@squadbase/vantage 0.0.1 → 0.1.1

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 (187) hide show
  1. package/README.md +24 -4
  2. package/dist/{chunk-ZGDU5YLH.js → chunk-5L2MH2NG.js} +16 -7
  3. package/dist/chunk-5L2MH2NG.js.map +1 -0
  4. package/dist/chunk-7IPAXPPY.js +51 -0
  5. package/dist/chunk-7IPAXPPY.js.map +1 -0
  6. package/dist/chunk-A2UUGASH.js +12 -0
  7. package/dist/chunk-A2UUGASH.js.map +1 -0
  8. package/dist/chunk-DTDVSFRY.js +29 -0
  9. package/dist/chunk-DTDVSFRY.js.map +1 -0
  10. package/dist/chunk-WQZYXXQW.js +2249 -0
  11. package/dist/chunk-WQZYXXQW.js.map +1 -0
  12. package/dist/{chunk-73J5ZD4C.js → chunk-YLAB6UQS.js} +17 -3
  13. package/dist/chunk-YLAB6UQS.js.map +1 -0
  14. package/dist/cli.js +607 -36
  15. package/dist/cli.js.map +1 -1
  16. package/dist/client/index.d.ts +2 -1
  17. package/dist/client/index.js +3 -1
  18. package/dist/client/index.js.map +1 -1
  19. package/dist/components/index.d.ts +575 -0
  20. package/dist/components/index.js +2097 -0
  21. package/dist/components/index.js.map +1 -0
  22. package/dist/{define-page-B6y9TOfZ.d.ts → define-page-BfhrK99G.d.ts} +5 -0
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/markdown/index.d.ts +9 -0
  27. package/dist/markdown/index.js +26 -0
  28. package/dist/markdown/index.js.map +1 -0
  29. package/dist/query/index.d.ts +95 -2
  30. package/dist/query/index.js +102 -1
  31. package/dist/query/index.js.map +1 -1
  32. package/dist/router/index.d.ts +86 -1
  33. package/dist/router/index.js +71 -7
  34. package/dist/router/index.js.map +1 -1
  35. package/dist/server/node.js +6 -1
  36. package/dist/server/node.js.map +1 -1
  37. package/dist/ui/index.d.ts +316 -200
  38. package/dist/ui/index.js +566 -511
  39. package/dist/ui/index.js.map +1 -1
  40. package/dist/vite/index.js +2 -2
  41. package/docs/en/agent-skills.md +89 -0
  42. package/docs/en/api-and-server.md +84 -0
  43. package/docs/en/build-and-deploy.md +280 -0
  44. package/docs/en/cli-reference.md +311 -0
  45. package/docs/en/components.md +235 -0
  46. package/docs/en/data-fetching.md +142 -0
  47. package/docs/en/environment-variables.md +69 -0
  48. package/docs/en/getting-started.md +95 -0
  49. package/docs/en/index.md +65 -0
  50. package/docs/en/markdown/markdown-renderer.md +44 -0
  51. package/docs/en/pages-and-metadata.md +59 -0
  52. package/docs/en/parts/app-shell.md +54 -0
  53. package/docs/en/parts/dashboard-card.md +64 -0
  54. package/docs/en/parts/data-table.md +86 -0
  55. package/docs/en/parts/date-range-picker.md +41 -0
  56. package/docs/en/parts/echart.md +53 -0
  57. package/docs/en/parts/filter-bar.md +66 -0
  58. package/docs/en/parts/funnel-steps.md +33 -0
  59. package/docs/en/parts/metric-value.md +23 -0
  60. package/docs/en/parts/multi-select.md +27 -0
  61. package/docs/en/parts/page-shell.md +45 -0
  62. package/docs/en/parts/placeholder.md +38 -0
  63. package/docs/en/parts/searchable-select.md +47 -0
  64. package/docs/en/parts/section-header.md +20 -0
  65. package/docs/en/parts/segmented-control.md +25 -0
  66. package/docs/en/parts/sparkline.md +47 -0
  67. package/docs/en/parts/status-badge.md +44 -0
  68. package/docs/en/parts/trend-indicator.md +26 -0
  69. package/docs/en/routing.md +177 -0
  70. package/docs/en/ui/accordion.md +36 -0
  71. package/docs/en/ui/alert.md +31 -0
  72. package/docs/en/ui/badge.md +23 -0
  73. package/docs/en/ui/breadcrumb.md +38 -0
  74. package/docs/en/ui/button.md +39 -0
  75. package/docs/en/ui/calendar.md +28 -0
  76. package/docs/en/ui/card.md +35 -0
  77. package/docs/en/ui/checkbox.md +34 -0
  78. package/docs/en/ui/cn.md +34 -0
  79. package/docs/en/ui/collapsible.md +21 -0
  80. package/docs/en/ui/command.md +37 -0
  81. package/docs/en/ui/dialog.md +52 -0
  82. package/docs/en/ui/dropdown-menu.md +50 -0
  83. package/docs/en/ui/empty.md +22 -0
  84. package/docs/en/ui/error-state.md +50 -0
  85. package/docs/en/ui/input-group.md +30 -0
  86. package/docs/en/ui/input.md +28 -0
  87. package/docs/en/ui/label.md +19 -0
  88. package/docs/en/ui/loading.md +19 -0
  89. package/docs/en/ui/popover.md +34 -0
  90. package/docs/en/ui/progress.md +28 -0
  91. package/docs/en/ui/scroll-area.md +23 -0
  92. package/docs/en/ui/select.md +63 -0
  93. package/docs/en/ui/separator.md +15 -0
  94. package/docs/en/ui/sheet.md +28 -0
  95. package/docs/en/ui/sidebar.md +92 -0
  96. package/docs/en/ui/skeleton.md +16 -0
  97. package/docs/en/ui/slider.md +21 -0
  98. package/docs/en/ui/spinner.md +14 -0
  99. package/docs/en/ui/switch.md +19 -0
  100. package/docs/en/ui/table.md +24 -0
  101. package/docs/en/ui/tabs.md +23 -0
  102. package/docs/en/ui/textarea.md +15 -0
  103. package/docs/en/ui/toggle-group.md +26 -0
  104. package/docs/en/ui/toggle.md +19 -0
  105. package/docs/en/ui/tooltip.md +22 -0
  106. package/docs/en/ui/use-is-mobile.md +18 -0
  107. package/docs/en/ui-and-theming.md +95 -0
  108. package/docs/index.json +1346 -0
  109. package/docs/ja/agent-skills.md +87 -0
  110. package/docs/ja/api-and-server.md +84 -0
  111. package/docs/ja/build-and-deploy.md +279 -0
  112. package/docs/ja/cli-reference.md +305 -0
  113. package/docs/ja/components.md +231 -0
  114. package/docs/ja/data-fetching.md +142 -0
  115. package/docs/ja/environment-variables.md +68 -0
  116. package/docs/ja/getting-started.md +95 -0
  117. package/docs/ja/index.md +65 -0
  118. package/docs/ja/markdown/markdown-renderer.md +43 -0
  119. package/docs/ja/pages-and-metadata.md +59 -0
  120. package/docs/ja/parts/app-shell.md +54 -0
  121. package/docs/ja/parts/dashboard-card.md +64 -0
  122. package/docs/ja/parts/data-table.md +85 -0
  123. package/docs/ja/parts/date-range-picker.md +41 -0
  124. package/docs/ja/parts/echart.md +52 -0
  125. package/docs/ja/parts/filter-bar.md +64 -0
  126. package/docs/ja/parts/funnel-steps.md +33 -0
  127. package/docs/ja/parts/metric-value.md +25 -0
  128. package/docs/ja/parts/multi-select.md +27 -0
  129. package/docs/ja/parts/page-shell.md +45 -0
  130. package/docs/ja/parts/placeholder.md +37 -0
  131. package/docs/ja/parts/searchable-select.md +47 -0
  132. package/docs/ja/parts/section-header.md +20 -0
  133. package/docs/ja/parts/segmented-control.md +26 -0
  134. package/docs/ja/parts/sparkline.md +47 -0
  135. package/docs/ja/parts/status-badge.md +44 -0
  136. package/docs/ja/parts/trend-indicator.md +26 -0
  137. package/docs/ja/routing.md +175 -0
  138. package/docs/ja/ui/accordion.md +37 -0
  139. package/docs/ja/ui/alert.md +31 -0
  140. package/docs/ja/ui/badge.md +23 -0
  141. package/docs/ja/ui/breadcrumb.md +38 -0
  142. package/docs/ja/ui/button.md +39 -0
  143. package/docs/ja/ui/calendar.md +28 -0
  144. package/docs/ja/ui/card.md +35 -0
  145. package/docs/ja/ui/checkbox.md +34 -0
  146. package/docs/ja/ui/cn.md +34 -0
  147. package/docs/ja/ui/collapsible.md +21 -0
  148. package/docs/ja/ui/command.md +36 -0
  149. package/docs/ja/ui/dialog.md +51 -0
  150. package/docs/ja/ui/dropdown-menu.md +50 -0
  151. package/docs/ja/ui/empty.md +22 -0
  152. package/docs/ja/ui/error-state.md +50 -0
  153. package/docs/ja/ui/input-group.md +30 -0
  154. package/docs/ja/ui/input.md +28 -0
  155. package/docs/ja/ui/label.md +19 -0
  156. package/docs/ja/ui/loading.md +19 -0
  157. package/docs/ja/ui/popover.md +34 -0
  158. package/docs/ja/ui/progress.md +28 -0
  159. package/docs/ja/ui/scroll-area.md +24 -0
  160. package/docs/ja/ui/select.md +64 -0
  161. package/docs/ja/ui/separator.md +15 -0
  162. package/docs/ja/ui/sheet.md +28 -0
  163. package/docs/ja/ui/sidebar.md +92 -0
  164. package/docs/ja/ui/skeleton.md +16 -0
  165. package/docs/ja/ui/slider.md +21 -0
  166. package/docs/ja/ui/spinner.md +14 -0
  167. package/docs/ja/ui/switch.md +19 -0
  168. package/docs/ja/ui/table.md +24 -0
  169. package/docs/ja/ui/tabs.md +24 -0
  170. package/docs/ja/ui/textarea.md +15 -0
  171. package/docs/ja/ui/toggle-group.md +27 -0
  172. package/docs/ja/ui/toggle.md +19 -0
  173. package/docs/ja/ui/tooltip.md +22 -0
  174. package/docs/ja/ui/use-is-mobile.md +18 -0
  175. package/docs/ja/ui-and-theming.md +95 -0
  176. package/package.json +29 -4
  177. package/registry/blocks/sales-overview.tsx +43 -19
  178. package/registry/ui/data-table.tsx +702 -102
  179. package/skills/vantage-add-feature/SKILL.md +153 -0
  180. package/skills/vantage-app/SKILL.md +291 -0
  181. package/skills/vantage-pitfalls/SKILL.md +139 -0
  182. package/templates/AGENTS.md +313 -0
  183. package/theme.css +178 -40
  184. package/dist/chunk-73J5ZD4C.js.map +0 -1
  185. package/dist/chunk-ATYZ45XL.js +0 -19
  186. package/dist/chunk-ATYZ45XL.js.map +0 -1
  187. package/dist/chunk-ZGDU5YLH.js.map +0 -1
