@hex-core/components 1.3.0 → 1.4.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 (186) hide show
  1. package/README.md +183 -9
  2. package/dist/accordion.d.ts +13 -0
  3. package/dist/accordion.js +62 -0
  4. package/dist/accordion.js.map +1 -0
  5. package/dist/alert-dialog.d.ts +34 -0
  6. package/dist/alert-dialog.js +125 -0
  7. package/dist/alert-dialog.js.map +1 -0
  8. package/dist/alert.d.ts +17 -0
  9. package/dist/alert.js +54 -0
  10. package/dist/alert.js.map +1 -0
  11. package/dist/aspect-ratio.d.ts +7 -0
  12. package/dist/aspect-ratio.js +8 -0
  13. package/dist/aspect-ratio.js.map +1 -0
  14. package/dist/avatar.d.ts +11 -0
  15. package/dist/avatar.js +44 -0
  16. package/dist/avatar.js.map +1 -0
  17. package/dist/badge.d.ts +22 -0
  18. package/dist/badge.js +36 -0
  19. package/dist/badge.js.map +1 -0
  20. package/dist/breadcrumb.d.ts +27 -0
  21. package/dist/breadcrumb.js +120 -0
  22. package/dist/breadcrumb.js.map +1 -0
  23. package/dist/button-variants-Bx6gCUFp.d.ts +19 -0
  24. package/dist/button.d.ts +13 -0
  25. package/dist/button.js +113 -0
  26. package/dist/button.js.map +1 -0
  27. package/dist/calendar.d.ts +17 -0
  28. package/dist/calendar.js +126 -0
  29. package/dist/calendar.js.map +1 -0
  30. package/dist/card.d.ts +16 -0
  31. package/dist/card.js +68 -0
  32. package/dist/card.js.map +1 -0
  33. package/dist/checkbox.d.ts +11 -0
  34. package/dist/checkbox.js +65 -0
  35. package/dist/checkbox.js.map +1 -0
  36. package/dist/cluster.d.ts +34 -0
  37. package/dist/cluster.js +50 -0
  38. package/dist/cluster.js.map +1 -0
  39. package/dist/collapsible.d.ts +11 -0
  40. package/dist/collapsible.js +10 -0
  41. package/dist/collapsible.js.map +1 -0
  42. package/dist/color-picker.d.ts +44 -0
  43. package/dist/color-picker.js +321 -0
  44. package/dist/color-picker.js.map +1 -0
  45. package/dist/combobox.d.ts +45 -0
  46. package/dist/combobox.js +226 -0
  47. package/dist/combobox.js.map +1 -0
  48. package/dist/command.d.ts +111 -0
  49. package/dist/command.js +232 -0
  50. package/dist/command.js.map +1 -0
  51. package/dist/container.d.ts +41 -0
  52. package/dist/container.js +39 -0
  53. package/dist/container.js.map +1 -0
  54. package/dist/context-menu.d.ts +37 -0
  55. package/dist/context-menu.js +130 -0
  56. package/dist/context-menu.js.map +1 -0
  57. package/dist/data-table.d.ts +33 -0
  58. package/dist/data-table.js +103 -0
  59. package/dist/data-table.js.map +1 -0
  60. package/dist/date-picker.d.ts +43 -0
  61. package/dist/date-picker.js +221 -0
  62. package/dist/date-picker.js.map +1 -0
  63. package/dist/dialog.d.ts +46 -0
  64. package/dist/dialog.js +125 -0
  65. package/dist/dialog.js.map +1 -0
  66. package/dist/drawer.d.ts +41 -0
  67. package/dist/drawer.js +82 -0
  68. package/dist/drawer.js.map +1 -0
  69. package/dist/dropdown-menu.d.ts +39 -0
  70. package/dist/dropdown-menu.js +133 -0
  71. package/dist/dropdown-menu.js.map +1 -0
  72. package/dist/dropzone.d.ts +54 -0
  73. package/dist/dropzone.js +194 -0
  74. package/dist/dropzone.js.map +1 -0
  75. package/dist/file-tree.d.ts +53 -0
  76. package/dist/file-tree.js +322 -0
  77. package/dist/file-tree.js.map +1 -0
  78. package/dist/form.d.ts +45 -0
  79. package/dist/form.js +114 -0
  80. package/dist/form.js.map +1 -0
  81. package/dist/grid.d.ts +50 -0
  82. package/dist/grid.js +58 -0
  83. package/dist/grid.js.map +1 -0
  84. package/dist/hover-card.d.ts +11 -0
  85. package/dist/hover-card.js +34 -0
  86. package/dist/hover-card.js.map +1 -0
  87. package/dist/index.d.ts +98 -1564
  88. package/dist/index.js +527 -5536
  89. package/dist/index.js.map +1 -1
  90. package/dist/input-otp.d.ts +19 -0
  91. package/dist/input-otp.js +71 -0
  92. package/dist/input-otp.js.map +1 -0
  93. package/dist/input.d.ts +6 -0
  94. package/dist/input.js +40 -0
  95. package/dist/input.js.map +1 -0
  96. package/dist/label.d.ts +11 -0
  97. package/dist/label.js +22 -0
  98. package/dist/label.js.map +1 -0
  99. package/dist/menubar.d.ts +35 -0
  100. package/dist/menubar.js +106 -0
  101. package/dist/menubar.js.map +1 -0
  102. package/dist/multi-combobox.d.ts +51 -0
  103. package/dist/multi-combobox.js +258 -0
  104. package/dist/multi-combobox.js.map +1 -0
  105. package/dist/navigation-menu.d.ts +23 -0
  106. package/dist/navigation-menu.js +108 -0
  107. package/dist/navigation-menu.js.map +1 -0
  108. package/dist/pagination.d.ts +40 -0
  109. package/dist/pagination.js +195 -0
  110. package/dist/pagination.js.map +1 -0
  111. package/dist/popover.d.ts +13 -0
  112. package/dist/popover.js +35 -0
  113. package/dist/popover.js.map +1 -0
  114. package/dist/progress.d.ts +10 -0
  115. package/dist/progress.js +38 -0
  116. package/dist/progress.js.map +1 -0
  117. package/dist/radio-group.d.ts +9 -0
  118. package/dist/radio-group.js +44 -0
  119. package/dist/radio-group.js.map +1 -0
  120. package/dist/resizable.d.ts +28 -0
  121. package/dist/resizable.js +66 -0
  122. package/dist/resizable.js.map +1 -0
  123. package/dist/schemas.d.ts +121 -0
  124. package/dist/schemas.js +4643 -0
  125. package/dist/schemas.js.map +1 -0
  126. package/dist/scroll-area.d.ts +18 -0
  127. package/dist/scroll-area.js +55 -0
  128. package/dist/scroll-area.js.map +1 -0
  129. package/dist/select.d.ts +21 -0
  130. package/dist/select.js +136 -0
  131. package/dist/select.js.map +1 -0
  132. package/dist/separator.d.ts +11 -0
  133. package/dist/separator.js +29 -0
  134. package/dist/separator.js.map +1 -0
  135. package/dist/sheet.d.ts +39 -0
  136. package/dist/sheet.js +140 -0
  137. package/dist/sheet.js.map +1 -0
  138. package/dist/sidebar.d.ts +75 -0
  139. package/dist/sidebar.js +201 -0
  140. package/dist/sidebar.js.map +1 -0
  141. package/dist/skeleton.d.ts +11 -0
  142. package/dist/skeleton.js +21 -0
  143. package/dist/skeleton.js.map +1 -0
  144. package/dist/slider.d.ts +20 -0
  145. package/dist/slider.js +55 -0
  146. package/dist/slider.js.map +1 -0
  147. package/dist/sonner.d.ts +14 -0
  148. package/dist/sonner.js +27 -0
  149. package/dist/sonner.js.map +1 -0
  150. package/dist/spacer.d.ts +38 -0
  151. package/dist/spacer.js +43 -0
  152. package/dist/spacer.js.map +1 -0
  153. package/dist/stack.d.ts +34 -0
  154. package/dist/stack.js +49 -0
  155. package/dist/stack.js.map +1 -0
  156. package/dist/stepper.d.ts +48 -0
  157. package/dist/stepper.js +226 -0
  158. package/dist/stepper.js.map +1 -0
  159. package/dist/switch.d.ts +11 -0
  160. package/dist/switch.js +47 -0
  161. package/dist/switch.js.map +1 -0
  162. package/dist/table.d.ts +24 -0
  163. package/dist/table.js +85 -0
  164. package/dist/table.js.map +1 -0
  165. package/dist/tabs.d.ts +13 -0
  166. package/dist/tabs.js +57 -0
  167. package/dist/tabs.js.map +1 -0
  168. package/dist/textarea.d.ts +10 -0
  169. package/dist/textarea.js +36 -0
  170. package/dist/textarea.js.map +1 -0
  171. package/dist/time-picker.d.ts +34 -0
  172. package/dist/time-picker.js +50 -0
  173. package/dist/time-picker.js.map +1 -0
  174. package/dist/timeline.d.ts +42 -0
  175. package/dist/timeline.js +84 -0
  176. package/dist/timeline.js.map +1 -0
  177. package/dist/toggle-group.d.ts +17 -0
  178. package/dist/toggle-group.js +83 -0
  179. package/dist/toggle-group.js.map +1 -0
  180. package/dist/toggle.d.ts +19 -0
  181. package/dist/toggle.js +49 -0
  182. package/dist/toggle.js.map +1 -0
  183. package/dist/tooltip.d.ts +13 -0
  184. package/dist/tooltip.js +33 -0
  185. package/dist/tooltip.js.map +1 -0
  186. package/package.json +68 -16
