diff --git a/.changeset/6122-action-prop-renames.md b/.changeset/6122-action-prop-renames.md new file mode 100644 index 0000000000..d99824e289 --- /dev/null +++ b/.changeset/6122-action-prop-renames.md @@ -0,0 +1,29 @@ +--- +--- + +Docs only, publishes nothing: five `content/docs/components` reference pages +annotated an event prop as `string | ActionConfig` — a type `@object-ui/types` +has never exported. Each site was resolved individually against the freshly +built `packages/types/dist/*.d.ts`, and in every case the shipped slot is a +plain function callback that the page had also named wrongly: + +| page | documented | shipped slot | declaration | +| --- | --- | --- | --- | +| `form/command.mdx` | `onSelect` | `onChange?: (value: string) => void` | `form.d.ts:1376` | +| `form/radio-group.mdx` | `onValueChange` | `onChange?: (value: string \| number) => void` | `form.d.ts:394` | +| `form/date-picker.mdx` | `onDateChange` | `onChange?: (date: Date \| undefined) => void` | `form.d.ts:642` | +| `form/combobox.mdx` | `onValueChange` | `onChange?: (value: string) => void` | `form.d.ts:1324` | +| `feedback/toast.mdx` | `actionLabel` + `onAction` | `action?: { label: string; onClick: () => void }` | `feedback.d.ts:137` | + +The `string |` half of each annotation goes with the name, and that is the +substance rather than a tidy-up: objectui#4453 narrowed the runtime to +`typeof === 'function'`, so an authored string handler is **dropped** +(`packages/plugin-calendar/src/calendar-view-renderer.tsx`). A reference page +promising `string | Fn` is exactly what makes an AI author emit a handler that +publishes, validates, and silently does nothing. + +No type was minted to make the prose true. Measured with a throwaway re-fence +probe: `TS2304: Cannot find name 'ActionConfig'` **10 → 5** across the +`components` group, and the 5 that remain are objectui#6132's, untouched here. + +Part of objectui#6122. diff --git a/content/docs/components/feedback/toast.mdx b/content/docs/components/feedback/toast.mdx index 5da45f5afe..c00c17e884 100644 --- a/content/docs/components/feedback/toast.mdx +++ b/content/docs/components/feedback/toast.mdx @@ -31,9 +31,11 @@ interface ToastSchema { description?: string; // Toast message variant?: 'default' | 'destructive'; - // Action - actionLabel?: string; // Action button label - onAction?: string | ActionConfig; + // Action button + action?: { + label: string; + onClick: () => void; + }; // Timing duration?: number; // Auto-dismiss time in ms diff --git a/content/docs/components/form/combobox.mdx b/content/docs/components/form/combobox.mdx index ef658d634f..a9bf345361 100644 --- a/content/docs/components/form/combobox.mdx +++ b/content/docs/components/form/combobox.mdx @@ -41,7 +41,7 @@ interface ComboboxSchema { emptyText?: string; // Text when no results // Events - onValueChange?: string | ActionConfig; + onChange?: (value: string) => void; // States disabled?: boolean; diff --git a/content/docs/components/form/command.mdx b/content/docs/components/form/command.mdx index e40f51e278..f475a19e43 100644 --- a/content/docs/components/form/command.mdx +++ b/content/docs/components/form/command.mdx @@ -31,7 +31,7 @@ interface CommandSchema { emptyText?: string; // Text when no results // Events - onSelect?: string | ActionConfig; + onChange?: (value: string) => void; // Styling className?: string; diff --git a/content/docs/components/form/date-picker.mdx b/content/docs/components/form/date-picker.mdx index 8d2a79823f..34d195b50f 100644 --- a/content/docs/components/form/date-picker.mdx +++ b/content/docs/components/form/date-picker.mdx @@ -31,7 +31,7 @@ interface DatePickerSchema { placeholder?: string; // Placeholder text // Events - onDateChange?: string | ActionConfig; + onChange?: (date: Date | undefined) => void; // States disabled?: boolean; diff --git a/content/docs/components/form/radio-group.mdx b/content/docs/components/form/radio-group.mdx index b3817c8174..43acc4cb4f 100644 --- a/content/docs/components/form/radio-group.mdx +++ b/content/docs/components/form/radio-group.mdx @@ -47,7 +47,7 @@ interface RadioGroupSchema { direction?: 'vertical' | 'horizontal'; // Events - onValueChange?: string | ActionConfig; + onChange?: (value: string | number) => void; // States disabled?: boolean;