@hilum/ui 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.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +3 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +992 -0
- package/dist/index.js +4433 -0
- package/dist/index.js.map +1 -0
- package/dist/tokens.css +265 -0
- package/dist/tokens.d.ts +189 -0
- package/dist/tokens.js +193 -0
- package/dist/tokens.js.map +1 -0
- package/package.json +80 -0
- package/src/components/__tests__/data.test.tsx +180 -0
- package/src/components/__tests__/disclosure.test.tsx +198 -0
- package/src/components/__tests__/display.test.tsx +262 -0
- package/src/components/__tests__/feedback.test.tsx +138 -0
- package/src/components/__tests__/form.test.tsx +297 -0
- package/src/components/__tests__/layout.test.tsx +388 -0
- package/src/components/__tests__/overlay.test.tsx +90 -0
- package/src/components/__tests__/primitives.test.tsx +248 -0
- package/src/components/accordion.tsx +68 -0
- package/src/components/action-panel.tsx +112 -0
- package/src/components/activity-feed.tsx +69 -0
- package/src/components/alert-dialog.tsx +132 -0
- package/src/components/alert.tsx +44 -0
- package/src/components/aspect-ratio.tsx +19 -0
- package/src/components/avatar-stack.tsx +70 -0
- package/src/components/avatar.tsx +103 -0
- package/src/components/badge.tsx +33 -0
- package/src/components/breadcrumb.tsx +76 -0
- package/src/components/button-group.tsx +45 -0
- package/src/components/button.tsx +60 -0
- package/src/components/calendar.tsx +61 -0
- package/src/components/card-heading.tsx +60 -0
- package/src/components/card.tsx +120 -0
- package/src/components/carousel.tsx +222 -0
- package/src/components/chart.tsx +77 -0
- package/src/components/checkbox.tsx +35 -0
- package/src/components/collapsible.tsx +9 -0
- package/src/components/color-input.tsx +90 -0
- package/src/components/color-picker.tsx +111 -0
- package/src/components/combobox.tsx +207 -0
- package/src/components/command-palette.tsx +137 -0
- package/src/components/command.tsx +248 -0
- package/src/components/context-menu.tsx +201 -0
- package/src/components/data-table.tsx +151 -0
- package/src/components/date-picker.tsx +56 -0
- package/src/components/description-list.tsx +70 -0
- package/src/components/dialog.tsx +97 -0
- package/src/components/drawer.tsx +90 -0
- package/src/components/dropdown-menu.tsx +202 -0
- package/src/components/empty-state.tsx +43 -0
- package/src/components/field.tsx +45 -0
- package/src/components/grid-list.tsx +159 -0
- package/src/components/hover-card.tsx +34 -0
- package/src/components/input-group.tsx +134 -0
- package/src/components/input-number.tsx +142 -0
- package/src/components/input-otp.tsx +68 -0
- package/src/components/input.tsx +23 -0
- package/src/components/kbd.tsx +18 -0
- package/src/components/label.tsx +23 -0
- package/src/components/media-object.tsx +49 -0
- package/src/components/menubar.tsx +235 -0
- package/src/components/native-select.tsx +44 -0
- package/src/components/navigation-menu.tsx +158 -0
- package/src/components/notification.tsx +109 -0
- package/src/components/page-heading.tsx +125 -0
- package/src/components/pagination.tsx +89 -0
- package/src/components/popover.tsx +35 -0
- package/src/components/progress.tsx +23 -0
- package/src/components/property-row.tsx +56 -0
- package/src/components/radio-card.tsx +105 -0
- package/src/components/radio-group.tsx +38 -0
- package/src/components/resizable.tsx +74 -0
- package/src/components/scroll-area.tsx +42 -0
- package/src/components/section-heading.tsx +64 -0
- package/src/components/select.tsx +130 -0
- package/src/components/separator.tsx +25 -0
- package/src/components/sheet.tsx +117 -0
- package/src/components/sidebar.tsx +636 -0
- package/src/components/skeleton.tsx +14 -0
- package/src/components/slider.tsx +24 -0
- package/src/components/sonner.tsx +34 -0
- package/src/components/spinner.tsx +37 -0
- package/src/components/stacked-list.tsx +64 -0
- package/src/components/stat-card.tsx +54 -0
- package/src/components/steps.tsx +179 -0
- package/src/components/switch.tsx +33 -0
- package/src/components/table.tsx +101 -0
- package/src/components/tabs.tsx +55 -0
- package/src/components/textarea.tsx +21 -0
- package/src/components/toggle-group.tsx +49 -0
- package/src/components/toggle.tsx +66 -0
- package/src/components/tooltip.tsx +43 -0
- package/src/icons.ts +158 -0
- package/src/index.ts +84 -0
- package/src/lib/utils.ts +6 -0
- package/src/tokens/tokens.ts +194 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4433 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import * as React15 from 'react';
|
|
4
|
+
import { Accordion, AlertDialog, AspectRatio, Avatar as Avatar$1, Checkbox, Collapsible, Dialog, ContextMenu, Popover, DropdownMenu, Label as Label$1, HoverCard, Menubar, NavigationMenu, Progress, RadioGroup, ScrollArea, Select, Separator, Tooltip, Slider, Switch, Tabs, Toggle, ToggleGroup, Slot } from 'radix-ui';
|
|
5
|
+
import { ChevronDown, Minus, Check, X, Search, Circle, ChevronRight, AlertCircle, ChevronUp, MoreHorizontal, ChevronLeft, ArrowLeft, ArrowRight, ChevronsUpDown, CalendarIcon, Info, AlertTriangle, CheckCircle, GripVertical, PanelLeft, TrendingDown, TrendingUp } from 'lucide-react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
import { cva } from 'class-variance-authority';
|
|
8
|
+
import { DayPicker } from 'react-day-picker';
|
|
9
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
10
|
+
import { ResponsiveContainer } from 'recharts';
|
|
11
|
+
export { Area, AreaChart, Bar, BarChart, CartesianGrid, Cell, Legend, Line, LineChart, Pie, PieChart, Tooltip as RechartsTooltip, XAxis, YAxis } from 'recharts';
|
|
12
|
+
import { useReactTable, getPaginationRowModel, getFilteredRowModel, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
13
|
+
export { createColumnHelper } from '@tanstack/react-table';
|
|
14
|
+
import { Drawer } from 'vaul';
|
|
15
|
+
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
16
|
+
import { Panel, Group, Separator as Separator$1 } from 'react-resizable-panels';
|
|
17
|
+
import { Toaster as Toaster$1 } from 'sonner';
|
|
18
|
+
|
|
19
|
+
// src/lib/utils.ts
|
|
20
|
+
function cn(...inputs) {
|
|
21
|
+
return twMerge(clsx(inputs));
|
|
22
|
+
}
|
|
23
|
+
var AccordionRoot = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Accordion.Root, { ref, className: cn("divide-y divide-taupe-100", className), ...props }));
|
|
24
|
+
AccordionRoot.displayName = "Accordion";
|
|
25
|
+
var AccordionItem = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Accordion.Item, { ref, className: cn("", className), ...props }));
|
|
26
|
+
AccordionItem.displayName = "AccordionItem";
|
|
27
|
+
var AccordionTrigger = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(Accordion.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
28
|
+
Accordion.Trigger,
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
className: cn(
|
|
32
|
+
"flex w-full items-center justify-between py-4",
|
|
33
|
+
"body font-medium text-taupe-900 transition-colors hover:text-taupe-700",
|
|
34
|
+
"[&[data-state=open]>svg]:rotate-180",
|
|
35
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-taupe-900/15",
|
|
36
|
+
className
|
|
37
|
+
),
|
|
38
|
+
...props,
|
|
39
|
+
children: [
|
|
40
|
+
children,
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
ChevronDown,
|
|
43
|
+
{
|
|
44
|
+
size: 16,
|
|
45
|
+
className: "text-taupe-400 transition-transform duration-200 shrink-0"
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
) }));
|
|
51
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
52
|
+
var AccordionContent = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
53
|
+
Accordion.Content,
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
className: cn(
|
|
57
|
+
"overflow-hidden body text-taupe-500",
|
|
58
|
+
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
59
|
+
className
|
|
60
|
+
),
|
|
61
|
+
...props,
|
|
62
|
+
children: /* @__PURE__ */ jsx("div", { className: "pb-4", children })
|
|
63
|
+
}
|
|
64
|
+
));
|
|
65
|
+
AccordionContent.displayName = "AccordionContent";
|
|
66
|
+
var buttonVariants = cva(
|
|
67
|
+
[
|
|
68
|
+
"inline-flex shrink-0 items-center justify-center gap-2",
|
|
69
|
+
"body font-medium whitespace-nowrap",
|
|
70
|
+
"transition-all duration-150 outline-none",
|
|
71
|
+
"focus-visible:ring-2 focus-visible:ring-brand-primary/30 focus-visible:ring-offset-1",
|
|
72
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
73
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
74
|
+
],
|
|
75
|
+
{
|
|
76
|
+
variants: {
|
|
77
|
+
variant: {
|
|
78
|
+
default: "bg-brand-primary text-white hover:bg-brand-primary/90 active:bg-brand-primary/80",
|
|
79
|
+
destructive: "bg-red-600 text-white hover:bg-red-700 active:bg-red-800",
|
|
80
|
+
outline: "bg-white text-taupe-700 shadow-natural hover:bg-taupe-50 rounded-xl",
|
|
81
|
+
secondary: "bg-taupe-100 text-taupe-700 hover:bg-taupe-200",
|
|
82
|
+
brand: "bg-brand-secondary text-taupe-900 hover:bg-brand-secondary/90 active:bg-brand-secondary/80",
|
|
83
|
+
ghost: "text-taupe-600 hover:bg-taupe-100 hover:text-taupe-900",
|
|
84
|
+
link: "text-taupe-900 underline-offset-4 hover:underline"
|
|
85
|
+
},
|
|
86
|
+
size: {
|
|
87
|
+
default: "h-9 px-4 py-2 rounded-md",
|
|
88
|
+
xs: "h-6 gap-1 px-2 caption rounded-md",
|
|
89
|
+
sm: "h-8 gap-1.5 px-3 rounded-md",
|
|
90
|
+
lg: "h-10 px-6 rounded-md",
|
|
91
|
+
icon: "size-9 rounded-md",
|
|
92
|
+
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
93
|
+
"icon-sm": "size-8 rounded-md",
|
|
94
|
+
"icon-lg": "size-10 rounded-md"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
defaultVariants: {
|
|
98
|
+
variant: "default",
|
|
99
|
+
size: "default"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
function Button({ className, variant, size, asChild = false, ...props }) {
|
|
104
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
105
|
+
return /* @__PURE__ */ jsx(
|
|
106
|
+
Comp,
|
|
107
|
+
{
|
|
108
|
+
"data-slot": "button",
|
|
109
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
110
|
+
...props
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function ActionPanel({
|
|
115
|
+
title,
|
|
116
|
+
description,
|
|
117
|
+
action,
|
|
118
|
+
actions,
|
|
119
|
+
link,
|
|
120
|
+
variant = "default",
|
|
121
|
+
layout = "stacked",
|
|
122
|
+
children,
|
|
123
|
+
className
|
|
124
|
+
}) {
|
|
125
|
+
const allActions = actions ?? (action ? [action] : []);
|
|
126
|
+
const renderActions = () => {
|
|
127
|
+
if (allActions.length === 0 && !link) return null;
|
|
128
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
129
|
+
link && (link.href ? /* @__PURE__ */ jsxs(
|
|
130
|
+
"a",
|
|
131
|
+
{
|
|
132
|
+
href: link.href,
|
|
133
|
+
className: "body font-medium text-taupe-600 hover:text-taupe-900 transition-colors inline-flex items-center gap-1",
|
|
134
|
+
children: [
|
|
135
|
+
link.label,
|
|
136
|
+
" ",
|
|
137
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2192" })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
) : /* @__PURE__ */ jsxs(
|
|
141
|
+
"button",
|
|
142
|
+
{
|
|
143
|
+
type: "button",
|
|
144
|
+
onClick: link.onClick,
|
|
145
|
+
className: "body font-medium text-taupe-600 hover:text-taupe-900 transition-colors inline-flex items-center gap-1",
|
|
146
|
+
children: [
|
|
147
|
+
link.label,
|
|
148
|
+
" ",
|
|
149
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2192" })
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
)),
|
|
153
|
+
allActions.map(
|
|
154
|
+
(a, i) => a.href ? /* @__PURE__ */ jsx(Button, { size: "sm", variant: a.variant ?? "default", asChild: true, children: /* @__PURE__ */ jsx("a", { href: a.href, children: a.label }) }, i) : /* @__PURE__ */ jsx(Button, { size: "sm", variant: a.variant ?? "default", onClick: a.onClick, children: a.label }, i)
|
|
155
|
+
)
|
|
156
|
+
] });
|
|
157
|
+
};
|
|
158
|
+
return /* @__PURE__ */ jsxs(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
className: cn(
|
|
162
|
+
"rounded-xl border px-5 py-5",
|
|
163
|
+
variant === "muted" ? "border-taupe-100 bg-taupe-50" : "border-taupe-100 bg-white shadow-natural",
|
|
164
|
+
layout === "inline" && "flex items-center justify-between gap-6",
|
|
165
|
+
className
|
|
166
|
+
),
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ jsxs("div", { className: cn("min-w-0", layout === "inline" ? "flex-1" : ""), children: [
|
|
169
|
+
/* @__PURE__ */ jsx("p", { className: "body font-semibold text-taupe-900", children: title }),
|
|
170
|
+
description && /* @__PURE__ */ jsx("p", { className: cn("body text-taupe-400", layout === "stacked" ? "mt-1" : ""), children: description }),
|
|
171
|
+
children && layout === "stacked" && /* @__PURE__ */ jsx("div", { className: "mt-4", children })
|
|
172
|
+
] }),
|
|
173
|
+
layout === "stacked" ? (allActions.length > 0 || link) && /* @__PURE__ */ jsx("div", { className: "mt-4", children: renderActions() }) : /* @__PURE__ */ jsxs("div", { className: "shrink-0 flex items-center gap-3", children: [
|
|
174
|
+
children,
|
|
175
|
+
renderActions()
|
|
176
|
+
] })
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
function ActivityFeed({ events, className }) {
|
|
182
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flow-root", className), children: /* @__PURE__ */ jsx("ul", { role: "list", className: "-mb-8", children: events.map((event, i) => {
|
|
183
|
+
const isLast = i === events.length - 1;
|
|
184
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("div", { className: "relative pb-8", children: [
|
|
185
|
+
!isLast && /* @__PURE__ */ jsx(
|
|
186
|
+
"span",
|
|
187
|
+
{
|
|
188
|
+
className: "absolute top-4 left-4 -ml-px h-full w-0.5 bg-taupe-100",
|
|
189
|
+
"aria-hidden": "true"
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex gap-3", children: [
|
|
193
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
194
|
+
"span",
|
|
195
|
+
{
|
|
196
|
+
className: cn(
|
|
197
|
+
"flex size-8 items-center justify-center rounded-full ring-8 ring-white",
|
|
198
|
+
event.iconBgClass ?? "bg-taupe-100 text-taupe-500"
|
|
199
|
+
),
|
|
200
|
+
children: event.icon
|
|
201
|
+
}
|
|
202
|
+
) }),
|
|
203
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-baseline justify-between gap-4 pt-1", children: [
|
|
204
|
+
/* @__PURE__ */ jsx("div", { className: "body text-taupe-600", children: event.content }),
|
|
205
|
+
event.date && /* @__PURE__ */ jsx(
|
|
206
|
+
"time",
|
|
207
|
+
{
|
|
208
|
+
dateTime: event.datetime ?? event.date,
|
|
209
|
+
className: "caption whitespace-nowrap text-taupe-400",
|
|
210
|
+
children: event.date
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
] })
|
|
214
|
+
] })
|
|
215
|
+
] }) }, event.id ?? i);
|
|
216
|
+
}) }) });
|
|
217
|
+
}
|
|
218
|
+
var AlertDialogRoot = AlertDialog.Root;
|
|
219
|
+
var AlertDialogTrigger = AlertDialog.Trigger;
|
|
220
|
+
var AlertDialogPortal = AlertDialog.Portal;
|
|
221
|
+
var AlertDialogOverlay = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
222
|
+
AlertDialog.Overlay,
|
|
223
|
+
{
|
|
224
|
+
ref,
|
|
225
|
+
className: cn(
|
|
226
|
+
"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm",
|
|
227
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
228
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
229
|
+
className
|
|
230
|
+
),
|
|
231
|
+
...props
|
|
232
|
+
}
|
|
233
|
+
));
|
|
234
|
+
AlertDialogOverlay.displayName = "AlertDialogOverlay";
|
|
235
|
+
var AlertDialogContent = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [
|
|
236
|
+
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
237
|
+
/* @__PURE__ */ jsx(
|
|
238
|
+
AlertDialog.Content,
|
|
239
|
+
{
|
|
240
|
+
ref,
|
|
241
|
+
className: cn(
|
|
242
|
+
"fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%]",
|
|
243
|
+
"w-full max-w-md bg-white rounded-2xl shadow-elevated p-6",
|
|
244
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
245
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
246
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
247
|
+
className
|
|
248
|
+
),
|
|
249
|
+
...props,
|
|
250
|
+
children
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
] }));
|
|
254
|
+
AlertDialogContent.displayName = "AlertDialogContent";
|
|
255
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
256
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-1.5 mb-5", className), ...props });
|
|
257
|
+
}
|
|
258
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
259
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
260
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-end gap-2 mt-6", className), ...props });
|
|
261
|
+
}
|
|
262
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
263
|
+
var AlertDialogTitle = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
264
|
+
AlertDialog.Title,
|
|
265
|
+
{
|
|
266
|
+
ref,
|
|
267
|
+
className: cn("body-lg font-semibold text-taupe-900", className),
|
|
268
|
+
...props
|
|
269
|
+
}
|
|
270
|
+
));
|
|
271
|
+
AlertDialogTitle.displayName = "AlertDialogTitle";
|
|
272
|
+
var AlertDialogDescription = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialog.Description, { ref, className: cn("body text-taupe-500", className), ...props }));
|
|
273
|
+
AlertDialogDescription.displayName = "AlertDialogDescription";
|
|
274
|
+
var AlertDialogAction = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
275
|
+
AlertDialog.Action,
|
|
276
|
+
{
|
|
277
|
+
ref,
|
|
278
|
+
className: cn(
|
|
279
|
+
"inline-flex h-9 items-center justify-center rounded-md px-4",
|
|
280
|
+
"body font-medium whitespace-nowrap transition-all duration-150",
|
|
281
|
+
"bg-brand-primary text-white hover:bg-brand-primary/90 active:bg-brand-primary/80",
|
|
282
|
+
"focus-visible:ring-2 focus-visible:ring-brand-primary/30 focus-visible:ring-offset-1 outline-none",
|
|
283
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
284
|
+
className
|
|
285
|
+
),
|
|
286
|
+
...props
|
|
287
|
+
}
|
|
288
|
+
));
|
|
289
|
+
AlertDialogAction.displayName = "AlertDialogAction";
|
|
290
|
+
var AlertDialogCancel = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
291
|
+
AlertDialog.Cancel,
|
|
292
|
+
{
|
|
293
|
+
ref,
|
|
294
|
+
className: cn(
|
|
295
|
+
"inline-flex h-9 items-center justify-center rounded-md px-4",
|
|
296
|
+
"body font-medium whitespace-nowrap transition-all duration-150",
|
|
297
|
+
"bg-white text-taupe-700 shadow-natural hover:bg-taupe-50 rounded-xl",
|
|
298
|
+
"focus-visible:ring-2 focus-visible:ring-brand-primary/30 focus-visible:ring-offset-1 outline-none",
|
|
299
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
300
|
+
className
|
|
301
|
+
),
|
|
302
|
+
...props
|
|
303
|
+
}
|
|
304
|
+
));
|
|
305
|
+
AlertDialogCancel.displayName = "AlertDialogCancel";
|
|
306
|
+
var alertVariants = cva(
|
|
307
|
+
"relative w-full rounded-xl px-4 py-3.5 body [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-3.5 [&>svg~*]:pl-6",
|
|
308
|
+
{
|
|
309
|
+
variants: {
|
|
310
|
+
variant: {
|
|
311
|
+
default: "bg-taupe-50 text-taupe-800 [&>svg]:text-taupe-500",
|
|
312
|
+
info: "bg-brand-secondary/40 text-taupe-700 [&>svg]:text-taupe-500",
|
|
313
|
+
success: "bg-brand-secondary/15 text-taupe-800 [&>svg]:text-taupe-600",
|
|
314
|
+
warning: "bg-brand-secondary/70 text-taupe-800 [&>svg]:text-taupe-600",
|
|
315
|
+
destructive: "bg-red-50 text-red-800 [&>svg]:text-red-500"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
defaultVariants: { variant: "default" }
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
var Alert = React15.forwardRef(
|
|
322
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props })
|
|
323
|
+
);
|
|
324
|
+
Alert.displayName = "Alert";
|
|
325
|
+
var AlertTitle = React15.forwardRef(
|
|
326
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("mb-0.5 body font-semibold leading-tight", className), ...props })
|
|
327
|
+
);
|
|
328
|
+
AlertTitle.displayName = "AlertTitle";
|
|
329
|
+
var AlertDescription = React15.forwardRef(
|
|
330
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("body opacity-90", className), ...props })
|
|
331
|
+
);
|
|
332
|
+
AlertDescription.displayName = "AlertDescription";
|
|
333
|
+
var AspectRatioRoot = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
334
|
+
AspectRatio.Root,
|
|
335
|
+
{
|
|
336
|
+
ref,
|
|
337
|
+
className: cn("relative w-full overflow-hidden", className),
|
|
338
|
+
...props
|
|
339
|
+
}
|
|
340
|
+
));
|
|
341
|
+
AspectRatioRoot.displayName = "AspectRatio";
|
|
342
|
+
var sizeMap = {
|
|
343
|
+
sm: { wrapper: "size-6 ring-[1.5px]", text: "caption-xs" },
|
|
344
|
+
md: { wrapper: "size-8 ring-2", text: "caption" },
|
|
345
|
+
lg: { wrapper: "size-10 ring-2", text: "body" }
|
|
346
|
+
};
|
|
347
|
+
function AvatarStack({ avatars, max, size = "md", className }) {
|
|
348
|
+
const shown = max ? avatars.slice(0, max) : avatars;
|
|
349
|
+
const overflow = max && avatars.length > max ? avatars.length - max : 0;
|
|
350
|
+
const s = sizeMap[size];
|
|
351
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex -space-x-2", className), children: [
|
|
352
|
+
shown.map((avatar, i) => /* @__PURE__ */ jsx(
|
|
353
|
+
"span",
|
|
354
|
+
{
|
|
355
|
+
title: avatar.name,
|
|
356
|
+
className: cn(
|
|
357
|
+
"relative inline-flex shrink-0 overflow-hidden rounded-full ring-white",
|
|
358
|
+
s.wrapper
|
|
359
|
+
),
|
|
360
|
+
children: avatar.src ? /* @__PURE__ */ jsx("img", { src: avatar.src, alt: avatar.name, className: "size-full object-cover" }) : /* @__PURE__ */ jsx(
|
|
361
|
+
"span",
|
|
362
|
+
{
|
|
363
|
+
className: cn(
|
|
364
|
+
"flex size-full items-center justify-center font-medium",
|
|
365
|
+
s.text,
|
|
366
|
+
avatar.colorClass ?? "bg-taupe-200 text-taupe-700"
|
|
367
|
+
),
|
|
368
|
+
children: avatar.fallback ?? avatar.name.slice(0, 2).toUpperCase()
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
},
|
|
372
|
+
i
|
|
373
|
+
)),
|
|
374
|
+
overflow > 0 && /* @__PURE__ */ jsxs(
|
|
375
|
+
"span",
|
|
376
|
+
{
|
|
377
|
+
className: cn(
|
|
378
|
+
"relative inline-flex shrink-0 items-center justify-center rounded-full ring-white bg-taupe-100 font-medium text-taupe-600",
|
|
379
|
+
s.wrapper,
|
|
380
|
+
s.text
|
|
381
|
+
),
|
|
382
|
+
children: [
|
|
383
|
+
"+",
|
|
384
|
+
overflow
|
|
385
|
+
]
|
|
386
|
+
}
|
|
387
|
+
)
|
|
388
|
+
] });
|
|
389
|
+
}
|
|
390
|
+
var sizeMap2 = {
|
|
391
|
+
xs: "size-5 caption-xs",
|
|
392
|
+
sm: "size-7 caption",
|
|
393
|
+
md: "size-8 body",
|
|
394
|
+
lg: "size-10 body-lg",
|
|
395
|
+
xl: "size-12 subheading"
|
|
396
|
+
};
|
|
397
|
+
var Avatar = React15.forwardRef(
|
|
398
|
+
({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
399
|
+
Avatar$1.Root,
|
|
400
|
+
{
|
|
401
|
+
ref,
|
|
402
|
+
className: cn(
|
|
403
|
+
"relative flex shrink-0 overflow-hidden rounded-full",
|
|
404
|
+
sizeMap2[size],
|
|
405
|
+
className
|
|
406
|
+
),
|
|
407
|
+
...props
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
);
|
|
411
|
+
Avatar.displayName = "Avatar";
|
|
412
|
+
var AvatarImage = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
413
|
+
Avatar$1.Image,
|
|
414
|
+
{
|
|
415
|
+
ref,
|
|
416
|
+
className: cn("aspect-square h-full w-full object-cover", className),
|
|
417
|
+
...props
|
|
418
|
+
}
|
|
419
|
+
));
|
|
420
|
+
AvatarImage.displayName = "AvatarImage";
|
|
421
|
+
var AvatarFallback = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
422
|
+
Avatar$1.Fallback,
|
|
423
|
+
{
|
|
424
|
+
ref,
|
|
425
|
+
className: cn(
|
|
426
|
+
"flex h-full w-full items-center justify-center rounded-full bg-taupe-100 body font-semibold text-taupe-600",
|
|
427
|
+
className
|
|
428
|
+
),
|
|
429
|
+
...props
|
|
430
|
+
}
|
|
431
|
+
));
|
|
432
|
+
AvatarFallback.displayName = "AvatarFallback";
|
|
433
|
+
var statusColorMap = {
|
|
434
|
+
online: "bg-brand-secondary",
|
|
435
|
+
offline: "bg-taupe-300",
|
|
436
|
+
busy: "bg-red-500",
|
|
437
|
+
away: "bg-brand-secondary"
|
|
438
|
+
};
|
|
439
|
+
var statusSizeMap = {
|
|
440
|
+
xs: "size-1.5 ring-1",
|
|
441
|
+
sm: "size-2 ring-1",
|
|
442
|
+
md: "size-2.5 ring-[1.5px]",
|
|
443
|
+
lg: "size-3 ring-2",
|
|
444
|
+
xl: "size-3.5 ring-2"
|
|
445
|
+
};
|
|
446
|
+
var AvatarWithStatus = React15.forwardRef(({ status, size = "md", className, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "relative inline-flex shrink-0", children: [
|
|
447
|
+
/* @__PURE__ */ jsx(Avatar, { ref, size, className, ...props, children }),
|
|
448
|
+
status && /* @__PURE__ */ jsx(
|
|
449
|
+
"span",
|
|
450
|
+
{
|
|
451
|
+
className: cn(
|
|
452
|
+
"absolute bottom-0 right-0 rounded-full ring-white",
|
|
453
|
+
statusColorMap[status],
|
|
454
|
+
statusSizeMap[size]
|
|
455
|
+
)
|
|
456
|
+
}
|
|
457
|
+
)
|
|
458
|
+
] }));
|
|
459
|
+
AvatarWithStatus.displayName = "AvatarWithStatus";
|
|
460
|
+
var badgeVariants = cva(
|
|
461
|
+
"inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 caption font-medium transition-colors",
|
|
462
|
+
{
|
|
463
|
+
variants: {
|
|
464
|
+
variant: {
|
|
465
|
+
default: "bg-taupe-900 text-white",
|
|
466
|
+
secondary: "bg-taupe-100 text-taupe-700",
|
|
467
|
+
outline: "border border-taupe-200 text-taupe-600 bg-transparent",
|
|
468
|
+
brand: "bg-brand-primary text-white",
|
|
469
|
+
success: "bg-brand-secondary/20 text-taupe-800 border border-brand-secondary/50",
|
|
470
|
+
warning: "bg-brand-secondary/70 text-taupe-700 border border-brand-secondary",
|
|
471
|
+
destructive: "bg-red-50 text-red-700 border border-red-200"
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
defaultVariants: {
|
|
475
|
+
variant: "default"
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
function Badge({ className, variant, ...props }) {
|
|
480
|
+
return /* @__PURE__ */ jsx("span", { "data-slot": "badge", className: cn(badgeVariants({ variant, className })), ...props });
|
|
481
|
+
}
|
|
482
|
+
var Breadcrumb = React15.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
483
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
484
|
+
var BreadcrumbList = React15.forwardRef(
|
|
485
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
486
|
+
"ol",
|
|
487
|
+
{
|
|
488
|
+
ref,
|
|
489
|
+
className: cn("flex flex-wrap items-center gap-1.5 body text-taupe-500", className),
|
|
490
|
+
...props
|
|
491
|
+
}
|
|
492
|
+
)
|
|
493
|
+
);
|
|
494
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
495
|
+
var BreadcrumbItem = React15.forwardRef(
|
|
496
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("li", { ref, className: cn("inline-flex items-center gap-1.5", className), ...props })
|
|
497
|
+
);
|
|
498
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
499
|
+
var BreadcrumbLink = React15.forwardRef(
|
|
500
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("a", { ref, className: cn("transition-colors hover:text-taupe-900", className), ...props })
|
|
501
|
+
);
|
|
502
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
503
|
+
var BreadcrumbPage = React15.forwardRef(
|
|
504
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
505
|
+
"span",
|
|
506
|
+
{
|
|
507
|
+
ref,
|
|
508
|
+
role: "link",
|
|
509
|
+
"aria-current": "page",
|
|
510
|
+
className: cn("body font-medium text-taupe-900", className),
|
|
511
|
+
...props
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
);
|
|
515
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
516
|
+
var BreadcrumbSeparator = ({ children, className, ...props }) => /* @__PURE__ */ jsx("li", { role: "presentation", "aria-hidden": "true", className: cn("text-taupe-300", className), ...props, children: children ?? /* @__PURE__ */ jsx(ChevronRight, { size: 14 }) });
|
|
517
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
518
|
+
var BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
519
|
+
"span",
|
|
520
|
+
{
|
|
521
|
+
role: "presentation",
|
|
522
|
+
"aria-hidden": "true",
|
|
523
|
+
className: cn("flex size-5 items-center justify-center", className),
|
|
524
|
+
...props,
|
|
525
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { size: 14, className: "text-taupe-400" })
|
|
526
|
+
}
|
|
527
|
+
);
|
|
528
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
529
|
+
function ButtonGroup({ children, className }) {
|
|
530
|
+
return /* @__PURE__ */ jsx(
|
|
531
|
+
"div",
|
|
532
|
+
{
|
|
533
|
+
className: cn(
|
|
534
|
+
"inline-flex divide-x divide-taupe-200 overflow-hidden rounded-lg border border-taupe-200 bg-white shadow-natural",
|
|
535
|
+
className
|
|
536
|
+
),
|
|
537
|
+
children
|
|
538
|
+
}
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
function ButtonGroupItem({ active, className, children, ...props }) {
|
|
542
|
+
return /* @__PURE__ */ jsx(
|
|
543
|
+
"button",
|
|
544
|
+
{
|
|
545
|
+
type: "button",
|
|
546
|
+
className: cn(
|
|
547
|
+
"relative inline-flex items-center gap-1.5 px-3.5 py-2 body font-medium transition-colors",
|
|
548
|
+
"focus:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-taupe-400/40 focus-visible:ring-inset",
|
|
549
|
+
active ? "bg-taupe-900 text-white" : "text-taupe-600 hover:bg-taupe-50 hover:text-taupe-900",
|
|
550
|
+
className
|
|
551
|
+
),
|
|
552
|
+
...props,
|
|
553
|
+
children
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
|
|
558
|
+
return /* @__PURE__ */ jsx(
|
|
559
|
+
DayPicker,
|
|
560
|
+
{
|
|
561
|
+
showOutsideDays,
|
|
562
|
+
className: cn("p-3", className),
|
|
563
|
+
classNames: {
|
|
564
|
+
months: "flex flex-col sm:flex-row gap-4",
|
|
565
|
+
month: "flex flex-col gap-4",
|
|
566
|
+
month_caption: "flex justify-center pt-1 relative items-center px-10",
|
|
567
|
+
caption_label: "body font-semibold text-taupe-900",
|
|
568
|
+
nav: "flex items-center justify-between absolute inset-x-0 top-1",
|
|
569
|
+
button_previous: cn(
|
|
570
|
+
"absolute left-0 h-7 w-7 flex items-center justify-center rounded-md",
|
|
571
|
+
"text-taupe-400 hover:bg-taupe-100 hover:text-taupe-700 transition-colors"
|
|
572
|
+
),
|
|
573
|
+
button_next: cn(
|
|
574
|
+
"absolute right-0 h-7 w-7 flex items-center justify-center rounded-md",
|
|
575
|
+
"text-taupe-400 hover:bg-taupe-100 hover:text-taupe-700 transition-colors"
|
|
576
|
+
),
|
|
577
|
+
month_grid: "w-full border-collapse mt-1",
|
|
578
|
+
weekdays: "flex",
|
|
579
|
+
weekday: "w-9 h-9 flex items-center justify-center label text-taupe-400 font-normal",
|
|
580
|
+
week: "flex w-full mt-1",
|
|
581
|
+
day: "relative p-0 text-center",
|
|
582
|
+
day_button: cn(
|
|
583
|
+
"h-9 w-9 flex items-center justify-center rounded-full body font-normal",
|
|
584
|
+
"text-taupe-900 hover:bg-taupe-100 transition-colors",
|
|
585
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/30"
|
|
586
|
+
),
|
|
587
|
+
selected: "[&>button]:bg-brand-primary [&>button]:text-white [&>button]:hover:bg-brand-primary/90",
|
|
588
|
+
today: "[&>button]:font-semibold [&>button]:text-brand-primary",
|
|
589
|
+
outside: "opacity-40 [&>button]:text-taupe-400",
|
|
590
|
+
disabled: "opacity-30 [&>button]:cursor-not-allowed",
|
|
591
|
+
range_start: "[&>button]:bg-brand-primary [&>button]:text-white [&>button]:rounded-full",
|
|
592
|
+
range_end: "[&>button]:bg-brand-primary [&>button]:text-white [&>button]:rounded-full",
|
|
593
|
+
range_middle: "[&>button]:bg-brand-primary/15 [&>button]:text-taupe-900 [&>button]:rounded-none",
|
|
594
|
+
hidden: "invisible",
|
|
595
|
+
...classNames
|
|
596
|
+
},
|
|
597
|
+
components: {
|
|
598
|
+
Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ jsx(ChevronLeft, { size: 14 }) : /* @__PURE__ */ jsx(ChevronRight, { size: 14 })
|
|
599
|
+
},
|
|
600
|
+
...props
|
|
601
|
+
}
|
|
602
|
+
);
|
|
603
|
+
}
|
|
604
|
+
Calendar.displayName = "Calendar";
|
|
605
|
+
function CardHeading({ title, description, actions, children, className }) {
|
|
606
|
+
return /* @__PURE__ */ jsxs(
|
|
607
|
+
"div",
|
|
608
|
+
{
|
|
609
|
+
className: cn(
|
|
610
|
+
"flex items-start justify-between gap-4 border-b border-taupe-100 px-5 py-4",
|
|
611
|
+
className
|
|
612
|
+
),
|
|
613
|
+
children: [
|
|
614
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
615
|
+
children,
|
|
616
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
617
|
+
/* @__PURE__ */ jsx("p", { className: "body font-semibold text-taupe-900 truncate", children: title }),
|
|
618
|
+
description && /* @__PURE__ */ jsx("p", { className: "caption text-taupe-400 mt-0.5", children: description })
|
|
619
|
+
] })
|
|
620
|
+
] }),
|
|
621
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions.map(
|
|
622
|
+
(action, i) => action.href ? /* @__PURE__ */ jsx(Button, { size: "sm", variant: action.variant ?? "default", asChild: true, children: /* @__PURE__ */ jsx("a", { href: action.href, children: action.label }) }, i) : /* @__PURE__ */ jsx(
|
|
623
|
+
Button,
|
|
624
|
+
{
|
|
625
|
+
size: "sm",
|
|
626
|
+
variant: action.variant ?? "default",
|
|
627
|
+
onClick: action.onClick,
|
|
628
|
+
children: action.label
|
|
629
|
+
},
|
|
630
|
+
i
|
|
631
|
+
)
|
|
632
|
+
) })
|
|
633
|
+
]
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
}
|
|
637
|
+
var cardVariants = cva("rounded-xl", {
|
|
638
|
+
variants: {
|
|
639
|
+
variant: {
|
|
640
|
+
default: "bg-white shadow-natural",
|
|
641
|
+
muted: "bg-taupe-50",
|
|
642
|
+
ghost: "bg-transparent"
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
defaultVariants: {
|
|
646
|
+
variant: "default"
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
var Card = React15.forwardRef(
|
|
650
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
651
|
+
"div",
|
|
652
|
+
{
|
|
653
|
+
ref,
|
|
654
|
+
"data-slot": "card",
|
|
655
|
+
className: cn(cardVariants({ variant }), className),
|
|
656
|
+
...props
|
|
657
|
+
}
|
|
658
|
+
)
|
|
659
|
+
);
|
|
660
|
+
Card.displayName = "Card";
|
|
661
|
+
var CardHeader = React15.forwardRef(
|
|
662
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
663
|
+
"div",
|
|
664
|
+
{
|
|
665
|
+
ref,
|
|
666
|
+
"data-slot": "card-header",
|
|
667
|
+
className: cn("flex flex-col gap-1.5 p-5", className),
|
|
668
|
+
...props
|
|
669
|
+
}
|
|
670
|
+
)
|
|
671
|
+
);
|
|
672
|
+
CardHeader.displayName = "CardHeader";
|
|
673
|
+
var CardTitle = React15.forwardRef(
|
|
674
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
675
|
+
"h3",
|
|
676
|
+
{
|
|
677
|
+
ref,
|
|
678
|
+
"data-slot": "card-title",
|
|
679
|
+
className: cn("subheading text-taupe-900", className),
|
|
680
|
+
...props
|
|
681
|
+
}
|
|
682
|
+
)
|
|
683
|
+
);
|
|
684
|
+
CardTitle.displayName = "CardTitle";
|
|
685
|
+
var CardDescription = React15.forwardRef(
|
|
686
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
687
|
+
"p",
|
|
688
|
+
{
|
|
689
|
+
ref,
|
|
690
|
+
"data-slot": "card-description",
|
|
691
|
+
className: cn("caption text-taupe-500", className),
|
|
692
|
+
...props
|
|
693
|
+
}
|
|
694
|
+
)
|
|
695
|
+
);
|
|
696
|
+
CardDescription.displayName = "CardDescription";
|
|
697
|
+
var CardContent = React15.forwardRef(
|
|
698
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, "data-slot": "card-content", className: cn("p-5 pt-0", className), ...props })
|
|
699
|
+
);
|
|
700
|
+
CardContent.displayName = "CardContent";
|
|
701
|
+
var CardFooter = React15.forwardRef(
|
|
702
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
703
|
+
"div",
|
|
704
|
+
{
|
|
705
|
+
ref,
|
|
706
|
+
"data-slot": "card-footer",
|
|
707
|
+
className: cn("flex items-center p-5 pt-0", className),
|
|
708
|
+
...props
|
|
709
|
+
}
|
|
710
|
+
)
|
|
711
|
+
);
|
|
712
|
+
CardFooter.displayName = "CardFooter";
|
|
713
|
+
var CardMedia = React15.forwardRef(
|
|
714
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
715
|
+
"div",
|
|
716
|
+
{
|
|
717
|
+
ref,
|
|
718
|
+
"data-slot": "card-media",
|
|
719
|
+
className: cn("relative overflow-hidden", className),
|
|
720
|
+
...props
|
|
721
|
+
}
|
|
722
|
+
)
|
|
723
|
+
);
|
|
724
|
+
CardMedia.displayName = "CardMedia";
|
|
725
|
+
var CarouselContext = React15.createContext(null);
|
|
726
|
+
function useCarousel() {
|
|
727
|
+
const context = React15.useContext(CarouselContext);
|
|
728
|
+
if (!context) throw new Error("useCarousel must be used within a <Carousel />");
|
|
729
|
+
return context;
|
|
730
|
+
}
|
|
731
|
+
function Carousel({
|
|
732
|
+
opts,
|
|
733
|
+
plugins,
|
|
734
|
+
orientation = "horizontal",
|
|
735
|
+
setApi,
|
|
736
|
+
className,
|
|
737
|
+
children,
|
|
738
|
+
...props
|
|
739
|
+
}) {
|
|
740
|
+
const [carouselRef, emblaApi] = useEmblaCarousel(
|
|
741
|
+
{
|
|
742
|
+
...opts,
|
|
743
|
+
axis: orientation === "vertical" ? "y" : "x"
|
|
744
|
+
},
|
|
745
|
+
plugins
|
|
746
|
+
);
|
|
747
|
+
const [canScrollPrev, setCanScrollPrev] = React15.useState(false);
|
|
748
|
+
const [canScrollNext, setCanScrollNext] = React15.useState(false);
|
|
749
|
+
const onSelect = React15.useCallback((api) => {
|
|
750
|
+
if (!api) return;
|
|
751
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
752
|
+
setCanScrollNext(api.canScrollNext());
|
|
753
|
+
}, []);
|
|
754
|
+
const scrollPrev = React15.useCallback(() => {
|
|
755
|
+
emblaApi?.scrollPrev();
|
|
756
|
+
}, [emblaApi]);
|
|
757
|
+
const scrollNext = React15.useCallback(() => {
|
|
758
|
+
emblaApi?.scrollNext();
|
|
759
|
+
}, [emblaApi]);
|
|
760
|
+
const handleKeyDown = React15.useCallback(
|
|
761
|
+
(event) => {
|
|
762
|
+
if (event.key === "ArrowLeft") {
|
|
763
|
+
event.preventDefault();
|
|
764
|
+
scrollPrev();
|
|
765
|
+
} else if (event.key === "ArrowRight") {
|
|
766
|
+
event.preventDefault();
|
|
767
|
+
scrollNext();
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
[scrollPrev, scrollNext]
|
|
771
|
+
);
|
|
772
|
+
React15.useEffect(() => {
|
|
773
|
+
if (!emblaApi) return;
|
|
774
|
+
onSelect(emblaApi);
|
|
775
|
+
emblaApi.on("reInit", onSelect);
|
|
776
|
+
emblaApi.on("select", onSelect);
|
|
777
|
+
return () => {
|
|
778
|
+
emblaApi.off("reInit", onSelect);
|
|
779
|
+
emblaApi.off("select", onSelect);
|
|
780
|
+
};
|
|
781
|
+
}, [emblaApi, onSelect]);
|
|
782
|
+
React15.useEffect(() => {
|
|
783
|
+
if (!emblaApi || !setApi) return;
|
|
784
|
+
setApi(emblaApi);
|
|
785
|
+
}, [emblaApi, setApi]);
|
|
786
|
+
return /* @__PURE__ */ jsx(
|
|
787
|
+
CarouselContext.Provider,
|
|
788
|
+
{
|
|
789
|
+
value: {
|
|
790
|
+
carouselRef,
|
|
791
|
+
api: emblaApi,
|
|
792
|
+
opts,
|
|
793
|
+
orientation,
|
|
794
|
+
scrollPrev,
|
|
795
|
+
scrollNext,
|
|
796
|
+
canScrollPrev,
|
|
797
|
+
canScrollNext
|
|
798
|
+
},
|
|
799
|
+
children: /* @__PURE__ */ jsx(
|
|
800
|
+
"div",
|
|
801
|
+
{
|
|
802
|
+
onKeyDownCapture: handleKeyDown,
|
|
803
|
+
className: cn("relative", className),
|
|
804
|
+
role: "region",
|
|
805
|
+
"aria-roledescription": "carousel",
|
|
806
|
+
...props,
|
|
807
|
+
children
|
|
808
|
+
}
|
|
809
|
+
)
|
|
810
|
+
}
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
function CarouselContent({ className, ...props }) {
|
|
814
|
+
const { carouselRef, orientation } = useCarousel();
|
|
815
|
+
return /* @__PURE__ */ jsx("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
816
|
+
"div",
|
|
817
|
+
{
|
|
818
|
+
className: cn("flex", orientation === "vertical" ? "-mt-4 flex-col" : "-ml-4", className),
|
|
819
|
+
...props
|
|
820
|
+
}
|
|
821
|
+
) });
|
|
822
|
+
}
|
|
823
|
+
function CarouselItem({ className, ...props }) {
|
|
824
|
+
const { orientation } = useCarousel();
|
|
825
|
+
return /* @__PURE__ */ jsx(
|
|
826
|
+
"div",
|
|
827
|
+
{
|
|
828
|
+
role: "group",
|
|
829
|
+
"aria-roledescription": "slide",
|
|
830
|
+
className: cn(
|
|
831
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
832
|
+
orientation === "vertical" ? "pt-4" : "pl-4",
|
|
833
|
+
className
|
|
834
|
+
),
|
|
835
|
+
...props
|
|
836
|
+
}
|
|
837
|
+
);
|
|
838
|
+
}
|
|
839
|
+
function CarouselPrevious({
|
|
840
|
+
className,
|
|
841
|
+
variant = "outline",
|
|
842
|
+
size = "icon",
|
|
843
|
+
...props
|
|
844
|
+
}) {
|
|
845
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
846
|
+
return /* @__PURE__ */ jsxs(
|
|
847
|
+
Button,
|
|
848
|
+
{
|
|
849
|
+
variant,
|
|
850
|
+
size,
|
|
851
|
+
className: cn(
|
|
852
|
+
"absolute h-9 w-9 rounded-full",
|
|
853
|
+
orientation === "vertical" ? "-top-12 left-1/2 -translate-x-1/2 rotate-90" : "-left-12 top-1/2 -translate-y-1/2",
|
|
854
|
+
className
|
|
855
|
+
),
|
|
856
|
+
disabled: !canScrollPrev,
|
|
857
|
+
onClick: scrollPrev,
|
|
858
|
+
...props,
|
|
859
|
+
children: [
|
|
860
|
+
/* @__PURE__ */ jsx(ArrowLeft, { className: "size-4" }),
|
|
861
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
862
|
+
]
|
|
863
|
+
}
|
|
864
|
+
);
|
|
865
|
+
}
|
|
866
|
+
function CarouselNext({
|
|
867
|
+
className,
|
|
868
|
+
variant = "outline",
|
|
869
|
+
size = "icon",
|
|
870
|
+
...props
|
|
871
|
+
}) {
|
|
872
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
873
|
+
return /* @__PURE__ */ jsxs(
|
|
874
|
+
Button,
|
|
875
|
+
{
|
|
876
|
+
variant,
|
|
877
|
+
size,
|
|
878
|
+
className: cn(
|
|
879
|
+
"absolute h-9 w-9 rounded-full",
|
|
880
|
+
orientation === "vertical" ? "-bottom-12 left-1/2 -translate-x-1/2 rotate-90" : "-right-12 top-1/2 -translate-y-1/2",
|
|
881
|
+
className
|
|
882
|
+
),
|
|
883
|
+
disabled: !canScrollNext,
|
|
884
|
+
onClick: scrollNext,
|
|
885
|
+
...props,
|
|
886
|
+
children: [
|
|
887
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "size-4" }),
|
|
888
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
|
|
889
|
+
]
|
|
890
|
+
}
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
var CHART_COLORS = {
|
|
894
|
+
primary: "#FF4D01",
|
|
895
|
+
// brand-primary
|
|
896
|
+
secondary: "#CDEA19",
|
|
897
|
+
// brand-secondary
|
|
898
|
+
tertiary: "#FDE086",
|
|
899
|
+
// brand-secondary
|
|
900
|
+
muted: "#a8978a",
|
|
901
|
+
// taupe-400
|
|
902
|
+
subtle: "#e3dcd4",
|
|
903
|
+
// taupe-200
|
|
904
|
+
dark: "#26181a"
|
|
905
|
+
// taupe-900
|
|
906
|
+
};
|
|
907
|
+
function ChartContainer({ children, className, height = 300 }) {
|
|
908
|
+
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children }) });
|
|
909
|
+
}
|
|
910
|
+
ChartContainer.displayName = "ChartContainer";
|
|
911
|
+
function ChartTooltip({ active, payload, label, labelClassName }) {
|
|
912
|
+
if (!active || !payload?.length) return null;
|
|
913
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-taupe-100 bg-white px-3 py-2 shadow-elevated", children: [
|
|
914
|
+
label && /* @__PURE__ */ jsx("p", { className: cn("mb-1 label text-taupe-400", labelClassName), children: label }),
|
|
915
|
+
payload.map((entry, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
916
|
+
/* @__PURE__ */ jsx(
|
|
917
|
+
"span",
|
|
918
|
+
{
|
|
919
|
+
className: "inline-block h-2 w-2 rounded-full",
|
|
920
|
+
style: { backgroundColor: entry.color }
|
|
921
|
+
}
|
|
922
|
+
),
|
|
923
|
+
/* @__PURE__ */ jsxs("span", { className: "caption text-taupe-500", children: [
|
|
924
|
+
entry.name,
|
|
925
|
+
":"
|
|
926
|
+
] }),
|
|
927
|
+
/* @__PURE__ */ jsx("span", { className: "caption font-medium text-taupe-900", children: entry.value })
|
|
928
|
+
] }, i))
|
|
929
|
+
] });
|
|
930
|
+
}
|
|
931
|
+
ChartTooltip.displayName = "ChartTooltip";
|
|
932
|
+
var CheckboxRoot = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
933
|
+
Checkbox.Root,
|
|
934
|
+
{
|
|
935
|
+
ref,
|
|
936
|
+
className: cn(
|
|
937
|
+
"peer size-4 shrink-0 rounded border border-taupe-300 bg-white transition-colors",
|
|
938
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/30",
|
|
939
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
940
|
+
"data-[state=checked]:bg-brand-primary data-[state=checked]:border-brand-primary",
|
|
941
|
+
"data-[state=indeterminate]:bg-brand-primary data-[state=indeterminate]:border-brand-primary",
|
|
942
|
+
className
|
|
943
|
+
),
|
|
944
|
+
...props,
|
|
945
|
+
children: /* @__PURE__ */ jsx(Checkbox.Indicator, { className: "flex items-center justify-center text-white", children: props.checked === "indeterminate" ? /* @__PURE__ */ jsx(Minus, { size: 11, strokeWidth: 3 }) : /* @__PURE__ */ jsx(Check, { size: 11, strokeWidth: 3 }) })
|
|
946
|
+
}
|
|
947
|
+
));
|
|
948
|
+
CheckboxRoot.displayName = "Checkbox";
|
|
949
|
+
var CollapsibleRoot = Collapsible.Root;
|
|
950
|
+
var CollapsibleTrigger = Collapsible.Trigger;
|
|
951
|
+
var CollapsibleContent = Collapsible.Content;
|
|
952
|
+
function isValidHex(s) {
|
|
953
|
+
return /^#([0-9a-fA-F]{3}){1,2}$/.test(s);
|
|
954
|
+
}
|
|
955
|
+
function ColorPicker({
|
|
956
|
+
value,
|
|
957
|
+
onChange,
|
|
958
|
+
className,
|
|
959
|
+
disabled,
|
|
960
|
+
presets,
|
|
961
|
+
ariaLabel = "Color"
|
|
962
|
+
}) {
|
|
963
|
+
const [hex, setHex] = React15.useState(value);
|
|
964
|
+
React15.useEffect(() => {
|
|
965
|
+
setHex(value);
|
|
966
|
+
}, [value]);
|
|
967
|
+
const commit = (next) => {
|
|
968
|
+
if (isValidHex(next)) onChange(next);
|
|
969
|
+
};
|
|
970
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { children: [
|
|
971
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
972
|
+
"button",
|
|
973
|
+
{
|
|
974
|
+
type: "button",
|
|
975
|
+
disabled,
|
|
976
|
+
"aria-label": ariaLabel,
|
|
977
|
+
className: cn(
|
|
978
|
+
"inline-flex h-8 w-8 items-center justify-center rounded-md border border-taupe-200 bg-white",
|
|
979
|
+
"transition-colors hover:border-taupe-300",
|
|
980
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/20 focus-visible:border-brand-primary",
|
|
981
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
982
|
+
className
|
|
983
|
+
),
|
|
984
|
+
children: /* @__PURE__ */ jsx(
|
|
985
|
+
"span",
|
|
986
|
+
{
|
|
987
|
+
"aria-hidden": true,
|
|
988
|
+
className: "h-5 w-5 rounded-sm border border-black/5",
|
|
989
|
+
style: { backgroundColor: value }
|
|
990
|
+
}
|
|
991
|
+
)
|
|
992
|
+
}
|
|
993
|
+
) }),
|
|
994
|
+
/* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsxs(
|
|
995
|
+
Popover.Content,
|
|
996
|
+
{
|
|
997
|
+
align: "start",
|
|
998
|
+
sideOffset: 6,
|
|
999
|
+
className: "z-50 w-56 rounded-xl bg-white p-3 shadow-natural outline-none",
|
|
1000
|
+
children: [
|
|
1001
|
+
/* @__PURE__ */ jsx(
|
|
1002
|
+
"input",
|
|
1003
|
+
{
|
|
1004
|
+
type: "color",
|
|
1005
|
+
value: isValidHex(hex) ? hex : "#000000",
|
|
1006
|
+
onChange: (e) => {
|
|
1007
|
+
setHex(e.target.value);
|
|
1008
|
+
onChange(e.target.value);
|
|
1009
|
+
},
|
|
1010
|
+
className: "h-10 w-full cursor-pointer rounded-md border border-taupe-200 bg-white p-0.5"
|
|
1011
|
+
}
|
|
1012
|
+
),
|
|
1013
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
1014
|
+
/* @__PURE__ */ jsx("span", { className: "caption text-taupe-500", children: "Hex" }),
|
|
1015
|
+
/* @__PURE__ */ jsx(
|
|
1016
|
+
"input",
|
|
1017
|
+
{
|
|
1018
|
+
type: "text",
|
|
1019
|
+
value: hex,
|
|
1020
|
+
onChange: (e) => setHex(e.target.value),
|
|
1021
|
+
onBlur: (e) => commit(e.target.value),
|
|
1022
|
+
onKeyDown: (e) => {
|
|
1023
|
+
if (e.key === "Enter") commit(e.target.value);
|
|
1024
|
+
},
|
|
1025
|
+
className: "flex-1 h-7 rounded-md border border-taupe-200 bg-white px-2 caption text-taupe-900 focus:outline-none focus:border-brand-primary"
|
|
1026
|
+
}
|
|
1027
|
+
)
|
|
1028
|
+
] }),
|
|
1029
|
+
presets && presets.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-3 grid grid-cols-8 gap-1.5", children: presets.map((p) => /* @__PURE__ */ jsx(
|
|
1030
|
+
"button",
|
|
1031
|
+
{
|
|
1032
|
+
type: "button",
|
|
1033
|
+
onClick: () => onChange(p),
|
|
1034
|
+
"aria-label": p,
|
|
1035
|
+
className: "h-5 w-5 rounded-sm border border-black/10 transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/30",
|
|
1036
|
+
style: { backgroundColor: p }
|
|
1037
|
+
},
|
|
1038
|
+
p
|
|
1039
|
+
)) })
|
|
1040
|
+
]
|
|
1041
|
+
}
|
|
1042
|
+
) })
|
|
1043
|
+
] });
|
|
1044
|
+
}
|
|
1045
|
+
function ColorInput({
|
|
1046
|
+
value,
|
|
1047
|
+
onChange,
|
|
1048
|
+
opacity,
|
|
1049
|
+
onOpacityChange,
|
|
1050
|
+
className,
|
|
1051
|
+
disabled,
|
|
1052
|
+
presets
|
|
1053
|
+
}) {
|
|
1054
|
+
const [hex, setHex] = React15.useState(value);
|
|
1055
|
+
React15.useEffect(() => {
|
|
1056
|
+
setHex(value);
|
|
1057
|
+
}, [value]);
|
|
1058
|
+
const commitHex = (next) => {
|
|
1059
|
+
if (/^#([0-9a-fA-F]{3}){1,2}$/.test(next)) onChange(next);
|
|
1060
|
+
else setHex(value);
|
|
1061
|
+
};
|
|
1062
|
+
return /* @__PURE__ */ jsxs(
|
|
1063
|
+
"div",
|
|
1064
|
+
{
|
|
1065
|
+
className: cn(
|
|
1066
|
+
"inline-flex h-8 items-stretch gap-0 rounded-md border border-taupe-200 bg-white overflow-hidden",
|
|
1067
|
+
"focus-within:ring-2 focus-within:ring-brand-primary/20 focus-within:border-brand-primary",
|
|
1068
|
+
disabled && "opacity-50 pointer-events-none",
|
|
1069
|
+
className
|
|
1070
|
+
),
|
|
1071
|
+
children: [
|
|
1072
|
+
/* @__PURE__ */ jsx(
|
|
1073
|
+
ColorPicker,
|
|
1074
|
+
{
|
|
1075
|
+
value,
|
|
1076
|
+
onChange,
|
|
1077
|
+
presets,
|
|
1078
|
+
disabled,
|
|
1079
|
+
className: "h-full w-8 border-0 rounded-none focus-visible:ring-0"
|
|
1080
|
+
}
|
|
1081
|
+
),
|
|
1082
|
+
/* @__PURE__ */ jsx(
|
|
1083
|
+
"input",
|
|
1084
|
+
{
|
|
1085
|
+
type: "text",
|
|
1086
|
+
value: hex.replace(/^#/, ""),
|
|
1087
|
+
onChange: (e) => setHex("#" + e.target.value.replace(/^#/, "")),
|
|
1088
|
+
onBlur: (e) => commitHex("#" + e.target.value.replace(/^#/, "")),
|
|
1089
|
+
onKeyDown: (e) => {
|
|
1090
|
+
if (e.key === "Enter")
|
|
1091
|
+
commitHex("#" + e.target.value.replace(/^#/, ""));
|
|
1092
|
+
},
|
|
1093
|
+
spellCheck: false,
|
|
1094
|
+
className: "w-[5.5rem] caption text-taupe-900 px-2 bg-transparent border-l border-taupe-100 focus:outline-none uppercase"
|
|
1095
|
+
}
|
|
1096
|
+
),
|
|
1097
|
+
typeof opacity === "number" && onOpacityChange && /* @__PURE__ */ jsxs("div", { className: "relative flex items-center border-l border-taupe-100", children: [
|
|
1098
|
+
/* @__PURE__ */ jsx(
|
|
1099
|
+
"input",
|
|
1100
|
+
{
|
|
1101
|
+
type: "number",
|
|
1102
|
+
min: 0,
|
|
1103
|
+
max: 100,
|
|
1104
|
+
value: Math.round(opacity),
|
|
1105
|
+
onChange: (e) => onOpacityChange(Number(e.target.value)),
|
|
1106
|
+
className: "w-12 caption text-taupe-900 px-2 bg-transparent focus:outline-none text-right [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
|
|
1107
|
+
}
|
|
1108
|
+
),
|
|
1109
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "caption-xs text-taupe-400 pr-2", children: "%" })
|
|
1110
|
+
] })
|
|
1111
|
+
]
|
|
1112
|
+
}
|
|
1113
|
+
);
|
|
1114
|
+
}
|
|
1115
|
+
function Combobox({
|
|
1116
|
+
options,
|
|
1117
|
+
value,
|
|
1118
|
+
onValueChange,
|
|
1119
|
+
placeholder = "Select...",
|
|
1120
|
+
searchPlaceholder = "Search...",
|
|
1121
|
+
emptyText = "No results found.",
|
|
1122
|
+
className
|
|
1123
|
+
}) {
|
|
1124
|
+
const [open, setOpen] = React15.useState(false);
|
|
1125
|
+
const [query, setQuery] = React15.useState("");
|
|
1126
|
+
const containerRef = React15.useRef(null);
|
|
1127
|
+
const inputRef = React15.useRef(null);
|
|
1128
|
+
const selectedOption = options.find((o) => o.value === value);
|
|
1129
|
+
const filtered = query === "" ? options : options.filter(
|
|
1130
|
+
(o) => o.label.toLowerCase().includes(query.toLowerCase()) || o.description?.toLowerCase().includes(query.toLowerCase())
|
|
1131
|
+
);
|
|
1132
|
+
React15.useEffect(() => {
|
|
1133
|
+
function onMouseDown(e) {
|
|
1134
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1135
|
+
setOpen(false);
|
|
1136
|
+
setQuery("");
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
document.addEventListener("mousedown", onMouseDown);
|
|
1140
|
+
return () => document.removeEventListener("mousedown", onMouseDown);
|
|
1141
|
+
}, []);
|
|
1142
|
+
React15.useEffect(() => {
|
|
1143
|
+
if (!open) return;
|
|
1144
|
+
function onKey(e) {
|
|
1145
|
+
if (e.key === "Escape") {
|
|
1146
|
+
setOpen(false);
|
|
1147
|
+
setQuery("");
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
document.addEventListener("keydown", onKey);
|
|
1151
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
1152
|
+
}, [open]);
|
|
1153
|
+
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: cn("relative", className), children: [
|
|
1154
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
1155
|
+
selectedOption?.avatar && !open && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute left-2.5 flex size-5 items-center justify-center rounded-full bg-taupe-200 caption-xs font-semibold text-taupe-700 shrink-0", children: selectedOption.avatar }),
|
|
1156
|
+
selectedOption?.statusColor && !open && /* @__PURE__ */ jsx(
|
|
1157
|
+
"div",
|
|
1158
|
+
{
|
|
1159
|
+
className: "pointer-events-none absolute left-3 size-2 rounded-full shrink-0",
|
|
1160
|
+
style: { backgroundColor: selectedOption.statusColor }
|
|
1161
|
+
}
|
|
1162
|
+
),
|
|
1163
|
+
/* @__PURE__ */ jsx(
|
|
1164
|
+
"input",
|
|
1165
|
+
{
|
|
1166
|
+
ref: inputRef,
|
|
1167
|
+
type: "text",
|
|
1168
|
+
role: "combobox",
|
|
1169
|
+
"aria-expanded": open,
|
|
1170
|
+
className: cn(
|
|
1171
|
+
"flex h-9 w-full rounded-lg border border-taupe-200 bg-white pr-8 body text-taupe-900",
|
|
1172
|
+
"placeholder:text-taupe-400",
|
|
1173
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-taupe-400/30 focus-visible:border-taupe-400",
|
|
1174
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1175
|
+
selectedOption?.avatar && !open ? "pl-8" : selectedOption?.statusColor && !open ? "pl-7" : "pl-3"
|
|
1176
|
+
),
|
|
1177
|
+
placeholder: open ? searchPlaceholder : selectedOption?.label ?? placeholder,
|
|
1178
|
+
value: open ? query : selectedOption?.label ?? "",
|
|
1179
|
+
onChange: (e) => {
|
|
1180
|
+
setQuery(e.target.value);
|
|
1181
|
+
if (!open) setOpen(true);
|
|
1182
|
+
},
|
|
1183
|
+
onFocus: () => {
|
|
1184
|
+
setOpen(true);
|
|
1185
|
+
setQuery("");
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
),
|
|
1189
|
+
/* @__PURE__ */ jsx(
|
|
1190
|
+
"button",
|
|
1191
|
+
{
|
|
1192
|
+
type: "button",
|
|
1193
|
+
tabIndex: -1,
|
|
1194
|
+
className: "absolute inset-y-0 right-0 flex items-center px-2 text-taupe-400 hover:text-taupe-700 transition-colors",
|
|
1195
|
+
onClick: () => {
|
|
1196
|
+
if (open) {
|
|
1197
|
+
setOpen(false);
|
|
1198
|
+
setQuery("");
|
|
1199
|
+
} else {
|
|
1200
|
+
setOpen(true);
|
|
1201
|
+
inputRef.current?.focus();
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
children: /* @__PURE__ */ jsx(ChevronsUpDown, { size: 14 })
|
|
1205
|
+
}
|
|
1206
|
+
)
|
|
1207
|
+
] }),
|
|
1208
|
+
open && /* @__PURE__ */ jsx("div", { className: "absolute z-50 mt-1 w-full overflow-hidden rounded-lg border border-taupe-200 bg-white shadow-elevated", children: /* @__PURE__ */ jsx("ul", { role: "listbox", className: "max-h-60 overflow-auto py-1", children: filtered.length === 0 ? /* @__PURE__ */ jsx("li", { className: "px-3 py-2 body text-taupe-400", children: emptyText }) : filtered.map((option) => {
|
|
1209
|
+
const isSelected = option.value === value;
|
|
1210
|
+
return /* @__PURE__ */ jsxs(
|
|
1211
|
+
"li",
|
|
1212
|
+
{
|
|
1213
|
+
role: "option",
|
|
1214
|
+
"aria-selected": isSelected,
|
|
1215
|
+
className: cn(
|
|
1216
|
+
"flex cursor-pointer select-none items-center gap-2.5 px-3 py-2 body transition-colors",
|
|
1217
|
+
isSelected ? "bg-brand-primary text-white" : "text-taupe-900 hover:bg-taupe-50"
|
|
1218
|
+
),
|
|
1219
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1220
|
+
onClick: () => {
|
|
1221
|
+
onValueChange?.(option.value);
|
|
1222
|
+
setQuery("");
|
|
1223
|
+
setOpen(false);
|
|
1224
|
+
},
|
|
1225
|
+
children: [
|
|
1226
|
+
option.avatar && /* @__PURE__ */ jsx(
|
|
1227
|
+
"div",
|
|
1228
|
+
{
|
|
1229
|
+
className: cn(
|
|
1230
|
+
"flex size-6 shrink-0 items-center justify-center rounded-full caption-xs font-semibold",
|
|
1231
|
+
isSelected ? "bg-white/20 text-white" : "bg-taupe-200 text-taupe-700"
|
|
1232
|
+
),
|
|
1233
|
+
children: option.avatar
|
|
1234
|
+
}
|
|
1235
|
+
),
|
|
1236
|
+
option.statusColor && !option.avatar && /* @__PURE__ */ jsx(
|
|
1237
|
+
"div",
|
|
1238
|
+
{
|
|
1239
|
+
className: "size-2 shrink-0 rounded-full",
|
|
1240
|
+
style: { backgroundColor: option.statusColor }
|
|
1241
|
+
}
|
|
1242
|
+
),
|
|
1243
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1244
|
+
/* @__PURE__ */ jsx("p", { className: cn("truncate", isSelected && "font-semibold"), children: option.label }),
|
|
1245
|
+
option.description && /* @__PURE__ */ jsx(
|
|
1246
|
+
"p",
|
|
1247
|
+
{
|
|
1248
|
+
className: cn(
|
|
1249
|
+
"caption truncate",
|
|
1250
|
+
isSelected ? "text-white/70" : "text-taupe-400"
|
|
1251
|
+
),
|
|
1252
|
+
children: option.description
|
|
1253
|
+
}
|
|
1254
|
+
)
|
|
1255
|
+
] }),
|
|
1256
|
+
isSelected && /* @__PURE__ */ jsx(Check, { size: 14, className: "shrink-0" })
|
|
1257
|
+
]
|
|
1258
|
+
},
|
|
1259
|
+
option.value
|
|
1260
|
+
);
|
|
1261
|
+
}) }) })
|
|
1262
|
+
] });
|
|
1263
|
+
}
|
|
1264
|
+
var DialogRoot = Dialog.Root;
|
|
1265
|
+
var DialogTrigger = Dialog.Trigger;
|
|
1266
|
+
var DialogClose = Dialog.Close;
|
|
1267
|
+
var DialogOverlay = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1268
|
+
Dialog.Overlay,
|
|
1269
|
+
{
|
|
1270
|
+
ref,
|
|
1271
|
+
className: cn(
|
|
1272
|
+
"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm",
|
|
1273
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1274
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1275
|
+
className
|
|
1276
|
+
),
|
|
1277
|
+
...props
|
|
1278
|
+
}
|
|
1279
|
+
));
|
|
1280
|
+
DialogOverlay.displayName = "DialogOverlay";
|
|
1281
|
+
var DialogContent = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
|
|
1282
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
1283
|
+
/* @__PURE__ */ jsxs(
|
|
1284
|
+
Dialog.Content,
|
|
1285
|
+
{
|
|
1286
|
+
ref,
|
|
1287
|
+
className: cn(
|
|
1288
|
+
"fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%]",
|
|
1289
|
+
"w-full max-w-lg bg-white rounded-2xl shadow-elevated p-6",
|
|
1290
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1291
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1292
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
1293
|
+
className
|
|
1294
|
+
),
|
|
1295
|
+
...props,
|
|
1296
|
+
children: [
|
|
1297
|
+
children,
|
|
1298
|
+
/* @__PURE__ */ jsxs(Dialog.Close, { className: "absolute right-4 top-4 rounded-md p-1 text-taupe-400 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-taupe-900/20", children: [
|
|
1299
|
+
/* @__PURE__ */ jsx(X, { size: 16 }),
|
|
1300
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1301
|
+
] })
|
|
1302
|
+
]
|
|
1303
|
+
}
|
|
1304
|
+
)
|
|
1305
|
+
] }));
|
|
1306
|
+
DialogContent.displayName = "DialogContent";
|
|
1307
|
+
function DialogHeader({ className, ...props }) {
|
|
1308
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-1.5 mb-4", className), ...props });
|
|
1309
|
+
}
|
|
1310
|
+
DialogHeader.displayName = "DialogHeader";
|
|
1311
|
+
function DialogFooter({ className, ...props }) {
|
|
1312
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-end gap-2 mt-6", className), ...props });
|
|
1313
|
+
}
|
|
1314
|
+
DialogFooter.displayName = "DialogFooter";
|
|
1315
|
+
var DialogTitle = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1316
|
+
Dialog.Title,
|
|
1317
|
+
{
|
|
1318
|
+
ref,
|
|
1319
|
+
className: cn("body-lg font-semibold text-taupe-900", className),
|
|
1320
|
+
...props
|
|
1321
|
+
}
|
|
1322
|
+
));
|
|
1323
|
+
DialogTitle.displayName = "DialogTitle";
|
|
1324
|
+
var DialogDescription = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Dialog.Description, { ref, className: cn("body text-taupe-500", className), ...props }));
|
|
1325
|
+
DialogDescription.displayName = "DialogDescription";
|
|
1326
|
+
function CommandPalette({
|
|
1327
|
+
open,
|
|
1328
|
+
onClose,
|
|
1329
|
+
items,
|
|
1330
|
+
placeholder = "Search...",
|
|
1331
|
+
emptyText = "No results found."
|
|
1332
|
+
}) {
|
|
1333
|
+
const [query, setQuery] = React15.useState("");
|
|
1334
|
+
const inputRef = React15.useRef(null);
|
|
1335
|
+
React15.useEffect(() => {
|
|
1336
|
+
if (open) {
|
|
1337
|
+
setTimeout(() => inputRef.current?.focus(), 50);
|
|
1338
|
+
setQuery("");
|
|
1339
|
+
}
|
|
1340
|
+
}, [open]);
|
|
1341
|
+
const filtered = query === "" ? items : items.filter(
|
|
1342
|
+
(item) => item.label.toLowerCase().includes(query.toLowerCase()) || item.description?.toLowerCase().includes(query.toLowerCase()) || item.category?.toLowerCase().includes(query.toLowerCase())
|
|
1343
|
+
);
|
|
1344
|
+
const grouped = filtered.reduce((acc, item) => {
|
|
1345
|
+
const cat = item.category ?? "";
|
|
1346
|
+
if (!acc[cat]) acc[cat] = [];
|
|
1347
|
+
acc[cat].push(item);
|
|
1348
|
+
return acc;
|
|
1349
|
+
}, {});
|
|
1350
|
+
const categories = Object.keys(grouped);
|
|
1351
|
+
function handleSelect(item) {
|
|
1352
|
+
if (item.href) {
|
|
1353
|
+
window.location.href = item.href;
|
|
1354
|
+
} else {
|
|
1355
|
+
item.onSelect?.();
|
|
1356
|
+
}
|
|
1357
|
+
onClose();
|
|
1358
|
+
}
|
|
1359
|
+
return /* @__PURE__ */ jsx(DialogRoot, { open, onOpenChange: (v) => !v && onClose(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "gap-0 overflow-hidden p-0 sm:max-w-xl", children: [
|
|
1360
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-b border-taupe-100 px-4", children: [
|
|
1361
|
+
/* @__PURE__ */ jsx(Search, { size: 16, className: "shrink-0 text-taupe-400" }),
|
|
1362
|
+
/* @__PURE__ */ jsx(
|
|
1363
|
+
"input",
|
|
1364
|
+
{
|
|
1365
|
+
ref: inputRef,
|
|
1366
|
+
type: "text",
|
|
1367
|
+
className: "h-12 flex-1 bg-transparent body text-taupe-900 placeholder:text-taupe-400 focus:outline-none",
|
|
1368
|
+
placeholder,
|
|
1369
|
+
value: query,
|
|
1370
|
+
onChange: (e) => setQuery(e.target.value),
|
|
1371
|
+
onKeyDown: (e) => {
|
|
1372
|
+
if (e.key === "Escape") onClose();
|
|
1373
|
+
if (e.key === "Enter" && filtered.length > 0) handleSelect(filtered[0]);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
),
|
|
1377
|
+
/* @__PURE__ */ jsx("kbd", { className: "hidden items-center gap-0.5 sm:flex", children: /* @__PURE__ */ jsx("span", { className: "caption-xs font-medium text-taupe-400 rounded border border-taupe-200 px-1.5 py-0.5", children: "esc" }) })
|
|
1378
|
+
] }),
|
|
1379
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-80 overflow-y-auto", children: filtered.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-4 py-8 text-center body text-taupe-400", children: emptyText }) : /* @__PURE__ */ jsx("ul", { role: "list", className: "py-2", children: categories.map((cat) => /* @__PURE__ */ jsxs("li", { children: [
|
|
1380
|
+
cat && /* @__PURE__ */ jsx("p", { className: "label px-4 py-2 text-taupe-400", children: cat }),
|
|
1381
|
+
grouped[cat].map((item, i) => /* @__PURE__ */ jsxs(
|
|
1382
|
+
"button",
|
|
1383
|
+
{
|
|
1384
|
+
type: "button",
|
|
1385
|
+
className: "flex w-full items-center gap-3 px-4 py-2.5 body text-left transition-colors hover:bg-taupe-50 focus-visible:bg-taupe-50 focus-visible:outline-none",
|
|
1386
|
+
onClick: () => handleSelect(item),
|
|
1387
|
+
children: [
|
|
1388
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-lg border border-taupe-200 bg-white text-taupe-500", children: item.icon }),
|
|
1389
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1390
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-taupe-900 truncate", children: item.label }),
|
|
1391
|
+
item.description && /* @__PURE__ */ jsx("p", { className: "caption text-taupe-400 truncate", children: item.description })
|
|
1392
|
+
] }),
|
|
1393
|
+
/* @__PURE__ */ jsx(ArrowRight, { size: 13, className: "shrink-0 text-taupe-300" })
|
|
1394
|
+
]
|
|
1395
|
+
},
|
|
1396
|
+
item.id ?? i
|
|
1397
|
+
))
|
|
1398
|
+
] }, cat)) }) })
|
|
1399
|
+
] }) });
|
|
1400
|
+
}
|
|
1401
|
+
var CommandCtx = React15.createContext({
|
|
1402
|
+
query: "",
|
|
1403
|
+
setQuery: () => {
|
|
1404
|
+
},
|
|
1405
|
+
reportVisible: () => {
|
|
1406
|
+
}
|
|
1407
|
+
});
|
|
1408
|
+
var CommandVisibleCtx = React15.createContext(0);
|
|
1409
|
+
function Command({ className, children, onSelect, ...props }) {
|
|
1410
|
+
const [query, setQuery] = React15.useState("");
|
|
1411
|
+
const visibleIds = React15.useRef(/* @__PURE__ */ new Set());
|
|
1412
|
+
const [visibleCount, setVisibleCount] = React15.useState(0);
|
|
1413
|
+
const reportVisible = React15.useCallback((id, visible) => {
|
|
1414
|
+
const had = visibleIds.current.has(id);
|
|
1415
|
+
if (visible && !had) {
|
|
1416
|
+
visibleIds.current.add(id);
|
|
1417
|
+
setVisibleCount(visibleIds.current.size);
|
|
1418
|
+
} else if (!visible && had) {
|
|
1419
|
+
visibleIds.current.delete(id);
|
|
1420
|
+
setVisibleCount(visibleIds.current.size);
|
|
1421
|
+
}
|
|
1422
|
+
}, []);
|
|
1423
|
+
return /* @__PURE__ */ jsx(CommandCtx.Provider, { value: { query, setQuery, onSelect, reportVisible }, children: /* @__PURE__ */ jsx(CommandVisibleCtx.Provider, { value: visibleCount, children: /* @__PURE__ */ jsx(
|
|
1424
|
+
"div",
|
|
1425
|
+
{
|
|
1426
|
+
className: cn(
|
|
1427
|
+
"flex flex-col overflow-hidden rounded-xl border border-taupe-200 bg-white",
|
|
1428
|
+
className
|
|
1429
|
+
),
|
|
1430
|
+
...props,
|
|
1431
|
+
children
|
|
1432
|
+
}
|
|
1433
|
+
) }) });
|
|
1434
|
+
}
|
|
1435
|
+
var CommandInput = React15.forwardRef(({ className, ...props }, ref) => {
|
|
1436
|
+
const { query, setQuery } = React15.useContext(CommandCtx);
|
|
1437
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b border-taupe-100 px-3", children: [
|
|
1438
|
+
/* @__PURE__ */ jsx(Search, { size: 14, className: "shrink-0 text-taupe-400" }),
|
|
1439
|
+
/* @__PURE__ */ jsx(
|
|
1440
|
+
"input",
|
|
1441
|
+
{
|
|
1442
|
+
ref,
|
|
1443
|
+
type: "text",
|
|
1444
|
+
autoComplete: "off",
|
|
1445
|
+
autoCorrect: "off",
|
|
1446
|
+
spellCheck: false,
|
|
1447
|
+
className: cn(
|
|
1448
|
+
"flex h-10 w-full bg-transparent body text-taupe-900",
|
|
1449
|
+
"placeholder:text-taupe-400 focus:outline-none",
|
|
1450
|
+
className
|
|
1451
|
+
),
|
|
1452
|
+
value: query,
|
|
1453
|
+
onChange: (e) => setQuery(e.target.value),
|
|
1454
|
+
...props
|
|
1455
|
+
}
|
|
1456
|
+
)
|
|
1457
|
+
] });
|
|
1458
|
+
});
|
|
1459
|
+
CommandInput.displayName = "CommandInput";
|
|
1460
|
+
var CommandList = React15.forwardRef(
|
|
1461
|
+
({ className, ...props }, ref) => {
|
|
1462
|
+
const listRef = React15.useRef(null);
|
|
1463
|
+
const combinedRef = React15.useCallback(
|
|
1464
|
+
(el) => {
|
|
1465
|
+
listRef.current = el;
|
|
1466
|
+
if (typeof ref === "function") ref(el);
|
|
1467
|
+
else if (ref) ref.current = el;
|
|
1468
|
+
},
|
|
1469
|
+
[ref]
|
|
1470
|
+
);
|
|
1471
|
+
const handleKeyDown = (e) => {
|
|
1472
|
+
if (!["ArrowDown", "ArrowUp"].includes(e.key)) return;
|
|
1473
|
+
e.preventDefault();
|
|
1474
|
+
const el = listRef.current;
|
|
1475
|
+
if (!el) return;
|
|
1476
|
+
const items = Array.from(
|
|
1477
|
+
el.querySelectorAll("[data-cmd-item]:not([aria-disabled='true'])")
|
|
1478
|
+
);
|
|
1479
|
+
if (!items.length) return;
|
|
1480
|
+
const focused = el.querySelector("[data-cmd-item]:focus");
|
|
1481
|
+
const idx = focused ? items.indexOf(focused) : -1;
|
|
1482
|
+
const next = e.key === "ArrowDown" ? items[Math.min(idx + 1, items.length - 1)] : items[Math.max(idx - 1, 0)];
|
|
1483
|
+
next?.focus();
|
|
1484
|
+
};
|
|
1485
|
+
return /* @__PURE__ */ jsx(
|
|
1486
|
+
"div",
|
|
1487
|
+
{
|
|
1488
|
+
ref: combinedRef,
|
|
1489
|
+
role: "listbox",
|
|
1490
|
+
onKeyDown: handleKeyDown,
|
|
1491
|
+
className: cn("max-h-[300px] overflow-y-auto py-1", className),
|
|
1492
|
+
...props
|
|
1493
|
+
}
|
|
1494
|
+
);
|
|
1495
|
+
}
|
|
1496
|
+
);
|
|
1497
|
+
CommandList.displayName = "CommandList";
|
|
1498
|
+
var CommandEmpty = React15.forwardRef(
|
|
1499
|
+
({ className, children = "No results found.", ...props }, ref) => {
|
|
1500
|
+
const visibleCount = React15.useContext(CommandVisibleCtx);
|
|
1501
|
+
if (visibleCount > 0) return null;
|
|
1502
|
+
return /* @__PURE__ */ jsx(
|
|
1503
|
+
"div",
|
|
1504
|
+
{
|
|
1505
|
+
ref,
|
|
1506
|
+
className: cn("py-6 text-center caption text-taupe-400", className),
|
|
1507
|
+
...props,
|
|
1508
|
+
children
|
|
1509
|
+
}
|
|
1510
|
+
);
|
|
1511
|
+
}
|
|
1512
|
+
);
|
|
1513
|
+
CommandEmpty.displayName = "CommandEmpty";
|
|
1514
|
+
var CommandGroup = React15.forwardRef(
|
|
1515
|
+
({ className, heading, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { ref, role: "group", className: cn("py-1", className), ...props, children: [
|
|
1516
|
+
heading && /* @__PURE__ */ jsx("p", { className: "px-3 pb-1 pt-0.5 label text-taupe-400", children: heading }),
|
|
1517
|
+
children
|
|
1518
|
+
] })
|
|
1519
|
+
);
|
|
1520
|
+
CommandGroup.displayName = "CommandGroup";
|
|
1521
|
+
var CommandItem = React15.forwardRef(
|
|
1522
|
+
({ className, value = "", keywords, disabled, onSelect, children, ...props }, ref) => {
|
|
1523
|
+
const { query, onSelect: ctxOnSelect, reportVisible } = React15.useContext(CommandCtx);
|
|
1524
|
+
const id = React15.useId();
|
|
1525
|
+
const searchText = (keywords ?? [value]).join(" ").toLowerCase();
|
|
1526
|
+
const isVisible = !query || searchText.includes(query.toLowerCase());
|
|
1527
|
+
React15.useLayoutEffect(() => {
|
|
1528
|
+
reportVisible(id, isVisible && !disabled);
|
|
1529
|
+
return () => reportVisible(id, false);
|
|
1530
|
+
}, [id, isVisible, disabled, reportVisible]);
|
|
1531
|
+
if (!isVisible) return null;
|
|
1532
|
+
const handleSelect = () => {
|
|
1533
|
+
if (disabled) return;
|
|
1534
|
+
onSelect?.(value);
|
|
1535
|
+
ctxOnSelect?.(value);
|
|
1536
|
+
};
|
|
1537
|
+
return /* @__PURE__ */ jsx(
|
|
1538
|
+
"div",
|
|
1539
|
+
{
|
|
1540
|
+
ref,
|
|
1541
|
+
role: "option",
|
|
1542
|
+
"aria-selected": false,
|
|
1543
|
+
"aria-disabled": disabled || void 0,
|
|
1544
|
+
"data-cmd-item": true,
|
|
1545
|
+
tabIndex: disabled ? void 0 : 0,
|
|
1546
|
+
className: cn(
|
|
1547
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md px-2.5 py-1.5 mx-1",
|
|
1548
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
1549
|
+
"hover:bg-taupe-50 hover:text-taupe-900",
|
|
1550
|
+
"focus:bg-taupe-50 focus:text-taupe-900",
|
|
1551
|
+
disabled && "pointer-events-none opacity-40",
|
|
1552
|
+
className
|
|
1553
|
+
),
|
|
1554
|
+
onClick: handleSelect,
|
|
1555
|
+
onKeyDown: (e) => {
|
|
1556
|
+
if (e.key === "Enter") {
|
|
1557
|
+
e.preventDefault();
|
|
1558
|
+
handleSelect();
|
|
1559
|
+
}
|
|
1560
|
+
},
|
|
1561
|
+
...props,
|
|
1562
|
+
children
|
|
1563
|
+
}
|
|
1564
|
+
);
|
|
1565
|
+
}
|
|
1566
|
+
);
|
|
1567
|
+
CommandItem.displayName = "CommandItem";
|
|
1568
|
+
var CommandSeparator = React15.forwardRef(
|
|
1569
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("my-1 h-px bg-taupe-100", className), ...props })
|
|
1570
|
+
);
|
|
1571
|
+
CommandSeparator.displayName = "CommandSeparator";
|
|
1572
|
+
function CommandShortcut({ className, ...props }) {
|
|
1573
|
+
return /* @__PURE__ */ jsx(
|
|
1574
|
+
"span",
|
|
1575
|
+
{
|
|
1576
|
+
className: cn("ml-auto caption text-taupe-300 tracking-widest font-medium", className),
|
|
1577
|
+
...props
|
|
1578
|
+
}
|
|
1579
|
+
);
|
|
1580
|
+
}
|
|
1581
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
1582
|
+
var ContextMenuRoot = ContextMenu.Root;
|
|
1583
|
+
var ContextMenuTrigger = ContextMenu.Trigger;
|
|
1584
|
+
var ContextMenuGroup = ContextMenu.Group;
|
|
1585
|
+
var ContextMenuPortal = ContextMenu.Portal;
|
|
1586
|
+
var ContextMenuSub = ContextMenu.Sub;
|
|
1587
|
+
var ContextMenuRadioGroup = ContextMenu.RadioGroup;
|
|
1588
|
+
var ContextMenuContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenu.Portal, { children: /* @__PURE__ */ jsx(
|
|
1589
|
+
ContextMenu.Content,
|
|
1590
|
+
{
|
|
1591
|
+
ref,
|
|
1592
|
+
className: cn(
|
|
1593
|
+
"z-50 min-w-[8rem] bg-white rounded-xl shadow-natural p-1",
|
|
1594
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1595
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1596
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
1597
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1598
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
1599
|
+
className
|
|
1600
|
+
),
|
|
1601
|
+
...props
|
|
1602
|
+
}
|
|
1603
|
+
) }));
|
|
1604
|
+
ContextMenuContent.displayName = "ContextMenuContent";
|
|
1605
|
+
var ContextMenuItem = React15.forwardRef(({ className, inset, destructive, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1606
|
+
ContextMenu.Item,
|
|
1607
|
+
{
|
|
1608
|
+
ref,
|
|
1609
|
+
className: cn(
|
|
1610
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md px-2.5 py-1.5",
|
|
1611
|
+
"body outline-none transition-colors",
|
|
1612
|
+
destructive ? "text-red-600 focus:bg-red-50 focus:text-red-700" : "text-taupe-700 focus:bg-taupe-50 focus:text-taupe-900",
|
|
1613
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1614
|
+
inset && "pl-8",
|
|
1615
|
+
className
|
|
1616
|
+
),
|
|
1617
|
+
...props
|
|
1618
|
+
}
|
|
1619
|
+
));
|
|
1620
|
+
ContextMenuItem.displayName = "ContextMenuItem";
|
|
1621
|
+
var ContextMenuCheckboxItem = React15.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1622
|
+
ContextMenu.CheckboxItem,
|
|
1623
|
+
{
|
|
1624
|
+
ref,
|
|
1625
|
+
className: cn(
|
|
1626
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md pl-8 pr-2.5 py-1.5",
|
|
1627
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
1628
|
+
"focus:bg-taupe-50 focus:text-taupe-900",
|
|
1629
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1630
|
+
className
|
|
1631
|
+
),
|
|
1632
|
+
checked,
|
|
1633
|
+
...props,
|
|
1634
|
+
children: [
|
|
1635
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { size: 13, className: "text-taupe-900" }) }) }),
|
|
1636
|
+
children
|
|
1637
|
+
]
|
|
1638
|
+
}
|
|
1639
|
+
));
|
|
1640
|
+
ContextMenuCheckboxItem.displayName = "ContextMenuCheckboxItem";
|
|
1641
|
+
var ContextMenuRadioItem = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1642
|
+
ContextMenu.RadioItem,
|
|
1643
|
+
{
|
|
1644
|
+
ref,
|
|
1645
|
+
className: cn(
|
|
1646
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md pl-8 pr-2.5 py-1.5",
|
|
1647
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
1648
|
+
"focus:bg-taupe-50 focus:text-taupe-900",
|
|
1649
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1650
|
+
className
|
|
1651
|
+
),
|
|
1652
|
+
...props,
|
|
1653
|
+
children: [
|
|
1654
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { size: 8, className: "fill-taupe-900 text-taupe-900" }) }) }),
|
|
1655
|
+
children
|
|
1656
|
+
]
|
|
1657
|
+
}
|
|
1658
|
+
));
|
|
1659
|
+
ContextMenuRadioItem.displayName = "ContextMenuRadioItem";
|
|
1660
|
+
var ContextMenuLabel = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1661
|
+
ContextMenu.Label,
|
|
1662
|
+
{
|
|
1663
|
+
ref,
|
|
1664
|
+
className: cn("px-2.5 py-1 label text-taupe-400", inset && "pl-8", className),
|
|
1665
|
+
...props
|
|
1666
|
+
}
|
|
1667
|
+
));
|
|
1668
|
+
ContextMenuLabel.displayName = "ContextMenuLabel";
|
|
1669
|
+
var ContextMenuSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1670
|
+
ContextMenu.Separator,
|
|
1671
|
+
{
|
|
1672
|
+
ref,
|
|
1673
|
+
className: cn("mx-1 my-1 h-px bg-taupe-100", className),
|
|
1674
|
+
...props
|
|
1675
|
+
}
|
|
1676
|
+
));
|
|
1677
|
+
ContextMenuSeparator.displayName = "ContextMenuSeparator";
|
|
1678
|
+
var ContextMenuSubTrigger = React15.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1679
|
+
ContextMenu.SubTrigger,
|
|
1680
|
+
{
|
|
1681
|
+
ref,
|
|
1682
|
+
className: cn(
|
|
1683
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md px-2.5 py-1.5",
|
|
1684
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
1685
|
+
"focus:bg-taupe-50 focus:text-taupe-900 data-[state=open]:bg-taupe-50",
|
|
1686
|
+
inset && "pl-8",
|
|
1687
|
+
className
|
|
1688
|
+
),
|
|
1689
|
+
...props,
|
|
1690
|
+
children: [
|
|
1691
|
+
children,
|
|
1692
|
+
/* @__PURE__ */ jsx(ChevronRight, { size: 14, className: "ml-auto text-taupe-400" })
|
|
1693
|
+
]
|
|
1694
|
+
}
|
|
1695
|
+
));
|
|
1696
|
+
ContextMenuSubTrigger.displayName = "ContextMenuSubTrigger";
|
|
1697
|
+
var ContextMenuSubContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1698
|
+
ContextMenu.SubContent,
|
|
1699
|
+
{
|
|
1700
|
+
ref,
|
|
1701
|
+
className: cn(
|
|
1702
|
+
"z-50 min-w-[8rem] bg-white rounded-xl border border-taupe-100 shadow-natural p-1",
|
|
1703
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1704
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1705
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
1706
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
1707
|
+
className
|
|
1708
|
+
),
|
|
1709
|
+
...props
|
|
1710
|
+
}
|
|
1711
|
+
));
|
|
1712
|
+
ContextMenuSubContent.displayName = "ContextMenuSubContent";
|
|
1713
|
+
function ContextMenuShortcut({ className, ...props }) {
|
|
1714
|
+
return /* @__PURE__ */ jsx("span", { className: cn("ml-auto caption text-taupe-400", className), ...props });
|
|
1715
|
+
}
|
|
1716
|
+
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
1717
|
+
var Table = React15.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1718
|
+
"div",
|
|
1719
|
+
{
|
|
1720
|
+
className: cn(
|
|
1721
|
+
"w-full overflow-hidden rounded-xl border border-taupe-100 bg-white",
|
|
1722
|
+
containerClassName
|
|
1723
|
+
),
|
|
1724
|
+
children: /* @__PURE__ */ jsx(
|
|
1725
|
+
"table",
|
|
1726
|
+
{
|
|
1727
|
+
ref,
|
|
1728
|
+
className: cn("min-w-full caption-bottom divide-y divide-taupe-200", className),
|
|
1729
|
+
...props
|
|
1730
|
+
}
|
|
1731
|
+
)
|
|
1732
|
+
}
|
|
1733
|
+
));
|
|
1734
|
+
Table.displayName = "Table";
|
|
1735
|
+
var TableHeader = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("bg-taupe-50", className), ...props }));
|
|
1736
|
+
TableHeader.displayName = "TableHeader";
|
|
1737
|
+
var TableBody = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("divide-y divide-taupe-100 bg-white", className), ...props }));
|
|
1738
|
+
TableBody.displayName = "TableBody";
|
|
1739
|
+
var TableFooter = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tfoot", { ref, className: cn("bg-taupe-50 font-medium", className), ...props }));
|
|
1740
|
+
TableFooter.displayName = "TableFooter";
|
|
1741
|
+
var TableRow = React15.forwardRef(
|
|
1742
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1743
|
+
"tr",
|
|
1744
|
+
{
|
|
1745
|
+
ref,
|
|
1746
|
+
className: cn(
|
|
1747
|
+
"transition-colors hover:bg-taupe-50/50 data-[state=selected]:bg-taupe-50",
|
|
1748
|
+
className
|
|
1749
|
+
),
|
|
1750
|
+
...props
|
|
1751
|
+
}
|
|
1752
|
+
)
|
|
1753
|
+
);
|
|
1754
|
+
TableRow.displayName = "TableRow";
|
|
1755
|
+
var TableHead = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1756
|
+
"th",
|
|
1757
|
+
{
|
|
1758
|
+
ref,
|
|
1759
|
+
className: cn(
|
|
1760
|
+
"px-6 py-3 text-left align-middle label text-taupe-400",
|
|
1761
|
+
"[&:has([role=checkbox])]:pr-0",
|
|
1762
|
+
className
|
|
1763
|
+
),
|
|
1764
|
+
...props
|
|
1765
|
+
}
|
|
1766
|
+
));
|
|
1767
|
+
TableHead.displayName = "TableHead";
|
|
1768
|
+
var TableCell = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1769
|
+
"td",
|
|
1770
|
+
{
|
|
1771
|
+
ref,
|
|
1772
|
+
className: cn(
|
|
1773
|
+
"px-6 py-4 align-middle body text-taupe-500",
|
|
1774
|
+
"[&:has([role=checkbox])]:pr-0",
|
|
1775
|
+
className
|
|
1776
|
+
),
|
|
1777
|
+
...props
|
|
1778
|
+
}
|
|
1779
|
+
));
|
|
1780
|
+
TableCell.displayName = "TableCell";
|
|
1781
|
+
var TableCaption = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn("mt-4 caption text-taupe-400", className), ...props }));
|
|
1782
|
+
TableCaption.displayName = "TableCaption";
|
|
1783
|
+
function Input({ className, type, ...props }) {
|
|
1784
|
+
return /* @__PURE__ */ jsx(
|
|
1785
|
+
"input",
|
|
1786
|
+
{
|
|
1787
|
+
type,
|
|
1788
|
+
"data-slot": "input",
|
|
1789
|
+
className: cn(
|
|
1790
|
+
"flex h-9 w-full rounded-md border border-taupe-200 bg-white px-3 py-1",
|
|
1791
|
+
"body text-taupe-900 placeholder:text-taupe-400",
|
|
1792
|
+
"transition-colors duration-150",
|
|
1793
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/20 focus-visible:border-brand-primary",
|
|
1794
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-taupe-50",
|
|
1795
|
+
"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-taupe-900",
|
|
1796
|
+
className
|
|
1797
|
+
),
|
|
1798
|
+
...props
|
|
1799
|
+
}
|
|
1800
|
+
);
|
|
1801
|
+
}
|
|
1802
|
+
function DataTable({
|
|
1803
|
+
columns,
|
|
1804
|
+
data,
|
|
1805
|
+
searchKey,
|
|
1806
|
+
searchPlaceholder = "Search...",
|
|
1807
|
+
pageSize = 10,
|
|
1808
|
+
showPagination = true
|
|
1809
|
+
}) {
|
|
1810
|
+
const [sorting, setSorting] = React15.useState([]);
|
|
1811
|
+
const [columnFilters, setColumnFilters] = React15.useState([]);
|
|
1812
|
+
const table = useReactTable({
|
|
1813
|
+
data,
|
|
1814
|
+
columns,
|
|
1815
|
+
getCoreRowModel: getCoreRowModel(),
|
|
1816
|
+
getSortedRowModel: getSortedRowModel(),
|
|
1817
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
1818
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
1819
|
+
onSortingChange: setSorting,
|
|
1820
|
+
onColumnFiltersChange: setColumnFilters,
|
|
1821
|
+
state: { sorting, columnFilters },
|
|
1822
|
+
initialState: { pagination: { pageSize } }
|
|
1823
|
+
});
|
|
1824
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
1825
|
+
searchKey && /* @__PURE__ */ jsx(
|
|
1826
|
+
Input,
|
|
1827
|
+
{
|
|
1828
|
+
placeholder: searchPlaceholder,
|
|
1829
|
+
value: table.getColumn(searchKey)?.getFilterValue() ?? "",
|
|
1830
|
+
onChange: (e) => table.getColumn(searchKey)?.setFilterValue(e.target.value),
|
|
1831
|
+
className: "max-w-sm"
|
|
1832
|
+
}
|
|
1833
|
+
),
|
|
1834
|
+
/* @__PURE__ */ jsxs(Table, { children: [
|
|
1835
|
+
/* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(TableHead, { children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsxs(
|
|
1836
|
+
"button",
|
|
1837
|
+
{
|
|
1838
|
+
className: cn(
|
|
1839
|
+
"flex items-center gap-1 transition-colors hover:text-taupe-700",
|
|
1840
|
+
header.column.getIsSorted() && "text-taupe-900"
|
|
1841
|
+
),
|
|
1842
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
1843
|
+
children: [
|
|
1844
|
+
flexRender(header.column.columnDef.header, header.getContext()),
|
|
1845
|
+
header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx(ChevronUp, { size: 12, className: "text-brand-primary" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx(ChevronDown, { size: 12, className: "text-brand-primary" }) : /* @__PURE__ */ jsx(ChevronsUpDown, { size: 12, className: "text-taupe-300" })
|
|
1846
|
+
]
|
|
1847
|
+
}
|
|
1848
|
+
) : flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }, headerGroup.id)) }),
|
|
1849
|
+
/* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: columns.length, className: "h-24 text-center text-taupe-400", children: "No results." }) }) })
|
|
1850
|
+
] }),
|
|
1851
|
+
showPagination && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
1852
|
+
/* @__PURE__ */ jsxs("p", { className: "caption text-taupe-400", children: [
|
|
1853
|
+
table.getFilteredRowModel().rows.length,
|
|
1854
|
+
" result",
|
|
1855
|
+
table.getFilteredRowModel().rows.length !== 1 ? "s" : ""
|
|
1856
|
+
] }),
|
|
1857
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1858
|
+
/* @__PURE__ */ jsxs("span", { className: "caption text-taupe-400", children: [
|
|
1859
|
+
"Page ",
|
|
1860
|
+
table.getState().pagination.pageIndex + 1,
|
|
1861
|
+
" of ",
|
|
1862
|
+
table.getPageCount()
|
|
1863
|
+
] }),
|
|
1864
|
+
/* @__PURE__ */ jsx(
|
|
1865
|
+
Button,
|
|
1866
|
+
{
|
|
1867
|
+
variant: "outline",
|
|
1868
|
+
size: "sm",
|
|
1869
|
+
onClick: () => table.previousPage(),
|
|
1870
|
+
disabled: !table.getCanPreviousPage(),
|
|
1871
|
+
children: "Previous"
|
|
1872
|
+
}
|
|
1873
|
+
),
|
|
1874
|
+
/* @__PURE__ */ jsx(
|
|
1875
|
+
Button,
|
|
1876
|
+
{
|
|
1877
|
+
variant: "outline",
|
|
1878
|
+
size: "sm",
|
|
1879
|
+
onClick: () => table.nextPage(),
|
|
1880
|
+
disabled: !table.getCanNextPage(),
|
|
1881
|
+
children: "Next"
|
|
1882
|
+
}
|
|
1883
|
+
)
|
|
1884
|
+
] })
|
|
1885
|
+
] })
|
|
1886
|
+
] });
|
|
1887
|
+
}
|
|
1888
|
+
var PopoverRoot = Popover.Root;
|
|
1889
|
+
var PopoverTrigger = Popover.Trigger;
|
|
1890
|
+
var PopoverClose = Popover.Close;
|
|
1891
|
+
var PopoverContent = React15.forwardRef(({ className, align = "center", sideOffset = 6, ...props }, ref) => /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(
|
|
1892
|
+
Popover.Content,
|
|
1893
|
+
{
|
|
1894
|
+
ref,
|
|
1895
|
+
align,
|
|
1896
|
+
sideOffset,
|
|
1897
|
+
className: cn(
|
|
1898
|
+
"z-50 w-72 rounded-xl bg-white p-4 shadow-natural outline-none",
|
|
1899
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1900
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1901
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
1902
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1903
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
1904
|
+
className
|
|
1905
|
+
),
|
|
1906
|
+
...props
|
|
1907
|
+
}
|
|
1908
|
+
) }));
|
|
1909
|
+
PopoverContent.displayName = "PopoverContent";
|
|
1910
|
+
var formatDate = (date) => date.toLocaleDateString("en-US", {
|
|
1911
|
+
month: "long",
|
|
1912
|
+
day: "numeric",
|
|
1913
|
+
year: "numeric"
|
|
1914
|
+
});
|
|
1915
|
+
function DatePicker({
|
|
1916
|
+
value,
|
|
1917
|
+
onChange,
|
|
1918
|
+
placeholder = "Pick a date",
|
|
1919
|
+
disabled,
|
|
1920
|
+
className
|
|
1921
|
+
}) {
|
|
1922
|
+
return /* @__PURE__ */ jsxs(PopoverRoot, { children: [
|
|
1923
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1924
|
+
Button,
|
|
1925
|
+
{
|
|
1926
|
+
variant: "outline",
|
|
1927
|
+
className: cn(
|
|
1928
|
+
"w-[240px] justify-start gap-2 text-left font-normal",
|
|
1929
|
+
!value && "text-taupe-400",
|
|
1930
|
+
className
|
|
1931
|
+
),
|
|
1932
|
+
disabled,
|
|
1933
|
+
children: [
|
|
1934
|
+
/* @__PURE__ */ jsx(CalendarIcon, { size: 14, className: "text-taupe-400 shrink-0" }),
|
|
1935
|
+
value ? formatDate(value) : /* @__PURE__ */ jsx("span", { children: placeholder })
|
|
1936
|
+
]
|
|
1937
|
+
}
|
|
1938
|
+
) }),
|
|
1939
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0 shadow-elevated", align: "start", children: /* @__PURE__ */ jsx(Calendar, { mode: "single", selected: value, onSelect: onChange, autoFocus: true }) })
|
|
1940
|
+
] });
|
|
1941
|
+
}
|
|
1942
|
+
DatePicker.displayName = "DatePicker";
|
|
1943
|
+
function DescriptionList({
|
|
1944
|
+
title,
|
|
1945
|
+
description,
|
|
1946
|
+
items,
|
|
1947
|
+
columns = 1,
|
|
1948
|
+
striped = false,
|
|
1949
|
+
className
|
|
1950
|
+
}) {
|
|
1951
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
1952
|
+
(title || description) && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
1953
|
+
title && /* @__PURE__ */ jsx("p", { className: "body font-semibold text-taupe-900", children: title }),
|
|
1954
|
+
description && /* @__PURE__ */ jsx("p", { className: "mt-1 caption text-taupe-400", children: description })
|
|
1955
|
+
] }),
|
|
1956
|
+
/* @__PURE__ */ jsx("dl", { className: cn("border-t border-taupe-100", columns === 2 && "sm:grid sm:grid-cols-2"), children: items.map((item, i) => /* @__PURE__ */ jsxs(
|
|
1957
|
+
"div",
|
|
1958
|
+
{
|
|
1959
|
+
className: cn(
|
|
1960
|
+
"py-3.5",
|
|
1961
|
+
columns === 1 ? "grid grid-cols-3 gap-4 items-baseline" : "flex flex-col gap-1 border-b border-taupe-100",
|
|
1962
|
+
columns === 1 && i !== items.length - 1 && "border-b border-taupe-100",
|
|
1963
|
+
striped && i % 2 === 0 && "bg-taupe-50 -mx-4 px-4 rounded"
|
|
1964
|
+
),
|
|
1965
|
+
children: [
|
|
1966
|
+
/* @__PURE__ */ jsx("dt", { className: "caption font-semibold text-taupe-500 uppercase tracking-wide", children: item.term }),
|
|
1967
|
+
/* @__PURE__ */ jsx("dd", { className: cn("body text-taupe-900", columns === 1 ? "col-span-2" : ""), children: item.action ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
1968
|
+
/* @__PURE__ */ jsx("span", { children: item.details }),
|
|
1969
|
+
item.action
|
|
1970
|
+
] }) : item.details })
|
|
1971
|
+
]
|
|
1972
|
+
},
|
|
1973
|
+
i
|
|
1974
|
+
)) })
|
|
1975
|
+
] });
|
|
1976
|
+
}
|
|
1977
|
+
var DrawerRoot = Drawer.Root;
|
|
1978
|
+
var DrawerTrigger = Drawer.Trigger;
|
|
1979
|
+
var DrawerPortal = Drawer.Portal;
|
|
1980
|
+
var DrawerClose = Drawer.Close;
|
|
1981
|
+
var DrawerOverlay = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1982
|
+
Drawer.Overlay,
|
|
1983
|
+
{
|
|
1984
|
+
ref,
|
|
1985
|
+
className: cn("fixed inset-0 z-50 bg-taupe-950/40 backdrop-blur-[1px]", className),
|
|
1986
|
+
...props
|
|
1987
|
+
}
|
|
1988
|
+
));
|
|
1989
|
+
DrawerOverlay.displayName = "DrawerOverlay";
|
|
1990
|
+
var DrawerContent = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPortal, { children: [
|
|
1991
|
+
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
1992
|
+
/* @__PURE__ */ jsxs(
|
|
1993
|
+
Drawer.Content,
|
|
1994
|
+
{
|
|
1995
|
+
ref,
|
|
1996
|
+
className: cn(
|
|
1997
|
+
"fixed inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl border border-taupe-100 bg-white",
|
|
1998
|
+
className
|
|
1999
|
+
),
|
|
2000
|
+
...props,
|
|
2001
|
+
children: [
|
|
2002
|
+
/* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-1 w-12 rounded-full bg-taupe-200" }),
|
|
2003
|
+
children
|
|
2004
|
+
]
|
|
2005
|
+
}
|
|
2006
|
+
)
|
|
2007
|
+
] }));
|
|
2008
|
+
DrawerContent.displayName = "DrawerContent";
|
|
2009
|
+
var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("grid gap-1 px-6 py-4 text-center sm:text-left", className), ...props });
|
|
2010
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
2011
|
+
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("mt-auto flex flex-col gap-2 px-6 pb-6", className), ...props });
|
|
2012
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
2013
|
+
var DrawerTitle = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2014
|
+
Drawer.Title,
|
|
2015
|
+
{
|
|
2016
|
+
ref,
|
|
2017
|
+
className: cn("subheading text-taupe-900", className),
|
|
2018
|
+
...props
|
|
2019
|
+
}
|
|
2020
|
+
));
|
|
2021
|
+
DrawerTitle.displayName = "DrawerTitle";
|
|
2022
|
+
var DrawerDescription = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2023
|
+
Drawer.Description,
|
|
2024
|
+
{
|
|
2025
|
+
ref,
|
|
2026
|
+
className: cn("body text-taupe-500", className),
|
|
2027
|
+
...props
|
|
2028
|
+
}
|
|
2029
|
+
));
|
|
2030
|
+
DrawerDescription.displayName = "DrawerDescription";
|
|
2031
|
+
var DropdownMenuRoot = DropdownMenu.Root;
|
|
2032
|
+
var DropdownMenuTrigger = DropdownMenu.Trigger;
|
|
2033
|
+
var DropdownMenuGroup = DropdownMenu.Group;
|
|
2034
|
+
var DropdownMenuPortal = DropdownMenu.Portal;
|
|
2035
|
+
var DropdownMenuSub = DropdownMenu.Sub;
|
|
2036
|
+
var DropdownMenuRadioGroup = DropdownMenu.RadioGroup;
|
|
2037
|
+
var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(
|
|
2038
|
+
DropdownMenu.Content,
|
|
2039
|
+
{
|
|
2040
|
+
ref,
|
|
2041
|
+
sideOffset,
|
|
2042
|
+
className: cn(
|
|
2043
|
+
"z-50 min-w-[8rem] bg-white rounded-xl shadow-natural p-1",
|
|
2044
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2045
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2046
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
2047
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2048
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
2049
|
+
className
|
|
2050
|
+
),
|
|
2051
|
+
...props
|
|
2052
|
+
}
|
|
2053
|
+
) }));
|
|
2054
|
+
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
2055
|
+
var DropdownMenuItem = React15.forwardRef(({ className, inset, destructive, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2056
|
+
DropdownMenu.Item,
|
|
2057
|
+
{
|
|
2058
|
+
ref,
|
|
2059
|
+
className: cn(
|
|
2060
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md px-2.5 py-1.5",
|
|
2061
|
+
"body outline-none transition-colors",
|
|
2062
|
+
destructive ? "text-red-600 focus:bg-red-50 focus:text-red-700" : "text-taupe-700 focus:bg-taupe-50 focus:text-taupe-900",
|
|
2063
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2064
|
+
inset && "pl-8",
|
|
2065
|
+
className
|
|
2066
|
+
),
|
|
2067
|
+
...props
|
|
2068
|
+
}
|
|
2069
|
+
));
|
|
2070
|
+
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
2071
|
+
var DropdownMenuCheckboxItem = React15.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
2072
|
+
DropdownMenu.CheckboxItem,
|
|
2073
|
+
{
|
|
2074
|
+
ref,
|
|
2075
|
+
className: cn(
|
|
2076
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md pl-8 pr-2.5 py-1.5",
|
|
2077
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
2078
|
+
"focus:bg-taupe-50 focus:text-taupe-900",
|
|
2079
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2080
|
+
className
|
|
2081
|
+
),
|
|
2082
|
+
checked,
|
|
2083
|
+
...props,
|
|
2084
|
+
children: [
|
|
2085
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { size: 13, className: "text-taupe-900" }) }) }),
|
|
2086
|
+
children
|
|
2087
|
+
]
|
|
2088
|
+
}
|
|
2089
|
+
));
|
|
2090
|
+
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
2091
|
+
var DropdownMenuRadioItem = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
2092
|
+
DropdownMenu.RadioItem,
|
|
2093
|
+
{
|
|
2094
|
+
ref,
|
|
2095
|
+
className: cn(
|
|
2096
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md pl-8 pr-2.5 py-1.5",
|
|
2097
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
2098
|
+
"focus:bg-taupe-50 focus:text-taupe-900",
|
|
2099
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2100
|
+
className
|
|
2101
|
+
),
|
|
2102
|
+
...props,
|
|
2103
|
+
children: [
|
|
2104
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { size: 8, className: "fill-taupe-900 text-taupe-900" }) }) }),
|
|
2105
|
+
children
|
|
2106
|
+
]
|
|
2107
|
+
}
|
|
2108
|
+
));
|
|
2109
|
+
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
2110
|
+
var DropdownMenuLabel = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2111
|
+
DropdownMenu.Label,
|
|
2112
|
+
{
|
|
2113
|
+
ref,
|
|
2114
|
+
className: cn("px-2.5 py-1 label text-taupe-400", inset && "pl-8", className),
|
|
2115
|
+
...props
|
|
2116
|
+
}
|
|
2117
|
+
));
|
|
2118
|
+
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
2119
|
+
var DropdownMenuSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2120
|
+
DropdownMenu.Separator,
|
|
2121
|
+
{
|
|
2122
|
+
ref,
|
|
2123
|
+
className: cn("mx-1 my-1 h-px bg-taupe-100", className),
|
|
2124
|
+
...props
|
|
2125
|
+
}
|
|
2126
|
+
));
|
|
2127
|
+
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
2128
|
+
var DropdownMenuSubTrigger = React15.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
2129
|
+
DropdownMenu.SubTrigger,
|
|
2130
|
+
{
|
|
2131
|
+
ref,
|
|
2132
|
+
className: cn(
|
|
2133
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md px-2.5 py-1.5",
|
|
2134
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
2135
|
+
"focus:bg-taupe-50 focus:text-taupe-900 data-[state=open]:bg-taupe-50",
|
|
2136
|
+
inset && "pl-8",
|
|
2137
|
+
className
|
|
2138
|
+
),
|
|
2139
|
+
...props,
|
|
2140
|
+
children: [
|
|
2141
|
+
children,
|
|
2142
|
+
/* @__PURE__ */ jsx(ChevronRight, { size: 14, className: "ml-auto text-taupe-400" })
|
|
2143
|
+
]
|
|
2144
|
+
}
|
|
2145
|
+
));
|
|
2146
|
+
DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
|
|
2147
|
+
var DropdownMenuSubContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2148
|
+
DropdownMenu.SubContent,
|
|
2149
|
+
{
|
|
2150
|
+
ref,
|
|
2151
|
+
className: cn(
|
|
2152
|
+
"z-50 min-w-[8rem] bg-white rounded-xl border border-taupe-100 shadow-natural p-1",
|
|
2153
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2154
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2155
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
2156
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
2157
|
+
className
|
|
2158
|
+
),
|
|
2159
|
+
...props
|
|
2160
|
+
}
|
|
2161
|
+
));
|
|
2162
|
+
DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
|
|
2163
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
2164
|
+
return /* @__PURE__ */ jsx("span", { className: cn("ml-auto caption text-taupe-400", className), ...props });
|
|
2165
|
+
}
|
|
2166
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2167
|
+
function EmptyState({ icon, title, description, action, className }) {
|
|
2168
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center gap-4 px-6 py-14 text-center", className), children: [
|
|
2169
|
+
icon && /* @__PURE__ */ jsx("div", { className: "flex size-12 items-center justify-center rounded-xl bg-brand-secondary/20 text-taupe-700", children: icon }),
|
|
2170
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
2171
|
+
/* @__PURE__ */ jsx("p", { className: "body font-semibold text-taupe-900", children: title }),
|
|
2172
|
+
description && /* @__PURE__ */ jsx("p", { className: "body max-w-xs text-taupe-400", children: description })
|
|
2173
|
+
] }),
|
|
2174
|
+
action && (action.href ? /* @__PURE__ */ jsx(Button, { size: "sm", asChild: true, children: /* @__PURE__ */ jsx("a", { href: action.href, children: action.label }) }) : /* @__PURE__ */ jsx(Button, { size: "sm", onClick: action.onClick, children: action.label }))
|
|
2175
|
+
] });
|
|
2176
|
+
}
|
|
2177
|
+
var Label = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2178
|
+
Label$1.Root,
|
|
2179
|
+
{
|
|
2180
|
+
ref,
|
|
2181
|
+
className: cn(
|
|
2182
|
+
"body font-medium leading-none text-taupe-700",
|
|
2183
|
+
"peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2184
|
+
className
|
|
2185
|
+
),
|
|
2186
|
+
...props
|
|
2187
|
+
}
|
|
2188
|
+
));
|
|
2189
|
+
Label.displayName = "Label";
|
|
2190
|
+
function Field({
|
|
2191
|
+
label,
|
|
2192
|
+
htmlFor,
|
|
2193
|
+
hint,
|
|
2194
|
+
error,
|
|
2195
|
+
required,
|
|
2196
|
+
cornerHint,
|
|
2197
|
+
className,
|
|
2198
|
+
children
|
|
2199
|
+
}) {
|
|
2200
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1.5", className), children: [
|
|
2201
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2202
|
+
/* @__PURE__ */ jsxs(Label, { htmlFor, children: [
|
|
2203
|
+
label,
|
|
2204
|
+
required && /* @__PURE__ */ jsx("span", { className: "ml-0.5 text-red-600", children: "*" })
|
|
2205
|
+
] }),
|
|
2206
|
+
cornerHint && /* @__PURE__ */ jsx("span", { className: "caption text-taupe-400", children: cornerHint })
|
|
2207
|
+
] }),
|
|
2208
|
+
children,
|
|
2209
|
+
error ? /* @__PURE__ */ jsx("p", { className: "caption text-red-600", children: error }) : hint ? /* @__PURE__ */ jsx("p", { className: "caption text-taupe-400", children: hint }) : null
|
|
2210
|
+
] });
|
|
2211
|
+
}
|
|
2212
|
+
var colMap = {
|
|
2213
|
+
2: "grid-cols-1 sm:grid-cols-2",
|
|
2214
|
+
3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
2215
|
+
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
2216
|
+
};
|
|
2217
|
+
var gapMap = {
|
|
2218
|
+
sm: "gap-3",
|
|
2219
|
+
md: "gap-4",
|
|
2220
|
+
lg: "gap-6"
|
|
2221
|
+
};
|
|
2222
|
+
function GridList({ children, columns = 3, gap = "md", className }) {
|
|
2223
|
+
return /* @__PURE__ */ jsx("ul", { role: "list", className: cn("grid", colMap[columns], gapMap[gap], className), children });
|
|
2224
|
+
}
|
|
2225
|
+
function GridListCard({
|
|
2226
|
+
title,
|
|
2227
|
+
description,
|
|
2228
|
+
meta,
|
|
2229
|
+
href,
|
|
2230
|
+
accent,
|
|
2231
|
+
trailing,
|
|
2232
|
+
className
|
|
2233
|
+
}) {
|
|
2234
|
+
const inner = /* @__PURE__ */ jsxs(
|
|
2235
|
+
"div",
|
|
2236
|
+
{
|
|
2237
|
+
className: cn(
|
|
2238
|
+
"flex h-full flex-col gap-1 rounded-xl border border-taupe-100 bg-white p-4 shadow-natural transition-shadow",
|
|
2239
|
+
href && "hover:shadow-elevated",
|
|
2240
|
+
className
|
|
2241
|
+
),
|
|
2242
|
+
children: [
|
|
2243
|
+
accent && /* @__PURE__ */ jsx("div", { className: "mb-2", children: accent }),
|
|
2244
|
+
/* @__PURE__ */ jsx("p", { className: "body font-semibold text-taupe-900", children: title }),
|
|
2245
|
+
description && /* @__PURE__ */ jsx("p", { className: "caption text-taupe-400", children: description }),
|
|
2246
|
+
(meta || trailing) && /* @__PURE__ */ jsxs("div", { className: "mt-auto flex items-center justify-between pt-3", children: [
|
|
2247
|
+
meta && /* @__PURE__ */ jsx("span", { className: "caption text-taupe-400", children: meta }),
|
|
2248
|
+
trailing && /* @__PURE__ */ jsx("span", { className: "caption text-taupe-400", children: trailing })
|
|
2249
|
+
] })
|
|
2250
|
+
]
|
|
2251
|
+
}
|
|
2252
|
+
);
|
|
2253
|
+
return /* @__PURE__ */ jsx("li", { children: href ? /* @__PURE__ */ jsx(
|
|
2254
|
+
"a",
|
|
2255
|
+
{
|
|
2256
|
+
href,
|
|
2257
|
+
className: "block h-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-taupe-400/40 rounded-xl",
|
|
2258
|
+
children: inner
|
|
2259
|
+
}
|
|
2260
|
+
) : inner });
|
|
2261
|
+
}
|
|
2262
|
+
function GridListAccentCard({
|
|
2263
|
+
title,
|
|
2264
|
+
meta,
|
|
2265
|
+
href,
|
|
2266
|
+
accentClass = "bg-taupe-900",
|
|
2267
|
+
initials,
|
|
2268
|
+
trailing,
|
|
2269
|
+
className
|
|
2270
|
+
}) {
|
|
2271
|
+
const inner = /* @__PURE__ */ jsxs(
|
|
2272
|
+
"div",
|
|
2273
|
+
{
|
|
2274
|
+
className: cn(
|
|
2275
|
+
"flex overflow-hidden rounded-xl border border-taupe-100 bg-white shadow-natural transition-shadow",
|
|
2276
|
+
href && "hover:shadow-elevated",
|
|
2277
|
+
className
|
|
2278
|
+
),
|
|
2279
|
+
children: [
|
|
2280
|
+
/* @__PURE__ */ jsx(
|
|
2281
|
+
"div",
|
|
2282
|
+
{
|
|
2283
|
+
className: cn(
|
|
2284
|
+
"flex w-14 shrink-0 items-center justify-center body font-semibold text-white",
|
|
2285
|
+
accentClass
|
|
2286
|
+
),
|
|
2287
|
+
children: initials
|
|
2288
|
+
}
|
|
2289
|
+
),
|
|
2290
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center justify-between truncate border-l border-taupe-100 px-4 py-3", children: [
|
|
2291
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2292
|
+
/* @__PURE__ */ jsx("p", { className: "body font-semibold text-taupe-900 truncate", children: title }),
|
|
2293
|
+
meta && /* @__PURE__ */ jsx("p", { className: "caption text-taupe-400", children: meta })
|
|
2294
|
+
] }),
|
|
2295
|
+
trailing && /* @__PURE__ */ jsx("div", { className: "shrink-0 pl-2", children: trailing })
|
|
2296
|
+
] })
|
|
2297
|
+
]
|
|
2298
|
+
}
|
|
2299
|
+
);
|
|
2300
|
+
return /* @__PURE__ */ jsx("li", { children: href ? /* @__PURE__ */ jsx(
|
|
2301
|
+
"a",
|
|
2302
|
+
{
|
|
2303
|
+
href,
|
|
2304
|
+
className: "block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-taupe-400/40 rounded-xl",
|
|
2305
|
+
children: inner
|
|
2306
|
+
}
|
|
2307
|
+
) : inner });
|
|
2308
|
+
}
|
|
2309
|
+
var HoverCardRoot = HoverCard.Root;
|
|
2310
|
+
var HoverCardTrigger = HoverCard.Trigger;
|
|
2311
|
+
var HoverCardContent = React15.forwardRef(({ className, align = "center", sideOffset = 6, ...props }, ref) => /* @__PURE__ */ jsx(HoverCard.Portal, { children: /* @__PURE__ */ jsx(
|
|
2312
|
+
HoverCard.Content,
|
|
2313
|
+
{
|
|
2314
|
+
ref,
|
|
2315
|
+
align,
|
|
2316
|
+
sideOffset,
|
|
2317
|
+
className: cn(
|
|
2318
|
+
"z-50 w-64 rounded-xl border border-taupe-100 bg-white p-4 shadow-elevated outline-none",
|
|
2319
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2320
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2321
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
2322
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2323
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
2324
|
+
className
|
|
2325
|
+
),
|
|
2326
|
+
...props
|
|
2327
|
+
}
|
|
2328
|
+
) }));
|
|
2329
|
+
HoverCardContent.displayName = "HoverCardContent";
|
|
2330
|
+
var InputGroup = React15.forwardRef(
|
|
2331
|
+
({
|
|
2332
|
+
leadingAddon,
|
|
2333
|
+
trailingAddon,
|
|
2334
|
+
leadingIcon,
|
|
2335
|
+
trailingIcon,
|
|
2336
|
+
trailingButton,
|
|
2337
|
+
error,
|
|
2338
|
+
pill,
|
|
2339
|
+
className,
|
|
2340
|
+
wrapperClassName,
|
|
2341
|
+
...props
|
|
2342
|
+
}, ref) => {
|
|
2343
|
+
const radius = pill ? "rounded-full" : "rounded-lg";
|
|
2344
|
+
const hasLeading = leadingAddon || leadingIcon;
|
|
2345
|
+
const hasTrailing = trailingAddon || trailingIcon || trailingButton || error;
|
|
2346
|
+
const baseInput = cn(
|
|
2347
|
+
"flex h-9 w-full border bg-white body text-taupe-900 placeholder:text-taupe-400",
|
|
2348
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:disabled:cursor-not-allowed disabled:opacity-50",
|
|
2349
|
+
error ? "border-red-400 focus-visible:ring-red-200 focus-visible:border-red-500" : "border-taupe-200 focus-visible:ring-brand-primary/20 focus-visible:border-brand-primary"
|
|
2350
|
+
);
|
|
2351
|
+
if (!hasLeading && !hasTrailing) {
|
|
2352
|
+
return /* @__PURE__ */ jsx("input", { ref, className: cn(baseInput, radius, "px-3", className), ...props });
|
|
2353
|
+
}
|
|
2354
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex", wrapperClassName), children: [
|
|
2355
|
+
leadingAddon && /* @__PURE__ */ jsx(
|
|
2356
|
+
"span",
|
|
2357
|
+
{
|
|
2358
|
+
className: cn(
|
|
2359
|
+
"inline-flex items-center border border-r-0 bg-taupe-50 px-3 body text-taupe-500 select-none",
|
|
2360
|
+
error ? "border-red-400" : "border-taupe-200",
|
|
2361
|
+
pill ? "rounded-l-full" : "rounded-l-lg"
|
|
2362
|
+
),
|
|
2363
|
+
children: leadingAddon
|
|
2364
|
+
}
|
|
2365
|
+
),
|
|
2366
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
|
|
2367
|
+
leadingIcon && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-taupe-400", children: leadingIcon }),
|
|
2368
|
+
/* @__PURE__ */ jsx(
|
|
2369
|
+
"input",
|
|
2370
|
+
{
|
|
2371
|
+
ref,
|
|
2372
|
+
className: cn(
|
|
2373
|
+
baseInput,
|
|
2374
|
+
// Border radius
|
|
2375
|
+
leadingAddon ? trailingAddon || trailingButton ? "rounded-none px-3" : pill ? "rounded-none rounded-r-full px-3" : "rounded-none rounded-r-lg px-3" : leadingIcon ? trailingAddon ? pill ? "rounded-l-full rounded-r-none pl-9 pr-3" : "rounded-l-lg rounded-r-none pl-9 pr-3" : trailingIcon || error ? cn(radius, "pl-9 pr-9") : cn(radius, "pl-9 pr-3") : trailingAddon ? pill ? "rounded-l-full rounded-r-none px-3" : "rounded-l-lg rounded-r-none px-3" : trailingIcon || error || trailingButton ? cn(radius, "pl-3 pr-9") : cn(radius, "px-3"),
|
|
2376
|
+
className
|
|
2377
|
+
),
|
|
2378
|
+
...props
|
|
2379
|
+
}
|
|
2380
|
+
),
|
|
2381
|
+
(trailingIcon || error) && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3", children: error ? /* @__PURE__ */ jsx(AlertCircle, { size: 15, className: "text-red-500" }) : /* @__PURE__ */ jsx("span", { className: "text-taupe-400", children: trailingIcon }) })
|
|
2382
|
+
] }),
|
|
2383
|
+
trailingAddon && /* @__PURE__ */ jsx(
|
|
2384
|
+
"span",
|
|
2385
|
+
{
|
|
2386
|
+
className: cn(
|
|
2387
|
+
"inline-flex items-center border border-l-0 bg-taupe-50 px-3 body text-taupe-500 select-none",
|
|
2388
|
+
error ? "border-red-400" : "border-taupe-200",
|
|
2389
|
+
pill ? "rounded-r-full" : "rounded-r-lg"
|
|
2390
|
+
),
|
|
2391
|
+
children: trailingAddon
|
|
2392
|
+
}
|
|
2393
|
+
),
|
|
2394
|
+
trailingButton && /* @__PURE__ */ jsx("div", { className: "flex", children: trailingButton })
|
|
2395
|
+
] });
|
|
2396
|
+
}
|
|
2397
|
+
);
|
|
2398
|
+
InputGroup.displayName = "InputGroup";
|
|
2399
|
+
var InputNumber = React15.forwardRef(
|
|
2400
|
+
({
|
|
2401
|
+
value,
|
|
2402
|
+
onChange,
|
|
2403
|
+
min = -Infinity,
|
|
2404
|
+
max = Infinity,
|
|
2405
|
+
step = 1,
|
|
2406
|
+
unit,
|
|
2407
|
+
precision = 0,
|
|
2408
|
+
hideSteppers = false,
|
|
2409
|
+
className,
|
|
2410
|
+
disabled,
|
|
2411
|
+
...rest
|
|
2412
|
+
}, ref) => {
|
|
2413
|
+
const [text, setText] = React15.useState(value.toFixed(precision));
|
|
2414
|
+
React15.useEffect(() => {
|
|
2415
|
+
setText(value.toFixed(precision));
|
|
2416
|
+
}, [value, precision]);
|
|
2417
|
+
const clamp = React15.useCallback((n) => Math.min(max, Math.max(min, n)), [min, max]);
|
|
2418
|
+
const commit = (raw) => {
|
|
2419
|
+
const n = parseFloat(raw);
|
|
2420
|
+
if (Number.isFinite(n)) {
|
|
2421
|
+
const next = clamp(n);
|
|
2422
|
+
onChange(next);
|
|
2423
|
+
setText(next.toFixed(precision));
|
|
2424
|
+
} else {
|
|
2425
|
+
setText(value.toFixed(precision));
|
|
2426
|
+
}
|
|
2427
|
+
};
|
|
2428
|
+
const bump = (delta) => {
|
|
2429
|
+
const next = clamp(value + delta);
|
|
2430
|
+
onChange(next);
|
|
2431
|
+
setText(next.toFixed(precision));
|
|
2432
|
+
};
|
|
2433
|
+
const onKeyDown = (e) => {
|
|
2434
|
+
if (e.key === "ArrowUp") {
|
|
2435
|
+
e.preventDefault();
|
|
2436
|
+
bump(step * (e.shiftKey ? 10 : 1));
|
|
2437
|
+
} else if (e.key === "ArrowDown") {
|
|
2438
|
+
e.preventDefault();
|
|
2439
|
+
bump(-step * (e.shiftKey ? 10 : 1));
|
|
2440
|
+
} else if (e.key === "Enter") {
|
|
2441
|
+
commit(e.target.value);
|
|
2442
|
+
}
|
|
2443
|
+
};
|
|
2444
|
+
return /* @__PURE__ */ jsxs(
|
|
2445
|
+
"div",
|
|
2446
|
+
{
|
|
2447
|
+
className: cn(
|
|
2448
|
+
"inline-flex h-8 items-stretch rounded-md border border-taupe-200 bg-white overflow-hidden",
|
|
2449
|
+
"focus-within:ring-2 focus-within:ring-brand-primary/20 focus-within:border-brand-primary",
|
|
2450
|
+
disabled && "opacity-50 pointer-events-none",
|
|
2451
|
+
className
|
|
2452
|
+
),
|
|
2453
|
+
children: [
|
|
2454
|
+
/* @__PURE__ */ jsx(
|
|
2455
|
+
"input",
|
|
2456
|
+
{
|
|
2457
|
+
ref,
|
|
2458
|
+
type: "text",
|
|
2459
|
+
inputMode: "decimal",
|
|
2460
|
+
spellCheck: false,
|
|
2461
|
+
value: text,
|
|
2462
|
+
onChange: (e) => setText(e.target.value),
|
|
2463
|
+
onBlur: (e) => commit(e.target.value),
|
|
2464
|
+
onKeyDown,
|
|
2465
|
+
disabled,
|
|
2466
|
+
className: "w-full caption text-taupe-900 px-2 bg-transparent focus:outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none text-right",
|
|
2467
|
+
...rest
|
|
2468
|
+
}
|
|
2469
|
+
),
|
|
2470
|
+
unit && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "caption-xs text-taupe-400 self-center pr-1.5 select-none", children: unit }),
|
|
2471
|
+
!hideSteppers && /* @__PURE__ */ jsxs("div", { className: "flex flex-col border-l border-taupe-100", children: [
|
|
2472
|
+
/* @__PURE__ */ jsx(
|
|
2473
|
+
"button",
|
|
2474
|
+
{
|
|
2475
|
+
type: "button",
|
|
2476
|
+
tabIndex: -1,
|
|
2477
|
+
onClick: () => bump(step),
|
|
2478
|
+
"aria-label": "Increment",
|
|
2479
|
+
className: "flex-1 px-1 hover:bg-taupe-50 active:bg-taupe-100 transition-colors text-taupe-500",
|
|
2480
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 8 5", width: "8", height: "5", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M0 5 L4 0 L8 5 Z" }) })
|
|
2481
|
+
}
|
|
2482
|
+
),
|
|
2483
|
+
/* @__PURE__ */ jsx("div", { className: "border-t border-taupe-100" }),
|
|
2484
|
+
/* @__PURE__ */ jsx(
|
|
2485
|
+
"button",
|
|
2486
|
+
{
|
|
2487
|
+
type: "button",
|
|
2488
|
+
tabIndex: -1,
|
|
2489
|
+
onClick: () => bump(-step),
|
|
2490
|
+
"aria-label": "Decrement",
|
|
2491
|
+
className: "flex-1 px-1 hover:bg-taupe-50 active:bg-taupe-100 transition-colors text-taupe-500",
|
|
2492
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 8 5", width: "8", height: "5", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M0 0 L4 5 L8 0 Z" }) })
|
|
2493
|
+
}
|
|
2494
|
+
)
|
|
2495
|
+
] })
|
|
2496
|
+
]
|
|
2497
|
+
}
|
|
2498
|
+
);
|
|
2499
|
+
}
|
|
2500
|
+
);
|
|
2501
|
+
InputNumber.displayName = "InputNumber";
|
|
2502
|
+
var InputOTP = React15.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2503
|
+
OTPInput,
|
|
2504
|
+
{
|
|
2505
|
+
ref,
|
|
2506
|
+
containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
|
|
2507
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
2508
|
+
...props
|
|
2509
|
+
}
|
|
2510
|
+
));
|
|
2511
|
+
InputOTP.displayName = "InputOTP";
|
|
2512
|
+
var InputOTPGroup = React15.forwardRef(
|
|
2513
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center", className), ...props })
|
|
2514
|
+
);
|
|
2515
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
2516
|
+
var InputOTPSlot = React15.forwardRef(({ index, className, ...props }, ref) => {
|
|
2517
|
+
const inputOTPContext = React15.useContext(OTPInputContext);
|
|
2518
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
2519
|
+
return /* @__PURE__ */ jsxs(
|
|
2520
|
+
"div",
|
|
2521
|
+
{
|
|
2522
|
+
ref,
|
|
2523
|
+
className: cn(
|
|
2524
|
+
"relative flex h-12 w-11 items-center justify-center",
|
|
2525
|
+
"border-y border-r border-taupe-200 body font-medium text-taupe-900",
|
|
2526
|
+
"first:rounded-l-xl first:border-l last:rounded-r-xl",
|
|
2527
|
+
"transition-all",
|
|
2528
|
+
isActive && "z-10 ring-2 ring-brand-primary/40 border-brand-primary",
|
|
2529
|
+
className
|
|
2530
|
+
),
|
|
2531
|
+
...props,
|
|
2532
|
+
children: [
|
|
2533
|
+
char,
|
|
2534
|
+
hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-5 w-px animate-caret-blink bg-taupe-900 duration-1000" }) })
|
|
2535
|
+
]
|
|
2536
|
+
}
|
|
2537
|
+
);
|
|
2538
|
+
});
|
|
2539
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
2540
|
+
var InputOTPSeparator = React15.forwardRef(
|
|
2541
|
+
({ ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx(Minus, { size: 14, className: "text-taupe-300" }) })
|
|
2542
|
+
);
|
|
2543
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
2544
|
+
var Kbd = React15.forwardRef(
|
|
2545
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2546
|
+
"kbd",
|
|
2547
|
+
{
|
|
2548
|
+
ref,
|
|
2549
|
+
className: cn(
|
|
2550
|
+
"inline-flex h-5 min-w-5 items-center justify-center rounded border border-taupe-200 bg-taupe-50 px-1.5 font-mono caption-xs font-medium text-taupe-500",
|
|
2551
|
+
className
|
|
2552
|
+
),
|
|
2553
|
+
...props
|
|
2554
|
+
}
|
|
2555
|
+
)
|
|
2556
|
+
);
|
|
2557
|
+
Kbd.displayName = "Kbd";
|
|
2558
|
+
var alignMap = {
|
|
2559
|
+
top: "items-start",
|
|
2560
|
+
center: "items-center",
|
|
2561
|
+
bottom: "items-end"
|
|
2562
|
+
};
|
|
2563
|
+
var gapMap2 = {
|
|
2564
|
+
sm: "gap-3",
|
|
2565
|
+
md: "gap-4",
|
|
2566
|
+
lg: "gap-6"
|
|
2567
|
+
};
|
|
2568
|
+
function MediaObject({
|
|
2569
|
+
media,
|
|
2570
|
+
children,
|
|
2571
|
+
mediaPosition = "left",
|
|
2572
|
+
align = "top",
|
|
2573
|
+
gap = "md",
|
|
2574
|
+
className
|
|
2575
|
+
}) {
|
|
2576
|
+
return /* @__PURE__ */ jsxs(
|
|
2577
|
+
"div",
|
|
2578
|
+
{
|
|
2579
|
+
className: cn(
|
|
2580
|
+
"flex",
|
|
2581
|
+
mediaPosition === "right" && "flex-row-reverse",
|
|
2582
|
+
alignMap[align],
|
|
2583
|
+
gapMap2[gap],
|
|
2584
|
+
className
|
|
2585
|
+
),
|
|
2586
|
+
children: [
|
|
2587
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0", children: media }),
|
|
2588
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children })
|
|
2589
|
+
]
|
|
2590
|
+
}
|
|
2591
|
+
);
|
|
2592
|
+
}
|
|
2593
|
+
var MenubarRoot = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2594
|
+
Menubar.Root,
|
|
2595
|
+
{
|
|
2596
|
+
ref,
|
|
2597
|
+
className: cn(
|
|
2598
|
+
"flex h-9 items-center gap-0.5 rounded-lg border border-taupe-100 bg-white px-1",
|
|
2599
|
+
className
|
|
2600
|
+
),
|
|
2601
|
+
...props
|
|
2602
|
+
}
|
|
2603
|
+
));
|
|
2604
|
+
MenubarRoot.displayName = "Menubar";
|
|
2605
|
+
var MenubarMenu = Menubar.Menu;
|
|
2606
|
+
var MenubarGroup = Menubar.Group;
|
|
2607
|
+
var MenubarSub = Menubar.Sub;
|
|
2608
|
+
var MenubarRadioGroup = Menubar.RadioGroup;
|
|
2609
|
+
var MenubarTrigger = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2610
|
+
Menubar.Trigger,
|
|
2611
|
+
{
|
|
2612
|
+
ref,
|
|
2613
|
+
className: cn(
|
|
2614
|
+
"flex cursor-default items-center rounded-md px-3 py-1 body font-medium text-taupe-700 select-none outline-none",
|
|
2615
|
+
"hover:bg-taupe-50",
|
|
2616
|
+
"data-[state=open]:bg-taupe-100 data-[state=open]:text-taupe-900",
|
|
2617
|
+
"focus:bg-taupe-50",
|
|
2618
|
+
className
|
|
2619
|
+
),
|
|
2620
|
+
...props
|
|
2621
|
+
}
|
|
2622
|
+
));
|
|
2623
|
+
MenubarTrigger.displayName = "MenubarTrigger";
|
|
2624
|
+
var MenubarContent = React15.forwardRef(({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsx(Menubar.Portal, { children: /* @__PURE__ */ jsx(
|
|
2625
|
+
Menubar.Content,
|
|
2626
|
+
{
|
|
2627
|
+
ref,
|
|
2628
|
+
align,
|
|
2629
|
+
alignOffset,
|
|
2630
|
+
sideOffset,
|
|
2631
|
+
className: cn(
|
|
2632
|
+
"z-50 min-w-[12rem] bg-white rounded-xl shadow-natural p-1",
|
|
2633
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2634
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2635
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
2636
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2637
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
2638
|
+
className
|
|
2639
|
+
),
|
|
2640
|
+
...props
|
|
2641
|
+
}
|
|
2642
|
+
) }));
|
|
2643
|
+
MenubarContent.displayName = "MenubarContent";
|
|
2644
|
+
var MenubarItem = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2645
|
+
Menubar.Item,
|
|
2646
|
+
{
|
|
2647
|
+
ref,
|
|
2648
|
+
className: cn(
|
|
2649
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md px-2.5 py-1.5",
|
|
2650
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
2651
|
+
"focus:bg-taupe-50 focus:text-taupe-900",
|
|
2652
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2653
|
+
inset && "pl-8",
|
|
2654
|
+
className
|
|
2655
|
+
),
|
|
2656
|
+
...props
|
|
2657
|
+
}
|
|
2658
|
+
));
|
|
2659
|
+
MenubarItem.displayName = "MenubarItem";
|
|
2660
|
+
var MenubarCheckboxItem = React15.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
2661
|
+
Menubar.CheckboxItem,
|
|
2662
|
+
{
|
|
2663
|
+
ref,
|
|
2664
|
+
className: cn(
|
|
2665
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md pl-8 pr-2.5 py-1.5",
|
|
2666
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
2667
|
+
"focus:bg-taupe-50 focus:text-taupe-900",
|
|
2668
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2669
|
+
className
|
|
2670
|
+
),
|
|
2671
|
+
checked,
|
|
2672
|
+
...props,
|
|
2673
|
+
children: [
|
|
2674
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(Menubar.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { size: 13, className: "text-taupe-900" }) }) }),
|
|
2675
|
+
children
|
|
2676
|
+
]
|
|
2677
|
+
}
|
|
2678
|
+
));
|
|
2679
|
+
MenubarCheckboxItem.displayName = "MenubarCheckboxItem";
|
|
2680
|
+
var MenubarRadioItem = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
2681
|
+
Menubar.RadioItem,
|
|
2682
|
+
{
|
|
2683
|
+
ref,
|
|
2684
|
+
className: cn(
|
|
2685
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md pl-8 pr-2.5 py-1.5",
|
|
2686
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
2687
|
+
"focus:bg-taupe-50 focus:text-taupe-900",
|
|
2688
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2689
|
+
className
|
|
2690
|
+
),
|
|
2691
|
+
...props,
|
|
2692
|
+
children: [
|
|
2693
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(Menubar.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { size: 8, className: "fill-taupe-900 text-taupe-900" }) }) }),
|
|
2694
|
+
children
|
|
2695
|
+
]
|
|
2696
|
+
}
|
|
2697
|
+
));
|
|
2698
|
+
MenubarRadioItem.displayName = "MenubarRadioItem";
|
|
2699
|
+
var MenubarLabel = React15.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2700
|
+
Menubar.Label,
|
|
2701
|
+
{
|
|
2702
|
+
ref,
|
|
2703
|
+
className: cn("px-2.5 py-1 label text-taupe-400", inset && "pl-8", className),
|
|
2704
|
+
...props
|
|
2705
|
+
}
|
|
2706
|
+
));
|
|
2707
|
+
MenubarLabel.displayName = "MenubarLabel";
|
|
2708
|
+
var MenubarSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2709
|
+
Menubar.Separator,
|
|
2710
|
+
{
|
|
2711
|
+
ref,
|
|
2712
|
+
className: cn("mx-1 my-1 h-px bg-taupe-100", className),
|
|
2713
|
+
...props
|
|
2714
|
+
}
|
|
2715
|
+
));
|
|
2716
|
+
MenubarSeparator.displayName = "MenubarSeparator";
|
|
2717
|
+
var MenubarSubTrigger = React15.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
2718
|
+
Menubar.SubTrigger,
|
|
2719
|
+
{
|
|
2720
|
+
ref,
|
|
2721
|
+
className: cn(
|
|
2722
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-md px-2.5 py-1.5",
|
|
2723
|
+
"body text-taupe-700 outline-none transition-colors",
|
|
2724
|
+
"focus:bg-taupe-50 focus:text-taupe-900 data-[state=open]:bg-taupe-50",
|
|
2725
|
+
inset && "pl-8",
|
|
2726
|
+
className
|
|
2727
|
+
),
|
|
2728
|
+
...props,
|
|
2729
|
+
children: [
|
|
2730
|
+
children,
|
|
2731
|
+
/* @__PURE__ */ jsx(ChevronRight, { size: 14, className: "ml-auto text-taupe-400" })
|
|
2732
|
+
]
|
|
2733
|
+
}
|
|
2734
|
+
));
|
|
2735
|
+
MenubarSubTrigger.displayName = "MenubarSubTrigger";
|
|
2736
|
+
var MenubarSubContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2737
|
+
Menubar.SubContent,
|
|
2738
|
+
{
|
|
2739
|
+
ref,
|
|
2740
|
+
className: cn(
|
|
2741
|
+
"z-50 min-w-[8rem] bg-white rounded-xl border border-taupe-100 shadow-natural p-1",
|
|
2742
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2743
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2744
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
2745
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
2746
|
+
className
|
|
2747
|
+
),
|
|
2748
|
+
...props
|
|
2749
|
+
}
|
|
2750
|
+
));
|
|
2751
|
+
MenubarSubContent.displayName = "MenubarSubContent";
|
|
2752
|
+
function MenubarShortcut({ className, ...props }) {
|
|
2753
|
+
return /* @__PURE__ */ jsx("span", { className: cn("ml-auto caption text-taupe-400", className), ...props });
|
|
2754
|
+
}
|
|
2755
|
+
MenubarShortcut.displayName = "MenubarShortcut";
|
|
2756
|
+
var NativeSelect = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
2757
|
+
/* @__PURE__ */ jsx(
|
|
2758
|
+
"select",
|
|
2759
|
+
{
|
|
2760
|
+
ref,
|
|
2761
|
+
className: cn(
|
|
2762
|
+
"peer h-9 w-full appearance-none rounded-lg border border-taupe-200 bg-white pl-3 pr-8",
|
|
2763
|
+
"body text-taupe-900",
|
|
2764
|
+
"focus:outline-none focus:ring-2 focus:ring-taupe-400/30 focus:border-taupe-400",
|
|
2765
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
2766
|
+
"aria-[invalid=true]:border-red-500 aria-[invalid=true]:focus:ring-red-500/20",
|
|
2767
|
+
className
|
|
2768
|
+
),
|
|
2769
|
+
...props,
|
|
2770
|
+
children
|
|
2771
|
+
}
|
|
2772
|
+
),
|
|
2773
|
+
/* @__PURE__ */ jsx(
|
|
2774
|
+
ChevronDown,
|
|
2775
|
+
{
|
|
2776
|
+
size: 14,
|
|
2777
|
+
className: "pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-taupe-400 peer-disabled:opacity-50"
|
|
2778
|
+
}
|
|
2779
|
+
)
|
|
2780
|
+
] }));
|
|
2781
|
+
NativeSelect.displayName = "NativeSelect";
|
|
2782
|
+
var NativeSelectOption = React15.forwardRef((props, ref) => /* @__PURE__ */ jsx("option", { ref, ...props }));
|
|
2783
|
+
NativeSelectOption.displayName = "NativeSelectOption";
|
|
2784
|
+
var NativeSelectOptGroup = React15.forwardRef((props, ref) => /* @__PURE__ */ jsx("optgroup", { ref, ...props }));
|
|
2785
|
+
NativeSelectOptGroup.displayName = "NativeSelectOptGroup";
|
|
2786
|
+
var NavigationMenuRoot = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2787
|
+
NavigationMenu.Root,
|
|
2788
|
+
{
|
|
2789
|
+
ref,
|
|
2790
|
+
className: cn("relative z-10 flex max-w-max flex-1 items-center justify-center", className),
|
|
2791
|
+
...props,
|
|
2792
|
+
children
|
|
2793
|
+
}
|
|
2794
|
+
));
|
|
2795
|
+
NavigationMenuRoot.displayName = "NavigationMenu";
|
|
2796
|
+
var NavigationMenuList = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2797
|
+
NavigationMenu.List,
|
|
2798
|
+
{
|
|
2799
|
+
ref,
|
|
2800
|
+
className: cn("group flex flex-1 list-none items-center justify-center gap-1", className),
|
|
2801
|
+
...props
|
|
2802
|
+
}
|
|
2803
|
+
));
|
|
2804
|
+
NavigationMenuList.displayName = "NavigationMenuList";
|
|
2805
|
+
var NavigationMenuItem = NavigationMenu.Item;
|
|
2806
|
+
var NavigationMenuTrigger = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
2807
|
+
NavigationMenu.Trigger,
|
|
2808
|
+
{
|
|
2809
|
+
ref,
|
|
2810
|
+
className: cn(
|
|
2811
|
+
"group inline-flex h-9 w-max items-center justify-center gap-1 rounded-md px-3 py-2",
|
|
2812
|
+
"body font-medium text-taupe-700",
|
|
2813
|
+
"hover:bg-taupe-100 hover:text-taupe-900",
|
|
2814
|
+
"data-[active]:bg-taupe-100 data-[state=open]:bg-taupe-100",
|
|
2815
|
+
"outline-none transition-colors",
|
|
2816
|
+
className
|
|
2817
|
+
),
|
|
2818
|
+
...props,
|
|
2819
|
+
children: [
|
|
2820
|
+
children,
|
|
2821
|
+
/* @__PURE__ */ jsx(
|
|
2822
|
+
ChevronDown,
|
|
2823
|
+
{
|
|
2824
|
+
size: 12,
|
|
2825
|
+
className: "transition-transform duration-200 group-data-[state=open]:rotate-180",
|
|
2826
|
+
"aria-hidden": "true"
|
|
2827
|
+
}
|
|
2828
|
+
)
|
|
2829
|
+
]
|
|
2830
|
+
}
|
|
2831
|
+
));
|
|
2832
|
+
NavigationMenuTrigger.displayName = "NavigationMenuTrigger";
|
|
2833
|
+
var NavigationMenuContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2834
|
+
NavigationMenu.Content,
|
|
2835
|
+
{
|
|
2836
|
+
ref,
|
|
2837
|
+
className: cn(
|
|
2838
|
+
"left-0 top-0 w-full",
|
|
2839
|
+
"data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out",
|
|
2840
|
+
"data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out",
|
|
2841
|
+
"data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52",
|
|
2842
|
+
"data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52",
|
|
2843
|
+
"md:absolute md:w-auto",
|
|
2844
|
+
className
|
|
2845
|
+
),
|
|
2846
|
+
...props
|
|
2847
|
+
}
|
|
2848
|
+
));
|
|
2849
|
+
NavigationMenuContent.displayName = "NavigationMenuContent";
|
|
2850
|
+
var NavigationMenuLink = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2851
|
+
NavigationMenu.Link,
|
|
2852
|
+
{
|
|
2853
|
+
ref,
|
|
2854
|
+
className: cn(
|
|
2855
|
+
"block select-none rounded-md px-3 py-2 body text-taupe-700",
|
|
2856
|
+
"hover:bg-taupe-50 hover:text-taupe-900",
|
|
2857
|
+
"outline-none transition-colors",
|
|
2858
|
+
className
|
|
2859
|
+
),
|
|
2860
|
+
...props
|
|
2861
|
+
}
|
|
2862
|
+
));
|
|
2863
|
+
NavigationMenuLink.displayName = "NavigationMenuLink";
|
|
2864
|
+
var NavigationMenuViewport = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "absolute left-0 top-full flex justify-center", children: /* @__PURE__ */ jsx(
|
|
2865
|
+
NavigationMenu.Viewport,
|
|
2866
|
+
{
|
|
2867
|
+
ref,
|
|
2868
|
+
className: cn(
|
|
2869
|
+
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-xl border border-taupe-100 bg-white shadow-elevated",
|
|
2870
|
+
"md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
2871
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2872
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90",
|
|
2873
|
+
className
|
|
2874
|
+
),
|
|
2875
|
+
...props
|
|
2876
|
+
}
|
|
2877
|
+
) }));
|
|
2878
|
+
NavigationMenuViewport.displayName = "NavigationMenuViewport";
|
|
2879
|
+
var NavigationMenuIndicator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2880
|
+
NavigationMenu.Indicator,
|
|
2881
|
+
{
|
|
2882
|
+
ref,
|
|
2883
|
+
className: cn(
|
|
2884
|
+
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
|
|
2885
|
+
"data-[state=visible]:animate-in data-[state=hidden]:animate-out",
|
|
2886
|
+
"data-[state=hidden]:fade-out data-[state=visible]:fade-in",
|
|
2887
|
+
className
|
|
2888
|
+
),
|
|
2889
|
+
...props,
|
|
2890
|
+
children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-taupe-100 shadow-elevated" })
|
|
2891
|
+
}
|
|
2892
|
+
));
|
|
2893
|
+
NavigationMenuIndicator.displayName = "NavigationMenuIndicator";
|
|
2894
|
+
function navigationMenuTriggerStyle() {
|
|
2895
|
+
return cn(
|
|
2896
|
+
"group inline-flex h-9 w-max items-center justify-center gap-1 rounded-md px-3 py-2",
|
|
2897
|
+
"body font-medium text-taupe-700",
|
|
2898
|
+
"hover:bg-taupe-100 hover:text-taupe-900",
|
|
2899
|
+
"data-[active]:bg-taupe-100 data-[state=open]:bg-taupe-100",
|
|
2900
|
+
"outline-none transition-colors"
|
|
2901
|
+
);
|
|
2902
|
+
}
|
|
2903
|
+
var variantConfig = {
|
|
2904
|
+
default: { icon: null, iconClass: "text-taupe-400" },
|
|
2905
|
+
success: {
|
|
2906
|
+
icon: CheckCircle,
|
|
2907
|
+
iconClass: "bg-brand-secondary/25 text-taupe-700 rounded-full p-1"
|
|
2908
|
+
},
|
|
2909
|
+
error: { icon: AlertCircle, iconClass: "text-red-500" },
|
|
2910
|
+
warning: {
|
|
2911
|
+
icon: AlertTriangle,
|
|
2912
|
+
iconClass: "bg-brand-secondary/80 text-taupe-700 rounded-full p-1"
|
|
2913
|
+
},
|
|
2914
|
+
info: { icon: Info, iconClass: "text-taupe-400" }
|
|
2915
|
+
};
|
|
2916
|
+
function Notification({
|
|
2917
|
+
title,
|
|
2918
|
+
description,
|
|
2919
|
+
icon,
|
|
2920
|
+
variant = "default",
|
|
2921
|
+
actions,
|
|
2922
|
+
onClose,
|
|
2923
|
+
className
|
|
2924
|
+
}) {
|
|
2925
|
+
const config = variantConfig[variant];
|
|
2926
|
+
const DefaultIcon = config.icon;
|
|
2927
|
+
const resolvedIcon = icon ?? (DefaultIcon ? /* @__PURE__ */ jsx(DefaultIcon, { size: 20 }) : null);
|
|
2928
|
+
return /* @__PURE__ */ jsx(
|
|
2929
|
+
"div",
|
|
2930
|
+
{
|
|
2931
|
+
className: cn(
|
|
2932
|
+
"pointer-events-auto w-full max-w-sm overflow-hidden rounded-xl border border-taupe-100 bg-white shadow-elevated",
|
|
2933
|
+
className
|
|
2934
|
+
),
|
|
2935
|
+
children: /* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2936
|
+
resolvedIcon && /* @__PURE__ */ jsx("div", { className: cn("shrink-0 mt-0.5", config.iconClass), children: resolvedIcon }),
|
|
2937
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
2938
|
+
/* @__PURE__ */ jsx("p", { className: "body font-semibold text-taupe-900", children: title }),
|
|
2939
|
+
description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 body text-taupe-500", children: description }),
|
|
2940
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-3 flex gap-3", children: actions.map((action, i) => /* @__PURE__ */ jsx(
|
|
2941
|
+
"button",
|
|
2942
|
+
{
|
|
2943
|
+
type: "button",
|
|
2944
|
+
onClick: action.onClick,
|
|
2945
|
+
className: cn(
|
|
2946
|
+
"body font-semibold transition-colors",
|
|
2947
|
+
action.variant === "ghost" ? "text-taupe-400 hover:text-taupe-700" : "text-taupe-900 hover:text-taupe-600"
|
|
2948
|
+
),
|
|
2949
|
+
children: action.label
|
|
2950
|
+
},
|
|
2951
|
+
i
|
|
2952
|
+
)) })
|
|
2953
|
+
] }),
|
|
2954
|
+
onClose && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsxs(
|
|
2955
|
+
"button",
|
|
2956
|
+
{
|
|
2957
|
+
type: "button",
|
|
2958
|
+
onClick: onClose,
|
|
2959
|
+
className: "rounded-md text-taupe-400 hover:text-taupe-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-taupe-400/40",
|
|
2960
|
+
children: [
|
|
2961
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" }),
|
|
2962
|
+
/* @__PURE__ */ jsx(X, { size: 16 })
|
|
2963
|
+
]
|
|
2964
|
+
}
|
|
2965
|
+
) })
|
|
2966
|
+
] }) })
|
|
2967
|
+
}
|
|
2968
|
+
);
|
|
2969
|
+
}
|
|
2970
|
+
function PageHeading({
|
|
2971
|
+
title,
|
|
2972
|
+
description,
|
|
2973
|
+
breadcrumbs,
|
|
2974
|
+
actions,
|
|
2975
|
+
meta,
|
|
2976
|
+
badge,
|
|
2977
|
+
className
|
|
2978
|
+
}) {
|
|
2979
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("border-b border-taupe-100 pb-6", className), children: [
|
|
2980
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx("nav", { className: "mb-3 flex items-center gap-1.5", "aria-label": "Breadcrumb", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React15.Fragment, { children: [
|
|
2981
|
+
i > 0 && /* @__PURE__ */ jsx(ChevronRight, { size: 12, className: "text-taupe-300 shrink-0" }),
|
|
2982
|
+
crumb.href ? /* @__PURE__ */ jsx(
|
|
2983
|
+
"a",
|
|
2984
|
+
{
|
|
2985
|
+
href: crumb.href,
|
|
2986
|
+
className: "caption text-taupe-400 hover:text-taupe-700 transition-colors",
|
|
2987
|
+
children: crumb.label
|
|
2988
|
+
}
|
|
2989
|
+
) : /* @__PURE__ */ jsx("span", { className: "caption font-semibold text-taupe-700", children: crumb.label })
|
|
2990
|
+
] }, i)) }),
|
|
2991
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-start justify-between gap-4", children: [
|
|
2992
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
2993
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2994
|
+
/* @__PURE__ */ jsx("h1", { className: "display text-taupe-900 truncate", children: title }),
|
|
2995
|
+
badge && (typeof badge === "string" ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: badge }) : /* @__PURE__ */ jsx(Badge, { variant: badge.variant ?? "secondary", children: badge.label }))
|
|
2996
|
+
] }),
|
|
2997
|
+
description && /* @__PURE__ */ jsx("p", { className: "mt-1.5 body text-taupe-400 max-w-2xl", children: description }),
|
|
2998
|
+
meta && meta.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-wrap items-center gap-4", children: meta.map((m, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 caption text-taupe-400", children: [
|
|
2999
|
+
m.icon && /* @__PURE__ */ jsx("span", { className: "text-taupe-400", children: m.icon }),
|
|
3000
|
+
/* @__PURE__ */ jsx("span", { children: m.text })
|
|
3001
|
+
] }, i)) })
|
|
3002
|
+
] }),
|
|
3003
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions.map(
|
|
3004
|
+
(action, i) => action.href ? /* @__PURE__ */ jsx(
|
|
3005
|
+
Button,
|
|
3006
|
+
{
|
|
3007
|
+
size: "sm",
|
|
3008
|
+
variant: action.primary ? "default" : action.variant ?? "outline",
|
|
3009
|
+
asChild: true,
|
|
3010
|
+
children: /* @__PURE__ */ jsx("a", { href: action.href, children: action.label })
|
|
3011
|
+
},
|
|
3012
|
+
i
|
|
3013
|
+
) : /* @__PURE__ */ jsx(
|
|
3014
|
+
Button,
|
|
3015
|
+
{
|
|
3016
|
+
size: "sm",
|
|
3017
|
+
variant: action.primary ? "default" : action.variant ?? "outline",
|
|
3018
|
+
onClick: action.onClick,
|
|
3019
|
+
children: action.label
|
|
3020
|
+
},
|
|
3021
|
+
i
|
|
3022
|
+
)
|
|
3023
|
+
) })
|
|
3024
|
+
] })
|
|
3025
|
+
] });
|
|
3026
|
+
}
|
|
3027
|
+
var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
3028
|
+
"nav",
|
|
3029
|
+
{
|
|
3030
|
+
role: "navigation",
|
|
3031
|
+
"aria-label": "pagination",
|
|
3032
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
3033
|
+
...props
|
|
3034
|
+
}
|
|
3035
|
+
);
|
|
3036
|
+
Pagination.displayName = "Pagination";
|
|
3037
|
+
var PaginationContent = React15.forwardRef(
|
|
3038
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("ul", { ref, className: cn("flex flex-row items-center gap-1", className), ...props })
|
|
3039
|
+
);
|
|
3040
|
+
PaginationContent.displayName = "PaginationContent";
|
|
3041
|
+
var PaginationItem = React15.forwardRef(
|
|
3042
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("li", { ref, className: cn("", className), ...props })
|
|
3043
|
+
);
|
|
3044
|
+
PaginationItem.displayName = "PaginationItem";
|
|
3045
|
+
var PaginationLink = ({ className, isActive, ...props }) => /* @__PURE__ */ jsx(
|
|
3046
|
+
"a",
|
|
3047
|
+
{
|
|
3048
|
+
"aria-current": isActive ? "page" : void 0,
|
|
3049
|
+
className: cn(
|
|
3050
|
+
buttonVariants({ variant: isActive ? "default" : "ghost", size: "icon" }),
|
|
3051
|
+
"size-8 rounded-md body",
|
|
3052
|
+
className
|
|
3053
|
+
),
|
|
3054
|
+
...props
|
|
3055
|
+
}
|
|
3056
|
+
);
|
|
3057
|
+
PaginationLink.displayName = "PaginationLink";
|
|
3058
|
+
var PaginationPrevious = ({
|
|
3059
|
+
className,
|
|
3060
|
+
...props
|
|
3061
|
+
}) => /* @__PURE__ */ jsxs(
|
|
3062
|
+
PaginationLink,
|
|
3063
|
+
{
|
|
3064
|
+
"aria-label": "Go to previous page",
|
|
3065
|
+
className: cn("gap-1 px-3 w-auto", className),
|
|
3066
|
+
...props,
|
|
3067
|
+
children: [
|
|
3068
|
+
/* @__PURE__ */ jsx(ChevronLeft, { size: 14 }),
|
|
3069
|
+
/* @__PURE__ */ jsx("span", { className: "body", children: "Prev" })
|
|
3070
|
+
]
|
|
3071
|
+
}
|
|
3072
|
+
);
|
|
3073
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
3074
|
+
var PaginationNext = ({ className, ...props }) => /* @__PURE__ */ jsxs(
|
|
3075
|
+
PaginationLink,
|
|
3076
|
+
{
|
|
3077
|
+
"aria-label": "Go to next page",
|
|
3078
|
+
className: cn("gap-1 px-3 w-auto", className),
|
|
3079
|
+
...props,
|
|
3080
|
+
children: [
|
|
3081
|
+
/* @__PURE__ */ jsx("span", { className: "body", children: "Next" }),
|
|
3082
|
+
/* @__PURE__ */ jsx(ChevronRight, { size: 14 })
|
|
3083
|
+
]
|
|
3084
|
+
}
|
|
3085
|
+
);
|
|
3086
|
+
PaginationNext.displayName = "PaginationNext";
|
|
3087
|
+
var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
3088
|
+
"span",
|
|
3089
|
+
{
|
|
3090
|
+
"aria-hidden": true,
|
|
3091
|
+
className: cn("flex size-8 items-center justify-center text-taupe-400", className),
|
|
3092
|
+
...props,
|
|
3093
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { size: 14 })
|
|
3094
|
+
}
|
|
3095
|
+
);
|
|
3096
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
3097
|
+
var ProgressRoot = React15.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3098
|
+
Progress.Root,
|
|
3099
|
+
{
|
|
3100
|
+
ref,
|
|
3101
|
+
className: cn("relative h-2 w-full overflow-hidden rounded-full bg-taupe-100", className),
|
|
3102
|
+
value,
|
|
3103
|
+
...props,
|
|
3104
|
+
children: /* @__PURE__ */ jsx(
|
|
3105
|
+
Progress.Indicator,
|
|
3106
|
+
{
|
|
3107
|
+
className: "h-full w-full flex-1 bg-brand-primary transition-all",
|
|
3108
|
+
style: { transform: `translateX(-${100 - (value ?? 0)}%)` }
|
|
3109
|
+
}
|
|
3110
|
+
)
|
|
3111
|
+
}
|
|
3112
|
+
));
|
|
3113
|
+
ProgressRoot.displayName = "Progress";
|
|
3114
|
+
function PropertyRow({
|
|
3115
|
+
label,
|
|
3116
|
+
labelWidth = 96,
|
|
3117
|
+
labelAlign = "center",
|
|
3118
|
+
className,
|
|
3119
|
+
children,
|
|
3120
|
+
...rest
|
|
3121
|
+
}) {
|
|
3122
|
+
return /* @__PURE__ */ jsxs(
|
|
3123
|
+
"div",
|
|
3124
|
+
{
|
|
3125
|
+
className: cn(
|
|
3126
|
+
"flex w-full gap-3 py-1",
|
|
3127
|
+
labelAlign === "center" ? "items-center" : "items-start",
|
|
3128
|
+
className
|
|
3129
|
+
),
|
|
3130
|
+
...rest,
|
|
3131
|
+
children: [
|
|
3132
|
+
label !== void 0 && /* @__PURE__ */ jsx(
|
|
3133
|
+
"div",
|
|
3134
|
+
{
|
|
3135
|
+
className: "caption text-taupe-500 shrink-0 select-none",
|
|
3136
|
+
style: { width: typeof labelWidth === "number" ? `${labelWidth}px` : labelWidth },
|
|
3137
|
+
children: label
|
|
3138
|
+
}
|
|
3139
|
+
),
|
|
3140
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center gap-2 min-w-0", children })
|
|
3141
|
+
]
|
|
3142
|
+
}
|
|
3143
|
+
);
|
|
3144
|
+
}
|
|
3145
|
+
function RadioCards({ options, value, onValueChange, columns = 3, className }) {
|
|
3146
|
+
const colMap2 = {
|
|
3147
|
+
1: "grid-cols-1",
|
|
3148
|
+
2: "grid-cols-1 sm:grid-cols-2",
|
|
3149
|
+
3: "grid-cols-1 sm:grid-cols-3",
|
|
3150
|
+
4: "grid-cols-2 sm:grid-cols-4"
|
|
3151
|
+
};
|
|
3152
|
+
return /* @__PURE__ */ jsx("div", { className: cn("grid gap-3", colMap2[columns], className), children: options.map((option) => {
|
|
3153
|
+
const isSelected = option.value === value;
|
|
3154
|
+
return /* @__PURE__ */ jsxs(
|
|
3155
|
+
"button",
|
|
3156
|
+
{
|
|
3157
|
+
type: "button",
|
|
3158
|
+
role: "radio",
|
|
3159
|
+
"aria-checked": isSelected,
|
|
3160
|
+
disabled: option.disabled,
|
|
3161
|
+
onClick: () => !option.disabled && onValueChange?.(option.value),
|
|
3162
|
+
className: cn(
|
|
3163
|
+
"relative flex cursor-pointer flex-col gap-1 rounded-xl border p-4 text-left transition-all",
|
|
3164
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/30",
|
|
3165
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
3166
|
+
isSelected ? "border-brand-primary bg-white shadow-natural" : "border-taupe-200 bg-white hover:border-taupe-400"
|
|
3167
|
+
),
|
|
3168
|
+
children: [
|
|
3169
|
+
isSelected && /* @__PURE__ */ jsx(
|
|
3170
|
+
"span",
|
|
3171
|
+
{
|
|
3172
|
+
className: "pointer-events-none absolute inset-0 rounded-xl ring-2 ring-brand-primary",
|
|
3173
|
+
"aria-hidden": "true"
|
|
3174
|
+
}
|
|
3175
|
+
),
|
|
3176
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
3177
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
3178
|
+
option.icon && /* @__PURE__ */ jsx("div", { className: "mb-2 text-taupe-500", children: option.icon }),
|
|
3179
|
+
/* @__PURE__ */ jsx(
|
|
3180
|
+
"p",
|
|
3181
|
+
{
|
|
3182
|
+
className: cn(
|
|
3183
|
+
"body font-semibold",
|
|
3184
|
+
isSelected ? "text-taupe-900" : "text-taupe-800"
|
|
3185
|
+
),
|
|
3186
|
+
children: option.label
|
|
3187
|
+
}
|
|
3188
|
+
),
|
|
3189
|
+
option.description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 caption text-taupe-400", children: option.description })
|
|
3190
|
+
] }),
|
|
3191
|
+
/* @__PURE__ */ jsx(
|
|
3192
|
+
"div",
|
|
3193
|
+
{
|
|
3194
|
+
className: cn(
|
|
3195
|
+
"flex size-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors",
|
|
3196
|
+
isSelected ? "border-brand-primary bg-brand-primary" : "border-taupe-300 bg-white"
|
|
3197
|
+
),
|
|
3198
|
+
children: isSelected && /* @__PURE__ */ jsx(Check, { size: 10, className: "text-white", strokeWidth: 3 })
|
|
3199
|
+
}
|
|
3200
|
+
)
|
|
3201
|
+
] }),
|
|
3202
|
+
option.meta && /* @__PURE__ */ jsx(
|
|
3203
|
+
"p",
|
|
3204
|
+
{
|
|
3205
|
+
className: cn(
|
|
3206
|
+
"caption font-semibold mt-2",
|
|
3207
|
+
isSelected ? "text-taupe-900" : "text-taupe-400"
|
|
3208
|
+
),
|
|
3209
|
+
children: option.meta
|
|
3210
|
+
}
|
|
3211
|
+
)
|
|
3212
|
+
]
|
|
3213
|
+
},
|
|
3214
|
+
option.value
|
|
3215
|
+
);
|
|
3216
|
+
}) });
|
|
3217
|
+
}
|
|
3218
|
+
var RadioGroupRoot = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadioGroup.Root, { ref, className: cn("grid gap-2", className), ...props }));
|
|
3219
|
+
RadioGroupRoot.displayName = "RadioGroup";
|
|
3220
|
+
var RadioGroupItem = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3221
|
+
RadioGroup.Item,
|
|
3222
|
+
{
|
|
3223
|
+
ref,
|
|
3224
|
+
className: cn(
|
|
3225
|
+
"aspect-square size-4 rounded-full border border-taupe-300 text-taupe-900",
|
|
3226
|
+
"shadow-none transition-colors",
|
|
3227
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-taupe-900/20",
|
|
3228
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
3229
|
+
"data-[state=checked]:bg-taupe-900 data-[state=checked]:border-taupe-900",
|
|
3230
|
+
className
|
|
3231
|
+
),
|
|
3232
|
+
...props,
|
|
3233
|
+
children: /* @__PURE__ */ jsx(RadioGroup.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "size-2 rounded-full bg-white" }) })
|
|
3234
|
+
}
|
|
3235
|
+
));
|
|
3236
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
3237
|
+
function ResizablePanelGroup({
|
|
3238
|
+
className,
|
|
3239
|
+
direction,
|
|
3240
|
+
orientation,
|
|
3241
|
+
...props
|
|
3242
|
+
}) {
|
|
3243
|
+
const resolvedOrientation = orientation ?? direction ?? "horizontal";
|
|
3244
|
+
return /* @__PURE__ */ jsx(
|
|
3245
|
+
Group,
|
|
3246
|
+
{
|
|
3247
|
+
orientation: resolvedOrientation,
|
|
3248
|
+
className: cn(
|
|
3249
|
+
"flex h-full w-full",
|
|
3250
|
+
resolvedOrientation === "vertical" && "flex-col",
|
|
3251
|
+
className
|
|
3252
|
+
),
|
|
3253
|
+
...props
|
|
3254
|
+
}
|
|
3255
|
+
);
|
|
3256
|
+
}
|
|
3257
|
+
ResizablePanelGroup.displayName = "ResizablePanelGroup";
|
|
3258
|
+
var ResizablePanel = Panel;
|
|
3259
|
+
function ResizableHandle({ className, withHandle = true, ...props }) {
|
|
3260
|
+
return /* @__PURE__ */ jsx(
|
|
3261
|
+
Separator$1,
|
|
3262
|
+
{
|
|
3263
|
+
className: cn(
|
|
3264
|
+
"relative flex shrink-0 items-center justify-center bg-taupe-100",
|
|
3265
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-brand-primary/50",
|
|
3266
|
+
// Horizontal (default): vertical bar
|
|
3267
|
+
"[&:not([aria-orientation=vertical])]:h-full [&:not([aria-orientation=vertical])]:w-px",
|
|
3268
|
+
// Vertical: horizontal bar
|
|
3269
|
+
"[aria-orientation=vertical]:h-px [aria-orientation=vertical]:w-full",
|
|
3270
|
+
// Wider hit target via pseudo-element
|
|
3271
|
+
"after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2",
|
|
3272
|
+
"[aria-orientation=vertical]:after:left-0 [aria-orientation=vertical]:after:h-1 [aria-orientation=vertical]:after:w-full [aria-orientation=vertical]:after:translate-x-0 [aria-orientation=vertical]:after:-translate-y-1/2",
|
|
3273
|
+
// Active drag state
|
|
3274
|
+
"active:bg-brand-primary/30",
|
|
3275
|
+
className
|
|
3276
|
+
),
|
|
3277
|
+
...props,
|
|
3278
|
+
children: withHandle && /* @__PURE__ */ jsx("div", { className: "z-10 flex h-5 w-3 items-center justify-center rounded-sm border border-taupe-100 bg-white shadow-natural", children: /* @__PURE__ */ jsx(GripVertical, { size: 10, className: "text-taupe-400" }) })
|
|
3279
|
+
}
|
|
3280
|
+
);
|
|
3281
|
+
}
|
|
3282
|
+
ResizableHandle.displayName = "ResizableHandle";
|
|
3283
|
+
var ScrollAreaRoot = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(ScrollArea.Root, { ref, className: cn("relative overflow-hidden", className), ...props, children: [
|
|
3284
|
+
/* @__PURE__ */ jsx(ScrollArea.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
3285
|
+
/* @__PURE__ */ jsx(ScrollAreaScrollbar, { orientation: "vertical" }),
|
|
3286
|
+
/* @__PURE__ */ jsx(ScrollAreaScrollbar, { orientation: "horizontal" }),
|
|
3287
|
+
/* @__PURE__ */ jsx(ScrollArea.Corner, {})
|
|
3288
|
+
] }));
|
|
3289
|
+
ScrollAreaRoot.displayName = "ScrollArea";
|
|
3290
|
+
var ScrollAreaScrollbar = React15.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3291
|
+
ScrollArea.Scrollbar,
|
|
3292
|
+
{
|
|
3293
|
+
ref,
|
|
3294
|
+
orientation,
|
|
3295
|
+
className: cn(
|
|
3296
|
+
"flex touch-none select-none transition-colors",
|
|
3297
|
+
orientation === "vertical" && "h-full w-2 border-l border-l-transparent p-px",
|
|
3298
|
+
orientation === "horizontal" && "h-2 flex-col border-t border-t-transparent p-px",
|
|
3299
|
+
className
|
|
3300
|
+
),
|
|
3301
|
+
...props,
|
|
3302
|
+
children: /* @__PURE__ */ jsx(ScrollArea.Thumb, { className: "relative flex-1 rounded-full bg-taupe-200 hover:bg-taupe-300 transition-colors" })
|
|
3303
|
+
}
|
|
3304
|
+
));
|
|
3305
|
+
ScrollAreaScrollbar.displayName = "ScrollAreaScrollbar";
|
|
3306
|
+
function SectionHeading({
|
|
3307
|
+
title,
|
|
3308
|
+
description,
|
|
3309
|
+
actions,
|
|
3310
|
+
border = true,
|
|
3311
|
+
className
|
|
3312
|
+
}) {
|
|
3313
|
+
return /* @__PURE__ */ jsxs(
|
|
3314
|
+
"div",
|
|
3315
|
+
{
|
|
3316
|
+
className: cn(
|
|
3317
|
+
"flex flex-col gap-1 pb-4 sm:flex-row sm:items-start sm:justify-between",
|
|
3318
|
+
border && "border-b border-taupe-100",
|
|
3319
|
+
className
|
|
3320
|
+
),
|
|
3321
|
+
children: [
|
|
3322
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
3323
|
+
/* @__PURE__ */ jsx("h2", { className: "heading text-taupe-900 truncate", children: title }),
|
|
3324
|
+
description && /* @__PURE__ */ jsx("p", { className: "mt-1 body text-taupe-400", children: description })
|
|
3325
|
+
] }),
|
|
3326
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2 pt-1", children: actions.map(
|
|
3327
|
+
(action, i) => action.href ? /* @__PURE__ */ jsx(Button, { size: "sm", variant: action.variant ?? "default", asChild: true, children: /* @__PURE__ */ jsx("a", { href: action.href, children: action.label }) }, i) : /* @__PURE__ */ jsx(
|
|
3328
|
+
Button,
|
|
3329
|
+
{
|
|
3330
|
+
size: "sm",
|
|
3331
|
+
variant: action.variant ?? "default",
|
|
3332
|
+
onClick: action.onClick,
|
|
3333
|
+
children: action.label
|
|
3334
|
+
},
|
|
3335
|
+
i
|
|
3336
|
+
)
|
|
3337
|
+
) })
|
|
3338
|
+
]
|
|
3339
|
+
}
|
|
3340
|
+
);
|
|
3341
|
+
}
|
|
3342
|
+
var SelectRoot = Select.Root;
|
|
3343
|
+
var SelectGroup = Select.Group;
|
|
3344
|
+
var SelectValue = Select.Value;
|
|
3345
|
+
var SelectTrigger = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3346
|
+
Select.Trigger,
|
|
3347
|
+
{
|
|
3348
|
+
ref,
|
|
3349
|
+
className: cn(
|
|
3350
|
+
"flex h-9 w-full items-center justify-between rounded-xl bg-white px-3 py-2",
|
|
3351
|
+
"body text-taupe-900 shadow-natural",
|
|
3352
|
+
"focus:outline-none focus:ring-2 focus:ring-taupe-900/15",
|
|
3353
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
3354
|
+
"data-[placeholder]:text-taupe-400",
|
|
3355
|
+
"[&>span]:line-clamp-1",
|
|
3356
|
+
className
|
|
3357
|
+
),
|
|
3358
|
+
...props,
|
|
3359
|
+
children: [
|
|
3360
|
+
children,
|
|
3361
|
+
/* @__PURE__ */ jsx(Select.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { size: 15, className: "text-taupe-400 shrink-0" }) })
|
|
3362
|
+
]
|
|
3363
|
+
}
|
|
3364
|
+
));
|
|
3365
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
3366
|
+
var SelectContent = React15.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsxs(
|
|
3367
|
+
Select.Content,
|
|
3368
|
+
{
|
|
3369
|
+
ref,
|
|
3370
|
+
className: cn(
|
|
3371
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden",
|
|
3372
|
+
"bg-white rounded-xl shadow-natural p-1",
|
|
3373
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
3374
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
3375
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
3376
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
3377
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",
|
|
3378
|
+
className
|
|
3379
|
+
),
|
|
3380
|
+
position,
|
|
3381
|
+
...props,
|
|
3382
|
+
children: [
|
|
3383
|
+
/* @__PURE__ */ jsx(Select.ScrollUpButton, { className: "flex cursor-default items-center justify-center py-1", children: /* @__PURE__ */ jsx(ChevronUp, { size: 14, className: "text-taupe-400" }) }),
|
|
3384
|
+
/* @__PURE__ */ jsx(
|
|
3385
|
+
Select.Viewport,
|
|
3386
|
+
{
|
|
3387
|
+
className: cn(
|
|
3388
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
3389
|
+
),
|
|
3390
|
+
children
|
|
3391
|
+
}
|
|
3392
|
+
),
|
|
3393
|
+
/* @__PURE__ */ jsx(Select.ScrollDownButton, { className: "flex cursor-default items-center justify-center py-1", children: /* @__PURE__ */ jsx(ChevronDown, { size: 14, className: "text-taupe-400" }) })
|
|
3394
|
+
]
|
|
3395
|
+
}
|
|
3396
|
+
) }));
|
|
3397
|
+
SelectContent.displayName = "SelectContent";
|
|
3398
|
+
var SelectItem = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3399
|
+
Select.Item,
|
|
3400
|
+
{
|
|
3401
|
+
ref,
|
|
3402
|
+
className: cn(
|
|
3403
|
+
"relative flex w-full cursor-default select-none items-center rounded-md px-2.5 py-1.5",
|
|
3404
|
+
"body text-taupe-700 outline-none",
|
|
3405
|
+
"focus:bg-taupe-50 focus:text-taupe-900",
|
|
3406
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
3407
|
+
className
|
|
3408
|
+
),
|
|
3409
|
+
...props,
|
|
3410
|
+
children: [
|
|
3411
|
+
/* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(Select.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { size: 13, className: "text-taupe-900" }) }) }),
|
|
3412
|
+
/* @__PURE__ */ jsx(Select.ItemText, { children })
|
|
3413
|
+
]
|
|
3414
|
+
}
|
|
3415
|
+
));
|
|
3416
|
+
SelectItem.displayName = "SelectItem";
|
|
3417
|
+
var SelectLabel = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3418
|
+
Select.Label,
|
|
3419
|
+
{
|
|
3420
|
+
ref,
|
|
3421
|
+
className: cn("px-2.5 py-1 label text-taupe-400", className),
|
|
3422
|
+
...props
|
|
3423
|
+
}
|
|
3424
|
+
));
|
|
3425
|
+
SelectLabel.displayName = "SelectLabel";
|
|
3426
|
+
var SelectSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Select.Separator, { ref, className: cn("mx-1 my-1 h-px bg-taupe-100", className), ...props }));
|
|
3427
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
3428
|
+
var Separator2 = React15.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3429
|
+
Separator.Root,
|
|
3430
|
+
{
|
|
3431
|
+
ref,
|
|
3432
|
+
decorative,
|
|
3433
|
+
orientation,
|
|
3434
|
+
className: cn(
|
|
3435
|
+
"shrink-0 bg-taupe-100",
|
|
3436
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
3437
|
+
className
|
|
3438
|
+
),
|
|
3439
|
+
...props
|
|
3440
|
+
}
|
|
3441
|
+
));
|
|
3442
|
+
Separator2.displayName = "Separator";
|
|
3443
|
+
var SheetRoot = Dialog.Root;
|
|
3444
|
+
var SheetTrigger = Dialog.Trigger;
|
|
3445
|
+
var SheetClose = Dialog.Close;
|
|
3446
|
+
var SheetOverlay = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3447
|
+
Dialog.Overlay,
|
|
3448
|
+
{
|
|
3449
|
+
ref,
|
|
3450
|
+
className: cn(
|
|
3451
|
+
"fixed inset-0 z-50 bg-black/30 backdrop-blur-sm",
|
|
3452
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
3453
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
3454
|
+
className
|
|
3455
|
+
),
|
|
3456
|
+
...props
|
|
3457
|
+
}
|
|
3458
|
+
));
|
|
3459
|
+
SheetOverlay.displayName = "SheetOverlay";
|
|
3460
|
+
var sheetContentVariants = cva(
|
|
3461
|
+
[
|
|
3462
|
+
"fixed z-50 bg-white shadow-elevated p-6",
|
|
3463
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
3464
|
+
"transition ease-in-out duration-300"
|
|
3465
|
+
],
|
|
3466
|
+
{
|
|
3467
|
+
variants: {
|
|
3468
|
+
side: {
|
|
3469
|
+
right: "right-0 top-0 h-full w-full max-w-sm data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
|
|
3470
|
+
left: "left-0 top-0 h-full w-full max-w-sm data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
|
|
3471
|
+
top: "top-0 inset-x-0 h-auto data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
3472
|
+
bottom: "bottom-0 inset-x-0 h-auto data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"
|
|
3473
|
+
}
|
|
3474
|
+
},
|
|
3475
|
+
defaultVariants: {
|
|
3476
|
+
side: "right"
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3479
|
+
);
|
|
3480
|
+
var SheetContent = React15.forwardRef(
|
|
3481
|
+
({ className, children, side = "right", ...props }, ref) => /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
|
|
3482
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
3483
|
+
/* @__PURE__ */ jsxs(
|
|
3484
|
+
Dialog.Content,
|
|
3485
|
+
{
|
|
3486
|
+
ref,
|
|
3487
|
+
className: cn(sheetContentVariants({ side }), className),
|
|
3488
|
+
...props,
|
|
3489
|
+
children: [
|
|
3490
|
+
children,
|
|
3491
|
+
/* @__PURE__ */ jsxs(Dialog.Close, { className: "absolute right-4 top-4 rounded-md p-1 text-taupe-400 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-taupe-900/20", children: [
|
|
3492
|
+
/* @__PURE__ */ jsx(X, { size: 16 }),
|
|
3493
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
3494
|
+
] })
|
|
3495
|
+
]
|
|
3496
|
+
}
|
|
3497
|
+
)
|
|
3498
|
+
] })
|
|
3499
|
+
);
|
|
3500
|
+
SheetContent.displayName = "SheetContent";
|
|
3501
|
+
function SheetHeader({ className, ...props }) {
|
|
3502
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-1.5 mb-4", className), ...props });
|
|
3503
|
+
}
|
|
3504
|
+
SheetHeader.displayName = "SheetHeader";
|
|
3505
|
+
function SheetFooter({ className, ...props }) {
|
|
3506
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-end gap-2 mt-6", className), ...props });
|
|
3507
|
+
}
|
|
3508
|
+
SheetFooter.displayName = "SheetFooter";
|
|
3509
|
+
var SheetTitle = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3510
|
+
Dialog.Title,
|
|
3511
|
+
{
|
|
3512
|
+
ref,
|
|
3513
|
+
className: cn("body-lg font-semibold text-taupe-900", className),
|
|
3514
|
+
...props
|
|
3515
|
+
}
|
|
3516
|
+
));
|
|
3517
|
+
SheetTitle.displayName = "SheetTitle";
|
|
3518
|
+
var SheetDescription = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Dialog.Description, { ref, className: cn("body text-taupe-500", className), ...props }));
|
|
3519
|
+
SheetDescription.displayName = "SheetDescription";
|
|
3520
|
+
function TooltipProvider({
|
|
3521
|
+
children,
|
|
3522
|
+
...props
|
|
3523
|
+
}) {
|
|
3524
|
+
return /* @__PURE__ */ jsx(Tooltip.Provider, { delayDuration: 300, ...props, children });
|
|
3525
|
+
}
|
|
3526
|
+
var TooltipRoot = Tooltip.Root;
|
|
3527
|
+
var TooltipTrigger = Tooltip.Trigger;
|
|
3528
|
+
var TooltipContent = React15.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(
|
|
3529
|
+
Tooltip.Content,
|
|
3530
|
+
{
|
|
3531
|
+
ref,
|
|
3532
|
+
sideOffset,
|
|
3533
|
+
className: cn(
|
|
3534
|
+
"z-50 rounded-lg bg-taupe-900 px-2.5 py-1.5 caption text-white",
|
|
3535
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
3536
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3537
|
+
"data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1",
|
|
3538
|
+
"data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1",
|
|
3539
|
+
className
|
|
3540
|
+
),
|
|
3541
|
+
...props
|
|
3542
|
+
}
|
|
3543
|
+
) }));
|
|
3544
|
+
TooltipContent.displayName = "TooltipContent";
|
|
3545
|
+
var SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
3546
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
3547
|
+
var SIDEBAR_WIDTH_ICON = "3.5rem";
|
|
3548
|
+
var SidebarContext = React15.createContext(null);
|
|
3549
|
+
function useSidebar() {
|
|
3550
|
+
const ctx = React15.useContext(SidebarContext);
|
|
3551
|
+
if (!ctx) throw new Error("useSidebar must be used inside SidebarProvider");
|
|
3552
|
+
return ctx;
|
|
3553
|
+
}
|
|
3554
|
+
function SidebarProvider({
|
|
3555
|
+
defaultOpen = true,
|
|
3556
|
+
open: openProp,
|
|
3557
|
+
onOpenChange,
|
|
3558
|
+
className,
|
|
3559
|
+
style,
|
|
3560
|
+
children,
|
|
3561
|
+
...props
|
|
3562
|
+
}) {
|
|
3563
|
+
const [_open, _setOpen] = React15.useState(defaultOpen);
|
|
3564
|
+
const open = openProp !== void 0 ? openProp : _open;
|
|
3565
|
+
const setOpen = React15.useCallback(
|
|
3566
|
+
(value) => {
|
|
3567
|
+
if (onOpenChange) {
|
|
3568
|
+
onOpenChange(value);
|
|
3569
|
+
} else {
|
|
3570
|
+
_setOpen(value);
|
|
3571
|
+
}
|
|
3572
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${value}; path=/; max-age=${60 * 60 * 24 * 7}`;
|
|
3573
|
+
},
|
|
3574
|
+
[onOpenChange]
|
|
3575
|
+
);
|
|
3576
|
+
const toggleSidebar = React15.useCallback(() => {
|
|
3577
|
+
setOpen(!open);
|
|
3578
|
+
}, [open, setOpen]);
|
|
3579
|
+
const state = open ? "expanded" : "collapsed";
|
|
3580
|
+
const contextValue = React15.useMemo(
|
|
3581
|
+
() => ({ state, open, setOpen, toggleSidebar }),
|
|
3582
|
+
[state, open, setOpen, toggleSidebar]
|
|
3583
|
+
);
|
|
3584
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
|
|
3585
|
+
"div",
|
|
3586
|
+
{
|
|
3587
|
+
"data-sidebar": "provider",
|
|
3588
|
+
"data-state": state,
|
|
3589
|
+
className: cn("group/sidebar-wrapper flex min-h-svh w-full", className),
|
|
3590
|
+
style: {
|
|
3591
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
3592
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
3593
|
+
...style
|
|
3594
|
+
},
|
|
3595
|
+
...props,
|
|
3596
|
+
children
|
|
3597
|
+
}
|
|
3598
|
+
) }) });
|
|
3599
|
+
}
|
|
3600
|
+
function Sidebar({
|
|
3601
|
+
side = "left",
|
|
3602
|
+
variant = "sidebar",
|
|
3603
|
+
collapsible = "icon",
|
|
3604
|
+
className,
|
|
3605
|
+
children,
|
|
3606
|
+
...props
|
|
3607
|
+
}) {
|
|
3608
|
+
const { state } = useSidebar();
|
|
3609
|
+
if (collapsible === "none") {
|
|
3610
|
+
return /* @__PURE__ */ jsx(
|
|
3611
|
+
"aside",
|
|
3612
|
+
{
|
|
3613
|
+
"data-side": side,
|
|
3614
|
+
"data-variant": variant,
|
|
3615
|
+
"data-collapsible": "none",
|
|
3616
|
+
className: cn(
|
|
3617
|
+
"flex flex-col h-svh bg-white border-r border-taupe-100 w-[--sidebar-width]",
|
|
3618
|
+
side === "right" && "border-r-0 border-l",
|
|
3619
|
+
className
|
|
3620
|
+
),
|
|
3621
|
+
...props,
|
|
3622
|
+
children
|
|
3623
|
+
}
|
|
3624
|
+
);
|
|
3625
|
+
}
|
|
3626
|
+
if (collapsible === "offcanvas") {
|
|
3627
|
+
return /* @__PURE__ */ jsx(
|
|
3628
|
+
"aside",
|
|
3629
|
+
{
|
|
3630
|
+
"data-state": state,
|
|
3631
|
+
"data-side": side,
|
|
3632
|
+
"data-variant": variant,
|
|
3633
|
+
"data-collapsible": "offcanvas",
|
|
3634
|
+
className: cn(
|
|
3635
|
+
"group peer flex flex-col h-svh bg-white border-r border-taupe-100",
|
|
3636
|
+
"transition-[width,transform] duration-200 ease-linear",
|
|
3637
|
+
"data-[state=expanded]:w-[--sidebar-width] data-[state=collapsed]:w-0 data-[state=collapsed]:-translate-x-full",
|
|
3638
|
+
side === "right" && "border-r-0 border-l data-[state=collapsed]:translate-x-full",
|
|
3639
|
+
className
|
|
3640
|
+
),
|
|
3641
|
+
...props,
|
|
3642
|
+
children
|
|
3643
|
+
}
|
|
3644
|
+
);
|
|
3645
|
+
}
|
|
3646
|
+
return /* @__PURE__ */ jsx(
|
|
3647
|
+
"aside",
|
|
3648
|
+
{
|
|
3649
|
+
"data-state": state,
|
|
3650
|
+
"data-side": side,
|
|
3651
|
+
"data-variant": variant,
|
|
3652
|
+
"data-collapsible": "icon",
|
|
3653
|
+
className: cn(
|
|
3654
|
+
"group peer hidden md:flex flex-col h-svh bg-white border-r border-taupe-100",
|
|
3655
|
+
"transition-[width] duration-200 ease-linear overflow-hidden",
|
|
3656
|
+
"data-[state=expanded]:w-[--sidebar-width] data-[state=collapsed]:w-[--sidebar-width-icon]",
|
|
3657
|
+
side === "right" && "border-r-0 border-l",
|
|
3658
|
+
variant === "floating" && "m-2 h-[calc(100svh-1rem)] rounded-xl border shadow-natural",
|
|
3659
|
+
variant === "inset" && "border-r-0",
|
|
3660
|
+
className
|
|
3661
|
+
),
|
|
3662
|
+
...props,
|
|
3663
|
+
children
|
|
3664
|
+
}
|
|
3665
|
+
);
|
|
3666
|
+
}
|
|
3667
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
3668
|
+
const { toggleSidebar } = useSidebar();
|
|
3669
|
+
return /* @__PURE__ */ jsxs(
|
|
3670
|
+
Button,
|
|
3671
|
+
{
|
|
3672
|
+
"data-sidebar": "trigger",
|
|
3673
|
+
variant: "ghost",
|
|
3674
|
+
size: "sm",
|
|
3675
|
+
className: cn("h-7 w-7", className),
|
|
3676
|
+
onClick: (e) => {
|
|
3677
|
+
onClick?.(e);
|
|
3678
|
+
toggleSidebar();
|
|
3679
|
+
},
|
|
3680
|
+
...props,
|
|
3681
|
+
children: [
|
|
3682
|
+
/* @__PURE__ */ jsx(PanelLeft, { size: 16 }),
|
|
3683
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle sidebar" })
|
|
3684
|
+
]
|
|
3685
|
+
}
|
|
3686
|
+
);
|
|
3687
|
+
}
|
|
3688
|
+
function SidebarRail({ className, ...props }) {
|
|
3689
|
+
const { toggleSidebar } = useSidebar();
|
|
3690
|
+
return /* @__PURE__ */ jsx(
|
|
3691
|
+
"button",
|
|
3692
|
+
{
|
|
3693
|
+
"data-sidebar": "rail",
|
|
3694
|
+
"aria-label": "Toggle sidebar",
|
|
3695
|
+
tabIndex: -1,
|
|
3696
|
+
onClick: toggleSidebar,
|
|
3697
|
+
title: "Toggle sidebar",
|
|
3698
|
+
className: cn(
|
|
3699
|
+
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 cursor-col-resize transition-all ease-linear",
|
|
3700
|
+
"after:absolute after:inset-y-0 after:left-1/2 after:w-[2px]",
|
|
3701
|
+
"hover:after:bg-brand-primary/30",
|
|
3702
|
+
"group-data-[side=left]:-right-4 group-data-[side=right]:left-0",
|
|
3703
|
+
"sm:flex",
|
|
3704
|
+
className
|
|
3705
|
+
),
|
|
3706
|
+
...props
|
|
3707
|
+
}
|
|
3708
|
+
);
|
|
3709
|
+
}
|
|
3710
|
+
function SidebarInset({ className, ...props }) {
|
|
3711
|
+
return /* @__PURE__ */ jsx(
|
|
3712
|
+
"main",
|
|
3713
|
+
{
|
|
3714
|
+
"data-sidebar": "inset",
|
|
3715
|
+
className: cn("relative flex min-h-svh flex-1 flex-col bg-white overflow-hidden", className),
|
|
3716
|
+
...props
|
|
3717
|
+
}
|
|
3718
|
+
);
|
|
3719
|
+
}
|
|
3720
|
+
function SidebarHeader({ className, ...props }) {
|
|
3721
|
+
return /* @__PURE__ */ jsx(
|
|
3722
|
+
"div",
|
|
3723
|
+
{
|
|
3724
|
+
"data-sidebar": "header",
|
|
3725
|
+
className: cn("flex flex-col gap-2 p-3 border-b border-taupe-100", className),
|
|
3726
|
+
...props
|
|
3727
|
+
}
|
|
3728
|
+
);
|
|
3729
|
+
}
|
|
3730
|
+
function SidebarContent({ className, ...props }) {
|
|
3731
|
+
return /* @__PURE__ */ jsx(
|
|
3732
|
+
"div",
|
|
3733
|
+
{
|
|
3734
|
+
"data-sidebar": "content",
|
|
3735
|
+
className: cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-3", className),
|
|
3736
|
+
...props
|
|
3737
|
+
}
|
|
3738
|
+
);
|
|
3739
|
+
}
|
|
3740
|
+
function SidebarFooter({ className, ...props }) {
|
|
3741
|
+
return /* @__PURE__ */ jsx(
|
|
3742
|
+
"div",
|
|
3743
|
+
{
|
|
3744
|
+
"data-sidebar": "footer",
|
|
3745
|
+
className: cn("flex flex-col gap-2 p-3 border-t border-taupe-100", className),
|
|
3746
|
+
...props
|
|
3747
|
+
}
|
|
3748
|
+
);
|
|
3749
|
+
}
|
|
3750
|
+
function SidebarSeparator({ className, ...props }) {
|
|
3751
|
+
return /* @__PURE__ */ jsx(
|
|
3752
|
+
Separator2,
|
|
3753
|
+
{
|
|
3754
|
+
"data-sidebar": "separator",
|
|
3755
|
+
className: cn("mx-2 my-1 bg-taupe-100", className),
|
|
3756
|
+
...props
|
|
3757
|
+
}
|
|
3758
|
+
);
|
|
3759
|
+
}
|
|
3760
|
+
function SidebarGroup({ className, ...props }) {
|
|
3761
|
+
return /* @__PURE__ */ jsx(
|
|
3762
|
+
"div",
|
|
3763
|
+
{
|
|
3764
|
+
"data-sidebar": "group",
|
|
3765
|
+
className: cn("relative flex w-full min-w-0 flex-col p-2", className),
|
|
3766
|
+
...props
|
|
3767
|
+
}
|
|
3768
|
+
);
|
|
3769
|
+
}
|
|
3770
|
+
function SidebarGroupLabel({
|
|
3771
|
+
className,
|
|
3772
|
+
asChild = false,
|
|
3773
|
+
...props
|
|
3774
|
+
}) {
|
|
3775
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
3776
|
+
return /* @__PURE__ */ jsx(
|
|
3777
|
+
Comp,
|
|
3778
|
+
{
|
|
3779
|
+
"data-sidebar": "group-label",
|
|
3780
|
+
className: cn(
|
|
3781
|
+
"flex h-8 shrink-0 items-center rounded-md px-2 label text-taupe-400",
|
|
3782
|
+
"outline-none ring-taupe-900 transition-[margin,opacity] duration-200 ease-linear",
|
|
3783
|
+
"group-data-[state=collapsed]/sidebar-wrapper:opacity-0",
|
|
3784
|
+
"group-data-[state=collapsed]/sidebar-wrapper:h-0",
|
|
3785
|
+
"group-data-[state=collapsed]/sidebar-wrapper:m-0",
|
|
3786
|
+
"group-data-[state=collapsed]/sidebar-wrapper:p-0",
|
|
3787
|
+
"group-data-[state=collapsed]/sidebar-wrapper:overflow-hidden",
|
|
3788
|
+
className
|
|
3789
|
+
),
|
|
3790
|
+
...props
|
|
3791
|
+
}
|
|
3792
|
+
);
|
|
3793
|
+
}
|
|
3794
|
+
function SidebarGroupContent({ className, ...props }) {
|
|
3795
|
+
return /* @__PURE__ */ jsx("div", { "data-sidebar": "group-content", className: cn("w-full text-sm", className), ...props });
|
|
3796
|
+
}
|
|
3797
|
+
function SidebarGroupAction({
|
|
3798
|
+
className,
|
|
3799
|
+
asChild = false,
|
|
3800
|
+
...props
|
|
3801
|
+
}) {
|
|
3802
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
3803
|
+
return /* @__PURE__ */ jsx(
|
|
3804
|
+
Comp,
|
|
3805
|
+
{
|
|
3806
|
+
"data-sidebar": "group-action",
|
|
3807
|
+
className: cn(
|
|
3808
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center",
|
|
3809
|
+
"rounded-md text-taupe-400 hover:bg-taupe-100 hover:text-taupe-900",
|
|
3810
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/30",
|
|
3811
|
+
className
|
|
3812
|
+
),
|
|
3813
|
+
...props
|
|
3814
|
+
}
|
|
3815
|
+
);
|
|
3816
|
+
}
|
|
3817
|
+
function SidebarMenu({ className, ...props }) {
|
|
3818
|
+
return /* @__PURE__ */ jsx(
|
|
3819
|
+
"ul",
|
|
3820
|
+
{
|
|
3821
|
+
"data-sidebar": "menu",
|
|
3822
|
+
className: cn("flex w-full min-w-0 flex-col gap-1", className),
|
|
3823
|
+
...props
|
|
3824
|
+
}
|
|
3825
|
+
);
|
|
3826
|
+
}
|
|
3827
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
3828
|
+
return /* @__PURE__ */ jsx("li", { "data-sidebar": "menu-item", className: cn("group/menu-item relative", className), ...props });
|
|
3829
|
+
}
|
|
3830
|
+
function SidebarMenuButton({
|
|
3831
|
+
asChild = false,
|
|
3832
|
+
isActive = false,
|
|
3833
|
+
tooltip,
|
|
3834
|
+
size = "default",
|
|
3835
|
+
className,
|
|
3836
|
+
children,
|
|
3837
|
+
...props
|
|
3838
|
+
}) {
|
|
3839
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
3840
|
+
const button = /* @__PURE__ */ jsx(
|
|
3841
|
+
Comp,
|
|
3842
|
+
{
|
|
3843
|
+
"data-sidebar": "menu-button",
|
|
3844
|
+
"data-active": isActive,
|
|
3845
|
+
"data-size": size,
|
|
3846
|
+
className: cn(
|
|
3847
|
+
// Base
|
|
3848
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 body text-left",
|
|
3849
|
+
"outline-none ring-taupe-900",
|
|
3850
|
+
"transition-[width,height,padding] duration-150",
|
|
3851
|
+
"hover:bg-taupe-100 hover:text-taupe-900",
|
|
3852
|
+
"focus-visible:ring-2 focus-visible:ring-brand-primary/30",
|
|
3853
|
+
"active:bg-taupe-100",
|
|
3854
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
3855
|
+
"[&>svg]:size-4 [&>svg]:shrink-0",
|
|
3856
|
+
// Size variants
|
|
3857
|
+
size === "sm" && "h-7 text-xs",
|
|
3858
|
+
size === "lg" && "h-10",
|
|
3859
|
+
// Active state
|
|
3860
|
+
isActive && [
|
|
3861
|
+
"bg-brand-primary/10 text-brand-primary",
|
|
3862
|
+
"hover:bg-brand-primary/15 hover:text-brand-primary"
|
|
3863
|
+
],
|
|
3864
|
+
// Collapsed state
|
|
3865
|
+
"group-data-[state=collapsed]/sidebar-wrapper:justify-center",
|
|
3866
|
+
"group-data-[state=collapsed]/sidebar-wrapper:size-9",
|
|
3867
|
+
"group-data-[state=collapsed]/sidebar-wrapper:p-0",
|
|
3868
|
+
className
|
|
3869
|
+
),
|
|
3870
|
+
...props,
|
|
3871
|
+
children
|
|
3872
|
+
}
|
|
3873
|
+
);
|
|
3874
|
+
if (!tooltip) {
|
|
3875
|
+
return button;
|
|
3876
|
+
}
|
|
3877
|
+
return /* @__PURE__ */ jsxs(TooltipRoot, { children: [
|
|
3878
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
|
|
3879
|
+
/* @__PURE__ */ jsx(
|
|
3880
|
+
TooltipContent,
|
|
3881
|
+
{
|
|
3882
|
+
side: "right",
|
|
3883
|
+
className: cn(
|
|
3884
|
+
// Only visible when collapsed
|
|
3885
|
+
"hidden group-data-[state=collapsed]/sidebar-wrapper:block"
|
|
3886
|
+
),
|
|
3887
|
+
children: tooltip
|
|
3888
|
+
}
|
|
3889
|
+
)
|
|
3890
|
+
] });
|
|
3891
|
+
}
|
|
3892
|
+
function SidebarMenuAction({
|
|
3893
|
+
className,
|
|
3894
|
+
asChild = false,
|
|
3895
|
+
showOnHover = false,
|
|
3896
|
+
...props
|
|
3897
|
+
}) {
|
|
3898
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
3899
|
+
return /* @__PURE__ */ jsx(
|
|
3900
|
+
Comp,
|
|
3901
|
+
{
|
|
3902
|
+
"data-sidebar": "menu-action",
|
|
3903
|
+
className: cn(
|
|
3904
|
+
"absolute right-1 top-1/2 -translate-y-1/2 flex aspect-square w-5 items-center justify-center",
|
|
3905
|
+
"rounded-md text-taupe-400 hover:bg-taupe-100 hover:text-taupe-900",
|
|
3906
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/30",
|
|
3907
|
+
showOnHover && [
|
|
3908
|
+
"opacity-0 transition-opacity",
|
|
3909
|
+
"group-hover/menu-item:opacity-100",
|
|
3910
|
+
"peer-data-[active=true]/menu-button:opacity-100"
|
|
3911
|
+
],
|
|
3912
|
+
"group-data-[state=collapsed]/sidebar-wrapper:hidden",
|
|
3913
|
+
className
|
|
3914
|
+
),
|
|
3915
|
+
...props
|
|
3916
|
+
}
|
|
3917
|
+
);
|
|
3918
|
+
}
|
|
3919
|
+
function SidebarMenuBadge({ className, ...props }) {
|
|
3920
|
+
return /* @__PURE__ */ jsx(
|
|
3921
|
+
"div",
|
|
3922
|
+
{
|
|
3923
|
+
"data-sidebar": "menu-badge",
|
|
3924
|
+
className: cn(
|
|
3925
|
+
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-full",
|
|
3926
|
+
"caption font-medium bg-taupe-100 text-taupe-700 px-1",
|
|
3927
|
+
"group-data-[state=collapsed]/sidebar-wrapper:hidden",
|
|
3928
|
+
className
|
|
3929
|
+
),
|
|
3930
|
+
...props
|
|
3931
|
+
}
|
|
3932
|
+
);
|
|
3933
|
+
}
|
|
3934
|
+
function SidebarMenuSkeleton({
|
|
3935
|
+
className,
|
|
3936
|
+
showIcon = false,
|
|
3937
|
+
...props
|
|
3938
|
+
}) {
|
|
3939
|
+
const width = React15.useMemo(() => {
|
|
3940
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
3941
|
+
}, []);
|
|
3942
|
+
return /* @__PURE__ */ jsxs(
|
|
3943
|
+
"div",
|
|
3944
|
+
{
|
|
3945
|
+
"data-sidebar": "menu-skeleton",
|
|
3946
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
3947
|
+
...props,
|
|
3948
|
+
children: [
|
|
3949
|
+
showIcon && /* @__PURE__ */ jsx("div", { className: "size-4 shrink-0 rounded-md bg-taupe-200 animate-pulse" }),
|
|
3950
|
+
/* @__PURE__ */ jsx(
|
|
3951
|
+
"div",
|
|
3952
|
+
{
|
|
3953
|
+
className: "h-4 max-w-[--skeleton-width] flex-1 rounded-md bg-taupe-200 animate-pulse",
|
|
3954
|
+
style: { "--skeleton-width": width }
|
|
3955
|
+
}
|
|
3956
|
+
)
|
|
3957
|
+
]
|
|
3958
|
+
}
|
|
3959
|
+
);
|
|
3960
|
+
}
|
|
3961
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
3962
|
+
return /* @__PURE__ */ jsx(
|
|
3963
|
+
"ul",
|
|
3964
|
+
{
|
|
3965
|
+
"data-sidebar": "menu-sub",
|
|
3966
|
+
className: cn(
|
|
3967
|
+
"mx-3.5 flex min-w-0 flex-col gap-1 border-l border-taupe-100 pl-3",
|
|
3968
|
+
"group-data-[state=collapsed]/sidebar-wrapper:hidden",
|
|
3969
|
+
className
|
|
3970
|
+
),
|
|
3971
|
+
...props
|
|
3972
|
+
}
|
|
3973
|
+
);
|
|
3974
|
+
}
|
|
3975
|
+
function SidebarMenuSubItem({ className, ...props }) {
|
|
3976
|
+
return /* @__PURE__ */ jsx(
|
|
3977
|
+
"li",
|
|
3978
|
+
{
|
|
3979
|
+
"data-sidebar": "menu-sub-item",
|
|
3980
|
+
className: cn("group/menu-sub-item relative", className),
|
|
3981
|
+
...props
|
|
3982
|
+
}
|
|
3983
|
+
);
|
|
3984
|
+
}
|
|
3985
|
+
function SidebarMenuSubButton({
|
|
3986
|
+
asChild = false,
|
|
3987
|
+
isActive = false,
|
|
3988
|
+
className,
|
|
3989
|
+
...props
|
|
3990
|
+
}) {
|
|
3991
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
3992
|
+
return /* @__PURE__ */ jsx(
|
|
3993
|
+
Comp,
|
|
3994
|
+
{
|
|
3995
|
+
"data-sidebar": "menu-sub-button",
|
|
3996
|
+
"data-active": isActive,
|
|
3997
|
+
className: cn(
|
|
3998
|
+
"flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2",
|
|
3999
|
+
"body text-taupe-500 outline-none",
|
|
4000
|
+
"transition-colors duration-150",
|
|
4001
|
+
"hover:text-taupe-900 hover:bg-taupe-100",
|
|
4002
|
+
"focus-visible:ring-2 focus-visible:ring-brand-primary/30",
|
|
4003
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
4004
|
+
"[&>svg]:size-3.5 [&>svg]:shrink-0",
|
|
4005
|
+
isActive && "text-brand-primary hover:text-brand-primary",
|
|
4006
|
+
className
|
|
4007
|
+
),
|
|
4008
|
+
...props
|
|
4009
|
+
}
|
|
4010
|
+
);
|
|
4011
|
+
}
|
|
4012
|
+
function Skeleton({ className, ...props }) {
|
|
4013
|
+
return /* @__PURE__ */ jsx(
|
|
4014
|
+
"div",
|
|
4015
|
+
{
|
|
4016
|
+
"data-slot": "skeleton",
|
|
4017
|
+
className: cn("animate-pulse rounded-md bg-taupe-100", className),
|
|
4018
|
+
...props
|
|
4019
|
+
}
|
|
4020
|
+
);
|
|
4021
|
+
}
|
|
4022
|
+
var SliderRoot = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
4023
|
+
Slider.Root,
|
|
4024
|
+
{
|
|
4025
|
+
ref,
|
|
4026
|
+
className: cn("relative flex w-full touch-none select-none items-center", className),
|
|
4027
|
+
...props,
|
|
4028
|
+
children: [
|
|
4029
|
+
/* @__PURE__ */ jsx(Slider.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-taupe-100", children: /* @__PURE__ */ jsx(Slider.Range, { className: "absolute h-full bg-brand-primary" }) }),
|
|
4030
|
+
/* @__PURE__ */ jsx(Slider.Thumb, { className: "block size-4 rounded-full border-2 border-brand-primary bg-white shadow-natural transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/30 disabled:pointer-events-none disabled:opacity-50" })
|
|
4031
|
+
]
|
|
4032
|
+
}
|
|
4033
|
+
));
|
|
4034
|
+
SliderRoot.displayName = "Slider";
|
|
4035
|
+
function Toaster({ ...props }) {
|
|
4036
|
+
return /* @__PURE__ */ jsx(
|
|
4037
|
+
Toaster$1,
|
|
4038
|
+
{
|
|
4039
|
+
theme: "light",
|
|
4040
|
+
className: "toaster group",
|
|
4041
|
+
toastOptions: {
|
|
4042
|
+
classNames: {
|
|
4043
|
+
toast: "group toast font-sans text-sm group-[.toaster]:bg-white group-[.toaster]:text-taupe-900 group-[.toaster]:border group-[.toaster]:border-taupe-100 group-[.toaster]:shadow-elevated group-[.toaster]:rounded-xl",
|
|
4044
|
+
description: "group-[.toast]:text-taupe-500 group-[.toast]:text-xs",
|
|
4045
|
+
actionButton: "group-[.toast]:bg-brand-primary group-[.toast]:text-white group-[.toast]:rounded-md group-[.toast]:text-xs group-[.toast]:font-medium",
|
|
4046
|
+
cancelButton: "group-[.toast]:bg-taupe-100 group-[.toast]:text-taupe-600 group-[.toast]:rounded-md group-[.toast]:text-xs group-[.toast]:font-medium",
|
|
4047
|
+
success: "group-[.toaster]:border-brand-secondary/40 group-[.toaster]:text-taupe-900",
|
|
4048
|
+
error: "group-[.toaster]:bg-red-50 group-[.toaster]:text-red-700 group-[.toaster]:border-red-200",
|
|
4049
|
+
warning: "group-[.toaster]:bg-yellow-50 group-[.toaster]:text-yellow-800 group-[.toaster]:border-yellow-200",
|
|
4050
|
+
info: "group-[.toaster]:border-taupe-200"
|
|
4051
|
+
}
|
|
4052
|
+
},
|
|
4053
|
+
...props
|
|
4054
|
+
}
|
|
4055
|
+
);
|
|
4056
|
+
}
|
|
4057
|
+
var spinnerVariants = cva(
|
|
4058
|
+
"inline-block animate-spin rounded-full border-2 border-current border-t-transparent",
|
|
4059
|
+
{
|
|
4060
|
+
variants: {
|
|
4061
|
+
size: {
|
|
4062
|
+
xs: "size-3",
|
|
4063
|
+
sm: "size-4",
|
|
4064
|
+
default: "size-5",
|
|
4065
|
+
lg: "size-6",
|
|
4066
|
+
xl: "size-8"
|
|
4067
|
+
}
|
|
4068
|
+
},
|
|
4069
|
+
defaultVariants: {
|
|
4070
|
+
size: "default"
|
|
4071
|
+
}
|
|
4072
|
+
}
|
|
4073
|
+
);
|
|
4074
|
+
function Spinner({ className, size, ...props }) {
|
|
4075
|
+
return /* @__PURE__ */ jsx(
|
|
4076
|
+
"span",
|
|
4077
|
+
{
|
|
4078
|
+
role: "status",
|
|
4079
|
+
"aria-label": "Loading",
|
|
4080
|
+
className: cn(spinnerVariants({ size }), className),
|
|
4081
|
+
...props
|
|
4082
|
+
}
|
|
4083
|
+
);
|
|
4084
|
+
}
|
|
4085
|
+
function StackedList({ children, divided = true, bordered = true, className }) {
|
|
4086
|
+
return /* @__PURE__ */ jsx(
|
|
4087
|
+
"ul",
|
|
4088
|
+
{
|
|
4089
|
+
role: "list",
|
|
4090
|
+
className: cn(
|
|
4091
|
+
"overflow-hidden rounded-xl bg-white",
|
|
4092
|
+
bordered && "border border-taupe-100 shadow-natural",
|
|
4093
|
+
divided && "divide-y divide-taupe-100",
|
|
4094
|
+
className
|
|
4095
|
+
),
|
|
4096
|
+
children
|
|
4097
|
+
}
|
|
4098
|
+
);
|
|
4099
|
+
}
|
|
4100
|
+
function StackedListItem({ children, href, onClick, className }) {
|
|
4101
|
+
const inner = /* @__PURE__ */ jsx("div", { className: cn("px-4 py-3.5", className), children });
|
|
4102
|
+
if (href) {
|
|
4103
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href, className: "block hover:bg-taupe-50 transition-colors", children: inner }) });
|
|
4104
|
+
}
|
|
4105
|
+
if (onClick) {
|
|
4106
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
4107
|
+
"button",
|
|
4108
|
+
{
|
|
4109
|
+
type: "button",
|
|
4110
|
+
className: "w-full text-left hover:bg-taupe-50 transition-colors",
|
|
4111
|
+
onClick,
|
|
4112
|
+
children: inner
|
|
4113
|
+
}
|
|
4114
|
+
) });
|
|
4115
|
+
}
|
|
4116
|
+
return /* @__PURE__ */ jsx("li", { children: inner });
|
|
4117
|
+
}
|
|
4118
|
+
function StatCard({ label, value, trend, icon, className }) {
|
|
4119
|
+
const trendColor = {
|
|
4120
|
+
up: "text-taupe-800 bg-brand-secondary/30 rounded-full px-2 py-0.5 w-fit",
|
|
4121
|
+
down: "text-red-600",
|
|
4122
|
+
neutral: "text-taupe-400"
|
|
4123
|
+
};
|
|
4124
|
+
const TrendIcon = {
|
|
4125
|
+
up: TrendingUp,
|
|
4126
|
+
down: TrendingDown,
|
|
4127
|
+
neutral: Minus
|
|
4128
|
+
};
|
|
4129
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-xl border border-taupe-100 bg-white p-5", className), children: [
|
|
4130
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
4131
|
+
/* @__PURE__ */ jsx("p", { className: "label text-taupe-400", children: label }),
|
|
4132
|
+
icon && /* @__PURE__ */ jsx("div", { className: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-taupe-50 text-taupe-400", children: icon })
|
|
4133
|
+
] }),
|
|
4134
|
+
/* @__PURE__ */ jsx("p", { className: "heading-xl mt-2 text-taupe-900", children: value }),
|
|
4135
|
+
trend && (() => {
|
|
4136
|
+
const Icon = TrendIcon[trend.direction];
|
|
4137
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("mt-2 flex items-center gap-1", trendColor[trend.direction]), children: [
|
|
4138
|
+
/* @__PURE__ */ jsx(Icon, { size: 12 }),
|
|
4139
|
+
/* @__PURE__ */ jsx("span", { className: "caption font-medium", children: trend.value })
|
|
4140
|
+
] });
|
|
4141
|
+
})()
|
|
4142
|
+
] });
|
|
4143
|
+
}
|
|
4144
|
+
function CirclesSteps({ steps, className }) {
|
|
4145
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "Progress", className, children: /* @__PURE__ */ jsx("ol", { role: "list", className: "flex items-center", children: steps.map((step, i) => {
|
|
4146
|
+
const isLast = i === steps.length - 1;
|
|
4147
|
+
return /* @__PURE__ */ jsxs("li", { className: cn("relative", !isLast && "flex-1"), children: [
|
|
4148
|
+
!isLast && /* @__PURE__ */ jsx("div", { className: "absolute top-4 left-8 -right-px h-0.5", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
4149
|
+
"div",
|
|
4150
|
+
{
|
|
4151
|
+
className: cn(
|
|
4152
|
+
"h-full",
|
|
4153
|
+
step.status === "complete" ? "bg-brand-primary" : "bg-taupe-200"
|
|
4154
|
+
)
|
|
4155
|
+
}
|
|
4156
|
+
) }),
|
|
4157
|
+
/* @__PURE__ */ jsxs(
|
|
4158
|
+
"a",
|
|
4159
|
+
{
|
|
4160
|
+
href: step.href ?? "#",
|
|
4161
|
+
onClick: !step.href ? (e) => e.preventDefault() : void 0,
|
|
4162
|
+
className: "group relative flex flex-col items-center gap-2",
|
|
4163
|
+
children: [
|
|
4164
|
+
/* @__PURE__ */ jsx(
|
|
4165
|
+
"span",
|
|
4166
|
+
{
|
|
4167
|
+
className: cn(
|
|
4168
|
+
"relative z-10 flex size-8 items-center justify-center rounded-full transition-colors",
|
|
4169
|
+
step.status === "complete" && "bg-brand-primary group-hover:bg-brand-primary/80",
|
|
4170
|
+
step.status === "current" && "border-2 border-brand-primary bg-white",
|
|
4171
|
+
step.status === "upcoming" && "border-2 border-taupe-300 bg-white group-hover:border-taupe-400"
|
|
4172
|
+
),
|
|
4173
|
+
children: step.status === "complete" ? /* @__PURE__ */ jsx(Check, { size: 14, className: "text-white", strokeWidth: 2.5 }) : step.status === "current" ? /* @__PURE__ */ jsx("span", { className: "size-2.5 rounded-full bg-brand-primary" }) : /* @__PURE__ */ jsx("span", { className: "size-2.5 rounded-full bg-transparent group-hover:bg-taupe-300" })
|
|
4174
|
+
}
|
|
4175
|
+
),
|
|
4176
|
+
/* @__PURE__ */ jsxs("span", { className: "flex flex-col items-center", children: [
|
|
4177
|
+
/* @__PURE__ */ jsx(
|
|
4178
|
+
"span",
|
|
4179
|
+
{
|
|
4180
|
+
className: cn(
|
|
4181
|
+
"caption font-semibold",
|
|
4182
|
+
step.status === "upcoming" ? "text-taupe-400" : "text-taupe-900"
|
|
4183
|
+
),
|
|
4184
|
+
children: step.name
|
|
4185
|
+
}
|
|
4186
|
+
),
|
|
4187
|
+
step.description && /* @__PURE__ */ jsx("span", { className: "caption text-taupe-400", children: step.description })
|
|
4188
|
+
] })
|
|
4189
|
+
]
|
|
4190
|
+
}
|
|
4191
|
+
)
|
|
4192
|
+
] }, step.id ?? i);
|
|
4193
|
+
}) }) });
|
|
4194
|
+
}
|
|
4195
|
+
function BulletsSteps({ steps, className }) {
|
|
4196
|
+
const currentIdx = steps.findIndex((s) => s.status === "current");
|
|
4197
|
+
return /* @__PURE__ */ jsxs("nav", { className: cn("flex items-center gap-4", className), "aria-label": "Progress", children: [
|
|
4198
|
+
/* @__PURE__ */ jsxs("p", { className: "body font-medium text-taupe-700", children: [
|
|
4199
|
+
"Step ",
|
|
4200
|
+
currentIdx + 1,
|
|
4201
|
+
" of ",
|
|
4202
|
+
steps.length
|
|
4203
|
+
] }),
|
|
4204
|
+
/* @__PURE__ */ jsx("ol", { role: "list", className: "flex items-center gap-2", children: steps.map((step, i) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
4205
|
+
"a",
|
|
4206
|
+
{
|
|
4207
|
+
href: step.href ?? "#",
|
|
4208
|
+
onClick: !step.href ? (e) => e.preventDefault() : void 0,
|
|
4209
|
+
className: "block",
|
|
4210
|
+
children: step.status === "complete" ? /* @__PURE__ */ jsx(
|
|
4211
|
+
"span",
|
|
4212
|
+
{
|
|
4213
|
+
className: "block size-2.5 rounded-full bg-brand-primary hover:bg-brand-primary/80 transition-colors",
|
|
4214
|
+
title: step.name
|
|
4215
|
+
}
|
|
4216
|
+
) : step.status === "current" ? /* @__PURE__ */ jsxs(
|
|
4217
|
+
"span",
|
|
4218
|
+
{
|
|
4219
|
+
className: "relative flex size-4 items-center justify-center",
|
|
4220
|
+
"aria-current": "step",
|
|
4221
|
+
children: [
|
|
4222
|
+
/* @__PURE__ */ jsx("span", { className: "absolute size-4 rounded-full bg-brand-primary/20" }),
|
|
4223
|
+
/* @__PURE__ */ jsx("span", { className: "relative size-2.5 rounded-full bg-brand-primary" }),
|
|
4224
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: step.name })
|
|
4225
|
+
]
|
|
4226
|
+
}
|
|
4227
|
+
) : /* @__PURE__ */ jsx(
|
|
4228
|
+
"span",
|
|
4229
|
+
{
|
|
4230
|
+
className: "block size-2.5 rounded-full bg-taupe-200 hover:bg-taupe-300 transition-colors",
|
|
4231
|
+
title: step.name
|
|
4232
|
+
}
|
|
4233
|
+
)
|
|
4234
|
+
}
|
|
4235
|
+
) }, step.id ?? i)) })
|
|
4236
|
+
] });
|
|
4237
|
+
}
|
|
4238
|
+
function ProgressSteps({ steps, className }) {
|
|
4239
|
+
const completeCount = steps.filter((s) => s.status === "complete").length;
|
|
4240
|
+
const currentIdx = steps.findIndex((s) => s.status === "current");
|
|
4241
|
+
const progress = (completeCount + (currentIdx >= 0 ? 0.5 : 0)) / steps.length * 100;
|
|
4242
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
|
|
4243
|
+
/* @__PURE__ */ jsx("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-taupe-100", children: /* @__PURE__ */ jsx(
|
|
4244
|
+
"div",
|
|
4245
|
+
{
|
|
4246
|
+
className: "h-full rounded-full bg-brand-primary transition-all duration-500",
|
|
4247
|
+
style: { width: `${progress}%` }
|
|
4248
|
+
}
|
|
4249
|
+
) }),
|
|
4250
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 grid", style: { gridTemplateColumns: `repeat(${steps.length}, 1fr)` }, children: steps.map((step, i) => {
|
|
4251
|
+
const isLast = i === steps.length - 1;
|
|
4252
|
+
return /* @__PURE__ */ jsx(
|
|
4253
|
+
"div",
|
|
4254
|
+
{
|
|
4255
|
+
className: cn(
|
|
4256
|
+
"caption font-medium",
|
|
4257
|
+
i === 0 ? "text-left" : isLast ? "text-right" : "text-center",
|
|
4258
|
+
step.status === "upcoming" ? "text-taupe-400" : "text-taupe-900"
|
|
4259
|
+
),
|
|
4260
|
+
children: step.name
|
|
4261
|
+
},
|
|
4262
|
+
step.id ?? i
|
|
4263
|
+
);
|
|
4264
|
+
}) })
|
|
4265
|
+
] });
|
|
4266
|
+
}
|
|
4267
|
+
function Steps({ steps, variant = "circles", className }) {
|
|
4268
|
+
if (variant === "bullets") return /* @__PURE__ */ jsx(BulletsSteps, { steps, className });
|
|
4269
|
+
if (variant === "progress") return /* @__PURE__ */ jsx(ProgressSteps, { steps, className });
|
|
4270
|
+
return /* @__PURE__ */ jsx(CirclesSteps, { steps, className });
|
|
4271
|
+
}
|
|
4272
|
+
var SwitchRoot = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4273
|
+
Switch.Root,
|
|
4274
|
+
{
|
|
4275
|
+
ref,
|
|
4276
|
+
className: cn(
|
|
4277
|
+
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full",
|
|
4278
|
+
"border-2 border-transparent transition-colors",
|
|
4279
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/30",
|
|
4280
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
4281
|
+
"data-[state=unchecked]:bg-taupe-200 data-[state=checked]:bg-brand-primary",
|
|
4282
|
+
className
|
|
4283
|
+
),
|
|
4284
|
+
...props,
|
|
4285
|
+
children: /* @__PURE__ */ jsx(
|
|
4286
|
+
Switch.Thumb,
|
|
4287
|
+
{
|
|
4288
|
+
className: cn(
|
|
4289
|
+
"pointer-events-none block size-4 rounded-full bg-white shadow-natural",
|
|
4290
|
+
"transition-transform data-[state=unchecked]:translate-x-0 data-[state=checked]:translate-x-4"
|
|
4291
|
+
)
|
|
4292
|
+
}
|
|
4293
|
+
)
|
|
4294
|
+
}
|
|
4295
|
+
));
|
|
4296
|
+
SwitchRoot.displayName = "Switch";
|
|
4297
|
+
var TabsRoot = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Tabs.Root, { ref, className: cn("w-full", className), ...props }));
|
|
4298
|
+
TabsRoot.displayName = "Tabs";
|
|
4299
|
+
var TabsList = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4300
|
+
Tabs.List,
|
|
4301
|
+
{
|
|
4302
|
+
ref,
|
|
4303
|
+
className: cn("inline-flex items-center gap-1 border-b border-taupe-100 w-full", className),
|
|
4304
|
+
...props
|
|
4305
|
+
}
|
|
4306
|
+
));
|
|
4307
|
+
TabsList.displayName = "TabsList";
|
|
4308
|
+
var TabsTrigger = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4309
|
+
Tabs.Trigger,
|
|
4310
|
+
{
|
|
4311
|
+
ref,
|
|
4312
|
+
className: cn(
|
|
4313
|
+
"px-0 pb-2.5 body font-medium text-taupe-400",
|
|
4314
|
+
"border-b-2 border-transparent -mb-px",
|
|
4315
|
+
"transition-colors cursor-pointer",
|
|
4316
|
+
"data-[state=active]:text-brand-primary data-[state=active]:border-brand-primary",
|
|
4317
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-primary/20",
|
|
4318
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
4319
|
+
className
|
|
4320
|
+
),
|
|
4321
|
+
...props
|
|
4322
|
+
}
|
|
4323
|
+
));
|
|
4324
|
+
TabsTrigger.displayName = "TabsTrigger";
|
|
4325
|
+
var TabsContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Tabs.Content, { ref, className: cn("mt-4", className), ...props }));
|
|
4326
|
+
TabsContent.displayName = "TabsContent";
|
|
4327
|
+
function Textarea({ className, ...props }) {
|
|
4328
|
+
return /* @__PURE__ */ jsx(
|
|
4329
|
+
"textarea",
|
|
4330
|
+
{
|
|
4331
|
+
"data-slot": "textarea",
|
|
4332
|
+
className: cn(
|
|
4333
|
+
"flex min-h-[80px] w-full rounded-md border border-taupe-200 bg-white px-3 py-2",
|
|
4334
|
+
"body text-taupe-900 placeholder:text-taupe-400",
|
|
4335
|
+
"resize-none transition-colors duration-150",
|
|
4336
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-taupe-900/15 focus-visible:border-taupe-400",
|
|
4337
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-taupe-50",
|
|
4338
|
+
className
|
|
4339
|
+
),
|
|
4340
|
+
...props
|
|
4341
|
+
}
|
|
4342
|
+
);
|
|
4343
|
+
}
|
|
4344
|
+
var toggleVariants = cva(
|
|
4345
|
+
[
|
|
4346
|
+
"inline-flex shrink-0 items-center justify-center gap-2",
|
|
4347
|
+
"body font-medium whitespace-nowrap rounded-md",
|
|
4348
|
+
"transition-all duration-150 outline-none",
|
|
4349
|
+
"focus-visible:ring-2 focus-visible:ring-brand-primary/30 focus-visible:ring-offset-1",
|
|
4350
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
4351
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
4352
|
+
],
|
|
4353
|
+
{
|
|
4354
|
+
variants: {
|
|
4355
|
+
variant: {
|
|
4356
|
+
default: [
|
|
4357
|
+
"bg-transparent text-taupe-600",
|
|
4358
|
+
"hover:bg-taupe-100 hover:text-taupe-900",
|
|
4359
|
+
"data-[state=on]:bg-taupe-100 data-[state=on]:text-taupe-900"
|
|
4360
|
+
],
|
|
4361
|
+
outline: [
|
|
4362
|
+
"border border-taupe-200 bg-white text-taupe-600 shadow-natural",
|
|
4363
|
+
"hover:bg-taupe-50 hover:text-taupe-900",
|
|
4364
|
+
"data-[state=on]:bg-taupe-100 data-[state=on]:text-taupe-900 data-[state=on]:border-taupe-300"
|
|
4365
|
+
],
|
|
4366
|
+
brand: [
|
|
4367
|
+
"bg-transparent text-taupe-600",
|
|
4368
|
+
"hover:bg-taupe-100 hover:text-taupe-900",
|
|
4369
|
+
"data-[state=on]:bg-brand-primary data-[state=on]:text-white"
|
|
4370
|
+
]
|
|
4371
|
+
},
|
|
4372
|
+
size: {
|
|
4373
|
+
sm: "h-8 gap-1.5 px-3",
|
|
4374
|
+
default: "h-9 px-3",
|
|
4375
|
+
lg: "h-10 px-4",
|
|
4376
|
+
icon: "size-9",
|
|
4377
|
+
"icon-sm": "size-8",
|
|
4378
|
+
"icon-lg": "size-10"
|
|
4379
|
+
}
|
|
4380
|
+
},
|
|
4381
|
+
defaultVariants: {
|
|
4382
|
+
variant: "default",
|
|
4383
|
+
size: "default"
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4386
|
+
);
|
|
4387
|
+
var ToggleRoot = React15.forwardRef(
|
|
4388
|
+
({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4389
|
+
Toggle.Root,
|
|
4390
|
+
{
|
|
4391
|
+
ref,
|
|
4392
|
+
className: cn(toggleVariants({ variant, size }), className),
|
|
4393
|
+
...props
|
|
4394
|
+
}
|
|
4395
|
+
)
|
|
4396
|
+
);
|
|
4397
|
+
ToggleRoot.displayName = "Toggle";
|
|
4398
|
+
var ToggleGroupContext = React15.createContext({
|
|
4399
|
+
size: "default",
|
|
4400
|
+
variant: "default"
|
|
4401
|
+
});
|
|
4402
|
+
var ToggleGroupRoot = React15.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4403
|
+
ToggleGroup.Root,
|
|
4404
|
+
{
|
|
4405
|
+
ref,
|
|
4406
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
4407
|
+
...props,
|
|
4408
|
+
children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
4409
|
+
}
|
|
4410
|
+
));
|
|
4411
|
+
ToggleGroupRoot.displayName = "ToggleGroup";
|
|
4412
|
+
var ToggleGroupItem = React15.forwardRef(({ className, variant, size, ...props }, ref) => {
|
|
4413
|
+
const context = React15.useContext(ToggleGroupContext);
|
|
4414
|
+
return /* @__PURE__ */ jsx(
|
|
4415
|
+
ToggleGroup.Item,
|
|
4416
|
+
{
|
|
4417
|
+
ref,
|
|
4418
|
+
className: cn(
|
|
4419
|
+
toggleVariants({
|
|
4420
|
+
variant: variant ?? context.variant,
|
|
4421
|
+
size: size ?? context.size
|
|
4422
|
+
}),
|
|
4423
|
+
className
|
|
4424
|
+
),
|
|
4425
|
+
...props
|
|
4426
|
+
}
|
|
4427
|
+
);
|
|
4428
|
+
});
|
|
4429
|
+
ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
4430
|
+
|
|
4431
|
+
export { AccordionRoot as Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionPanel, ActivityFeed, Alert, AlertDescription, AlertDialogRoot as AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatioRoot as AspectRatio, Avatar, AvatarFallback, AvatarImage, AvatarStack, AvatarWithStatus, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupItem, CHART_COLORS, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardHeading, CardMedia, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartTooltip, CheckboxRoot as Checkbox, CollapsibleRoot as Collapsible, CollapsibleContent, CollapsibleTrigger, ColorInput, ColorPicker, Combobox, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandPalette, CommandSeparator, CommandShortcut, ContextMenuRoot as ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DatePicker, DescriptionList, DialogRoot as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, DrawerRoot as Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenuRoot as DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Field, GridList, GridListAccentCard, GridListCard, HoverCardRoot as HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputNumber, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, Label, MediaObject, MenubarRoot as Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenuRoot as NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Notification, PageHeading, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PopoverRoot as Popover, PopoverClose, PopoverContent, PopoverTrigger, ProgressRoot as Progress, PropertyRow, RadioCards, RadioGroupRoot as RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollAreaRoot as ScrollArea, SectionHeading, SelectRoot as Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, SheetRoot as Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, SliderRoot as Slider, Spinner, StackedList, StackedListItem, StatCard, Steps, SwitchRoot as Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TabsRoot as Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, ToggleRoot as Toggle, ToggleGroupRoot as ToggleGroup, ToggleGroupItem, TooltipRoot as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cardVariants, cn, formatDate, navigationMenuTriggerStyle, spinnerVariants, toggleVariants, useSidebar };
|
|
4432
|
+
//# sourceMappingURL=index.js.map
|
|
4433
|
+
//# sourceMappingURL=index.js.map
|