Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .changeset/6122-action-prop-renames.md
Original file line numberDiff line numberDiff line change
@@ -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.
8 changes: 5 additions & 3 deletions content/docs/components/feedback/toast.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/docs/components/form/combobox.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,7 +41,7 @@ interface ComboboxSchema {
emptyText?: string; // Text when no results

// Events
onValueChange?: string | ActionConfig;
onChange?: (value: string) => void;

// States
disabled?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion content/docs/components/form/command.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,7 @@ interface CommandSchema {
emptyText?: string; // Text when no results

// Events
onSelect?: string | ActionConfig;
onChange?: (value: string) => void;

// Styling
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion content/docs/components/form/date-picker.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,7 @@ interface DatePickerSchema {
placeholder?: string; // Placeholder text

// Events
onDateChange?: string | ActionConfig;
onChange?: (date: Date | undefined) => void;

// States
disabled?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion content/docs/components/form/radio-group.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,7 @@ interface RadioGroupSchema {
direction?: 'vertical' | 'horizontal';

// Events
onValueChange?: string | ActionConfig;
onChange?: (value: string | number) => void;

// States
disabled?: boolean;
Expand Down