package/dist/ui/index.js CHANGED
@@ -1,302 +1,630 @@
1
- import { forwardRef, createContext, useState, useContext, useMemo, useEffect, useRef } from 'react';
1
+ export { Badge, Button, Calendar, CalendarDayButton, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, toggleVariants, useIsMobile, useSidebar } from '../chunk-WQZYXXQW.js';
2
+ import { cn } from '../chunk-A2UUGASH.js';
3
+ export { cn } from '../chunk-A2UUGASH.js';
4
+ import { Accordion as Accordion$1 } from '@base-ui/react/accordion';
5
+ import { ChevronDownIcon, ChevronUpIcon, ChevronRightIcon, MoreHorizontalIcon, Loader2Icon } from 'lucide-react';
2
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
+ import 'react';
8
+ import { cva } from 'class-variance-authority';
9
+ import { mergeProps } from '@base-ui/react/merge-props';
10
+ import { useRender } from '@base-ui/react/use-render';
11
+ import { Progress as Progress$1 } from '@base-ui/react/progress';
12
+ import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
13
+ import { Slider as Slider$1 } from '@base-ui/react/slider';
14
+ import { Switch as Switch$1 } from '@base-ui/react/switch';
15
+ import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
3
16
 
4
17
  // @squadbase/vantage — generated build. Do not edit.
