From cb56e5ae1919f28c52fb6ab498729d3f75ddcf1f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 25 Aug 2026 14:29:30 +0000 Subject: [PATCH] docs(components): follow the shipped types on the last five action props The five `content/docs/components` pages that objectui#6122 measured as having NO declared slot at all are corrected against the built `packages/types/dist`. Maintainer ruled Option A on 2026-08-25: documentation follows the shipped types. Two remedies, because the cases differ: Deleted, nothing declares them at any level: * feedback/sonner.mdx action?: { label; onClick } -- SonnerSchema has no `action` (src/feedback.ts:204); the renderer reads only message/title/ description/variant/buttonLabel/buttonVariant/className. * basic/button-group.mdx onValueChange -- ButtonGroupSchema declares only type/buttons/variant/size (src/navigation.ts:335). `ButtonGroupButton` does declare `onClick`, but a per-button click is not a group-level selection-change, so this is a deletion and not a redirect. Redirected, the real slot is one level down on the item: * overlay/context-menu.mdx, overlay/dropdown-menu.mdx, overlay/menubar.mdx documented a menu-level `onSelect`; no menu schema declares any event slot (DropdownMenuSchema declares `onOpenChange` and nothing else). `MenuItem` declares `onClick?: () => void` at src/overlay.ts:346, built at dist/overlay.d.ts:334 -- the exact line the card cited -- and mirrored in Zod at src/zod/overlay.zod.ts:136. `MenuItem` is the element type of all three `items` arrays, so one declaration serves all three pages. The `string |` half goes with the name: objectui#4453 narrowed the runtime to `typeof === 'function'`, so an authored string handler is dropped. No type was minted. No fence moved: the five pages hold 10 `plaintext` fence markers before and after, leaving objectui#5867's SHRINK-ONLY population at 80 files / 93 blocks. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012CZgmFFzqA9cX8tBMhvpFe --- .changeset/6132-undeclared-action-props.md | 59 +++++++++++++++++++ .../docs/components/basic/button-group.mdx | 3 - content/docs/components/feedback/sonner.mdx | 6 -- .../docs/components/overlay/context-menu.mdx | 6 +- .../docs/components/overlay/dropdown-menu.mdx | 8 ++- content/docs/components/overlay/menubar.mdx | 8 ++- 6 files changed, 74 insertions(+), 16 deletions(-) create mode 100644 .changeset/6132-undeclared-action-props.md diff --git a/.changeset/6132-undeclared-action-props.md b/.changeset/6132-undeclared-action-props.md new file mode 100644 index 0000000000..dac7317f6c --- /dev/null +++ b/.changeset/6132-undeclared-action-props.md @@ -0,0 +1,59 @@ +--- +--- + +Docs only, publishes nothing: the last five `content/docs/components` reference +pages annotating an event prop as `string | ActionConfig` are corrected. These +are the five objectui#6122 measured as having **no declared slot at all** (the +other eleven were renamed in #6130/#6142), and the maintainer ruled Option A on +2026-08-25: documentation follows the shipped types. + +Two different remedies, because the two cases are not the same defect: + +**Deleted — nothing declares them, at any level:** + +| page | documented prop | shipped type | +| --- | --- | --- | +| `feedback/sonner.mdx` | `action?: { label; onClick }` | `SonnerSchema` declares no `action` (`packages/types/src/feedback.ts:204`) | +| `basic/button-group.mdx` | `onValueChange` | `ButtonGroupSchema` declares only `type`/`buttons`/`variant`/`size` (`packages/types/src/navigation.ts:335`) | + +**Redirected — the real slot is one level down, on the item:** + +`overlay/context-menu.mdx`, `overlay/dropdown-menu.mdx` and `overlay/menubar.mdx` +documented a menu-level `onSelect`. None of the three menu schemas declares any +event slot (`DropdownMenuSchema` declares `onOpenChange` and nothing else). The +handler is declared on the **item**, and that declaration is real: + +```ts +// packages/types/src/overlay.ts:330-357 (jsdoc elided except on onClick) +// built: packages/types/dist/overlay.d.ts:334 -- the line objectui#6132 cited +export interface MenuItem { + label: string; + icon?: string; + disabled?: boolean; + /** + * Click handler + */ + onClick?: () => void; + shortcut?: string; + children?: MenuItem[]; + separator?: boolean; +} +``` + +declared at `packages/types/src/overlay.ts:346` and mirrored in Zod at +`packages/types/src/zod/overlay.zod.ts:136` +(`onClick: z.function().optional().describe('Click handler')`). `MenuItem` is the +element type of `DropdownMenuSchema.items`, `ContextMenuSchema.items` and +`MenubarMenu.items`, so all three pages redirect to the same declaration rather +than losing the capability. + +The `string |` half goes with the name in every case: objectui#4453 narrowed the +runtime to `typeof === 'function'`, so an authored string handler is dropped. A +reference page promising `string | Fn` is what makes an AI author emit a handler +that validates, publishes, and silently does nothing. + +No type was minted to make the prose true, and no fence moved: the five pages +hold 10 `plaintext` fence markers before and after, so objectui#5867's +SHRINK-ONLY declared population is unchanged. + +Part of objectui#6132 (maintainer ruling of 2026-08-25, Option A). diff --git a/content/docs/components/basic/button-group.mdx b/content/docs/components/basic/button-group.mdx index 5308886028..44d814ab63 100644 --- a/content/docs/components/basic/button-group.mdx +++ b/content/docs/components/basic/button-group.mdx @@ -43,9 +43,6 @@ interface ButtonGroupSchema { variant?: 'default' | 'outline' | 'ghost'; size?: 'sm' | 'default' | 'lg'; - // Events - onValueChange?: string | ActionConfig; - // States disabled?: boolean; diff --git a/content/docs/components/feedback/sonner.mdx b/content/docs/components/feedback/sonner.mdx index d3867eebab..f051863109 100644 --- a/content/docs/components/feedback/sonner.mdx +++ b/content/docs/components/feedback/sonner.mdx @@ -33,12 +33,6 @@ interface SonnerSchema { description?: string; // Additional description variant?: 'default' | 'success' | 'error' | 'warning' | 'info'; duration?: number; // Auto-close duration (ms) - - // Action - action?: { - label: string; - onClick: string | ActionConfig; - }; } ``` diff --git a/content/docs/components/overlay/context-menu.mdx b/content/docs/components/overlay/context-menu.mdx index 2ca05f8d6f..75d4745a00 100644 --- a/content/docs/components/overlay/context-menu.mdx +++ b/content/docs/components/overlay/context-menu.mdx @@ -27,13 +27,17 @@ interface ContextMenuItem { icon?: string; // kebab-case Lucide icon name (e.g. "trash") type?: 'separator'; disabled?: boolean; + onClick?: () => void; // Item click handler } interface ContextMenuSchema { type: 'context-menu'; trigger: ComponentSchema; // Trigger element items: ContextMenuItem[]; // Menu items - onSelect?: string | ActionConfig; className?: string; } ``` + +Handlers are declared on the **item**, not on the menu: the shipped `MenuItem` +declares `onClick?: () => void`. The menu schema itself declares no event slot, +so there is no menu-level `onSelect`. diff --git a/content/docs/components/overlay/dropdown-menu.mdx b/content/docs/components/overlay/dropdown-menu.mdx index 040e115b3d..013e62ae22 100644 --- a/content/docs/components/overlay/dropdown-menu.mdx +++ b/content/docs/components/overlay/dropdown-menu.mdx @@ -31,6 +31,7 @@ interface DropdownMenuItem { variant?: 'default' | 'destructive'; type?: 'separator'; disabled?: boolean; + onClick?: () => void; // Item click handler } interface DropdownMenuSchema { @@ -38,10 +39,11 @@ interface DropdownMenuSchema { trigger: ComponentSchema; // Trigger component items: DropdownMenuItem[]; // Menu items - // Events - onSelect?: string | ActionConfig; - // Styling className?: string; } ``` + +Handlers are declared on the **item**, not on the menu: the shipped `MenuItem` +declares `onClick?: () => void`. The menu schema itself declares no event slot, +so there is no menu-level `onSelect`. diff --git a/content/docs/components/overlay/menubar.mdx b/content/docs/components/overlay/menubar.mdx index 3c53944aa4..f2a4111a32 100644 --- a/content/docs/components/overlay/menubar.mdx +++ b/content/docs/components/overlay/menubar.mdx @@ -19,6 +19,7 @@ interface MenubarItem { shortcut?: string[]; type?: 'separator'; disabled?: boolean; + onClick?: () => void; // Item click handler } interface MenubarMenu { @@ -30,10 +31,11 @@ interface MenubarSchema { type: 'menubar'; menus: MenubarMenu[]; // Menu definitions - // Events - onSelect?: string | ActionConfig; - // Styling className?: string; } ``` + +Handlers are declared on the **item**, not on the menu: the shipped `MenuItem` +declares `onClick?: () => void`. The menu schema itself declares no event slot, +so there is no menu-level `onSelect`.