Skip to content

Commit 20bdd34

Browse files
committed
feat(page,element): declare inputs for the eight configurable page:*/element:* blocks
Same gap #3027 closed for record:*, in the two namespaces next door: renderers that read real props while every authoring surface reported "takes no configuration". Declarations mirror what each renderer reads — page:tabs items, tabStyle (line/card/pill), position (top/left) page:card title, bordered, body (slot), footer (slot) page:accordion items, allowMultiple, variant (flush/card) element:text content, variant, align element:number object, aggregate, field, filter, format, prefix, suffix element:button label, action (inline ActionDef), variant, size, icon, iconPosition, disabled element:definition-list items, columns, inline element:repeater object, titleField, fields, filter, sort, limit, emptyText, divided page:section, page:footer and page:sidebar stay at zero inputs on purpose: their renderers render children/body and nothing else — like element:divider, they are genuinely prop-less containers, and inventing inputs for them would be the opposite falsehood. aria and className stay undeclared throughout, per the convention on record:details: escape hatches and styling pass-throughs, not authoring choices. element:button's registration also documents the split against action:button — inline ActionDef vs a declared action referenced by name — so the two stop reading as duplicates. Declaration only; no renderer behavior changes. Curation (which of these join PUBLIC_BLOCKS) is a separate change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N4mrr1ihhwnfEHFSWmGoMp
1 parent a149e90 commit 20bdd34

4 files changed

Lines changed: 91 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
"@object-ui/components": patch
3+
---
4+
5+
feat(page,element): declare inputs for the eight configurable page:\* / element:\* blocks
6+
7+
Same gap objectui#3027 closed for `record:*`, in the two namespaces next door:
8+
renderers that read real props while every authoring surface reported "takes no
9+
configuration". Declarations mirror what each renderer reads —
10+
11+
| block | inputs |
12+
|---|---|
13+
| `page:tabs` | items, tabStyle (line/card/pill), position (top/left) |
14+
| `page:card` | title, bordered, body (slot), footer (slot) |
15+
| `page:accordion` | items, allowMultiple, variant (flush/card) |
16+
| `element:text` | content, variant (heading/subheading/body/caption), align |
17+
| `element:number` | object, aggregate (count/sum/avg/min/max), field, filter, format, prefix, suffix |
18+
| `element:button` | label, action (inline ActionDef), variant, size, icon, iconPosition, disabled |
19+
| `element:definition-list` | items, columns, inline |
20+
| `element:repeater` | object, titleField, fields, filter, sort, limit, emptyText, divided |
21+
22+
`page:section`, `page:footer` and `page:sidebar` are left at zero inputs on
23+
purpose: their renderers render `children`/`body` and nothing else — like
24+
`element:divider`, they are genuinely prop-less containers, and inventing
25+
inputs for them would be the opposite falsehood.
26+
27+
`aria` and `className` stay undeclared throughout, per the convention on
28+
`record:details`: escape hatches and styling pass-throughs, not authoring
29+
choices. `element:button`'s registration also documents the split against
30+
`action:button` — inline ActionDef vs a declared action referenced by name —
31+
so the two stop reading as duplicates.
32+
33+
Declaration only; no renderer behavior changes. Curation (which of these join
34+
`PUBLIC_BLOCKS`) is a separate change.

packages/components/src/renderers/basic/data-list.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ ComponentRegistry.register('definition-list', DefinitionListRenderer, {
8282
skipFallback: true,
8383
label: 'Definition List',
8484
category: 'content',
85+
inputs: [
86+
{ name: 'items', type: 'array', label: 'Items', required: true, description: 'Term/description pairs [{ term, description }]' },
87+
{ name: 'columns', type: 'enum', label: 'Columns', enum: ['1', '2'], defaultValue: '1' },
88+
{ name: 'inline', type: 'boolean', label: 'Inline', description: 'Term and description on one baseline-aligned row' },
89+
],
8590
});
8691

8792
// ---------------------------------------------------------------------------
@@ -178,4 +183,14 @@ ComponentRegistry.register('repeater', RepeaterRenderer, {
178183
skipFallback: true,
179184
label: 'Repeater',
180185
category: 'content',
186+
inputs: [
187+
{ name: 'object', type: 'string', label: 'Object', required: true, description: 'Object whose records the list repeats over' },
188+
{ name: 'titleField', type: 'string', label: 'Title Field' },
189+
{ name: 'fields', type: 'array', label: 'Fields', description: 'Columns per row — bare names or { field, label? }' },
190+
{ name: 'filter', type: 'array', label: 'Filter' },
191+
{ name: 'sort', type: 'array', label: 'Sort' },
192+
{ name: 'limit', type: 'number', label: 'Limit' },
193+
{ name: 'emptyText', type: 'string', label: 'Empty Text' },
194+
{ name: 'divided', type: 'boolean', label: 'Divided', description: 'Separator between rows' },
195+
],
181196
});