5
-
6
- // src/ui/cn.ts
7
- function cn(...classes) {
8
- return classes.filter(Boolean).join(" ");
9
- }
10
- var VARIANTS = {
11
- default: "bg-primary text-primary-foreground hover:opacity-90",
12
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
13
- outline: "border border-border bg-background hover:bg-accent hover:text-accent-foreground",
14
- ghost: "hover:bg-accent hover:text-accent-foreground",
15
- destructive: "bg-destructive text-destructive-foreground hover:opacity-90"
16
- };
17
- var SIZES = {
18
- sm: "h-8 px-3 text-xs",
19
- default: "h-9 px-4 text-sm",
20
- lg: "h-10 px-6 text-sm",
21
- icon: "h-9 w-9"
22
- };
23
- var Button = forwardRef(
24
- ({ className, variant = "default", size = "default", type = "button", ...props }, ref) => /* @__PURE__ */ jsx(
25
- "button",
26
- {
27
- ref,
28
- type,
18
+ function Accordion({ className, ...props }) {
19
+ return /* @__PURE__ */ jsx(
20
+ Accordion$1.Root,
21
+ {
22
+ "data-slot": "accordion",
23
+ className: cn("flex w-full flex-col", className),
24
+ ...props
25
+ }
26
+ );
27
+ }
28
+ function AccordionItem({ className, ...props }) {
29
+ return /* @__PURE__ */ jsx(
30
+ Accordion$1.Item,
31
+ {
32
+ "data-slot": "accordion-item",
33
+ className: cn("not-last:border-b", className),
34
+ ...props
35
+ }
36
+ );
37
+ }
38
+ function AccordionTrigger({
39
+ className,
40
+ children,
41
+ ...props
42
+ }) {
43
+ return /* @__PURE__ */ jsx(Accordion$1.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
44
+ Accordion$1.Trigger,
45
+ {
46
+ "data-slot": "accordion-trigger",
29
47
  className: cn(
30
- "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors",
31
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
32
- "disabled:pointer-events-none disabled:opacity-50",
33
- VARIANTS[variant],
34
- SIZES[size],
48
+ "group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
35
49
  className
36
50
  ),
37
- ...props
51
+ ...props,
52
+ children: [
53
+ children,
54
+ /* @__PURE__ */ jsx(ChevronDownIcon, { "data-slot": "accordion-trigger-icon", className: "pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" }),
55
+ /* @__PURE__ */ jsx(ChevronUpIcon, { "data-slot": "accordion-trigger-icon", className: "pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" })
56
+ ]
38
57
  }
39
- )
40
- );
41
- Button.displayName = "Button";
42
- var FIELD = "flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
43
- var Input = forwardRef(
44
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("input", { ref, className: cn(FIELD, className), ...props })
45
- );
46
- Input.displayName = "Input";
47
- var Select = forwardRef(
48
- ({ className, options, children, ...props }, ref) => /* @__PURE__ */ jsx("select", { ref, className: cn(FIELD, "pr-8", className), ...props, children: options ? options.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, children: o.label }, o.value)) : children })
58
+ ) });
59
+ }
60
+ function AccordionContent({
61
+ className,
62
+ children,
63
+ ...props
64
+ }) {
65
+ return /* @__PURE__ */ jsx(
66
+ Accordion$1.Panel,
67
+ {
68
+ "data-slot": "accordion-content",
69
+ className: "overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",
70
+ ...props,
71
+ children: /* @__PURE__ */ jsx(
72
+ "div",
73
+ {
74
+ className: cn(
75
+ "h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
76
+ className
77
+ ),
78
+ children
79
+ }
80
+ )
81
+ }
82
+ );
83
+ }
84
+ var alertVariants = cva(
85
+ "group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
86
+ {
87
+ variants: {
88
+ variant: {
89
+ default: "bg-card text-card-foreground",
90
+ destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"
91
+ }
92
+ },
93
+ defaultVariants: {
94
+ variant: "default"
95
+ }
96
+ }
49
97
  );
50
- Select.displayName = "Select";
51
- var Checkbox = forwardRef(
52
- ({ className, label, id, ...props }, ref) => /* @__PURE__ */ jsxs("label", { className: "inline-flex items-center gap-2 text-sm", children: [
53
- /* @__PURE__ */ jsx(
54
- "input",
98
+ function Alert({
99
+ className,
100
+ variant,
101
+ ...props
102
+ }) {
103
+ return /* @__PURE__ */ jsx(
104
+ "div",
105
+ {
106
+ "data-slot": "alert",
107
+ role: "alert",
108
+ className: cn(alertVariants({ variant }), className),
109
+ ...props
110
+ }
111
+ );
112
+ }
113
+ function AlertTitle({ className, ...props }) {
114
+ return /* @__PURE__ */ jsx(
115
+ "div",
116
+ {
117
+ "data-slot": "alert-title",
118
+ className: cn(
119
+ "font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
120
+ className
121
+ ),
122
+ ...props
123
+ }
124
+ );
125
+ }
126
+ function AlertDescription({
127
+ className,
128
+ ...props
129
+ }) {
130
+ return /* @__PURE__ */ jsx(
131
+ "div",
132
+ {
133
+ "data-slot": "alert-description",
134
+ className: cn(
135
+ "text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
136
+ className
137
+ ),
138
+ ...props
139
+ }
140
+ );
141
+ }
142
+ function AlertAction({ className, ...props }) {
143
+ return /* @__PURE__ */ jsx(
144
+ "div",
145
+ {
146
+ "data-slot": "alert-action",
147
+ className: cn("absolute top-2 right-2", className),
148
+ ...props
149
+ }
150
+ );
151
+ }
152
+ function Breadcrumb({ className, ...props }) {
153
+ return /* @__PURE__ */ jsx(
154
+ "nav",
155
+ {
156
+ "aria-label": "breadcrumb",
157
+ "data-slot": "breadcrumb",
158
+ className: cn(className),
159
+ ...props
160
+ }
161
+ );
162
+ }
163
+ function BreadcrumbList({ className, ...props }) {
164
+ return /* @__PURE__ */ jsx(
165
+ "ol",
166
+ {
167
+ "data-slot": "breadcrumb-list",
168
+ className: cn(
169
+ "flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
170
+ className
171
+ ),
172
+ ...props
173
+ }
174
+ );
175
+ }
176
+ function BreadcrumbItem({ className, ...props }) {
177
+ return /* @__PURE__ */ jsx(
178
+ "li",
179
+ {
180
+ "data-slot": "breadcrumb-item",
181
+ className: cn("inline-flex items-center gap-1", className),
182
+ ...props
183
+ }
184
+ );
185
+ }
186
+ function BreadcrumbLink({
187
+ className,
188
+ render,
189
+ ...props
190
+ }) {
191
+ return useRender({
192
+ defaultTagName: "a",
193
+ props: mergeProps(
55
194
  {
56
- ref,
57
- id,
58
- type: "checkbox",
59
- className: cn("h-4 w-4 rounded border-input text-primary focus-visible:ring-2 focus-visible:ring-ring", className),
60
- ...props
61
- }
195
+ className: cn("transition-colors hover:text-foreground", className)
196
+ },
197
+ props
62
198
  ),
63
- label ? /* @__PURE__ */ jsx("span", { children: label }) : null
64
- ] })
65
- );
66
- Checkbox.displayName = "Checkbox";
67
- function Card({ className, ...props }) {
199
+ render,
200
+ state: {
201
+ slot: "breadcrumb-link"
202
+ }
203
+ });
204
+ }
205
+ function BreadcrumbPage({ className, ...props }) {
206
+ return /* @__PURE__ */ jsx(
207
+ "span",
208
+ {
209
+ "data-slot": "breadcrumb-page",
210
+ role: "link",
211
+ "aria-disabled": "true",
212
+ "aria-current": "page",
213
+ className: cn("font-normal text-foreground", className),
214
+ ...props
215
+ }
216
+ );
217
+ }
218
+ function BreadcrumbSeparator({
219
+ children,
220
+ className,
221
+ ...props
222
+ }) {
223
+ return /* @__PURE__ */ jsx(
224
+ "li",
225
+ {
226
+ "data-slot": "breadcrumb-separator",
227
+ role: "presentation",
228
+ "aria-hidden": "true",
229
+ className: cn("[&>svg]:size-3.5", className),
230
+ ...props,
231
+ children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, { className: "cn-rtl-flip" })
232
+ }
233
+ );
234
+ }
235
+ function BreadcrumbEllipsis({
236
+ className,
237
+ ...props
238
+ }) {
239
+ return /* @__PURE__ */ jsxs(
240
+ "span",
241
+ {
242
+ "data-slot": "breadcrumb-ellipsis",
243
+ role: "presentation",
244
+ "aria-hidden": "true",
245
+ className: cn(
246
+ "flex size-5 items-center justify-center [&>svg]:size-4",
247
+ className
248
+ ),
249
+ ...props,
250
+ children: [
251
+ /* @__PURE__ */ jsx(MoreHorizontalIcon, {}),
252
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "More" })
253
+ ]
254
+ }
255
+ );
256
+ }
257
+ function Card({
258
+ className,
259
+ size = "default",
260
+ ...props
261
+ }) {
68
262
  return /* @__PURE__ */ jsx(
69
263
  "div",
70
264
  {
71
- className: cn("rounded-xl border border-border bg-card text-card-foreground shadow-sm", className),
265
+ "data-slot": "card",
266
+ "data-size": size,
267
+ className: cn(
268
+ "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--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",
269
+ className
270
+ ),
72
271
  ...props
73
272
  }
74
273
  );
75
274
  }
