Skip to content
Draft
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
59 changes: 59 additions & 0 deletions .changeset/6132-undeclared-action-props.md
Original file line number Diff line number Diff line change
@@ -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).
3 changes: 0 additions & 3 deletions content/docs/components/basic/button-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ interface ButtonGroupSchema {
variant?: 'default' | 'outline' | 'ghost';
size?: 'sm' | 'default' | 'lg';

// Events
onValueChange?: string | ActionConfig;

// States
disabled?: boolean;

Expand Down
6 changes: 0 additions & 6 deletions content/docs/components/feedback/sonner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
```

Expand Down
6 changes: 5 additions & 1 deletion content/docs/components/overlay/context-menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
8 changes: 5 additions & 3 deletions content/docs/components/overlay/dropdown-menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@ interface DropdownMenuItem {
variant?: 'default' | 'destructive';
type?: 'separator';
disabled?: boolean;
onClick?: () => void; // Item click handler
}

interface DropdownMenuSchema {
type: 'dropdown-menu';
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`.
8 changes: 5 additions & 3 deletions content/docs/components/overlay/menubar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface MenubarItem {
shortcut?: string[];
type?: 'separator';
disabled?: boolean;
onClick?: () => void; // Item click handler
}

interface MenubarMenu {
Expand All @@ -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`.