packages/components/src/renderers/basic/elements.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ ComponentRegistry.register('text', ElementTextRenderer, {
9797
skipFallback: true,
9898
label: 'Text',
9999
category: 'content',
100+
inputs: [
101+
{ name: 'content', type: 'string', label: 'Content', required: true, description: 'Accepts an inline translation map ({ en, "zh-CN", … })' },
102+
{ name: 'variant', type: 'enum', label: 'Variant', enum: ['heading', 'subheading', 'body', 'caption'], defaultValue: 'body' },
103+
{ name: 'align', type: 'enum', label: 'Align', enum: ['left', 'center', 'right'], defaultValue: 'left' },
104+
],
100105
});
101106

102107
// ---------------------------------------------------------------------------
@@ -268,6 +273,18 @@ ComponentRegistry.register('button', ElementButtonRenderer, {
268273
skipFallback: true,
269274
label: 'Button',
270275
category: 'action',
276+
// Distinct from `action:button`, which references a DECLARED action by name
277+
// and gates on visible/enabled predicates. This one carries an inline
278+
// ActionDef — the standalone-page button.
279+
inputs: [
280+
{ name: 'label', type: 'string', label: 'Label', required: true, description: 'Accepts an inline translation map ({ en, "zh-CN", … })' },
281+
{ name: 'action', type: 'object', label: 'Action', description: 'Inline ActionDef executed on click (url / navigation / api / script / modal / flow); omitted → renders inert' },
282+
{ name: 'variant', type: 'enum', label: 'Variant', enum: ['primary', 'secondary', 'danger', 'ghost', 'link'], defaultValue: 'primary' },
283+
{ name: 'size', type: 'enum', label: 'Size', enum: ['small', 'medium', 'large'], defaultValue: 'medium' },
284+
{ name: 'icon', type: 'string', label: 'Icon', description: 'Lucide icon name' },
285+
{ name: 'iconPosition', type: 'enum', label: 'Icon Position', enum: ['left', 'right'], defaultValue: 'left' },
286+
{ name: 'disabled', type: 'boolean', label: 'Disabled' },
287+
],
271288
});
272289

273290
// ---------------------------------------------------------------------------
@@ -390,4 +407,13 @@ ComponentRegistry.register('number', ElementNumberRenderer, {
390407
skipFallback: true,
391408
label: 'Number',
392409
category: 'content',
410+
inputs: [
411+
{ name: 'object', type: 'string', label: 'Object', required: true, description: 'Object the aggregate runs over' },
412+
{ name: 'aggregate', type: 'enum', label: 'Aggregate', enum: ['count', 'sum', 'avg', 'min', 'max'], required: true },
413+
{ name: 'field', type: 'string', label: 'Field', description: 'Measure field (required for every aggregate except count)' },
414+
{ name: 'filter', type: 'array', label: 'Filter' },
415+
{ name: 'format', type: 'enum', label: 'Format', enum: ['number', 'currency', 'percent'], defaultValue: 'number' },
416+
{ name: 'prefix', type: 'string', label: 'Prefix' },
417+
{ name: 'suffix', type: 'string', label: 'Suffix' },
418+
],
393419
});

packages/components/src/renderers/layout/containers.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,11 @@ ComponentRegistry.register('tabs', PageTabsRenderer, {
559559
label: 'Page Tabs',
560560
category: 'layout',
561561
isContainer: true,
562+
inputs: [
563+
{ name: 'items', type: 'array', label: 'Tabs', required: true, description: 'Tab definitions [{ label, value?, icon?, count?, visibleWhen?, children }] — value is the stable ?tab= URL token, count auto-derives from record:related_list descendants when omitted' },
564+
{ name: 'tabStyle', type: 'enum', label: 'Style', enum: ['line', 'card', 'pill'], defaultValue: 'line' },
565+
{ name: 'position', type: 'enum', label: 'Position', enum: ['top', 'left'], defaultValue: 'top' },
566+
],
562567
});
563568

564569
// ---------------------------------------------------------------------------
@@ -602,6 +607,12 @@ ComponentRegistry.register('card', PageCardRenderer, {
602607
label: 'Page Card',
603608
category: 'layout',
604609
isContainer: true,
610+
inputs: [
611+
{ name: 'title', type: 'string', label: 'Title', description: 'Accepts an inline translation map ({ en, "zh-CN", … })' },
612+
{ name: 'bordered', type: 'boolean', label: 'Bordered', defaultValue: true },
613+
{ name: 'body', type: 'slot', label: 'Body', description: 'Card content; plain `children` also render here' },
614+
{ name: 'footer', type: 'slot', label: 'Footer' },
615+
],
605616
});
606617

607618
// ---------------------------------------------------------------------------
@@ -683,6 +694,11 @@ ComponentRegistry.register('accordion', PageAccordionRenderer, {
683694
label: 'Page Accordion',
684695
category: 'layout',
685696
isContainer: true,
697+
inputs: [
698+
{ name: 'items', type: 'array', label: 'Panels', required: true, description: 'Panel definitions [{ label, collapsed?, children }] — collapsed: false opens a panel by default' },
699+
{ name: 'allowMultiple', type: 'boolean', label: 'Allow Multiple Open', defaultValue: false },
700+
{ name: 'variant', type: 'enum', label: 'Variant', enum: ['flush', 'card'], defaultValue: 'flush' },
701+
],
686702
});
687703

688704
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)