@loccal/ui 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/CHANGELOG.md +13 -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/collapsible.d.ts +5 -0
  31. package/dist/components/ui/collapsible.js +13 -0
  32. package/dist/components/ui/command-block.d.ts +28 -0
  33. package/dist/components/ui/command-block.js +58 -0
  34. package/dist/components/ui/command.d.ts +19 -0
  35. package/dist/components/ui/command.js +35 -0
  36. package/dist/components/ui/connection-status.d.ts +29 -0
  37. package/dist/components/ui/connection-status.js +26 -0
  38. package/dist/components/ui/context-menu.d.ts +29 -0
  39. package/dist/components/ui/context-menu.js +51 -0
  40. package/dist/components/ui/data-table.d.ts +49 -0
  41. package/dist/components/ui/data-table.js +100 -0
  42. package/dist/components/ui/dialog.d.ts +18 -0
  43. package/dist/components/ui/dialog.js +37 -0
  44. package/dist/components/ui/drawer.d.ts +16 -0
  45. package/dist/components/ui/drawer.js +75 -0
  46. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  47. package/dist/components/ui/dropdown-menu.js +51 -0
  48. package/dist/components/ui/dropzone.d.ts +11 -0
  49. package/dist/components/ui/dropzone.js +39 -0
  50. package/dist/components/ui/empty.d.ts +11 -0
  51. package/dist/components/ui/empty.js +33 -0
  52. package/dist/components/ui/field.d.ts +24 -0
  53. package/dist/components/ui/field.js +68 -0
  54. package/dist/components/ui/file-tree.d.ts +42 -0
  55. package/dist/components/ui/file-tree.js +85 -0
  56. package/dist/components/ui/hash-chain.d.ts +43 -0
  57. package/dist/components/ui/hash-chain.js +34 -0
  58. package/dist/components/ui/history-palette.d.ts +37 -0
  59. package/dist/components/ui/history-palette.js +44 -0
  60. package/dist/components/ui/hover-card.d.ts +5 -0
  61. package/dist/components/ui/hover-card.js +14 -0
  62. package/dist/components/ui/icon-base.d.ts +15 -0
  63. package/dist/components/ui/icon-base.js +18 -0
  64. package/dist/components/ui/icon.d.ts +15 -0
  65. package/dist/components/ui/icon.js +32 -0
  66. package/dist/components/ui/icons-compat.d.ts +32 -0
  67. package/dist/components/ui/icons-compat.js +34 -0
  68. package/dist/components/ui/icons.d.ts +1048 -0
  69. package/dist/components/ui/icons.js +264 -0
  70. package/dist/components/ui/input-group.d.ts +18 -0
  71. package/dist/components/ui/input-group.js +57 -0
  72. package/dist/components/ui/input-otp.d.ts +11 -0
  73. package/dist/components/ui/input-otp.js +21 -0
  74. package/dist/components/ui/input.d.ts +3 -0
  75. package/dist/components/ui/input.js +7 -0
  76. package/dist/components/ui/kbd.d.ts +3 -0
  77. package/dist/components/ui/kbd.js +9 -0
  78. package/dist/components/ui/label.d.ts +3 -0
  79. package/dist/components/ui/label.js +7 -0
  80. package/dist/components/ui/locale-switch.d.ts +9 -0
  81. package/dist/components/ui/locale-switch.js +31 -0
  82. package/dist/components/ui/log-panel.d.ts +28 -0
  83. package/dist/components/ui/log-panel.js +59 -0
  84. package/dist/components/ui/menubar.d.ts +29 -0
  85. package/dist/components/ui/menubar.js +56 -0
  86. package/dist/components/ui/metric-grid.d.ts +20 -0
  87. package/dist/components/ui/metric-grid.js +14 -0
  88. package/dist/components/ui/model-list.d.ts +33 -0
  89. package/dist/components/ui/model-list.js +69 -0
  90. package/dist/components/ui/navigation-menu.d.ts +11 -0
  91. package/dist/components/ui/navigation-menu.js +31 -0
  92. package/dist/components/ui/number-field.d.ts +29 -0
  93. package/dist/components/ui/number-field.js +65 -0
  94. package/dist/components/ui/pagination.d.ts +17 -0
  95. package/dist/components/ui/pagination.js +26 -0
  96. package/dist/components/ui/pane-tree.d.ts +18 -0
  97. package/dist/components/ui/pane-tree.js +65 -0
  98. package/dist/components/ui/popover.d.ts +9 -0
  99. package/dist/components/ui/popover.js +23 -0
  100. package/dist/components/ui/progress.d.ts +7 -0
  101. package/dist/components/ui/progress.js +20 -0
  102. package/dist/components/ui/radio-group.d.ts +5 -0
  103. package/dist/components/ui/radio-group.js +12 -0
  104. package/dist/components/ui/resizable.d.ts +7 -0
  105. package/dist/components/ui/resizable.js +14 -0
  106. package/dist/components/ui/scroll-area.d.ts +5 -0
  107. package/dist/components/ui/scroll-area.js +11 -0
  108. package/dist/components/ui/select.d.ts +15 -0
  109. package/dist/components/ui/select.js +34 -0
  110. package/dist/components/ui/separator.d.ts +3 -0
  111. package/dist/components/ui/separator.js +8 -0
  112. package/dist/components/ui/settings-layout.d.ts +31 -0
  113. package/dist/components/ui/settings-layout.js +45 -0
  114. package/dist/components/ui/sheet.d.ts +14 -0
  115. package/dist/components/ui/sheet.js +37 -0
  116. package/dist/components/ui/shell-picker.d.ts +18 -0
  117. package/dist/components/ui/shell-picker.js +17 -0
  118. package/dist/components/ui/skeleton.d.ts +2 -0
  119. package/dist/components/ui/skeleton.js +6 -0
  120. package/dist/components/ui/slider.d.ts +3 -0
  121. package/dist/components/ui/slider.js +12 -0
  122. package/dist/components/ui/sonner.d.ts +3 -0
  123. package/dist/components/ui/sonner.js +25 -0
  124. package/dist/components/ui/spinner.d.ts +2 -0
  125. package/dist/components/ui/spinner.js +7 -0
  126. package/dist/components/ui/split-button.d.ts +21 -0
  127. package/dist/components/ui/split-button.js +14 -0
  128. package/dist/components/ui/stat.d.ts +10 -0
  129. package/dist/components/ui/stat.js +8 -0
  130. package/dist/components/ui/status-bar.d.ts +13 -0
  131. package/dist/components/ui/status-bar.js +15 -0
  132. package/dist/components/ui/stepper.d.ts +13 -0
  133. package/dist/components/ui/stepper.js +11 -0
  134. package/dist/components/ui/switch.d.ts +5 -0
  135. package/dist/components/ui/switch.js +8 -0
  136. package/dist/components/ui/table.d.ts +10 -0
  137. package/dist/components/ui/table.js +28 -0
  138. package/dist/components/ui/tabs.d.ts +10 -0
  139. package/dist/components/ui/tabs.js +29 -0
  140. package/dist/components/ui/terminal-tabs.d.ts +31 -0
  141. package/dist/components/ui/terminal-tabs.js +109 -0
  142. package/dist/components/ui/terminal-view.d.ts +51 -0
  143. package/dist/components/ui/terminal-view.js +189 -0
  144. package/dist/components/ui/textarea.d.ts +3 -0
  145. package/dist/components/ui/textarea.js +6 -0
  146. package/dist/components/ui/timeline.d.ts +9 -0
  147. package/dist/components/ui/timeline.js +18 -0
  148. package/dist/components/ui/toggle-group.d.ts +11 -0
  149. package/dist/components/ui/toggle-group.js +24 -0
  150. package/dist/components/ui/toggle.d.ts +8 -0
  151. package/dist/components/ui/toggle.js +26 -0
  152. package/dist/components/ui/tooltip.d.ts +6 -0
  153. package/dist/components/ui/tooltip.js +17 -0
  154. package/dist/components/ui/tree-view.d.ts +20 -0
  155. package/dist/components/ui/tree-view.js +41 -0
  156. package/dist/components/ui/window-frame.d.ts +35 -0
  157. package/dist/components/ui/window-frame.js +49 -0
  158. package/dist/lib/ai-markdown.d.ts +13 -0
  159. package/dist/lib/ai-markdown.js +46 -0
  160. package/dist/lib/command-risk.d.ts +6 -0
  161. package/dist/lib/command-risk.js +42 -0
  162. package/dist/lib/file-kind.d.ts +10 -0
  163. package/dist/lib/file-kind.js +63 -0
  164. package/dist/lib/format.d.ts +9 -0
  165. package/dist/lib/format.js +30 -0
  166. package/dist/lib/i18n-core.d.ts +20 -0
  167. package/dist/lib/i18n-core.js +36 -0
  168. package/dist/lib/i18n.d.ts +15 -0
  169. package/dist/lib/i18n.js +68 -0
  170. package/dist/lib/icon-data.d.ts +276 -0
  171. package/dist/lib/icon-data.js +307 -0
  172. package/dist/lib/icon-shapes.d.ts +14 -0
  173. package/dist/lib/icon-shapes.js +47 -0
  174. package/dist/lib/log-filter.d.ts +23 -0
  175. package/dist/lib/log-filter.js +44 -0
  176. package/dist/lib/number-field.d.ts +11 -0
  177. package/dist/lib/number-field.js +30 -0
  178. package/dist/lib/pane-tree.d.ts +39 -0
  179. package/dist/lib/pane-tree.js +92 -0
  180. package/dist/lib/platform.d.ts +10 -0
  181. package/dist/lib/platform.js +24 -0
  182. package/dist/lib/shell-meta.d.ts +7 -0
  183. package/dist/lib/shell-meta.js +70 -0
  184. package/dist/lib/tab-order.d.ts +6 -0
  185. package/dist/lib/tab-order.js +24 -0
  186. package/dist/lib/table-sort.d.ts +16 -0
  187. package/dist/lib/table-sort.js +66 -0
  188. package/dist/lib/terminal-themes.d.ts +30 -0
  189. package/dist/lib/terminal-themes.js +90 -0
  190. package/dist/lib/utils.d.ts +2 -0
  191. package/dist/lib/utils.js +5 -0
  192. package/dist-cdn/loccal-ui.css +971 -0
  193. package/dist-cdn/loccal-ui.min.js +1 -0
  194. package/dist-wc/base.d.ts +31 -0
  195. package/dist-wc/base.js +104 -0
  196. package/dist-wc/button.d.ts +12 -0
  197. package/dist-wc/button.js +47 -0
  198. package/dist-wc/calendar.d.ts +16 -0
  199. package/dist-wc/calendar.js +106 -0
  200. package/dist-wc/choice.d.ts +17 -0
  201. package/dist-wc/choice.js +76 -0
  202. package/dist-wc/command.d.ts +32 -0
  203. package/dist-wc/command.js +181 -0
  204. package/dist-wc/data-table.d.ts +22 -0
  205. package/dist-wc/data-table.js +128 -0
  206. package/dist-wc/dialog.d.ts +29 -0
  207. package/dist-wc/dialog.js +94 -0
  208. package/dist-wc/disclosure.d.ts +17 -0
  209. package/dist-wc/disclosure.js +91 -0
  210. package/dist-wc/fields2.d.ts +38 -0
  211. package/dist-wc/fields2.js +133 -0
  212. package/dist-wc/file-tree.d.ts +19 -0
  213. package/dist-wc/file-tree.js +97 -0
  214. package/dist-wc/floating.d.ts +32 -0
  215. package/dist-wc/floating.js +91 -0
  216. package/dist-wc/index.d.ts +23 -0
  217. package/dist-wc/index.js +24 -0
  218. package/dist-wc/input-otp.d.ts +14 -0
  219. package/dist-wc/input-otp.js +82 -0
  220. package/dist-wc/navigation-menu.d.ts +14 -0
  221. package/dist-wc/navigation-menu.js +75 -0
  222. package/dist-wc/number-field.d.ts +13 -0
  223. package/dist-wc/number-field.js +67 -0
  224. package/dist-wc/resizable.d.ts +14 -0
  225. package/dist-wc/resizable.js +57 -0
  226. package/dist-wc/select.d.ts +17 -0
  227. package/dist-wc/select.js +80 -0
  228. package/dist-wc/static.d.ts +1 -0
  229. package/dist-wc/static.js +175 -0
  230. package/dist-wc/status-bar.d.ts +11 -0
  231. package/dist-wc/status-bar.js +54 -0
  232. package/dist-wc/styles.css +971 -0
  233. package/dist-wc/tabs.d.ts +16 -0
  234. package/dist-wc/tabs.js +62 -0
  235. package/dist-wc/terminal-tabs.d.ts +16 -0
  236. package/dist-wc/terminal-tabs.js +79 -0
  237. package/dist-wc/toaster.d.ts +16 -0
  238. package/dist-wc/toaster.js +68 -0
  239. package/dist-wc/toggle.d.ts +30 -0
  240. package/dist-wc/toggle.js +101 -0
  241. package/dist-wc/tree.d.ts +17 -0
  242. package/dist-wc/tree.js +72 -0
  243. package/docs/ARQUITETURA-VANILLA.md +54 -0
  244. package/docs/VERSIONING.md +88 -0
  245. package/package.json +1058 -6
  246. package/styles.css +426 -0
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { DayPicker, getDefaultClassNames, } from "react-day-picker";
6
+ import { Button, buttonVariants } from "./button.js";
7
+ import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from "./icons.js";
8
+ function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
9
+ const defaultClassNames = getDefaultClassNames();
10
+ return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn("group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent", String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, locale: locale, formatters: {
11
+ formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
12
+ ...formatters,
13
+ }, classNames: {
14
+ root: cn("w-fit", defaultClassNames.root),
15
+ months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
16
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
17
+ nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
18
+ button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
19
+ button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
20
+ month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
21
+ dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
22
+ dropdown_root: cn("relative rounded-(--cell-radius)", defaultClassNames.dropdown_root),
23
+ dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
24
+ caption_label: cn("font-medium select-none", captionLayout === "label"
25
+ ? "text-sm"
26
+ : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
27
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
28
+ weekdays: cn("flex", defaultClassNames.weekdays),
29
+ weekday: cn("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
30
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
31
+ week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
32
+ week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
33
+ day: cn("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", props.showWeekNumber
34
+ ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)"
35
+ : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", defaultClassNames.day),
36
+ range_start: cn("relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted", defaultClassNames.range_start),
37
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
38
+ range_end: cn("relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted", defaultClassNames.range_end),
39
+ today: cn("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
40
+ outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
41
+ disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
42
+ hidden: cn("invisible", defaultClassNames.hidden),
43
+ ...classNames,
44
+ }, components: {
45
+ Root: ({ className, rootRef, ...props }) => {
46
+ return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props }));
47
+ },
48
+ Chevron: ({ className, orientation, ...props }) => {
49
+ if (orientation === "left") {
50
+ return (_jsx(ChevronLeftIcon, { className: cn("size-4", className), ...props }));
51
+ }
52
+ if (orientation === "right") {
53
+ return (_jsx(ChevronRightIcon, { className: cn("size-4", className), ...props }));
54
+ }
55
+ return (_jsx(ChevronDownIcon, { className: cn("size-4", className), ...props }));
56
+ },
57
+ DayButton: ({ ...props }) => (_jsx(CalendarDayButton, { locale: locale, ...props })),
58
+ WeekNumber: ({ children, ...props }) => {
59
+ return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
60
+ },
61
+ ...components,
62
+ }, ...props }));
63
+ }
64
+ function CalendarDayButton({ className, day, modifiers, locale, ...props }) {
65
+ const defaultClassNames = getDefaultClassNames();
66
+ const ref = React.useRef(null);
67
+ React.useEffect(() => {
68
+ if (modifiers.focused)
69
+ ref.current?.focus();
70
+ }, [modifiers.focused]);
71
+ return (_jsx(Button, { variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(locale?.code), "data-selected-single": modifiers.selected &&
72
+ !modifiers.range_start &&
73
+ !modifiers.range_end &&
74
+ !modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className), ...props }));
75
+ }
76
+ export { Calendar, CalendarDayButton };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
3
+ size?: "default" | "sm";
4
+ }): React.JSX.Element;
5
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
6
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
7
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
8
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
9
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils.js";
3
+ function Card({ className, size = "default", ...props }) {
4
+ return (_jsx("div", { "data-slot": "card", "data-size": size, className: cn("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-surface [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className), ...props }));
5
+ }
6
+ function CardHeader({ className, ...props }) {
7
+ return (_jsx("div", { "data-slot": "card-header", className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className), ...props }));
8
+ }
9
+ function CardTitle({ className, ...props }) {
10
+ return (_jsx("div", { "data-slot": "card-title", className: cn("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className), ...props }));
11
+ }
12
+ function CardDescription({ className, ...props }) {
13
+ return (_jsx("div", { "data-slot": "card-description", className: cn("text-sm text-muted-foreground", className), ...props }));
14
+ }
15
+ function CardAction({ className, ...props }) {
16
+ return (_jsx("div", { "data-slot": "card-action", className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className), ...props }));
17
+ }
18
+ function CardContent({ className, ...props }) {
19
+ return (_jsx("div", { "data-slot": "card-content", className: cn("px-(--card-spacing)", className), ...props }));
20
+ }
21
+ function CardFooter({ className, ...props }) {
22
+ return (_jsx("div", { "data-slot": "card-footer", className: cn("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)", className), ...props }));
23
+ }
24
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -0,0 +1,44 @@
1
+ import * as React from "react";
2
+ import * as RechartsPrimitive from "recharts";
3
+ import type { TooltipValueType } from "recharts";
4
+ declare const THEMES: {
5
+ readonly light: "";
6
+ readonly dark: ".dark";
7
+ };
8
+ type TooltipNameType = number | string;
9
+ export type ChartConfig = Record<string, {
10
+ label?: React.ReactNode;
11
+ icon?: React.ComponentType;
12
+ } & ({
13
+ color?: string;
14
+ theme?: never;
15
+ } | {
16
+ color?: never;
17
+ theme: Record<keyof typeof THEMES, string>;
18
+ })>;
19
+ declare function ChartContainer({ id, className, children, config, initialDimension, ...props }: React.ComponentProps<"div"> & {
20
+ config: ChartConfig;
21
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
22
+ initialDimension?: {
23
+ width: number;
24
+ height: number;
25
+ };
26
+ }): React.JSX.Element;
27
+ declare const ChartStyle: ({ id, config }: {
28
+ id: string;
29
+ config: ChartConfig;
30
+ }) => React.JSX.Element | null;
31
+ declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
32
+ declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
33
+ hideLabel?: boolean;
34
+ hideIndicator?: boolean;
35
+ indicator?: "line" | "dot" | "dashed";
36
+ nameKey?: string;
37
+ labelKey?: string;
38
+ } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, "accessibilityLayer">): React.JSX.Element | null;
39
+ declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
40
+ declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & {
41
+ hideIcon?: boolean;
42
+ nameKey?: string;
43
+ } & RechartsPrimitive.DefaultLegendContentProps): React.JSX.Element | null;
44
+ export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
@@ -0,0 +1,132 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../../lib/utils.js";
5
+ import * as RechartsPrimitive from "recharts";
6
+ // Format: { THEME_NAME: CSS_SELECTOR }
7
+ const THEMES = { light: "", dark: ".dark" };
8
+ const INITIAL_DIMENSION = { width: 320, height: 200 };
9
+ const ChartContext = React.createContext(null);
10
+ function useChart() {
11
+ const context = React.useContext(ChartContext);
12
+ if (!context) {
13
+ throw new Error("useChart must be used within a <ChartContainer />");
14
+ }
15
+ return context;
16
+ }
17
+ function ChartContainer({ id, className, children, config, initialDimension = INITIAL_DIMENSION, ...props }) {
18
+ const uniqueId = React.useId();
19
+ const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
20
+ return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { initialDimension: initialDimension, children: children })] }) }));
21
+ }
22
+ const ChartStyle = ({ id, config }) => {
23
+ const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);
24
+ if (!colorConfig.length) {
25
+ return null;
26
+ }
27
+ return (_jsx("style", { dangerouslySetInnerHTML: {
28
+ __html: Object.entries(THEMES)
29
+ .map(([theme, prefix]) => `
30
+ ${prefix} [data-chart=${id}] {
31
+ ${colorConfig
32
+ .map(([key, itemConfig]) => {
33
+ const color = itemConfig.theme?.[theme] ??
34
+ itemConfig.color;
35
+ return color ? ` --color-${key}: ${color};` : null;
36
+ })
37
+ .join("\n")}
38
+ }
39
+ `)
40
+ .join("\n"),
41
+ } }));
42
+ };
43
+ const ChartTooltip = RechartsPrimitive.Tooltip;
44
+ function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
45
+ const { config } = useChart();
46
+ const tooltipLabel = React.useMemo(() => {
47
+ if (hideLabel || !payload?.length) {
48
+ return null;
49
+ }
50
+ const [item] = payload;
51
+ const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`;
52
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
53
+ const value = !labelKey && typeof label === "string"
54
+ ? (config[label]?.label ?? label)
55
+ : itemConfig?.label;
56
+ if (labelFormatter) {
57
+ return (_jsx("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) }));
58
+ }
59
+ if (!value) {
60
+ return null;
61
+ }
62
+ return _jsx("div", { className: cn("font-medium", labelClassName), children: value });
63
+ }, [
64
+ label,
65
+ labelFormatter,
66
+ payload,
67
+ hideLabel,
68
+ labelClassName,
69
+ config,
70
+ labelKey,
71
+ ]);
72
+ if (!active || !payload?.length) {
73
+ return null;
74
+ }
75
+ const nestLabel = payload.length === 1 && indicator !== "dot";
76
+ return (_jsxs("div", { className: cn("grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload
77
+ .filter((item) => item.type !== "none")
78
+ .map((item, index) => {
79
+ const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`;
80
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
81
+ const indicatorColor = color ?? item.payload?.fill ?? item.color;
82
+ return (_jsx("div", { className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center"), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [itemConfig?.icon ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
83
+ "h-2.5 w-2.5": indicator === "dot",
84
+ "w-1": indicator === "line",
85
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
86
+ "my-0.5": nestLabel && indicator === "dashed",
87
+ }), style: {
88
+ "--color-bg": indicatorColor,
89
+ "--color-border": indicatorColor,
90
+ } }))), _jsxs("div", { className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"), children: [_jsxs("div", { className: "grid gap-1.5", children: [nestLabel ? tooltipLabel : null, _jsx("span", { className: "text-muted-foreground", children: itemConfig?.label ?? item.name })] }), item.value != null && (_jsx("span", { className: "font-mono font-medium text-foreground tabular-nums", children: typeof item.value === "number"
91
+ ? item.value.toLocaleString()
92
+ : String(item.value) }))] })] })) }, index));
93
+ }) })] }));
94
+ }
95
+ const ChartLegend = RechartsPrimitive.Legend;
96
+ function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey, }) {
97
+ const { config } = useChart();
98
+ if (!payload?.length) {
99
+ return null;
100
+ }
101
+ return (_jsx("div", { className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className), children: payload
102
+ .filter((item) => item.type !== "none")
103
+ .map((item, index) => {
104
+ const key = `${nameKey ?? item.dataKey ?? "value"}`;
105
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
106
+ return (_jsxs("div", { className: cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
107
+ backgroundColor: item.color,
108
+ } })), itemConfig?.label] }, index));
109
+ }) }));
110
+ }
111
+ function getPayloadConfigFromPayload(config, payload, key) {
112
+ if (typeof payload !== "object" || payload === null) {
113
+ return undefined;
114
+ }
115
+ const payloadPayload = "payload" in payload &&
116
+ typeof payload.payload === "object" &&
117
+ payload.payload !== null
118
+ ? payload.payload
119
+ : undefined;
120
+ let configLabelKey = key;
121
+ if (key in payload &&
122
+ typeof payload[key] === "string") {
123
+ configLabelKey = payload[key];
124
+ }
125
+ else if (payloadPayload &&
126
+ key in payloadPayload &&
127
+ typeof payloadPayload[key] === "string") {
128
+ configLabelKey = payloadPayload[key];
129
+ }
130
+ return configLabelKey in config ? config[configLabelKey] : config[key];
131
+ }
132
+ export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
@@ -0,0 +1,3 @@
1
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
2
+ declare function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props): import("react").JSX.Element;
3
+ export { Checkbox };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { CheckIcon } from "./icons.js";
6
+ function Checkbox({ className, ...props }) {
7
+ return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 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(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none [&>svg]:size-3.5", children: _jsx(CheckIcon, {}) }) }));
8
+ }
9
+ export { Checkbox };
@@ -0,0 +1,5 @@
1
+ import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
2
+ declare function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props): import("react").JSX.Element;
3
+ declare function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props): import("react").JSX.Element;
4
+ declare function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props): import("react").JSX.Element;
5
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
4
+ function Collapsible({ ...props }) {
5
+ return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
6
+ }
7
+ function CollapsibleTrigger({ ...props }) {
8
+ return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", ...props }));
9
+ }
10
+ function CollapsibleContent({ ...props }) {
11
+ return (_jsx(CollapsiblePrimitive.Panel, { "data-slot": "collapsible-content", ...props }));
12
+ }
13
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { type CommandRisk } from "../../lib/command-risk.js";
3
+ type CommandBlockLabels = {
4
+ copy: string;
5
+ copied: string;
6
+ insert: string;
7
+ run: string;
8
+ confirmRun: string;
9
+ risk: Record<CommandRisk, string>;
10
+ };
11
+ type CommandBlockProps = {
12
+ command: string;
13
+ explanation?: React.ReactNode;
14
+ /** Sobrescreve a avaliacao automatica de risco. */
15
+ risk?: CommandRisk;
16
+ /** Insere o comando no prompt do terminal sem pressionar Enter. */
17
+ onInsert?: (command: string) => void;
18
+ /** Executa o comando. Em risco alto exige um segundo clique de confirmacao. */
19
+ onRun?: (command: string) => void;
20
+ onCopy?: (command: string) => void;
21
+ labels?: Partial<Omit<CommandBlockLabels, "risk">> & {
22
+ risk?: Partial<Record<CommandRisk, string>>;
23
+ };
24
+ className?: string;
25
+ };
26
+ declare function CommandBlock({ command, explanation, risk, onInsert, onRun, onCopy, labels, className }: CommandBlockProps): React.JSX.Element;
27
+ export { CommandBlock };
28
+ export type { CommandBlockProps };
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { CheckIcon, CopyIcon, CornerDownLeftIcon, PlayIcon, AlertTriangleIcon as TriangleAlertIcon } from "./icons.js";
5
+ import { cn } from "../../lib/utils.js";
6
+ import { Badge } from "./badge.js";
7
+ import { Button } from "./button.js";
8
+ import { assessCommandRisk } from "../../lib/command-risk.js";
9
+ const DEFAULT_LABELS = {
10
+ copy: "Copiar",
11
+ copied: "Copiado",
12
+ insert: "Inserir",
13
+ run: "Executar",
14
+ confirmRun: "Confirmar execução",
15
+ risk: { low: "Baixo risco", medium: "Atenção", high: "Risco alto" },
16
+ };
17
+ const CONFIRM_WINDOW_MS = 4000;
18
+ function CommandBlock({ command, explanation, risk, onInsert, onRun, onCopy, labels, className }) {
19
+ const l = { ...DEFAULT_LABELS, ...labels, risk: { ...DEFAULT_LABELS.risk, ...labels?.risk } };
20
+ const assessment = React.useMemo(() => assessCommandRisk(command), [command]);
21
+ const level = risk ?? assessment.risk;
22
+ const [copied, setCopied] = React.useState(false);
23
+ const [armed, setArmed] = React.useState(false);
24
+ React.useEffect(() => {
25
+ if (!armed)
26
+ return;
27
+ const t = window.setTimeout(() => setArmed(false), CONFIRM_WINDOW_MS);
28
+ return () => window.clearTimeout(t);
29
+ }, [armed]);
30
+ React.useEffect(() => {
31
+ if (!copied)
32
+ return;
33
+ const t = window.setTimeout(() => setCopied(false), 1500);
34
+ return () => window.clearTimeout(t);
35
+ }, [copied]);
36
+ // Se o comando mudar (streaming), a confirmacao anterior deixa de valer.
37
+ React.useEffect(() => setArmed(false), [command]);
38
+ const copy = async () => {
39
+ try {
40
+ await navigator.clipboard.writeText(command);
41
+ setCopied(true);
42
+ }
43
+ catch {
44
+ // sem permissao de area de transferencia: o chamador ainda e avisado
45
+ }
46
+ onCopy?.(command);
47
+ };
48
+ const run = () => {
49
+ if (level === "high" && !armed) {
50
+ setArmed(true);
51
+ return;
52
+ }
53
+ setArmed(false);
54
+ onRun?.(command);
55
+ };
56
+ return (_jsxs("div", { "data-slot": "command-block", "data-risk": level, className: cn("overflow-hidden rounded-lg bg-card shadow-surface", level === "high" && "shadow-[inset_0_0_0_1px_var(--destructive)]", className), children: [_jsx("pre", { className: "overflow-x-auto px-3 py-2 font-mono text-xs leading-relaxed whitespace-pre-wrap break-all text-foreground", children: _jsx("code", { children: command }) }), explanation ? _jsx("p", { className: "px-3 pb-2 text-xs text-muted-foreground", children: explanation }) : null, _jsxs("div", { className: "flex items-center gap-1.5 border-t bg-muted/40 px-1.5 py-1", children: [level !== "low" ? (_jsxs(Badge, { variant: level === "high" ? "destructive" : "outline", className: "gap-1", children: [_jsx(TriangleAlertIcon, {}), l.risk[level]] })) : null, _jsx("span", { className: "flex-1" }), _jsxs(Button, { type: "button", size: "sm", variant: "ghost", onClick: copy, children: [copied ? _jsx(CheckIcon, {}) : _jsx(CopyIcon, {}), copied ? l.copied : l.copy] }), onInsert ? (_jsxs(Button, { type: "button", size: "sm", variant: "ghost", onClick: () => onInsert(command), children: [_jsx(CornerDownLeftIcon, {}), l.insert] })) : null, onRun ? (_jsxs(Button, { type: "button", size: "sm", variant: armed ? "destructive" : "outline", "aria-live": "polite", onClick: run, children: [_jsx(PlayIcon, {}), armed ? l.confirmRun : l.run] })) : null] })] }));
57
+ }
58
+ export { CommandBlock };
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { Command as CommandPrimitive } from "cmdk";
3
+ import { Dialog } from "./dialog.js";
4
+ declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
5
+ declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
6
+ title?: string;
7
+ description?: string;
8
+ className?: string;
9
+ showCloseButton?: boolean;
10
+ children: React.ReactNode;
11
+ }): React.JSX.Element;
12
+ declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
13
+ declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
14
+ declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
15
+ declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
16
+ declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
17
+ declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
18
+ declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
19
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Command as CommandPrimitive } from "cmdk";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog.js";
6
+ import { InputGroup, InputGroupAddon, } from "./input-group.js";
7
+ import { SearchIcon, CheckIcon } from "./icons.js";
8
+ function Command({ className, ...props }) {
9
+ return (_jsx(CommandPrimitive, { "data-slot": "command", className: cn("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground", className), ...props }));
10
+ }
11
+ function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = false, ...props }) {
12
+ return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0", className), showCloseButton: showCloseButton, children: children })] }));
13
+ }
14
+ function CommandInput({ className, ...props }) {
15
+ return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: _jsxs(InputGroup, { className: "h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className), ...props }), _jsx(InputGroupAddon, { children: _jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }) })] }) }));
16
+ }
17
+ function CommandList({ className, ...props }) {
18
+ return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", className), ...props }));
19
+ }
20
+ function CommandEmpty({ className, ...props }) {
21
+ return (_jsx(CommandPrimitive.Empty, { "data-slot": "command-empty", className: cn("py-6 text-center text-sm", className), ...props }));
22
+ }
23
+ function CommandGroup({ className, ...props }) {
24
+ return (_jsx(CommandPrimitive.Group, { "data-slot": "command-group", className: cn("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground", className), ...props }));
25
+ }
26
+ function CommandSeparator({ className, ...props }) {
27
+ return (_jsx(CommandPrimitive.Separator, { "data-slot": "command-separator", className: cn("-mx-1 h-px bg-border", className), ...props }));
28
+ }
29
+ function CommandItem({ className, children, ...props }) {
30
+ return (_jsxs(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground", className), ...props, children: [children, _jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] }));
31
+ }
32
+ function CommandShortcut({ className, ...props }) {
33
+ return (_jsx("span", { "data-slot": "command-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground", className), ...props }));
34
+ }
35
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ type ConnectionState = "disabled" | "connecting" | "online" | "degraded" | "offline";
3
+ type CircuitState = "closed" | "half-open" | "open";
4
+ type ConnectionStatusLabels = {
5
+ disabled: string;
6
+ connecting: string;
7
+ online: string;
8
+ degraded: string;
9
+ offline: string;
10
+ test: string;
11
+ circuit: Record<CircuitState, string>;
12
+ };
13
+ type ConnectionStatusProps = {
14
+ state: ConnectionState;
15
+ latencyMs?: number;
16
+ /** Versao do servico remoto, por exemplo a do Ollama. */
17
+ version?: string;
18
+ circuit?: CircuitState;
19
+ /** Mensagem de erro curta mostrada quando offline/instavel. */
20
+ detail?: string;
21
+ onTest?: () => void;
22
+ labels?: Partial<Omit<ConnectionStatusLabels, "circuit">> & {
23
+ circuit?: Partial<Record<CircuitState, string>>;
24
+ };
25
+ className?: string;
26
+ };
27
+ declare function ConnectionStatus({ state, latencyMs, version, circuit, detail, onTest, labels, className }: ConnectionStatusProps): React.JSX.Element;
28
+ export { ConnectionStatus };
29
+ export type { ConnectionState, CircuitState, ConnectionStatusProps };
@@ -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, };