76
275
  function CardHeader({ className, ...props }) {
77
- return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-1.5 p-6", className), ...props });
276
+ return /* @__PURE__ */ jsx(
277
+ "div",
278
+ {
279
+ "data-slot": "card-header",
280
+ className: cn(
281
+ "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)",
282
+ className
283
+ ),
284
+ ...props
285
+ }
286
+ );
78
287
  }
79
288
  function CardTitle({ className, ...props }) {
80
- return /* @__PURE__ */ jsx("h3", { className: cn("text-base font-semibold leading-none tracking-tight", className), ...props });
289
+ return /* @__PURE__ */ jsx(
290
+ "div",
291
+ {
292
+ "data-slot": "card-title",
293
+ className: cn(
294
+ "cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
295
+ className
296
+ ),
297
+ ...props
298
+ }
299
+ );
81
300
  }
82
301
  function CardDescription({ className, ...props }) {
83
- return /* @__PURE__ */ jsx("p", { className: cn("text-sm text-muted-foreground", className), ...props });
302
+ return /* @__PURE__ */ jsx(
303
+ "div",
304
+ {
305
+ "data-slot": "card-description",
306
+ className: cn("text-sm text-muted-foreground", className),
307
+ ...props
308
+ }
309
+ );
310
+ }
311
+ function CardAction({ className, ...props }) {
312
+ return /* @__PURE__ */ jsx(
313
+ "div",
314
+ {
315
+ "data-slot": "card-action",
316
+ className: cn(
317
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
318
+ className
319
+ ),
320
+ ...props
321
+ }
322
+ );
84
323
  }
85
324
  function CardContent({ className, ...props }) {
86
- return /* @__PURE__ */ jsx("div", { className: cn("p-6 pt-0", className), ...props });
325
+ return /* @__PURE__ */ jsx(
326
+ "div",
327
+ {
328
+ "data-slot": "card-content",
329
+ className: cn("px-(--card-spacing)", className),
330
+ ...props
331
+ }
332
+ );
87
333
  }
88
334
  function CardFooter({ className, ...props }) {
89
- return /* @__PURE__ */ jsx("div", { className: cn("flex items-center p-6 pt-0", className), ...props });
90
- }
91
- var Ctx = createContext(null);
92
- function Tabs({ defaultValue, value, onValueChange, className, children }) {
93
- const [internal, setInternal] = useState(defaultValue);
94
- const current = value ?? internal;
95
- const setValue = (v) => {
96
- if (value === void 0) setInternal(v);
97
- onValueChange?.(v);
98
- };
99
- return /* @__PURE__ */ jsx(Ctx.Provider, { value: { value: current, setValue }, children: /* @__PURE__ */ jsx("div", { className, children }) });
100
- }
101
- function TabsList({ className, children }) {
102
- return /* @__PURE__ */ jsx("div", { className: cn("inline-flex h-9 items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground", className), children });
103
- }
104
- function TabsTrigger({ value, children }) {
105
- const ctx = useContext(Ctx);
106
- if (!ctx) throw new Error("TabsTrigger must be used within Tabs");
107
- const active = ctx.value === value;
108
335
  return /* @__PURE__ */ jsx(
109
- "button",
336
+ "div",
110
337
  {
111
- type: "button",
112
- onClick: () => ctx.setValue(value),
338
+ "data-slot": "card-footer",
113
339
  className: cn(
114
- "inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium transition-all",
115
- active ? "bg-background text-foreground shadow-sm" : "hover:text-foreground"
340
+ "flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",
341
+ className
116
342
  ),
117
- children
343
+ ...props
118
344
  }
119
345
  );
120
346
  }