@@ -0,0 +1,41 @@
1
+ import * as vaul from 'vaul';
2
+ import { Drawer as Drawer$1 } from 'vaul';
3
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import * as React from 'react';
6
+
7
+ type DrawerRootProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Root>;
8
+ /**
9
+ * Root container for a bottom drawer (vaul). Manages open state, drag, and snap points.
10
+ * @returns A drawer root that coordinates overlay, content, and dismiss behavior.
11
+ */
12
+ declare function Drawer({ shouldScaleBackground, ...props }: DrawerRootProps): react_jsx_runtime.JSX.Element;
13
+ declare namespace Drawer {
14
+ var displayName: string;
15
+ }
16
+ /** The element that opens the drawer when clicked. */
17
+ declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
18
+ /** Portals drawer overlay and content into the body. */
19
+ declare const DrawerPortal: typeof vaul.Portal;
20
+ /** Closes the drawer when rendered inside DrawerContent. */
21
+ declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
22
+ /** Dimmed backdrop behind the drawer content. */
23
+ declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
24
+ /** The drawer content panel. Slides up from the bottom and can be dragged down to dismiss. */
25
+ declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
26
+ /**
27
+ * Header container inside DrawerContent; stacks title and description.
28
+ * @returns A div with vertical rhythm.
29
+ */
30
+ declare function DrawerHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
31
+ /**
32
+ * Footer container inside DrawerContent; stacks action buttons.
33
+ * @returns A div that stacks buttons vertically with consistent gutters.
34
+ */
35
+ declare function DrawerFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
36
+ /** Accessible drawer title; vaul wires it to aria-labelledby automatically. */
37
+ declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
38
+ /** Accessible drawer description; vaul wires it to aria-describedby automatically. */
39
+ declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
40
+
41
+ export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
package/dist/drawer.js ADDED
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ import * as React from 'react';
3
+ import { Drawer as Drawer$1 } from 'vaul';
4
+ import { clsx } from 'clsx';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
+
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ function Drawer({ shouldScaleBackground = true, ...props }) {
12
+ return /* @__PURE__ */ jsx(Drawer$1.Root, { shouldScaleBackground, ...props });
13
+ }
14
+ Drawer.displayName = "Drawer";
15
+ var DrawerTrigger = Drawer$1.Trigger;
16
+ var DrawerPortal = Drawer$1.Portal;
17
+ var DrawerClose = Drawer$1.Close;
18
+ var DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
19
+ Drawer$1.Overlay,
20
+ {
21
+ ref,
22
+ className: cn(
23
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",
24
+ className
25
+ ),
26
+ ...props
27
+ }
28
+ ));
29
+ DrawerOverlay.displayName = "DrawerOverlay";
30
+ var DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPortal, { children: [
31
+ /* @__PURE__ */ jsx(DrawerOverlay, {}),
32
+ /* @__PURE__ */ jsxs(
33
+ Drawer$1.Content,
34
+ {
35
+ ref,
36
+ className: cn(
37
+ "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-foreground/[0.08] bg-background",
38
+ className
39
+ ),
40
+ ...props,
41
+ children: [
42
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mt-[var(--space-4,1rem)] h-2 w-[100px] rounded-full bg-muted", "aria-hidden": "true" }),
43
+ children
44
+ ]
45
+ }
46
+ )
47
+ ] }));
48
+ DrawerContent.displayName = "DrawerContent";
49
+ function DrawerHeader({ className, ...props }) {
50
+ return /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ className: cn("grid gap-1.5 p-[var(--space-4,1rem)] text-center sm:text-left", className),
54
+ ...props
55
+ }
56
+ );
57
+ }
58
+ function DrawerFooter({ className, ...props }) {
59
+ return /* @__PURE__ */ jsx("div", { className: cn("mt-auto flex flex-col gap-[var(--gap-sm,0.5rem)] p-[var(--space-4,1rem)]", className), ...props });
60
+ }
61
+ var DrawerTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
62
+ Drawer$1.Title,
63
+ {
64
+ ref,
65
+ className: cn("text-lg font-semibold leading-none tracking-tight", className),
66
+ ...props
67
+ }
68
+ ));
69
+ DrawerTitle.displayName = "DrawerTitle";
70
+ var DrawerDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
71
+ Drawer$1.Description,
72
+ {
73
+ ref,
74
+ className: cn("text-sm text-muted-foreground", className),
75
+ ...props
76
+ }
77
+ ));
78
+ DrawerDescription.displayName = "DrawerDescription";
79
+
80
+ export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
81
+ //# sourceMappingURL=drawer.js.map
82
+ //# sourceMappingURL=drawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"s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AU,sEAAA,EAAuE,aAAA,EAAY,MAAA,EAAO,CAAA;AAAA,QACxG;AAAA;AAAA;AAAA;AACF,CAAA,EACD,CACA;AACD,aAAA,CAAc,WAAA,GAAc,eAAA;AAM5B,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAyC;AACpF,EAAA,uBACC,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,+DAAA,EAAiE,SAAS,CAAA;AAAA,MACvF,GAAG;AAAA;AAAA,GACL;AAEF;AAMA,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAyC;AACpF,EAAA,uBAAO,GAAA,CAAC,SAAI,SAAA,EAAW,EAAA,CAAG,4EAA4E,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAC9H;AAGA,IAAM,WAAA,GAAoB,iBAGxB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC3B,GAAA;AAAA,EAACA,QAAA,CAAgB,KAAA;AAAA,EAAhB;AAAA,IACA,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,mDAAA,EAAqD,SAAS,CAAA;AAAA,IAC3E,GAAG;AAAA;AACL,CACA;AACD,WAAA,CAAY,WAAA,GAAc,aAAA;AAG1B,IAAM,iBAAA,GAA0B,iBAG9B,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC3B,GAAA;AAAA,EAACA,QAAA,CAAgB,WAAA;AAAA,EAAhB;AAAA,IACA,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,IACvD,GAAG;AAAA;AACL,CACA;AACD,iBAAA,CAAkB,WAAA,GAAc,mBAAA","file":"drawer.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind CSS conflict resolution.\n * @param inputs - Class values (strings, arrays, objects) to merge\n * @returns A single merged class string with Tailwind conflicts resolved\n */\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"../../lib/utils.js\";\n\ntype DrawerRootProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Root>;\n\n/**\n * Root container for a bottom drawer (vaul). Manages open state, drag, and snap points.\n * @returns A drawer root that coordinates overlay, content, and dismiss behavior.\n */\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerRootProps) {\n\treturn <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\nDrawer.displayName = \"Drawer\";\n\n/** The element that opens the drawer when clicked. */\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/** Portals drawer overlay and content into the body. */\nconst DrawerPortal = DrawerPrimitive.Portal;\n\n/** Closes the drawer when rendered inside DrawerContent. */\nconst DrawerClose = DrawerPrimitive.Close;\n\n/** Dimmed backdrop behind the drawer content. */\nconst DrawerOverlay = React.forwardRef<\n\tReact.ComponentRef<typeof DrawerPrimitive.Overlay>,\n\tReact.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<DrawerPrimitive.Overlay\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDrawerOverlay.displayName = \"DrawerOverlay\";\n\n/** The drawer content panel. Slides up from the bottom and can be dragged down to dismiss. */\nconst DrawerContent = React.forwardRef<\n\tReact.ComponentRef<typeof DrawerPrimitive.Content>,\n\tReact.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n\t<DrawerPortal>\n\t\t<DrawerOverlay />\n\t\t<DrawerPrimitive.Content\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-foreground/[0.08] bg-background\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div className=\"mx-auto mt-[var(--space-4,1rem)] h-2 w-[100px] rounded-full bg-muted\" aria-hidden=\"true\" />\n\t\t\t{children}\n\t\t</DrawerPrimitive.Content>\n\t</DrawerPortal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\n/**\n * Header container inside DrawerContent; stacks title and description.\n * @returns A div with vertical rhythm.\n */\nfunction DrawerHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\"grid gap-1.5 p-[var(--space-4,1rem)] text-center sm:text-left\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * Footer container inside DrawerContent; stacks action buttons.\n * @returns A div that stacks buttons vertically with consistent gutters.\n */\nfunction DrawerFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn <div className={cn(\"mt-auto flex flex-col gap-[var(--gap-sm,0.5rem)] p-[var(--space-4,1rem)]\", className)} {...props} />;\n}\n\n/** Accessible drawer title; vaul wires it to aria-labelledby automatically. */\nconst DrawerTitle = React.forwardRef<\n\tReact.ComponentRef<typeof DrawerPrimitive.Title>,\n\tReact.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<DrawerPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n\t\t{...props}\n\t/>\n));\nDrawerTitle.displayName = \"DrawerTitle\";\n\n/** Accessible drawer description; vaul wires it to aria-describedby automatically. */\nconst DrawerDescription = React.forwardRef<\n\tReact.ComponentRef<typeof DrawerPrimitive.Description>,\n\tReact.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<DrawerPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cn(\"text-sm text-muted-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nDrawerDescription.displayName = \"DrawerDescription\";\n\nexport {\n\tDrawer,\n\tDrawerPortal,\n\tDrawerOverlay,\n\tDrawerTrigger,\n\tDrawerClose,\n\tDrawerContent,\n\tDrawerHeader,\n\tDrawerFooter,\n\tDrawerTitle,\n\tDrawerDescription,\n};\n"]}
@@ -0,0 +1,39 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
+ import * as React from 'react';
4
+
5
+ /** Root container for a dropdown menu. */
6
+ declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
7
+ /** The element (button) that opens the dropdown. */
8
+ declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
9
+ /** Groups related menu items for a11y. */
10
+ declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
11
+ /** Portals dropdown content into the body. */
12
+ declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
13
+ /** Nested submenu root. */
14
+ declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
15
+ /** Group for checkable radio items (one selected at a time). */
16
+ declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
17
+ /** The visible dropdown panel. */
18
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ /** A clickable menu item. */
20
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
21
+ inset?: boolean;
22
+ } & React.RefAttributes<HTMLDivElement>>;
23
+ /** A menu item with a checkbox state. */
24
+ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
25
+ /** A menu item in a radio group. */
26
+ declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
27
+ /** A non-interactive section heading inside the menu. */
28
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
29
+ inset?: boolean;
30
+ } & React.RefAttributes<HTMLDivElement>>;
31
+ /** Horizontal divider between menu items. */
32
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
33
+ /**
34
+ * Right-aligned shortcut text (e.g. ⌘K) shown next to a menu item.
35
+ * @returns A span with muted, tracked typography
36
+ */
37
+ declare function DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
38
+
39
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuTrigger };
@@ -0,0 +1,133 @@
1
+ "use client";
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
+ import * as React from 'react';
4
+ import { clsx } from 'clsx';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
+
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ var DropdownMenu = DropdownMenuPrimitive.Root;
12
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
13
+ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
14
+ var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
15
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
16
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
17
+ var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
18
+ DropdownMenuPrimitive.Content,
19
+ {
20
+ ref,
21
+ sideOffset,
22
+ className: cn(
23
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border border-foreground/[0.08] bg-popover p-[var(--space-1,0.25rem)] text-popover-foreground shadow-md",
24
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
25
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
26
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
27
+ "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",
28
+ className
29
+ ),
30
+ ...props
31
+ }
32
+ ) }));
33
+ DropdownMenuContent.displayName = "DropdownMenuContent";
34
+ var DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
35
+ DropdownMenuPrimitive.Item,
36
+ {
37
+ ref,
38
+ className: cn(
39
+ "relative flex cursor-default select-none items-center gap-[var(--gap-sm,0.5rem)] rounded-sm px-[var(--space-2,0.5rem)] py-1.5 text-sm outline-none",
40
+ "transition-all duration-[var(--duration-normal,200ms)] ease-out",
41
+ "focus:bg-accent focus:text-accent-foreground",
42
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
43
+ inset && "pl-[var(--space-8,2rem)]",
44
+ className
45
+ ),
46
+ ...props
47
+ }
48
+ ));
49
+ DropdownMenuItem.displayName = "DropdownMenuItem";
50
+ var DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
51
+ DropdownMenuPrimitive.CheckboxItem,
52
+ {
53
+ ref,
54
+ className: cn(
55
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-[var(--space-8,2rem)] pr-[var(--space-2,0.5rem)] text-sm outline-none",
56
+ "transition-all duration-[var(--duration-normal,200ms)] ease-out",
57
+ "focus:bg-accent focus:text-accent-foreground",
58
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
59
+ className
60
+ ),
61
+ checked,
62
+ ...props,
63
+ children: [
64
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
65
+ "svg",
66
+ {
67
+ xmlns: "http://www.w3.org/2000/svg",
68
+ viewBox: "0 0 24 24",
69
+ fill: "none",
70
+ stroke: "currentColor",
71
+ strokeWidth: "3",
72
+ strokeLinecap: "round",
73
+ strokeLinejoin: "round",
74
+ className: "h-4 w-4",
75
+ "aria-hidden": "true",
76
+ children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
77
+ }
78
+ ) }) }),
79
+ children
80
+ ]
81
+ }
82
+ ));
83
+ DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
84
+ var DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
85
+ DropdownMenuPrimitive.RadioItem,
86
+ {
87
+ ref,
88
+ className: cn(
89
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-[var(--space-8,2rem)] pr-[var(--space-2,0.5rem)] text-sm outline-none",
90
+ "transition-all duration-[var(--duration-normal,200ms)] ease-out",
91
+ "focus:bg-accent focus:text-accent-foreground",
92
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
93
+ className
94
+ ),
95
+ ...props,
96
+ children: [
97
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-2 w-2 fill-current", "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }) }),
98
+ children
99
+ ]
100
+ }
101
+ ));
102
+ DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
103
+ var DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
104
+ DropdownMenuPrimitive.Label,
105
+ {
106
+ ref,
107
+ className: cn("px-[var(--space-2,0.5rem)] py-1.5 text-sm font-semibold", inset && "pl-[var(--space-8,2rem)]", className),
108
+ ...props
109
+ }
110
+ ));
111
+ DropdownMenuLabel.displayName = "DropdownMenuLabel";
112
+ var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
113
+ DropdownMenuPrimitive.Separator,
114
+ {
115
+ ref,
116
+ className: cn("-mx-[var(--space-1,0.25rem)] my-[var(--space-1,0.25rem)] h-px bg-foreground/[0.12]", className),
117
+ ...props
118
+ }
119
+ ));
120
+ DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
121
+ function DropdownMenuShortcut({ className, ...props }) {
122
+ return /* @__PURE__ */ jsx(
123
+ "span",
124
+ {
125
+ className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
126
+ ...props
127
+ }
128
+ );
129
+ }
130
+
131
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuTrigger };
132
+ //# sourceMappingURL=dropdown-menu.js.map
133
+ //# sourceMappingURL=dropdown-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/utils.ts","../src/components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":";;;;;;AAQO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACHA,IAAM,YAAA,GAAqC,qBAAA,CAAA;AAG3C,IAAM,mBAAA,GAA4C,qBAAA,CAAA;AAGlD,IAAM,iBAAA,GAA0C,qBAAA,CAAA;AAGhD,IAAM,kBAAA,GAA2C,qBAAA,CAAA;AAGjD,IAAM,eAAA,GAAwC,qBAAA,CAAA;AAG9C,IAAM,sBAAA,GAA+C,qBAAA,CAAA;AAGrD,IAAM,mBAAA,GAA4B,KAAA,CAAA,UAAA,CAGhC,CAAC,EAAE,SAAA,EAAW,UAAA,GAAa,CAAA,EAAG,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC3C,GAAA,CAAuB,8BAAtB,EACA,QAAA,kBAAA,GAAA;AAAA,EAAuB,qBAAA,CAAA,OAAA;AAAA,EAAtB;AAAA,IACA,GAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACV,sJAAA;AAAA,MACA,8DAAA;AAAA,MACA,4DAAA;AAAA,MACA,8DAAA;AAAA,MACA,6JAAA;AAAA,MACA;AAAA,KACD;AAAA,IACC,GAAG;AAAA;AACL,CAAA,EACD,CACA;AACD,mBAAA,CAAoB,WAAA,GAAc,qBAAA;AAGlC,IAAM,gBAAA,GAAyB,iBAG7B,CAAC,EAAE,WAAW,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,qBAClC,GAAA;A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W,GAAG,KAAA,IAAS,GAAA,qBAC3B,GAAA;AAAA,EAAuB,qBAAA,CAAA,SAAA;AAAA,EAAtB;AAAA,IACA,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,oFAAA,EAAsF,SAAS,CAAA;AAAA,IAC5G,GAAG;AAAA;AACL,CACA;AACD,qBAAA,CAAsB,WAAA,GAAc,uBAAA;AAMpC,SAAS,oBAAA,CAAqB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA0C;AAC7F,EAAA,uBACC,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,uDAAA,EAAyD,SAAS,CAAA;AAAA,MAC/E,GAAG;AAAA;AAAA,GACL;AAEF","file":"dropdown-menu.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind CSS conflict resolution.\n * @param inputs - Class values (strings, arrays, objects) to merge\n * @returns A single merged class string with Tailwind conflicts resolved\n */\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils.js\";\n\n/** Root container for a dropdown menu. */\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/** The element (button) that opens the dropdown. */\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/** Groups related menu items for a11y. */\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/** Portals dropdown content into the body. */\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\n/** Nested submenu root. */\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/** Group for checkable radio items (one selected at a time). */\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/** The visible dropdown panel. */\nconst DropdownMenuContent = React.forwardRef<\n\tReact.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n\tReact.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Portal>\n\t\t<DropdownMenuPrimitive.Content\n\t\t\tref={ref}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn(\n\t\t\t\t\"z-50 min-w-[8rem] overflow-hidden rounded-md border border-foreground/[0.08] bg-popover p-[var(--space-1,0.25rem)] text-popover-foreground shadow-md\",\n\t\t\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n\t\t\t\t\"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n\t\t\t\t\"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n\t\t\t\t\"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\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t</DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = \"DropdownMenuContent\";\n\n/** A clickable menu item. */\nconst DropdownMenuItem = React.forwardRef<\n\tReact.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n\tReact.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Item\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"relative flex cursor-default select-none items-center gap-[var(--gap-sm,0.5rem)] rounded-sm px-[var(--space-2,0.5rem)] py-1.5 text-sm outline-none\",\n\t\t\t\"transition-all duration-[var(--duration-normal,200ms)] ease-out\",\n\t\t\t\"focus:bg-accent focus:text-accent-foreground\",\n\t\t\t\"data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n\t\t\tinset && \"pl-[var(--space-8,2rem)]\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuItem.displayName = \"DropdownMenuItem\";\n\n/** A menu item with a checkbox state. */\nconst DropdownMenuCheckboxItem = React.forwardRef<\n\tReact.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n\tReact.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n\t<DropdownMenuPrimitive.CheckboxItem\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-[var(--space-8,2rem)] pr-[var(--space-2,0.5rem)] text-sm outline-none\",\n\t\t\t\"transition-all duration-[var(--duration-normal,200ms)] ease-out\",\n\t\t\t\"focus:bg-accent focus:text-accent-foreground\",\n\t\t\t\"data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n\t\t\tclassName,\n\t\t)}\n\t\tchecked={checked}\n\t\t{...props}\n\t>\n\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstrokeWidth=\"3\"\n\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\tclassName=\"h-4 w-4\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<polyline points=\"20 6 9 17 4 12\" />\n\t\t\t\t</svg>\n\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t</span>\n\t\t{children}\n\t</DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = \"DropdownMenuCheckboxItem\";\n\n/** A menu item in a radio group. */\nconst DropdownMenuRadioItem = React.forwardRef<\n\tReact.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n\tReact.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n\t<DropdownMenuPrimitive.RadioItem\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-[var(--space-8,2rem)] pr-[var(--space-2,0.5rem)] text-sm outline-none\",\n\t\t\t\"transition-all duration-[var(--duration-normal,200ms)] ease-out\",\n\t\t\t\"focus:bg-accent focus:text-accent-foreground\",\n\t\t\t\"data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t<svg viewBox=\"0 0 24 24\" className=\"h-2 w-2 fill-current\" aria-hidden=\"true\">\n\t\t\t\t\t<circle cx=\"12\" cy=\"12\" r=\"10\" />\n\t\t\t\t</svg>\n\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t</span>\n\t\t{children}\n\t</DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = \"DropdownMenuRadioItem\";\n\n/** A non-interactive section heading inside the menu. */\nconst DropdownMenuLabel = React.forwardRef<\n\tReact.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n\tReact.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Label\n\t\tref={ref}\n\t\tclassName={cn(\"px-[var(--space-2,0.5rem)] py-1.5 text-sm font-semibold\", inset && \"pl-[var(--space-8,2rem)]\", className)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\";\n\n/** Horizontal divider between menu items. */\nconst DropdownMenuSeparator = React.forwardRef<\n\tReact.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n\tReact.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Separator\n\t\tref={ref}\n\t\tclassName={cn(\"-mx-[var(--space-1,0.25rem)] my-[var(--space-1,0.25rem)] h-px bg-foreground/[0.12]\", className)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\";\n\n/**\n * Right-aligned shortcut text (e.g. ⌘K) shown next to a menu item.\n * @returns A span with muted, tracked typography\n */\nfunction DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) {\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuRadioItem,\n\tDropdownMenuLabel,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuGroup,\n\tDropdownMenuPortal,\n\tDropdownMenuSub,\n\tDropdownMenuRadioGroup,\n};\n"]}
@@ -0,0 +1,54 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ interface DropzoneProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "onDrop" | "children"> {
5
+ /** Fired with the accepted file list every time the user picks or drops files. */
6
+ onFilesSelected?: (files: File[]) => void;
7
+ /**
8
+ * Fired when files are dropped/picked but ALL of them are filtered out by
9
+ * `accept` / `maxSize` / `maxFiles`. Useful for surfacing "file too large"
10
+ * or "wrong type" toasts to the user. Receives the rejected File[].
11
+ */
12
+ onFilesRejected?: (files: File[]) => void;
13
+ /** `accept` attribute forwarded to the hidden file input (e.g. "image/*", ".csv"). */
14
+ accept?: string;
15
+ /** Allow multiple files. Default true. */
16
+ multiple?: boolean;
17
+ /** Maximum total file count (after dedupe). Excess files are dropped silently — surface in your handler. */
18
+ maxFiles?: number;
19
+ /** Maximum size per file in bytes. Files over the cap are filtered before onFilesSelected fires. */
20
+ maxSize?: number;
21
+ /** Disable interaction. */
22
+ disabled?: boolean;
23
+ /** Optional render override for the dropzone body. Receives drag state. */
24
+ children?: React.ReactNode | ((state: DropzoneRenderState) => React.ReactNode);
25
+ /** Required accessible name for the drop area. */
26
+ "aria-label": string;
27
+ }
28
+ interface DropzoneRenderState {
29
+ isDragOver: boolean;
30
+ isDisabled: boolean;
31
+ openFileDialog: () => void;
32
+ }
33
+ /**
34
+ * Drag-and-drop file input built on the native HTML5 drag-drop API plus a
35
+ * visually-hidden (sr-only) `<input type="file">` for screen-reader and
36
+ * keyboard access.
37
+ *
38
+ * Two interaction surfaces:
39
+ * - The visible drop area is a `role="button"` div with `tabIndex=0` and the
40
+ * required `aria-label`. Click, Enter, or Space proxies through to click the
41
+ * hidden input, opening the system file dialog.
42
+ * - The hidden input itself remains in the accessibility tree (sr-only, NOT
43
+ * `aria-hidden`) so AT-driven file pickers can find it directly.
44
+ *
45
+ * Pass `children` as a node (default placeholder) or a function receiving
46
+ * `{ isDragOver, isDisabled, openFileDialog }` for full layout control.
47
+ * @returns A drop area + hidden file input pair that yields a File[].
48
+ */
49
+ declare function Dropzone({ onFilesSelected, onFilesRejected, accept, multiple, maxFiles, maxSize, disabled, children, className, "aria-label": ariaLabel, ...rest }: DropzoneProps): react_jsx_runtime.JSX.Element;
50
+ declare namespace Dropzone {
51
+ var displayName: string;
52
+ }
53
+
54
+ export { Dropzone, type DropzoneProps, type DropzoneRenderState };
@@ -0,0 +1,194 @@
1
+ "use client";
2
+ import * as React from 'react';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
6
+
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+ function filterFiles(files, { accept, maxSize, maxFiles }) {
11
+ const list = Array.from(files);
12
+ const acceptList = accept ? accept.split(",").map((s) => s.trim()).filter(Boolean) : void 0;
13
+ const matchAccept = (file) => {
14
+ if (!acceptList) return true;
15
+ return acceptList.some((entry) => {
16
+ if (entry.startsWith(".")) {
17
+ return file.name.toLowerCase().endsWith(entry.toLowerCase());
18
+ }
19
+ if (entry.endsWith("/*")) {
20
+ const prefix = entry.slice(0, -1);
21
+ return file.type.startsWith(prefix);
22
+ }
23
+ return file.type === entry;
24
+ });
25
+ };
26
+ const sized = typeof maxSize === "number" ? list.filter((f) => f.size <= maxSize) : list;
27
+ const accepted = sized.filter(matchAccept);
28
+ if (typeof maxFiles === "number") return accepted.slice(0, maxFiles);
29
+ return accepted;
30
+ }
31
+ function Dropzone({
32
+ onFilesSelected,
33
+ onFilesRejected,
34
+ accept,
35
+ multiple = true,
36
+ maxFiles,
37
+ maxSize,
38
+ disabled = false,
39
+ children,
40
+ className,
41
+ "aria-label": ariaLabel,
42
+ ...rest
43
+ }) {
44
+ const inputRef = React.useRef(null);
45
+ const [isDragOver, setIsDragOver] = React.useState(false);
46
+ const dragCounter = React.useRef(0);
47
+ const emit = React.useCallback(
48
+ (files) => {
49
+ if (!files || disabled) return;
50
+ const all = Array.from(files);
51
+ if (all.length === 0) return;
52
+ const accepted = filterFiles(all, { accept, maxSize, maxFiles });
53
+ if (accepted.length === 0) {
54
+ onFilesRejected?.(all);
55
+ return;
56
+ }
57
+ const finalAccepted = !multiple ? accepted.slice(0, 1) : accepted;
58
+ const rejected = all.filter((f) => !finalAccepted.includes(f));
59
+ onFilesSelected?.(finalAccepted);
60
+ if (rejected.length > 0) onFilesRejected?.(rejected);
61
+ },
62
+ [
63
+ accept,
64
+ disabled,
65
+ maxFiles,
66
+ maxSize,
67
+ multiple,
68
+ onFilesSelected,
69
+ onFilesRejected
70
+ ]
71
+ );
72
+ React.useEffect(() => {
73
+ const reset = () => {
74
+ dragCounter.current = 0;
75
+ setIsDragOver(false);
76
+ };
77
+ window.addEventListener("dragend", reset);
78
+ window.addEventListener("drop", reset);
79
+ return () => {
80
+ window.removeEventListener("dragend", reset);
81
+ window.removeEventListener("drop", reset);
82
+ };
83
+ }, []);
84
+ const openFileDialog = React.useCallback(() => {
85
+ if (disabled) return;
86
+ inputRef.current?.click();
87
+ }, [disabled]);
88
+ const handleDragEnter = (e) => {
89
+ if (disabled) return;
90
+ e.preventDefault();
91
+ dragCounter.current += 1;
92
+ if (e.dataTransfer.types.includes("Files")) setIsDragOver(true);
93
+ };
94
+ const handleDragOver = (e) => {
95
+ if (disabled) return;
96
+ e.preventDefault();
97
+ e.dataTransfer.dropEffect = "copy";
98
+ };
99
+ const handleDragLeave = (e) => {
100
+ if (disabled) return;
101
+ e.preventDefault();
102
+ dragCounter.current = Math.max(0, dragCounter.current - 1);
103
+ if (dragCounter.current === 0) setIsDragOver(false);
104
+ };
105
+ const handleDrop = (e) => {
106
+ if (disabled) return;
107
+ e.preventDefault();
108
+ dragCounter.current = 0;
109
+ setIsDragOver(false);
110
+ emit(e.dataTransfer.files);
111
+ };
112
+ const handleKeyDown = (e) => {
113
+ if (disabled) return;
114
+ if (e.key === "Enter" || e.key === " ") {
115
+ e.preventDefault();
116
+ openFileDialog();
117
+ }
118
+ };
119
+ const renderState = {
120
+ isDragOver,
121
+ isDisabled: disabled,
122
+ openFileDialog
123
+ };
124
+ return /* @__PURE__ */ jsxs(
125
+ "div",
126
+ {
127
+ role: "button",
128
+ tabIndex: disabled ? -1 : 0,
129
+ "aria-label": ariaLabel,
130
+ "aria-disabled": disabled || void 0,
131
+ "data-drag-over": isDragOver || void 0,
132
+ onClick: openFileDialog,
133
+ onKeyDown: handleKeyDown,
134
+ onDragEnter: handleDragEnter,
135
+ onDragOver: handleDragOver,
136
+ onDragLeave: handleDragLeave,
137
+ onDrop: handleDrop,
138
+ className: cn(
139
+ "flex w-full cursor-pointer select-none flex-col items-center justify-center gap-[var(--space-2,0.5rem)] rounded-md border-2 border-dashed border-input bg-background px-[var(--space-6,1.5rem)] py-[var(--space-8,2rem)] text-center text-sm transition-all duration-[var(--duration-normal,200ms)] ease-out",
140
+ "hover:bg-accent hover:text-accent-foreground",
141
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
142
+ isDragOver && "border-primary bg-accent text-accent-foreground",
143
+ disabled && "pointer-events-none opacity-50",
144
+ className
145
+ ),
146
+ ...rest,
147
+ children: [
148
+ typeof children === "function" ? children(renderState) : children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
149
+ /* @__PURE__ */ jsxs(
150
+ "svg",
151
+ {
152
+ xmlns: "http://www.w3.org/2000/svg",
153
+ viewBox: "0 0 24 24",
154
+ fill: "none",
155
+ stroke: "currentColor",
156
+ strokeWidth: "2",
157
+ strokeLinecap: "round",
158
+ strokeLinejoin: "round",
159
+ className: "h-6 w-6 text-muted-foreground",
160
+ "aria-hidden": "true",
161
+ children: [
162
+ /* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
163
+ /* @__PURE__ */ jsx("polyline", { points: "17 8 12 3 7 8" }),
164
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
165
+ ]
166
+ }
167
+ ),
168
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: isDragOver ? "Drop files to upload" : "Drag files here or click to browse" }),
169
+ accept ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: accept }) : null
170
+ ] }),
171
+ /* @__PURE__ */ jsx(
172
+ "input",
173
+ {
174
+ ref: inputRef,
175
+ type: "file",
176
+ accept,
177
+ multiple,
178
+ disabled,
179
+ className: "sr-only",
180
+ onChange: (e) => {
181
+ emit(e.target.files);
182
+ e.target.value = "";
183
+ }
184
+ }
185
+ )
186
+ ]
187
+ }
188
+ );
189
+ }
190
+ Dropzone.displayName = "Dropzone";
191
+
192
+ export { Dropzone };
193
+ //# sourceMappingURL=dropzone.js.map
194
+ //# sourceMappingURL=dropzone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/utils.ts","../src/components/dropzone/dropzone.tsx"],"names":[],"mappings":";;;;;AAQO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;AC+BA,SAAS,YACR,KAAA,EACA,EAAE,MAAA,EAAQ,OAAA,EAAS,UAAS,EACnB;AACT,EAAA,MAAM,IAAA,GAAO,KAAA,CAAM,IAAA,CAAK,KAAK,CAAA;AAC7B,EAAA,MAAM,UAAA,GAAa,MAAA,GAChB,MAAA,CACC,KAAA,CAAM,GAAG,CAAA,CACT,GAAA,CAAI,CAAC,CAAA,KAAM,EAAE,IAAA,EAAM,CAAA,CACnB,MAAA,CAAO,OAAO,CAAA,GACf,MAAA;AAEH,EAAA,MAAM,WAAA,GAAc,CAAC,IAAA,KAAwB;AAC5C,IAAA,IAAI,CAAC,YAAY,OAAO,IAAA;AACxB,IAAA,OAAO,UAAA,CAAW,IAAA,CAAK,CAAC,KAAA,KAAU;AACjC,MAAA,IAAI,KAAA,CAAM,UAAA,CAAW,GAAG,CAAA,EAAG;AAC1B,QAAA,OAAO,KAAK,IAAA,CAAK,WAAA,GAAc,QAAA,CAAS,KAAA,CAAM,aAAa,CAAA;AAAA,MAC5D;AACA,MAAA,IAAI,KAAA,CAAM,QAAA,CAAS,IAAI,CAAA,EAAG;AACzB,QAAA,MAAM,MAAA,GAAS,KAAA,CAAM,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA;AAChC,QAAA,OAAO,IAAA,CAAK,IAAA,CAAK,UAAA,CAAW,MAAM,CAAA;AAAA,MACnC;AACA,MAAA,OAAO,KAAK,IAAA,KAAS,KAAA;AAAA,IACtB,CAAC,CAAA;AAAA,EACF,CAAA;AAEA,EAAA,MAAM,KAAA,GACL,OAAO,OAAA,KAAY,QAAA,GAAW,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GAAA,EAAI,EAAA,EAAG,IAAA,EAAK,EAAA,EAAG,IAAA,EAAK;AAAA;AAAA;AAAA,WACtC;AAAA,8BACC,MAAA,EAAA,EAAK,SAAA,EAAU,aAAA,EACd,QAAA,EAAA,UAAA,GAAa,yBAAyB,oCAAA,EACxC,CAAA;AAAA,UACC,yBACA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,+BAAA,EAAiC,kBAAO,CAAA,GACrD;AAAA,SAAA,EACL,CAAA;AAAA,wBAEH,GAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACA,GAAA,EAAK,QAAA;AAAA,YACL,IAAA,EAAK,MAAA;AAAA,YACL,MAAA;AAAA,YACA,QAAA;AAAA,YACA,QAAA;AAAA,YACA,SAAA,EAAU,SAAA;AAAA,YAMV,QAAA,EAAU,CAAC,CAAA,KAAM;AAChB,cAAA,IAAA,CAAK,CAAA,CAAE,OAAO,KAAK,CAAA;AAEnB,cAAA,CAAA,CAAE,OAAO,KAAA,GAAQ,EAAA;AAAA,YAClB;AAAA;AAAA;AACD;AAAA;AAAA,GACD;AAEF;AACA,QAAA,CAAS,WAAA,GAAc,UAAA","file":"dropzone.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind CSS conflict resolution.\n * @param inputs - Class values (strings, arrays, objects) to merge\n * @returns A single merged class string with Tailwind conflicts resolved\n */\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils.js\";\n\ninterface DropzoneProps\n\textends Omit<\n\t\tReact.HTMLAttributes<HTMLDivElement>,\n\t\t\"onChange\" | \"onDrop\" | \"children\"\n\t> {\n\t/** Fired with the accepted file list every time the user picks or drops files. */\n\tonFilesSelected?: (files: File[]) => void;\n\t/**\n\t * Fired when files are dropped/picked but ALL of them are filtered out by\n\t * `accept` / `maxSize` / `maxFiles`. Useful for surfacing \"file too large\"\n\t * or \"wrong type\" toasts to the user. Receives the rejected File[].\n\t */\n\tonFilesRejected?: (files: File[]) => void;\n\t/** `accept` attribute forwarded to the hidden file input (e.g. \"image/*\", \".csv\"). */\n\taccept?: string;\n\t/** Allow multiple files. Default true. */\n\tmultiple?: boolean;\n\t/** Maximum total file count (after dedupe). Excess files are dropped silently — surface in your handler. */\n\tmaxFiles?: number;\n\t/** Maximum size per file in bytes. Files over the cap are filtered before onFilesSelected fires. */\n\tmaxSize?: number;\n\t/** Disable interaction. */\n\tdisabled?: boolean;\n\t/** Optional render override for the dropzone body. Receives drag state. */\n\tchildren?: React.ReactNode | ((state: DropzoneRenderState) => React.ReactNode);\n\t/** Required accessible name for the drop area. */\n\t\"aria-label\": string;\n}\n\ninterface DropzoneRenderState {\n\tisDragOver: boolean;\n\tisDisabled: boolean;\n\topenFileDialog: () => void;\n}\n\n/** Apply `accept` / `maxSize` / `maxFiles` filters before emitting to onFilesSelected. */\nfunction filterFiles(\n\tfiles: FileList | File[],\n\t{ accept, maxSize, maxFiles }: { accept?: string; maxSize?: number; maxFiles?: number },\n): File[] {\n\tconst list = Array.from(files);\n\tconst acceptList = accept\n\t\t? accept\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((s) => s.trim())\n\t\t\t\t.filter(Boolean)\n\t\t: undefined;\n\n\tconst matchAccept = (file: File): boolean => {\n\t\tif (!acceptList) return true;\n\t\treturn acceptList.some((entry) => {\n\t\t\tif (entry.startsWith(\".\")) {\n\t\t\t\treturn file.name.toLowerCase().endsWith(entry.toLowerCase());\n\t\t\t}\n\t\t\tif (entry.endsWith(\"/*\")) {\n\t\t\t\tconst prefix = entry.slice(0, -1); // \"image/\"\n\t\t\t\treturn file.type.startsWith(prefix);\n\t\t\t}\n\t\t\treturn file.type === entry;\n\t\t});\n\t};\n\n\tconst sized =\n\t\ttypeof maxSize === \"number\" ? list.filter((f) => f.size <= maxSize) : list;\n\tconst accepted = sized.filter(matchAccept);\n\tif (typeof maxFiles === \"number\") return accepted.slice(0, maxFiles);\n\treturn accepted;\n}\n\n/**\n * Drag-and-drop file input built on the native HTML5 drag-drop API plus a\n * visually-hidden (sr-only) `<input type=\"file\">` for screen-reader and\n * keyboard access.\n *\n * Two interaction surfaces:\n * - The visible drop area is a `role=\"button\"` div with `tabIndex=0` and the\n * required `aria-label`. Click, Enter, or Space proxies through to click the\n * hidden input, opening the system file dialog.\n * - The hidden input itself remains in the accessibility tree (sr-only, NOT\n * `aria-hidden`) so AT-driven file pickers can find it directly.\n *\n * Pass `children` as a node (default placeholder) or a function receiving\n * `{ isDragOver, isDisabled, openFileDialog }` for full layout control.\n * @returns A drop area + hidden file input pair that yields a File[].\n */\nfunction Dropzone({\n\tonFilesSelected,\n\tonFilesRejected,\n\taccept,\n\tmultiple = true,\n\tmaxFiles,\n\tmaxSize,\n\tdisabled = false,\n\tchildren,\n\tclassName,\n\t\"aria-label\": ariaLabel,\n\t...rest\n}: DropzoneProps) {\n\tconst inputRef = React.useRef<HTMLInputElement>(null);\n\tconst [isDragOver, setIsDragOver] = React.useState(false);\n\tconst dragCounter = React.useRef(0);\n\n\tconst emit = React.useCallback(\n\t\t(files: FileList | File[] | null | undefined) => {\n\t\t\tif (!files || disabled) return;\n\t\t\tconst all = Array.from(files);\n\t\t\tif (all.length === 0) return;\n\t\t\tconst accepted = filterFiles(all, { accept, maxSize, maxFiles });\n\t\t\tif (accepted.length === 0) {\n\t\t\t\tonFilesRejected?.(all);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst finalAccepted = !multiple ? accepted.slice(0, 1) : accepted;\n\t\t\tconst rejected = all.filter((f) => !finalAccepted.includes(f));\n\t\t\tonFilesSelected?.(finalAccepted);\n\t\t\tif (rejected.length > 0) onFilesRejected?.(rejected);\n\t\t},\n\t\t[\n\t\t\taccept,\n\t\t\tdisabled,\n\t\t\tmaxFiles,\n\t\t\tmaxSize,\n\t\t\tmultiple,\n\t\t\tonFilesSelected,\n\t\t\tonFilesRejected,\n\t\t],\n\t);\n\n\t/*\n\t * Reset the drag counter + isDragOver when the user cancels a drag outside\n\t * the dropzone (Esc, drag off the page, switch tab). Without this, the\n\t * counter can stay >0 and the dropzone gets stuck in its hover style.\n\t */\n\tReact.useEffect(() => {\n\t\tconst reset = () => {\n\t\t\tdragCounter.current = 0;\n\t\t\tsetIsDragOver(false);\n\t\t};\n\t\twindow.addEventListener(\"dragend\", reset);\n\t\twindow.addEventListener(\"drop\", reset);\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"dragend\", reset);\n\t\t\twindow.removeEventListener(\"drop\", reset);\n\t\t};\n\t}, []);\n\n\tconst openFileDialog = React.useCallback(() => {\n\t\tif (disabled) return;\n\t\tinputRef.current?.click();\n\t}, [disabled]);\n\n\tconst handleDragEnter = (e: React.DragEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\te.preventDefault();\n\t\tdragCounter.current += 1;\n\t\tif (e.dataTransfer.types.includes(\"Files\")) setIsDragOver(true);\n\t};\n\tconst handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\te.preventDefault();\n\t\te.dataTransfer.dropEffect = \"copy\";\n\t};\n\tconst handleDragLeave = (e: React.DragEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\te.preventDefault();\n\t\tdragCounter.current = Math.max(0, dragCounter.current - 1);\n\t\tif (dragCounter.current === 0) setIsDragOver(false);\n\t};\n\tconst handleDrop = (e: React.DragEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\te.preventDefault();\n\t\tdragCounter.current = 0;\n\t\tsetIsDragOver(false);\n\t\temit(e.dataTransfer.files);\n\t};\n\tconst handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\tif (e.key === \"Enter\" || e.key === \" \") {\n\t\t\te.preventDefault();\n\t\t\topenFileDialog();\n\t\t}\n\t};\n\n\tconst renderState: DropzoneRenderState = {\n\t\tisDragOver,\n\t\tisDisabled: disabled,\n\t\topenFileDialog,\n\t};\n\n\treturn (\n\t\t<div\n\t\t\trole=\"button\"\n\t\t\ttabIndex={disabled ? -1 : 0}\n\t\t\taria-label={ariaLabel}\n\t\t\taria-disabled={disabled || undefined}\n\t\t\tdata-drag-over={isDragOver || undefined}\n\t\t\tonClick={openFileDialog}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tonDragEnter={handleDragEnter}\n\t\t\tonDragOver={handleDragOver}\n\t\t\tonDragLeave={handleDragLeave}\n\t\t\tonDrop={handleDrop}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex w-full cursor-pointer select-none flex-col items-center justify-center gap-[var(--space-2,0.5rem)] rounded-md border-2 border-dashed border-input bg-background px-[var(--space-6,1.5rem)] py-[var(--space-8,2rem)] text-center text-sm transition-all duration-[var(--duration-normal,200ms)] ease-out\",\n\t\t\t\t\"hover:bg-accent hover:text-accent-foreground\",\n\t\t\t\t\"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n\t\t\t\tisDragOver && \"border-primary bg-accent text-accent-foreground\",\n\t\t\t\tdisabled && \"pointer-events-none opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{typeof children === \"function\"\n\t\t\t\t? children(renderState)\n\t\t\t\t: (children ?? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\t\t\t\tclassName=\"h-6 w-6 text-muted-foreground\"\n\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n\t\t\t\t\t\t\t\t<polyline points=\"17 8 12 3 7 8\" />\n\t\t\t\t\t\t\t\t<line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<span className=\"font-medium\">\n\t\t\t\t\t\t\t\t{isDragOver ? \"Drop files to upload\" : \"Drag files here or click to browse\"}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{accept ? (\n\t\t\t\t\t\t\t\t<span className=\"text-xs text-muted-foreground\">{accept}</span>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</>\n\t\t\t\t\t))}\n\t\t\t<input\n\t\t\t\tref={inputRef}\n\t\t\t\ttype=\"file\"\n\t\t\t\taccept={accept}\n\t\t\t\tmultiple={multiple}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tclassName=\"sr-only\"\n\t\t\t\t/*\n\t\t\t\t * Intentionally NOT aria-hidden + NOT tabIndex=-1: the input\n\t\t\t\t * stays in the a11y tree so AT-driven file pickers (NVDA's\n\t\t\t\t * forms mode, JAWS) can find it. Visually hidden via sr-only.\n\t\t\t\t */\n\t\t\t\tonChange={(e) => {\n\t\t\t\t\temit(e.target.files);\n\t\t\t\t\t// Reset so picking the same file twice still fires onChange\n\t\t\t\t\te.target.value = \"\";\n\t\t\t\t}}\n\t\t\t/>\n\t\t</div>\n\t);\n}\nDropzone.displayName = \"Dropzone\";\n\nexport { Dropzone };\nexport type { DropzoneProps, DropzoneRenderState };\n"]}