OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Canonical showcase for readonly, password, autocomplete, address, phone, temporal, and repeated grouped fields.
Source Definition
import { fromZod } from '@lssm-tech/lib.schema';
import { z } from 'zod';
import { OwnersEnum, StabilityEnum, TagsEnum } from '../ownership';
import type { AddressFormValue, PhoneFormValue } from './forms';
import { defineFormSpec } from './forms';
export const RichFieldsShowcaseForm = defineFormSpec({
meta: {
key: 'forms.rich-fields-showcase',
version: '1.0.0',
title: 'Rich Fields Showcase',
description:
'Canonical showcase for readonly, password, autocomplete, address, phone, temporal, and repeated grouped fields.',
domain: 'forms',
owners: [OwnersEnum.PlatformCore],
tags: [TagsEnum.Docs, 'forms', 'showcase'],
stability: StabilityEnum.Experimental,
},
model: RichFieldsShowcaseModel,
fields: [
{
kind: 'text',
name: 'recordId',
labelI18n: 'Record ID',
readOnly: true,
},
{
kind: 'select',
name: 'status',
labelI18n: 'Status',
options: {
kind: 'static',
options: [
{ labelI18n: 'Draft', value: 'draft' },
{ labelI18n: 'Ready', value: 'ready' },
{ labelI18n: 'Published', value: 'published' },
],
},
},
{
kind: 'autocomplete',
name: 'reviewer',
labelI18n: 'Reviewer',
placeholderI18n: 'Search a reviewer',
source: {
kind: 'local',
searchKeys: ['id', 'name', 'email'],
options: [
{
labelI18n: 'Alice Martin',
value: 'usr_1',
data: {
id: 'usr_1',
name: 'Alice Martin',
email: 'alice@example.com',
},
},
{
labelI18n: 'Bob Chen',
value: 'usr_2',
data: { id: 'usr_2', name: 'Bob Chen', email: 'bob@example.com' },
},
],
},
valueMapping: { mode: 'object' },
},
{ kind: 'address', name: 'address', labelI18n: 'Address' },
{ kind: 'phone', name: 'phone', labelI18n: 'Phone' },
{ kind: 'date', name: 'startDate', labelI18n: 'Start date' },
{
kind: 'time',
name: 'startTime',
labelI18n: 'Start time',
is24Hour: true,
},
{
kind: 'datetime',
name: 'publishedAt',
labelI18n: 'Published at',
is24Hour: true,
},
{
kind: 'array',
name: 'contacts',
labelI18n: 'Contacts',
min: 1,
of: {
kind: 'group',
fields: [
{ kind: 'text', name: 'label', labelI18n: 'Label' },
{ kind: 'text', name: 'value', labelI18n: 'Value' },
],
},
},
],
actions: [{ key: 'submit', labelI18n: 'Save' }],
policy: { flags: [], pii: ['address', 'phone'] },
renderHints: { ui: 'custom', form: 'react-hook-form' },
});