121
- function TabsContent({ value, className, children }) {
122
- const ctx = useContext(Ctx);
123
- if (!ctx) throw new Error("TabsContent must be used within Tabs");
124
- if (ctx.value !== value) return null;
125
- return /* @__PURE__ */ jsx("div", { className: cn("mt-4", className), children });
347
+ function Label({ className, ...props }) {
348
+ return /* @__PURE__ */ jsx(
349
+ "label",
350
+ {
351
+ "data-slot": "label",
352
+ className: cn(
353
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
354
+ className
355
+ ),
356
+ ...props
357
+ }
358
+ );
126
359
  }
127
- function Table({ className, ...props }) {
128
- return /* @__PURE__ */ jsx("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsx("table", { className: cn("w-full caption-bottom text-sm", className), ...props }) });
360
+ function Progress({
361
+ className,
362
+ children,
363
+ value,
364
+ ...props
365
+ }) {
366
+ return /* @__PURE__ */ jsxs(
367
+ Progress$1.Root,
368
+ {
369
+ value,
370
+ "data-slot": "progress",
371
+ className: cn("flex flex-wrap gap-3", className),
372
+ ...props,
373
+ children: [
374
+ children,
375
+ /* @__PURE__ */ jsx(ProgressTrack, { children: /* @__PURE__ */ jsx(ProgressIndicator, {}) })
376
+ ]
377
+ }
378
+ );
129
379
  }
130
- function TableHeader(props) {
131
- return /* @__PURE__ */ jsx("thead", { className: "[&_tr]:border-b border-border", ...props });
380
+ function ProgressTrack({ className, ...props }) {
381
+ return /* @__PURE__ */ jsx(
382
+ Progress$1.Track,
383
+ {
384
+ className: cn(
385
+ "relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",
386
+ className
387
+ ),
388
+ "data-slot": "progress-track",
389
+ ...props
390
+ }
391
+ );
132
392
  }
133
- function TableBody(props) {
134
- return /* @__PURE__ */ jsx("tbody", { className: "[&_tr:last-child]:border-0", ...props });
393
+ function ProgressIndicator({
394
+ className,
395
+ ...props
396
+ }) {
397
+ return /* @__PURE__ */ jsx(
398
+ Progress$1.Indicator,
399
+ {
400
+ "data-slot": "progress-indicator",
401
+ className: cn("h-full bg-primary transition-all", className),
402
+ ...props
403
+ }
404
+ );
135
405
  }
136
- function TableRow({ className, ...props }) {
137
- return /* @__PURE__ */ jsx("tr", { className: cn("border-b border-border transition-colors hover:bg-muted/50", className), ...props });
406
+ function ProgressLabel({ className, ...props }) {
407
+ return /* @__PURE__ */ jsx(
408
+ Progress$1.Label,
409
+ {
410
+ className: cn("text-sm font-medium", className),
411
+ "data-slot": "progress-label",
412
+ ...props
413
+ }
414
+ );
138
415
  }
139
- function TableHead({ className, ...props }) {
416
+ function ProgressValue({ className, ...props }) {
140
417
  return /* @__PURE__ */ jsx(
141
- "th",
418
+ Progress$1.Value,
142
419
  {
143
- className: cn("h-10 px-3 text-left align-middle text-xs font-medium text-muted-foreground", className),
420
+ className: cn(
421
+ "ml-auto text-sm text-muted-foreground tabular-nums",
422
+ className
423
+ ),
424
+ "data-slot": "progress-value",
144
425
  ...props
145
426
  }
146
427
  );
147
428
  }
148
- function TableCell({ className, ...props }) {
149
- return /* @__PURE__ */ jsx("td", { className: cn("px-3 py-2.5 align-middle", className), ...props });
429
+ function ScrollArea({
430
+ className,
431
+ children,
432
+ ...props
433
+ }) {
434
+ return /* @__PURE__ */ jsxs(
435
+ ScrollArea$1.Root,
436
+ {
437
+ "data-slot": "scroll-area",
438
+ className: cn("relative", className),
439
+ ...props,
440
+ children: [
441
+ /* @__PURE__ */ jsx(
442
+ ScrollArea$1.Viewport,
443
+ {
444
+ "data-slot": "scroll-area-viewport",
445
+ className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",
446
+ children
447
+ }
448
+ ),
449
+ /* @__PURE__ */ jsx(ScrollBar, {}),
450
+ /* @__PURE__ */ jsx(ScrollArea$1.Corner, {})
451
+ ]
452
+ }
453
+ );
150
454
  }
151
- function DataTable({
152
- columns,
153
- data,
154
- pageSize = 10,
155
- getRowId,
156
- empty,
157
- className
455
+ function ScrollBar({
456
+ className,
457
+ orientation = "vertical",
458
+ ...props
158
459
  }) {
159
- const [sort, setSort] = useState(null);
160
- const [page, setPage] = useState(0);
161
- const valueOf = (row, col) => {
162
- if (col.accessor) return col.accessor(row);
163
- const v = row[col.key];
164
- return typeof v === "number" ? v : String(v ?? "");
165
- };
166
- const sorted = useMemo(() => {
167
- if (!sort) return data;
168
- const col = columns.find((c) => c.key === sort.key);
169
- if (!col) return data;
170
- const copy = [...data];
171
- const rank = (v) => typeof v === "number" ? 0 : 1;
172
- copy.sort((a, b) => {
173
- const av = valueOf(a, col);
174
- const bv = valueOf(b, col);
175
- let cmp = rank(av) - rank(bv);
176
- if (cmp === 0) {
177
- cmp = typeof av === "number" && typeof bv === "number" ? av - bv : String(av).localeCompare(String(bv));
178
- }
179
- return sort.dir === "asc" ? cmp : -cmp;
180
- });
181
- return copy;
182
- }, [data, sort, columns]);
183
- const pageCount = Math.max(1, Math.ceil(sorted.length / pageSize));
184
- const clampedPage = Math.min(page, pageCount - 1);
185
- const rows = sorted.slice(clampedPage * pageSize, clampedPage * pageSize + pageSize);
186
- const toggleSort = (key) => {
187
- setPage(0);
188
- setSort(
189
- (prev) => prev?.key === key ? prev.dir === "asc" ? { key, dir: "desc" } : null : { key, dir: "asc" }
190
- );
191
- };
192
- const alignClass = (a) => a === "right" ? "text-right" : a === "center" ? "text-center" : "text-left";
193
- if (data.length === 0 && empty) {
194
- return /* @__PURE__ */ jsx("div", { className: cn("rounded-xl border border-border bg-card", className), children: empty });
195
- }
196
- return /* @__PURE__ */ jsxs("div", { className: cn("rounded-xl border border-border bg-card", className), children: [
197
- /* @__PURE__ */ jsxs(Table, { children: [
198
- /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, { children: columns.map((col) => /* @__PURE__ */ jsx(TableHead, { className: alignClass(col.align), children: col.sortable ? /* @__PURE__ */ jsxs(
199
- "button",
460
+ return /* @__PURE__ */ jsx(
461
+ ScrollArea$1.Scrollbar,
462
+ {
463
+ "data-slot": "scroll-area-scrollbar",
464
+ "data-orientation": orientation,
465
+ orientation,
466
+ className: cn(
467
+ "flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",
468
+ className
469
+ ),
470
+ ...props,
471
+ children: /* @__PURE__ */ jsx(
472
+ ScrollArea$1.Thumb,
200
473
  {
201
- type: "button",
202
- onClick: () => toggleSort(col.key),
203
- className: "inline-flex items-center gap-1 hover:text-foreground",
204
- children: [
205
- col.header,
206
- /* @__PURE__ */ jsx("span", { className: "text-[10px]", children: sort?.key === col.key ? sort.dir === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
207
- ]
474
+ "data-slot": "scroll-area-thumb",
475
+ className: "relative flex-1 rounded-full bg-border"
208
476
  }
209
- ) : col.header }, col.key)) }) }),
210
- /* @__PURE__ */ jsx(TableBody, { children: rows.map((row, i) => /* @__PURE__ */ jsx(TableRow, { children: columns.map((col) => /* @__PURE__ */ jsx(TableCell, { className: alignClass(col.align), children: col.render ? col.render(row) : String(row[col.key] ?? "") }, col.key)) }, getRowId ? getRowId(row, i) : i)) })
211
- ] }),
212
- pageCount > 1 ? /* @__PURE__ */ jsx(
213
- Pagination,
214
- {
215
- page: clampedPage,
216
- pageCount,
217
- total: sorted.length,
218
- onPageChange: setPage
219
- }
220
- ) : null
221
- ] });
477
+ )
478
+ }
479
+ );
480
+ }
481
+ function Slider({
482
+ className,
483
+ defaultValue,
484
+ value,
485
+ min = 0,
486
+ max = 100,
487
+ ...props
488
+ }) {
489
+ const _values = Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max];
490
+ return /* @__PURE__ */ jsx(
491
+ Slider$1.Root,
492
+ {
493
+ className: cn("data-horizontal:w-full data-vertical:h-full", className),
494
+ "data-slot": "slider",
495
+ defaultValue,
496
+ value,
497
+ min,
498
+ max,
499
+ thumbAlignment: "edge",
500
+ ...props,
501
+ children: /* @__PURE__ */ jsxs(Slider$1.Control, { className: "relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col", children: [
502
+ /* @__PURE__ */ jsx(
503
+ Slider$1.Track,
504
+ {
505
+ "data-slot": "slider-track",
506
+ className: "relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",
507
+ children: /* @__PURE__ */ jsx(
508
+ Slider$1.Indicator,
509
+ {
510
+ "data-slot": "slider-range",
511
+ className: "bg-primary select-none data-horizontal:h-full data-vertical:w-full"
512
+ }
513
+ )
514
+ }
515
+ ),
516
+ Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx(
517
+ Slider$1.Thumb,
518
+ {
519
+ "data-slot": "slider-thumb",
520
+ className: "relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50"
521
+ },
522
+ index
523
+ ))
524
+ ] })
525
+ }
526
+ );
527
+ }
528
+ function Spinner({ className, ...props }) {
529
+ return /* @__PURE__ */ jsx(Loader2Icon, { "data-slot": "spinner", role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props });
222
530
  }
223
- function Pagination({ page, pageCount, total, onPageChange }) {
224
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 border-t border-border px-3 py-2 text-sm", children: [
225
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
226
- total != null ? `${total} rows \xB7 ` : "",
227
- "Page ",
228
- page + 1,
229
- " of ",
230
- pageCount
231
- ] }),
232
- /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
233
- /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", disabled: page === 0, onClick: () => onPageChange(page - 1), children: "Previous" }),
234
- /* @__PURE__ */ jsx(
235
- Button,
531
+ function Switch({
532
+ className,
533
+ size = "default",
534
+ ...props
535
+ }) {
536
+ return /* @__PURE__ */ jsx(
537
+ Switch$1.Root,
538
+ {
539
+ "data-slot": "switch",
540
+ "data-size": size,
541
+ className: cn(
542
+ "peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",
543
+ className
544
+ ),
545
+ ...props,
546
+ children: /* @__PURE__ */ jsx(
547
+ Switch$1.Thumb,
236
548
  {
237
- size: "sm",
238
- variant: "outline",
239
- disabled: page >= pageCount - 1,
240
- onClick: () => onPageChange(page + 1),
241
- children: "Next"
549
+ "data-slot": "switch-thumb",
550
+ className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
242
551
  }
243
552
  )
244
- ] })
245
- ] });
246
- }
247
- function MetricCard({ label, value, delta, deltaLabel, icon, className }) {
248
- const positive = (delta ?? 0) >= 0;
249
- return /* @__PURE__ */ jsxs(Card, { className: cn("p-5", className), children: [
250
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
251
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-muted-foreground", children: label }),
252
- icon ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: icon }) : null
253
- ] }),
254
- /* @__PURE__ */ jsx("p", { className: "mt-2 text-3xl font-semibold tracking-tight", children: value }),
255
- delta != null ? /* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs", children: [
256
- /* @__PURE__ */ jsxs("span", { className: cn("font-medium", positive ? "text-[var(--chart-2)]" : "text-destructive"), children: [
257
- positive ? "\u25B2" : "\u25BC",
258
- " ",
259
- Math.abs(delta),
260
- "%"
261
- ] }),
262
- " ",
263
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: deltaLabel ?? "vs. previous" })
264
- ] }) : null
265
- ] });
553
+ }
554
+ );
266
555
  }
