@jrkropp/codex-js-react 0.2.0

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +29 -0
  4. package/README.md +55 -0
  5. package/dist/components/chat-runtime.d.ts +58 -0
  6. package/dist/components/codex-chat-layout.d.ts +23 -0
  7. package/dist/components/codex-chat-render-state.d.ts +158 -0
  8. package/dist/components/codex-chat-view.d.ts +58 -0
  9. package/dist/components/codex-chat.d.ts +11 -0
  10. package/dist/components/index.d.ts +11 -0
  11. package/dist/components/primitives.d.ts +13 -0
  12. package/dist/hooks/chat-lifecycle.d.ts +73 -0
  13. package/dist/hooks/index.d.ts +5 -0
  14. package/dist/hooks/lifecycle.d.ts +41 -0
  15. package/dist/hooks/thread-reader.d.ts +3 -0
  16. package/dist/index.d.ts +2 -0
  17. package/dist/index.js +9773 -0
  18. package/dist/internal/chat-ui/components/ChatMarkdown.d.ts +7 -0
  19. package/dist/internal/chat-ui/components/ComposerPromptEditor.d.ts +34 -0
  20. package/dist/internal/chat-ui/components/chat/ChangedFilesTree.d.ts +5 -0
  21. package/dist/internal/chat-ui/components/chat/ChangedFilesTree.logic.d.ts +33 -0
  22. package/dist/internal/chat-ui/components/chat/ChatComposer.d.ts +103 -0
  23. package/dist/internal/chat-ui/components/chat/ChatView.d.ts +23 -0
  24. package/dist/internal/chat-ui/components/chat/CompactComposerControlsMenu.d.ts +16 -0
  25. package/dist/internal/chat-ui/components/chat/ComposerBannerStack.d.ts +20 -0
  26. package/dist/internal/chat-ui/components/chat/ComposerCommandMenu.d.ts +35 -0
  27. package/dist/internal/chat-ui/components/chat/ComposerPendingApprovalActions.d.ts +9 -0
  28. package/dist/internal/chat-ui/components/chat/ComposerPendingApprovalPanel.d.ts +9 -0
  29. package/dist/internal/chat-ui/components/chat/ComposerPendingTerminalContexts.d.ts +18 -0
  30. package/dist/internal/chat-ui/components/chat/ComposerPendingUserInputPanel.d.ts +12 -0
  31. package/dist/internal/chat-ui/components/chat/ComposerPlanFollowUpBanner.d.ts +3 -0
  32. package/dist/internal/chat-ui/components/chat/ComposerPrimaryActions.d.ts +17 -0
  33. package/dist/internal/chat-ui/components/chat/ComposerPrimaryActions.logic.d.ts +13 -0
  34. package/dist/internal/chat-ui/components/chat/ComposerRealtimeConversationControl.d.ts +7 -0
  35. package/dist/internal/chat-ui/components/chat/ContextWindowMeter.d.ts +4 -0
  36. package/dist/internal/chat-ui/components/chat/ExpandedImageDialog.d.ts +5 -0
  37. package/dist/internal/chat-ui/components/chat/MessagesTimeline.d.ts +16 -0
  38. package/dist/internal/chat-ui/components/chat/MessagesTimeline.logic.d.ts +113 -0
  39. package/dist/internal/chat-ui/components/chat/ModelListRow.d.ts +9 -0
  40. package/dist/internal/chat-ui/components/chat/ModelPickerContent.d.ts +15 -0
  41. package/dist/internal/chat-ui/components/chat/ModelPickerSidebar.d.ts +8 -0
  42. package/dist/internal/chat-ui/components/chat/ProposedPlanCard.d.ts +3 -0
  43. package/dist/internal/chat-ui/components/chat/ProviderInstanceIcon.d.ts +12 -0
  44. package/dist/internal/chat-ui/components/chat/ProviderModelPicker.d.ts +14 -0
  45. package/dist/internal/chat-ui/components/chat/ProviderStatusBanner.d.ts +9 -0
  46. package/dist/internal/chat-ui/components/chat/TerminalContextInlineChip.d.ts +7 -0
  47. package/dist/internal/chat-ui/components/chat/TraitsPicker.d.ts +7 -0
  48. package/dist/internal/chat-ui/components/chat/composer-draft.client.d.ts +50 -0
  49. package/dist/internal/chat-ui/components/chat/composer-editor-mentions.d.ts +15 -0
  50. package/dist/internal/chat-ui/components/chat/composer-footer-layout.d.ts +9 -0
  51. package/dist/internal/chat-ui/components/chat/composer-image-attachments.d.ts +46 -0
  52. package/dist/internal/chat-ui/components/chat/composer-logic.d.ts +15 -0
  53. package/dist/internal/chat-ui/components/chat/composer-mention-targets.d.ts +12 -0
  54. package/dist/internal/chat-ui/components/chat/composer-realtime-conversation.logic.d.ts +26 -0
  55. package/dist/internal/chat-ui/components/chat/composer-send-state.logic.d.ts +17 -0
  56. package/dist/internal/chat-ui/components/chat/composerMenuHighlight.d.ts +8 -0
  57. package/dist/internal/chat-ui/components/chat/composerProviderState.d.ts +33 -0
  58. package/dist/internal/chat-ui/components/chat/composerSlashCommandSearch.d.ts +6 -0
  59. package/dist/internal/chat-ui/components/chat/index.d.ts +54 -0
  60. package/dist/internal/chat-ui/components/chat/mention-bindings.d.ts +26 -0
  61. package/dist/internal/chat-ui/components/chat/mention-codec.d.ts +22 -0
  62. package/dist/internal/chat-ui/components/chat/mention-syntax.d.ts +9 -0
  63. package/dist/internal/chat-ui/components/chat/modelPickerSearch.d.ts +16 -0
  64. package/dist/internal/chat-ui/components/chat/proposed-plan.d.ts +17 -0
  65. package/dist/internal/chat-ui/components/chat/providerIconUtils.d.ts +15 -0
  66. package/dist/internal/chat-ui/components/composerInlineChip.d.ts +5 -0
  67. package/dist/internal/chat-ui/components/ui/alert.d.ts +10 -0
  68. package/dist/internal/chat-ui/components/ui/badge.d.ts +10 -0
  69. package/dist/internal/chat-ui/components/ui/button.d.ts +10 -0
  70. package/dist/internal/chat-ui/components/ui/command.d.ts +18 -0
  71. package/dist/internal/chat-ui/components/ui/dialog.d.ts +17 -0
  72. package/dist/internal/chat-ui/components/ui/dropdown-menu.d.ts +29 -0
  73. package/dist/internal/chat-ui/components/ui/input.d.ts +3 -0
  74. package/dist/internal/chat-ui/components/ui/popover.d.ts +10 -0
  75. package/dist/internal/chat-ui/components/ui/separator.d.ts +4 -0
  76. package/dist/internal/chat-ui/components/ui/tooltip.d.ts +8 -0
  77. package/dist/internal/chat-ui/index.d.ts +2 -0
  78. package/dist/internal/chat-ui/lib/contextWindow.d.ts +27 -0
  79. package/dist/internal/chat-ui/lib/modelSelection.d.ts +36 -0
  80. package/dist/internal/chat-ui/lib/searchRanking.d.ts +27 -0
  81. package/dist/internal/chat-ui/lib/utils.d.ts +2 -0
  82. package/dist/internal/chat-ui/pendingUserInput.d.ts +37 -0
  83. package/dist/shadcn/hooks/use-mobile.d.ts +1 -0
  84. package/dist/shadcn/index.d.ts +13 -0
  85. package/dist/shadcn/index.js +1256 -0
  86. package/dist/shadcn/lib/utils.d.ts +2 -0
  87. package/dist/shadcn/ui/button.d.ts +10 -0
  88. package/dist/shadcn/ui/collapsible.d.ts +5 -0
  89. package/dist/shadcn/ui/command.d.ts +18 -0
  90. package/dist/shadcn/ui/dialog.d.ts +17 -0
  91. package/dist/shadcn/ui/input.d.ts +3 -0
  92. package/dist/shadcn/ui/scroll-area.d.ts +8 -0
  93. package/dist/shadcn/ui/separator.d.ts +4 -0
  94. package/dist/shadcn/ui/sheet.d.ts +14 -0
  95. package/dist/shadcn/ui/sidebar.d.ts +69 -0
  96. package/dist/shadcn/ui/skeleton.d.ts +2 -0
  97. package/dist/shadcn/ui/tooltip.d.ts +7 -0
  98. package/dist/styles.css +2 -0
  99. package/package.json +77 -0
