@loccal/ui 0.0.0-stage → 0.3.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 (254) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE +21 -0
  3. package/README.md +38 -3
  4. package/dist/components/ui/accordion.d.ts +6 -0
  5. package/dist/components/ui/accordion.js +17 -0
  6. package/dist/components/ui/ai-panel.d.ts +47 -0
  7. package/dist/components/ui/ai-panel.js +74 -0
  8. package/dist/components/ui/alert-dialog.d.ts +18 -0
  9. package/dist/components/ui/alert-dialog.js +42 -0
  10. package/dist/components/ui/alert.d.ts +10 -0
  11. package/dist/components/ui/alert.js +27 -0
  12. package/dist/components/ui/avatar.d.ts +11 -0
  13. package/dist/components/ui/avatar.js +23 -0
  14. package/dist/components/ui/badge.d.ts +7 -0
  15. package/dist/components/ui/badge.js +36 -0
  16. package/dist/components/ui/breadcrumb.d.ts +10 -0
  17. package/dist/components/ui/breadcrumb.js +36 -0
  18. package/dist/components/ui/button-group.d.ts +10 -0
  19. package/dist/components/ui/button-group.js +36 -0
  20. package/dist/components/ui/button.d.ts +8 -0
  21. package/dist/components/ui/button.js +34 -0
  22. package/dist/components/ui/calendar.d.ts +10 -0
  23. package/dist/components/ui/calendar.js +76 -0
  24. package/dist/components/ui/card.d.ts +11 -0
  25. package/dist/components/ui/card.js +24 -0
  26. package/dist/components/ui/chart.d.ts +44 -0
  27. package/dist/components/ui/chart.js +132 -0
  28. package/dist/components/ui/checkbox.d.ts +3 -0
  29. package/dist/components/ui/checkbox.js +9 -0
  30. package/dist/components/ui/code-view.d.ts +31 -0
  31. package/dist/components/ui/code-view.js +62 -0
  32. package/dist/components/ui/collapsible.d.ts +5 -0
  33. package/dist/components/ui/collapsible.js +13 -0
  34. package/dist/components/ui/command-block.d.ts +28 -0
  35. package/dist/components/ui/command-block.js +58 -0
  36. package/dist/components/ui/command.d.ts +19 -0
  37. package/dist/components/ui/command.js +35 -0
  38. package/dist/components/ui/connection-status.d.ts +29 -0
  39. package/dist/components/ui/connection-status.js +26 -0
  40. package/dist/components/ui/context-menu.d.ts +29 -0
  41. package/dist/components/ui/context-menu.js +51 -0
  42. package/dist/components/ui/data-table.d.ts +49 -0
  43. package/dist/components/ui/data-table.js +100 -0
  44. package/dist/components/ui/dialog.d.ts +18 -0
  45. package/dist/components/ui/dialog.js +37 -0
  46. package/dist/components/ui/drawer.d.ts +16 -0
  47. package/dist/components/ui/drawer.js +75 -0
  48. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  49. package/dist/components/ui/dropdown-menu.js +51 -0
  50. package/dist/components/ui/dropzone.d.ts +11 -0
  51. package/dist/components/ui/dropzone.js +39 -0
  52. package/dist/components/ui/empty.d.ts +11 -0
  53. package/dist/components/ui/empty.js +33 -0
  54. package/dist/components/ui/field.d.ts +24 -0
  55. package/dist/components/ui/field.js +68 -0
  56. package/dist/components/ui/file-tree.d.ts +42 -0
  57. package/dist/components/ui/file-tree.js +88 -0
  58. package/dist/components/ui/file-type-icon.d.ts +16 -0
  59. package/dist/components/ui/file-type-icon.js +19 -0
  60. package/dist/components/ui/hash-chain.d.ts +43 -0
  61. package/dist/components/ui/hash-chain.js +34 -0
  62. package/dist/components/ui/history-palette.d.ts +37 -0
  63. package/dist/components/ui/history-palette.js +44 -0
  64. package/dist/components/ui/hover-card.d.ts +5 -0
  65. package/dist/components/ui/hover-card.js +14 -0
  66. package/dist/components/ui/icon-base.d.ts +15 -0
  67. package/dist/components/ui/icon-base.js +18 -0
  68. package/dist/components/ui/icon.d.ts +15 -0
  69. package/dist/components/ui/icon.js +32 -0
  70. package/dist/components/ui/icons-compat.d.ts +32 -0
  71. package/dist/components/ui/icons-compat.js +34 -0
  72. package/dist/components/ui/icons.d.ts +1048 -0
  73. package/dist/components/ui/icons.js +264 -0
  74. package/dist/components/ui/input-group.d.ts +18 -0
  75. package/dist/components/ui/input-group.js +57 -0
  76. package/dist/components/ui/input-otp.d.ts +11 -0
  77. package/dist/components/ui/input-otp.js +21 -0
  78. package/dist/components/ui/input.d.ts +3 -0
  79. package/dist/components/ui/input.js +7 -0
  80. package/dist/components/ui/kbd.d.ts +3 -0
  81. package/dist/components/ui/kbd.js +9 -0
  82. package/dist/components/ui/label.d.ts +3 -0
  83. package/dist/components/ui/label.js +7 -0
  84. package/dist/components/ui/locale-switch.d.ts +9 -0
  85. package/dist/components/ui/locale-switch.js +31 -0
  86. package/dist/components/ui/log-panel.d.ts +28 -0
  87. package/dist/components/ui/log-panel.js +59 -0
  88. package/dist/components/ui/menubar.d.ts +29 -0
  89. package/dist/components/ui/menubar.js +56 -0
  90. package/dist/components/ui/metric-grid.d.ts +20 -0
  91. package/dist/components/ui/metric-grid.js +14 -0
  92. package/dist/components/ui/model-list.d.ts +33 -0
  93. package/dist/components/ui/model-list.js +69 -0
  94. package/dist/components/ui/navigation-menu.d.ts +11 -0
  95. package/dist/components/ui/navigation-menu.js +31 -0
  96. package/dist/components/ui/number-field.d.ts +29 -0
  97. package/dist/components/ui/number-field.js +65 -0
  98. package/dist/components/ui/pagination.d.ts +17 -0
  99. package/dist/components/ui/pagination.js +26 -0
  100. package/dist/components/ui/pane-tree.d.ts +18 -0
  101. package/dist/components/ui/pane-tree.js +65 -0
  102. package/dist/components/ui/popover.d.ts +9 -0
  103. package/dist/components/ui/popover.js +23 -0
  104. package/dist/components/ui/progress.d.ts +7 -0
  105. package/dist/components/ui/progress.js +20 -0
  106. package/dist/components/ui/radio-group.d.ts +5 -0
  107. package/dist/components/ui/radio-group.js +12 -0
  108. package/dist/components/ui/resizable.d.ts +7 -0
  109. package/dist/components/ui/resizable.js +14 -0
  110. package/dist/components/ui/scroll-area.d.ts +5 -0
  111. package/dist/components/ui/scroll-area.js +11 -0
  112. package/dist/components/ui/select.d.ts +15 -0
  113. package/dist/components/ui/select.js +34 -0
  114. package/dist/components/ui/separator.d.ts +3 -0
  115. package/dist/components/ui/separator.js +8 -0
  116. package/dist/components/ui/settings-layout.d.ts +31 -0
  117. package/dist/components/ui/settings-layout.js +45 -0
  118. package/dist/components/ui/sheet.d.ts +14 -0
  119. package/dist/components/ui/sheet.js +37 -0
  120. package/dist/components/ui/shell-picker.d.ts +18 -0
  121. package/dist/components/ui/shell-picker.js +17 -0
  122. package/dist/components/ui/skeleton.d.ts +2 -0
  123. package/dist/components/ui/skeleton.js +6 -0
  124. package/dist/components/ui/slider.d.ts +3 -0
  125. package/dist/components/ui/slider.js +12 -0
  126. package/dist/components/ui/sonner.d.ts +3 -0
  127. package/dist/components/ui/sonner.js +25 -0
  128. package/dist/components/ui/spinner.d.ts +2 -0
  129. package/dist/components/ui/spinner.js +7 -0
  130. package/dist/components/ui/split-button.d.ts +21 -0
  131. package/dist/components/ui/split-button.js +14 -0
  132. package/dist/components/ui/stat.d.ts +10 -0
  133. package/dist/components/ui/stat.js +8 -0
  134. package/dist/components/ui/status-bar.d.ts +13 -0
  135. package/dist/components/ui/status-bar.js +15 -0
  136. package/dist/components/ui/stepper.d.ts +13 -0
  137. package/dist/components/ui/stepper.js +11 -0
  138. package/dist/components/ui/switch.d.ts +5 -0
  139. package/dist/components/ui/switch.js +8 -0
  140. package/dist/components/ui/table.d.ts +10 -0
  141. package/dist/components/ui/table.js +28 -0
  142. package/dist/components/ui/tabs.d.ts +10 -0
  143. package/dist/components/ui/tabs.js +29 -0
  144. package/dist/components/ui/terminal-tabs.d.ts +31 -0
  145. package/dist/components/ui/terminal-tabs.js +109 -0
  146. package/dist/components/ui/terminal-view.d.ts +51 -0
  147. package/dist/components/ui/terminal-view.js +189 -0
  148. package/dist/components/ui/textarea.d.ts +3 -0
  149. package/dist/components/ui/textarea.js +6 -0
  150. package/dist/components/ui/timeline.d.ts +9 -0
  151. package/dist/components/ui/timeline.js +18 -0
  152. package/dist/components/ui/toggle-group.d.ts +11 -0
  153. package/dist/components/ui/toggle-group.js +24 -0
  154. package/dist/components/ui/toggle.d.ts +8 -0
  155. package/dist/components/ui/toggle.js +26 -0
  156. package/dist/components/ui/tooltip.d.ts +6 -0
  157. package/dist/components/ui/tooltip.js +17 -0
  158. package/dist/components/ui/tree-view.d.ts +20 -0
  159. package/dist/components/ui/tree-view.js +41 -0
  160. package/dist/components/ui/window-frame.d.ts +35 -0
  161. package/dist/components/ui/window-frame.js +49 -0
  162. package/dist/lib/ai-markdown.d.ts +13 -0
  163. package/dist/lib/ai-markdown.js +46 -0
  164. package/dist/lib/command-risk.d.ts +6 -0
  165. package/dist/lib/command-risk.js +42 -0
  166. package/dist/lib/file-icons.d.ts +18 -0
  167. package/dist/lib/file-icons.js +136 -0
  168. package/dist/lib/file-kind.d.ts +10 -0
  169. package/dist/lib/file-kind.js +63 -0
  170. package/dist/lib/format.d.ts +9 -0
  171. package/dist/lib/format.js +30 -0
  172. package/dist/lib/i18n-core.d.ts +20 -0
  173. package/dist/lib/i18n-core.js +36 -0
  174. package/dist/lib/i18n.d.ts +15 -0
  175. package/dist/lib/i18n.js +68 -0
  176. package/dist/lib/icon-data.d.ts +276 -0
  177. package/dist/lib/icon-data.js +307 -0
  178. package/dist/lib/icon-shapes.d.ts +14 -0
  179. package/dist/lib/icon-shapes.js +47 -0
  180. package/dist/lib/log-filter.d.ts +23 -0
  181. package/dist/lib/log-filter.js +44 -0
  182. package/dist/lib/number-field.d.ts +11 -0
  183. package/dist/lib/number-field.js +30 -0
  184. package/dist/lib/pane-tree.d.ts +39 -0
  185. package/dist/lib/pane-tree.js +92 -0
  186. package/dist/lib/platform.d.ts +10 -0
  187. package/dist/lib/platform.js +24 -0
  188. package/dist/lib/shell-meta.d.ts +7 -0
  189. package/dist/lib/shell-meta.js +70 -0
  190. package/dist/lib/syntax.d.ts +16 -0
  191. package/dist/lib/syntax.js +540 -0
  192. package/dist/lib/tab-order.d.ts +6 -0
  193. package/dist/lib/tab-order.js +24 -0
  194. package/dist/lib/table-sort.d.ts +16 -0
  195. package/dist/lib/table-sort.js +66 -0
  196. package/dist/lib/terminal-themes.d.ts +30 -0
  197. package/dist/lib/terminal-themes.js +90 -0
  198. package/dist/lib/utils.d.ts +2 -0
  199. package/dist/lib/utils.js +5 -0
  200. package/dist-cdn/loccal-ui.css +971 -0
  201. package/dist-cdn/loccal-ui.min.js +1 -0
  202. package/dist-wc/base.d.ts +31 -0
  203. package/dist-wc/base.js +104 -0
  204. package/dist-wc/button.d.ts +12 -0
  205. package/dist-wc/button.js +47 -0
  206. package/dist-wc/calendar.d.ts +16 -0
  207. package/dist-wc/calendar.js +106 -0
  208. package/dist-wc/choice.d.ts +17 -0
  209. package/dist-wc/choice.js +76 -0
  210. package/dist-wc/command.d.ts +32 -0
  211. package/dist-wc/command.js +181 -0
  212. package/dist-wc/data-table.d.ts +22 -0
  213. package/dist-wc/data-table.js +128 -0
  214. package/dist-wc/dialog.d.ts +29 -0
  215. package/dist-wc/dialog.js +94 -0
  216. package/dist-wc/disclosure.d.ts +17 -0
  217. package/dist-wc/disclosure.js +91 -0
  218. package/dist-wc/fields2.d.ts +38 -0
  219. package/dist-wc/fields2.js +133 -0
  220. package/dist-wc/file-tree.d.ts +19 -0
  221. package/dist-wc/file-tree.js +97 -0
  222. package/dist-wc/floating.d.ts +32 -0
  223. package/dist-wc/floating.js +91 -0
  224. package/dist-wc/index.d.ts +23 -0
  225. package/dist-wc/index.js +24 -0
  226. package/dist-wc/input-otp.d.ts +14 -0
  227. package/dist-wc/input-otp.js +82 -0
  228. package/dist-wc/navigation-menu.d.ts +14 -0
  229. package/dist-wc/navigation-menu.js +75 -0
  230. package/dist-wc/number-field.d.ts +13 -0
  231. package/dist-wc/number-field.js +67 -0
  232. package/dist-wc/resizable.d.ts +14 -0
  233. package/dist-wc/resizable.js +57 -0
  234. package/dist-wc/select.d.ts +17 -0
  235. package/dist-wc/select.js +80 -0
  236. package/dist-wc/static.d.ts +1 -0
  237. package/dist-wc/static.js +175 -0
  238. package/dist-wc/status-bar.d.ts +11 -0
  239. package/dist-wc/status-bar.js +54 -0
  240. package/dist-wc/styles.css +971 -0
  241. package/dist-wc/tabs.d.ts +16 -0
  242. package/dist-wc/tabs.js +62 -0
  243. package/dist-wc/terminal-tabs.d.ts +16 -0
  244. package/dist-wc/terminal-tabs.js +79 -0
  245. package/dist-wc/toaster.d.ts +16 -0
  246. package/dist-wc/toaster.js +68 -0
  247. package/dist-wc/toggle.d.ts +30 -0
  248. package/dist-wc/toggle.js +101 -0
  249. package/dist-wc/tree.d.ts +17 -0
  250. package/dist-wc/tree.js +72 -0
  251. package/docs/ARQUITETURA-VANILLA.md +54 -0
  252. package/docs/VERSIONING.md +88 -0
  253. package/package.json +1078 -6
  254. package/styles.css +476 -0
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { RefreshIcon as RefreshCwIcon } from "./icons.js";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { Button } from "./button.js";
6
+ const DEFAULT_LABELS = {
7
+ disabled: "Desativado",
8
+ connecting: "Conectando",
9
+ online: "Conectado",
10
+ degraded: "Instável",
11
+ offline: "Indisponível",
12
+ test: "Testar conexão",
13
+ circuit: { closed: "Circuito fechado", "half-open": "Circuito em teste", open: "Circuito aberto" },
14
+ };
15
+ const tone = {
16
+ disabled: "bg-muted-foreground/50",
17
+ connecting: "bg-warning animate-pulse",
18
+ online: "bg-success",
19
+ degraded: "bg-warning",
20
+ offline: "bg-destructive",
21
+ };
22
+ function ConnectionStatus({ state, latencyMs, version, circuit, detail, onTest, labels, className }) {
23
+ const l = { ...DEFAULT_LABELS, ...labels, circuit: { ...DEFAULT_LABELS.circuit, ...labels?.circuit } };
24
+ return (_jsxs("div", { "data-slot": "connection-status", "data-state": state, className: cn("flex min-h-8 flex-wrap items-center gap-x-3 gap-y-1 text-sm", className), children: [_jsxs("span", { role: "status", "aria-live": "polite", className: "inline-flex items-center gap-2 font-medium", children: [_jsx("span", { "aria-hidden": true, className: cn("size-2 rounded-full", tone[state]) }), l[state]] }), state === "online" || state === "degraded" ? (_jsxs("span", { className: "font-mono text-xs text-muted-foreground tabular", children: [version ? `v${version}` : null, version && latencyMs !== undefined ? " · " : null, latencyMs !== undefined ? `${Math.round(latencyMs)} ms` : null] })) : null, circuit && circuit !== "closed" ? (_jsx("span", { className: cn("text-xs", circuit === "open" ? "text-destructive" : "text-warning"), children: l.circuit[circuit] })) : null, detail && (state === "offline" || state === "degraded") ? (_jsx("span", { className: "min-w-0 truncate text-xs text-muted-foreground", title: detail, children: detail })) : null, onTest ? (_jsxs(Button, { type: "button", size: "sm", variant: "outline", className: "ml-auto", disabled: state === "connecting", onClick: onTest, children: [_jsx(RefreshCwIcon, { className: cn(state === "connecting" && "animate-spin") }), l.test] })) : null] }));
25
+ }
26
+ export { ConnectionStatus };
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
3
+ declare function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props): React.JSX.Element;
4
+ declare function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props): React.JSX.Element;
5
+ declare function ContextMenuTrigger({ className, ...props }: ContextMenuPrimitive.Trigger.Props): React.JSX.Element;
6
+ declare function ContextMenuContent({ className, align, alignOffset, side, sideOffset, ...props }: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
7
+ declare function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props): React.JSX.Element;
8
+ declare function ContextMenuLabel({ className, inset, ...props }: ContextMenuPrimitive.GroupLabel.Props & {
9
+ inset?: boolean;
10
+ }): React.JSX.Element;
11
+ declare function ContextMenuItem({ className, inset, variant, ...props }: ContextMenuPrimitive.Item.Props & {
12
+ inset?: boolean;
13
+ variant?: "default" | "destructive";
14
+ }): React.JSX.Element;
15
+ declare function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
16
+ declare function ContextMenuSubTrigger({ className, inset, children, ...props }: ContextMenuPrimitive.SubmenuTrigger.Props & {
17
+ inset?: boolean;
18
+ }): React.JSX.Element;
19
+ declare function ContextMenuSubContent({ ...props }: React.ComponentProps<typeof ContextMenuContent>): React.JSX.Element;
20
+ declare function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }: ContextMenuPrimitive.CheckboxItem.Props & {
21
+ inset?: boolean;
22
+ }): React.JSX.Element;
23
+ declare function ContextMenuRadioGroup({ ...props }: ContextMenuPrimitive.RadioGroup.Props): React.JSX.Element;
24
+ declare function ContextMenuRadioItem({ className, children, inset, ...props }: ContextMenuPrimitive.RadioItem.Props & {
25
+ inset?: boolean;
26
+ }): React.JSX.Element;
27
+ declare function ContextMenuSeparator({ className, ...props }: ContextMenuPrimitive.Separator.Props): React.JSX.Element;
28
+ declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
29
+ export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { ChevronRightIcon, CheckIcon } from "./icons.js";
6
+ function ContextMenu({ ...props }) {
7
+ return _jsx(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
8
+ }
9
+ function ContextMenuPortal({ ...props }) {
10
+ return (_jsx(ContextMenuPrimitive.Portal, { "data-slot": "context-menu-portal", ...props }));
11
+ }
12
+ function ContextMenuTrigger({ className, ...props }) {
13
+ return (_jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", className: cn("select-none", className), ...props }));
14
+ }
15
+ function ContextMenuContent({ className, align = "start", alignOffset = 4, side = "right", sideOffset = 0, ...props }) {
16
+ return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(ContextMenuPrimitive.Popup, { "data-slot": "context-menu-content", className: cn("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-floating duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
17
+ }
18
+ function ContextMenuGroup({ ...props }) {
19
+ return (_jsx(ContextMenuPrimitive.Group, { "data-slot": "context-menu-group", ...props }));
20
+ }
21
+ function ContextMenuLabel({ className, inset, ...props }) {
22
+ return (_jsx(ContextMenuPrimitive.GroupLabel, { "data-slot": "context-menu-label", "data-inset": inset, className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className), ...props }));
23
+ }
24
+ function ContextMenuItem({ className, inset, variant = "default", ...props }) {
25
+ return (_jsx(ContextMenuPrimitive.Item, { "data-slot": "context-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive", className), ...props }));
26
+ }
27
+ function ContextMenuSub({ ...props }) {
28
+ return (_jsx(ContextMenuPrimitive.SubmenuRoot, { "data-slot": "context-menu-sub", ...props }));
29
+ }
30
+ function ContextMenuSubTrigger({ className, inset, children, ...props }) {
31
+ return (_jsxs(ContextMenuPrimitive.SubmenuTrigger, { "data-slot": "context-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] }));
32
+ }
33
+ function ContextMenuSubContent({ ...props }) {
34
+ return (_jsx(ContextMenuContent, { "data-slot": "context-menu-sub-content", className: "shadow-lg", side: "right", ...props }));
35
+ }
36
+ function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }) {
37
+ return (_jsxs(ContextMenuPrimitive.CheckboxItem, { "data-slot": "context-menu-checkbox-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2", children: _jsx(ContextMenuPrimitive.CheckboxItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
38
+ }
39
+ function ContextMenuRadioGroup({ ...props }) {
40
+ return (_jsx(ContextMenuPrimitive.RadioGroup, { "data-slot": "context-menu-radio-group", ...props }));
41
+ }
42
+ function ContextMenuRadioItem({ className, children, inset, ...props }) {
43
+ return (_jsxs(ContextMenuPrimitive.RadioItem, { "data-slot": "context-menu-radio-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2", children: _jsx(ContextMenuPrimitive.RadioItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
44
+ }
45
+ function ContextMenuSeparator({ className, ...props }) {
46
+ return (_jsx(ContextMenuPrimitive.Separator, { "data-slot": "context-menu-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
47
+ }
48
+ function ContextMenuShortcut({ className, ...props }) {
49
+ return (_jsx("span", { "data-slot": "context-menu-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground", className), ...props }));
50
+ }
51
+ export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
@@ -0,0 +1,49 @@
1
+ import * as React from "react";
2
+ import { type SortState } from "../../lib/table-sort.js";
3
+ type DataTableLabels = {
4
+ empty: string;
5
+ selectAll: string;
6
+ selectRow: string;
7
+ sortedAsc: string;
8
+ sortedDesc: string;
9
+ selected: (n: number) => string;
10
+ };
11
+ type DataTableColumn<T> = {
12
+ key: string;
13
+ header: React.ReactNode;
14
+ /** Valor usado para ordenar; padrao: row[key]. */
15
+ value?: (row: T) => unknown;
16
+ cell?: (row: T) => React.ReactNode;
17
+ sortable?: boolean;
18
+ align?: "left" | "right" | "center";
19
+ /** Largura CSS (ex.: "8rem", "30%"). Sem largura a coluna divide o espaco restante. */
20
+ width?: string;
21
+ /** Aplica fonte mono e algarismos tabulares (ids, tamanhos, datas). */
22
+ mono?: boolean;
23
+ };
24
+ type DataTableProps<T> = {
25
+ rows: readonly T[];
26
+ columns: readonly DataTableColumn<T>[];
27
+ rowId: (row: T) => string;
28
+ /** Habilita checkboxes e selecao multipla (Shift+clique seleciona intervalo). */
29
+ selectable?: boolean;
30
+ selected?: ReadonlySet<string>;
31
+ onSelectedChange?: (selected: Set<string>) => void;
32
+ sort?: SortState;
33
+ onSortChange?: (sort: SortState) => void;
34
+ /** Enter ou duplo clique em uma linha. */
35
+ onActivate?: (row: T) => void;
36
+ /** Altura da area rolavel (CSS). Sem valor a tabela cresce com o conteudo. */
37
+ maxHeight?: string;
38
+ caption?: string;
39
+ labels?: Partial<DataTableLabels>;
40
+ className?: string;
41
+ };
42
+ /**
43
+ * Tabela densa para apps desktop: linhas de 28px, cabecalho fixo, ordenacao por clique,
44
+ * selecao multipla e navegacao por teclado (setas, Home/End, Espaco seleciona, Enter ativa).
45
+ * Controlada ou nao: ordenacao e selecao mantem estado interno quando as props nao sao passadas.
46
+ */
47
+ declare function DataTable<T>({ rows, columns, rowId, selectable, selected: selectedProp, onSelectedChange, sort: sortProp, onSortChange, onActivate, maxHeight, caption, labels, className }: DataTableProps<T>): React.JSX.Element;
48
+ export { DataTable };
49
+ export type { DataTableColumn, DataTableProps, DataTableLabels };
@@ -0,0 +1,100 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { ArrowDownIcon, ArrowUpIcon, CheckIcon, MinusIcon } from "./icons.js";
5
+ import { allState, nextSort, selectRange, sortRows, toggleSelected } from "../../lib/table-sort.js";
6
+ import { cn } from "../../lib/utils.js";
7
+ const DEFAULT_LABELS = {
8
+ empty: "Nenhum item",
9
+ selectAll: "Selecionar tudo",
10
+ selectRow: "Selecionar linha",
11
+ sortedAsc: "ordem crescente",
12
+ sortedDesc: "ordem decrescente",
13
+ selected: (n) => `${n} selecionado${n === 1 ? "" : "s"}`,
14
+ };
15
+ const alignClass = { left: "text-left", right: "text-right", center: "text-center" };
16
+ /**
17
+ * Tabela densa para apps desktop: linhas de 28px, cabecalho fixo, ordenacao por clique,
18
+ * selecao multipla e navegacao por teclado (setas, Home/End, Espaco seleciona, Enter ativa).
19
+ * Controlada ou nao: ordenacao e selecao mantem estado interno quando as props nao sao passadas.
20
+ */
21
+ function DataTable({ rows, columns, rowId, selectable, selected: selectedProp, onSelectedChange, sort: sortProp, onSortChange, onActivate, maxHeight, caption, labels, className }) {
22
+ const l = { ...DEFAULT_LABELS, ...labels };
23
+ const [sortState, setSortState] = React.useState(null);
24
+ const [selState, setSelState] = React.useState(new Set());
25
+ const sort = sortProp === undefined ? sortState : sortProp;
26
+ const selected = selectedProp ?? selState;
27
+ const setSort = (s) => (onSortChange ? onSortChange(s) : setSortState(s));
28
+ const setSelected = (s) => (onSelectedChange ? onSelectedChange(s) : setSelState(s));
29
+ const byKey = React.useMemo(() => new Map(columns.map((c) => [c.key, c])), [columns]);
30
+ const sorted = React.useMemo(() => sortRows(rows, sort, (row, key) => {
31
+ const col = byKey.get(key);
32
+ return col?.value ? col.value(row) : row[key];
33
+ }), [rows, sort, byKey]);
34
+ const order = React.useMemo(() => sorted.map(rowId), [sorted, rowId]);
35
+ const [active, setActive] = React.useState(0);
36
+ const anchor = React.useRef(null);
37
+ const bodyRef = React.useRef(null);
38
+ const activeIndex = Math.min(active, Math.max(order.length - 1, 0));
39
+ const focusRow = (i) => {
40
+ const next = Math.max(0, Math.min(order.length - 1, i));
41
+ setActive(next);
42
+ bodyRef.current?.querySelectorAll("tr")[next]?.focus();
43
+ };
44
+ const select = (id, shift) => {
45
+ if (shift && anchor.current)
46
+ setSelected(selectRange(order, selected, anchor.current, id));
47
+ else {
48
+ setSelected(toggleSelected(selected, id));
49
+ anchor.current = id;
50
+ }
51
+ };
52
+ const onRowKeyDown = (e, row, i) => {
53
+ switch (e.key) {
54
+ case "ArrowDown":
55
+ e.preventDefault();
56
+ return focusRow(i + 1);
57
+ case "ArrowUp":
58
+ e.preventDefault();
59
+ return focusRow(i - 1);
60
+ case "Home":
61
+ e.preventDefault();
62
+ return focusRow(0);
63
+ case "End":
64
+ e.preventDefault();
65
+ return focusRow(order.length - 1);
66
+ case " ":
67
+ if (selectable) {
68
+ e.preventDefault();
69
+ select(rowId(row), e.shiftKey);
70
+ }
71
+ return;
72
+ case "Enter":
73
+ if (onActivate) {
74
+ e.preventDefault();
75
+ onActivate(row);
76
+ }
77
+ return;
78
+ }
79
+ };
80
+ const all = allState(order, selected);
81
+ const cols = columns.length + (selectable ? 1 : 0);
82
+ return (_jsxs("div", { "data-slot": "data-table", className: cn("flex min-h-0 flex-col overflow-hidden rounded-lg border bg-card", className), children: [_jsx("div", { className: "min-h-0 overflow-auto", style: maxHeight ? { maxHeight } : undefined, children: _jsxs("table", { className: "w-full table-fixed border-collapse text-xs", "aria-multiselectable": selectable || undefined, children: [caption ? _jsx("caption", { className: "sr-only", children: caption }) : null, _jsxs("colgroup", { children: [selectable ? _jsx("col", { style: { width: "2rem" } }) : null, columns.map((c) => (_jsx("col", { style: c.width ? { width: c.width } : undefined }, c.key)))] }), _jsx("thead", { className: "sticky top-0 z-10 bg-muted/80 backdrop-blur", children: _jsxs("tr", { className: "h-7 border-b", children: [selectable ? (_jsx("th", { scope: "col", className: "w-8 px-0", children: _jsx(Check, { state: all, label: l.selectAll, onToggle: () => setSelected(all === "all" ? new Set() : new Set(order)) }) })) : null, columns.map((c) => {
83
+ const dir = sort?.key === c.key ? sort.dir : null;
84
+ return (_jsx("th", { scope: "col", "aria-sort": dir === "asc" ? "ascending" : dir === "desc" ? "descending" : c.sortable ? "none" : undefined, className: cn("px-2 font-medium text-muted-foreground", alignClass[c.align ?? "left"]), children: c.sortable ? (_jsxs("button", { type: "button", onClick: () => setSort(nextSort(sort, c.key)), className: cn("inline-flex h-6 max-w-full items-center gap-1 rounded px-1 -mx-1 outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50", c.align === "right" && "flex-row-reverse", dir && "text-foreground"), children: [_jsx("span", { className: "truncate", children: c.header }), dir === "asc" ? _jsx(ArrowUpIcon, { className: "size-3 shrink-0", "aria-label": l.sortedAsc }) : dir === "desc" ? _jsx(ArrowDownIcon, { className: "size-3 shrink-0", "aria-label": l.sortedDesc }) : null] })) : (_jsx("span", { className: "truncate", children: c.header })) }, c.key));
85
+ })] }) }), _jsx("tbody", { ref: bodyRef, children: sorted.length === 0 ? (_jsx("tr", { children: _jsx("td", { colSpan: cols, className: "h-16 text-center text-muted-foreground", children: l.empty }) })) : (sorted.map((row, i) => {
86
+ const id = order[i];
87
+ const isSel = selected.has(id);
88
+ return (_jsxs("tr", { tabIndex: i === activeIndex ? 0 : -1, "aria-selected": selectable ? isSel : undefined, "data-selected": isSel || undefined, onFocus: () => setActive(i), onKeyDown: (e) => onRowKeyDown(e, row, i), onDoubleClick: () => onActivate?.(row), onClick: (e) => {
89
+ if (selectable && (e.shiftKey || e.ctrlKey || e.metaKey))
90
+ select(id, e.shiftKey);
91
+ }, className: "h-7 border-b border-border/60 outline-none last:border-b-0 hover:bg-muted/50 focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/50 data-[selected]:bg-brand/10", children: [selectable ? (_jsx("td", { className: "px-0", children: _jsx(Check, { state: isSel ? "all" : "none", label: l.selectRow, onToggle: () => select(id, false) }) })) : null, columns.map((c) => (_jsx("td", { className: cn("truncate px-2", alignClass[c.align ?? "left"], c.mono && "font-mono tabular-nums"), children: c.cell ? c.cell(row) : String(row[c.key] ?? "") }, c.key)))] }, id));
92
+ })) })] }) }), selectable && selected.size > 0 ? (_jsx("div", { className: "flex h-6 shrink-0 items-center border-t bg-sidebar px-2 font-mono text-[11px] text-muted-foreground", "aria-live": "polite", children: l.selected(selected.size) })) : null] }));
93
+ }
94
+ function Check({ state, label, onToggle }) {
95
+ return (_jsx("button", { type: "button", role: "checkbox", "aria-checked": state === "all" ? true : state === "some" ? "mixed" : false, "aria-label": label, tabIndex: -1, onClick: (e) => {
96
+ e.stopPropagation();
97
+ onToggle();
98
+ }, className: "mx-auto grid size-7 place-items-center outline-none", children: _jsx("span", { className: cn("grid size-3.5 place-items-center rounded-[4px] border border-input transition-colors", state !== "none" && "border-transparent bg-primary text-primary-foreground"), children: state === "all" ? _jsx(CheckIcon, { className: "size-3", strokeWidth: 3 }) : state === "some" ? _jsx(MinusIcon, { className: "size-3", strokeWidth: 3 }) : null }) }));
99
+ }
100
+ export { DataTable };
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
3
+ declare function Dialog({ ...props }: DialogPrimitive.Root.Props): React.JSX.Element;
4
+ declare function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props): React.JSX.Element;
5
+ declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): React.JSX.Element;
6
+ declare function DialogClose({ ...props }: DialogPrimitive.Close.Props): React.JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): React.JSX.Element;
8
+ declare function DialogContent({ className, children, showCloseButton, closeLabel, ...props }: DialogPrimitive.Popup.Props & {
9
+ showCloseButton?: boolean;
10
+ closeLabel?: string;
11
+ }): React.JSX.Element;
12
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
13
+ declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
14
+ showCloseButton?: boolean;
15
+ }): React.JSX.Element;
16
+ declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): React.JSX.Element;
17
+ declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): React.JSX.Element;
18
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { Button } from "./button.js";
6
+ import { XIcon } from "./icons.js";
7
+ function Dialog({ ...props }) {
8
+ return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
9
+ }
10
+ function DialogTrigger({ ...props }) {
11
+ return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
12
+ }
13
+ function DialogPortal({ ...props }) {
14
+ return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
15
+ }
16
+ function DialogClose({ ...props }) {
17
+ return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
18
+ }
19
+ function DialogOverlay({ className, ...props }) {
20
+ return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-overlay", className: cn("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", className), ...props }));
21
+ }
22
+ function DialogContent({ className, children, showCloseButton = true, closeLabel = "Close", ...props }) {
23
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", className: cn("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", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", render: _jsx(Button, { variant: "ghost", className: "absolute top-2 right-2", size: "icon-sm" }), children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: closeLabel })] }))] })] }));
24
+ }
25
+ function DialogHeader({ className, ...props }) {
26
+ return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2", className), ...props }));
27
+ }
28
+ function DialogFooter({ className, showCloseButton = false, children, ...props }) {
29
+ return (_jsxs("div", { "data-slot": "dialog-footer", className: cn("-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", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { render: _jsx(Button, { variant: "outline" }), children: "Close" }))] }));
30
+ }
31
+ function DialogTitle({ className, ...props }) {
32
+ return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-base leading-none font-medium", className), ...props }));
33
+ }
34
+ function DialogDescription({ className, ...props }) {
35
+ return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
36
+ }
37
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
3
+ declare function Drawer({ modal, showSwipeHandle, snapPoints, swipeDirection, ...props }: DrawerPrimitive.Root.Props & {
4
+ showSwipeHandle?: boolean;
5
+ }): React.JSX.Element;
6
+ declare function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props): React.JSX.Element;
7
+ declare function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props): React.JSX.Element;
8
+ declare function DrawerClose({ ...props }: DrawerPrimitive.Close.Props): React.JSX.Element;
9
+ declare function DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props): React.JSX.Element;
10
+ declare function DrawerSwipeHandle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.Props): React.JSX.Element;
12
+ declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
13
+ declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
14
+ declare function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props): React.JSX.Element;
15
+ declare function DrawerDescription({ className, ...props }: DrawerPrimitive.Description.Props): React.JSX.Element;
16
+ export { Drawer, DrawerPortal, DrawerOverlay, DrawerSwipeHandle, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
@@ -0,0 +1,75 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
5
+ import { cn } from "../../lib/utils.js";
6
+ const DrawerContext = React.createContext(null);
7
+ function useDrawer() {
8
+ const context = React.useContext(DrawerContext);
9
+ if (!context) {
10
+ throw new Error("useDrawer must be used within a Drawer.");
11
+ }
12
+ return context;
13
+ }
14
+ function Drawer({ modal = true, showSwipeHandle = false, snapPoints, swipeDirection = "down", ...props }) {
15
+ const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
16
+ const contextValue = React.useMemo(() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }), [hasSnapPoints, modal, showSwipeHandle, swipeDirection]);
17
+ return (_jsx(DrawerContext.Provider, { value: contextValue, children: _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", modal: modal, snapPoints: snapPoints, swipeDirection: swipeDirection, ...props }) }));
18
+ }
19
+ function DrawerTrigger({ ...props }) {
20
+ return _jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
21
+ }
22
+ function DrawerPortal({ ...props }) {
23
+ return _jsx(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
24
+ }
25
+ function DrawerClose({ ...props }) {
26
+ return _jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
27
+ }
28
+ function DrawerOverlay({ className, ...props }) {
29
+ return (_jsx(DrawerPrimitive.Backdrop, { "data-slot": "drawer-overlay", className: cn("fixed inset-0 z-50 min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute", className), ...props }));
30
+ }
31
+ function DrawerSwipeHandle({ className, ...props }) {
32
+ return (_jsx("div", { "data-slot": "drawer-swipe-handle", "aria-hidden": "true", className: cn("relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-axis=y]/drawer-popup:justify-center group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:items-start after:block after:shrink-0 after:rounded-full after:bg-muted group-data-[swipe-axis=x]/drawer-popup:after:h-24 group-data-[swipe-axis=x]/drawer-popup:after:w-1 group-data-[swipe-axis=y]/drawer-popup:after:h-1 group-data-[swipe-axis=y]/drawer-popup:after:w-24 active:cursor-grabbing", className), ...props }));
33
+ }
34
+ function DrawerContent({ className, children, ...props }) {
35
+ const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();
36
+ const swipeAxis = swipeDirection === "down" || swipeDirection === "up" ? "y" : "x";
37
+ return (_jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [modal === true && (_jsx(DrawerOverlay, { "data-snap-points": hasSnapPoints ? "" : undefined })), _jsx(DrawerPrimitive.Viewport, { "data-slot": "drawer-viewport", "data-modal": modal, className: "pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto", children: _jsxs(DrawerPrimitive.Popup, { "data-slot": "drawer-popup", "data-swipe-axis": swipeAxis, "data-snap-points": hasSnapPoints ? "" : undefined, className: cn(
38
+ // Base.
39
+ "group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b",
40
+ // Nested.
41
+ "data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
42
+ // Bleed.
43
+ "after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full",
44
+ // Sizing.
45
+ "[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]",
46
+ // Stack.
47
+ "[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]",
48
+ // Transitions.
49
+ "data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]",
50
+ // Axis: y.
51
+ "data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
52
+ // Axis: x.
53
+ "data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row",
54
+ // Direction: down.
55
+ "data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]",
56
+ // Direction: up.
57
+ "data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]",
58
+ // Direction: left.
59
+ "data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]",
60
+ // Direction: right.
61
+ "data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]", className), ...props, children: [showSwipeHandle && _jsx(DrawerSwipeHandle, {}), _jsx(DrawerPrimitive.Content, { "data-slot": "drawer-content", className: cn("flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none"), children: children })] }) })] }));
62
+ }
63
+ function DrawerHeader({ className, ...props }) {
64
+ return (_jsx("div", { "data-slot": "drawer-header", className: cn("flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0.5 md:text-left", className), ...props }));
65
+ }
66
+ function DrawerFooter({ className, ...props }) {
67
+ return (_jsx("div", { "data-slot": "drawer-footer", className: cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className), ...props }));
68
+ }
69
+ function DrawerTitle({ className, ...props }) {
70
+ return (_jsx(DrawerPrimitive.Title, { "data-slot": "drawer-title", className: cn("text-base font-medium text-foreground", className), ...props }));
71
+ }
72
+ function DrawerDescription({ className, ...props }) {
73
+ return (_jsx(DrawerPrimitive.Description, { "data-slot": "drawer-description", className: cn("text-sm text-balance text-muted-foreground", className), ...props }));
74
+ }
75
+ export { Drawer, DrawerPortal, DrawerOverlay, DrawerSwipeHandle, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import { Menu as MenuPrimitive } from "@base-ui/react/menu";
3
+ declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): React.JSX.Element;
4
+ declare function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props): React.JSX.Element;
5
+ declare function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props): React.JSX.Element;
6
+ declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
7
+ declare function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props): React.JSX.Element;
8
+ declare function DropdownMenuLabel({ className, inset, ...props }: MenuPrimitive.GroupLabel.Props & {
9
+ inset?: boolean;
10
+ }): React.JSX.Element;
11
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: MenuPrimitive.Item.Props & {
12
+ inset?: boolean;
13
+ variant?: "default" | "destructive";
14
+ }): React.JSX.Element;
15
+ declare function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
16
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: MenuPrimitive.SubmenuTrigger.Props & {
17
+ inset?: boolean;
18
+ }): React.JSX.Element;
19
+ declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): React.JSX.Element;
20
+ declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: MenuPrimitive.CheckboxItem.Props & {
21
+ inset?: boolean;
22
+ }): React.JSX.Element;
23
+ declare function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props): React.JSX.Element;
24
+ declare function DropdownMenuRadioItem({ className, children, inset, ...props }: MenuPrimitive.RadioItem.Props & {
25
+ inset?: boolean;
26
+ }): React.JSX.Element;
27
+ declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): React.JSX.Element;
28
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
29
+ export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Menu as MenuPrimitive } from "@base-ui/react/menu";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { ChevronRightIcon, CheckIcon } from "./icons.js";
6
+ function DropdownMenu({ ...props }) {
7
+ return _jsx(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
8
+ }
9
+ function DropdownMenuPortal({ ...props }) {
10
+ return _jsx(MenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
11
+ }
12
+ function DropdownMenuTrigger({ ...props }) {
13
+ return _jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
14
+ }
15
+ function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, ...props }) {
16
+ return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", className: cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-floating duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
17
+ }
18
+ function DropdownMenuGroup({ ...props }) {
19
+ return _jsx(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
20
+ }
21
+ function DropdownMenuLabel({ className, inset, ...props }) {
22
+ return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className), ...props }));
23
+ }
24
+ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
25
+ return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className), ...props }));
26
+ }
27
+ function DropdownMenuSub({ ...props }) {
28
+ return _jsx(MenuPrimitive.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...props });
29
+ }
30
+ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
31
+ return (_jsxs(MenuPrimitive.SubmenuTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] }));
32
+ }
33
+ function DropdownMenuSubContent({ align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props }) {
34
+ return (_jsx(DropdownMenuContent, { "data-slot": "dropdown-menu-sub-content", className: cn("w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-floating duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, ...props }));
35
+ }
36
+ function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
37
+ return (_jsxs(MenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-checkbox-item-indicator", children: _jsx(MenuPrimitive.CheckboxItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
38
+ }
39
+ function DropdownMenuRadioGroup({ ...props }) {
40
+ return (_jsx(MenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
41
+ }
42
+ function DropdownMenuRadioItem({ className, children, inset, ...props }) {
43
+ return (_jsxs(MenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-radio-item-indicator", children: _jsx(MenuPrimitive.RadioItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
44
+ }
45
+ function DropdownMenuSeparator({ className, ...props }) {
46
+ return (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
47
+ }
48
+ function DropdownMenuShortcut({ className, ...props }) {
49
+ return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className), ...props }));
50
+ }
51
+ export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ type DropzoneProps = {
3
+ accept?: string;
4
+ multiple?: boolean;
5
+ maxSizeMb?: number;
6
+ onFilesChange?: (files: File[]) => void;
7
+ className?: string;
8
+ hint?: string;
9
+ };
10
+ declare function Dropzone({ accept, multiple, maxSizeMb, onFilesChange, className, hint }: DropzoneProps): React.JSX.Element;
11
+ export { Dropzone };
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { FileIcon, UploadIcon, XIcon } from "./icons.js";
5
+ import { cn } from "../../lib/utils.js";
6
+ function formatBytes(bytes) {
7
+ if (bytes < 1024)
8
+ return `${bytes} B`;
9
+ if (bytes < 1024 * 1024)
10
+ return `${(bytes / 1024).toFixed(1)} KB`;
11
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
12
+ }
13
+ function Dropzone({ accept, multiple = true, maxSizeMb = 25, onFilesChange, className, hint }) {
14
+ const inputId = React.useId();
15
+ const [dragging, setDragging] = React.useState(false);
16
+ const [files, setFiles] = React.useState([]);
17
+ const addFiles = (list) => {
18
+ if (!list)
19
+ return;
20
+ const incoming = Array.from(list).filter((f) => f.size <= maxSizeMb * 1024 * 1024);
21
+ const next = multiple ? [...files, ...incoming] : incoming.slice(0, 1);
22
+ setFiles(next);
23
+ onFilesChange?.(next);
24
+ };
25
+ const remove = (index) => {
26
+ const next = files.filter((_, i) => i !== index);
27
+ setFiles(next);
28
+ onFilesChange?.(next);
29
+ };
30
+ return (_jsxs("div", { "data-slot": "dropzone", className: cn("flex flex-col gap-3", className), children: [_jsxs("label", { htmlFor: inputId, onDragOver: (e) => {
31
+ e.preventDefault();
32
+ setDragging(true);
33
+ }, onDragLeave: () => setDragging(false), onDrop: (e) => {
34
+ e.preventDefault();
35
+ setDragging(false);
36
+ addFiles(e.dataTransfer.files);
37
+ }, "data-dragging": dragging, className: cn("flex cursor-pointer flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-input bg-muted/40 px-6 py-10 text-center transition-colors", "hover:border-foreground/25 hover:bg-muted/70 has-focus-visible:ring-3 has-focus-visible:ring-ring/50", "data-[dragging=true]:border-brand data-[dragging=true]:bg-brand/5"), children: [_jsx("span", { className: "flex size-10 items-center justify-center rounded-lg bg-card shadow-surface", children: _jsx(UploadIcon, { className: "size-4 text-muted-foreground" }) }), _jsxs("span", { className: "flex flex-col gap-1", children: [_jsxs("span", { className: "text-sm font-medium", children: ["Arraste arquivos ou ", _jsx("span", { className: "text-brand underline-offset-4 hover:underline", children: "procure no computador" })] }), _jsx("span", { className: "text-xs text-muted-foreground", children: hint ?? `Até ${maxSizeMb} MB por arquivo` })] }), _jsx("input", { id: inputId, type: "file", accept: accept, multiple: multiple, className: "sr-only", onChange: (e) => addFiles(e.target.files) })] }), files.length > 0 ? (_jsx("ul", { className: "flex flex-col gap-1.5", children: files.map((file, index) => (_jsxs("li", { className: "flex items-center gap-3 rounded-lg bg-card px-3 py-2 text-sm shadow-surface", children: [_jsx(FileIcon, { className: "size-4 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: file.name }), _jsx("span", { className: "font-mono text-[11px] text-muted-foreground tabular", children: formatBytes(file.size) }), _jsx("button", { type: "button", onClick: () => remove(index), "aria-label": `Remover ${file.name}`, className: "rounded-sm p-0.5 text-muted-foreground transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60 outline-none", children: _jsx(XIcon, { className: "size-3.5" }) })] }, `${file.name}-${index}`))) })) : null] }));
38
+ }
39
+ export { Dropzone };
@@ -0,0 +1,11 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ declare function Empty({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
3
+ declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
4
+ declare const emptyMediaVariants: (props?: ({
5
+ variant?: "default" | "icon" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): import("react").JSX.Element;
8
+ declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
9
+ declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): import("react").JSX.Element;
10
+ declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
11
+ export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, };