@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,29 @@
1
+ import * as React from "react";
2
+ import { Menu as MenuPrimitive } from "@base-ui/react/menu";
3
+ import { Menubar as MenubarPrimitive } from "@base-ui/react/menubar";
4
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./dropdown-menu.js";
5
+ declare function Menubar({ className, ...props }: MenubarPrimitive.Props): React.JSX.Element;
6
+ declare function MenubarMenu({ ...props }: React.ComponentProps<typeof DropdownMenu>): React.JSX.Element;
7
+ declare function MenubarGroup({ ...props }: React.ComponentProps<typeof DropdownMenuGroup>): React.JSX.Element;
8
+ declare function MenubarPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPortal>): React.JSX.Element;
9
+ declare function MenubarTrigger({ className, ...props }: React.ComponentProps<typeof DropdownMenuTrigger>): React.JSX.Element;
10
+ declare function MenubarContent({ className, align, alignOffset, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuContent>): React.JSX.Element;
11
+ declare function MenubarItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuItem>): React.JSX.Element;
12
+ declare function MenubarCheckboxItem({ className, children, checked, inset, ...props }: MenuPrimitive.CheckboxItem.Props & {
13
+ inset?: boolean;
14
+ }): React.JSX.Element;
15
+ declare function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuRadioGroup>): React.JSX.Element;
16
+ declare function MenubarRadioItem({ className, children, inset, ...props }: MenuPrimitive.RadioItem.Props & {
17
+ inset?: boolean;
18
+ }): React.JSX.Element;
19
+ declare function MenubarLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuLabel> & {
20
+ inset?: boolean;
21
+ }): React.JSX.Element;
22
+ declare function MenubarSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuSeparator>): React.JSX.Element;
23
+ declare function MenubarShortcut({ className, ...props }: React.ComponentProps<typeof DropdownMenuShortcut>): React.JSX.Element;
24
+ declare function MenubarSub({ ...props }: React.ComponentProps<typeof DropdownMenuSub>): React.JSX.Element;
25
+ declare function MenubarSubTrigger({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuSubTrigger> & {
26
+ inset?: boolean;
27
+ }): React.JSX.Element;
28
+ declare function MenubarSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuSubContent>): React.JSX.Element;
29
+ export { Menubar, MenubarPortal, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarSeparator, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent, };
@@ -0,0 +1,56 @@
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 { Menubar as MenubarPrimitive } from "@base-ui/react/menubar";
5
+ import { cn } from "../../lib/utils.js";
6
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "./dropdown-menu.js";
7
+ import { CheckIcon } from "./icons.js";
8
+ function Menubar({ className, ...props }) {
9
+ return (_jsx(MenubarPrimitive, { "data-slot": "menubar", className: cn("flex h-8 items-center gap-0.5 rounded-lg border p-[3px]", className), ...props }));
10
+ }
11
+ function MenubarMenu({ ...props }) {
12
+ return _jsx(DropdownMenu, { "data-slot": "menubar-menu", ...props });
13
+ }
14
+ function MenubarGroup({ ...props }) {
15
+ return _jsx(DropdownMenuGroup, { "data-slot": "menubar-group", ...props });
16
+ }
17
+ function MenubarPortal({ ...props }) {
18
+ return _jsx(DropdownMenuPortal, { "data-slot": "menubar-portal", ...props });
19
+ }
20
+ function MenubarTrigger({ className, ...props }) {
21
+ return (_jsx(DropdownMenuTrigger, { "data-slot": "menubar-trigger", className: cn("flex items-center rounded-sm px-1.5 py-[2px] text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted", className), ...props }));
22
+ }
23
+ function MenubarContent({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }) {
24
+ return (_jsx(DropdownMenuContent, { "data-slot": "menubar-content", align: align, alignOffset: alignOffset, sideOffset: sideOffset, className: cn("min-w-36 rounded-lg bg-popover p-1 text-popover-foreground shadow-floating duration-100 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", className), ...props }));
25
+ }
26
+ function MenubarItem({ className, inset, variant = "default", ...props }) {
27
+ return (_jsx(DropdownMenuItem, { "data-slot": "menubar-item", "data-inset": inset, "data-variant": variant, className: cn("group/menubar-item gap-1.5 rounded-md px-1.5 py-1 text-sm 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:opacity-50 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!", className), ...props }));
28
+ }
29
+ function MenubarCheckboxItem({ className, children, checked, inset, ...props }) {
30
+ return (_jsxs(MenuPrimitive.CheckboxItem, { "data-slot": "menubar-checkbox-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 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", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4", children: _jsx(MenuPrimitive.CheckboxItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
31
+ }
32
+ function MenubarRadioGroup({ ...props }) {
33
+ return _jsx(DropdownMenuRadioGroup, { "data-slot": "menubar-radio-group", ...props });
34
+ }
35
+ function MenubarRadioItem({ className, children, inset, ...props }) {
36
+ return (_jsxs(MenuPrimitive.RadioItem, { "data-slot": "menubar-radio-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 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 left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4", children: _jsx(MenuPrimitive.RadioItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
37
+ }
38
+ function MenubarLabel({ className, inset, ...props }) {
39
+ return (_jsx(DropdownMenuLabel, { "data-slot": "menubar-label", "data-inset": inset, className: cn("px-1.5 py-1 text-sm font-medium data-inset:pl-7", className), ...props }));
40
+ }
41
+ function MenubarSeparator({ className, ...props }) {
42
+ return (_jsx(DropdownMenuSeparator, { "data-slot": "menubar-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
43
+ }
44
+ function MenubarShortcut({ className, ...props }) {
45
+ return (_jsx(DropdownMenuShortcut, { "data-slot": "menubar-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground", className), ...props }));
46
+ }
47
+ function MenubarSub({ ...props }) {
48
+ return _jsx(DropdownMenuSub, { "data-slot": "menubar-sub", ...props });
49
+ }
50
+ function MenubarSubTrigger({ className, inset, ...props }) {
51
+ return (_jsx(DropdownMenuSubTrigger, { "data-slot": "menubar-sub-trigger", "data-inset": inset, className: cn("gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4", className), ...props }));
52
+ }
53
+ function MenubarSubContent({ className, ...props }) {
54
+ return (_jsx(DropdownMenuSubContent, { "data-slot": "menubar-sub-content", className: cn("min-w-32 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), ...props }));
55
+ }
56
+ export { Menubar, MenubarPortal, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarSeparator, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent, };
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ type MetricTone = "default" | "success" | "warning" | "destructive";
3
+ type Metric = {
4
+ id: string;
5
+ label: string;
6
+ value: React.ReactNode;
7
+ /** Linha pequena abaixo do valor (unidade, origem, estado). */
8
+ hint?: React.ReactNode;
9
+ tone?: MetricTone;
10
+ };
11
+ type MetricGridProps = {
12
+ metrics: Metric[];
13
+ /** Colunas minimas por largura; o grid se adapta ao espaco. */
14
+ minColumnWidth?: number;
15
+ className?: string;
16
+ };
17
+ /** Grade densa de numeros de telemetria. Valores em fonte tabular para nao "pular" ao atualizar. */
18
+ declare function MetricGrid({ metrics, minColumnWidth, className }: MetricGridProps): React.JSX.Element;
19
+ export { MetricGrid };
20
+ export type { Metric, MetricGridProps, MetricTone };
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../../lib/utils.js";
4
+ const toneClass = {
5
+ default: "text-foreground",
6
+ success: "text-success",
7
+ warning: "text-warning",
8
+ destructive: "text-destructive",
9
+ };
10
+ /** Grade densa de numeros de telemetria. Valores em fonte tabular para nao "pular" ao atualizar. */
11
+ function MetricGrid({ metrics, minColumnWidth = 140, className }) {
12
+ return (_jsx("dl", { "data-slot": "metric-grid", style: { gridTemplateColumns: `repeat(auto-fill, minmax(${minColumnWidth}px, 1fr))` }, className: cn("grid gap-px overflow-hidden rounded-lg border bg-border", className), children: metrics.map((m) => (_jsxs("div", { "data-metric": m.id, className: "flex min-w-0 flex-col gap-0.5 bg-card px-3 py-2", children: [_jsx("dt", { className: "truncate text-[11px] text-muted-foreground", children: m.label }), _jsx("dd", { className: cn("truncate font-mono text-lg leading-tight font-semibold tabular", toneClass[m.tone ?? "default"]), children: m.value }), m.hint ? _jsx("dd", { className: "truncate text-[11px] text-muted-foreground", children: m.hint }) : null] }, m.id))) }));
13
+ }
14
+ export { MetricGrid };
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ type ModelInfo = {
3
+ name: string;
4
+ sizeBytes?: number;
5
+ family?: string;
6
+ parameterSize?: string;
7
+ quantization?: string;
8
+ };
9
+ type ModelListLabels = {
10
+ search: string;
11
+ enableAll: string;
12
+ disableAll: string;
13
+ enabled: string;
14
+ defaultModel: string;
15
+ unavailable: string;
16
+ empty: string;
17
+ noMatch: string;
18
+ summary: string;
19
+ };
20
+ type ModelListProps = {
21
+ /** Modelos instalados no servidor. */
22
+ models: ModelInfo[];
23
+ /** Nomes habilitados pelo usuario. Nomes que nao estao em `models` aparecem como nao instalados. */
24
+ enabled: string[];
25
+ defaultModel?: string;
26
+ onEnabledChange: (names: string[]) => void;
27
+ onDefaultChange?: (name: string) => void;
28
+ labels?: Partial<ModelListLabels>;
29
+ className?: string;
30
+ };
31
+ declare function ModelList({ models, enabled, defaultModel, onEnabledChange, onDefaultChange, labels, className }: ModelListProps): React.JSX.Element;
32
+ export { ModelList };
33
+ export type { ModelInfo, ModelListProps };
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { SearchIcon } from "./icons.js";
5
+ import { cn } from "../../lib/utils.js";
6
+ import { Badge } from "./badge.js";
7
+ import { Button } from "./button.js";
8
+ import { Checkbox } from "./checkbox.js";
9
+ import { Input } from "./input.js";
10
+ import { RadioGroup, RadioGroupItem } from "./radio-group.js";
11
+ import { formatBytes } from "../../lib/format.js";
12
+ const DEFAULT_LABELS = {
13
+ search: "Filtrar modelos",
14
+ enableAll: "Habilitar visíveis",
15
+ disableAll: "Desabilitar visíveis",
16
+ enabled: "Habilitar modelo",
17
+ defaultModel: "Modelo padrão",
18
+ unavailable: "Não instalado",
19
+ empty: "Nenhum modelo instalado.",
20
+ noMatch: "Nenhum modelo corresponde ao filtro.",
21
+ summary: "{enabled} de {total} habilitados",
22
+ };
23
+ function ModelList({ models, enabled, defaultModel, onEnabledChange, onDefaultChange, labels, className }) {
24
+ const l = { ...DEFAULT_LABELS, ...labels };
25
+ const [query, setQuery] = React.useState("");
26
+ const rows = React.useMemo(() => {
27
+ const installed = new Set(models.map((m) => m.name));
28
+ const ghosts = enabled.filter((n) => !installed.has(n)).map((name) => ({ name, installed: false }));
29
+ return [...models.map((m) => ({ ...m, installed: true })), ...ghosts];
30
+ }, [models, enabled]);
31
+ const visible = React.useMemo(() => {
32
+ const q = query.trim().toLowerCase();
33
+ return q ? rows.filter((r) => r.name.toLowerCase().includes(q) || r.family?.toLowerCase().includes(q)) : rows;
34
+ }, [rows, query]);
35
+ const enabledSet = React.useMemo(() => new Set(enabled), [enabled]);
36
+ const toggle = (name, on) => {
37
+ const next = on ? [...enabled.filter((n) => n !== name), name] : enabled.filter((n) => n !== name);
38
+ onEnabledChange(next);
39
+ // O padrao precisa continuar entre os habilitados.
40
+ if (!on && defaultModel === name) {
41
+ const fallback = next[0];
42
+ if (fallback)
43
+ onDefaultChange?.(fallback);
44
+ }
45
+ else if (on && !defaultModel) {
46
+ onDefaultChange?.(name);
47
+ }
48
+ };
49
+ const setVisible = (on) => {
50
+ const names = new Set(visible.filter((r) => r.installed || !on).map((r) => r.name));
51
+ const next = on ? [...new Set([...enabled, ...names])] : enabled.filter((n) => !names.has(n));
52
+ onEnabledChange(next);
53
+ if (on && !defaultModel && next[0])
54
+ onDefaultChange?.(next[0]);
55
+ if (!on && defaultModel && !next.includes(defaultModel) && next[0])
56
+ onDefaultChange?.(next[0]);
57
+ };
58
+ return (_jsxs("div", { "data-slot": "model-list", className: cn("flex min-h-0 flex-col gap-2", className), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("div", { className: "relative min-w-0 flex-1", children: [_jsx(SearchIcon, { className: "pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { value: query, onChange: (e) => setQuery(e.target.value), onKeyDown: (e) => {
59
+ if (e.key === "Escape" && query) {
60
+ e.stopPropagation();
61
+ setQuery("");
62
+ }
63
+ }, placeholder: l.search, "aria-label": l.search, className: "h-7 pl-7" })] }), _jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: () => setVisible(true), disabled: visible.length === 0, children: l.enableAll }), _jsx(Button, { type: "button", size: "sm", variant: "ghost", onClick: () => setVisible(false), disabled: visible.length === 0, children: l.disableAll })] }), rows.length === 0 ? (_jsx("p", { className: "py-6 text-center text-sm text-muted-foreground", children: l.empty })) : visible.length === 0 ? (_jsx("p", { className: "py-6 text-center text-sm text-muted-foreground", children: l.noMatch })) : (_jsx(RadioGroup, { value: defaultModel ?? "", onValueChange: (v) => typeof v === "string" && onDefaultChange?.(v), "aria-label": l.defaultModel, className: "gap-0 overflow-y-auto rounded-lg shadow-surface", children: visible.map((row) => {
64
+ const on = enabledSet.has(row.name);
65
+ const meta = [row.family, row.parameterSize, row.quantization, formatBytes(row.sizeBytes)].filter(Boolean);
66
+ return (_jsxs("div", { "data-enabled": on, "data-installed": row.installed, className: "flex items-center gap-3 border-b px-3 py-2 last:border-b-0 data-[installed=false]:opacity-70", children: [_jsx(Checkbox, { checked: on, onCheckedChange: (v) => toggle(row.name, Boolean(v)), "aria-label": `${l.enabled}: ${row.name}` }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "truncate font-mono text-sm", children: row.name }), !row.installed ? _jsx(Badge, { variant: "outline", children: l.unavailable }) : null] }), meta.length ? (_jsx("div", { className: "truncate font-mono text-[11px] text-muted-foreground tabular", children: meta.join(" · ") })) : null] }), _jsx(RadioGroupItem, { value: row.name, disabled: !on || !row.installed, "aria-label": `${l.defaultModel}: ${row.name}` })] }, row.name));
67
+ }) })), _jsx("p", { className: "text-xs text-muted-foreground tabular", children: l.summary.replace("{enabled}", String(enabled.length)).replace("{total}", String(rows.length)) })] }));
68
+ }
69
+ export { ModelList };
@@ -0,0 +1,11 @@
1
+ import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu";
2
+ declare function NavigationMenu({ align, className, children, ...props }: NavigationMenuPrimitive.Root.Props & Pick<NavigationMenuPrimitive.Positioner.Props, "align">): import("react").JSX.Element;
3
+ declare function NavigationMenuList({ className, ...props }: React.ComponentPropsWithRef<typeof NavigationMenuPrimitive.List>): import("react").JSX.Element;
4
+ declare function NavigationMenuItem({ className, ...props }: React.ComponentPropsWithRef<typeof NavigationMenuPrimitive.Item>): import("react").JSX.Element;
5
+ declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
+ declare function NavigationMenuTrigger({ className, children, ...props }: NavigationMenuPrimitive.Trigger.Props): import("react").JSX.Element;
7
+ declare function NavigationMenuContent({ className, ...props }: NavigationMenuPrimitive.Content.Props): import("react").JSX.Element;
8
+ declare function NavigationMenuPositioner({ className, side, sideOffset, align, alignOffset, ...props }: NavigationMenuPrimitive.Positioner.Props): import("react").JSX.Element;
9
+ declare function NavigationMenuLink({ className, ...props }: NavigationMenuPrimitive.Link.Props): import("react").JSX.Element;
10
+ declare function NavigationMenuIndicator({ className, ...props }: React.ComponentPropsWithRef<typeof NavigationMenuPrimitive.Icon>): import("react").JSX.Element;
11
+ export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle, NavigationMenuPositioner, };
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { ChevronDownIcon } from "./icons.js";
6
+ function NavigationMenu({ align = "start", className, children, ...props }) {
7
+ return (_jsxs(NavigationMenuPrimitive.Root, { "data-slot": "navigation-menu", className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className), ...props, children: [children, _jsx(NavigationMenuPositioner, { align: align })] }));
8
+ }
9
+ function NavigationMenuList({ className, ...props }) {
10
+ return (_jsx(NavigationMenuPrimitive.List, { "data-slot": "navigation-menu-list", className: cn("group flex flex-1 list-none items-center justify-center gap-0", className), ...props }));
11
+ }
12
+ function NavigationMenuItem({ className, ...props }) {
13
+ return (_jsx(NavigationMenuPrimitive.Item, { "data-slot": "navigation-menu-item", className: cn("relative", className), ...props }));
14
+ }
15
+ const navigationMenuTriggerStyle = cva("group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-lg px-2.5 py-1.5 text-sm font-medium transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted data-open:bg-muted/50 data-open:hover:bg-muted data-open:focus:bg-muted");
16
+ function NavigationMenuTrigger({ className, children, ...props }) {
17
+ return (_jsxs(NavigationMenuPrimitive.Trigger, { "data-slot": "navigation-menu-trigger", className: cn(navigationMenuTriggerStyle(), "group", className), ...props, children: [children, " ", _jsx(ChevronDownIcon, { className: "relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180", "aria-hidden": "true" })] }));
18
+ }
19
+ function NavigationMenuContent({ className, ...props }) {
20
+ return (_jsx(NavigationMenuPrimitive.Content, { "data-slot": "navigation-menu-content", className: cn("data-ending-style:data-activation-direction=left:translate-x-[50%] data-ending-style:data-activation-direction=right:translate-x-[-50%] data-starting-style:data-activation-direction=left:translate-x-[-50%] data-starting-style:data-activation-direction=right:translate-x-[50%] h-full w-auto p-1 transition-[opacity,transform,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:duration-300 data-ending-style:opacity-0 data-starting-style:opacity-0 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95", className), ...props }));
21
+ }
22
+ function NavigationMenuPositioner({ className, side = "bottom", sideOffset = 8, align = "start", alignOffset = 0, ...props }) {
23
+ return (_jsx(NavigationMenuPrimitive.Portal, { children: _jsx(NavigationMenuPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, className: cn("isolate z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0", className), ...props, children: _jsx(NavigationMenuPrimitive.Popup, { className: "data-[ending-style]:easing-[ease] xs:w-(--popup-width) relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) rounded-lg bg-popover text-popover-foreground shadow ring-1 ring-foreground/10 transition-[opacity,transform,width,height,scale,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] outline-none data-ending-style:scale-90 data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:scale-90 data-starting-style:opacity-0", children: _jsx(NavigationMenuPrimitive.Viewport, { className: "relative size-full overflow-hidden" }) }) }) }));
24
+ }
25
+ function NavigationMenuLink({ className, ...props }) {
26
+ return (_jsx(NavigationMenuPrimitive.Link, { "data-slot": "navigation-menu-link", className: cn("flex items-center gap-2 rounded-lg p-2 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-md data-active:bg-muted/50 data-active:hover:bg-muted data-active:focus:bg-muted [&_svg:not([class*='size-'])]:size-4", className), ...props }));
27
+ }
28
+ function NavigationMenuIndicator({ className, ...props }) {
29
+ return (_jsx(NavigationMenuPrimitive.Icon, { "data-slot": "navigation-menu-indicator", className: cn("top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in", className), ...props, children: _jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" }) }));
30
+ }
31
+ export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle, NavigationMenuPositioner, };
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ type NumberFieldLabels = {
3
+ increase: string;
4
+ decrease: string;
5
+ };
6
+ type NumberFieldProps = {
7
+ value: number | null;
8
+ onValueChange: (value: number | null) => void;
9
+ min?: number;
10
+ max?: number;
11
+ step?: number;
12
+ /** Casas decimais exibidas apos confirmar (ex.: 2 -> "1,50"). */
13
+ fractionDigits?: number;
14
+ /** Sufixo fixo, como "px", "ms" ou "MB". */
15
+ unit?: string;
16
+ disabled?: boolean;
17
+ invalid?: boolean;
18
+ id?: string;
19
+ "aria-label"?: string;
20
+ labels?: Partial<NumberFieldLabels>;
21
+ className?: string;
22
+ };
23
+ /**
24
+ * Campo numerico denso (h-7) com botoes e teclado: setas somam o passo, Shift multiplica por 10,
25
+ * PageUp/PageDown por 10, Home/End vao ao minimo/maximo. Aceita virgula decimal e confirma no blur/Enter.
26
+ */
27
+ declare function NumberField({ value, onValueChange, min, max, step, fractionDigits, unit, disabled, invalid, id, labels, className, "aria-label": ariaLabel }: NumberFieldProps): React.JSX.Element;
28
+ export { NumberField };
29
+ export type { NumberFieldProps };
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { MinusIcon, PlusIcon } from "./icons.js";
5
+ import { clamp, formatNumber, parseNumber, stepValue } from "../../lib/number-field.js";
6
+ import { cn } from "../../lib/utils.js";
7
+ const DEFAULT_LABELS = { increase: "Aumentar", decrease: "Diminuir" };
8
+ /**
9
+ * Campo numerico denso (h-7) com botoes e teclado: setas somam o passo, Shift multiplica por 10,
10
+ * PageUp/PageDown por 10, Home/End vao ao minimo/maximo. Aceita virgula decimal e confirma no blur/Enter.
11
+ */
12
+ function NumberField({ value, onValueChange, min, max, step = 1, fractionDigits, unit, disabled, invalid, id, labels, className, "aria-label": ariaLabel }) {
13
+ const l = { ...DEFAULT_LABELS, ...labels };
14
+ const [draft, setDraft] = React.useState(null);
15
+ const shown = draft ?? formatNumber(value, fractionDigits);
16
+ const bounds = { min, max, step };
17
+ const commit = (text) => {
18
+ const parsed = parseNumber(text);
19
+ setDraft(null);
20
+ onValueChange(parsed === null ? null : clamp(parsed, bounds));
21
+ };
22
+ const bump = (dir, mult = 1) => {
23
+ setDraft(null);
24
+ onValueChange(stepValue(value ?? min ?? 0, dir, bounds, mult));
25
+ };
26
+ const onKeyDown = (e) => {
27
+ switch (e.key) {
28
+ case "ArrowUp":
29
+ e.preventDefault();
30
+ return bump(1, e.shiftKey ? 10 : 1);
31
+ case "ArrowDown":
32
+ e.preventDefault();
33
+ return bump(-1, e.shiftKey ? 10 : 1);
34
+ case "PageUp":
35
+ e.preventDefault();
36
+ return bump(1, 10);
37
+ case "PageDown":
38
+ e.preventDefault();
39
+ return bump(-1, 10);
40
+ case "Home":
41
+ if (min !== undefined) {
42
+ e.preventDefault();
43
+ setDraft(null);
44
+ onValueChange(min);
45
+ }
46
+ return;
47
+ case "End":
48
+ if (max !== undefined) {
49
+ e.preventDefault();
50
+ setDraft(null);
51
+ onValueChange(max);
52
+ }
53
+ return;
54
+ case "Enter":
55
+ return commit(e.currentTarget.value);
56
+ case "Escape":
57
+ return setDraft(null);
58
+ }
59
+ };
60
+ const atMin = value !== null && min !== undefined && value <= min;
61
+ const atMax = value !== null && max !== undefined && value >= max;
62
+ const btn = "grid h-full w-6 shrink-0 place-items-center text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:bg-muted disabled:pointer-events-none disabled:opacity-40 [&_svg]:size-3";
63
+ return (_jsxs("div", { "data-slot": "number-field", "aria-invalid": invalid || undefined, className: cn("inline-flex h-7 w-32 items-stretch overflow-hidden rounded-md border border-input bg-transparent text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30", disabled && "pointer-events-none opacity-50", className), children: [_jsx("button", { type: "button", tabIndex: -1, "aria-label": l.decrease, disabled: disabled || atMin, onClick: () => bump(-1), className: cn(btn, "border-r"), children: _jsx(MinusIcon, {}) }), _jsx("input", { id: id, role: "spinbutton", inputMode: "decimal", "aria-label": ariaLabel, "aria-valuenow": value ?? undefined, "aria-valuemin": min, "aria-valuemax": max, disabled: disabled, value: shown, onChange: (e) => setDraft(e.target.value), onBlur: (e) => draft !== null && commit(e.target.value), onKeyDown: onKeyDown, className: "min-w-0 flex-1 bg-transparent px-1.5 text-center font-mono text-xs tabular-nums outline-none" }), unit ? _jsx("span", { className: "grid place-items-center pr-1.5 text-[11px] text-muted-foreground select-none", children: unit }) : null, _jsx("button", { type: "button", tabIndex: -1, "aria-label": l.increase, disabled: disabled || atMax, onClick: () => bump(1), className: cn(btn, "border-l"), children: _jsx(PlusIcon, {}) })] }));
64
+ }
65
+ export { NumberField };
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import { Button } from "./button.js";
3
+ declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
4
+ declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
5
+ declare function PaginationItem({ ...props }: React.ComponentProps<"li">): React.JSX.Element;
6
+ type PaginationLinkProps = {
7
+ isActive?: boolean;
8
+ } & Pick<React.ComponentProps<typeof Button>, "size"> & React.ComponentProps<"a">;
9
+ declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): React.JSX.Element;
10
+ declare function PaginationPrevious({ className, text, ...props }: React.ComponentProps<typeof PaginationLink> & {
11
+ text?: string;
12
+ }): React.JSX.Element;
13
+ declare function PaginationNext({ className, text, ...props }: React.ComponentProps<typeof PaginationLink> & {
14
+ text?: string;
15
+ }): React.JSX.Element;
16
+ declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
17
+ export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, };
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils.js";
3
+ import { Button } from "./button.js";
4
+ import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "./icons.js";
5
+ function Pagination({ className, ...props }) {
6
+ return (_jsx("nav", { role: "navigation", "aria-label": "pagination", "data-slot": "pagination", className: cn("mx-auto flex w-full justify-center", className), ...props }));
7
+ }
8
+ function PaginationContent({ className, ...props }) {
9
+ return (_jsx("ul", { "data-slot": "pagination-content", className: cn("flex items-center gap-0.5", className), ...props }));
10
+ }
11
+ function PaginationItem({ ...props }) {
12
+ return _jsx("li", { "data-slot": "pagination-item", ...props });
13
+ }
14
+ function PaginationLink({ className, isActive, size = "icon", ...props }) {
15
+ return (_jsx(Button, { variant: isActive ? "outline" : "ghost", size: size, className: cn(className), nativeButton: false, render: _jsx("a", { "aria-current": isActive ? "page" : undefined, "data-slot": "pagination-link", "data-active": isActive, ...props }) }));
16
+ }
17
+ function PaginationPrevious({ className, text = "Previous", ...props }) {
18
+ return (_jsxs(PaginationLink, { "aria-label": "Go to previous page", size: "default", className: cn("pl-1.5!", className), ...props, children: [_jsx(ChevronLeftIcon, { "data-icon": "inline-start" }), _jsx("span", { className: "hidden sm:block", children: text })] }));
19
+ }
20
+ function PaginationNext({ className, text = "Next", ...props }) {
21
+ return (_jsxs(PaginationLink, { "aria-label": "Go to next page", size: "default", className: cn("pr-1.5!", className), ...props, children: [_jsx("span", { className: "hidden sm:block", children: text }), _jsx(ChevronRightIcon, { "data-icon": "inline-end" })] }));
22
+ }
23
+ function PaginationEllipsis({ className, ...props }) {
24
+ return (_jsxs("span", { "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn("flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx(MoreHorizontalIcon, {}), _jsx("span", { className: "sr-only", children: "More pages" })] }));
25
+ }
26
+ export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, };
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { type PaneNode } from "../../lib/pane-tree.js";
3
+ type PaneTreeProps = {
4
+ root: PaneNode;
5
+ activeId?: string;
6
+ onActiveChange?: (leafId: string) => void;
7
+ onRatioChange?: (splitId: string, ratio: number) => void;
8
+ /** Renderiza o conteudo de uma folha. Mantenha o conteudo montado entre renders (ex.: terminal). */
9
+ renderLeaf: (leafId: string, ctx: {
10
+ active: boolean;
11
+ }) => React.ReactNode;
12
+ /** Texto acessivel do divisor. */
13
+ resizeLabel?: string;
14
+ className?: string;
15
+ };
16
+ declare function PaneTree({ root, activeId, onActiveChange, onRatioChange, renderLeaf, resizeLabel, className, }: PaneTreeProps): React.JSX.Element;
17
+ export { PaneTree };
18
+ export type { PaneTreeProps };
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { clampRatio, leaves } from "../../lib/pane-tree.js";
6
+ function PaneTree({ root, activeId, onActiveChange, onRatioChange, renderLeaf, resizeLabel = "Redimensionar painéis", className, }) {
7
+ const multiple = leaves(root).length > 1;
8
+ return (_jsx("div", { "data-slot": "pane-tree", className: cn("flex size-full min-h-0 min-w-0", className), children: _jsx(PaneNodeView, { node: root, activeId: activeId, multiple: multiple, onActiveChange: onActiveChange, onRatioChange: onRatioChange, renderLeaf: renderLeaf, resizeLabel: resizeLabel }) }));
9
+ }
10
+ function PaneNodeView(props) {
11
+ const { node, activeId, multiple, onActiveChange, renderLeaf } = props;
12
+ if (node.type === "leaf") {
13
+ const active = node.id === activeId;
14
+ return (_jsx("div", { "data-slot": "pane-leaf", "data-active": active, onPointerDownCapture: () => onActiveChange?.(node.id), onFocusCapture: () => onActiveChange?.(node.id), className: cn("relative size-full min-h-0 min-w-0 overflow-hidden", multiple && "data-[active=true]:shadow-[inset_0_0_0_1px_var(--brand)]"), children: renderLeaf(node.id, { active }) }));
15
+ }
16
+ return _jsx(PaneSplitView, { ...props, split: node });
17
+ }
18
+ function PaneSplitView({ split, ...rest }) {
19
+ const ref = React.useRef(null);
20
+ const horizontal = split.direction === "row";
21
+ const { onRatioChange, resizeLabel } = rest;
22
+ const ratioFromPointer = React.useCallback((e) => {
23
+ const el = ref.current;
24
+ if (!el)
25
+ return split.ratio;
26
+ const rect = el.getBoundingClientRect();
27
+ const size = horizontal ? rect.width : rect.height;
28
+ if (size <= 0)
29
+ return split.ratio;
30
+ const offset = horizontal ? e.clientX - rect.left : e.clientY - rect.top;
31
+ return clampRatio(offset / size);
32
+ }, [horizontal, split.ratio]);
33
+ const onPointerDown = (e) => {
34
+ e.preventDefault();
35
+ e.currentTarget.setPointerCapture(e.pointerId);
36
+ };
37
+ const onPointerMove = (e) => {
38
+ if (!e.currentTarget.hasPointerCapture(e.pointerId))
39
+ return;
40
+ onRatioChange?.(split.id, ratioFromPointer(e));
41
+ };
42
+ const onKeyDown = (e) => {
43
+ const step = e.shiftKey ? 0.1 : 0.02;
44
+ const dec = horizontal ? "ArrowLeft" : "ArrowUp";
45
+ const inc = horizontal ? "ArrowRight" : "ArrowDown";
46
+ if (e.key === dec)
47
+ onRatioChange?.(split.id, clampRatio(split.ratio - step));
48
+ else if (e.key === inc)
49
+ onRatioChange?.(split.id, clampRatio(split.ratio + step));
50
+ else if (e.key === "Home")
51
+ onRatioChange?.(split.id, 0.1);
52
+ else if (e.key === "End")
53
+ onRatioChange?.(split.id, 0.9);
54
+ else if (e.key === "Enter")
55
+ onRatioChange?.(split.id, 0.5);
56
+ else
57
+ return;
58
+ e.preventDefault();
59
+ };
60
+ const pct = Math.round(split.ratio * 100);
61
+ return (_jsxs("div", { ref: ref, "data-slot": "pane-split", "data-direction": split.direction, className: cn("flex size-full min-h-0 min-w-0", horizontal ? "flex-row" : "flex-col"), children: [_jsx("div", { className: "min-h-0 min-w-0 overflow-hidden", style: { flex: `${split.ratio} 1 0%` }, children: _jsx(PaneNodeView, { ...rest, node: split.first }) }), _jsx("div", { role: "separator", tabIndex: 0, "aria-label": resizeLabel, "aria-orientation": horizontal ? "vertical" : "horizontal", "aria-valuemin": 10, "aria-valuemax": 90, "aria-valuenow": pct, onPointerDown: onPointerDown, onPointerMove: onPointerMove, onKeyDown: onKeyDown, className: cn("relative shrink-0 touch-none bg-border outline-none transition-colors hover:bg-brand/60 focus-visible:bg-brand", horizontal
62
+ ? "w-px cursor-col-resize after:absolute after:inset-y-0 after:-left-1 after:w-[9px]"
63
+ : "h-px cursor-row-resize after:absolute after:inset-x-0 after:-top-1 after:h-[9px]") }), _jsx("div", { className: "min-h-0 min-w-0 overflow-hidden", style: { flex: `${1 - split.ratio} 1 0%` }, children: _jsx(PaneNodeView, { ...rest, node: split.second }) })] }));
64
+ }
65
+ export { PaneTree };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
3
+ declare function Popover({ ...props }: PopoverPrimitive.Root.Props): React.JSX.Element;
4
+ declare function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props): React.JSX.Element;
5
+ declare function PopoverContent({ className, align, alignOffset, side, sideOffset, ...props }: PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
6
+ declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
7
+ declare function PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props): React.JSX.Element;
8
+ declare function PopoverDescription({ className, ...props }: PopoverPrimitive.Description.Props): React.JSX.Element;
9
+ export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
4
+ import { cn } from "../../lib/utils.js";
5
+ function Popover({ ...props }) {
6
+ return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
7
+ }
8
+ function PopoverTrigger({ ...props }) {
9
+ return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
10
+ }
11
+ function PopoverContent({ className, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, ...props }) {
12
+ return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsx(PopoverPrimitive.Popup, { "data-slot": "popover-content", className: cn("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-floating outline-hidden duration-100 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 }) }) }));
13
+ }
14
+ function PopoverHeader({ className, ...props }) {
15
+ return (_jsx("div", { "data-slot": "popover-header", className: cn("flex flex-col gap-0.5 text-sm", className), ...props }));
16
+ }
17
+ function PopoverTitle({ className, ...props }) {
18
+ return (_jsx(PopoverPrimitive.Title, { "data-slot": "popover-title", className: cn("font-medium", className), ...props }));
19
+ }
20
+ function PopoverDescription({ className, ...props }) {
21
+ return (_jsx(PopoverPrimitive.Description, { "data-slot": "popover-description", className: cn("text-muted-foreground", className), ...props }));
22
+ }
23
+ export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
@@ -0,0 +1,7 @@
1
+ import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
2
+ declare function Progress({ className, children, value, ...props }: ProgressPrimitive.Root.Props): import("react").JSX.Element;
3
+ declare function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props): import("react").JSX.Element;
4
+ declare function ProgressIndicator({ className, ...props }: ProgressPrimitive.Indicator.Props): import("react").JSX.Element;
5
+ declare function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props): import("react").JSX.Element;
6
+ declare function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props): import("react").JSX.Element;
7
+ export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue, };
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
4
+ import { cn } from "../../lib/utils.js";
5
+ function Progress({ className, children, value, ...props }) {
6
+ return (_jsxs(ProgressPrimitive.Root, { value: value, "data-slot": "progress", className: cn("flex flex-wrap gap-3", className), ...props, children: [children, _jsx(ProgressTrack, { children: _jsx(ProgressIndicator, {}) })] }));
7
+ }
8
+ function ProgressTrack({ className, ...props }) {
9
+ return (_jsx(ProgressPrimitive.Track, { className: cn("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted", className), "data-slot": "progress-track", ...props }));
10
+ }
11
+ function ProgressIndicator({ className, ...props }) {
12
+ return (_jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: cn("h-full bg-primary transition-all", className), ...props }));
13
+ }
14
+ function ProgressLabel({ className, ...props }) {
15
+ return (_jsx(ProgressPrimitive.Label, { className: cn("text-sm font-medium", className), "data-slot": "progress-label", ...props }));
16
+ }
17
+ function ProgressValue({ className, ...props }) {
18
+ return (_jsx(ProgressPrimitive.Value, { className: cn("ml-auto text-sm text-muted-foreground tabular-nums", className), "data-slot": "progress-value", ...props }));
19
+ }
20
+ export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue, };
@@ -0,0 +1,5 @@
1
+ import { Radio as RadioPrimitive } from "@base-ui/react/radio";
2
+ import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
3
+ declare function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props): import("react").JSX.Element;
4
+ declare function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props): import("react").JSX.Element;
5
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Radio as RadioPrimitive } from "@base-ui/react/radio";
4
+ import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
5
+ import { cn } from "../../lib/utils.js";
6
+ function RadioGroup({ className, ...props }) {
7
+ return (_jsx(RadioGroupPrimitive, { "data-slot": "radio-group", className: cn("grid w-full gap-2", className), ...props }));
8
+ }
9
+ function RadioGroupItem({ className, ...props }) {
10
+ return (_jsx(RadioPrimitive.Root, { "data-slot": "radio-group-item", className: cn("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary", className), ...props, children: _jsx(RadioPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "flex size-4 items-center justify-center", children: _jsx("span", { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" }) }) }));
11
+ }
12
+ export { RadioGroup, RadioGroupItem };