@@ -0,0 +1,1256 @@
1
+ import { cva } from 'class-variance-authority';
2
+ import { Slot, Collapsible as Collapsible$1, Dialog as Dialog$1, ScrollArea as ScrollArea$1, Separator as Separator$1, Tooltip as Tooltip$1 } from 'radix-ui';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+ import { Command as Command$1 } from 'cmdk';
7
+ import { XIcon, SearchIcon, CheckIcon, PanelLeftIcon } from 'lucide-react';
8
+ import * as React2 from 'react';
9
+
10
+ // src/shadcn/ui/button.tsx
11
+ function cn(...inputs) {
12
+ return twMerge(clsx(inputs));
13
+ }
14
+ var buttonVariants = cva(
15
+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-semibold whitespace-nowrap shadow-sm shadow-foreground/5 transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
16
+ {
17
+ variants: {
18
+ variant: {
19
+ default: "bg-primary text-primary-foreground hover:bg-primary/90 [a]:hover:bg-primary/90",
20
+ outline: "border-border/95 bg-background/85 hover:border-primary/25 hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
21
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
22
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
23
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
24
+ link: "text-primary underline-offset-4 hover:underline"
25
+ },
26
+ size: {
27
+ default: "h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
28
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
29
+ sm: "h-8 gap-1 rounded-[min(var(--radius-md),12px)] px-3 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3.5",
30
+ lg: "h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
31
+ icon: "size-8",
32
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
33
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
34
+ "icon-lg": "size-9"
35
+ }
36
+ },
37
+ defaultVariants: {
38
+ variant: "default",
39
+ size: "default"
40
+ }
41
+ }
42
+ );
43
+ function Button({
44
+ className,
45
+ variant = "default",
46
+ size = "default",
47
+ asChild = false,
48
+ ...props
49
+ }) {
50
+ const Comp = asChild ? Slot.Root : "button";
51
+ return /* @__PURE__ */ jsx(
52
+ Comp,
53
+ {
54
+ "data-slot": "button",
55
+ "data-variant": variant,
56
+ "data-size": size,
57
+ className: cn(buttonVariants({ variant, size, className })),
58
+ ...props
59
+ }
60
+ );
61
+ }
62
+ function Collapsible({
63
+ ...props
64
+ }) {
65
+ return /* @__PURE__ */ jsx(Collapsible$1.Root, { "data-slot": "collapsible", ...props });
66
+ }
67
+ function CollapsibleTrigger({
68
+ ...props
69
+ }) {
70
+ return /* @__PURE__ */ jsx(
71
+ Collapsible$1.CollapsibleTrigger,
72
+ {
73
+ "data-slot": "collapsible-trigger",
74
+ ...props
75
+ }
76
+ );
77
+ }
78
+ function CollapsibleContent({
79
+ ...props
80
+ }) {
81
+ return /* @__PURE__ */ jsx(
82
+ Collapsible$1.CollapsibleContent,
83
+ {
84
+ "data-slot": "collapsible-content",
85
+ ...props
86
+ }
87
+ );
88
+ }
89
+ function Dialog({
90
+ ...props
91
+ }) {
92
+ return /* @__PURE__ */ jsx(Dialog$1.Root, { "data-slot": "dialog", ...props });
93
+ }
94
+ function DialogTrigger({
95
+ ...props
96
+ }) {
97
+ return /* @__PURE__ */ jsx(Dialog$1.Trigger, { "data-slot": "dialog-trigger", ...props });
98
+ }
99
+ function DialogPortal({
100
+ ...props
101
+ }) {
102
+ return /* @__PURE__ */ jsx(Dialog$1.Portal, { "data-slot": "dialog-portal", ...props });
103
+ }
104
+ function DialogClose({
105
+ ...props
106
+ }) {
107
+ return /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", ...props });
108
+ }
109
+ function DialogOverlay({
110
+ className,
111
+ ...props
112
+ }) {
113
+ return /* @__PURE__ */ jsx(
114
+ Dialog$1.Overlay,
115
+ {
116
+ "data-slot": "dialog-overlay",
117
+ className: cn(
118
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
119
+ className
120
+ ),
121
+ ...props
122
+ }
123
+ );
124
+ }
125
+ function DialogContent({
126
+ className,
127
+ children,
128
+ showCloseButton = true,
129
+ ...props
130
+ }) {
131
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [
132
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
133
+ /* @__PURE__ */ jsxs(
134
+ Dialog$1.Content,
135
+ {
136
+ "data-slot": "dialog-content",
137
+ className: cn(
138
+ "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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",
139
+ className
140
+ ),
141
+ ...props,
142
+ children: [
143
+ children,
144
+ showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", asChild: true, children: /* @__PURE__ */ jsxs(
145
+ Button,
146
+ {
147
+ variant: "ghost",
148
+ className: "absolute top-2 right-2",
149
+ size: "icon-sm",
150
+ children: [
151
+ /* @__PURE__ */ jsx(
152
+ XIcon,
153
+ {}
154
+ ),
155
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
156
+ ]
157
+ }
158
+ ) })
159
+ ]
160
+ }
161
+ )
162
+ ] });
163
+ }
164
+ function DialogHeader({ className, ...props }) {
165
+ return /* @__PURE__ */ jsx(
166
+ "div",
167
+ {
168
+ "data-slot": "dialog-header",
169
+ className: cn("flex flex-col gap-2", className),
170
+ ...props
171
+ }
172
+ );
173
+ }
174
+ function DialogFooter({
175
+ className,
176
+ showCloseButton = false,
177
+ children,
178
+ ...props
179
+ }) {
180
+ return /* @__PURE__ */ jsxs(
181
+ "div",
182
+ {
183
+ "data-slot": "dialog-footer",
184
+ className: cn(
185
+ "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
186
+ className
187
+ ),
188
+ ...props,
189
+ children: [
190
+ children,
191
+ showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: "Close" }) })
192
+ ]
193
+ }
194
+ );
195
+ }
196
+ function DialogTitle({
197
+ className,
198
+ ...props
199
+ }) {
200
+ return /* @__PURE__ */ jsx(
201
+ Dialog$1.Title,
202
+ {
203
+ "data-slot": "dialog-title",
204
+ className: cn(
205
+ "font-heading text-base leading-none font-medium",
206
+ className
207
+ ),
208
+ ...props
209
+ }
210
+ );
211
+ }
212
+ function DialogDescription({
213
+ className,
214
+ ...props
215
+ }) {
216
+ return /* @__PURE__ */ jsx(
217
+ Dialog$1.Description,
218
+ {
219
+ "data-slot": "dialog-description",
220
+ className: cn(
221
+ "text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
222
+ className
223
+ ),
224
+ ...props
225
+ }
226
+ );
227
+ }
228
+ function Command({
229
+ className,
230
+ ...props
231
+ }) {
232
+ return /* @__PURE__ */ jsx(
233
+ Command$1,
234
+ {
235
+ "data-slot": "command",
236
+ className: cn(
237
+ "flex size-full flex-col overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground",
238
+ className
239
+ ),
240
+ ...props
241
+ }
242
+ );
243
+ }
244
+ function CommandDialog({
245
+ title = "Command Palette",
246
+ description = "Search for a command to run...",
247
+ children,
248
+ className,
249
+ showCloseButton = false,
250
+ ...props
251
+ }) {
252
+ return /* @__PURE__ */ jsxs(Dialog, { ...props, children: [
253
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "sr-only", children: [
254
+ /* @__PURE__ */ jsx(DialogTitle, { children: title }),
255
+ /* @__PURE__ */ jsx(DialogDescription, { children: description })
256
+ ] }),
257
+ /* @__PURE__ */ jsx(
258
+ DialogContent,
259
+ {
260
+ className: cn("top-1/3 translate-y-0 overflow-hidden p-0", className),
261
+ showCloseButton,
262
+ children
263
+ }
264
+ )
265
+ ] });
266
+ }
267
+ function CommandInput({
268
+ className,
269
+ ...props
270
+ }) {
271
+ return /* @__PURE__ */ jsxs(
272
+ "div",
273
+ {
274
+ "data-slot": "command-input-wrapper",
275
+ className: "flex h-10 items-center gap-2 border-b px-3",
276
+ children: [
277
+ /* @__PURE__ */ jsx(SearchIcon, { "aria-hidden": "true", className: "size-4 shrink-0 opacity-50" }),
278
+ /* @__PURE__ */ jsx(
279
+ Command$1.Input,
280
+ {
281
+ "data-slot": "command-input",
282
+ className: cn(
283
+ "h-9 w-full bg-transparent text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
284
+ className
285
+ ),
286
+ ...props
287
+ }
288
+ )
289
+ ]
290
+ }
291
+ );
292
+ }
293
+ function CommandList({
294
+ className,
295
+ ...props
296
+ }) {
297
+ return /* @__PURE__ */ jsx(
298
+ Command$1.List,
299
+ {
300
+ "data-slot": "command-list",
301
+ className: cn(
302
+ "max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
303
+ className
304
+ ),
305
+ ...props
306
+ }
307
+ );
308
+ }
309
+ function CommandEmpty({
310
+ className,
311
+ ...props
312
+ }) {
313
+ return /* @__PURE__ */ jsx(
314
+ Command$1.Empty,
315
+ {
316
+ "data-slot": "command-empty",
317
+ className: cn("py-6 text-center text-sm", className),
318
+ ...props
319
+ }
320
+ );
321
+ }
322
+ function CommandGroup({
323
+ className,
324
+ ...props
325
+ }) {
326
+ return /* @__PURE__ */ jsx(
327
+ Command$1.Group,
328
+ {
329
+ "data-slot": "command-group",
330
+ className: cn(
331
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
332
+ className
333
+ ),
334
+ ...props
335
+ }
336
+ );
337
+ }
338
+ function CommandSeparator({
339
+ className,
340
+ ...props
341
+ }) {
342
+ return /* @__PURE__ */ jsx(
343
+ Command$1.Separator,
344
+ {
345
+ "data-slot": "command-separator",
346
+ className: cn("-mx-1 h-px bg-border", className),
347
+ ...props
348
+ }
349
+ );
350
+ }
351
+ function CommandItem({
352
+ className,
353
+ children,
354
+ ...props
355
+ }) {
356
+ return /* @__PURE__ */ jsxs(
357
+ Command$1.Item,
358
+ {
359
+ "data-slot": "command-item",
360
+ className: cn(
361
+ "group/command-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
362
+ className
363
+ ),
364
+ ...props,
365
+ children: [
366
+ children,
367
+ /* @__PURE__ */ jsx(CheckIcon, { className: "ml-auto opacity-0 group-data-[checked=true]/command-item:opacity-100" })
368
+ ]
369
+ }
370
+ );
371
+ }
372
+ function CommandShortcut({
373
+ className,
374
+ ...props
375
+ }) {
376
+ return /* @__PURE__ */ jsx(
377
+ "span",
378
+ {
379
+ "data-slot": "command-shortcut",
380
+ className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
381
+ ...props
382
+ }
383
+ );
384
+ }
385
+ function Input({ className, type, ...props }) {
386
+ return /* @__PURE__ */ jsx(
387
+ "input",
388
+ {
389
+ type,
390
+ "data-slot": "input",
391
+ className: cn(
392
+ "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
393
+ className
394
+ ),
395
+ ...props
396
+ }
397
+ );
398
+ }
399
+ function ScrollArea({
400
+ className,
401
+ children,
402
+ hideScrollbars = false,
403
+ scrollFade = false,
404
+ ...props
405
+ }) {
406
+ return /* @__PURE__ */ jsxs(
407
+ ScrollArea$1.Root,
408
+ {
409
+ "data-slot": "scroll-area",
410
+ "data-scroll-fade": scrollFade ? "true" : "false",
411
+ className: cn(
412
+ "relative",
413
+ scrollFade && "before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-10 before:h-4 before:bg-linear-to-b before:from-background before:to-transparent after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:z-10 after:h-4 after:bg-linear-to-t after:from-background after:to-transparent",
414
+ className
415
+ ),
416
+ ...props,
417
+ children: [
418
+ /* @__PURE__ */ jsx(
419
+ ScrollArea$1.Viewport,
420
+ {
421
+ "data-slot": "scroll-area-viewport",
422
+ className: cn(
423
+ "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",
424
+ hideScrollbars && "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
425
+ ),
426
+ children
427
+ }
428
+ ),
429
+ hideScrollbars ? null : /* @__PURE__ */ jsx(ScrollBar, {}),
430
+ /* @__PURE__ */ jsx(ScrollArea$1.Corner, {})
431
+ ]
432
+ }
433
+ );
434
+ }
435
+ function ScrollBar({
436
+ className,
437
+ orientation = "vertical",
438
+ ...props
439
+ }) {
440
+ return /* @__PURE__ */ jsx(
441
+ ScrollArea$1.ScrollAreaScrollbar,
442
+ {
443
+ "data-slot": "scroll-area-scrollbar",
444
+ "data-orientation": orientation,
445
+ orientation,
446
+ className: cn(
447
+ "flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",
448
+ className
449
+ ),
450
+ ...props,
451
+ children: /* @__PURE__ */ jsx(
452
+ ScrollArea$1.ScrollAreaThumb,
453
+ {
454
+ "data-slot": "scroll-area-thumb",
455
+ className: "relative flex-1 rounded-full bg-border"
456
+ }
457
+ )
458
+ }
459
+ );
460
+ }
461
+ function Separator({
462
+ className,
463
+ orientation = "horizontal",
464
+ decorative = true,
465
+ ...props
466
+ }) {
467
+ return /* @__PURE__ */ jsx(
468
+ Separator$1.Root,
469
+ {
470
+ "data-slot": "separator",
471
+ decorative,
472
+ orientation,
473
+ className: cn(
474
+ "shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
475
+ className
476
+ ),
477
+ ...props
478
+ }
479
+ );
480
+ }
481
+ function Sheet({ ...props }) {
482
+ return /* @__PURE__ */ jsx(Dialog$1.Root, { "data-slot": "sheet", ...props });
483
+ }
484
+ function SheetTrigger({
485
+ ...props
486
+ }) {
487
+ return /* @__PURE__ */ jsx(Dialog$1.Trigger, { "data-slot": "sheet-trigger", ...props });
488
+ }
489
+ function SheetClose({
490
+ ...props
491
+ }) {
492
+ return /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "sheet-close", ...props });
493
+ }
494
+ function SheetPortal({
495
+ ...props
496
+ }) {
497
+ return /* @__PURE__ */ jsx(Dialog$1.Portal, { "data-slot": "sheet-portal", ...props });
498
+ }
499
+ function SheetOverlay({
500
+ className,
501
+ ...props
502
+ }) {
503
+ return /* @__PURE__ */ jsx(
504
+ Dialog$1.Overlay,
505
+ {
506
+ "data-slot": "sheet-overlay",
507
+ className: cn(
508
+ "fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
509
+ className
510
+ ),
511
+ ...props
512
+ }
513
+ );
514
+ }
515
+ function SheetContent({
516
+ className,
517
+ children,
518
+ side = "right",
519
+ showCloseButton = true,
520
+ ...props
521
+ }) {
522
+ return /* @__PURE__ */ jsxs(SheetPortal, { children: [
523
+ /* @__PURE__ */ jsx(SheetOverlay, {}),
524
+ /* @__PURE__ */ jsxs(
525
+ Dialog$1.Content,
526
+ {
527
+ "data-slot": "sheet-content",
528
+ "data-side": side,
529
+ className: cn(
530
+ "fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",
531
+ className
532
+ ),
533
+ ...props,
534
+ children: [
535
+ children,
536
+ showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "sheet-close", asChild: true, children: /* @__PURE__ */ jsxs(
537
+ Button,
538
+ {
539
+ variant: "ghost",
540
+ className: "absolute top-3 right-3",
541
+ size: "icon-sm",
542
+ children: [
543
+ /* @__PURE__ */ jsx(
544
+ XIcon,
545
+ {}
546
+ ),
547
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
548
+ ]
549
+ }
550
+ ) })
551
+ ]
552
+ }
553
+ )
554
+ ] });
555
+ }
556
+ function SheetHeader({ className, ...props }) {
557
+ return /* @__PURE__ */ jsx(
558
+ "div",
559
+ {
560
+ "data-slot": "sheet-header",
561
+ className: cn("flex flex-col gap-0.5 p-4", className),
562
+ ...props
563
+ }
564
+ );
565
+ }
566
+ function SheetFooter({ className, ...props }) {
567
+ return /* @__PURE__ */ jsx(
568
+ "div",
569
+ {
570
+ "data-slot": "sheet-footer",
571
+ className: cn("mt-auto flex flex-col gap-2 p-4", className),
572
+ ...props
573
+ }
574
+ );
575
+ }
576
+ function SheetTitle({
577
+ className,
578
+ ...props
579
+ }) {
580
+ return /* @__PURE__ */ jsx(
581
+ Dialog$1.Title,
582
+ {
583
+ "data-slot": "sheet-title",
584
+ className: cn(
585
+ "font-heading text-base font-medium text-foreground",
586
+ className
587
+ ),
588
+ ...props
589
+ }
590
+ );
591
+ }
592
+ function SheetDescription({
593
+ className,
594
+ ...props
595
+ }) {
596
+ return /* @__PURE__ */ jsx(
597
+ Dialog$1.Description,
598
+ {
599
+ "data-slot": "sheet-description",
600
+ className: cn("text-sm text-muted-foreground", className),
601
+ ...props
602
+ }
603
+ );
604
+ }
605
+ var MOBILE_BREAKPOINT = 768;
606
+ function useIsMobile() {
607
+ const [isMobile, setIsMobile] = React2.useState(void 0);
608
+ React2.useEffect(() => {
609
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
610
+ const onChange = () => {
611
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
612
+ };
613
+ mql.addEventListener("change", onChange);
614
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
615
+ return () => mql.removeEventListener("change", onChange);
616
+ }, []);
617
+ return !!isMobile;
618
+ }
619
+ function Skeleton({ className, ...props }) {
620
+ return /* @__PURE__ */ jsx(
621
+ "div",
622
+ {
623
+ "data-slot": "skeleton",
624
+ className: cn("animate-pulse rounded-md bg-muted", className),
625
+ ...props
626
+ }
627
+ );
628
+ }
629
+ function TooltipProvider({
630
+ delayDuration = 0,
631
+ ...props
632
+ }) {
633
+ return /* @__PURE__ */ jsx(
634
+ Tooltip$1.Provider,
635
+ {
636
+ "data-slot": "tooltip-provider",
637
+ delayDuration,
638
+ ...props
639
+ }
640
+ );
641
+ }
642
+ function Tooltip({
643
+ ...props
644
+ }) {
645
+ return /* @__PURE__ */ jsx(Tooltip$1.Root, { "data-slot": "tooltip", ...props });
646
+ }
647
+ function TooltipTrigger({
648
+ ...props
649
+ }) {
650
+ return /* @__PURE__ */ jsx(Tooltip$1.Trigger, { "data-slot": "tooltip-trigger", ...props });
651
+ }
652
+ function TooltipContent({
653
+ className,
654
+ sideOffset = 0,
655
+ children,
656
+ ...props
657
+ }) {
658
+ return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsxs(
659
+ Tooltip$1.Content,
660
+ {
661
+ "data-slot": "tooltip-content",
662
+ sideOffset,
663
+ className: cn(
664
+ "z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 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",
665
+ className
666
+ ),
667
+ ...props,
668
+ children: [
669
+ children,
670
+ /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" })
671
+ ]
672
+ }
673
+ ) });
674
+ }
675
+ var SIDEBAR_COOKIE_NAME = "sidebar_state";
676
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
677
+ var SIDEBAR_WIDTH = "16rem";
678
+ var SIDEBAR_WIDTH_MOBILE = "18rem";
679
+ var SIDEBAR_WIDTH_ICON = "3rem";
680
+ var SIDEBAR_KEYBOARD_SHORTCUT = "b";
681
+ var SidebarContext = React2.createContext(null);
682
+ function useSidebar() {
683
+ const context = React2.useContext(SidebarContext);
684
+ if (!context) {
685
+ throw new Error("useSidebar must be used within a SidebarProvider.");
686
+ }
687
+ return context;
688
+ }
689
+ function SidebarProvider({
690
+ defaultOpen = true,
691
+ open: openProp,
692
+ onOpenChange: setOpenProp,
693
+ className,
694
+ style,
695
+ children,
696
+ ...props
697
+ }) {
698
+ const isMobile = useIsMobile();
699
+ const [openMobile, setOpenMobile] = React2.useState(false);
700
+ const [_open, _setOpen] = React2.useState(defaultOpen);
701
+ const open = openProp ?? _open;
702
+ const setOpen = React2.useCallback(
703
+ (value) => {
704
+ const openState = typeof value === "function" ? value(open) : value;
705
+ if (setOpenProp) {
706
+ setOpenProp(openState);
707
+ } else {
708
+ _setOpen(openState);
709
+ }
710
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
711
+ },
712
+ [setOpenProp, open]
713
+ );
714
+ const toggleSidebar = React2.useCallback(() => {
715
+ return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
716
+ }, [isMobile, setOpen, setOpenMobile]);
717
+ React2.useEffect(() => {
718
+ const handleKeyDown = (event) => {
719
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
720
+ event.preventDefault();
721
+ toggleSidebar();
722
+ }
723
+ };
724
+ window.addEventListener("keydown", handleKeyDown);
725
+ return () => window.removeEventListener("keydown", handleKeyDown);
726
+ }, [toggleSidebar]);
727
+ const state = open ? "expanded" : "collapsed";
728
+ const contextValue = React2.useMemo(
729
+ () => ({
730
+ state,
731
+ open,
732
+ setOpen,
733
+ isMobile,
734
+ openMobile,
735
+ setOpenMobile,
736
+ toggleSidebar
737
+ }),
738
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
739
+ );
740
+ return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
741
+ "div",
742
+ {
743
+ "data-slot": "sidebar-wrapper",
744
+ style: {
745
+ "--sidebar-width": SIDEBAR_WIDTH,
746
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
747
+ ...style
748
+ },
749
+ className: cn(
750
+ "group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",
751
+ className
752
+ ),
753
+ ...props,
754
+ children
755
+ }
756
+ ) });
757
+ }
758
+ function Sidebar({
759
+ side = "left",
760
+ variant = "sidebar",
761
+ collapsible = "offcanvas",
762
+ className,
763
+ children,
764
+ dir,
765
+ ...props
766
+ }) {
767
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
768
+ if (collapsible === "none") {
769
+ return /* @__PURE__ */ jsx(
770
+ "div",
771
+ {
772
+ "data-slot": "sidebar",
773
+ className: cn(
774
+ "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
775
+ className
776
+ ),
777
+ ...props,
778
+ children
779
+ }
780
+ );
781
+ }
782
+ if (isMobile) {
783
+ return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
784
+ SheetContent,
785
+ {
786
+ dir,
787
+ "data-sidebar": "sidebar",
788
+ "data-slot": "sidebar",
789
+ "data-mobile": "true",
790
+ className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
791
+ style: {
792
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
793
+ },
794
+ side,
795
+ children: [
796
+ /* @__PURE__ */ jsxs(SheetHeader, { className: "sr-only", children: [
797
+ /* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }),
798
+ /* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })
799
+ ] }),
800
+ /* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
801
+ ]
802
+ }
803
+ ) });
804
+ }
805
+ return /* @__PURE__ */ jsxs(
806
+ "div",
807
+ {
808
+ className: "group peer hidden text-sidebar-foreground md:block",
809
+ "data-state": state,
810
+ "data-collapsible": state === "collapsed" ? collapsible : "",
811
+ "data-variant": variant,
812
+ "data-side": side,
813
+ "data-slot": "sidebar",
814
+ children: [
815
+ /* @__PURE__ */ jsx(
816
+ "div",
817
+ {
818
+ "data-slot": "sidebar-gap",
819
+ className: cn(
820
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
821
+ "group-data-[collapsible=offcanvas]:w-0",
822
+ "group-data-[side=right]:rotate-180",
823
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
824
+ )
825
+ }
826
+ ),
827
+ /* @__PURE__ */ jsx(
828
+ "div",
829
+ {
830
+ "data-slot": "sidebar-container",
831
+ "data-side": side,
832
+ className: cn(
833
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
834
+ // Adjust the padding for floating and inset variants.
835
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
836
+ className
837
+ ),
838
+ ...props,
839
+ children: /* @__PURE__ */ jsx(
840
+ "div",
841
+ {
842
+ "data-sidebar": "sidebar",
843
+ "data-slot": "sidebar-inner",
844
+ className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",
845
+ children
846
+ }
847
+ )
848
+ }
849
+ )
850
+ ]
851
+ }
852
+ );
853
+ }
854
+ function SidebarTrigger({
855
+ className,
856
+ onClick,
857
+ ...props
858
+ }) {
859
+ const { toggleSidebar } = useSidebar();
860
+ return /* @__PURE__ */ jsxs(
861
+ Button,
862
+ {
863
+ "data-sidebar": "trigger",
864
+ "data-slot": "sidebar-trigger",
865
+ variant: "ghost",
866
+ size: "icon-sm",
867
+ className: cn(className),
868
+ onClick: (event) => {
869
+ onClick?.(event);
870
+ toggleSidebar();
871
+ },
872
+ ...props,
873
+ children: [
874
+ /* @__PURE__ */ jsx(PanelLeftIcon, {}),
875
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
876
+ ]
877
+ }
878
+ );
879
+ }
880
+ function SidebarRail({ className, ...props }) {
881
+ const { toggleSidebar } = useSidebar();
882
+ return /* @__PURE__ */ jsx(
883
+ "button",
884
+ {
885
+ "data-sidebar": "rail",
886
+ "data-slot": "sidebar-rail",
887
+ "aria-label": "Toggle Sidebar",
888
+ tabIndex: -1,
889
+ onClick: toggleSidebar,
890
+ title: "Toggle Sidebar",
891
+ className: cn(
892
+ "absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
893
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
894
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
895
+ "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
896
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
897
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
898
+ className
899
+ ),
900
+ ...props
901
+ }
902
+ );
903
+ }
904
+ function SidebarInset({ className, ...props }) {
905
+ return /* @__PURE__ */ jsx(
906
+ "main",
907
+ {
908
+ "data-slot": "sidebar-inset",
909
+ className: cn(
910
+ "relative flex min-w-0 w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
911
+ className
912
+ ),
913
+ ...props
914
+ }
915
+ );
916
+ }
917
+ function SidebarInput({
918
+ className,
919
+ ...props
920
+ }) {
921
+ return /* @__PURE__ */ jsx(
922
+ Input,
923
+ {
924
+ "data-slot": "sidebar-input",
925
+ "data-sidebar": "input",
926
+ className: cn("h-8 w-full bg-background shadow-none", className),
927
+ ...props
928
+ }
929
+ );
930
+ }
931
+ function SidebarHeader({ className, ...props }) {
932
+ return /* @__PURE__ */ jsx(
933
+ "div",
934
+ {
935
+ "data-slot": "sidebar-header",
936
+ "data-sidebar": "header",
937
+ className: cn("flex flex-col gap-2 p-2", className),
938
+ ...props
939
+ }
940
+ );
941
+ }
942
+ function SidebarFooter({ className, ...props }) {
943
+ return /* @__PURE__ */ jsx(
944
+ "div",
945
+ {
946
+ "data-slot": "sidebar-footer",
947
+ "data-sidebar": "footer",
948
+ className: cn("flex flex-col gap-2 p-2", className),
949
+ ...props
950
+ }
951
+ );
952
+ }
953
+ function SidebarSeparator({
954
+ className,
955
+ ...props
956
+ }) {
957
+ return /* @__PURE__ */ jsx(
958
+ Separator,
959
+ {
960
+ "data-slot": "sidebar-separator",
961
+ "data-sidebar": "separator",
962
+ className: cn("mx-2 w-auto bg-sidebar-border", className),
963
+ ...props
964
+ }
965
+ );
966
+ }
967
+ function SidebarContent({ className, ...props }) {
968
+ return /* @__PURE__ */ jsx(ScrollArea, { hideScrollbars: true, scrollFade: true, className: "h-auto min-h-0 flex-1", children: /* @__PURE__ */ jsx(
969
+ "div",
970
+ {
971
+ "data-slot": "sidebar-content",
972
+ "data-sidebar": "content",
973
+ className: cn(
974
+ "flex w-full min-w-0 flex-col gap-2 group-data-[collapsible=icon]:overflow-hidden",
975
+ className
976
+ ),
977
+ ...props
978
+ }
979
+ ) });
980
+ }
981
+ function SidebarGroup({ className, ...props }) {
982
+ return /* @__PURE__ */ jsx(
983
+ "div",
984
+ {
985
+ "data-slot": "sidebar-group",
986
+ "data-sidebar": "group",
987
+ className: cn("relative flex w-full min-w-0 flex-col p-2", className),
988
+ ...props
989
+ }
990
+ );
991
+ }
992
+ function SidebarGroupLabel({
993
+ className,
994
+ asChild = false,
995
+ ...props
996
+ }) {
997
+ const Comp = asChild ? Slot.Root : "div";
998
+ return /* @__PURE__ */ jsx(
999
+ Comp,
1000
+ {
1001
+ "data-slot": "sidebar-group-label",
1002
+ "data-sidebar": "group-label",
1003
+ className: cn(
1004
+ "flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
1005
+ className
1006
+ ),
1007
+ ...props
1008
+ }
1009
+ );
1010
+ }
1011
+ function SidebarGroupAction({
1012
+ className,
1013
+ asChild = false,
1014
+ ...props
1015
+ }) {
1016
+ const Comp = asChild ? Slot.Root : "button";
1017
+ return /* @__PURE__ */ jsx(
1018
+ Comp,
1019
+ {
1020
+ "data-slot": "sidebar-group-action",
1021
+ "data-sidebar": "group-action",
1022
+ className: cn(
1023
+ "absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
1024
+ className
1025
+ ),
1026
+ ...props
1027
+ }
1028
+ );
1029
+ }
1030
+ function SidebarGroupContent({
1031
+ className,
1032
+ ...props
1033
+ }) {
1034
+ return /* @__PURE__ */ jsx(
1035
+ "div",
1036
+ {
1037
+ "data-slot": "sidebar-group-content",
1038
+ "data-sidebar": "group-content",
1039
+ className: cn("w-full text-sm", className),
1040
+ ...props
1041
+ }
1042
+ );
1043
+ }
1044
+ function SidebarMenu({ className, ...props }) {
1045
+ return /* @__PURE__ */ jsx(
1046
+ "ul",
1047
+ {
1048
+ "data-slot": "sidebar-menu",
1049
+ "data-sidebar": "menu",
1050
+ className: cn("flex w-full min-w-0 flex-col gap-0", className),
1051
+ ...props
1052
+ }
1053
+ );
1054
+ }
1055
+ function SidebarMenuItem({ className, ...props }) {
1056
+ return /* @__PURE__ */ jsx(
1057
+ "li",
1058
+ {
1059
+ "data-slot": "sidebar-menu-item",
1060
+ "data-sidebar": "menu-item",
1061
+ className: cn("group/menu-item relative", className),
1062
+ ...props
1063
+ }
1064
+ );
1065
+ }
1066
+ var sidebarMenuButtonVariants = cva(
1067
+ "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
1068
+ {
1069
+ variants: {
1070
+ variant: {
1071
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
1072
+ outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
1073
+ },
1074
+ size: {
1075
+ default: "h-8 text-sm",
1076
+ sm: "h-7 text-xs",
1077
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
1078
+ }
1079
+ },
1080
+ defaultVariants: {
1081
+ variant: "default",
1082
+ size: "default"
1083
+ }
1084
+ }
1085
+ );
1086
+ function SidebarMenuButton({
1087
+ asChild = false,
1088
+ isActive = false,
1089
+ variant = "default",
1090
+ size = "default",
1091
+ tooltip,
1092
+ className,
1093
+ ...props
1094
+ }) {
1095
+ const Comp = asChild ? Slot.Root : "button";
1096
+ const { isMobile, state } = useSidebar();
1097
+ const button = /* @__PURE__ */ jsx(
1098
+ Comp,
1099
+ {
1100
+ "data-slot": "sidebar-menu-button",
1101
+ "data-sidebar": "menu-button",
1102
+ "data-size": size,
1103
+ "data-active": isActive,
1104
+ className: cn(sidebarMenuButtonVariants({ variant, size }), className),
1105
+ ...props
1106
+ }
1107
+ );
1108
+ if (!tooltip) {
1109
+ return button;
1110
+ }
1111
+ if (typeof tooltip === "string") {
1112
+ tooltip = {
1113
+ children: tooltip
1114
+ };
1115
+ }
1116
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
1117
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
1118
+ /* @__PURE__ */ jsx(
1119
+ TooltipContent,
1120
+ {
1121
+ side: "right",
1122
+ align: "center",
1123
+ hidden: state !== "collapsed" || isMobile,
1124
+ ...tooltip
1125
+ }
1126
+ )
1127
+ ] });
1128
+ }
1129
+ function SidebarMenuAction({
1130
+ className,
1131
+ asChild = false,
1132
+ showOnHover = false,
1133
+ ...props
1134
+ }) {
1135
+ const Comp = asChild ? Slot.Root : "button";
1136
+ return /* @__PURE__ */ jsx(
1137
+ Comp,
1138
+ {
1139
+ "data-slot": "sidebar-menu-action",
1140
+ "data-sidebar": "menu-action",
1141
+ className: cn(
1142
+ "absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
1143
+ showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0",
1144
+ className
1145
+ ),
1146
+ ...props
1147
+ }
1148
+ );
1149
+ }
1150
+ function SidebarMenuBadge({
1151
+ className,
1152
+ ...props
1153
+ }) {
1154
+ return /* @__PURE__ */ jsx(
1155
+ "div",
1156
+ {
1157
+ "data-slot": "sidebar-menu-badge",
1158
+ "data-sidebar": "menu-badge",
1159
+ className: cn(
1160
+ "pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",
1161
+ className
1162
+ ),
1163
+ ...props
1164
+ }
1165
+ );
1166
+ }
1167
+ function SidebarMenuSkeleton({
1168
+ className,
1169
+ showIcon = false,
1170
+ ...props
1171
+ }) {
1172
+ const [width] = React2.useState(() => {
1173
+ return `${Math.floor(Math.random() * 40) + 50}%`;
1174
+ });
1175
+ return /* @__PURE__ */ jsxs(
1176
+ "div",
1177
+ {
1178
+ "data-slot": "sidebar-menu-skeleton",
1179
+ "data-sidebar": "menu-skeleton",
1180
+ className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
1181
+ ...props,
1182
+ children: [
1183
+ showIcon && /* @__PURE__ */ jsx(
1184
+ Skeleton,
1185
+ {
1186
+ className: "size-4 rounded-md",
1187
+ "data-sidebar": "menu-skeleton-icon"
1188
+ }
1189
+ ),
1190
+ /* @__PURE__ */ jsx(
1191
+ Skeleton,
1192
+ {
1193
+ className: "h-4 max-w-(--skeleton-width) flex-1",
1194
+ "data-sidebar": "menu-skeleton-text",
1195
+ style: {
1196
+ "--skeleton-width": width
1197
+ }
1198
+ }
1199
+ )
1200
+ ]
1201
+ }
1202
+ );
1203
+ }
1204
+ function SidebarMenuSub({ className, ...props }) {
1205
+ return /* @__PURE__ */ jsx(
1206
+ "ul",
1207
+ {
1208
+ "data-slot": "sidebar-menu-sub",
1209
+ "data-sidebar": "menu-sub",
1210
+ className: cn(
1211
+ "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
1212
+ className
1213
+ ),
1214
+ ...props
1215
+ }
1216
+ );
1217
+ }
1218
+ function SidebarMenuSubItem({
1219
+ className,
1220
+ ...props
1221
+ }) {
1222
+ return /* @__PURE__ */ jsx(
1223
+ "li",
1224
+ {
1225
+ "data-slot": "sidebar-menu-sub-item",
1226
+ "data-sidebar": "menu-sub-item",
1227
+ className: cn("group/menu-sub-item relative", className),
1228
+ ...props
1229
+ }
1230
+ );
1231
+ }
1232
+ function SidebarMenuSubButton({
1233
+ asChild = false,
1234
+ size = "md",
1235
+ isActive = false,
1236
+ className,
1237
+ ...props
1238
+ }) {
1239
+ const Comp = asChild ? Slot.Root : "a";
1240
+ return /* @__PURE__ */ jsx(
1241
+ Comp,
1242
+ {
1243
+ "data-slot": "sidebar-menu-sub-button",
1244
+ "data-sidebar": "menu-sub-button",
1245
+ "data-size": size,
1246
+ "data-active": isActive,
1247
+ className: cn(
1248
+ "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
1249
+ className
1250
+ ),
1251
+ ...props
1252
+ }
1253
+ );
1254
+ }
1255
+
1256
+ export { Button, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Input, ScrollArea, ScrollBar, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cn, useIsMobile, useSidebar };