267
- function FilterBar({ className, children, ...props }) {
556
+ function Tabs({
557
+ className,
558
+ orientation = "horizontal",
559
+ ...props
560
+ }) {
268
561
  return /* @__PURE__ */ jsx(
269
- "div",
562
+ Tabs$1.Root,
270
563
  {
564
+ "data-slot": "tabs",
565
+ "data-orientation": orientation,
271
566
  className: cn(
272
- "flex flex-wrap items-end gap-3 rounded-xl border border-border bg-card p-4",
567
+ "group/tabs flex gap-2 data-horizontal:flex-col",
273
568
  className
274
569
  ),
275
- ...props,
276
- children
570
+ ...props
277
571
  }
278
572
  );
279
573
  }
280
- function FilterField({ label, children }) {
281
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
282
- /* @__PURE__ */ jsx("label", { className: "text-xs font-medium text-muted-foreground", children: label }),
283
- children
284
- ] });
574
+ var tabsListVariants = cva(
575
+ "group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",
576
+ {
577
+ variants: {
578
+ variant: {
579
+ default: "bg-muted",
580
+ line: "gap-1 bg-transparent"
581
+ }
582
+ },
583
+ defaultVariants: {
584
+ variant: "default"
585
+ }
586
+ }
587
+ );
588
+ function TabsList({
589
+ className,
590
+ variant = "default",
591
+ ...props
592
+ }) {
593
+ return /* @__PURE__ */ jsx(
594
+ Tabs$1.List,
595
+ {
596
+ "data-slot": "tabs-list",
597
+ "data-variant": variant,
598
+ className: cn(tabsListVariants({ variant }), className),
599
+ ...props
600
+ }
601
+ );
285
602
  }
