@multicomma/arkcn 0.1.2 → 0.1.3
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/package.json +1 -1
- package/registry/index.json +1 -1
- package/registry/items/accordion.json +302 -0
- package/registry/items/activity-feed.json +408 -0
- package/registry/items/alert-dialog.json +676 -0
- package/registry/items/alert.json +113 -0
- package/registry/items/angle-slider.json +378 -0
- package/registry/items/app-shell.json +2654 -1
- package/registry/items/aspect-ratio.json +36 -0
- package/registry/items/attachment.json +299 -1
- package/registry/items/avatar.json +213 -0
- package/registry/items/badge.json +44 -0
- package/registry/items/breadcrumb.json +191 -0
- package/registry/items/bubble.json +146 -0
- package/registry/items/button-group.json +110 -0
- package/registry/items/button.json +52 -0
- package/registry/items/calendar.json +499 -1
- package/registry/items/canvas.json +446 -1
- package/registry/items/card.json +192 -0
- package/registry/items/carousel.json +208 -1
- package/registry/items/cascader.json +797 -1
- package/registry/items/chart.json +1764 -1
- package/registry/items/chat.json +993 -0
- package/registry/items/checkbox.json +503 -0
- package/registry/items/clipboard.json +308 -0
- package/registry/items/collapsible.json +226 -0
- package/registry/items/color-picker.json +1261 -0
- package/registry/items/combobox.json +1123 -1
- package/registry/items/command.json +837 -1
- package/registry/items/comment-thread.json +952 -1
- package/registry/items/context-menu.json +1344 -1
- package/registry/items/data-grid.json +449 -1
- package/registry/items/data-table.json +1310 -1
- package/registry/items/date-input.json +476 -0
- package/registry/items/dialog.json +592 -0
- package/registry/items/direction.json +29 -1
- package/registry/items/drawer.json +797 -0
- package/registry/items/dropdown-menu.json +1311 -1
- package/registry/items/editable.json +503 -0
- package/registry/items/empty.json +166 -0
- package/registry/items/field.json +286 -1
- package/registry/items/file-upload.json +638 -0
- package/registry/items/floating-panel.json +720 -0
- package/registry/items/floating-toolbar.json +43 -0
- package/registry/items/format.json +109 -0
- package/registry/items/gantt.json +773 -1
- package/registry/items/hooks/use-mobile.json +1 -0
- package/registry/items/hotkeys.json +99 -1
- package/registry/items/hover-card.json +357 -0
- package/registry/items/image-cropper.json +431 -0
- package/registry/items/input-group.json +189 -0
- package/registry/items/input-otp.json +181 -0
- package/registry/items/input.json +28 -0
- package/registry/items/item.json +308 -0
- package/registry/items/json-tree-view.json +336 -0
- package/registry/items/kanban.json +624 -1
- package/registry/items/kbd.json +54 -0
- package/registry/items/label.json +28 -0
- package/registry/items/lib/controllable.json +1 -0
- package/registry/items/lib/data-table-adapter.json +1 -0
- package/registry/items/lib/drag-preview.json +1 -0
- package/registry/items/lib/form.json +1 -0
- package/registry/items/lib/history.json +1 -0
- package/registry/items/lib/row-layout.json +1 -0
- package/registry/items/lib/table.json +1 -0
- package/registry/items/lib/time.json +1 -0
- package/registry/items/lib/utils.json +1 -0
- package/registry/items/live-region.json +43 -0
- package/registry/items/marker.json +96 -0
- package/registry/items/marquee.json +300 -0
- package/registry/items/menubar.json +1282 -1
- package/registry/items/message.json +166 -0
- package/registry/items/navigation-menu.json +561 -1
- package/registry/items/node-graph.json +1037 -1
- package/registry/items/number-input.json +519 -0
- package/registry/items/pagination.json +244 -1
- package/registry/items/password-input.json +311 -0
- package/registry/items/popconfirm.json +566 -0
- package/registry/items/popover.json +615 -0
- package/registry/items/progress.json +516 -0
- package/registry/items/qr-code.json +249 -0
- package/registry/items/query-builder.json +1368 -1
- package/registry/items/radio-group.json +362 -0
- package/registry/items/rating-group.json +304 -0
- package/registry/items/resizable.json +242 -1
- package/registry/items/rich-text-editor.json +934 -1
- package/registry/items/scheduler.json +1013 -1
- package/registry/items/scroll-area.json +227 -0
- package/registry/items/segment-group.json +363 -0
- package/registry/items/select.json +956 -0
- package/registry/items/separator.json +45 -1
- package/registry/items/sheet.json +592 -0
- package/registry/items/sidebar.json +785 -1
- package/registry/items/signature-pad.json +330 -0
- package/registry/items/skeleton.json +28 -0
- package/registry/items/slider.json +799 -0
- package/registry/items/sonner.json +135 -0
- package/registry/items/spinner.json +28 -0
- package/registry/items/steps.json +483 -0
- package/registry/items/swap.json +107 -0
- package/registry/items/switch.json +362 -0
- package/registry/items/table.json +210 -0
- package/registry/items/tabs.json +326 -0
- package/registry/items/tags-input.json +640 -0
- package/registry/items/textarea.json +28 -0
- package/registry/items/timer.json +289 -0
- package/registry/items/toc.json +372 -0
- package/registry/items/toggle-group.json +214 -1
- package/registry/items/toggle.json +124 -0
- package/registry/items/tooltip.json +417 -0
- package/registry/items/tour.json +498 -0
- package/registry/items/transfer-list.json +609 -1
- package/registry/items/tree-select.json +742 -1
- package/registry/items/tree-view.json +794 -0
- package/registry/items/virtual-list.json +214 -1
- package/src/components/ui/app-shell.tsx +11 -0
- package/src/components/ui/attachment.tsx +1 -0
- package/src/components/ui/calendar.tsx +1 -0
- package/src/components/ui/canvas.tsx +8 -0
- package/src/components/ui/carousel.tsx +3 -0
- package/src/components/ui/cascader.tsx +1 -0
- package/src/components/ui/chart.tsx +10 -0
- package/src/components/ui/combobox.tsx +3 -0
- package/src/components/ui/command.tsx +1 -0
- package/src/components/ui/comment-thread.tsx +11 -0
- package/src/components/ui/context-menu.tsx +6 -0
- package/src/components/ui/data-grid.tsx +8 -0
- package/src/components/ui/data-table.tsx +6 -0
- package/src/components/ui/direction.tsx +2 -0
- package/src/components/ui/dropdown-menu.tsx +6 -0
- package/src/components/ui/field.tsx +1 -0
- package/src/components/ui/gantt.tsx +15 -0
- package/src/components/ui/hotkeys.tsx +3 -0
- package/src/components/ui/kanban.tsx +3 -0
- package/src/components/ui/menubar.tsx +6 -0
- package/src/components/ui/navigation-menu.tsx +1 -0
- package/src/components/ui/node-graph.tsx +23 -0
- package/src/components/ui/pagination.tsx +1 -0
- package/src/components/ui/query-builder.tsx +7 -0
- package/src/components/ui/resizable.tsx +1 -0
- package/src/components/ui/rich-text-editor.tsx +54 -0
- package/src/components/ui/scheduler.tsx +26 -0
- package/src/components/ui/separator.tsx +1 -0
- package/src/components/ui/sidebar.tsx +5 -0
- package/src/components/ui/toggle-group.tsx +3 -0
- package/src/components/ui/transfer-list.tsx +11 -0
- package/src/components/ui/tree-select.tsx +5 -0
- package/src/components/ui/virtual-list.tsx +7 -0
|
@@ -26,6 +26,1287 @@
|
|
|
26
26
|
"MenubarSubTrigger",
|
|
27
27
|
"MenubarTrigger"
|
|
28
28
|
],
|
|
29
|
+
"parts": [
|
|
30
|
+
{
|
|
31
|
+
"name": "Menubar",
|
|
32
|
+
"props": [
|
|
33
|
+
{
|
|
34
|
+
"name": "defaultValue",
|
|
35
|
+
"type": "string | null",
|
|
36
|
+
"required": false,
|
|
37
|
+
"default": "null",
|
|
38
|
+
"description": "The initial value when uncontrolled.",
|
|
39
|
+
"from": "arkcn"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "loop",
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"required": false,
|
|
45
|
+
"default": "false",
|
|
46
|
+
"description": "Whether ArrowLeft/ArrowRight wrap around at the ends.",
|
|
47
|
+
"from": "arkcn"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "onValueChange",
|
|
51
|
+
"type": "((value: string | null) => void)",
|
|
52
|
+
"required": false,
|
|
53
|
+
"description": "Called with the new value whenever it changes.",
|
|
54
|
+
"from": "arkcn"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "value",
|
|
58
|
+
"type": "string | null",
|
|
59
|
+
"required": false,
|
|
60
|
+
"description": "The id of the open menu (controlled).",
|
|
61
|
+
"from": "arkcn"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "children",
|
|
65
|
+
"type": "ReactNode",
|
|
66
|
+
"required": false,
|
|
67
|
+
"description": "Content rendered inside the part.",
|
|
68
|
+
"from": "@types/react"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "className",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"required": false,
|
|
74
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
75
|
+
"from": "@types/react"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "style",
|
|
79
|
+
"type": "CSSProperties",
|
|
80
|
+
"required": false,
|
|
81
|
+
"description": "Inline styles applied to the rendered element.",
|
|
82
|
+
"from": "@types/react"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "MenubarArrow",
|
|
88
|
+
"props": [
|
|
89
|
+
{
|
|
90
|
+
"name": "asChild",
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"required": false,
|
|
93
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
94
|
+
"from": "@ark-ui/react"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "children",
|
|
98
|
+
"type": "ReactNode",
|
|
99
|
+
"required": false,
|
|
100
|
+
"description": "Content rendered inside the part.",
|
|
101
|
+
"from": "@types/react"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "className",
|
|
105
|
+
"type": "string",
|
|
106
|
+
"required": false,
|
|
107
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
108
|
+
"from": "@types/react"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "style",
|
|
112
|
+
"type": "CSSProperties",
|
|
113
|
+
"required": false,
|
|
114
|
+
"description": "Inline styles applied to the rendered element.",
|
|
115
|
+
"from": "@types/react"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "MenubarCheckboxItem",
|
|
121
|
+
"props": [
|
|
122
|
+
{
|
|
123
|
+
"name": "checked",
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"required": false,
|
|
126
|
+
"default": "false",
|
|
127
|
+
"description": "Checked state of the item.",
|
|
128
|
+
"from": "arkcn"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "inset",
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"required": false,
|
|
134
|
+
"description": "Indent the item to align with items that have an indicator.",
|
|
135
|
+
"from": "arkcn"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "value",
|
|
139
|
+
"type": "string",
|
|
140
|
+
"required": false,
|
|
141
|
+
"description": "The controlled value.",
|
|
142
|
+
"from": "arkcn"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "asChild",
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"required": false,
|
|
148
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
149
|
+
"from": "@ark-ui/react"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "children",
|
|
153
|
+
"type": "ReactNode",
|
|
154
|
+
"required": false,
|
|
155
|
+
"description": "Content rendered inside the part.",
|
|
156
|
+
"from": "@types/react"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "className",
|
|
160
|
+
"type": "string",
|
|
161
|
+
"required": false,
|
|
162
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
163
|
+
"from": "@types/react"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "closeOnSelect",
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"required": false,
|
|
169
|
+
"description": "Whether the menu should be closed when the option is selected.",
|
|
170
|
+
"from": "@zag-js/menu"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"name": "disabled",
|
|
174
|
+
"type": "boolean",
|
|
175
|
+
"required": false,
|
|
176
|
+
"description": "Whether the menu item is disabled",
|
|
177
|
+
"from": "@zag-js/menu"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "onCheckedChange",
|
|
181
|
+
"type": "((checked: boolean) => void)",
|
|
182
|
+
"required": false,
|
|
183
|
+
"description": "Function called when the option state is changed",
|
|
184
|
+
"from": "@zag-js/menu"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "style",
|
|
188
|
+
"type": "CSSProperties",
|
|
189
|
+
"required": false,
|
|
190
|
+
"description": "Inline styles applied to the rendered element.",
|
|
191
|
+
"from": "@types/react"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "valueText",
|
|
195
|
+
"type": "string",
|
|
196
|
+
"required": false,
|
|
197
|
+
"description": "The textual value of the option. Used in typeahead navigation of the menu.\nIf not provided, the text content of the menu item will be used.",
|
|
198
|
+
"from": "@zag-js/menu"
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "MenubarContent",
|
|
204
|
+
"props": [
|
|
205
|
+
{
|
|
206
|
+
"name": "asChild",
|
|
207
|
+
"type": "boolean",
|
|
208
|
+
"required": false,
|
|
209
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
210
|
+
"from": "@ark-ui/react"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"name": "children",
|
|
214
|
+
"type": "ReactNode",
|
|
215
|
+
"required": false,
|
|
216
|
+
"description": "Content rendered inside the part.",
|
|
217
|
+
"from": "@types/react"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"name": "className",
|
|
221
|
+
"type": "string",
|
|
222
|
+
"required": false,
|
|
223
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
224
|
+
"from": "@types/react"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "style",
|
|
228
|
+
"type": "CSSProperties",
|
|
229
|
+
"required": false,
|
|
230
|
+
"description": "Inline styles applied to the rendered element.",
|
|
231
|
+
"from": "@types/react"
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"name": "MenubarContext",
|
|
237
|
+
"props": [
|
|
238
|
+
{
|
|
239
|
+
"name": "children",
|
|
240
|
+
"type": "(context: MenuApi<PropTypes>) => ReactNode",
|
|
241
|
+
"required": true,
|
|
242
|
+
"description": "Content rendered inside the part.",
|
|
243
|
+
"from": "@ark-ui/react"
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"name": "MenubarGroup",
|
|
249
|
+
"props": [
|
|
250
|
+
{
|
|
251
|
+
"name": "asChild",
|
|
252
|
+
"type": "boolean",
|
|
253
|
+
"required": false,
|
|
254
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
255
|
+
"from": "@ark-ui/react"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "children",
|
|
259
|
+
"type": "ReactNode",
|
|
260
|
+
"required": false,
|
|
261
|
+
"description": "Content rendered inside the part.",
|
|
262
|
+
"from": "@types/react"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"name": "className",
|
|
266
|
+
"type": "string",
|
|
267
|
+
"required": false,
|
|
268
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
269
|
+
"from": "@types/react"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "style",
|
|
273
|
+
"type": "CSSProperties",
|
|
274
|
+
"required": false,
|
|
275
|
+
"description": "Inline styles applied to the rendered element.",
|
|
276
|
+
"from": "@types/react"
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"name": "MenubarItem",
|
|
282
|
+
"props": [
|
|
283
|
+
{
|
|
284
|
+
"name": "inset",
|
|
285
|
+
"type": "boolean",
|
|
286
|
+
"required": false,
|
|
287
|
+
"description": "Indent the item to align with items that have an indicator.",
|
|
288
|
+
"from": "arkcn"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "value",
|
|
292
|
+
"type": "string",
|
|
293
|
+
"required": false,
|
|
294
|
+
"description": "The controlled value.",
|
|
295
|
+
"from": "arkcn"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"name": "variant",
|
|
299
|
+
"type": "\"default\" | \"destructive\"",
|
|
300
|
+
"required": false,
|
|
301
|
+
"default": "\"default\"",
|
|
302
|
+
"description": "Visual variant, styled with `cva`; sets a `data-variant` attribute.",
|
|
303
|
+
"from": "arkcn"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "asChild",
|
|
307
|
+
"type": "boolean",
|
|
308
|
+
"required": false,
|
|
309
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
310
|
+
"from": "@ark-ui/react"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "children",
|
|
314
|
+
"type": "ReactNode",
|
|
315
|
+
"required": false,
|
|
316
|
+
"description": "Content rendered inside the part.",
|
|
317
|
+
"from": "@types/react"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "className",
|
|
321
|
+
"type": "string",
|
|
322
|
+
"required": false,
|
|
323
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
324
|
+
"from": "@types/react"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"name": "closeOnSelect",
|
|
328
|
+
"type": "boolean",
|
|
329
|
+
"required": false,
|
|
330
|
+
"description": "Whether the menu should be closed when the option is selected.",
|
|
331
|
+
"from": "@zag-js/menu"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"name": "disabled",
|
|
335
|
+
"type": "boolean",
|
|
336
|
+
"required": false,
|
|
337
|
+
"description": "Whether the menu item is disabled",
|
|
338
|
+
"from": "@zag-js/menu"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "onSelect",
|
|
342
|
+
"type": "VoidFunction",
|
|
343
|
+
"required": false,
|
|
344
|
+
"description": "The function to call when the item is selected",
|
|
345
|
+
"from": "@ark-ui/react"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "style",
|
|
349
|
+
"type": "CSSProperties",
|
|
350
|
+
"required": false,
|
|
351
|
+
"description": "Inline styles applied to the rendered element.",
|
|
352
|
+
"from": "@types/react"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"name": "valueText",
|
|
356
|
+
"type": "string",
|
|
357
|
+
"required": false,
|
|
358
|
+
"description": "The textual value of the option. Used in typeahead navigation of the menu.\nIf not provided, the text content of the menu item will be used.",
|
|
359
|
+
"from": "@zag-js/menu"
|
|
360
|
+
}
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"name": "MenubarItemIndicator",
|
|
365
|
+
"props": [
|
|
366
|
+
{
|
|
367
|
+
"name": "asChild",
|
|
368
|
+
"type": "boolean",
|
|
369
|
+
"required": false,
|
|
370
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
371
|
+
"from": "@ark-ui/react"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"name": "children",
|
|
375
|
+
"type": "ReactNode",
|
|
376
|
+
"required": false,
|
|
377
|
+
"description": "Content rendered inside the part.",
|
|
378
|
+
"from": "@types/react"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"name": "className",
|
|
382
|
+
"type": "string",
|
|
383
|
+
"required": false,
|
|
384
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
385
|
+
"from": "@types/react"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "style",
|
|
389
|
+
"type": "CSSProperties",
|
|
390
|
+
"required": false,
|
|
391
|
+
"description": "Inline styles applied to the rendered element.",
|
|
392
|
+
"from": "@types/react"
|
|
393
|
+
}
|
|
394
|
+
]
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"name": "MenubarItemText",
|
|
398
|
+
"props": [
|
|
399
|
+
{
|
|
400
|
+
"name": "asChild",
|
|
401
|
+
"type": "boolean",
|
|
402
|
+
"required": false,
|
|
403
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
404
|
+
"from": "@ark-ui/react"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"name": "children",
|
|
408
|
+
"type": "ReactNode",
|
|
409
|
+
"required": false,
|
|
410
|
+
"description": "Content rendered inside the part.",
|
|
411
|
+
"from": "@types/react"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"name": "className",
|
|
415
|
+
"type": "string",
|
|
416
|
+
"required": false,
|
|
417
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
418
|
+
"from": "@types/react"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"name": "style",
|
|
422
|
+
"type": "CSSProperties",
|
|
423
|
+
"required": false,
|
|
424
|
+
"description": "Inline styles applied to the rendered element.",
|
|
425
|
+
"from": "@types/react"
|
|
426
|
+
}
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"name": "MenubarLabel",
|
|
431
|
+
"props": [
|
|
432
|
+
{
|
|
433
|
+
"name": "inset",
|
|
434
|
+
"type": "boolean",
|
|
435
|
+
"required": false,
|
|
436
|
+
"description": "Indent the item to align with items that have an indicator.",
|
|
437
|
+
"from": "arkcn"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "asChild",
|
|
441
|
+
"type": "boolean",
|
|
442
|
+
"required": false,
|
|
443
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
444
|
+
"from": "@ark-ui/react"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"name": "children",
|
|
448
|
+
"type": "ReactNode",
|
|
449
|
+
"required": false,
|
|
450
|
+
"description": "Content rendered inside the part.",
|
|
451
|
+
"from": "@types/react"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "className",
|
|
455
|
+
"type": "string",
|
|
456
|
+
"required": false,
|
|
457
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
458
|
+
"from": "@types/react"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"name": "style",
|
|
462
|
+
"type": "CSSProperties",
|
|
463
|
+
"required": false,
|
|
464
|
+
"description": "Inline styles applied to the rendered element.",
|
|
465
|
+
"from": "@types/react"
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "MenubarMenu",
|
|
471
|
+
"props": [
|
|
472
|
+
{
|
|
473
|
+
"name": "value",
|
|
474
|
+
"type": "string",
|
|
475
|
+
"required": false,
|
|
476
|
+
"description": "Identifies this menu within the menubar. Auto-generated when omitted.",
|
|
477
|
+
"from": "arkcn"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"name": "anchorPoint",
|
|
481
|
+
"type": "Point | null",
|
|
482
|
+
"required": false,
|
|
483
|
+
"description": "The positioning point for the menu. Can be set by the context menu trigger or the button trigger.",
|
|
484
|
+
"from": "@zag-js/menu"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"name": "aria-label",
|
|
488
|
+
"type": "string",
|
|
489
|
+
"required": false,
|
|
490
|
+
"description": "The accessibility label for the menu",
|
|
491
|
+
"from": "@zag-js/menu"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "children",
|
|
495
|
+
"type": "ReactNode",
|
|
496
|
+
"required": false,
|
|
497
|
+
"description": "Content rendered inside the part.",
|
|
498
|
+
"from": "@ark-ui/react"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "closeOnSelect",
|
|
502
|
+
"type": "boolean",
|
|
503
|
+
"required": false,
|
|
504
|
+
"default": "true",
|
|
505
|
+
"description": "Whether to close the menu when an option is selected",
|
|
506
|
+
"from": "@zag-js/menu"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"name": "composite",
|
|
510
|
+
"type": "boolean",
|
|
511
|
+
"required": false,
|
|
512
|
+
"default": "true",
|
|
513
|
+
"description": "Whether the menu is a composed with other composite widgets like a combobox or tabs",
|
|
514
|
+
"from": "@zag-js/menu"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"name": "defaultHighlightedValue",
|
|
518
|
+
"type": "string | null",
|
|
519
|
+
"required": false,
|
|
520
|
+
"description": "The initial highlighted value of the menu item when rendered.\nUse when you don't need to control the highlighted value of the menu item.",
|
|
521
|
+
"from": "@zag-js/menu"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"name": "defaultTriggerValue",
|
|
525
|
+
"type": "string | null",
|
|
526
|
+
"required": false,
|
|
527
|
+
"description": "The initial trigger value when rendered.\nUse when you don't need to control the trigger value.",
|
|
528
|
+
"from": "@zag-js/menu"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"name": "hideMode",
|
|
532
|
+
"type": "HideMode",
|
|
533
|
+
"required": false,
|
|
534
|
+
"default": "'display-none'",
|
|
535
|
+
"description": "How to hide content when mounted but not present.\n- `'display-none'`: HTML `hidden` attribute. Effects stay alive.\n- `'activity'`: React 19 `<Activity mode=\"hidden\">`. Effects pause. Requires React 19+.",
|
|
536
|
+
"from": "@ark-ui/react"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"name": "highlightedValue",
|
|
540
|
+
"type": "string | null",
|
|
541
|
+
"required": false,
|
|
542
|
+
"description": "The controlled highlighted value of the menu item.",
|
|
543
|
+
"from": "@zag-js/menu"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"name": "id",
|
|
547
|
+
"type": "string",
|
|
548
|
+
"required": false,
|
|
549
|
+
"description": "The unique identifier of the machine.",
|
|
550
|
+
"from": "@zag-js/types"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"name": "ids",
|
|
554
|
+
"type": "ElementIds",
|
|
555
|
+
"required": false,
|
|
556
|
+
"description": "The ids of the elements in the menu. Useful for composition.",
|
|
557
|
+
"from": "@zag-js/menu"
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"name": "immediate",
|
|
561
|
+
"type": "boolean",
|
|
562
|
+
"required": false,
|
|
563
|
+
"description": "Whether to synchronize the present change immediately or defer it to the next frame",
|
|
564
|
+
"from": "@zag-js/presence"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"name": "lazyMount",
|
|
568
|
+
"type": "boolean",
|
|
569
|
+
"required": false,
|
|
570
|
+
"default": "true",
|
|
571
|
+
"description": "Whether to enable lazy mounting",
|
|
572
|
+
"from": "@ark-ui/react"
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
"name": "loopFocus",
|
|
576
|
+
"type": "boolean",
|
|
577
|
+
"required": false,
|
|
578
|
+
"default": "false",
|
|
579
|
+
"description": "Whether to loop the keyboard navigation.",
|
|
580
|
+
"from": "@zag-js/menu"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
"name": "navigate",
|
|
584
|
+
"type": "((details: NavigateDetails) => void) | null",
|
|
585
|
+
"required": false,
|
|
586
|
+
"description": "Function to navigate to the selected item if it's an anchor element",
|
|
587
|
+
"from": "@zag-js/menu"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"name": "onEnterComplete",
|
|
591
|
+
"type": "VoidFunction",
|
|
592
|
+
"required": false,
|
|
593
|
+
"description": "Function called when the animation ends in the open state",
|
|
594
|
+
"from": "@zag-js/presence"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"name": "onEscapeKeyDown",
|
|
598
|
+
"type": "((event: KeyboardEvent) => void)",
|
|
599
|
+
"required": false,
|
|
600
|
+
"description": "Function called when the escape key is pressed",
|
|
601
|
+
"from": "@zag-js/dismissable"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"name": "onExitComplete",
|
|
605
|
+
"type": "VoidFunction",
|
|
606
|
+
"required": false,
|
|
607
|
+
"description": "Function called when the animation ends in the closed state",
|
|
608
|
+
"from": "@zag-js/presence"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"name": "onFocusOutside",
|
|
612
|
+
"type": "((event: FocusOutsideEvent) => void)",
|
|
613
|
+
"required": false,
|
|
614
|
+
"description": "Function called when the focus is moved outside the component",
|
|
615
|
+
"from": "@zag-js/interact-outside"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "onHighlightChange",
|
|
619
|
+
"type": "((details: HighlightChangeDetails) => void)",
|
|
620
|
+
"required": false,
|
|
621
|
+
"description": "Function called when the highlighted menu item changes.",
|
|
622
|
+
"from": "@zag-js/menu"
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"name": "onInteractOutside",
|
|
626
|
+
"type": "((event: InteractOutsideEvent) => void)",
|
|
627
|
+
"required": false,
|
|
628
|
+
"description": "Function called when an interaction happens outside the component",
|
|
629
|
+
"from": "@zag-js/interact-outside"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"name": "onOpenChange",
|
|
633
|
+
"type": "((details: OpenChangeDetails) => void)",
|
|
634
|
+
"required": false,
|
|
635
|
+
"description": "Function called when the menu opens or closes",
|
|
636
|
+
"from": "@zag-js/menu"
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
"name": "onPointerDownOutside",
|
|
640
|
+
"type": "((event: PointerDownOutsideEvent) => void)",
|
|
641
|
+
"required": false,
|
|
642
|
+
"description": "Function called when the pointer is pressed down outside the component",
|
|
643
|
+
"from": "@zag-js/interact-outside"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"name": "onRequestDismiss",
|
|
647
|
+
"type": "((event: LayerDismissEvent) => void)",
|
|
648
|
+
"required": false,
|
|
649
|
+
"description": "Function called when this layer is closed due to a parent layer being closed",
|
|
650
|
+
"from": "@zag-js/dismissable"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"name": "onSelect",
|
|
654
|
+
"type": "((details: SelectionDetails) => void)",
|
|
655
|
+
"required": false,
|
|
656
|
+
"description": "Function called when a menu item is selected.",
|
|
657
|
+
"from": "@zag-js/menu"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "onTriggerValueChange",
|
|
661
|
+
"type": "((details: TriggerValueChangeDetails) => void)",
|
|
662
|
+
"required": false,
|
|
663
|
+
"description": "Function called when the trigger value changes.",
|
|
664
|
+
"from": "@zag-js/menu"
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"name": "positioning",
|
|
668
|
+
"type": "PositioningOptions",
|
|
669
|
+
"required": false,
|
|
670
|
+
"description": "The options used to dynamically position the menu",
|
|
671
|
+
"from": "@zag-js/menu"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"name": "present",
|
|
675
|
+
"type": "boolean",
|
|
676
|
+
"required": false,
|
|
677
|
+
"description": "Whether the node is present (controlled by the user)",
|
|
678
|
+
"from": "@zag-js/presence"
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
"name": "skipAnimationOnMount",
|
|
682
|
+
"type": "boolean",
|
|
683
|
+
"required": false,
|
|
684
|
+
"default": "false",
|
|
685
|
+
"description": "Whether to allow the initial presence animation.",
|
|
686
|
+
"from": "@ark-ui/react"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"name": "triggerValue",
|
|
690
|
+
"type": "string | null",
|
|
691
|
+
"required": false,
|
|
692
|
+
"description": "The controlled trigger value",
|
|
693
|
+
"from": "@zag-js/menu"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"name": "typeahead",
|
|
697
|
+
"type": "boolean",
|
|
698
|
+
"required": false,
|
|
699
|
+
"default": "true",
|
|
700
|
+
"description": "Whether the pressing printable characters should trigger typeahead navigation",
|
|
701
|
+
"from": "@zag-js/menu"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"name": "unmountOnExit",
|
|
705
|
+
"type": "boolean",
|
|
706
|
+
"required": false,
|
|
707
|
+
"default": "true",
|
|
708
|
+
"description": "Whether to unmount on exit.",
|
|
709
|
+
"from": "@ark-ui/react"
|
|
710
|
+
}
|
|
711
|
+
]
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"name": "MenubarPortal",
|
|
715
|
+
"props": [
|
|
716
|
+
{
|
|
717
|
+
"name": "children",
|
|
718
|
+
"type": "ReactNode",
|
|
719
|
+
"required": false,
|
|
720
|
+
"description": "Content rendered inside the part.",
|
|
721
|
+
"from": "@types/react"
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
"name": "container",
|
|
725
|
+
"type": "RefObject<HTMLElement | null>",
|
|
726
|
+
"required": false,
|
|
727
|
+
"from": "@ark-ui/react"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"name": "disabled",
|
|
731
|
+
"type": "boolean",
|
|
732
|
+
"required": false,
|
|
733
|
+
"description": "Disables the part and everything inside it.",
|
|
734
|
+
"from": "@ark-ui/react"
|
|
735
|
+
}
|
|
736
|
+
]
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
"name": "MenubarPositioner",
|
|
740
|
+
"props": [
|
|
741
|
+
{
|
|
742
|
+
"name": "asChild",
|
|
743
|
+
"type": "boolean",
|
|
744
|
+
"required": false,
|
|
745
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
746
|
+
"from": "@ark-ui/react"
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
"name": "children",
|
|
750
|
+
"type": "ReactNode",
|
|
751
|
+
"required": false,
|
|
752
|
+
"description": "Content rendered inside the part.",
|
|
753
|
+
"from": "@types/react"
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"name": "className",
|
|
757
|
+
"type": "string",
|
|
758
|
+
"required": false,
|
|
759
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
760
|
+
"from": "@types/react"
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
"name": "style",
|
|
764
|
+
"type": "CSSProperties",
|
|
765
|
+
"required": false,
|
|
766
|
+
"description": "Inline styles applied to the rendered element.",
|
|
767
|
+
"from": "@types/react"
|
|
768
|
+
}
|
|
769
|
+
]
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"name": "MenubarRadioGroup",
|
|
773
|
+
"props": [
|
|
774
|
+
{
|
|
775
|
+
"name": "asChild",
|
|
776
|
+
"type": "boolean",
|
|
777
|
+
"required": false,
|
|
778
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
779
|
+
"from": "@ark-ui/react"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"name": "children",
|
|
783
|
+
"type": "ReactNode",
|
|
784
|
+
"required": false,
|
|
785
|
+
"description": "Content rendered inside the part.",
|
|
786
|
+
"from": "@types/react"
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
"name": "className",
|
|
790
|
+
"type": "string",
|
|
791
|
+
"required": false,
|
|
792
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
793
|
+
"from": "@types/react"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"name": "onValueChange",
|
|
797
|
+
"type": "((e: ValueChangeDetails) => void)",
|
|
798
|
+
"required": false,
|
|
799
|
+
"description": "Called with the new value whenever it changes.",
|
|
800
|
+
"from": "@ark-ui/react"
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
"name": "style",
|
|
804
|
+
"type": "CSSProperties",
|
|
805
|
+
"required": false,
|
|
806
|
+
"description": "Inline styles applied to the rendered element.",
|
|
807
|
+
"from": "@types/react"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
"name": "value",
|
|
811
|
+
"type": "string",
|
|
812
|
+
"required": false,
|
|
813
|
+
"description": "The controlled value.",
|
|
814
|
+
"from": "@ark-ui/react"
|
|
815
|
+
}
|
|
816
|
+
]
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"name": "MenubarRadioItem",
|
|
820
|
+
"props": [
|
|
821
|
+
{
|
|
822
|
+
"name": "inset",
|
|
823
|
+
"type": "boolean",
|
|
824
|
+
"required": false,
|
|
825
|
+
"description": "Indent the item to align with items that have an indicator.",
|
|
826
|
+
"from": "arkcn"
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
"name": "value",
|
|
830
|
+
"type": "string",
|
|
831
|
+
"required": true,
|
|
832
|
+
"description": "The value of the option",
|
|
833
|
+
"from": "@zag-js/menu"
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
"name": "asChild",
|
|
837
|
+
"type": "boolean",
|
|
838
|
+
"required": false,
|
|
839
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
840
|
+
"from": "@ark-ui/react"
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
"name": "children",
|
|
844
|
+
"type": "ReactNode",
|
|
845
|
+
"required": false,
|
|
846
|
+
"description": "Content rendered inside the part.",
|
|
847
|
+
"from": "@types/react"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"name": "className",
|
|
851
|
+
"type": "string",
|
|
852
|
+
"required": false,
|
|
853
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
854
|
+
"from": "@types/react"
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
"name": "closeOnSelect",
|
|
858
|
+
"type": "boolean",
|
|
859
|
+
"required": false,
|
|
860
|
+
"description": "Whether the menu should be closed when the option is selected.",
|
|
861
|
+
"from": "@zag-js/menu"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"name": "disabled",
|
|
865
|
+
"type": "boolean",
|
|
866
|
+
"required": false,
|
|
867
|
+
"description": "Whether the menu item is disabled",
|
|
868
|
+
"from": "@zag-js/menu"
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
"name": "style",
|
|
872
|
+
"type": "CSSProperties",
|
|
873
|
+
"required": false,
|
|
874
|
+
"description": "Inline styles applied to the rendered element.",
|
|
875
|
+
"from": "@types/react"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"name": "valueText",
|
|
879
|
+
"type": "string",
|
|
880
|
+
"required": false,
|
|
881
|
+
"description": "The textual value of the option. Used in typeahead navigation of the menu.\nIf not provided, the text content of the menu item will be used.",
|
|
882
|
+
"from": "@zag-js/menu"
|
|
883
|
+
}
|
|
884
|
+
]
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"name": "MenubarSeparator",
|
|
888
|
+
"props": [
|
|
889
|
+
{
|
|
890
|
+
"name": "asChild",
|
|
891
|
+
"type": "boolean",
|
|
892
|
+
"required": false,
|
|
893
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
894
|
+
"from": "@ark-ui/react"
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
"name": "children",
|
|
898
|
+
"type": "ReactNode",
|
|
899
|
+
"required": false,
|
|
900
|
+
"description": "Content rendered inside the part.",
|
|
901
|
+
"from": "@types/react"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"name": "className",
|
|
905
|
+
"type": "string",
|
|
906
|
+
"required": false,
|
|
907
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
908
|
+
"from": "@types/react"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
"name": "style",
|
|
912
|
+
"type": "CSSProperties",
|
|
913
|
+
"required": false,
|
|
914
|
+
"description": "Inline styles applied to the rendered element.",
|
|
915
|
+
"from": "@types/react"
|
|
916
|
+
}
|
|
917
|
+
]
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
"name": "MenubarShortcut",
|
|
921
|
+
"props": [
|
|
922
|
+
{
|
|
923
|
+
"name": "children",
|
|
924
|
+
"type": "ReactNode",
|
|
925
|
+
"required": false,
|
|
926
|
+
"description": "Content rendered inside the part.",
|
|
927
|
+
"from": "@types/react"
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"name": "className",
|
|
931
|
+
"type": "string",
|
|
932
|
+
"required": false,
|
|
933
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
934
|
+
"from": "@types/react"
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
"name": "style",
|
|
938
|
+
"type": "CSSProperties",
|
|
939
|
+
"required": false,
|
|
940
|
+
"description": "Inline styles applied to the rendered element.",
|
|
941
|
+
"from": "@types/react"
|
|
942
|
+
}
|
|
943
|
+
]
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"name": "MenubarSub",
|
|
947
|
+
"props": [
|
|
948
|
+
{
|
|
949
|
+
"name": "anchorPoint",
|
|
950
|
+
"type": "Point | null",
|
|
951
|
+
"required": false,
|
|
952
|
+
"description": "The positioning point for the menu. Can be set by the context menu trigger or the button trigger.",
|
|
953
|
+
"from": "@zag-js/menu"
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
"name": "aria-label",
|
|
957
|
+
"type": "string",
|
|
958
|
+
"required": false,
|
|
959
|
+
"description": "The accessibility label for the menu",
|
|
960
|
+
"from": "@zag-js/menu"
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
"name": "children",
|
|
964
|
+
"type": "ReactNode",
|
|
965
|
+
"required": false,
|
|
966
|
+
"description": "Content rendered inside the part.",
|
|
967
|
+
"from": "@ark-ui/react"
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
"name": "closeOnSelect",
|
|
971
|
+
"type": "boolean",
|
|
972
|
+
"required": false,
|
|
973
|
+
"default": "true",
|
|
974
|
+
"description": "Whether to close the menu when an option is selected",
|
|
975
|
+
"from": "@zag-js/menu"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"name": "composite",
|
|
979
|
+
"type": "boolean",
|
|
980
|
+
"required": false,
|
|
981
|
+
"default": "true",
|
|
982
|
+
"description": "Whether the menu is a composed with other composite widgets like a combobox or tabs",
|
|
983
|
+
"from": "@zag-js/menu"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"name": "defaultHighlightedValue",
|
|
987
|
+
"type": "string | null",
|
|
988
|
+
"required": false,
|
|
989
|
+
"description": "The initial highlighted value of the menu item when rendered.\nUse when you don't need to control the highlighted value of the menu item.",
|
|
990
|
+
"from": "@zag-js/menu"
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
"name": "defaultOpen",
|
|
994
|
+
"type": "boolean",
|
|
995
|
+
"required": false,
|
|
996
|
+
"description": "The initial open state of the menu when rendered.\nUse when you don't need to control the open state of the menu.",
|
|
997
|
+
"from": "@zag-js/menu"
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
"name": "defaultTriggerValue",
|
|
1001
|
+
"type": "string | null",
|
|
1002
|
+
"required": false,
|
|
1003
|
+
"description": "The initial trigger value when rendered.\nUse when you don't need to control the trigger value.",
|
|
1004
|
+
"from": "@zag-js/menu"
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
"name": "hideMode",
|
|
1008
|
+
"type": "HideMode",
|
|
1009
|
+
"required": false,
|
|
1010
|
+
"default": "'display-none'",
|
|
1011
|
+
"description": "How to hide content when mounted but not present.\n- `'display-none'`: HTML `hidden` attribute. Effects stay alive.\n- `'activity'`: React 19 `<Activity mode=\"hidden\">`. Effects pause. Requires React 19+.",
|
|
1012
|
+
"from": "@ark-ui/react"
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
"name": "highlightedValue",
|
|
1016
|
+
"type": "string | null",
|
|
1017
|
+
"required": false,
|
|
1018
|
+
"description": "The controlled highlighted value of the menu item.",
|
|
1019
|
+
"from": "@zag-js/menu"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"name": "id",
|
|
1023
|
+
"type": "string",
|
|
1024
|
+
"required": false,
|
|
1025
|
+
"description": "The unique identifier of the machine.",
|
|
1026
|
+
"from": "@zag-js/types"
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
"name": "ids",
|
|
1030
|
+
"type": "ElementIds",
|
|
1031
|
+
"required": false,
|
|
1032
|
+
"description": "The ids of the elements in the menu. Useful for composition.",
|
|
1033
|
+
"from": "@zag-js/menu"
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
"name": "immediate",
|
|
1037
|
+
"type": "boolean",
|
|
1038
|
+
"required": false,
|
|
1039
|
+
"description": "Whether to synchronize the present change immediately or defer it to the next frame",
|
|
1040
|
+
"from": "@zag-js/presence"
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
"name": "lazyMount",
|
|
1044
|
+
"type": "boolean",
|
|
1045
|
+
"required": false,
|
|
1046
|
+
"default": "true",
|
|
1047
|
+
"description": "Whether to enable lazy mounting",
|
|
1048
|
+
"from": "@ark-ui/react"
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
"name": "loopFocus",
|
|
1052
|
+
"type": "boolean",
|
|
1053
|
+
"required": false,
|
|
1054
|
+
"default": "false",
|
|
1055
|
+
"description": "Whether to loop the keyboard navigation.",
|
|
1056
|
+
"from": "@zag-js/menu"
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
"name": "navigate",
|
|
1060
|
+
"type": "((details: NavigateDetails) => void) | null",
|
|
1061
|
+
"required": false,
|
|
1062
|
+
"description": "Function to navigate to the selected item if it's an anchor element",
|
|
1063
|
+
"from": "@zag-js/menu"
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
"name": "onEnterComplete",
|
|
1067
|
+
"type": "VoidFunction",
|
|
1068
|
+
"required": false,
|
|
1069
|
+
"description": "Function called when the animation ends in the open state",
|
|
1070
|
+
"from": "@zag-js/presence"
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"name": "onEscapeKeyDown",
|
|
1074
|
+
"type": "((event: KeyboardEvent) => void)",
|
|
1075
|
+
"required": false,
|
|
1076
|
+
"description": "Function called when the escape key is pressed",
|
|
1077
|
+
"from": "@zag-js/dismissable"
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"name": "onExitComplete",
|
|
1081
|
+
"type": "VoidFunction",
|
|
1082
|
+
"required": false,
|
|
1083
|
+
"description": "Function called when the animation ends in the closed state",
|
|
1084
|
+
"from": "@zag-js/presence"
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
"name": "onFocusOutside",
|
|
1088
|
+
"type": "((event: FocusOutsideEvent) => void)",
|
|
1089
|
+
"required": false,
|
|
1090
|
+
"description": "Function called when the focus is moved outside the component",
|
|
1091
|
+
"from": "@zag-js/interact-outside"
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
"name": "onHighlightChange",
|
|
1095
|
+
"type": "((details: HighlightChangeDetails) => void)",
|
|
1096
|
+
"required": false,
|
|
1097
|
+
"description": "Function called when the highlighted menu item changes.",
|
|
1098
|
+
"from": "@zag-js/menu"
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
"name": "onInteractOutside",
|
|
1102
|
+
"type": "((event: InteractOutsideEvent) => void)",
|
|
1103
|
+
"required": false,
|
|
1104
|
+
"description": "Function called when an interaction happens outside the component",
|
|
1105
|
+
"from": "@zag-js/interact-outside"
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
"name": "onOpenChange",
|
|
1109
|
+
"type": "((details: OpenChangeDetails) => void)",
|
|
1110
|
+
"required": false,
|
|
1111
|
+
"description": "Function called when the menu opens or closes",
|
|
1112
|
+
"from": "@zag-js/menu"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
"name": "onPointerDownOutside",
|
|
1116
|
+
"type": "((event: PointerDownOutsideEvent) => void)",
|
|
1117
|
+
"required": false,
|
|
1118
|
+
"description": "Function called when the pointer is pressed down outside the component",
|
|
1119
|
+
"from": "@zag-js/interact-outside"
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"name": "onRequestDismiss",
|
|
1123
|
+
"type": "((event: LayerDismissEvent) => void)",
|
|
1124
|
+
"required": false,
|
|
1125
|
+
"description": "Function called when this layer is closed due to a parent layer being closed",
|
|
1126
|
+
"from": "@zag-js/dismissable"
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
"name": "onSelect",
|
|
1130
|
+
"type": "((details: SelectionDetails) => void)",
|
|
1131
|
+
"required": false,
|
|
1132
|
+
"description": "Function called when a menu item is selected.",
|
|
1133
|
+
"from": "@zag-js/menu"
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
"name": "onTriggerValueChange",
|
|
1137
|
+
"type": "((details: TriggerValueChangeDetails) => void)",
|
|
1138
|
+
"required": false,
|
|
1139
|
+
"description": "Function called when the trigger value changes.",
|
|
1140
|
+
"from": "@zag-js/menu"
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
"name": "open",
|
|
1144
|
+
"type": "boolean",
|
|
1145
|
+
"required": false,
|
|
1146
|
+
"description": "The controlled open state of the menu",
|
|
1147
|
+
"from": "@zag-js/menu"
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
"name": "positioning",
|
|
1151
|
+
"type": "PositioningOptions",
|
|
1152
|
+
"required": false,
|
|
1153
|
+
"description": "The options used to dynamically position the menu",
|
|
1154
|
+
"from": "@zag-js/menu"
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
"name": "present",
|
|
1158
|
+
"type": "boolean",
|
|
1159
|
+
"required": false,
|
|
1160
|
+
"description": "Whether the node is present (controlled by the user)",
|
|
1161
|
+
"from": "@zag-js/presence"
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
"name": "skipAnimationOnMount",
|
|
1165
|
+
"type": "boolean",
|
|
1166
|
+
"required": false,
|
|
1167
|
+
"default": "false",
|
|
1168
|
+
"description": "Whether to allow the initial presence animation.",
|
|
1169
|
+
"from": "@ark-ui/react"
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
"name": "triggerValue",
|
|
1173
|
+
"type": "string | null",
|
|
1174
|
+
"required": false,
|
|
1175
|
+
"description": "The controlled trigger value",
|
|
1176
|
+
"from": "@zag-js/menu"
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
"name": "typeahead",
|
|
1180
|
+
"type": "boolean",
|
|
1181
|
+
"required": false,
|
|
1182
|
+
"default": "true",
|
|
1183
|
+
"description": "Whether the pressing printable characters should trigger typeahead navigation",
|
|
1184
|
+
"from": "@zag-js/menu"
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
"name": "unmountOnExit",
|
|
1188
|
+
"type": "boolean",
|
|
1189
|
+
"required": false,
|
|
1190
|
+
"default": "true",
|
|
1191
|
+
"description": "Whether to unmount on exit.",
|
|
1192
|
+
"from": "@ark-ui/react"
|
|
1193
|
+
}
|
|
1194
|
+
]
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
"name": "MenubarSubContent",
|
|
1198
|
+
"props": [
|
|
1199
|
+
{
|
|
1200
|
+
"name": "asChild",
|
|
1201
|
+
"type": "boolean",
|
|
1202
|
+
"required": false,
|
|
1203
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
1204
|
+
"from": "@ark-ui/react"
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
"name": "children",
|
|
1208
|
+
"type": "ReactNode",
|
|
1209
|
+
"required": false,
|
|
1210
|
+
"description": "Content rendered inside the part.",
|
|
1211
|
+
"from": "@types/react"
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
"name": "className",
|
|
1215
|
+
"type": "string",
|
|
1216
|
+
"required": false,
|
|
1217
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
1218
|
+
"from": "@types/react"
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
"name": "style",
|
|
1222
|
+
"type": "CSSProperties",
|
|
1223
|
+
"required": false,
|
|
1224
|
+
"description": "Inline styles applied to the rendered element.",
|
|
1225
|
+
"from": "@types/react"
|
|
1226
|
+
}
|
|
1227
|
+
]
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
"name": "MenubarSubTrigger",
|
|
1231
|
+
"props": [
|
|
1232
|
+
{
|
|
1233
|
+
"name": "inset",
|
|
1234
|
+
"type": "boolean",
|
|
1235
|
+
"required": false,
|
|
1236
|
+
"description": "Indent the item to align with items that have an indicator.",
|
|
1237
|
+
"from": "arkcn"
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
"name": "asChild",
|
|
1241
|
+
"type": "boolean",
|
|
1242
|
+
"required": false,
|
|
1243
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
1244
|
+
"from": "@ark-ui/react"
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
"name": "children",
|
|
1248
|
+
"type": "ReactNode",
|
|
1249
|
+
"required": false,
|
|
1250
|
+
"description": "Content rendered inside the part.",
|
|
1251
|
+
"from": "@types/react"
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
"name": "className",
|
|
1255
|
+
"type": "string",
|
|
1256
|
+
"required": false,
|
|
1257
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
1258
|
+
"from": "@types/react"
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
"name": "style",
|
|
1262
|
+
"type": "CSSProperties",
|
|
1263
|
+
"required": false,
|
|
1264
|
+
"description": "Inline styles applied to the rendered element.",
|
|
1265
|
+
"from": "@types/react"
|
|
1266
|
+
}
|
|
1267
|
+
]
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
"name": "MenubarTrigger",
|
|
1271
|
+
"props": [
|
|
1272
|
+
{
|
|
1273
|
+
"name": "asChild",
|
|
1274
|
+
"type": "boolean",
|
|
1275
|
+
"required": false,
|
|
1276
|
+
"description": "Use the provided child element as the default rendered element, combining their props and behavior.",
|
|
1277
|
+
"from": "@ark-ui/react"
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
"name": "children",
|
|
1281
|
+
"type": "ReactNode",
|
|
1282
|
+
"required": false,
|
|
1283
|
+
"description": "Content rendered inside the part.",
|
|
1284
|
+
"from": "@types/react"
|
|
1285
|
+
},
|
|
1286
|
+
{
|
|
1287
|
+
"name": "className",
|
|
1288
|
+
"type": "string",
|
|
1289
|
+
"required": false,
|
|
1290
|
+
"description": "Extra classes merged into the part's own classes with `cn`.",
|
|
1291
|
+
"from": "@types/react"
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
"name": "style",
|
|
1295
|
+
"type": "CSSProperties",
|
|
1296
|
+
"required": false,
|
|
1297
|
+
"description": "Inline styles applied to the rendered element.",
|
|
1298
|
+
"from": "@types/react"
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
"name": "value",
|
|
1302
|
+
"type": "string",
|
|
1303
|
+
"required": false,
|
|
1304
|
+
"description": "The value that identifies this specific trigger",
|
|
1305
|
+
"from": "@zag-js/menu"
|
|
1306
|
+
}
|
|
1307
|
+
]
|
|
1308
|
+
}
|
|
1309
|
+
],
|
|
29
1310
|
"dependencies": {
|
|
30
1311
|
"@ark-ui/react": "^5.39.1",
|
|
31
1312
|
"lucide-react": "^1.41.0"
|
|
@@ -37,7 +1318,7 @@
|
|
|
37
1318
|
"files": [
|
|
38
1319
|
{
|
|
39
1320
|
"path": "components/ui/menubar.tsx",
|
|
40
|
-
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { useControllable } from \"@/lib/controllable\"\nimport { Menu as MenubarPrimitive, Portal as PortalPrimitive } from \"@ark-ui/react\"\nimport { CheckIcon, ChevronRightIcon } from \"lucide-react\"\n\n/**\n * Ark UI has no Menubar primitive. `Menubar` composes Ark `Menu` roots and adds\n * the menubar behaviours Radix provides: one open menu at a time, hover\n * switching between triggers once a menu is open, roving tabindex across\n * triggers, and ArrowLeft/ArrowRight moving between menus.\n */\n\ntype MenubarContextValue = {\n value: string | null\n setValue: (value: string | null) => void\n loop: boolean\n register: (id: string) => () => void\n order: string[]\n rootRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst MenubarContext = React.createContext<MenubarContextValue | null>(null)\nconst MenubarMenuContext = React.createContext<string | null>(null)\n\nfunction useMenubar(component: string) {\n const ctx = React.useContext(MenubarContext)\n if (!ctx) throw new Error(`${component} must be used within <Menubar>`)\n return ctx\n}\n\nfunction useMenubarMenu(component: string) {\n const id = React.useContext(MenubarMenuContext)\n if (!id) throw new Error(`${component} must be used within <MenubarMenu>`)\n return id\n}\n\nfunction Menubar({\n className,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n loop = false,\n ...props\n}: Omit<React.ComponentProps<\"div\">, \"value\" | \"defaultValue\"> & {\n /** The id of the open menu (controlled). */\n value?: string | null\n defaultValue?: string | null\n onValueChange?: (value: string | null) => void\n /** Whether ArrowLeft/ArrowRight wrap around at the ends. */\n loop?: boolean\n}) {\n const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange)\n const [order, setOrder] = React.useState<string[]>([])\n const register = React.useCallback((id: string) => {\n setOrder((prev) => (prev.includes(id) ? prev : [...prev, id]))\n return () => setOrder((prev) => prev.filter((x) => x !== id))\n }, [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const ctx = React.useMemo(\n () => ({ value, setValue, loop, register, order, rootRef }),\n [value, setValue, loop, register, order]\n )\n return (\n <MenubarContext.Provider value={ctx}>\n <div\n ref={rootRef}\n role=\"menubar\"\n data-slot=\"menubar\"\n className={cn(\"flex h-8 items-center gap-0.5 rounded-lg border p-0.75\", className)}\n {...props}\n />\n </MenubarContext.Provider>\n )\n}\n\nfunction useMenubarNavigation() {\n const ctx = useMenubar(\"MenubarTrigger\")\n return React.useCallback(\n (fromId: string, direction: 1 | -1, open: boolean) => {\n const { order, loop, rootRef, setValue } = ctx\n const index = order.indexOf(fromId)\n let next = index + direction\n if (next < 0) next = loop ? order.length - 1 : 0\n if (next >= order.length) next = loop ? 0 : order.length - 1\n const nextId = order[next]\n if (!nextId || nextId === fromId) return\n const trigger = rootRef.current?.querySelector<HTMLElement>(\n `[data-slot=\"menubar-trigger\"][data-menubar-value=\"${nextId}\"]`\n )\n trigger?.focus()\n setValue(open ? nextId : null)\n },\n [ctx]\n )\n}\n\nfunction MenubarMenu({\n value: valueProp,\n positioning,\n lazyMount = true,\n unmountOnExit = true,\n onOpenChange,\n ...props\n}: Omit<React.ComponentProps<typeof MenubarPrimitive.Root>, \"open\" | \"defaultOpen\"> & {\n /** Identifies this menu within the menubar. Auto-generated when omitted. */\n value?: string\n}) {\n const ctx = useMenubar(\"MenubarMenu\")\n const generated = React.useId()\n const id = valueProp ?? generated\n const { register } = ctx\n React.useEffect(() => register(id), [register, id])\n return (\n <MenubarMenuContext.Provider value={id}>\n <MenubarPrimitive.Root\n open={ctx.value === id}\n onOpenChange={(details) => {\n ctx.setValue(details.open ? id : ctx.value === id ? null : ctx.value)\n onOpenChange?.(details)\n }}\n positioning={{\n placement: \"bottom-start\",\n gutter: 8,\n offset: { crossAxis: -4 },\n ...positioning,\n }}\n lazyMount={lazyMount}\n unmountOnExit={unmountOnExit}\n {...props}\n />\n </MenubarMenuContext.Provider>\n )\n}\n\nfunction MenubarTrigger({\n className,\n onPointerEnter,\n onKeyDown,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {\n const ctx = useMenubar(\"MenubarTrigger\")\n const id = useMenubarMenu(\"MenubarTrigger\")\n const navigate = useMenubarNavigation()\n const isOpen = ctx.value === id\n const isFirst = ctx.order[0] === id\n return (\n <MenubarPrimitive.Trigger\n data-slot=\"menubar-trigger\"\n data-menubar-value={id}\n tabIndex={isOpen || (ctx.value === null && isFirst) ? 0 : -1}\n className={cn(\n \"flex items-center rounded-sm px-1.5 py-0.5 text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted\",\n className\n )}\n onPointerEnter={(event) => {\n onPointerEnter?.(event)\n if (ctx.value !== null && ctx.value !== id) ctx.setValue(id)\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented) return\n if (event.key === \"ArrowRight\" || event.key === \"ArrowLeft\") {\n event.preventDefault()\n navigate(id, event.key === \"ArrowRight\" ? 1 : -1, isOpen)\n }\n }}\n {...props}\n />\n )\n}\n\nfunction MenubarPortal({ ...props }: React.ComponentProps<typeof PortalPrimitive>) {\n return <PortalPrimitive {...props} />\n}\n\nfunction MenubarMenuContext_({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Context>) {\n return <MenubarPrimitive.Context {...props} />\n}\n\nfunction MenubarPositioner({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Positioner>) {\n return (\n <MenubarPrimitive.Positioner\n data-slot=\"menubar-positioner\"\n className={cn(\"[--z-index:50]\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarContent({ className, onKeyDown, ...props }: React.ComponentProps<typeof MenubarPrimitive.Content>) {\n const id = useMenubarMenu(\"MenubarContent\")\n const navigate = useMenubarNavigation()\n return (\n <MenubarPortal>\n <MenubarPositioner>\n <MenubarPrimitive.Content\n data-slot=\"menubar-content\"\n className={cn(\n \"z-50 min-w-36 origin-(--transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95\",\n className\n )}\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented) return\n if (event.key !== \"ArrowRight\" && event.key !== \"ArrowLeft\") return\n const target = event.target as HTMLElement\n // Inside a submenu, Ark owns ArrowLeft (close) and ArrowRight.\n if (target.closest('[data-slot=\"menubar-sub-content\"]')) return\n // On a highlighted sub trigger, ArrowRight opens the submenu.\n if (\n event.key === \"ArrowRight\" &&\n event.currentTarget.querySelector('[data-slot=\"menubar-sub-trigger\"][data-highlighted]')\n )\n return\n event.preventDefault()\n navigate(id, event.key === \"ArrowRight\" ? 1 : -1, true)\n }}\n {...props}\n />\n </MenubarPositioner>\n </MenubarPortal>\n )\n}\n\nfunction MenubarArrow({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Arrow>) {\n return (\n <MenubarPrimitive.Arrow\n data-slot=\"menubar-arrow\"\n className={cn(\"[--arrow-background:var(--color-popover)] [--arrow-size:0.625rem]\", className)}\n {...props}\n >\n <MenubarPrimitive.ArrowTip data-slot=\"menubar-arrow-tip\" className=\"border-t border-l border-foreground/10\" />\n </MenubarPrimitive.Arrow>\n )\n}\n\nfunction MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.ItemGroup>) {\n return <MenubarPrimitive.ItemGroup data-slot=\"menubar-group\" {...props} />\n}\n\nfunction MenubarItem({\n className,\n inset,\n variant = \"default\",\n value,\n ...props\n}: Omit<React.ComponentProps<typeof MenubarPrimitive.Item>, \"value\"> & {\n value?: string\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n const id = React.useId()\n return (\n <MenubarPrimitive.Item\n data-slot=\"menubar-item\"\n data-inset={inset}\n data-variant={variant}\n value={value ?? id}\n className={cn(\n \"group/menubar-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-highlighted:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction MenubarItemText({ ...props }: React.ComponentProps<typeof MenubarPrimitive.ItemText>) {\n return <MenubarPrimitive.ItemText data-slot=\"menubar-item-text\" {...props} />\n}\n\nfunction MenubarItemIndicator({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.ItemIndicator>) {\n return (\n <MenubarPrimitive.ItemIndicator\n data-slot=\"menubar-item-indicator\"\n className={cn(\"pointer-events-none absolute right-2 flex items-center justify-center\", className)}\n {...props}\n />\n )\n}\n\nconst optionItemClassName =\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n\nfunction MenubarCheckboxItem({\n className,\n children,\n checked = false,\n inset,\n value,\n ...props\n}: Omit<React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>, \"checked\" | \"value\"> & {\n checked?: boolean\n value?: string\n inset?: boolean\n}) {\n const id = React.useId()\n return (\n <MenubarPrimitive.CheckboxItem\n data-slot=\"menubar-checkbox-item\"\n data-inset={inset}\n className={cn(optionItemClassName, className)}\n checked={checked}\n value={value ?? id}\n {...props}\n >\n <MenubarItemIndicator data-slot=\"menubar-checkbox-item-indicator\">\n <CheckIcon />\n </MenubarItemIndicator>\n {children}\n </MenubarPrimitive.CheckboxItem>\n )\n}\n\nfunction MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioItemGroup>) {\n return <MenubarPrimitive.RadioItemGroup data-slot=\"menubar-radio-group\" {...props} />\n}\n\nfunction MenubarRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.RadioItem> & {\n inset?: boolean\n}) {\n return (\n <MenubarPrimitive.RadioItem\n data-slot=\"menubar-radio-item\"\n data-inset={inset}\n className={cn(optionItemClassName, className)}\n {...props}\n >\n <MenubarItemIndicator data-slot=\"menubar-radio-item-indicator\">\n <CheckIcon />\n </MenubarItemIndicator>\n {children}\n </MenubarPrimitive.RadioItem>\n )\n}\n\nfunction MenubarLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.ItemGroupLabel> & {\n inset?: boolean\n}) {\n return (\n <MenubarPrimitive.ItemGroupLabel\n data-slot=\"menubar-label\"\n data-inset={inset}\n className={cn(\"px-1.5 py-1 text-sm font-medium data-inset:pl-7\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarSeparator({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Separator>) {\n return (\n <MenubarPrimitive.Separator\n data-slot=\"menubar-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"menubar-shortcut\"\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground group-data-highlighted/menubar-item:text-accent-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction MenubarSub({\n lazyMount = true,\n unmountOnExit = true,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.Root>) {\n return <MenubarPrimitive.Root lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n}\n\nfunction MenubarSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.TriggerItem> & {\n inset?: boolean\n}) {\n return (\n <MenubarPrimitive.TriggerItem\n data-slot=\"menubar-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </MenubarPrimitive.TriggerItem>\n )\n}\n\nfunction MenubarSubContent({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Content>) {\n return (\n <MenubarPortal>\n <MenubarPositioner>\n <MenubarPrimitive.Content\n data-slot=\"menubar-sub-content\"\n className={cn(\n \"z-50 min-w-32 origin-(--transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </MenubarPositioner>\n </MenubarPortal>\n )\n}\n\nexport {\n Menubar,\n MenubarArrow,\n MenubarCheckboxItem,\n MenubarContent,\n MenubarMenuContext_ as MenubarContext,\n MenubarGroup,\n MenubarItem,\n MenubarItemIndicator,\n MenubarItemText,\n MenubarLabel,\n MenubarMenu,\n MenubarPortal,\n MenubarPositioner,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarTrigger,\n}\n"
|
|
1321
|
+
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { useControllable } from \"@/lib/controllable\"\nimport { Menu as MenubarPrimitive, Portal as PortalPrimitive } from \"@ark-ui/react\"\nimport { CheckIcon, ChevronRightIcon } from \"lucide-react\"\n\n/**\n * Ark UI has no Menubar primitive. `Menubar` composes Ark `Menu` roots and adds\n * the menubar behaviours Radix provides: one open menu at a time, hover\n * switching between triggers once a menu is open, roving tabindex across\n * triggers, and ArrowLeft/ArrowRight moving between menus.\n */\n\ntype MenubarContextValue = {\n value: string | null\n setValue: (value: string | null) => void\n loop: boolean\n register: (id: string) => () => void\n order: string[]\n rootRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst MenubarContext = React.createContext<MenubarContextValue | null>(null)\nconst MenubarMenuContext = React.createContext<string | null>(null)\n\nfunction useMenubar(component: string) {\n const ctx = React.useContext(MenubarContext)\n if (!ctx) throw new Error(`${component} must be used within <Menubar>`)\n return ctx\n}\n\nfunction useMenubarMenu(component: string) {\n const id = React.useContext(MenubarMenuContext)\n if (!id) throw new Error(`${component} must be used within <MenubarMenu>`)\n return id\n}\n\nfunction Menubar({\n className,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n loop = false,\n ...props\n}: Omit<React.ComponentProps<\"div\">, \"value\" | \"defaultValue\"> & {\n /** The id of the open menu (controlled). */\n value?: string | null\n defaultValue?: string | null\n onValueChange?: (value: string | null) => void\n /** Whether ArrowLeft/ArrowRight wrap around at the ends. */\n loop?: boolean\n}) {\n const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange)\n const [order, setOrder] = React.useState<string[]>([])\n const register = React.useCallback((id: string) => {\n setOrder((prev) => (prev.includes(id) ? prev : [...prev, id]))\n return () => setOrder((prev) => prev.filter((x) => x !== id))\n }, [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const ctx = React.useMemo(\n () => ({ value, setValue, loop, register, order, rootRef }),\n [value, setValue, loop, register, order]\n )\n return (\n <MenubarContext.Provider value={ctx}>\n <div\n ref={rootRef}\n role=\"menubar\"\n data-slot=\"menubar\"\n className={cn(\"flex h-8 items-center gap-0.5 rounded-lg border p-0.75\", className)}\n {...props}\n />\n </MenubarContext.Provider>\n )\n}\n\nfunction useMenubarNavigation() {\n const ctx = useMenubar(\"MenubarTrigger\")\n return React.useCallback(\n (fromId: string, direction: 1 | -1, open: boolean) => {\n const { order, loop, rootRef, setValue } = ctx\n const index = order.indexOf(fromId)\n let next = index + direction\n if (next < 0) next = loop ? order.length - 1 : 0\n if (next >= order.length) next = loop ? 0 : order.length - 1\n const nextId = order[next]\n if (!nextId || nextId === fromId) return\n const trigger = rootRef.current?.querySelector<HTMLElement>(\n `[data-slot=\"menubar-trigger\"][data-menubar-value=\"${nextId}\"]`\n )\n trigger?.focus()\n setValue(open ? nextId : null)\n },\n [ctx]\n )\n}\n\nfunction MenubarMenu({\n value: valueProp,\n positioning,\n lazyMount = true,\n unmountOnExit = true,\n onOpenChange,\n ...props\n}: Omit<React.ComponentProps<typeof MenubarPrimitive.Root>, \"open\" | \"defaultOpen\"> & {\n /** Identifies this menu within the menubar. Auto-generated when omitted. */\n value?: string\n}) {\n const ctx = useMenubar(\"MenubarMenu\")\n const generated = React.useId()\n const id = valueProp ?? generated\n const { register } = ctx\n React.useEffect(() => register(id), [register, id])\n return (\n <MenubarMenuContext.Provider value={id}>\n <MenubarPrimitive.Root\n open={ctx.value === id}\n onOpenChange={(details) => {\n ctx.setValue(details.open ? id : ctx.value === id ? null : ctx.value)\n onOpenChange?.(details)\n }}\n positioning={{\n placement: \"bottom-start\",\n gutter: 8,\n offset: { crossAxis: -4 },\n ...positioning,\n }}\n lazyMount={lazyMount}\n unmountOnExit={unmountOnExit}\n {...props}\n />\n </MenubarMenuContext.Provider>\n )\n}\n\nfunction MenubarTrigger({\n className,\n onPointerEnter,\n onKeyDown,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {\n const ctx = useMenubar(\"MenubarTrigger\")\n const id = useMenubarMenu(\"MenubarTrigger\")\n const navigate = useMenubarNavigation()\n const isOpen = ctx.value === id\n const isFirst = ctx.order[0] === id\n return (\n <MenubarPrimitive.Trigger\n data-slot=\"menubar-trigger\"\n data-menubar-value={id}\n tabIndex={isOpen || (ctx.value === null && isFirst) ? 0 : -1}\n className={cn(\n \"flex items-center rounded-sm px-1.5 py-0.5 text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted\",\n className\n )}\n onPointerEnter={(event) => {\n onPointerEnter?.(event)\n if (ctx.value !== null && ctx.value !== id) ctx.setValue(id)\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented) return\n if (event.key === \"ArrowRight\" || event.key === \"ArrowLeft\") {\n event.preventDefault()\n navigate(id, event.key === \"ArrowRight\" ? 1 : -1, isOpen)\n }\n }}\n {...props}\n />\n )\n}\n\nfunction MenubarPortal({ ...props }: React.ComponentProps<typeof PortalPrimitive>) {\n return <PortalPrimitive {...props} />\n}\n\nfunction MenubarMenuContext_({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Context>) {\n return <MenubarPrimitive.Context {...props} />\n}\n\nfunction MenubarPositioner({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Positioner>) {\n return (\n <MenubarPrimitive.Positioner\n data-slot=\"menubar-positioner\"\n className={cn(\"[--z-index:50]\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarContent({ className, onKeyDown, ...props }: React.ComponentProps<typeof MenubarPrimitive.Content>) {\n const id = useMenubarMenu(\"MenubarContent\")\n const navigate = useMenubarNavigation()\n return (\n <MenubarPortal>\n <MenubarPositioner>\n <MenubarPrimitive.Content\n data-slot=\"menubar-content\"\n className={cn(\n \"z-50 min-w-36 origin-(--transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95\",\n className\n )}\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented) return\n if (event.key !== \"ArrowRight\" && event.key !== \"ArrowLeft\") return\n const target = event.target as HTMLElement\n // Inside a submenu, Ark owns ArrowLeft (close) and ArrowRight.\n if (target.closest('[data-slot=\"menubar-sub-content\"]')) return\n // On a highlighted sub trigger, ArrowRight opens the submenu.\n if (\n event.key === \"ArrowRight\" &&\n event.currentTarget.querySelector('[data-slot=\"menubar-sub-trigger\"][data-highlighted]')\n )\n return\n event.preventDefault()\n navigate(id, event.key === \"ArrowRight\" ? 1 : -1, true)\n }}\n {...props}\n />\n </MenubarPositioner>\n </MenubarPortal>\n )\n}\n\nfunction MenubarArrow({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Arrow>) {\n return (\n <MenubarPrimitive.Arrow\n data-slot=\"menubar-arrow\"\n className={cn(\"[--arrow-background:var(--color-popover)] [--arrow-size:0.625rem]\", className)}\n {...props}\n >\n <MenubarPrimitive.ArrowTip data-slot=\"menubar-arrow-tip\" className=\"border-t border-l border-foreground/10\" />\n </MenubarPrimitive.Arrow>\n )\n}\n\nfunction MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.ItemGroup>) {\n return <MenubarPrimitive.ItemGroup data-slot=\"menubar-group\" {...props} />\n}\n\nfunction MenubarItem({\n className,\n inset,\n variant = \"default\",\n value,\n ...props\n}: Omit<React.ComponentProps<typeof MenubarPrimitive.Item>, \"value\"> & {\n value?: string\n /** Indent the item to align with items that have an indicator. */\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n const id = React.useId()\n return (\n <MenubarPrimitive.Item\n data-slot=\"menubar-item\"\n data-inset={inset}\n data-variant={variant}\n value={value ?? id}\n className={cn(\n \"group/menubar-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-highlighted:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction MenubarItemText({ ...props }: React.ComponentProps<typeof MenubarPrimitive.ItemText>) {\n return <MenubarPrimitive.ItemText data-slot=\"menubar-item-text\" {...props} />\n}\n\nfunction MenubarItemIndicator({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.ItemIndicator>) {\n return (\n <MenubarPrimitive.ItemIndicator\n data-slot=\"menubar-item-indicator\"\n className={cn(\"pointer-events-none absolute right-2 flex items-center justify-center\", className)}\n {...props}\n />\n )\n}\n\nconst optionItemClassName =\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n\nfunction MenubarCheckboxItem({\n className,\n children,\n checked = false,\n inset,\n value,\n ...props\n}: Omit<React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>, \"checked\" | \"value\"> & {\n /** Checked state of the item. */\n checked?: boolean\n value?: string\n /** Indent the item to align with items that have an indicator. */\n inset?: boolean\n}) {\n const id = React.useId()\n return (\n <MenubarPrimitive.CheckboxItem\n data-slot=\"menubar-checkbox-item\"\n data-inset={inset}\n className={cn(optionItemClassName, className)}\n checked={checked}\n value={value ?? id}\n {...props}\n >\n <MenubarItemIndicator data-slot=\"menubar-checkbox-item-indicator\">\n <CheckIcon />\n </MenubarItemIndicator>\n {children}\n </MenubarPrimitive.CheckboxItem>\n )\n}\n\nfunction MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioItemGroup>) {\n return <MenubarPrimitive.RadioItemGroup data-slot=\"menubar-radio-group\" {...props} />\n}\n\nfunction MenubarRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.RadioItem> & {\n /** Indent the item to align with items that have an indicator. */\n inset?: boolean\n}) {\n return (\n <MenubarPrimitive.RadioItem\n data-slot=\"menubar-radio-item\"\n data-inset={inset}\n className={cn(optionItemClassName, className)}\n {...props}\n >\n <MenubarItemIndicator data-slot=\"menubar-radio-item-indicator\">\n <CheckIcon />\n </MenubarItemIndicator>\n {children}\n </MenubarPrimitive.RadioItem>\n )\n}\n\nfunction MenubarLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.ItemGroupLabel> & {\n /** Indent the item to align with items that have an indicator. */\n inset?: boolean\n}) {\n return (\n <MenubarPrimitive.ItemGroupLabel\n data-slot=\"menubar-label\"\n data-inset={inset}\n className={cn(\"px-1.5 py-1 text-sm font-medium data-inset:pl-7\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarSeparator({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Separator>) {\n return (\n <MenubarPrimitive.Separator\n data-slot=\"menubar-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction MenubarShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"menubar-shortcut\"\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground group-data-highlighted/menubar-item:text-accent-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction MenubarSub({\n lazyMount = true,\n unmountOnExit = true,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.Root>) {\n return <MenubarPrimitive.Root lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />\n}\n\nfunction MenubarSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof MenubarPrimitive.TriggerItem> & {\n /** Indent the item to align with items that have an indicator. */\n inset?: boolean\n}) {\n return (\n <MenubarPrimitive.TriggerItem\n data-slot=\"menubar-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </MenubarPrimitive.TriggerItem>\n )\n}\n\nfunction MenubarSubContent({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Content>) {\n return (\n <MenubarPortal>\n <MenubarPositioner>\n <MenubarPrimitive.Content\n data-slot=\"menubar-sub-content\"\n className={cn(\n \"z-50 min-w-32 origin-(--transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </MenubarPositioner>\n </MenubarPortal>\n )\n}\n\nexport {\n Menubar,\n MenubarArrow,\n MenubarCheckboxItem,\n MenubarContent,\n MenubarMenuContext_ as MenubarContext,\n MenubarGroup,\n MenubarItem,\n MenubarItemIndicator,\n MenubarItemText,\n MenubarLabel,\n MenubarMenu,\n MenubarPortal,\n MenubarPositioner,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarTrigger,\n}\n"
|
|
41
1322
|
}
|
|
42
1323
|
]
|
|
43
1324
|
}
|