@agentero/design-system 0.24.3 → 0.24.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mcp/manifests/components.html +1714 -1001
- package/mcp/manifests/components.json +6985 -1
- package/mcp/server.mjs +3921 -2320
- package/package.json +1 -1
- package/src/accordion/accordion.d.ts +35 -23
- package/src/accordion/accordion.js +1 -8
- package/src/accordion/index.d.ts +18 -1
- package/src/accordion/index.js +10 -2
- package/src/avatar-group/avatar-group.d.ts +2 -0
- package/src/avatar-group/avatar-group.js +0 -1
- package/src/button/button.js +0 -1
- package/src/check-list/check-list.d.ts +15 -14
- package/src/check-list/check-list.js +1 -6
- package/src/check-list/index.d.ts +11 -1
- package/src/check-list/index.js +8 -2
- package/src/command/command.d.ts +117 -43
- package/src/command/command.js +1 -9
- package/src/command/index.d.ts +86 -1
- package/src/command/index.js +12 -2
- package/src/data-table/data-table.d.ts +81 -46
- package/src/data-table/data-table.js +71 -78
- package/src/data-table/index.d.ts +175 -2
- package/src/data-table/index.js +22 -3
- package/src/data-table/table.d.ts +107 -44
- package/src/data-table/table.js +1 -12
- package/src/divider/divider.js +0 -1
- package/src/dropdown-menu/dropdown-menu.d.ts +254 -136
- package/src/dropdown-menu/dropdown-menu.js +1 -14
- package/src/dropdown-menu/index.d.ts +51 -1
- package/src/dropdown-menu/index.js +16 -2
- package/src/hover-card/hover-card.d.ts +40 -26
- package/src/hover-card/hover-card.js +1 -9
- package/src/hover-card/index.d.ts +20 -1
- package/src/hover-card/index.js +11 -2
- package/src/label/label.js +0 -1
- package/src/modal/index.d.ts +38 -1
- package/src/modal/index.js +14 -2
- package/src/modal/modal.d.ts +125 -81
- package/src/modal/modal.js +1 -11
- package/src/popover/index.d.ts +24 -1
- package/src/popover/index.js +12 -2
- package/src/popover/popover.d.ts +30 -30
- package/src/popover/popover.js +1 -10
- package/src/skeleton/skeleton.js +0 -1
- package/src/tag/tag.js +0 -1
- package/src/validation-list/validation-list.d.ts +2 -0
- package/src/validation-list/validation-list.js +0 -1
|
@@ -84,56 +84,119 @@ type TableVariants = VariantProps<typeof tableRecipe>;
|
|
|
84
84
|
export type TableRootProps = TableVariants & {
|
|
85
85
|
ref?: Ref<HTMLDivElement>;
|
|
86
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* The outermost part of the low-level presentational table primitive — a thin
|
|
89
|
+
* themed wrapper over native `<table>` markup (scrolling, sticky rows, row
|
|
90
|
+
* sizing, dividers, hover, expandable rows). It renders the scroll viewport and
|
|
91
|
+
* `<table>`, shares variants with the other parts via context, and forwards
|
|
92
|
+
* `ref` to the scroll container. The viewport fills its (bounded) parent — cap
|
|
93
|
+
* height by constraining that parent.
|
|
94
|
+
*
|
|
95
|
+
* Compose `Root` with `Head` / `Body` / `Row` / `Header` / `Cell`, plus
|
|
96
|
+
* `ExpandButton` / `ExpandedRow` and `RowActions`. For sorting, toolbar and
|
|
97
|
+
* pagination, prefer `DataTable`, which is built on top of this.
|
|
98
|
+
*
|
|
99
|
+
* @summary Table root that owns the scroll viewport and `<table>` element
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```tsx
|
|
103
|
+
* import { Table } from '@agentero/design-system/data-table';
|
|
104
|
+
*
|
|
105
|
+
* <Table.Root size="md" sticky="head">
|
|
106
|
+
* <Table.Head>
|
|
107
|
+
* <Table.Row>
|
|
108
|
+
* <Table.Header>Name</Table.Header>
|
|
109
|
+
* </Table.Row>
|
|
110
|
+
* </Table.Head>
|
|
111
|
+
* <Table.Body>
|
|
112
|
+
* <Table.Row>
|
|
113
|
+
* <Table.Cell>Jane Doe</Table.Cell>
|
|
114
|
+
* </Table.Row>
|
|
115
|
+
* </Table.Body>
|
|
116
|
+
* </Table.Root>
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare const TableRoot: {
|
|
120
|
+
({ children, ref, ...variants }: PropsWithChildren<TableRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
121
|
+
displayName: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* `<thead>` wrapper; group your header `Table.Row` here.
|
|
125
|
+
*
|
|
126
|
+
* @summary `<thead>` wrapper for header rows
|
|
127
|
+
*/
|
|
128
|
+
export declare const TableHead: {
|
|
129
|
+
({ children, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
130
|
+
displayName: string;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* `<tbody>` wrapper; the per-row treatment lives on `Table.Row`.
|
|
134
|
+
*
|
|
135
|
+
* @summary `<tbody>` wrapper
|
|
136
|
+
*/
|
|
137
|
+
export declare const TableBody: {
|
|
138
|
+
({ children, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
139
|
+
displayName: string;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* A table row (`<tr>`). In `Table.Body`, rows pick up dividers, hover, and the
|
|
143
|
+
* sticky-footer treatment from the `Table.Root` variants automatically.
|
|
144
|
+
*
|
|
145
|
+
* @summary Table row element
|
|
146
|
+
*/
|
|
147
|
+
export declare const TableRow: {
|
|
148
|
+
({ className, ...props }: ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
displayName: string;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* A header cell (`<th>`): tertiary, light-weight column label.
|
|
153
|
+
*
|
|
154
|
+
* @summary Header cell element
|
|
155
|
+
*/
|
|
156
|
+
export declare const TableHeader: {
|
|
157
|
+
({ className, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
158
|
+
displayName: string;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* A data cell (`<td>`). Row min-height follows the `Table.Root` `size` variant.
|
|
162
|
+
*
|
|
163
|
+
* @summary Data cell element
|
|
164
|
+
*/
|
|
165
|
+
export declare const TableCell: {
|
|
166
|
+
({ className, ...props }: PropsWithChildren<TdHTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
167
|
+
displayName: string;
|
|
168
|
+
};
|
|
87
169
|
type TableExpandButtonProps = {
|
|
88
170
|
toggleExpanded: () => void;
|
|
89
171
|
isExpanded: boolean;
|
|
90
172
|
} & ButtonProps;
|
|
91
173
|
/**
|
|
92
|
-
*
|
|
93
|
-
* `<table>` markup (scrolling, sticky rows, row sizing, dividers, hover,
|
|
94
|
-
* expandable rows). Compose from `Root` / `Head` / `Body` / `Row` / `Header` /
|
|
95
|
-
* `Cell`, plus `ExpandButton` / `ExpandedRow` and `RowActions`. For
|
|
96
|
-
* sorting/toolbar/pagination, prefer `DataTable`, built on top of this.
|
|
174
|
+
* Ghost icon button toggling an expandable row; the chevron rotates 180° while open.
|
|
97
175
|
*
|
|
98
|
-
* @summary
|
|
99
|
-
* @namespace Table
|
|
176
|
+
* @summary Expand/collapse toggle button for an expandable row
|
|
100
177
|
*/
|
|
101
|
-
export declare const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
displayName: string;
|
|
125
|
-
};
|
|
126
|
-
ExpandButton: {
|
|
127
|
-
({ toggleExpanded, isExpanded, className, ...props }: TableExpandButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
128
|
-
displayName: string;
|
|
129
|
-
};
|
|
130
|
-
ExpandedRow: {
|
|
131
|
-
({ className, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableRowElement>>): import("react/jsx-runtime").JSX.Element;
|
|
132
|
-
displayName: string;
|
|
133
|
-
};
|
|
134
|
-
RowActions: {
|
|
135
|
-
({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
136
|
-
displayName: string;
|
|
137
|
-
};
|
|
178
|
+
export declare const TableExpandButton: {
|
|
179
|
+
({ toggleExpanded, isExpanded, className, ...props }: TableExpandButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
180
|
+
displayName: string;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Full-width detail row revealed under its parent when expanded. Put content in
|
|
184
|
+
* a single `Table.Cell` with a matching `colSpan`.
|
|
185
|
+
*
|
|
186
|
+
* @summary Detail row shown under an expanded parent row
|
|
187
|
+
*/
|
|
188
|
+
export declare const TableExpandedRow: {
|
|
189
|
+
({ className, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableRowElement>>): import("react/jsx-runtime").JSX.Element;
|
|
190
|
+
displayName: string;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Inline action cluster pinned to the row's trailing edge; controls stay hidden
|
|
194
|
+
* until row hover (always visible on coarse-pointer devices).
|
|
195
|
+
*
|
|
196
|
+
* @summary Hover-revealed row action cluster
|
|
197
|
+
*/
|
|
198
|
+
export declare const TableRowActions: {
|
|
199
|
+
({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
200
|
+
displayName: string;
|
|
138
201
|
};
|
|
139
202
|
export {};
|
package/src/data-table/table.js
CHANGED
|
@@ -168,16 +168,5 @@ var E = r({ base: [
|
|
|
168
168
|
children: e
|
|
169
169
|
});
|
|
170
170
|
D.displayName = "Table.RowActions";
|
|
171
|
-
var O = {
|
|
172
|
-
Root: m,
|
|
173
|
-
Head: h,
|
|
174
|
-
Body: g,
|
|
175
|
-
Row: v,
|
|
176
|
-
Header: b,
|
|
177
|
-
Cell: S,
|
|
178
|
-
ExpandButton: w,
|
|
179
|
-
ExpandedRow: T,
|
|
180
|
-
RowActions: D
|
|
181
|
-
};
|
|
182
171
|
//#endregion
|
|
183
|
-
export {
|
|
172
|
+
export { g as TableBody, S as TableCell, w as TableExpandButton, T as TableExpandedRow, h as TableHead, b as TableHeader, m as TableRoot, v as TableRow, D as TableRowActions, c as tableRecipe };
|
package/src/divider/divider.js
CHANGED
|
@@ -11,6 +11,74 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
|
11
11
|
* @property {'ltr' | 'rtl'} [dir] - The reading direction of the dropdown menu when applicable. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode.
|
|
12
12
|
*/
|
|
13
13
|
type RootProps = ComponentProps<typeof DropdownMenuPrimitive.Root>;
|
|
14
|
+
/**
|
|
15
|
+
* Root container that holds every part of a DropdownMenu — the menu of
|
|
16
|
+
* secondary actions attached to a button or icon trigger: edit/duplicate/delete
|
|
17
|
+
* rows, account menus, overflow affordances, and nested submenus. It owns the
|
|
18
|
+
* open state (controlled via `open`/`onOpenChange` or uncontrolled via
|
|
19
|
+
* `defaultOpen`) and must wrap Trigger, Portal, and Content. Built on Radix
|
|
20
|
+
* UI's DropdownMenu primitive, so keyboard navigation, focus trapping,
|
|
21
|
+
* typeahead, and viewport-collision detection come for free.
|
|
22
|
+
*
|
|
23
|
+
* Fill the menu with `Item`, `Separator`, `Label`, and — for nested flows —
|
|
24
|
+
* `Sub` / `SubTrigger` / `SubContent`. Wrap content in `Portal` so the menu
|
|
25
|
+
* escapes ancestor `overflow:hidden` and z-index stacking contexts.
|
|
26
|
+
*
|
|
27
|
+
* Do **not** use DropdownMenu for primary navigation (use a real nav menu),
|
|
28
|
+
* for single-choice form input (use a `Select`), or for command palettes
|
|
29
|
+
* (use `Command`). For radio/checkbox-style toggles, use Radix's
|
|
30
|
+
* `CheckboxItem` / `RadioItem` primitives directly — those parts are not
|
|
31
|
+
* exposed here yet.
|
|
32
|
+
*
|
|
33
|
+
* @summary Root provider for a DropdownMenu's open state
|
|
34
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/dropdown-menu|Radix UI DropdownMenu}
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* import { DropdownMenu } from '@agentero/design-system/dropdown-menu';
|
|
39
|
+
*
|
|
40
|
+
* <DropdownMenu.Root>
|
|
41
|
+
* <DropdownMenu.Trigger>
|
|
42
|
+
* <IconMoreVert />
|
|
43
|
+
* </DropdownMenu.Trigger>
|
|
44
|
+
*
|
|
45
|
+
* <DropdownMenu.Portal>
|
|
46
|
+
* <DropdownMenu.Content side="bottom" align="end">
|
|
47
|
+
* <DropdownMenu.Label>Actions</DropdownMenu.Label>
|
|
48
|
+
*
|
|
49
|
+
* <DropdownMenu.Item onSelect={() => handleEdit()}>
|
|
50
|
+
* <IconEdit />
|
|
51
|
+
* Edit
|
|
52
|
+
* </DropdownMenu.Item>
|
|
53
|
+
*
|
|
54
|
+
* <DropdownMenu.Sub>
|
|
55
|
+
* <DropdownMenu.SubTrigger>Share</DropdownMenu.SubTrigger>
|
|
56
|
+
* <DropdownMenu.Portal>
|
|
57
|
+
* <DropdownMenu.SubContent>
|
|
58
|
+
* <DropdownMenu.Item>Email</DropdownMenu.Item>
|
|
59
|
+
* <DropdownMenu.Item>Slack</DropdownMenu.Item>
|
|
60
|
+
* </DropdownMenu.SubContent>
|
|
61
|
+
* </DropdownMenu.Portal>
|
|
62
|
+
* </DropdownMenu.Sub>
|
|
63
|
+
*
|
|
64
|
+
* <DropdownMenu.Separator />
|
|
65
|
+
*
|
|
66
|
+
* <DropdownMenu.Item
|
|
67
|
+
* onSelect={() => handleDelete()}
|
|
68
|
+
* disabled={!canDelete}
|
|
69
|
+
* >
|
|
70
|
+
* <IconDelete />
|
|
71
|
+
* Delete
|
|
72
|
+
* </DropdownMenu.Item>
|
|
73
|
+
* </DropdownMenu.Content>
|
|
74
|
+
* </DropdownMenu.Portal>
|
|
75
|
+
* </DropdownMenu.Root>
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare const Root: {
|
|
79
|
+
(props: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
displayName: string;
|
|
81
|
+
};
|
|
14
82
|
/**
|
|
15
83
|
* Props for the DropdownMenu Trigger component.
|
|
16
84
|
*
|
|
@@ -21,6 +89,42 @@ type RootProps = ComponentProps<typeof DropdownMenuPrimitive.Root>;
|
|
|
21
89
|
* @dataAttribute {string} data-disabled - Present when disabled
|
|
22
90
|
*/
|
|
23
91
|
type TriggerProps = ComponentProps<typeof DropdownMenuPrimitive.Trigger>;
|
|
92
|
+
/**
|
|
93
|
+
* Button that toggles the DropdownMenu open/closed. Pass `asChild` to
|
|
94
|
+
* delegate rendering to a custom element (e.g. a `Button`) while inheriting
|
|
95
|
+
* Radix's accessibility wiring.
|
|
96
|
+
*
|
|
97
|
+
* @summary Toggle button that opens the DropdownMenu
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* <DropdownMenu.Trigger asChild>
|
|
102
|
+
* <Button variant="secondary">Open</Button>
|
|
103
|
+
* </DropdownMenu.Trigger>
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare const Trigger: {
|
|
107
|
+
({ className, ...props }: TriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
displayName: string;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Portals Content out of the DOM subtree to `document.body` (or a custom
|
|
112
|
+
* `container`) so the menu escapes ancestor `overflow:hidden` and z-index
|
|
113
|
+
* stacking contexts. Always wrap `Content` and `SubContent` in a Portal.
|
|
114
|
+
*
|
|
115
|
+
* @summary Portals DropdownMenu content to the body to escape stacking contexts
|
|
116
|
+
*
|
|
117
|
+
* @property {boolean} [forceMount] - Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
|
|
118
|
+
* @property {HTMLElement} [container=document.body] - Specify a container element to portal the content into.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```tsx
|
|
122
|
+
* <DropdownMenu.Portal>
|
|
123
|
+
* <DropdownMenu.Content>...</DropdownMenu.Content>
|
|
124
|
+
* </DropdownMenu.Portal>
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
export declare const Portal: import('react').FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
24
128
|
/**
|
|
25
129
|
* Tailwind variant styles for the dropdown menu content.
|
|
26
130
|
* Includes animations for slide-in/out based on the side from which the menu appears.
|
|
@@ -63,6 +167,27 @@ declare const contentStyles: import('tailwind-variants').TVReturnType<{
|
|
|
63
167
|
* @cssVariable --radix-dropdown-menu-content-available-height - The available height before overflow
|
|
64
168
|
*/
|
|
65
169
|
type ContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content> & VariantProps<typeof contentStyles>;
|
|
170
|
+
/**
|
|
171
|
+
* Floating surface that holds the menu items. Animates on open/close
|
|
172
|
+
* (direction follows `side`), performs collision detection so the menu
|
|
173
|
+
* stays within the viewport, and — when `hasTriggerWidth` is `true` —
|
|
174
|
+
* matches the trigger's width. Defaults: `sideOffset` is `8`,
|
|
175
|
+
* `hasTriggerWidth` is `false`.
|
|
176
|
+
*
|
|
177
|
+
* @summary Animated popover surface that contains the menu items
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```tsx
|
|
181
|
+
* <DropdownMenu.Content side="bottom" align="end" sideOffset={8}>
|
|
182
|
+
* <DropdownMenu.Item>Edit</DropdownMenu.Item>
|
|
183
|
+
* <DropdownMenu.Item>Delete</DropdownMenu.Item>
|
|
184
|
+
* </DropdownMenu.Content>
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
export declare const Content: {
|
|
188
|
+
({ className, hasTriggerWidth, sideOffset, ...props }: ContentProps): import("react/jsx-runtime").JSX.Element;
|
|
189
|
+
displayName: string;
|
|
190
|
+
};
|
|
66
191
|
/**
|
|
67
192
|
* Props for the DropdownMenu Item component.
|
|
68
193
|
*
|
|
@@ -75,18 +200,81 @@ type ContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content> & Varia
|
|
|
75
200
|
* @dataAttribute {string} data-disabled - Present when disabled
|
|
76
201
|
*/
|
|
77
202
|
type ItemProps = ComponentProps<typeof DropdownMenuPrimitive.Item>;
|
|
203
|
+
/**
|
|
204
|
+
* Selectable row inside the menu. Fires `onSelect` on click or keyboard
|
|
205
|
+
* activation; passing `disabled` greys the row and blocks interaction. Any
|
|
206
|
+
* leading `<svg>` is sized to 24px and tinted with the tertiary icon token.
|
|
207
|
+
*
|
|
208
|
+
* @summary Selectable menu row with hover + disabled styling
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* ```tsx
|
|
212
|
+
* <DropdownMenu.Item onSelect={() => handleEdit()}>
|
|
213
|
+
* <IconEdit />
|
|
214
|
+
* Edit
|
|
215
|
+
* </DropdownMenu.Item>
|
|
216
|
+
*
|
|
217
|
+
* <DropdownMenu.Item disabled>
|
|
218
|
+
* <IconDelete />
|
|
219
|
+
* Delete (unavailable)
|
|
220
|
+
* </DropdownMenu.Item>
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
export declare const Item: {
|
|
224
|
+
({ className, ...props }: ItemProps): import("react/jsx-runtime").JSX.Element;
|
|
225
|
+
displayName: string;
|
|
226
|
+
};
|
|
78
227
|
/**
|
|
79
228
|
* Props for the DropdownMenu Separator component.
|
|
80
229
|
*
|
|
81
230
|
* @property {string} [className] - Additional CSS classes to apply.
|
|
82
231
|
*/
|
|
83
232
|
type SeparatorProps = ComponentProps<typeof DropdownMenuPrimitive.Separator>;
|
|
233
|
+
/**
|
|
234
|
+
* Full-width horizontal rule that visually groups menu items — e.g. between
|
|
235
|
+
* an edit cluster and a destructive action. Extends past the content
|
|
236
|
+
* padding so the line meets the menu's edges.
|
|
237
|
+
*
|
|
238
|
+
* @summary Horizontal divider between groups of menu items
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```tsx
|
|
242
|
+
* <DropdownMenu.Item>Edit</DropdownMenu.Item>
|
|
243
|
+
* <DropdownMenu.Separator />
|
|
244
|
+
* <DropdownMenu.Item>Delete</DropdownMenu.Item>
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
export declare const Separator: {
|
|
248
|
+
({ className, ...props }: SeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
249
|
+
displayName: string;
|
|
250
|
+
};
|
|
84
251
|
/**
|
|
85
252
|
* Props for the DropdownMenu Label component.
|
|
86
253
|
*
|
|
87
254
|
* @property {string} [className] - Additional CSS classes to apply.
|
|
88
255
|
*/
|
|
89
256
|
type LabelProps = ComponentProps<typeof DropdownMenuPrimitive.Label>;
|
|
257
|
+
/**
|
|
258
|
+
* Non-interactive section heading. Use to label grouped items (e.g.
|
|
259
|
+
* "Profile", "Settings"). Not focusable and not announced as an item — the
|
|
260
|
+
* text reads as a group label to assistive tech.
|
|
261
|
+
*
|
|
262
|
+
* @summary Non-interactive section heading for grouped menu items
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```tsx
|
|
266
|
+
* <DropdownMenu.Label>Account Actions</DropdownMenu.Label>
|
|
267
|
+
* <DropdownMenu.Item>Profile</DropdownMenu.Item>
|
|
268
|
+
* <DropdownMenu.Item>Settings</DropdownMenu.Item>
|
|
269
|
+
* <DropdownMenu.Separator />
|
|
270
|
+
* <DropdownMenu.Label>Danger Zone</DropdownMenu.Label>
|
|
271
|
+
* <DropdownMenu.Item>Delete Account</DropdownMenu.Item>
|
|
272
|
+
* ```
|
|
273
|
+
*/
|
|
274
|
+
export declare const Label: {
|
|
275
|
+
({ className, ...props }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
276
|
+
displayName: string;
|
|
277
|
+
};
|
|
90
278
|
/**
|
|
91
279
|
* Props for the DropdownMenu Sub component.
|
|
92
280
|
*
|
|
@@ -95,6 +283,30 @@ type LabelProps = ComponentProps<typeof DropdownMenuPrimitive.Label>;
|
|
|
95
283
|
* @property {(open: boolean) => void} [onOpenChange] - Event handler called when the open state of the submenu changes.
|
|
96
284
|
*/
|
|
97
285
|
type SubProps = ComponentProps<typeof DropdownMenuPrimitive.Sub>;
|
|
286
|
+
/**
|
|
287
|
+
* Wrapper that groups a `SubTrigger` with its own `Portal` + `SubContent`.
|
|
288
|
+
* Lives inside a parent `Content`. Use sparingly — nest only when the extra
|
|
289
|
+
* depth meaningfully chunks actions; otherwise prefer a flat menu.
|
|
290
|
+
*
|
|
291
|
+
* @summary Groups a submenu's trigger and content
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```tsx
|
|
295
|
+
* <DropdownMenu.Sub>
|
|
296
|
+
* <DropdownMenu.SubTrigger>More Options</DropdownMenu.SubTrigger>
|
|
297
|
+
* <DropdownMenu.Portal>
|
|
298
|
+
* <DropdownMenu.SubContent>
|
|
299
|
+
* <DropdownMenu.Item>Sub Item 1</DropdownMenu.Item>
|
|
300
|
+
* <DropdownMenu.Item>Sub Item 2</DropdownMenu.Item>
|
|
301
|
+
* </DropdownMenu.SubContent>
|
|
302
|
+
* </DropdownMenu.Portal>
|
|
303
|
+
* </DropdownMenu.Sub>
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
export declare const Sub: {
|
|
307
|
+
(props: SubProps): import("react/jsx-runtime").JSX.Element;
|
|
308
|
+
displayName: string;
|
|
309
|
+
};
|
|
98
310
|
/**
|
|
99
311
|
* Props for the DropdownMenu SubTrigger component.
|
|
100
312
|
*
|
|
@@ -107,6 +319,33 @@ type SubProps = ComponentProps<typeof DropdownMenuPrimitive.Sub>;
|
|
|
107
319
|
* @dataAttribute {string} data-disabled - Present when disabled
|
|
108
320
|
*/
|
|
109
321
|
type SubTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>;
|
|
322
|
+
/**
|
|
323
|
+
* Row inside a parent `Content` that opens its submenu on hover or keyboard
|
|
324
|
+
* activation. Renders a trailing right-arrow affordance so the nested
|
|
325
|
+
* menu's existence is visible to users.
|
|
326
|
+
*
|
|
327
|
+
* @summary Submenu-opening menu row with a trailing arrow affordance
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```tsx
|
|
331
|
+
* <DropdownMenu.Sub>
|
|
332
|
+
* <DropdownMenu.SubTrigger>
|
|
333
|
+
* <IconFolder />
|
|
334
|
+
* Move to folder
|
|
335
|
+
* </DropdownMenu.SubTrigger>
|
|
336
|
+
* <DropdownMenu.Portal>
|
|
337
|
+
* <DropdownMenu.SubContent>
|
|
338
|
+
* <DropdownMenu.Item>Folder 1</DropdownMenu.Item>
|
|
339
|
+
* <DropdownMenu.Item>Folder 2</DropdownMenu.Item>
|
|
340
|
+
* </DropdownMenu.SubContent>
|
|
341
|
+
* </DropdownMenu.Portal>
|
|
342
|
+
* </DropdownMenu.Sub>
|
|
343
|
+
* ```
|
|
344
|
+
*/
|
|
345
|
+
export declare const SubTrigger: {
|
|
346
|
+
({ className, children, ...props }: SubTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
347
|
+
displayName: string;
|
|
348
|
+
};
|
|
110
349
|
/**
|
|
111
350
|
* Props for the DropdownMenu SubContent component.
|
|
112
351
|
*
|
|
@@ -128,149 +367,28 @@ type SubTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>;
|
|
|
128
367
|
*/
|
|
129
368
|
type SubContentProps = ComponentProps<typeof DropdownMenuPrimitive.SubContent>;
|
|
130
369
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* DropdownMenu primitive, so keyboard navigation, focus trapping, typeahead,
|
|
135
|
-
* and viewport-collision detection come for free.
|
|
136
|
-
*
|
|
137
|
-
* Compose it from `Root` / `Trigger` / `Portal` / `Content` and fill the
|
|
138
|
-
* menu with `Item`, `Separator`, `Label`, and — for nested flows — `Sub` /
|
|
139
|
-
* `SubTrigger` / `SubContent`. Wrap content in `Portal` so the menu escapes
|
|
140
|
-
* ancestor `overflow:hidden` and z-index stacking contexts.
|
|
141
|
-
*
|
|
142
|
-
* Do **not** use DropdownMenu for primary navigation (use a real nav menu),
|
|
143
|
-
* for single-choice form input (use a `Select`), or for command palettes
|
|
144
|
-
* (use a dedicated command component). For radio/checkbox-style toggles,
|
|
145
|
-
* use Radix's `CheckboxItem` / `RadioItem` primitives directly — those
|
|
146
|
-
* parts are not exposed here yet.
|
|
370
|
+
* Floating surface for a submenu's items. Positions itself alongside its
|
|
371
|
+
* `SubTrigger` with sensible defaults (`sideOffset: 2`, `alignOffset: -5`)
|
|
372
|
+
* and animates on open/close just like `Content`.
|
|
147
373
|
*
|
|
148
|
-
* @summary
|
|
149
|
-
*
|
|
150
|
-
* @see {@link https://www.radix-ui.com/primitives/docs/components/dropdown-menu|Radix UI DropdownMenu}
|
|
374
|
+
* @summary Popover surface that renders a submenu's items
|
|
151
375
|
*
|
|
152
376
|
* @example
|
|
153
377
|
* ```tsx
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* <DropdownMenu.Root>
|
|
157
|
-
* <DropdownMenu.Trigger>
|
|
158
|
-
* <IconMoreVert />
|
|
159
|
-
* </DropdownMenu.Trigger>
|
|
160
|
-
*
|
|
378
|
+
* <DropdownMenu.Sub>
|
|
379
|
+
* <DropdownMenu.SubTrigger>Share</DropdownMenu.SubTrigger>
|
|
161
380
|
* <DropdownMenu.Portal>
|
|
162
|
-
* <DropdownMenu.
|
|
163
|
-
* <DropdownMenu.
|
|
164
|
-
*
|
|
165
|
-
* <DropdownMenu.Item
|
|
166
|
-
*
|
|
167
|
-
* Edit
|
|
168
|
-
* </DropdownMenu.Item>
|
|
169
|
-
*
|
|
170
|
-
* <DropdownMenu.Sub>
|
|
171
|
-
* <DropdownMenu.SubTrigger>Share</DropdownMenu.SubTrigger>
|
|
172
|
-
* <DropdownMenu.Portal>
|
|
173
|
-
* <DropdownMenu.SubContent>
|
|
174
|
-
* <DropdownMenu.Item>Email</DropdownMenu.Item>
|
|
175
|
-
* <DropdownMenu.Item>Slack</DropdownMenu.Item>
|
|
176
|
-
* </DropdownMenu.SubContent>
|
|
177
|
-
* </DropdownMenu.Portal>
|
|
178
|
-
* </DropdownMenu.Sub>
|
|
179
|
-
*
|
|
180
|
-
* <DropdownMenu.Separator />
|
|
181
|
-
*
|
|
182
|
-
* <DropdownMenu.Item
|
|
183
|
-
* onSelect={() => handleDelete()}
|
|
184
|
-
* disabled={!canDelete}
|
|
185
|
-
* >
|
|
186
|
-
* <IconDelete />
|
|
187
|
-
* Delete
|
|
188
|
-
* </DropdownMenu.Item>
|
|
189
|
-
* </DropdownMenu.Content>
|
|
381
|
+
* <DropdownMenu.SubContent sideOffset={2} alignOffset={-5}>
|
|
382
|
+
* <DropdownMenu.Item>Email</DropdownMenu.Item>
|
|
383
|
+
* <DropdownMenu.Item>Slack</DropdownMenu.Item>
|
|
384
|
+
* <DropdownMenu.Item>Copy Link</DropdownMenu.Item>
|
|
385
|
+
* </DropdownMenu.SubContent>
|
|
190
386
|
* </DropdownMenu.Portal>
|
|
191
|
-
* </DropdownMenu.
|
|
387
|
+
* </DropdownMenu.Sub>
|
|
192
388
|
* ```
|
|
193
|
-
*
|
|
194
|
-
* @component
|
|
195
|
-
* @namespace DropdownMenu
|
|
196
389
|
*/
|
|
197
|
-
export declare const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
* @see {@link Root}
|
|
201
|
-
*/
|
|
202
|
-
Root: {
|
|
203
|
-
(props: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
204
|
-
displayName: string;
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* The button that toggles the dropdown menu.
|
|
208
|
-
* @see {@link Trigger}
|
|
209
|
-
*/
|
|
210
|
-
Trigger: {
|
|
211
|
-
({ className, ...props }: TriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
212
|
-
displayName: string;
|
|
213
|
-
};
|
|
214
|
-
/**
|
|
215
|
-
* Portals the content to the body element.
|
|
216
|
-
* @see {@link Portal}
|
|
217
|
-
*/
|
|
218
|
-
Portal: import('react').FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
219
|
-
/**
|
|
220
|
-
* The popup component containing menu items.
|
|
221
|
-
* @see {@link Content}
|
|
222
|
-
*/
|
|
223
|
-
Content: {
|
|
224
|
-
({ className, hasTriggerWidth, sideOffset, ...props }: ContentProps): import("react/jsx-runtime").JSX.Element;
|
|
225
|
-
displayName: string;
|
|
226
|
-
};
|
|
227
|
-
/**
|
|
228
|
-
* An individual menu item.
|
|
229
|
-
* @see {@link Item}
|
|
230
|
-
*/
|
|
231
|
-
Item: {
|
|
232
|
-
({ className, ...props }: ItemProps): import("react/jsx-runtime").JSX.Element;
|
|
233
|
-
displayName: string;
|
|
234
|
-
};
|
|
235
|
-
/**
|
|
236
|
-
* A visual divider between menu items.
|
|
237
|
-
* @see {@link Separator}
|
|
238
|
-
*/
|
|
239
|
-
Separator: {
|
|
240
|
-
({ className, ...props }: SeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
241
|
-
displayName: string;
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* A non-interactive label for menu sections.
|
|
245
|
-
* @see {@link Label}
|
|
246
|
-
*/
|
|
247
|
-
Label: {
|
|
248
|
-
({ className, ...props }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
249
|
-
displayName: string;
|
|
250
|
-
};
|
|
251
|
-
/**
|
|
252
|
-
* Container for submenu parts.
|
|
253
|
-
* @see {@link Sub}
|
|
254
|
-
*/
|
|
255
|
-
Sub: {
|
|
256
|
-
(props: SubProps): import("react/jsx-runtime").JSX.Element;
|
|
257
|
-
displayName: string;
|
|
258
|
-
};
|
|
259
|
-
/**
|
|
260
|
-
* An item that opens a submenu.
|
|
261
|
-
* @see {@link SubTrigger}
|
|
262
|
-
*/
|
|
263
|
-
SubTrigger: {
|
|
264
|
-
({ className, children, ...props }: SubTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
265
|
-
displayName: string;
|
|
266
|
-
};
|
|
267
|
-
/**
|
|
268
|
-
* The popup component for submenu items.
|
|
269
|
-
* @see {@link SubContent}
|
|
270
|
-
*/
|
|
271
|
-
SubContent: {
|
|
272
|
-
({ className, sideOffset, alignOffset, ...props }: SubContentProps): import("react/jsx-runtime").JSX.Element;
|
|
273
|
-
displayName: string;
|
|
274
|
-
};
|
|
390
|
+
export declare const SubContent: {
|
|
391
|
+
({ className, sideOffset, alignOffset, ...props }: SubContentProps): import("react/jsx-runtime").JSX.Element;
|
|
392
|
+
displayName: string;
|
|
275
393
|
};
|
|
276
394
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { cn as e } from "../../lib/utils.js";
|
|
3
2
|
import { IconArrowRight as t } from "./icons.js";
|
|
4
3
|
import { tv as n } from "tailwind-variants";
|
|
@@ -95,17 +94,5 @@ var g = n({ base: [
|
|
|
95
94
|
...i
|
|
96
95
|
});
|
|
97
96
|
_.displayName = "DropdownMenu.SubContent";
|
|
98
|
-
var v = {
|
|
99
|
-
Root: o,
|
|
100
|
-
Trigger: s,
|
|
101
|
-
Portal: c,
|
|
102
|
-
Content: u,
|
|
103
|
-
Item: d,
|
|
104
|
-
Separator: f,
|
|
105
|
-
Label: p,
|
|
106
|
-
Sub: m,
|
|
107
|
-
SubTrigger: h,
|
|
108
|
-
SubContent: _
|
|
109
|
-
};
|
|
110
97
|
//#endregion
|
|
111
|
-
export {
|
|
98
|
+
export { u as Content, d as Item, p as Label, c as Portal, o as Root, f as Separator, m as Sub, _ as SubContent, h as SubTrigger, s as Trigger };
|