286
- function DashboardShell({ title, description, actions, nav, children, className }) {
287
- return /* @__PURE__ */ jsxs("div", { className: cn("min-h-screen bg-background text-foreground", className), children: [
288
- /* @__PURE__ */ jsxs("header", { className: "sticky top-0 z-10 border-b border-border bg-background/80 backdrop-blur", children: [
289
- /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-3 px-6 py-4", children: [
290
- /* @__PURE__ */ jsxs("div", { children: [
291
- title ? /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold tracking-tight", children: title }) : null,
292
- description ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null
293
- ] }),
294
- actions ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: actions }) : null
295
- ] }),
296
- nav ? /* @__PURE__ */ jsx("nav", { className: "mx-auto max-w-7xl px-6 pb-2", children: nav }) : null
297
- ] }),
298
- /* @__PURE__ */ jsx("main", { className: "mx-auto max-w-7xl px-6 py-6", children })
299
- ] });
603
+ function TabsTrigger({ className, ...props }) {
604
+ return /* @__PURE__ */ jsx(
605
+ Tabs$1.Tab,
606
+ {
607
+ "data-slot": "tabs-trigger",
608
+ className: cn(
609
+ "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
610
+ "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
611
+ "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
612
+ "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
613
+ className
614
+ ),
615
+ ...props
616
+ }
617
+ );
618
+ }
619
+ function TabsContent({ className, ...props }) {
620
+ return /* @__PURE__ */ jsx(
621
+ Tabs$1.Panel,
622
+ {
623
+ "data-slot": "tabs-content",
624
+ className: cn("flex-1 text-sm outline-none", className),
625
+ ...props
626
+ }
627
+ );
300
628
  }
301
629
  function Loading({ label = "Loading\u2026", className }) {
302
630
  return /* @__PURE__ */ jsx("div", { className: cn("flex min-h-[30vh] items-center justify-center", className), role: "status", "aria-live": "polite", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-sm text-muted-foreground", children: [
@@ -337,280 +665,7 @@ function ErrorState({
337
665
  }
338
666
  );
339
667
  }
340
- var FIELD2 = "h-9 rounded-md border border-input bg-background px-3 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
341
- function DatePicker({ value, onChange, min, max, className, id }) {
342
- return /* @__PURE__ */ jsx(
343
- "input",
344
- {
345
- id,
346
- type: "date",
347
- value: value ?? "",
348
- min,
349
- max,
350
- onChange: (e) => onChange?.(e.target.value),
351
- className: cn(FIELD2, className)
352
- }
353
- );
354
- }
355
- function DateRangePicker({ value, onChange, className }) {
356
- const from = value?.from ?? "";
357
- const to = value?.to ?? "";
358
- return /* @__PURE__ */ jsxs("div", { className: cn("inline-flex items-center gap-2", className), children: [
359
- /* @__PURE__ */ jsx(
360
- "input",
361
- {
362
- type: "date",
363
- value: from,
364
- max: to || void 0,
365
- onChange: (e) => onChange?.({ from: e.target.value, to }),
366
- className: FIELD2,
367
- "aria-label": "From date"
368
- }
369
- ),
370
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2013" }),
371
- /* @__PURE__ */ jsx(
372
- "input",
373
- {
374
- type: "date",
375
- value: to,
376
- min: from || void 0,
377
- onChange: (e) => onChange?.({ from, to: e.target.value }),
378
- className: FIELD2,
379
- "aria-label": "To date"
380
- }
381
- )
382
- ] });
383
- }
384
- var CHART_COLORS = [
385
- "var(--chart-1)",
386
- "var(--chart-2)",
387
- "var(--chart-3)",
388
- "var(--chart-4)",
389
- "var(--chart-5)"
390
- ];
391
- function ChartContainer({
392
- children,
393
- className,
394
- height = 260
395
- }) {
396
- return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), style: { height }, children });
397
- }
398
- function ChartLegend({ series }) {
399
- return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-4 pt-3 text-xs text-muted-foreground", children: series.map((s, i) => /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
400
- /* @__PURE__ */ jsx(
401
- "span",
402
- {
403
- className: "h-2.5 w-2.5 rounded-[3px]",
404
- style: { backgroundColor: s.color ?? CHART_COLORS[i % CHART_COLORS.length] }
405
- }
406
- ),
407
- s.label ?? s.key
408
- ] }, s.key)) });
409
- }
410
- function ChartTooltip({ children, className }) {
411
- return /* @__PURE__ */ jsx(
412
- "div",
413
- {
414
- className: cn(
415
- "pointer-events-none rounded-md border border-border bg-popover px-2.5 py-1.5 text-xs shadow-md",
416
- className
417
- ),
418
- children
419
- }
420
- );
421
- }
422
- var PAD = { top: 8, right: 8, bottom: 22, left: 32 };
423
- function useGeometry(data, series) {
424
- let max = 0;
425
- for (const row of data) {
426
- for (const s of series) {
427
- const v = Number(row[s.key] ?? 0);
428
- if (v > max) max = v;
429
- }
430
- }
431
- return { max: max === 0 ? 1 : max };
432
- }
433
- function BarChart({
434
- data,
435
- categoryKey,
436
- series,
437
- height = 260,
438
- className
439
- }) {
440
- const width = 640;
441
- const { max } = useGeometry(data, series);
442
- const chartW = width - PAD.left - PAD.right;
443
- const chartH = height - PAD.top - PAD.bottom;
444
- const groupW = chartW / Math.max(1, data.length);
445
- const barW = Math.max(2, groupW * 0.7 / series.length);
446
- return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
447
- /* @__PURE__ */ jsxs("svg", { viewBox: `0 0 ${width} ${height}`, className: "w-full", style: { height }, role: "img", children: [
448
- [0, 0.25, 0.5, 0.75, 1].map((t) => {
449
- const y = PAD.top + chartH * (1 - t);
450
- return /* @__PURE__ */ jsxs("g", { children: [
451
- /* @__PURE__ */ jsx("line", { x1: PAD.left, x2: width - PAD.right, y1: y, y2: y, stroke: "var(--border)", strokeWidth: 1 }),
452
- /* @__PURE__ */ jsx("text", { x: PAD.left - 6, y: y + 3, textAnchor: "end", fontSize: 9, fill: "var(--muted-foreground)", children: Math.round(max * t) })
453
- ] }, t);
454
- }),
455
- data.map((row, i) => {
456
- const gx = PAD.left + groupW * i + (groupW - barW * series.length) / 2;
457
- return /* @__PURE__ */ jsxs("g", { children: [
458
- series.map((s, si) => {
459
- const v = Number(row[s.key] ?? 0);
460
- const h = v / max * chartH;
461
- return /* @__PURE__ */ jsx(
462
- "rect",
463
- {
464
- x: gx + si * barW,
465
- y: PAD.top + chartH - h,
466
- width: barW - 1,
467
- height: Math.max(0, h),
468
- rx: 2,
469
- fill: s.color ?? CHART_COLORS[si % CHART_COLORS.length],
470
- children: /* @__PURE__ */ jsx("title", { children: `${String(row[categoryKey])} \xB7 ${s.label ?? s.key}: ${v}` })
471
- },
472
- s.key
473
- );
474
- }),
475
- /* @__PURE__ */ jsx(
476
- "text",
477
- {
478
- x: PAD.left + groupW * i + groupW / 2,
479
- y: height - 6,
480
- textAnchor: "middle",
481
- fontSize: 9,
482
- fill: "var(--muted-foreground)",
483
- children: String(row[categoryKey])
484
- }
485
- )
486
- ] }, i);
487
- })
488
- ] }),
489
- /* @__PURE__ */ jsx(ChartLegend, { series })
490
- ] });
491
- }
492
- function LineChart({
493
- data,
494
- categoryKey,
495
- series,
496
- height = 260,
497
- className
498
- }) {
499
- const width = 640;
500
- const { max } = useGeometry(data, series);
501
- const chartW = width - PAD.left - PAD.right;
502
- const chartH = height - PAD.top - PAD.bottom;
503
- const stepX = chartW / Math.max(1, data.length - 1);
504
- const pointFor = (v, i) => ({
505
- x: PAD.left + stepX * i,
506
- y: PAD.top + chartH - v / max * chartH
507
- });
508
- return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
509
- /* @__PURE__ */ jsxs("svg", { viewBox: `0 0 ${width} ${height}`, className: "w-full", style: { height }, role: "img", children: [
510
- [0, 0.5, 1].map((t) => {
511
- const y = PAD.top + chartH * (1 - t);
512
- return /* @__PURE__ */ jsx("line", { x1: PAD.left, x2: width - PAD.right, y1: y, y2: y, stroke: "var(--border)", strokeWidth: 1 }, t);
513
- }),
514
- series.map((s, si) => {
515
- const pts = data.map((row, i) => pointFor(Number(row[s.key] ?? 0), i));
516
- const d = pts.map((p, i) => `${i === 0 ? "M" : "L"}${p.x},${p.y}`).join(" ");
517
- const color = s.color ?? CHART_COLORS[si % CHART_COLORS.length];
518
- return /* @__PURE__ */ jsxs("g", { children: [
519
- /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: color, strokeWidth: 2 }),
520
- pts.map((p, i) => /* @__PURE__ */ jsx("circle", { cx: p.x, cy: p.y, r: 2.5, fill: color }, i))
521
- ] }, s.key);
522
- }),
523
- data.map((row, i) => /* @__PURE__ */ jsx(
524
- "text",
525
- {
526
- x: PAD.left + stepX * i,
527
- y: height - 6,
528
- textAnchor: "middle",
529
- fontSize: 9,
530
- fill: "var(--muted-foreground)",
531
- children: String(row[categoryKey])
532
- },
533
- i
534
- ))
535
- ] }),
536
- /* @__PURE__ */ jsx(ChartLegend, { series })
537
- ] });
538
- }
539
- function Dialog({ open, onClose, title, description, children, footer, className }) {
540
- useEffect(() => {
541
- if (!open) return;
542
- const onKey = (e) => {
543
- if (e.key === "Escape") onClose();
544
- };
545
- document.addEventListener("keydown", onKey);
546
- return () => document.removeEventListener("keydown", onKey);
547
- }, [open, onClose]);
548
- if (!open) return null;
549
- return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
550
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-black/50", onClick: onClose, "aria-hidden": true }),
551
- /* @__PURE__ */ jsxs(
552
- "div",
553
- {
554
- role: "dialog",
555
- "aria-modal": "true",
556
- className: cn(
557
- "relative z-10 w-full max-w-lg rounded-xl border border-border bg-card p-6 shadow-lg",
558
- className
559
- ),
560
- children: [
561
- title ? /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", children: title }) : null,
562
- description ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: description }) : null,
563
- children ? /* @__PURE__ */ jsx("div", { className: "mt-4", children }) : null,
564
- footer ? /* @__PURE__ */ jsx("div", { className: "mt-6 flex justify-end gap-2", children: footer }) : null
565
- ]
566
- }
567
- )
568
- ] });
569
- }
570
- function DropdownMenu({ trigger, items, align = "start", className }) {
571
- const [open, setOpen] = useState(false);
572
- const ref = useRef(null);
573
- useEffect(() => {
574
- if (!open) return;
575
- const onDoc = (e) => {
576
- if (ref.current && !ref.current.contains(e.target)) setOpen(false);
577
- };
578
- document.addEventListener("mousedown", onDoc);
579
- return () => document.removeEventListener("mousedown", onDoc);
580
- }, [open]);
581
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("relative inline-block", className), children: [
582
- /* @__PURE__ */ jsx("span", { onClick: () => setOpen((v) => !v), children: trigger }),
583
- open ? /* @__PURE__ */ jsx(
584
- "div",
585
- {
586
- role: "menu",
587
- className: cn(
588
- "absolute z-50 mt-1 min-w-[10rem] rounded-md border border-border bg-popover p-1 shadow-md",
589
- align === "end" ? "right-0" : "left-0"
590
- ),
591
- children: items.map((item, i) => /* @__PURE__ */ jsx(
592
- "button",
593
- {
594
- type: "button",
595
- role: "menuitem",
596
- disabled: item.disabled,
597
- onClick: () => {
598
- item.onSelect?.();
599
- setOpen(false);
600
- },
601
- className: cn(
602
- "flex w-full items-center rounded-sm px-2 py-1.5 text-left text-sm",
603
- "hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50"
604
- ),
605
- children: item.label
606
- },
607
- i
608
- ))
609
- }
610
- ) : null
611
- ] });
612
- }
613
668
 
614
- export { BarChart, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartTooltip, Checkbox, DashboardShell, DataTable, DatePicker, DateRangePicker, Dialog, DropdownMenu, Empty, ErrorState, FilterBar, FilterField, Input, LineChart, Loading, MetricCard, Pagination, Select, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, cn };
669
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Empty, ErrorState, Label, Loading, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, ScrollArea, ScrollBar, Slider, Spinner, Switch, Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants };
615
670
  //# sourceMappingURL=index.js.map
616
671
  //# sourceMappingURL=index.js.map