@slipstream-ui/core 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +672 -52
- package/dist/index.d.ts +672 -52
- package/dist/index.js +1860 -657
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1836 -655
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/app-shell.manifest.json +156 -0
- package/dist/manifests/auth-layout.manifest.json +99 -0
- package/dist/manifests/autocomplete.manifest.json +53 -5
- package/dist/manifests/badge.manifest.json +12 -0
- package/dist/manifests/button.manifest.json +6 -2
- package/dist/manifests/card.manifest.json +53 -6
- package/dist/manifests/date-picker.manifest.json +87 -0
- package/dist/manifests/dialog.manifest.json +49 -4
- package/dist/manifests/drawer.manifest.json +18 -4
- package/dist/manifests/empty-state.manifest.json +108 -0
- package/dist/manifests/file-upload.manifest.json +103 -0
- package/dist/manifests/filter-bar.manifest.json +100 -0
- package/dist/manifests/menu.manifest.json +13 -1
- package/dist/manifests/metric-card.manifest.json +105 -0
- package/dist/manifests/page-header.manifest.json +94 -0
- package/dist/manifests/pagination.manifest.json +62 -34
- package/dist/manifests/password-input.manifest.json +75 -0
- package/dist/manifests/select-menu.manifest.json +142 -0
- package/dist/manifests/select.manifest.json +49 -12
- package/dist/manifests/stepper.manifest.json +95 -0
- package/dist/manifests/table-card.manifest.json +123 -0
- package/dist/manifests/time-picker.manifest.json +86 -0
- package/dist/manifests/timeline.manifest.json +69 -0
- package/dist/manifests/toast.manifest.json +101 -25
- package/package.json +1 -1
- package/src/components/app-shell/AppShell.test.tsx +100 -0
- package/src/components/app-shell/AppShell.tsx +162 -0
- package/src/components/app-shell/index.ts +1 -0
- package/src/components/auth-layout/AuthLayout.test.tsx +34 -0
- package/src/components/auth-layout/AuthLayout.tsx +47 -0
- package/src/components/auth-layout/index.ts +1 -0
- package/src/components/autocomplete/Autocomplete.test.tsx +53 -0
- package/src/components/autocomplete/Autocomplete.tsx +160 -41
- package/src/components/badge/Badge.test.tsx +14 -0
- package/src/components/badge/Badge.tsx +10 -4
- package/src/components/button/Button.test.tsx +29 -0
- package/src/components/button/Button.tsx +10 -0
- package/src/components/button-group/ButtonGroup.test.tsx +6 -8
- package/src/components/button-group/ButtonGroup.tsx +17 -9
- package/src/components/card/Card.test.tsx +14 -0
- package/src/components/card/Card.tsx +15 -8
- package/src/components/date-picker/DatePicker.test.tsx +30 -0
- package/src/components/date-picker/DatePicker.tsx +57 -0
- package/src/components/date-picker/index.ts +1 -0
- package/src/components/dialog/Dialog.test.tsx +64 -1
- package/src/components/dialog/Dialog.tsx +113 -23
- package/src/components/dialog/index.ts +1 -2
- package/src/components/drawer/Drawer.test.tsx +50 -0
- package/src/components/drawer/Drawer.tsx +44 -6
- package/src/components/empty-state/EmptyState.test.tsx +30 -0
- package/src/components/empty-state/EmptyState.tsx +48 -0
- package/src/components/empty-state/index.ts +1 -0
- package/src/components/file-upload/FileUpload.test.tsx +43 -0
- package/src/components/file-upload/FileUpload.tsx +143 -0
- package/src/components/file-upload/index.ts +1 -0
- package/src/components/filter-bar/FilterBar.test.tsx +32 -0
- package/src/components/filter-bar/FilterBar.tsx +71 -0
- package/src/components/filter-bar/index.ts +1 -0
- package/src/components/input-group/InputGroup.test.tsx +6 -3
- package/src/components/input-group/InputGroup.tsx +9 -6
- package/src/components/menu/Menu.test.tsx +21 -0
- package/src/components/menu/Menu.tsx +8 -3
- package/src/components/metric-card/MetricCard.test.tsx +28 -0
- package/src/components/metric-card/MetricCard.tsx +54 -0
- package/src/components/metric-card/index.ts +1 -0
- package/src/components/page-header/PageHeader.test.tsx +31 -0
- package/src/components/page-header/PageHeader.tsx +37 -0
- package/src/components/page-header/index.ts +1 -0
- package/src/components/pagination/Pagination.test.tsx +25 -0
- package/src/components/pagination/Pagination.tsx +53 -12
- package/src/components/password-input/PasswordInput.test.tsx +29 -0
- package/src/components/password-input/PasswordInput.tsx +41 -0
- package/src/components/password-input/index.ts +1 -0
- package/src/components/select/Select.test.tsx +40 -1
- package/src/components/select/Select.tsx +52 -14
- package/src/components/select/index.ts +1 -1
- package/src/components/select-menu/SelectMenu.test.tsx +105 -0
- package/src/components/select-menu/SelectMenu.tsx +368 -0
- package/src/components/select-menu/index.ts +1 -0
- package/src/components/stepper/Stepper.test.tsx +35 -0
- package/src/components/stepper/Stepper.tsx +91 -0
- package/src/components/stepper/index.ts +1 -0
- package/src/components/table-card/TableCard.test.tsx +59 -0
- package/src/components/table-card/TableCard.tsx +48 -0
- package/src/components/table-card/index.ts +1 -0
- package/src/components/time-picker/TimePicker.test.tsx +30 -0
- package/src/components/time-picker/TimePicker.tsx +56 -0
- package/src/components/time-picker/index.ts +1 -0
- package/src/components/timeline/Timeline.test.tsx +26 -0
- package/src/components/timeline/Timeline.tsx +53 -0
- package/src/components/timeline/index.ts +1 -0
- package/src/components/toast/Toast.test.tsx +5 -0
- package/src/components/toast/Toast.tsx +2 -16
- package/src/components/toast/Toaster.test.tsx +84 -0
- package/src/components/toast/Toaster.tsx +116 -0
- package/src/components/toast/index.ts +4 -0
- package/src/components/toast/toast-store.ts +117 -0
- package/src/index.ts +14 -0
- package/src/manifests/app-shell.manifest.json +156 -0
- package/src/manifests/auth-layout.manifest.json +99 -0
- package/src/manifests/autocomplete.manifest.json +53 -5
- package/src/manifests/badge.manifest.json +12 -0
- package/src/manifests/button.manifest.json +6 -2
- package/src/manifests/card.manifest.json +53 -6
- package/src/manifests/date-picker.manifest.json +87 -0
- package/src/manifests/dialog.manifest.json +49 -4
- package/src/manifests/drawer.manifest.json +18 -4
- package/src/manifests/empty-state.manifest.json +108 -0
- package/src/manifests/file-upload.manifest.json +103 -0
- package/src/manifests/filter-bar.manifest.json +100 -0
- package/src/manifests/menu.manifest.json +13 -1
- package/src/manifests/metric-card.manifest.json +105 -0
- package/src/manifests/page-header.manifest.json +94 -0
- package/src/manifests/pagination.manifest.json +62 -34
- package/src/manifests/password-input.manifest.json +75 -0
- package/src/manifests/select-menu.manifest.json +142 -0
- package/src/manifests/select.manifest.json +49 -12
- package/src/manifests/stepper.manifest.json +95 -0
- package/src/manifests/table-card.manifest.json +123 -0
- package/src/manifests/time-picker.manifest.json +86 -0
- package/src/manifests/timeline.manifest.json +69 -0
- package/src/manifests/toast.manifest.json +101 -25
package/dist/index.mjs
CHANGED
|
@@ -48,11 +48,269 @@ function usePresence(open, animate, exitMs = 200) {
|
|
|
48
48
|
return { present, exiting: present && !open };
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
// src/components/
|
|
51
|
+
// src/components/app-shell/AppShell.tsx
|
|
52
|
+
import * as React3 from "react";
|
|
53
|
+
|
|
54
|
+
// src/components/drawer/Drawer.tsx
|
|
52
55
|
import * as React2 from "react";
|
|
56
|
+
import { createPortal } from "react-dom";
|
|
57
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
58
|
+
var FOCUSABLE = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
59
|
+
var sideClasses = {
|
|
60
|
+
right: "inset-y-0 right-0 border-l",
|
|
61
|
+
left: "inset-y-0 left-0 border-r",
|
|
62
|
+
top: "inset-x-0 top-0 border-b",
|
|
63
|
+
bottom: "inset-x-0 bottom-0 border-t"
|
|
64
|
+
};
|
|
65
|
+
var sideWidths = {
|
|
66
|
+
sm: "w-72",
|
|
67
|
+
md: "w-96",
|
|
68
|
+
lg: "w-[32rem]",
|
|
69
|
+
xl: "w-[40rem]",
|
|
70
|
+
"2xl": "w-[48rem]"
|
|
71
|
+
};
|
|
72
|
+
var sideHeights = {
|
|
73
|
+
sm: "h-48",
|
|
74
|
+
md: "h-80",
|
|
75
|
+
lg: "h-[32rem]",
|
|
76
|
+
xl: "h-[40rem]",
|
|
77
|
+
"2xl": "h-[48rem]"
|
|
78
|
+
};
|
|
79
|
+
var sizeClasses = {
|
|
80
|
+
right: sideWidths,
|
|
81
|
+
left: sideWidths,
|
|
82
|
+
top: sideHeights,
|
|
83
|
+
bottom: sideHeights
|
|
84
|
+
};
|
|
85
|
+
function extentStyle(value) {
|
|
86
|
+
if (value === void 0) return void 0;
|
|
87
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
88
|
+
}
|
|
89
|
+
var slideIn = {
|
|
90
|
+
right: "slide-in-from-right",
|
|
91
|
+
left: "slide-in-from-left",
|
|
92
|
+
top: "slide-in-from-top",
|
|
93
|
+
bottom: "slide-in-from-bottom"
|
|
94
|
+
};
|
|
95
|
+
var slideOut = {
|
|
96
|
+
right: "slide-out-to-right",
|
|
97
|
+
left: "slide-out-to-left",
|
|
98
|
+
top: "slide-out-to-top",
|
|
99
|
+
bottom: "slide-out-to-bottom"
|
|
100
|
+
};
|
|
101
|
+
function Drawer({
|
|
102
|
+
open,
|
|
103
|
+
onOpenChange,
|
|
104
|
+
title,
|
|
105
|
+
description,
|
|
106
|
+
children,
|
|
107
|
+
side = "right",
|
|
108
|
+
size = "md",
|
|
109
|
+
width,
|
|
110
|
+
height,
|
|
111
|
+
closeOnBackdrop = true,
|
|
112
|
+
showClose = true,
|
|
113
|
+
initialFocusRef,
|
|
114
|
+
ariaLabel,
|
|
115
|
+
animate = false
|
|
116
|
+
}) {
|
|
117
|
+
const drawerRef = React2.useRef(null);
|
|
118
|
+
const previouslyFocused = React2.useRef(null);
|
|
119
|
+
const titleId = React2.useId();
|
|
120
|
+
const descriptionId = React2.useId();
|
|
121
|
+
const { present, exiting } = usePresence(open, animate);
|
|
122
|
+
React2.useEffect(() => {
|
|
123
|
+
if (open) {
|
|
124
|
+
previouslyFocused.current = document.activeElement;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
previouslyFocused.current?.focus?.();
|
|
128
|
+
previouslyFocused.current = null;
|
|
129
|
+
}, [open]);
|
|
130
|
+
React2.useEffect(() => {
|
|
131
|
+
if (!open || !present) return;
|
|
132
|
+
const node = drawerRef.current;
|
|
133
|
+
const target = initialFocusRef?.current ?? node?.querySelector(FOCUSABLE) ?? node;
|
|
134
|
+
target?.focus();
|
|
135
|
+
}, [open, present, initialFocusRef]);
|
|
136
|
+
React2.useEffect(() => {
|
|
137
|
+
if (!open) return;
|
|
138
|
+
const onKeyDown = (event) => {
|
|
139
|
+
if (event.key === "Escape") {
|
|
140
|
+
event.stopPropagation();
|
|
141
|
+
onOpenChange(false);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (event.key !== "Tab") return;
|
|
145
|
+
const node = drawerRef.current;
|
|
146
|
+
if (!node) return;
|
|
147
|
+
const focusable = Array.from(node.querySelectorAll(FOCUSABLE));
|
|
148
|
+
if (focusable.length === 0) {
|
|
149
|
+
event.preventDefault();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const first = focusable[0];
|
|
153
|
+
const last = focusable[focusable.length - 1];
|
|
154
|
+
const active = document.activeElement;
|
|
155
|
+
if (event.shiftKey && (active === first || !node.contains(active))) {
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
last.focus();
|
|
158
|
+
} else if (!event.shiftKey && active === last) {
|
|
159
|
+
event.preventDefault();
|
|
160
|
+
first.focus();
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
document.addEventListener("keydown", onKeyDown);
|
|
164
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
165
|
+
}, [open, onOpenChange]);
|
|
166
|
+
if (!present || typeof document === "undefined") return null;
|
|
167
|
+
const isVerticalSide = side === "top" || side === "bottom";
|
|
168
|
+
const customExtent = isVerticalSide ? extentStyle(height) : extentStyle(width);
|
|
169
|
+
const motion = animate ? cn(
|
|
170
|
+
"duration-200 motion-reduce:animate-none",
|
|
171
|
+
exiting ? `animate-out ${slideOut[side]}` : `animate-in ${slideIn[side]}`
|
|
172
|
+
) : void 0;
|
|
173
|
+
return createPortal(
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
className: "fixed inset-0 z-50",
|
|
178
|
+
onMouseDown: (event) => {
|
|
179
|
+
if (closeOnBackdrop && event.target === event.currentTarget) onOpenChange(false);
|
|
180
|
+
},
|
|
181
|
+
children: /* @__PURE__ */ jsxs(
|
|
182
|
+
"div",
|
|
183
|
+
{
|
|
184
|
+
ref: drawerRef,
|
|
185
|
+
role: "dialog",
|
|
186
|
+
"aria-modal": "true",
|
|
187
|
+
"aria-label": ariaLabel ?? title,
|
|
188
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
189
|
+
"aria-describedby": description ? descriptionId : void 0,
|
|
190
|
+
tabIndex: -1,
|
|
191
|
+
className: cn(
|
|
192
|
+
"fixed flex flex-col bg-background shadow-xl border-border",
|
|
193
|
+
sideClasses[side],
|
|
194
|
+
sizeClasses[side][size],
|
|
195
|
+
motion
|
|
196
|
+
),
|
|
197
|
+
style: customExtent ? { [isVerticalSide ? "height" : "width"]: customExtent } : void 0,
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 border-b border-border px-5 py-4", children: [
|
|
200
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
201
|
+
/* @__PURE__ */ jsx("h2", { id: titleId, className: "text-base font-semibold leading-tight", children: title }),
|
|
202
|
+
description && /* @__PURE__ */ jsx("p", { id: descriptionId, className: "mt-1 text-sm text-muted-foreground", children: description })
|
|
203
|
+
] }),
|
|
204
|
+
showClose && /* @__PURE__ */ jsx(
|
|
205
|
+
"button",
|
|
206
|
+
{
|
|
207
|
+
type: "button",
|
|
208
|
+
onClick: () => onOpenChange(false),
|
|
209
|
+
"aria-label": "Close drawer",
|
|
210
|
+
className: "-mr-1 rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
211
|
+
children: "\u2715"
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
] }),
|
|
215
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto px-5 py-4", children })
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
document.body
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// src/components/app-shell/AppShell.tsx
|
|
226
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
227
|
+
function Sidebar({
|
|
228
|
+
sections,
|
|
229
|
+
heading,
|
|
230
|
+
footer,
|
|
231
|
+
activeHref,
|
|
232
|
+
linkComponent,
|
|
233
|
+
label = "Primary",
|
|
234
|
+
className,
|
|
235
|
+
...props
|
|
236
|
+
}) {
|
|
237
|
+
const Link = linkComponent ?? "a";
|
|
238
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn("flex h-full min-h-0 flex-col gap-6 p-4", className), ...props, children: [
|
|
239
|
+
heading && /* @__PURE__ */ jsx2("div", { className: "px-2", children: heading }),
|
|
240
|
+
/* @__PURE__ */ jsx2("nav", { "aria-label": label, className: "flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto", children: sections.map((section, index) => /* @__PURE__ */ jsxs2("div", { children: [
|
|
241
|
+
section.title && /* @__PURE__ */ jsx2("p", { className: "mb-1.5 px-2 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: section.title }),
|
|
242
|
+
/* @__PURE__ */ jsx2("ul", { className: "space-y-0.5", children: section.items.map((item) => {
|
|
243
|
+
const active = item.active ?? (activeHref !== void 0 && item.href === activeHref);
|
|
244
|
+
return /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs2(
|
|
245
|
+
Link,
|
|
246
|
+
{
|
|
247
|
+
href: item.href,
|
|
248
|
+
"aria-current": active ? "page" : void 0,
|
|
249
|
+
className: cn(
|
|
250
|
+
"flex items-center gap-2.5 rounded-md px-2.5 py-2 text-sm transition-colors",
|
|
251
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
252
|
+
active ? "bg-primary/10 font-medium text-primary" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
|
253
|
+
),
|
|
254
|
+
children: [
|
|
255
|
+
item.icon && /* @__PURE__ */ jsx2("span", { className: "shrink-0 [&_svg]:size-4", children: item.icon }),
|
|
256
|
+
/* @__PURE__ */ jsx2("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
257
|
+
item.badge && /* @__PURE__ */ jsx2("span", { className: "shrink-0 text-xs", children: item.badge })
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
) }, item.href);
|
|
261
|
+
}) })
|
|
262
|
+
] }, section.title ?? `section-${index}`)) }),
|
|
263
|
+
footer && /* @__PURE__ */ jsx2("div", { className: "border-t border-border pt-4", children: footer })
|
|
264
|
+
] });
|
|
265
|
+
}
|
|
266
|
+
function AppShell({
|
|
267
|
+
sidebar,
|
|
268
|
+
header,
|
|
269
|
+
hideMobileMenu = false,
|
|
270
|
+
sidebarWidth = "w-64",
|
|
271
|
+
className,
|
|
272
|
+
children,
|
|
273
|
+
...props
|
|
274
|
+
}) {
|
|
275
|
+
const [mobileOpen, setMobileOpen] = React3.useState(false);
|
|
276
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn("flex min-h-screen bg-background text-foreground", className), ...props, children: [
|
|
277
|
+
sidebar && /* @__PURE__ */ jsx2("aside", { className: cn("hidden shrink-0 border-r border-border md:block", sidebarWidth), children: sidebar }),
|
|
278
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
279
|
+
(header || sidebar && !hideMobileMenu) && /* @__PURE__ */ jsxs2("header", { className: "sticky top-0 z-30 flex h-14 items-center gap-3 border-b border-border bg-background/80 px-4 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: [
|
|
280
|
+
sidebar && !hideMobileMenu && /* @__PURE__ */ jsx2(
|
|
281
|
+
"button",
|
|
282
|
+
{
|
|
283
|
+
type: "button",
|
|
284
|
+
onClick: () => setMobileOpen(true),
|
|
285
|
+
"aria-label": "Open navigation",
|
|
286
|
+
className: "rounded-md border border-border p-2 text-muted-foreground hover:bg-muted md:hidden",
|
|
287
|
+
children: /* @__PURE__ */ jsx2("span", { "aria-hidden": "true", children: "\u2630" })
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
/* @__PURE__ */ jsx2("div", { className: "min-w-0 flex-1", children: header })
|
|
291
|
+
] }),
|
|
292
|
+
/* @__PURE__ */ jsx2("main", { className: "min-w-0 flex-1", children })
|
|
293
|
+
] }),
|
|
294
|
+
sidebar && /* @__PURE__ */ jsx2(
|
|
295
|
+
Drawer,
|
|
296
|
+
{
|
|
297
|
+
open: mobileOpen,
|
|
298
|
+
onOpenChange: setMobileOpen,
|
|
299
|
+
title: "Navigation",
|
|
300
|
+
side: "left",
|
|
301
|
+
size: "sm",
|
|
302
|
+
animate: true,
|
|
303
|
+
children: sidebar
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] });
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// src/components/button/Button.tsx
|
|
310
|
+
import * as React4 from "react";
|
|
53
311
|
import { Slot } from "@radix-ui/react-slot";
|
|
54
312
|
import { cva } from "class-variance-authority";
|
|
55
|
-
import { jsx } from "react/jsx-runtime";
|
|
313
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
56
314
|
var buttonVariants = cva(
|
|
57
315
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
58
316
|
{
|
|
@@ -66,6 +324,12 @@ var buttonVariants = cva(
|
|
|
66
324
|
warning: "bg-warning text-warning-foreground hover:bg-warning/90",
|
|
67
325
|
info: "bg-info text-info-foreground hover:bg-info/90",
|
|
68
326
|
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
327
|
+
// Colored outlines: semantic border + label on the page surface, with
|
|
328
|
+
// a faint tint on hover — mirrors the Alert variant recipe.
|
|
329
|
+
"outline-destructive": "border border-destructive/50 bg-background text-destructive hover:border-destructive hover:bg-destructive/10",
|
|
330
|
+
"outline-success": "border border-success/50 bg-background text-success hover:border-success hover:bg-success/10",
|
|
331
|
+
"outline-warning": "border border-warning/50 bg-background text-warning hover:border-warning hover:bg-warning/10",
|
|
332
|
+
"outline-info": "border border-info/50 bg-background text-info hover:border-info hover:bg-info/10",
|
|
69
333
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
70
334
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
71
335
|
link: "text-primary underline-offset-4 hover:underline"
|
|
@@ -83,10 +347,10 @@ var buttonVariants = cva(
|
|
|
83
347
|
}
|
|
84
348
|
}
|
|
85
349
|
);
|
|
86
|
-
var Button =
|
|
350
|
+
var Button = React4.forwardRef(
|
|
87
351
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
88
352
|
const Comp = asChild ? Slot : "button";
|
|
89
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ jsx3(
|
|
90
354
|
Comp,
|
|
91
355
|
{
|
|
92
356
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -99,19 +363,22 @@ var Button = React2.forwardRef(
|
|
|
99
363
|
Button.displayName = "Button";
|
|
100
364
|
|
|
101
365
|
// src/components/button-group/ButtonGroup.tsx
|
|
102
|
-
import * as
|
|
103
|
-
import { jsx as
|
|
104
|
-
var ButtonGroup =
|
|
105
|
-
({ orientation = "horizontal", className, ...props }, ref) => /* @__PURE__ */
|
|
366
|
+
import * as React5 from "react";
|
|
367
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
368
|
+
var ButtonGroup = React5.forwardRef(
|
|
369
|
+
({ orientation = "horizontal", className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
106
370
|
"div",
|
|
107
371
|
{
|
|
108
372
|
ref,
|
|
109
373
|
"data-slot": "button-group",
|
|
110
374
|
role: "group",
|
|
111
375
|
className: cn(
|
|
112
|
-
"inline-flex",
|
|
113
|
-
|
|
114
|
-
"[
|
|
376
|
+
"inline-flex overflow-hidden rounded-md border border-border bg-background",
|
|
377
|
+
"[&>*]:rounded-none [&>*]:border-0",
|
|
378
|
+
"[&>*:focus-visible]:ring-inset [&>*:focus-visible]:ring-offset-0",
|
|
379
|
+
// divide-* compiles to `.group > * ~ * { border-left/top }` — higher
|
|
380
|
+
// specificity than the lead-strip above, so seams stay exact.
|
|
381
|
+
orientation === "horizontal" ? "divide-x divide-border" : "flex-col divide-y divide-border",
|
|
115
382
|
className
|
|
116
383
|
),
|
|
117
384
|
...props
|
|
@@ -121,11 +388,11 @@ var ButtonGroup = React3.forwardRef(
|
|
|
121
388
|
ButtonGroup.displayName = "ButtonGroup";
|
|
122
389
|
|
|
123
390
|
// src/components/input/Input.tsx
|
|
124
|
-
import * as
|
|
125
|
-
import { jsx as
|
|
126
|
-
var Input =
|
|
391
|
+
import * as React6 from "react";
|
|
392
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
393
|
+
var Input = React6.forwardRef(
|
|
127
394
|
({ className, type, ...props }, ref) => {
|
|
128
|
-
return /* @__PURE__ */
|
|
395
|
+
return /* @__PURE__ */ jsx5(
|
|
129
396
|
"input",
|
|
130
397
|
{
|
|
131
398
|
type,
|
|
@@ -146,13 +413,13 @@ var Input = React4.forwardRef(
|
|
|
146
413
|
Input.displayName = "Input";
|
|
147
414
|
|
|
148
415
|
// src/components/input-group/InputGroup.tsx
|
|
149
|
-
import * as
|
|
416
|
+
import * as React9 from "react";
|
|
150
417
|
|
|
151
418
|
// src/components/textarea/Textarea.tsx
|
|
152
|
-
import * as
|
|
153
|
-
import { jsx as
|
|
154
|
-
var Textarea =
|
|
155
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
419
|
+
import * as React7 from "react";
|
|
420
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
421
|
+
var Textarea = React7.forwardRef(
|
|
422
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
156
423
|
"textarea",
|
|
157
424
|
{
|
|
158
425
|
ref,
|
|
@@ -170,47 +437,61 @@ var Textarea = React5.forwardRef(
|
|
|
170
437
|
Textarea.displayName = "Textarea";
|
|
171
438
|
|
|
172
439
|
// src/components/select/Select.tsx
|
|
173
|
-
import * as
|
|
174
|
-
import { jsx as
|
|
175
|
-
var Select =
|
|
176
|
-
const generatedId =
|
|
440
|
+
import * as React8 from "react";
|
|
441
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
442
|
+
var Select = React8.forwardRef(function Select2({ options, groups, label, placeholder, multiple = false, value, defaultValue, onChange, id, className, ...props }, ref) {
|
|
443
|
+
const generatedId = React8.useId();
|
|
177
444
|
const selectId = id ?? generatedId;
|
|
178
445
|
const labelId = `${selectId}-label`;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
/* @__PURE__ */
|
|
446
|
+
const renderOption = (option) => /* @__PURE__ */ jsx7("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value);
|
|
447
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-1.5", children: [
|
|
448
|
+
label && /* @__PURE__ */ jsx7("label", { id: labelId, htmlFor: selectId, className: "text-sm font-medium", children: label }),
|
|
449
|
+
/* @__PURE__ */ jsxs3(
|
|
182
450
|
"select",
|
|
183
451
|
{
|
|
184
452
|
ref,
|
|
185
453
|
id: selectId,
|
|
454
|
+
multiple,
|
|
186
455
|
"aria-labelledby": label ? labelId : void 0,
|
|
187
456
|
className: cn(
|
|
188
457
|
"rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
458
|
+
multiple && "min-h-32",
|
|
189
459
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
460
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
190
461
|
className
|
|
191
462
|
),
|
|
192
463
|
value,
|
|
193
464
|
defaultValue,
|
|
194
|
-
onChange: (event) =>
|
|
465
|
+
onChange: (event) => {
|
|
466
|
+
if (!onChange) return;
|
|
467
|
+
if (multiple) {
|
|
468
|
+
onChange(Array.from(event.target.selectedOptions, (option) => option.value));
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
onChange(event.target.value);
|
|
472
|
+
},
|
|
195
473
|
...props,
|
|
196
|
-
children:
|
|
474
|
+
children: [
|
|
475
|
+
placeholder && /* @__PURE__ */ jsx7("option", { value: "", disabled: true, children: placeholder }),
|
|
476
|
+
groups ? groups.map((group) => /* @__PURE__ */ jsx7("optgroup", { label: group.label, children: group.options.map(renderOption) }, group.label)) : (options ?? []).map(renderOption)
|
|
477
|
+
]
|
|
197
478
|
}
|
|
198
479
|
)
|
|
199
480
|
] });
|
|
200
481
|
});
|
|
201
482
|
|
|
202
483
|
// src/components/input-group/InputGroup.tsx
|
|
203
|
-
import { jsx as
|
|
204
|
-
var isNestedField = (child) =>
|
|
205
|
-
var InputGroup =
|
|
484
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
485
|
+
var isNestedField = (child) => React9.isValidElement(child) && (child.type === Input || child.type === Textarea || child.type === Select);
|
|
486
|
+
var InputGroup = React9.forwardRef(
|
|
206
487
|
({ id, "aria-describedby": describedBy, "aria-invalid": invalid, className, children, ...props }, ref) => {
|
|
207
488
|
let wiredChildren = children;
|
|
208
489
|
if (id !== void 0 || describedBy !== void 0 || invalid !== void 0) {
|
|
209
|
-
const items =
|
|
490
|
+
const items = React9.Children.toArray(children);
|
|
210
491
|
const fieldIndex = items.findIndex(isNestedField);
|
|
211
492
|
if (fieldIndex !== -1) {
|
|
212
493
|
const field = items[fieldIndex];
|
|
213
|
-
items[fieldIndex] = isNestedField(field) ?
|
|
494
|
+
items[fieldIndex] = isNestedField(field) ? React9.cloneElement(field, {
|
|
214
495
|
...id !== void 0 && { id },
|
|
215
496
|
...describedBy !== void 0 && { "aria-describedby": describedBy },
|
|
216
497
|
...invalid !== void 0 && { "aria-invalid": invalid }
|
|
@@ -225,7 +506,7 @@ var InputGroup = React7.forwardRef(
|
|
|
225
506
|
};
|
|
226
507
|
}
|
|
227
508
|
}
|
|
228
|
-
return /* @__PURE__ */
|
|
509
|
+
return /* @__PURE__ */ jsx8(
|
|
229
510
|
"div",
|
|
230
511
|
{
|
|
231
512
|
ref,
|
|
@@ -233,12 +514,15 @@ var InputGroup = React7.forwardRef(
|
|
|
233
514
|
className: cn(
|
|
234
515
|
"flex h-10 w-full items-center overflow-hidden rounded-md border border-input bg-background",
|
|
235
516
|
"ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
236
|
-
// The group is the
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
"[&
|
|
517
|
+
// The group's outline is the only outline: force-strip every
|
|
518
|
+
// nested field's border, radius, ring, shadow and UA focus outline.
|
|
519
|
+
// Important flags defeat both the component's own utilities
|
|
520
|
+
// (Input ships `border` + `focus-visible:ring-2`) and browser
|
|
521
|
+
// defaults — no seams appear where an addon sits flush.
|
|
522
|
+
"[&_input]:h-full [&_input]:min-w-0 [&_input]:flex-1 [&_input]:rounded-none [&_input]:px-3 [&_input]:py-2",
|
|
523
|
+
"[&_input]:!border-0 [&_input]:!bg-transparent [&_input]:!shadow-none [&_input]:!outline-none [&_input]:!ring-0 [&_input]:!ring-offset-0",
|
|
524
|
+
"[&_textarea]:!border-0 [&_textarea]:!rounded-none [&_textarea]:!bg-transparent [&_textarea]:!shadow-none [&_textarea]:!outline-none [&_textarea]:!ring-0 [&_textarea]:!ring-offset-0",
|
|
525
|
+
"[&_select]:!border-0 [&_select]:!rounded-none [&_select]:!bg-transparent [&_select]:!shadow-none [&_select]:!outline-none [&_select]:!ring-0 [&_select]:!ring-offset-0",
|
|
242
526
|
"[&_input:disabled]:cursor-not-allowed",
|
|
243
527
|
className
|
|
244
528
|
),
|
|
@@ -249,8 +533,8 @@ var InputGroup = React7.forwardRef(
|
|
|
249
533
|
}
|
|
250
534
|
);
|
|
251
535
|
InputGroup.displayName = "InputGroup";
|
|
252
|
-
var InputGroupAddon =
|
|
253
|
-
({ side = "left", variant = "ghost", className, ...props }, ref) => /* @__PURE__ */
|
|
536
|
+
var InputGroupAddon = React9.forwardRef(
|
|
537
|
+
({ side = "left", variant = "ghost", className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
254
538
|
"div",
|
|
255
539
|
{
|
|
256
540
|
ref,
|
|
@@ -268,9 +552,10 @@ var InputGroupAddon = React7.forwardRef(
|
|
|
268
552
|
InputGroupAddon.displayName = "InputGroupAddon";
|
|
269
553
|
|
|
270
554
|
// src/components/badge/Badge.tsx
|
|
271
|
-
import * as
|
|
555
|
+
import * as React10 from "react";
|
|
556
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
272
557
|
import { cva as cva2 } from "class-variance-authority";
|
|
273
|
-
import { jsx as
|
|
558
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
274
559
|
var badgeVariants = cva2(
|
|
275
560
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
276
561
|
{
|
|
@@ -287,16 +572,19 @@ var badgeVariants = cva2(
|
|
|
287
572
|
}
|
|
288
573
|
}
|
|
289
574
|
);
|
|
290
|
-
var Badge =
|
|
291
|
-
({ className, variant, ...props }, ref) =>
|
|
575
|
+
var Badge = React10.forwardRef(
|
|
576
|
+
({ className, variant, asChild = false, ...props }, ref) => {
|
|
577
|
+
const Comp = asChild ? Slot2 : "div";
|
|
578
|
+
return /* @__PURE__ */ jsx9(Comp, { ref, className: cn(badgeVariants({ variant }), className), ...props });
|
|
579
|
+
}
|
|
292
580
|
);
|
|
293
581
|
Badge.displayName = "Badge";
|
|
294
582
|
|
|
295
583
|
// src/components/avatar/Avatar.tsx
|
|
296
|
-
import * as
|
|
584
|
+
import * as React11 from "react";
|
|
297
585
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
298
|
-
import { jsx as
|
|
299
|
-
var Avatar =
|
|
586
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
587
|
+
var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
300
588
|
AvatarPrimitive.Root,
|
|
301
589
|
{
|
|
302
590
|
ref,
|
|
@@ -308,7 +596,7 @@ var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
308
596
|
}
|
|
309
597
|
));
|
|
310
598
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
311
|
-
var AvatarImage =
|
|
599
|
+
var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
312
600
|
AvatarPrimitive.Image,
|
|
313
601
|
{
|
|
314
602
|
ref,
|
|
@@ -317,7 +605,7 @@ var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
317
605
|
}
|
|
318
606
|
));
|
|
319
607
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
320
|
-
var AvatarFallback =
|
|
608
|
+
var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
321
609
|
AvatarPrimitive.Fallback,
|
|
322
610
|
{
|
|
323
611
|
ref,
|
|
@@ -332,7 +620,7 @@ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
|
332
620
|
|
|
333
621
|
// src/components/spinner/Spinner.tsx
|
|
334
622
|
import { cva as cva3 } from "class-variance-authority";
|
|
335
|
-
import { jsx as
|
|
623
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
336
624
|
var spinnerVariants = cva3(
|
|
337
625
|
"inline-block animate-spin rounded-full border-2 border-current border-t-transparent text-muted-foreground motion-reduce:animate-none",
|
|
338
626
|
{
|
|
@@ -349,83 +637,83 @@ var spinnerVariants = cva3(
|
|
|
349
637
|
}
|
|
350
638
|
);
|
|
351
639
|
function Spinner({ className, size, label = "Loading...", ...props }) {
|
|
352
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ jsx11(
|
|
353
641
|
"span",
|
|
354
642
|
{
|
|
355
643
|
role: "status",
|
|
356
644
|
className: cn(spinnerVariants({ size }), className),
|
|
357
645
|
...props,
|
|
358
|
-
children: /* @__PURE__ */
|
|
646
|
+
children: /* @__PURE__ */ jsx11("span", { className: "sr-only", children: label })
|
|
359
647
|
}
|
|
360
648
|
);
|
|
361
649
|
}
|
|
362
650
|
|
|
363
651
|
// src/components/toast/Toast.tsx
|
|
364
|
-
import * as
|
|
365
|
-
import { jsx as
|
|
366
|
-
var ToastContext =
|
|
652
|
+
import * as React12 from "react";
|
|
653
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
654
|
+
var ToastContext = React12.createContext(null);
|
|
367
655
|
var DEFAULT_DURATION = 5e3;
|
|
368
656
|
function ToastProvider({ children, label = "Notifications" }) {
|
|
369
|
-
const [
|
|
370
|
-
const
|
|
371
|
-
const
|
|
372
|
-
const timer =
|
|
657
|
+
const [toasts2, setToasts] = React12.useState([]);
|
|
658
|
+
const timers2 = React12.useRef(/* @__PURE__ */ new Map());
|
|
659
|
+
const dismiss2 = React12.useCallback((id) => {
|
|
660
|
+
const timer = timers2.current.get(id);
|
|
373
661
|
if (timer) {
|
|
374
662
|
clearTimeout(timer);
|
|
375
|
-
|
|
663
|
+
timers2.current.delete(id);
|
|
376
664
|
}
|
|
377
665
|
setToasts((current) => current.filter((entry) => entry.id !== id));
|
|
378
666
|
}, []);
|
|
379
|
-
const
|
|
667
|
+
const toast2 = React12.useCallback(
|
|
380
668
|
(options) => {
|
|
381
669
|
const id = `toast-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
382
670
|
setToasts((current) => [...current, { ...options, id }]);
|
|
383
671
|
const duration = options.duration ?? DEFAULT_DURATION;
|
|
384
672
|
if (duration > 0) {
|
|
385
|
-
|
|
673
|
+
timers2.current.set(
|
|
386
674
|
id,
|
|
387
|
-
setTimeout(() =>
|
|
675
|
+
setTimeout(() => dismiss2(id), duration)
|
|
388
676
|
);
|
|
389
677
|
}
|
|
390
678
|
return id;
|
|
391
679
|
},
|
|
392
|
-
[
|
|
680
|
+
[dismiss2]
|
|
393
681
|
);
|
|
394
|
-
|
|
395
|
-
const pending =
|
|
682
|
+
React12.useEffect(() => {
|
|
683
|
+
const pending = timers2.current;
|
|
396
684
|
return () => {
|
|
397
685
|
for (const timer of pending.values()) clearTimeout(timer);
|
|
398
686
|
pending.clear();
|
|
399
687
|
};
|
|
400
688
|
}, []);
|
|
401
|
-
const value =
|
|
402
|
-
return /* @__PURE__ */
|
|
689
|
+
const value = React12.useMemo(() => ({ toasts: toasts2, toast: toast2, dismiss: dismiss2 }), [toasts2, toast2, dismiss2]);
|
|
690
|
+
return /* @__PURE__ */ jsxs4(ToastContext.Provider, { value, children: [
|
|
403
691
|
children,
|
|
404
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ jsx12(ToastRegion, { toasts: toasts2, onDismiss: dismiss2, label })
|
|
405
693
|
] });
|
|
406
694
|
}
|
|
407
695
|
function useToast() {
|
|
408
|
-
const context =
|
|
696
|
+
const context = React12.useContext(ToastContext);
|
|
409
697
|
if (!context) throw new Error("useToast must be used within a <ToastProvider>.");
|
|
410
698
|
return context;
|
|
411
699
|
}
|
|
412
700
|
function ToastRegion({
|
|
413
|
-
toasts,
|
|
701
|
+
toasts: toasts2,
|
|
414
702
|
onDismiss,
|
|
415
703
|
label
|
|
416
704
|
}) {
|
|
417
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ jsx12(
|
|
418
706
|
"ol",
|
|
419
707
|
{
|
|
420
708
|
"aria-label": label,
|
|
421
709
|
className: "fixed bottom-4 right-4 z-50 flex w-full max-w-sm flex-col gap-2",
|
|
422
|
-
children:
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
entry.description && /* @__PURE__ */
|
|
710
|
+
children: toasts2.map((entry) => /* @__PURE__ */ jsxs4("li", { className: "rounded-lg border border-border bg-card p-4 shadow-lg", children: [
|
|
711
|
+
/* @__PURE__ */ jsxs4("div", { role: "status", className: "flex items-start justify-between gap-3", children: [
|
|
712
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
713
|
+
/* @__PURE__ */ jsx12("p", { className: "text-sm font-semibold", children: entry.title }),
|
|
714
|
+
entry.description && /* @__PURE__ */ jsx12("p", { className: "mt-1 text-sm text-muted-foreground", children: entry.description })
|
|
427
715
|
] }),
|
|
428
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ jsx12(
|
|
429
717
|
"button",
|
|
430
718
|
{
|
|
431
719
|
type: "button",
|
|
@@ -436,7 +724,7 @@ function ToastRegion({
|
|
|
436
724
|
}
|
|
437
725
|
)
|
|
438
726
|
] }),
|
|
439
|
-
entry.action && /* @__PURE__ */
|
|
727
|
+
entry.action && /* @__PURE__ */ jsx12(
|
|
440
728
|
"button",
|
|
441
729
|
{
|
|
442
730
|
type: "button",
|
|
@@ -453,165 +741,200 @@ function ToastRegion({
|
|
|
453
741
|
);
|
|
454
742
|
}
|
|
455
743
|
|
|
456
|
-
// src/components/
|
|
457
|
-
import * as
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
var
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
744
|
+
// src/components/toast/Toaster.tsx
|
|
745
|
+
import * as React13 from "react";
|
|
746
|
+
|
|
747
|
+
// src/components/toast/toast-store.ts
|
|
748
|
+
var DEFAULT_DURATION2 = 5e3;
|
|
749
|
+
var toasts = [];
|
|
750
|
+
var EMPTY = [];
|
|
751
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
752
|
+
var timers = /* @__PURE__ */ new Map();
|
|
753
|
+
function emit() {
|
|
754
|
+
for (const listener of listeners) listener(toasts);
|
|
755
|
+
}
|
|
756
|
+
function dismiss(id) {
|
|
757
|
+
const timer = timers.get(id);
|
|
758
|
+
if (timer) {
|
|
759
|
+
clearTimeout(timer);
|
|
760
|
+
timers.delete(id);
|
|
761
|
+
}
|
|
762
|
+
toasts = toasts.filter((entry) => entry.id !== id);
|
|
763
|
+
emit();
|
|
764
|
+
}
|
|
765
|
+
function show(options) {
|
|
766
|
+
const id = `toast-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
767
|
+
toasts = [...toasts, { ...options, id }];
|
|
768
|
+
emit();
|
|
769
|
+
const duration = options.duration ?? DEFAULT_DURATION2;
|
|
770
|
+
if (duration > 0) {
|
|
771
|
+
timers.set(
|
|
772
|
+
id,
|
|
773
|
+
setTimeout(() => dismiss(id), duration)
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
return id;
|
|
777
|
+
}
|
|
778
|
+
var toast = Object.assign(
|
|
779
|
+
(options) => show({ ...options, variant: options.variant ?? "default" }),
|
|
780
|
+
{
|
|
781
|
+
success: (title, description) => show({ title, description, variant: "success" }),
|
|
782
|
+
error: (title, description) => show({ title, description, variant: "error" }),
|
|
783
|
+
warning: (title, description) => show({ title, description, variant: "warning" }),
|
|
784
|
+
info: (title, description) => show({ title, description, variant: "info" }),
|
|
785
|
+
dismiss: (id) => {
|
|
786
|
+
if (id) {
|
|
787
|
+
dismiss(id);
|
|
497
788
|
return;
|
|
498
789
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
790
|
+
for (const entry of [...toasts]) dismiss(entry.id);
|
|
791
|
+
},
|
|
792
|
+
clear: () => {
|
|
793
|
+
for (const entry of [...toasts]) dismiss(entry.id);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
);
|
|
797
|
+
function subscribeToToasts(listener) {
|
|
798
|
+
listeners.add(listener);
|
|
799
|
+
return () => listeners.delete(listener);
|
|
800
|
+
}
|
|
801
|
+
function getToastSnapshot() {
|
|
802
|
+
return toasts;
|
|
803
|
+
}
|
|
804
|
+
function getToastServerSnapshot() {
|
|
805
|
+
return EMPTY;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
// src/components/toast/Toaster.tsx
|
|
809
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
810
|
+
var positionClasses = {
|
|
811
|
+
"top-left": "left-4 top-4 items-start",
|
|
812
|
+
"top-center": "left-1/2 top-4 -translate-x-1/2 items-center",
|
|
813
|
+
"top-right": "right-4 top-4 items-end",
|
|
814
|
+
"bottom-left": "bottom-4 left-4 items-start",
|
|
815
|
+
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2 items-center",
|
|
816
|
+
"bottom-right": "bottom-4 right-4 items-end"
|
|
817
|
+
};
|
|
818
|
+
var richClasses = {
|
|
819
|
+
default: "border-border bg-card",
|
|
820
|
+
success: "border-success/50 bg-success/10",
|
|
821
|
+
error: "border-destructive/50 bg-destructive/10",
|
|
822
|
+
warning: "border-warning/50 bg-warning/10",
|
|
823
|
+
info: "border-info/50 bg-info/10"
|
|
824
|
+
};
|
|
825
|
+
var dotClasses = {
|
|
826
|
+
default: "bg-muted-foreground",
|
|
827
|
+
success: "bg-success",
|
|
828
|
+
error: "bg-destructive",
|
|
829
|
+
warning: "bg-warning",
|
|
830
|
+
info: "bg-info"
|
|
831
|
+
};
|
|
832
|
+
function Toaster({ position = "bottom-right", label = "Notifications", richColors = false }) {
|
|
833
|
+
const entries = React13.useSyncExternalStore(subscribeToToasts, getToastSnapshot, getToastServerSnapshot);
|
|
834
|
+
return /* @__PURE__ */ jsx13(
|
|
835
|
+
"ol",
|
|
836
|
+
{
|
|
837
|
+
"aria-label": label,
|
|
838
|
+
className: cn("fixed z-[60] flex w-full max-w-sm flex-col gap-2", positionClasses[position]),
|
|
839
|
+
children: entries.map((entry) => {
|
|
840
|
+
const variant = entry.variant ?? "default";
|
|
841
|
+
return /* @__PURE__ */ jsx13(
|
|
842
|
+
"li",
|
|
533
843
|
{
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
"
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
-
showClose && /* @__PURE__ */ jsx11(
|
|
844
|
+
className: cn(
|
|
845
|
+
"rounded-lg border p-4 shadow-lg",
|
|
846
|
+
richColors ? richClasses[variant] : "border-border bg-card"
|
|
847
|
+
),
|
|
848
|
+
children: /* @__PURE__ */ jsxs5("div", { role: "status", className: "flex items-start gap-3", children: [
|
|
849
|
+
/* @__PURE__ */ jsx13("span", { "aria-hidden": "true", className: cn("mt-1 h-2 w-2 shrink-0 rounded-full", dotClasses[variant]) }),
|
|
850
|
+
/* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1", children: [
|
|
851
|
+
/* @__PURE__ */ jsx13("p", { className: "text-sm font-semibold", children: entry.title }),
|
|
852
|
+
entry.description && /* @__PURE__ */ jsx13("p", { className: "mt-1 text-sm text-muted-foreground", children: entry.description }),
|
|
853
|
+
entry.action && /* @__PURE__ */ jsx13(
|
|
545
854
|
"button",
|
|
546
855
|
{
|
|
547
856
|
type: "button",
|
|
548
|
-
onClick: () =>
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
857
|
+
onClick: () => {
|
|
858
|
+
entry.action?.onClick();
|
|
859
|
+
toast.dismiss(entry.id);
|
|
860
|
+
},
|
|
861
|
+
className: "mt-2 text-sm font-medium text-primary hover:underline",
|
|
862
|
+
children: entry.action.label
|
|
552
863
|
}
|
|
553
864
|
)
|
|
554
865
|
] }),
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
866
|
+
/* @__PURE__ */ jsx13(
|
|
867
|
+
"button",
|
|
868
|
+
{
|
|
869
|
+
type: "button",
|
|
870
|
+
onClick: () => toast.dismiss(entry.id),
|
|
871
|
+
"aria-label": `Dismiss ${entry.title}`,
|
|
872
|
+
className: "rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
873
|
+
children: "\u2715"
|
|
874
|
+
}
|
|
875
|
+
)
|
|
876
|
+
] })
|
|
877
|
+
},
|
|
878
|
+
entry.id
|
|
879
|
+
);
|
|
880
|
+
})
|
|
881
|
+
}
|
|
563
882
|
);
|
|
564
883
|
}
|
|
565
|
-
|
|
566
|
-
// src/components/
|
|
567
|
-
import * as
|
|
884
|
+
|
|
885
|
+
// src/components/dialog/Dialog.tsx
|
|
886
|
+
import * as React14 from "react";
|
|
568
887
|
import { createPortal as createPortal2 } from "react-dom";
|
|
569
|
-
import { jsx as
|
|
888
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
570
889
|
var FOCUSABLE2 = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
571
|
-
var
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
var sizeClasses = {
|
|
578
|
-
right: { sm: "w-72", md: "w-96", lg: "w-[32rem]" },
|
|
579
|
-
left: { sm: "w-72", md: "w-96", lg: "w-[32rem]" },
|
|
580
|
-
top: { sm: "h-48", md: "h-80", lg: "h-[32rem]" },
|
|
581
|
-
bottom: { sm: "h-48", md: "h-80", lg: "h-[32rem]" }
|
|
582
|
-
};
|
|
583
|
-
var slideIn = {
|
|
584
|
-
right: "slide-in-from-right",
|
|
585
|
-
left: "slide-in-from-left",
|
|
586
|
-
top: "slide-in-from-top",
|
|
587
|
-
bottom: "slide-in-from-bottom"
|
|
588
|
-
};
|
|
589
|
-
var slideOut = {
|
|
590
|
-
right: "slide-out-to-right",
|
|
591
|
-
left: "slide-out-to-left",
|
|
592
|
-
top: "slide-out-to-top",
|
|
593
|
-
bottom: "slide-out-to-bottom"
|
|
890
|
+
var sizeClasses2 = {
|
|
891
|
+
sm: "max-w-sm",
|
|
892
|
+
md: "max-w-md",
|
|
893
|
+
lg: "max-w-lg",
|
|
894
|
+
xl: "max-w-xl",
|
|
895
|
+
"2xl": "max-w-2xl"
|
|
594
896
|
};
|
|
595
|
-
|
|
897
|
+
var DialogIdsContext = React14.createContext(null);
|
|
898
|
+
function DialogHeader({ className, ...props }) {
|
|
899
|
+
return /* @__PURE__ */ jsx14("div", { className: cn("flex items-start justify-between gap-4", className), ...props });
|
|
900
|
+
}
|
|
901
|
+
function DialogTitle({ className, ...props }) {
|
|
902
|
+
const ids = React14.useContext(DialogIdsContext);
|
|
903
|
+
return /* @__PURE__ */ jsx14("h2", { id: ids?.titleId, className: cn("text-lg font-semibold", className), ...props });
|
|
904
|
+
}
|
|
905
|
+
function DialogDescription({ className, ...props }) {
|
|
906
|
+
const ids = React14.useContext(DialogIdsContext);
|
|
907
|
+
return /* @__PURE__ */ jsx14("p", { id: ids?.descriptionId, className: cn("mt-2 text-sm text-muted-foreground", className), ...props });
|
|
908
|
+
}
|
|
909
|
+
function DialogBody({ className, ...props }) {
|
|
910
|
+
return /* @__PURE__ */ jsx14("div", { className: cn("mt-4", className), ...props });
|
|
911
|
+
}
|
|
912
|
+
function DialogFooter({ className, ...props }) {
|
|
913
|
+
return /* @__PURE__ */ jsx14("div", { className: cn("mt-6 flex items-center justify-end gap-2", className), ...props });
|
|
914
|
+
}
|
|
915
|
+
function Dialog({
|
|
596
916
|
open,
|
|
597
917
|
onOpenChange,
|
|
598
918
|
title,
|
|
599
919
|
description,
|
|
600
920
|
children,
|
|
601
|
-
side = "right",
|
|
602
921
|
size = "md",
|
|
922
|
+
header,
|
|
923
|
+
footer,
|
|
924
|
+
scrollable = false,
|
|
925
|
+
bodyClassName,
|
|
603
926
|
closeOnBackdrop = true,
|
|
604
927
|
showClose = true,
|
|
605
928
|
initialFocusRef,
|
|
606
929
|
ariaLabel,
|
|
607
930
|
animate = false
|
|
608
931
|
}) {
|
|
609
|
-
const
|
|
610
|
-
const previouslyFocused =
|
|
611
|
-
const titleId =
|
|
612
|
-
const descriptionId =
|
|
932
|
+
const dialogRef = React14.useRef(null);
|
|
933
|
+
const previouslyFocused = React14.useRef(null);
|
|
934
|
+
const titleId = React14.useId();
|
|
935
|
+
const descriptionId = React14.useId();
|
|
613
936
|
const { present, exiting } = usePresence(open, animate);
|
|
614
|
-
|
|
937
|
+
React14.useEffect(() => {
|
|
615
938
|
if (open) {
|
|
616
939
|
previouslyFocused.current = document.activeElement;
|
|
617
940
|
return;
|
|
@@ -619,13 +942,13 @@ function Drawer({
|
|
|
619
942
|
previouslyFocused.current?.focus?.();
|
|
620
943
|
previouslyFocused.current = null;
|
|
621
944
|
}, [open]);
|
|
622
|
-
|
|
945
|
+
React14.useEffect(() => {
|
|
623
946
|
if (!open || !present) return;
|
|
624
|
-
const node =
|
|
947
|
+
const node = dialogRef.current;
|
|
625
948
|
const target = initialFocusRef?.current ?? node?.querySelector(FOCUSABLE2) ?? node;
|
|
626
949
|
target?.focus();
|
|
627
950
|
}, [open, present, initialFocusRef]);
|
|
628
|
-
|
|
951
|
+
React14.useEffect(() => {
|
|
629
952
|
if (!open) return;
|
|
630
953
|
const onKeyDown = (event) => {
|
|
631
954
|
if (event.key === "Escape") {
|
|
@@ -634,17 +957,14 @@ function Drawer({
|
|
|
634
957
|
return;
|
|
635
958
|
}
|
|
636
959
|
if (event.key !== "Tab") return;
|
|
637
|
-
const node =
|
|
960
|
+
const node = dialogRef.current;
|
|
638
961
|
if (!node) return;
|
|
639
962
|
const focusable = Array.from(node.querySelectorAll(FOCUSABLE2));
|
|
640
|
-
if (focusable.length === 0)
|
|
641
|
-
event.preventDefault();
|
|
642
|
-
return;
|
|
643
|
-
}
|
|
963
|
+
if (focusable.length === 0) return;
|
|
644
964
|
const first = focusable[0];
|
|
645
965
|
const last = focusable[focusable.length - 1];
|
|
646
966
|
const active = document.activeElement;
|
|
647
|
-
if (event.shiftKey && (active === first ||
|
|
967
|
+
if (event.shiftKey && (active === first || active === node)) {
|
|
648
968
|
event.preventDefault();
|
|
649
969
|
last.focus();
|
|
650
970
|
} else if (!event.shiftKey && active === last) {
|
|
@@ -652,57 +972,67 @@ function Drawer({
|
|
|
652
972
|
first.focus();
|
|
653
973
|
}
|
|
654
974
|
};
|
|
655
|
-
document.addEventListener("keydown", onKeyDown);
|
|
656
|
-
return () => document.removeEventListener("keydown", onKeyDown);
|
|
975
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
976
|
+
return () => document.removeEventListener("keydown", onKeyDown, true);
|
|
657
977
|
}, [open, onOpenChange]);
|
|
658
978
|
if (!present || typeof document === "undefined") return null;
|
|
659
979
|
const motion = animate ? cn(
|
|
660
980
|
"duration-200 motion-reduce:animate-none",
|
|
661
|
-
exiting ?
|
|
981
|
+
exiting ? "animate-out fade-out-0 zoom-out-95" : "animate-in fade-in-0 zoom-in-95"
|
|
662
982
|
) : void 0;
|
|
663
983
|
return createPortal2(
|
|
664
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ jsx14(
|
|
665
985
|
"div",
|
|
666
986
|
{
|
|
667
|
-
className: "fixed inset-0 z-50",
|
|
987
|
+
className: cn("fixed inset-0 z-50 flex items-center justify-center bg-background/80 p-4", motion),
|
|
668
988
|
onMouseDown: (event) => {
|
|
669
989
|
if (closeOnBackdrop && event.target === event.currentTarget) onOpenChange(false);
|
|
670
990
|
},
|
|
671
|
-
children: /* @__PURE__ */
|
|
991
|
+
children: /* @__PURE__ */ jsx14(
|
|
672
992
|
"div",
|
|
673
993
|
{
|
|
674
|
-
ref:
|
|
994
|
+
ref: dialogRef,
|
|
675
995
|
role: "dialog",
|
|
676
996
|
"aria-modal": "true",
|
|
677
|
-
"aria-
|
|
678
|
-
"aria-
|
|
997
|
+
"aria-labelledby": ariaLabel ? void 0 : titleId,
|
|
998
|
+
"aria-label": ariaLabel,
|
|
679
999
|
"aria-describedby": description ? descriptionId : void 0,
|
|
680
1000
|
tabIndex: -1,
|
|
681
1001
|
className: cn(
|
|
682
|
-
"
|
|
683
|
-
|
|
684
|
-
sizeClasses[side][size],
|
|
1002
|
+
"flex w-full flex-col rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
1003
|
+
sizeClasses2[size],
|
|
685
1004
|
motion
|
|
686
1005
|
),
|
|
687
|
-
children: [
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
description && /* @__PURE__ */
|
|
1006
|
+
children: /* @__PURE__ */ jsxs6(DialogIdsContext.Provider, { value: { titleId, descriptionId }, children: [
|
|
1007
|
+
header ?? /* @__PURE__ */ jsxs6(DialogHeader, { children: [
|
|
1008
|
+
/* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
|
|
1009
|
+
title && /* @__PURE__ */ jsx14(DialogTitle, { children: title }),
|
|
1010
|
+
description && /* @__PURE__ */ jsx14(DialogDescription, { children: description })
|
|
692
1011
|
] }),
|
|
693
|
-
showClose && /* @__PURE__ */
|
|
1012
|
+
showClose && /* @__PURE__ */ jsx14(
|
|
694
1013
|
"button",
|
|
695
1014
|
{
|
|
696
1015
|
type: "button",
|
|
697
1016
|
onClick: () => onOpenChange(false),
|
|
698
|
-
"aria-label": "Close
|
|
699
|
-
className: "
|
|
1017
|
+
"aria-label": "Close dialog",
|
|
1018
|
+
className: "rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
700
1019
|
children: "\u2715"
|
|
701
1020
|
}
|
|
702
1021
|
)
|
|
703
1022
|
] }),
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
|
|
1023
|
+
/* @__PURE__ */ jsx14(
|
|
1024
|
+
"div",
|
|
1025
|
+
{
|
|
1026
|
+
className: cn(
|
|
1027
|
+
"mt-4 min-h-0",
|
|
1028
|
+
scrollable && "max-h-[60vh] overflow-y-auto pr-1",
|
|
1029
|
+
bodyClassName
|
|
1030
|
+
),
|
|
1031
|
+
children
|
|
1032
|
+
}
|
|
1033
|
+
),
|
|
1034
|
+
footer && /* @__PURE__ */ jsx14(DialogFooter, { children: footer })
|
|
1035
|
+
] })
|
|
706
1036
|
}
|
|
707
1037
|
)
|
|
708
1038
|
}
|
|
@@ -711,12 +1041,308 @@ function Drawer({
|
|
|
711
1041
|
);
|
|
712
1042
|
}
|
|
713
1043
|
|
|
714
|
-
// src/components/
|
|
715
|
-
import * as
|
|
1044
|
+
// src/components/table-card/TableCard.tsx
|
|
1045
|
+
import * as React15 from "react";
|
|
1046
|
+
import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1047
|
+
var TableCard = React15.forwardRef(function TableCard2({ title, description, actions, toolbar, children, footer, flush = true, className, ...props }, ref) {
|
|
1048
|
+
return /* @__PURE__ */ jsxs7(
|
|
1049
|
+
"div",
|
|
1050
|
+
{
|
|
1051
|
+
ref,
|
|
1052
|
+
className: cn("overflow-hidden rounded-xl border border-border bg-card text-card-foreground", className),
|
|
1053
|
+
...props,
|
|
1054
|
+
children: [
|
|
1055
|
+
(title || description || actions) && /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
1056
|
+
/* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
|
|
1057
|
+
title && /* @__PURE__ */ jsx15("h2", { className: "text-sm font-semibold", children: title }),
|
|
1058
|
+
description && /* @__PURE__ */ jsx15("p", { className: "mt-0.5 text-sm text-muted-foreground", children: description })
|
|
1059
|
+
] }),
|
|
1060
|
+
actions && /* @__PURE__ */ jsx15("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
1061
|
+
] }),
|
|
1062
|
+
toolbar && /* @__PURE__ */ jsx15("div", { className: "border-b border-border px-4 py-2", children: toolbar }),
|
|
1063
|
+
/* @__PURE__ */ jsx15("div", { className: cn(flush ? "overflow-x-auto" : "p-4"), children }),
|
|
1064
|
+
footer && /* @__PURE__ */ jsx15("div", { className: "border-t border-border px-4 py-3", children: footer })
|
|
1065
|
+
]
|
|
1066
|
+
}
|
|
1067
|
+
);
|
|
1068
|
+
});
|
|
1069
|
+
|
|
1070
|
+
// src/components/select-menu/SelectMenu.tsx
|
|
1071
|
+
import * as React16 from "react";
|
|
716
1072
|
import { createPortal as createPortal3 } from "react-dom";
|
|
1073
|
+
import { Fragment, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1074
|
+
function useOutsideClose(open, close, refs) {
|
|
1075
|
+
React16.useEffect(() => {
|
|
1076
|
+
if (!open) return;
|
|
1077
|
+
const onPointerDown = (event) => {
|
|
1078
|
+
const target = event.target;
|
|
1079
|
+
if (refs.some((ref) => ref.current?.contains(target))) return;
|
|
1080
|
+
close();
|
|
1081
|
+
};
|
|
1082
|
+
document.addEventListener("mousedown", onPointerDown);
|
|
1083
|
+
return () => document.removeEventListener("mousedown", onPointerDown);
|
|
1084
|
+
}, [open, close, refs]);
|
|
1085
|
+
}
|
|
1086
|
+
var SelectMenu = React16.forwardRef(function SelectMenu2({
|
|
1087
|
+
items,
|
|
1088
|
+
value,
|
|
1089
|
+
defaultValue,
|
|
1090
|
+
onValueChange,
|
|
1091
|
+
multiple = false,
|
|
1092
|
+
placeholder = "Select\u2026",
|
|
1093
|
+
name,
|
|
1094
|
+
renderValue,
|
|
1095
|
+
renderItem,
|
|
1096
|
+
emptyText = "No options",
|
|
1097
|
+
className,
|
|
1098
|
+
disabled,
|
|
1099
|
+
onKeyDown,
|
|
1100
|
+
...buttonProps
|
|
1101
|
+
}, ref) {
|
|
1102
|
+
const [internal, setInternal] = React16.useState(() => {
|
|
1103
|
+
if (defaultValue === void 0) return [];
|
|
1104
|
+
return Array.isArray(defaultValue) ? defaultValue : [defaultValue];
|
|
1105
|
+
});
|
|
1106
|
+
const selectedValues = React16.useMemo(() => {
|
|
1107
|
+
if (value === void 0) return internal;
|
|
1108
|
+
return Array.isArray(value) ? value : [value];
|
|
1109
|
+
}, [value, internal]);
|
|
1110
|
+
const [open, setOpen] = React16.useState(false);
|
|
1111
|
+
const [activeIndex, setActiveIndex] = React16.useState(-1);
|
|
1112
|
+
const [position, setPosition] = React16.useState(null);
|
|
1113
|
+
const triggerRef = React16.useRef(null);
|
|
1114
|
+
const listRef = React16.useRef(null);
|
|
1115
|
+
const listboxId = React16.useId();
|
|
1116
|
+
const labelId = React16.useId();
|
|
1117
|
+
const typeahead = React16.useRef({ query: "", at: 0 });
|
|
1118
|
+
const setTriggerRef = React16.useCallback(
|
|
1119
|
+
(node) => {
|
|
1120
|
+
triggerRef.current = node;
|
|
1121
|
+
if (typeof ref === "function") ref(node);
|
|
1122
|
+
else if (ref) ref.current = node;
|
|
1123
|
+
},
|
|
1124
|
+
[ref]
|
|
1125
|
+
);
|
|
1126
|
+
const close = React16.useCallback(() => setOpen(false), []);
|
|
1127
|
+
useOutsideClose(open, close, [triggerRef, listRef]);
|
|
1128
|
+
const measure = React16.useCallback(() => {
|
|
1129
|
+
const node = triggerRef.current;
|
|
1130
|
+
if (!node) return;
|
|
1131
|
+
const rect = node.getBoundingClientRect();
|
|
1132
|
+
setPosition({ top: rect.bottom + 4, left: rect.left, width: Math.max(rect.width, 200) });
|
|
1133
|
+
}, []);
|
|
1134
|
+
React16.useEffect(() => {
|
|
1135
|
+
if (!open) return;
|
|
1136
|
+
measure();
|
|
1137
|
+
const onScroll = () => measure();
|
|
1138
|
+
window.addEventListener("resize", onScroll);
|
|
1139
|
+
window.addEventListener("scroll", onScroll, true);
|
|
1140
|
+
return () => {
|
|
1141
|
+
window.removeEventListener("resize", onScroll);
|
|
1142
|
+
window.removeEventListener("scroll", onScroll, true);
|
|
1143
|
+
};
|
|
1144
|
+
}, [open, measure]);
|
|
1145
|
+
const firstEnabled = React16.useMemo(() => items.findIndex((item) => !item.disabled), [items]);
|
|
1146
|
+
const openMenu = () => {
|
|
1147
|
+
if (disabled) return;
|
|
1148
|
+
setOpen(true);
|
|
1149
|
+
const selectedIndex = items.findIndex((item) => selectedValues.includes(item.value) && !item.disabled);
|
|
1150
|
+
setActiveIndex(selectedIndex >= 0 ? selectedIndex : firstEnabled);
|
|
1151
|
+
};
|
|
1152
|
+
const commit = (next) => {
|
|
1153
|
+
if (value === void 0) setInternal(next);
|
|
1154
|
+
onValueChange?.(multiple ? next : next[0] ?? "");
|
|
1155
|
+
};
|
|
1156
|
+
const select = (item) => {
|
|
1157
|
+
if (item.disabled) return;
|
|
1158
|
+
if (multiple) {
|
|
1159
|
+
const next = selectedValues.includes(item.value) ? selectedValues.filter((entry) => entry !== item.value) : [...selectedValues, item.value];
|
|
1160
|
+
commit(next);
|
|
1161
|
+
return;
|
|
1162
|
+
}
|
|
1163
|
+
commit([item.value]);
|
|
1164
|
+
setOpen(false);
|
|
1165
|
+
};
|
|
1166
|
+
const move = (direction) => {
|
|
1167
|
+
if (items.length === 0) return;
|
|
1168
|
+
let index = activeIndex;
|
|
1169
|
+
for (let step = 0; step < items.length; step += 1) {
|
|
1170
|
+
index = (index + direction + items.length) % items.length;
|
|
1171
|
+
if (!items[index]?.disabled) {
|
|
1172
|
+
setActiveIndex(index);
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
};
|
|
1177
|
+
const handleKeyDown = (event) => {
|
|
1178
|
+
onKeyDown?.(event);
|
|
1179
|
+
if (event.defaultPrevented) return;
|
|
1180
|
+
if (!open) {
|
|
1181
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter" || event.key === " ") {
|
|
1182
|
+
event.preventDefault();
|
|
1183
|
+
openMenu();
|
|
1184
|
+
}
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
switch (event.key) {
|
|
1188
|
+
case "ArrowDown":
|
|
1189
|
+
event.preventDefault();
|
|
1190
|
+
move(1);
|
|
1191
|
+
break;
|
|
1192
|
+
case "ArrowUp":
|
|
1193
|
+
event.preventDefault();
|
|
1194
|
+
move(-1);
|
|
1195
|
+
break;
|
|
1196
|
+
case "Home":
|
|
1197
|
+
event.preventDefault();
|
|
1198
|
+
setActiveIndex(firstEnabled);
|
|
1199
|
+
break;
|
|
1200
|
+
case "End": {
|
|
1201
|
+
event.preventDefault();
|
|
1202
|
+
for (let i = items.length - 1; i >= 0; i -= 1) {
|
|
1203
|
+
if (!items[i]?.disabled) {
|
|
1204
|
+
setActiveIndex(i);
|
|
1205
|
+
break;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
break;
|
|
1209
|
+
}
|
|
1210
|
+
case "Enter":
|
|
1211
|
+
case " ":
|
|
1212
|
+
event.preventDefault();
|
|
1213
|
+
if (activeIndex >= 0 && items[activeIndex]) select(items[activeIndex]);
|
|
1214
|
+
break;
|
|
1215
|
+
case "Escape":
|
|
1216
|
+
event.preventDefault();
|
|
1217
|
+
setOpen(false);
|
|
1218
|
+
break;
|
|
1219
|
+
case "Tab":
|
|
1220
|
+
setOpen(false);
|
|
1221
|
+
break;
|
|
1222
|
+
default: {
|
|
1223
|
+
if (event.key.length !== 1 || event.metaKey || event.ctrlKey || event.altKey) return;
|
|
1224
|
+
const now = Date.now();
|
|
1225
|
+
const buffer = now - typeahead.current.at > 600 ? event.key : typeahead.current.query + event.key;
|
|
1226
|
+
typeahead.current = { query: buffer, at: now };
|
|
1227
|
+
const query = buffer.toLowerCase();
|
|
1228
|
+
const index = items.findIndex((item) => !item.disabled && item.label.toLowerCase().startsWith(query));
|
|
1229
|
+
if (index >= 0) setActiveIndex(index);
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
};
|
|
1233
|
+
const selectedItems = items.filter((item) => selectedValues.includes(item.value));
|
|
1234
|
+
const triggerContent = renderValue ? renderValue(selectedItems) : selectedItems.length === 0 ? /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: placeholder }) : multiple ? /* @__PURE__ */ jsx16("span", { className: "truncate", children: selectedItems.length === 1 ? selectedItems[0].label : `${selectedItems.length} selected` }) : /* @__PURE__ */ jsx16("span", { className: "truncate", children: selectedItems[0].label });
|
|
1235
|
+
const activeOptionId = activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : void 0;
|
|
1236
|
+
const rows = React16.useMemo(() => {
|
|
1237
|
+
const out = [];
|
|
1238
|
+
let lastGroup;
|
|
1239
|
+
items.forEach((item, index) => {
|
|
1240
|
+
if (item.group && item.group !== lastGroup) {
|
|
1241
|
+
out.push({ heading: item.group, index: -1 });
|
|
1242
|
+
lastGroup = item.group;
|
|
1243
|
+
}
|
|
1244
|
+
out.push({ item, index });
|
|
1245
|
+
});
|
|
1246
|
+
return out;
|
|
1247
|
+
}, [items]);
|
|
1248
|
+
return /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1249
|
+
/* @__PURE__ */ jsx16("span", { id: labelId, className: "sr-only", children: typeof buttonProps["aria-label"] === "string" ? buttonProps["aria-label"] : "Select" }),
|
|
1250
|
+
name && selectedValues.map((selected) => /* @__PURE__ */ jsx16("input", { type: "hidden", name, value: selected }, selected)),
|
|
1251
|
+
/* @__PURE__ */ jsxs8(
|
|
1252
|
+
"button",
|
|
1253
|
+
{
|
|
1254
|
+
ref: setTriggerRef,
|
|
1255
|
+
type: "button",
|
|
1256
|
+
"aria-haspopup": "listbox",
|
|
1257
|
+
"aria-expanded": open,
|
|
1258
|
+
"aria-controls": open ? listboxId : void 0,
|
|
1259
|
+
"aria-activedescendant": open ? activeOptionId : void 0,
|
|
1260
|
+
"aria-labelledby": labelId,
|
|
1261
|
+
disabled,
|
|
1262
|
+
onClick: () => open ? setOpen(false) : openMenu(),
|
|
1263
|
+
onKeyDown: handleKeyDown,
|
|
1264
|
+
className: cn(
|
|
1265
|
+
"flex h-10 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-left text-sm",
|
|
1266
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1267
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1268
|
+
className
|
|
1269
|
+
),
|
|
1270
|
+
...buttonProps,
|
|
1271
|
+
children: [
|
|
1272
|
+
/* @__PURE__ */ jsx16("span", { className: "min-w-0 flex-1", children: triggerContent }),
|
|
1273
|
+
/* @__PURE__ */ jsx16("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u25BE" })
|
|
1274
|
+
]
|
|
1275
|
+
}
|
|
1276
|
+
),
|
|
1277
|
+
open && position && createPortal3(
|
|
1278
|
+
/* @__PURE__ */ jsx16(
|
|
1279
|
+
"div",
|
|
1280
|
+
{
|
|
1281
|
+
ref: listRef,
|
|
1282
|
+
id: listboxId,
|
|
1283
|
+
role: "listbox",
|
|
1284
|
+
"aria-labelledby": labelId,
|
|
1285
|
+
"aria-multiselectable": multiple || void 0,
|
|
1286
|
+
style: {
|
|
1287
|
+
position: "fixed",
|
|
1288
|
+
top: position.top,
|
|
1289
|
+
left: position.left,
|
|
1290
|
+
width: position.width,
|
|
1291
|
+
zIndex: 50
|
|
1292
|
+
},
|
|
1293
|
+
className: "max-h-64 overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",
|
|
1294
|
+
children: items.length === 0 ? /* @__PURE__ */ jsx16("p", { role: "presentation", className: "px-3 py-2 text-sm text-muted-foreground", children: emptyText }) : rows.map(
|
|
1295
|
+
(row, rowIndex) => row.heading ? /* @__PURE__ */ jsx16(
|
|
1296
|
+
"p",
|
|
1297
|
+
{
|
|
1298
|
+
role: "presentation",
|
|
1299
|
+
className: "px-3 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",
|
|
1300
|
+
children: row.heading
|
|
1301
|
+
},
|
|
1302
|
+
`heading-${row.heading}-${rowIndex}`
|
|
1303
|
+
) : /* @__PURE__ */ jsx16(
|
|
1304
|
+
"div",
|
|
1305
|
+
{
|
|
1306
|
+
id: `${listboxId}-option-${row.index}`,
|
|
1307
|
+
role: "option",
|
|
1308
|
+
"aria-selected": selectedValues.includes(row.item.value),
|
|
1309
|
+
"aria-disabled": row.item.disabled || void 0,
|
|
1310
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
1311
|
+
onMouseEnter: () => !row.item.disabled && setActiveIndex(row.index),
|
|
1312
|
+
onClick: () => select(row.item),
|
|
1313
|
+
className: cn(
|
|
1314
|
+
"flex cursor-pointer items-start gap-2 rounded-sm px-3 py-2 text-sm outline-none",
|
|
1315
|
+
row.index === activeIndex ? "bg-accent text-accent-foreground" : "hover:bg-accent/60",
|
|
1316
|
+
row.item.disabled && "pointer-events-none opacity-50"
|
|
1317
|
+
),
|
|
1318
|
+
children: renderItem ? renderItem(row.item, {
|
|
1319
|
+
selected: selectedValues.includes(row.item.value),
|
|
1320
|
+
active: row.index === activeIndex
|
|
1321
|
+
}) : /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1322
|
+
row.item.icon && /* @__PURE__ */ jsx16("span", { className: "mt-0.5 shrink-0 [&_svg]:size-4", children: row.item.icon }),
|
|
1323
|
+
/* @__PURE__ */ jsxs8("span", { className: "min-w-0 flex-1", children: [
|
|
1324
|
+
/* @__PURE__ */ jsx16("span", { className: "block", children: row.item.label }),
|
|
1325
|
+
row.item.description && /* @__PURE__ */ jsx16("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: row.item.description })
|
|
1326
|
+
] }),
|
|
1327
|
+
multiple && selectedValues.includes(row.item.value) && /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", className: "ml-auto text-primary", children: "\u2713" })
|
|
1328
|
+
] })
|
|
1329
|
+
},
|
|
1330
|
+
row.item.value
|
|
1331
|
+
)
|
|
1332
|
+
)
|
|
1333
|
+
}
|
|
1334
|
+
),
|
|
1335
|
+
document.body
|
|
1336
|
+
)
|
|
1337
|
+
] });
|
|
1338
|
+
});
|
|
1339
|
+
|
|
1340
|
+
// src/components/search/Search.tsx
|
|
1341
|
+
import * as React18 from "react";
|
|
1342
|
+
import { createPortal as createPortal4 } from "react-dom";
|
|
717
1343
|
|
|
718
1344
|
// src/components/search/use-combobox.ts
|
|
719
|
-
import * as
|
|
1345
|
+
import * as React17 from "react";
|
|
720
1346
|
var searchUid = 0;
|
|
721
1347
|
function useCombobox({
|
|
722
1348
|
items,
|
|
@@ -724,12 +1350,12 @@ function useCombobox({
|
|
|
724
1350
|
onOpenChange,
|
|
725
1351
|
closeOnSubmit = true
|
|
726
1352
|
}) {
|
|
727
|
-
const [open, setOpenState] =
|
|
728
|
-
const [activeIndex, setActiveIndex] =
|
|
729
|
-
const [pos, setPos] =
|
|
730
|
-
const anchorRef =
|
|
731
|
-
const listboxId =
|
|
732
|
-
const setOpen =
|
|
1353
|
+
const [open, setOpenState] = React17.useState(false);
|
|
1354
|
+
const [activeIndex, setActiveIndex] = React17.useState(-1);
|
|
1355
|
+
const [pos, setPos] = React17.useState(null);
|
|
1356
|
+
const anchorRef = React17.useRef(null);
|
|
1357
|
+
const listboxId = React17.useRef(`slipstream-combobox-${++searchUid}`).current;
|
|
1358
|
+
const setOpen = React17.useCallback(
|
|
733
1359
|
(next) => {
|
|
734
1360
|
setOpenState(next);
|
|
735
1361
|
if (!next) setActiveIndex(-1);
|
|
@@ -737,10 +1363,10 @@ function useCombobox({
|
|
|
737
1363
|
},
|
|
738
1364
|
[onOpenChange]
|
|
739
1365
|
);
|
|
740
|
-
|
|
1366
|
+
React17.useEffect(() => {
|
|
741
1367
|
setActiveIndex(-1);
|
|
742
1368
|
}, [items]);
|
|
743
|
-
|
|
1369
|
+
React17.useLayoutEffect(() => {
|
|
744
1370
|
if (!open) {
|
|
745
1371
|
setPos(null);
|
|
746
1372
|
return;
|
|
@@ -760,7 +1386,7 @@ function useCombobox({
|
|
|
760
1386
|
window.removeEventListener("resize", measure);
|
|
761
1387
|
};
|
|
762
1388
|
}, [open, setOpen]);
|
|
763
|
-
|
|
1389
|
+
React17.useEffect(() => {
|
|
764
1390
|
if (!open) return;
|
|
765
1391
|
const onPointerDown = (event) => {
|
|
766
1392
|
if (!anchorRef.current?.contains(event.target)) setOpen(false);
|
|
@@ -768,7 +1394,7 @@ function useCombobox({
|
|
|
768
1394
|
document.addEventListener("pointerdown", onPointerDown);
|
|
769
1395
|
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
770
1396
|
}, [open, setOpen]);
|
|
771
|
-
const onInputKeyDown =
|
|
1397
|
+
const onInputKeyDown = React17.useCallback(
|
|
772
1398
|
(event) => {
|
|
773
1399
|
if (event.key === "Escape") {
|
|
774
1400
|
if (open) {
|
|
@@ -836,7 +1462,7 @@ function useCombobox({
|
|
|
836
1462
|
}
|
|
837
1463
|
|
|
838
1464
|
// src/components/search/Search.tsx
|
|
839
|
-
import { jsx as
|
|
1465
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
840
1466
|
function Search({
|
|
841
1467
|
options,
|
|
842
1468
|
defaultValue,
|
|
@@ -849,12 +1475,12 @@ function Search({
|
|
|
849
1475
|
className,
|
|
850
1476
|
"aria-label": ariaLabel
|
|
851
1477
|
}) {
|
|
852
|
-
const selected =
|
|
1478
|
+
const selected = React18.useMemo(
|
|
853
1479
|
() => options.find((option) => option.value === defaultValue),
|
|
854
1480
|
[options, defaultValue]
|
|
855
1481
|
);
|
|
856
|
-
const [query, setQuery] =
|
|
857
|
-
const filtered =
|
|
1482
|
+
const [query, setQuery] = React18.useState(selected?.label ?? "");
|
|
1483
|
+
const filtered = React18.useMemo(() => {
|
|
858
1484
|
if (!query.trim()) return options;
|
|
859
1485
|
const q = query.trim().toLowerCase();
|
|
860
1486
|
return options.filter(
|
|
@@ -873,8 +1499,8 @@ function Search({
|
|
|
873
1499
|
onValueChange?.(item.value);
|
|
874
1500
|
combobox.setOpen(false);
|
|
875
1501
|
};
|
|
876
|
-
return /* @__PURE__ */
|
|
877
|
-
/* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ jsxs9("div", { ref: combobox.anchorRef, className: cn("relative w-full", className), children: [
|
|
1503
|
+
/* @__PURE__ */ jsx17(
|
|
878
1504
|
Input,
|
|
879
1505
|
{
|
|
880
1506
|
id,
|
|
@@ -897,8 +1523,8 @@ function Search({
|
|
|
897
1523
|
...combobox.inputProps
|
|
898
1524
|
}
|
|
899
1525
|
),
|
|
900
|
-
combobox.ready &&
|
|
901
|
-
/* @__PURE__ */
|
|
1526
|
+
combobox.ready && createPortal4(
|
|
1527
|
+
/* @__PURE__ */ jsx17(
|
|
902
1528
|
"ul",
|
|
903
1529
|
{
|
|
904
1530
|
id: combobox.listboxId,
|
|
@@ -912,7 +1538,7 @@ function Search({
|
|
|
912
1538
|
zIndex: 50
|
|
913
1539
|
},
|
|
914
1540
|
className: "max-h-64 overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",
|
|
915
|
-
children: filtered.length === 0 ? /* @__PURE__ */
|
|
1541
|
+
children: filtered.length === 0 ? /* @__PURE__ */ jsx17("li", { role: "presentation", className: "px-3 py-2 text-sm text-muted-foreground", children: emptyText }) : filtered.map((option, index) => /* @__PURE__ */ jsxs9(
|
|
916
1542
|
"li",
|
|
917
1543
|
{
|
|
918
1544
|
id: combobox.optionId(index),
|
|
@@ -926,8 +1552,8 @@ function Search({
|
|
|
926
1552
|
combobox.activeIndex === index ? "bg-accent text-accent-foreground" : "hover:bg-accent/60"
|
|
927
1553
|
),
|
|
928
1554
|
children: [
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
option.description && /* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ jsx17("span", { className: "block", children: option.label }),
|
|
1556
|
+
option.description && /* @__PURE__ */ jsx17("span", { className: "block text-xs text-muted-foreground", children: option.description })
|
|
931
1557
|
]
|
|
932
1558
|
},
|
|
933
1559
|
option.value
|
|
@@ -940,15 +1566,25 @@ function Search({
|
|
|
940
1566
|
}
|
|
941
1567
|
|
|
942
1568
|
// src/components/autocomplete/Autocomplete.tsx
|
|
943
|
-
import * as
|
|
944
|
-
import { createPortal as
|
|
945
|
-
import { jsx as
|
|
1569
|
+
import * as React19 from "react";
|
|
1570
|
+
import { createPortal as createPortal5 } from "react-dom";
|
|
1571
|
+
import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1572
|
+
function normalize(entry) {
|
|
1573
|
+
if (typeof entry === "string") return { value: entry, label: entry };
|
|
1574
|
+
return { value: entry.value, label: entry.label ?? entry.value, group: entry.group, description: entry.description };
|
|
1575
|
+
}
|
|
946
1576
|
function Autocomplete({
|
|
947
1577
|
value,
|
|
948
1578
|
defaultValue = "",
|
|
949
1579
|
onValueChange,
|
|
1580
|
+
options,
|
|
950
1581
|
suggestions,
|
|
1582
|
+
loadOptions,
|
|
1583
|
+
renderOption,
|
|
1584
|
+
clearable = false,
|
|
951
1585
|
emptyText,
|
|
1586
|
+
loadingText,
|
|
1587
|
+
debounceMs = 200,
|
|
952
1588
|
placeholder,
|
|
953
1589
|
id,
|
|
954
1590
|
name,
|
|
@@ -957,27 +1593,62 @@ function Autocomplete({
|
|
|
957
1593
|
onFocus,
|
|
958
1594
|
...inputProps
|
|
959
1595
|
}) {
|
|
960
|
-
const [internalValue, setInternalValue] =
|
|
1596
|
+
const [internalValue, setInternalValue] = React19.useState(defaultValue);
|
|
961
1597
|
const current = value ?? internalValue;
|
|
962
|
-
const
|
|
1598
|
+
const [asyncOptions, setAsyncOptions] = React19.useState([]);
|
|
1599
|
+
const [loading, setLoading] = React19.useState(false);
|
|
1600
|
+
const requestId = React19.useRef(0);
|
|
1601
|
+
const source = React19.useMemo(() => {
|
|
1602
|
+
const list = options ?? (suggestions ?? []).map(normalize);
|
|
1603
|
+
return list.map(normalize);
|
|
1604
|
+
}, [options, suggestions]);
|
|
1605
|
+
React19.useEffect(() => {
|
|
1606
|
+
if (!loadOptions) return;
|
|
1607
|
+
const id2 = ++requestId.current;
|
|
1608
|
+
setLoading(true);
|
|
1609
|
+
const timer = setTimeout(async () => {
|
|
1610
|
+
try {
|
|
1611
|
+
const result = await loadOptions(current);
|
|
1612
|
+
if (requestId.current === id2) setAsyncOptions(result.map(normalize));
|
|
1613
|
+
} catch {
|
|
1614
|
+
if (requestId.current === id2) setAsyncOptions([]);
|
|
1615
|
+
} finally {
|
|
1616
|
+
if (requestId.current === id2) setLoading(false);
|
|
1617
|
+
}
|
|
1618
|
+
}, debounceMs);
|
|
1619
|
+
return () => clearTimeout(timer);
|
|
1620
|
+
}, [loadOptions, current, debounceMs]);
|
|
1621
|
+
const pool = loadOptions ? asyncOptions : source;
|
|
1622
|
+
const items = React19.useMemo(() => {
|
|
963
1623
|
const q = current.trim().toLowerCase();
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
}, [suggestions, current]);
|
|
1624
|
+
return pool.filter((option) => !q || option.label.toLowerCase().includes(q) || option.value.toLowerCase().includes(q)).filter((option) => option.value !== current);
|
|
1625
|
+
}, [pool, current]);
|
|
967
1626
|
const combobox = useCombobox({
|
|
968
|
-
items,
|
|
1627
|
+
items: items.map((item) => ({ value: item.value, label: item.label })),
|
|
969
1628
|
onSelect: (item) => {
|
|
970
1629
|
if (value === void 0) setInternalValue(item.label);
|
|
971
1630
|
onValueChange?.(item.label);
|
|
972
1631
|
}
|
|
973
1632
|
});
|
|
974
|
-
const select = (
|
|
975
|
-
if (value === void 0) setInternalValue(label);
|
|
976
|
-
onValueChange?.(label);
|
|
1633
|
+
const select = (option) => {
|
|
1634
|
+
if (value === void 0) setInternalValue(option.label);
|
|
1635
|
+
onValueChange?.(option.label);
|
|
977
1636
|
combobox.setOpen(false);
|
|
978
1637
|
};
|
|
979
|
-
|
|
980
|
-
|
|
1638
|
+
const grouped = React19.useMemo(() => {
|
|
1639
|
+
const out = [];
|
|
1640
|
+
let lastGroup;
|
|
1641
|
+
items.forEach((option, index) => {
|
|
1642
|
+
if (option.group && option.group !== lastGroup) {
|
|
1643
|
+
out.push({ heading: option.group, index: -1 });
|
|
1644
|
+
lastGroup = option.group;
|
|
1645
|
+
}
|
|
1646
|
+
out.push({ option, index });
|
|
1647
|
+
});
|
|
1648
|
+
return out;
|
|
1649
|
+
}, [items]);
|
|
1650
|
+
return /* @__PURE__ */ jsxs10("div", { ref: combobox.anchorRef, className: cn("relative w-full", className), children: [
|
|
1651
|
+
/* @__PURE__ */ jsx18(
|
|
981
1652
|
Input,
|
|
982
1653
|
{
|
|
983
1654
|
id,
|
|
@@ -985,6 +1656,7 @@ function Autocomplete({
|
|
|
985
1656
|
placeholder,
|
|
986
1657
|
autoComplete: "off",
|
|
987
1658
|
value: current,
|
|
1659
|
+
className: clearable && current ? "pr-9" : void 0,
|
|
988
1660
|
onChange: (event) => {
|
|
989
1661
|
if (value === void 0) setInternalValue(event.target.value);
|
|
990
1662
|
onValueChange?.(event.target.value);
|
|
@@ -1002,13 +1674,28 @@ function Autocomplete({
|
|
|
1002
1674
|
...combobox.inputProps
|
|
1003
1675
|
}
|
|
1004
1676
|
),
|
|
1005
|
-
|
|
1006
|
-
|
|
1677
|
+
clearable && current && /* @__PURE__ */ jsx18(
|
|
1678
|
+
"button",
|
|
1679
|
+
{
|
|
1680
|
+
type: "button",
|
|
1681
|
+
onClick: () => {
|
|
1682
|
+
if (value === void 0) setInternalValue("");
|
|
1683
|
+
onValueChange?.("");
|
|
1684
|
+
combobox.setOpen(true);
|
|
1685
|
+
},
|
|
1686
|
+
"aria-label": "Clear input",
|
|
1687
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1688
|
+
children: "\u2715"
|
|
1689
|
+
}
|
|
1690
|
+
),
|
|
1691
|
+
combobox.ready && createPortal5(
|
|
1692
|
+
/* @__PURE__ */ jsx18(
|
|
1007
1693
|
"ul",
|
|
1008
1694
|
{
|
|
1009
1695
|
id: combobox.listboxId,
|
|
1010
1696
|
role: "listbox",
|
|
1011
1697
|
"aria-label": "Suggestions",
|
|
1698
|
+
"aria-busy": loading || void 0,
|
|
1012
1699
|
style: {
|
|
1013
1700
|
position: "fixed",
|
|
1014
1701
|
top: combobox.pos.top,
|
|
@@ -1017,23 +1704,36 @@ function Autocomplete({
|
|
|
1017
1704
|
zIndex: 50
|
|
1018
1705
|
},
|
|
1019
1706
|
className: "max-h-60 overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",
|
|
1020
|
-
children: items.length === 0 ? /* @__PURE__ */
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1707
|
+
children: loading && items.length === 0 ? /* @__PURE__ */ jsx18("li", { role: "presentation", className: "px-3 py-2 text-sm text-muted-foreground", children: loadingText ?? "Loading\u2026" }) : items.length === 0 ? /* @__PURE__ */ jsx18("li", { role: "presentation", className: "px-3 py-2 text-sm text-muted-foreground", children: emptyText ?? "No suggestions" }) : grouped.map(
|
|
1708
|
+
(entry, rowIndex) => entry.heading ? /* @__PURE__ */ jsx18(
|
|
1709
|
+
"li",
|
|
1710
|
+
{
|
|
1711
|
+
role: "presentation",
|
|
1712
|
+
className: "px-3 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",
|
|
1713
|
+
children: entry.heading
|
|
1714
|
+
},
|
|
1715
|
+
`group-${entry.heading}-${rowIndex}`
|
|
1716
|
+
) : /* @__PURE__ */ jsx18(
|
|
1717
|
+
"li",
|
|
1718
|
+
{
|
|
1719
|
+
id: combobox.optionId(entry.index),
|
|
1720
|
+
role: "option",
|
|
1721
|
+
"aria-selected": combobox.activeIndex === entry.index,
|
|
1722
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
1723
|
+
onMouseEnter: () => combobox.setActiveIndex(entry.index),
|
|
1724
|
+
onClick: () => select(entry.option),
|
|
1725
|
+
className: cn(
|
|
1726
|
+
"cursor-pointer rounded-sm px-3 py-1.5 text-sm outline-none",
|
|
1727
|
+
combobox.activeIndex === entry.index ? "bg-accent text-accent-foreground" : "hover:bg-accent/60"
|
|
1728
|
+
),
|
|
1729
|
+
children: renderOption ? renderOption(entry.option, { active: combobox.activeIndex === entry.index }) : /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
1730
|
+
/* @__PURE__ */ jsx18("span", { className: "block", children: entry.option.label }),
|
|
1731
|
+
entry.option.description && /* @__PURE__ */ jsx18("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: entry.option.description })
|
|
1732
|
+
] })
|
|
1733
|
+
},
|
|
1734
|
+
entry.option.value
|
|
1735
|
+
)
|
|
1736
|
+
)
|
|
1037
1737
|
}
|
|
1038
1738
|
),
|
|
1039
1739
|
document.body
|
|
@@ -1042,10 +1742,10 @@ function Autocomplete({
|
|
|
1042
1742
|
}
|
|
1043
1743
|
|
|
1044
1744
|
// src/components/checkbox/Checkbox.tsx
|
|
1045
|
-
import * as
|
|
1046
|
-
import { jsx as
|
|
1047
|
-
var Checkbox =
|
|
1048
|
-
({ className, checked, onCheckedChange, ...props }, ref) => /* @__PURE__ */
|
|
1745
|
+
import * as React20 from "react";
|
|
1746
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1747
|
+
var Checkbox = React20.forwardRef(
|
|
1748
|
+
({ className, checked, onCheckedChange, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1049
1749
|
"input",
|
|
1050
1750
|
{
|
|
1051
1751
|
type: "checkbox",
|
|
@@ -1066,38 +1766,38 @@ var Checkbox = React16.forwardRef(
|
|
|
1066
1766
|
Checkbox.displayName = "Checkbox";
|
|
1067
1767
|
|
|
1068
1768
|
// src/components/checkbox/CheckboxGroup.tsx
|
|
1069
|
-
import * as
|
|
1070
|
-
import { jsx as
|
|
1071
|
-
var CheckboxGroupContext =
|
|
1769
|
+
import * as React21 from "react";
|
|
1770
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1771
|
+
var CheckboxGroupContext = React21.createContext({
|
|
1072
1772
|
name: "",
|
|
1073
1773
|
values: [],
|
|
1074
1774
|
toggle: () => {
|
|
1075
1775
|
}
|
|
1076
1776
|
});
|
|
1077
|
-
var CheckboxGroup =
|
|
1777
|
+
var CheckboxGroup = React21.forwardRef(
|
|
1078
1778
|
({ name, legend, value, defaultValue, onValueChange, orientation = "vertical", error, className, children }, ref) => {
|
|
1079
|
-
const [internalValue, setInternalValue] =
|
|
1779
|
+
const [internalValue, setInternalValue] = React21.useState(defaultValue ?? []);
|
|
1080
1780
|
const currentValue = value ?? internalValue;
|
|
1081
1781
|
const toggle = (next) => {
|
|
1082
1782
|
const updated = currentValue.includes(next) ? currentValue.filter((item) => item !== next) : [...currentValue, next];
|
|
1083
1783
|
if (value === void 0) setInternalValue(updated);
|
|
1084
1784
|
onValueChange?.(updated);
|
|
1085
1785
|
};
|
|
1086
|
-
return /* @__PURE__ */
|
|
1087
|
-
legend && /* @__PURE__ */
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
error && /* @__PURE__ */
|
|
1786
|
+
return /* @__PURE__ */ jsxs11("fieldset", { ref, className: cn(orientation === "vertical" ? "space-y-2" : "flex flex-row flex-wrap gap-x-4 gap-y-2", className), children: [
|
|
1787
|
+
legend && /* @__PURE__ */ jsx20("legend", { className: "text-sm font-medium", children: legend }),
|
|
1788
|
+
/* @__PURE__ */ jsx20(CheckboxGroupContext.Provider, { value: { name, values: currentValue, toggle }, children }),
|
|
1789
|
+
error && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-xs text-destructive", children: error })
|
|
1090
1790
|
] });
|
|
1091
1791
|
}
|
|
1092
1792
|
);
|
|
1093
1793
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
1094
|
-
var CheckboxGroupItem =
|
|
1794
|
+
var CheckboxGroupItem = React21.forwardRef(
|
|
1095
1795
|
({ value, label, className, id, ...props }, ref) => {
|
|
1096
|
-
const group =
|
|
1097
|
-
const generatedId =
|
|
1796
|
+
const group = React21.useContext(CheckboxGroupContext);
|
|
1797
|
+
const generatedId = React21.useId();
|
|
1098
1798
|
const inputId = id ?? generatedId;
|
|
1099
|
-
return /* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1799
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
1800
|
+
/* @__PURE__ */ jsx20(
|
|
1101
1801
|
Checkbox,
|
|
1102
1802
|
{
|
|
1103
1803
|
ref,
|
|
@@ -1110,7 +1810,7 @@ var CheckboxGroupItem = React17.forwardRef(
|
|
|
1110
1810
|
...props
|
|
1111
1811
|
}
|
|
1112
1812
|
),
|
|
1113
|
-
label && /* @__PURE__ */
|
|
1813
|
+
label && /* @__PURE__ */ jsx20(
|
|
1114
1814
|
"label",
|
|
1115
1815
|
{
|
|
1116
1816
|
htmlFor: inputId,
|
|
@@ -1124,10 +1824,10 @@ var CheckboxGroupItem = React17.forwardRef(
|
|
|
1124
1824
|
CheckboxGroupItem.displayName = "CheckboxGroupItem";
|
|
1125
1825
|
|
|
1126
1826
|
// src/components/radio/Radio.tsx
|
|
1127
|
-
import * as
|
|
1128
|
-
import { jsx as
|
|
1129
|
-
var Radio =
|
|
1130
|
-
({ className, checked, onCheckedChange, ...props }, ref) => /* @__PURE__ */
|
|
1827
|
+
import * as React22 from "react";
|
|
1828
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1829
|
+
var Radio = React22.forwardRef(
|
|
1830
|
+
({ className, checked, onCheckedChange, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1131
1831
|
"input",
|
|
1132
1832
|
{
|
|
1133
1833
|
type: "radio",
|
|
@@ -1146,15 +1846,15 @@ var Radio = React18.forwardRef(
|
|
|
1146
1846
|
)
|
|
1147
1847
|
);
|
|
1148
1848
|
Radio.displayName = "Radio";
|
|
1149
|
-
var RadioGroup =
|
|
1849
|
+
var RadioGroup = React22.forwardRef(
|
|
1150
1850
|
({ name, legend, value, defaultValue, onValueChange, orientation = "vertical", error, className, children }, ref) => {
|
|
1151
|
-
const [internalValue, setInternalValue] =
|
|
1851
|
+
const [internalValue, setInternalValue] = React22.useState(defaultValue ?? "");
|
|
1152
1852
|
const currentValue = value ?? internalValue;
|
|
1153
1853
|
const handleChange = (next) => {
|
|
1154
1854
|
if (value === void 0) setInternalValue(next);
|
|
1155
1855
|
onValueChange?.(next);
|
|
1156
1856
|
};
|
|
1157
|
-
return /* @__PURE__ */
|
|
1857
|
+
return /* @__PURE__ */ jsxs12(
|
|
1158
1858
|
"fieldset",
|
|
1159
1859
|
{
|
|
1160
1860
|
ref,
|
|
@@ -1163,28 +1863,28 @@ var RadioGroup = React18.forwardRef(
|
|
|
1163
1863
|
className
|
|
1164
1864
|
),
|
|
1165
1865
|
children: [
|
|
1166
|
-
legend && /* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
error && /* @__PURE__ */
|
|
1866
|
+
legend && /* @__PURE__ */ jsx21("legend", { className: "text-sm font-medium", children: legend }),
|
|
1867
|
+
/* @__PURE__ */ jsx21(RadioGroupContext.Provider, { value: { name, value: currentValue, onChange: handleChange }, children }),
|
|
1868
|
+
error && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-xs text-destructive", children: error })
|
|
1169
1869
|
]
|
|
1170
1870
|
}
|
|
1171
1871
|
);
|
|
1172
1872
|
}
|
|
1173
1873
|
);
|
|
1174
1874
|
RadioGroup.displayName = "RadioGroup";
|
|
1175
|
-
var RadioGroupContext =
|
|
1875
|
+
var RadioGroupContext = React22.createContext({
|
|
1176
1876
|
name: "",
|
|
1177
1877
|
value: "",
|
|
1178
1878
|
onChange: () => {
|
|
1179
1879
|
}
|
|
1180
1880
|
});
|
|
1181
|
-
var RadioGroupItem =
|
|
1881
|
+
var RadioGroupItem = React22.forwardRef(
|
|
1182
1882
|
({ value, label, className, id, ...props }, ref) => {
|
|
1183
|
-
const group =
|
|
1184
|
-
const generatedId =
|
|
1883
|
+
const group = React22.useContext(RadioGroupContext);
|
|
1884
|
+
const generatedId = React22.useId();
|
|
1185
1885
|
const inputId = id ?? generatedId;
|
|
1186
|
-
return /* @__PURE__ */
|
|
1187
|
-
/* @__PURE__ */
|
|
1886
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
|
|
1887
|
+
/* @__PURE__ */ jsx21(
|
|
1188
1888
|
Radio,
|
|
1189
1889
|
{
|
|
1190
1890
|
ref,
|
|
@@ -1197,21 +1897,21 @@ var RadioGroupItem = React18.forwardRef(
|
|
|
1197
1897
|
...props
|
|
1198
1898
|
}
|
|
1199
1899
|
),
|
|
1200
|
-
label && /* @__PURE__ */
|
|
1900
|
+
label && /* @__PURE__ */ jsx21("label", { htmlFor: inputId, className: "text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label })
|
|
1201
1901
|
] });
|
|
1202
1902
|
}
|
|
1203
1903
|
);
|
|
1204
1904
|
RadioGroupItem.displayName = "RadioGroupItem";
|
|
1205
1905
|
|
|
1206
1906
|
// src/components/radio/RadioCard.tsx
|
|
1207
|
-
import * as
|
|
1208
|
-
import { jsx as
|
|
1209
|
-
var RadioCard =
|
|
1907
|
+
import * as React23 from "react";
|
|
1908
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1909
|
+
var RadioCard = React23.forwardRef(
|
|
1210
1910
|
({ value, title, description, children, rounded = true, disabled, className, id }, ref) => {
|
|
1211
|
-
const group =
|
|
1212
|
-
const generatedId =
|
|
1911
|
+
const group = React23.useContext(RadioGroupContext);
|
|
1912
|
+
const generatedId = React23.useId();
|
|
1213
1913
|
const inputId = id ?? generatedId;
|
|
1214
|
-
return /* @__PURE__ */
|
|
1914
|
+
return /* @__PURE__ */ jsxs13(
|
|
1215
1915
|
"label",
|
|
1216
1916
|
{
|
|
1217
1917
|
ref,
|
|
@@ -1227,7 +1927,7 @@ var RadioCard = React19.forwardRef(
|
|
|
1227
1927
|
className
|
|
1228
1928
|
),
|
|
1229
1929
|
children: [
|
|
1230
|
-
/* @__PURE__ */
|
|
1930
|
+
/* @__PURE__ */ jsx22(
|
|
1231
1931
|
Radio,
|
|
1232
1932
|
{
|
|
1233
1933
|
id: inputId,
|
|
@@ -1238,8 +1938,8 @@ var RadioCard = React19.forwardRef(
|
|
|
1238
1938
|
className: "sr-only"
|
|
1239
1939
|
}
|
|
1240
1940
|
),
|
|
1241
|
-
title && /* @__PURE__ */
|
|
1242
|
-
description && /* @__PURE__ */
|
|
1941
|
+
title && /* @__PURE__ */ jsx22("span", { className: "text-sm font-medium leading-none", children: title }),
|
|
1942
|
+
description && /* @__PURE__ */ jsx22("span", { className: "text-sm text-muted-foreground", children: description }),
|
|
1243
1943
|
children
|
|
1244
1944
|
]
|
|
1245
1945
|
}
|
|
@@ -1249,10 +1949,10 @@ var RadioCard = React19.forwardRef(
|
|
|
1249
1949
|
RadioCard.displayName = "RadioCard";
|
|
1250
1950
|
|
|
1251
1951
|
// src/components/label/Label.tsx
|
|
1252
|
-
import * as
|
|
1253
|
-
import { jsx as
|
|
1254
|
-
var Label =
|
|
1255
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1952
|
+
import * as React24 from "react";
|
|
1953
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1954
|
+
var Label = React24.forwardRef(
|
|
1955
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
1256
1956
|
"label",
|
|
1257
1957
|
{
|
|
1258
1958
|
ref,
|
|
@@ -1267,20 +1967,20 @@ var Label = React20.forwardRef(
|
|
|
1267
1967
|
Label.displayName = "Label";
|
|
1268
1968
|
|
|
1269
1969
|
// src/components/fieldset/Fieldset.tsx
|
|
1270
|
-
import * as
|
|
1271
|
-
import { jsx as
|
|
1272
|
-
var Fieldset =
|
|
1273
|
-
({ legend, description, error, className, children, ...props }, ref) => /* @__PURE__ */
|
|
1970
|
+
import * as React25 from "react";
|
|
1971
|
+
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1972
|
+
var Fieldset = React25.forwardRef(
|
|
1973
|
+
({ legend, description, error, className, children, ...props }, ref) => /* @__PURE__ */ jsxs14(
|
|
1274
1974
|
"fieldset",
|
|
1275
1975
|
{
|
|
1276
1976
|
ref,
|
|
1277
1977
|
className: cn("m-0 flex min-w-0 flex-col gap-1.5 border-0 p-0", className),
|
|
1278
1978
|
...props,
|
|
1279
1979
|
children: [
|
|
1280
|
-
legend && /* @__PURE__ */
|
|
1281
|
-
description && /* @__PURE__ */
|
|
1980
|
+
legend && /* @__PURE__ */ jsx24("legend", { className: "p-0 text-sm font-medium leading-none", children: legend }),
|
|
1981
|
+
description && /* @__PURE__ */ jsx24("p", { className: "text-xs text-muted-foreground", children: description }),
|
|
1282
1982
|
children,
|
|
1283
|
-
error && /* @__PURE__ */
|
|
1983
|
+
error && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-xs text-destructive", children: error })
|
|
1284
1984
|
]
|
|
1285
1985
|
}
|
|
1286
1986
|
)
|
|
@@ -1288,36 +1988,36 @@ var Fieldset = React21.forwardRef(
|
|
|
1288
1988
|
Fieldset.displayName = "Fieldset";
|
|
1289
1989
|
|
|
1290
1990
|
// src/components/form-field/FormField.tsx
|
|
1291
|
-
import * as
|
|
1991
|
+
import * as React27 from "react";
|
|
1292
1992
|
|
|
1293
1993
|
// src/components/tooltip/Tooltip.tsx
|
|
1294
|
-
import * as
|
|
1295
|
-
import { createPortal as
|
|
1296
|
-
import { jsx as
|
|
1994
|
+
import * as React26 from "react";
|
|
1995
|
+
import { createPortal as createPortal6 } from "react-dom";
|
|
1996
|
+
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1297
1997
|
var GAP = 8;
|
|
1298
|
-
var Tooltip =
|
|
1998
|
+
var Tooltip = React26.forwardRef(
|
|
1299
1999
|
({ content, side = "top", delay = 300, className, children }, ref) => {
|
|
1300
|
-
const [open, setOpen] =
|
|
1301
|
-
const [pos, setPos] =
|
|
1302
|
-
const anchorRef =
|
|
1303
|
-
const timerRef =
|
|
1304
|
-
const id =
|
|
1305
|
-
const
|
|
2000
|
+
const [open, setOpen] = React26.useState(false);
|
|
2001
|
+
const [pos, setPos] = React26.useState(null);
|
|
2002
|
+
const anchorRef = React26.useRef(null);
|
|
2003
|
+
const timerRef = React26.useRef(null);
|
|
2004
|
+
const id = React26.useId();
|
|
2005
|
+
const show2 = React26.useCallback(() => {
|
|
1306
2006
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
1307
2007
|
timerRef.current = setTimeout(() => setOpen(true), delay);
|
|
1308
2008
|
}, [delay]);
|
|
1309
|
-
const hide =
|
|
2009
|
+
const hide = React26.useCallback(() => {
|
|
1310
2010
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
1311
2011
|
setOpen(false);
|
|
1312
2012
|
setPos(null);
|
|
1313
2013
|
}, []);
|
|
1314
|
-
|
|
2014
|
+
React26.useEffect(
|
|
1315
2015
|
() => () => {
|
|
1316
2016
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
1317
2017
|
},
|
|
1318
2018
|
[]
|
|
1319
2019
|
);
|
|
1320
|
-
|
|
2020
|
+
React26.useLayoutEffect(() => {
|
|
1321
2021
|
if (!open) return;
|
|
1322
2022
|
const rect = anchorRef.current?.getBoundingClientRect();
|
|
1323
2023
|
if (!rect) return;
|
|
@@ -1331,10 +2031,10 @@ var Tooltip = React22.forwardRef(
|
|
|
1331
2031
|
window.removeEventListener("resize", onScrollOrResize);
|
|
1332
2032
|
};
|
|
1333
2033
|
}, [open, side, hide]);
|
|
1334
|
-
const trigger =
|
|
2034
|
+
const trigger = React26.cloneElement(children, {
|
|
1335
2035
|
"aria-describedby": open ? id : void 0
|
|
1336
2036
|
});
|
|
1337
|
-
return /* @__PURE__ */
|
|
2037
|
+
return /* @__PURE__ */ jsxs15(
|
|
1338
2038
|
"div",
|
|
1339
2039
|
{
|
|
1340
2040
|
ref: (node) => {
|
|
@@ -1343,9 +2043,9 @@ var Tooltip = React22.forwardRef(
|
|
|
1343
2043
|
else if (ref) ref.current = node;
|
|
1344
2044
|
},
|
|
1345
2045
|
className: cn("relative inline-flex", className),
|
|
1346
|
-
onMouseEnter:
|
|
2046
|
+
onMouseEnter: show2,
|
|
1347
2047
|
onMouseLeave: hide,
|
|
1348
|
-
onFocusCapture:
|
|
2048
|
+
onFocusCapture: show2,
|
|
1349
2049
|
onBlurCapture: hide,
|
|
1350
2050
|
onKeyDown: (event) => {
|
|
1351
2051
|
if (event.key === "Escape" && open) {
|
|
@@ -1355,8 +2055,8 @@ var Tooltip = React22.forwardRef(
|
|
|
1355
2055
|
},
|
|
1356
2056
|
children: [
|
|
1357
2057
|
trigger,
|
|
1358
|
-
open && pos && typeof document !== "undefined" &&
|
|
1359
|
-
/* @__PURE__ */
|
|
2058
|
+
open && pos && typeof document !== "undefined" && createPortal6(
|
|
2059
|
+
/* @__PURE__ */ jsx25(
|
|
1360
2060
|
"div",
|
|
1361
2061
|
{
|
|
1362
2062
|
id,
|
|
@@ -1376,7 +2076,7 @@ var Tooltip = React22.forwardRef(
|
|
|
1376
2076
|
Tooltip.displayName = "Tooltip";
|
|
1377
2077
|
|
|
1378
2078
|
// src/components/form-field/FormField.tsx
|
|
1379
|
-
import { Fragment as
|
|
2079
|
+
import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1380
2080
|
var FormField = ({
|
|
1381
2081
|
id,
|
|
1382
2082
|
label,
|
|
@@ -1394,48 +2094,48 @@ var FormField = ({
|
|
|
1394
2094
|
const errorId = `${id}-error`;
|
|
1395
2095
|
const describedBy = error ? errorId : hint ? hintId : void 0;
|
|
1396
2096
|
let control = children;
|
|
1397
|
-
if (
|
|
1398
|
-
control =
|
|
2097
|
+
if (React27.isValidElement(children) && children.type !== React27.Fragment) {
|
|
2098
|
+
control = React27.cloneElement(children, {
|
|
1399
2099
|
id,
|
|
1400
2100
|
"aria-describedby": describedBy,
|
|
1401
2101
|
...error ? { "aria-invalid": true } : {}
|
|
1402
2102
|
});
|
|
1403
2103
|
}
|
|
1404
|
-
const labelNode = /* @__PURE__ */
|
|
2104
|
+
const labelNode = /* @__PURE__ */ jsxs16(Label, { htmlFor: id, className: labelHidden ? "sr-only" : void 0, children: [
|
|
1405
2105
|
label,
|
|
1406
|
-
required && /* @__PURE__ */
|
|
2106
|
+
required && /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
1407
2107
|
" ",
|
|
1408
|
-
/* @__PURE__ */
|
|
2108
|
+
/* @__PURE__ */ jsx26("span", { "aria-hidden": "true", className: "ml-0.5 text-destructive", children: "*" })
|
|
1409
2109
|
] })
|
|
1410
2110
|
] });
|
|
1411
|
-
const tooltipNode = tooltip ? /* @__PURE__ */
|
|
2111
|
+
const tooltipNode = tooltip ? /* @__PURE__ */ jsx26(Tooltip, { content: tooltip, side: "top", children: /* @__PURE__ */ jsx26(
|
|
1412
2112
|
"button",
|
|
1413
2113
|
{
|
|
1414
2114
|
type: "button",
|
|
1415
2115
|
"aria-label": `${label} information`,
|
|
1416
2116
|
className: "ml-1 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1417
|
-
children: /* @__PURE__ */
|
|
2117
|
+
children: /* @__PURE__ */ jsx26("svg", { viewBox: "0 0 16 16", className: "h-3.5 w-3.5", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx26("path", { d: "M8 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM8 7a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 7Zm0-2.25a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8Z" }) })
|
|
1418
2118
|
}
|
|
1419
2119
|
) }) : null;
|
|
1420
|
-
const hintOrError = error ? /* @__PURE__ */
|
|
2120
|
+
const hintOrError = error ? /* @__PURE__ */ jsx26("p", { id: errorId, role: "alert", className: "text-xs text-destructive", children: error }) : hint ? /* @__PURE__ */ jsx26("p", { id: hintId, className: "text-xs text-muted-foreground", children: hint }) : null;
|
|
1421
2121
|
if (labelPlacement === "left") {
|
|
1422
|
-
return /* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
2122
|
+
return /* @__PURE__ */ jsx26("div", { className: cn("flex min-w-0 flex-col gap-1.5", className), children: /* @__PURE__ */ jsxs16("div", { className: "flex items-start gap-3", children: [
|
|
2123
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex w-40 shrink-0 items-center gap-1 pt-2", children: [
|
|
1424
2124
|
labelNode,
|
|
1425
2125
|
tooltipNode
|
|
1426
2126
|
] }),
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1429
|
-
/* @__PURE__ */
|
|
1430
|
-
trailing && /* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
2128
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2129
|
+
/* @__PURE__ */ jsx26("div", { className: "min-w-0 flex-1", children: control }),
|
|
2130
|
+
trailing && /* @__PURE__ */ jsx26("span", { className: "shrink-0 text-xs text-muted-foreground", children: trailing })
|
|
1431
2131
|
] }),
|
|
1432
2132
|
hintOrError
|
|
1433
2133
|
] })
|
|
1434
2134
|
] }) });
|
|
1435
2135
|
}
|
|
1436
|
-
return /* @__PURE__ */
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
/* @__PURE__ */
|
|
2136
|
+
return /* @__PURE__ */ jsxs16("div", { className: cn("flex min-w-0 flex-col gap-1.5", className), children: [
|
|
2137
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2138
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex min-w-0 items-center", children: [
|
|
1439
2139
|
labelNode,
|
|
1440
2140
|
tooltipNode
|
|
1441
2141
|
] }),
|
|
@@ -1448,12 +2148,12 @@ var FormField = ({
|
|
|
1448
2148
|
FormField.displayName = "FormField";
|
|
1449
2149
|
|
|
1450
2150
|
// src/components/form/Form.tsx
|
|
1451
|
-
import * as
|
|
1452
|
-
import { jsx as
|
|
1453
|
-
var Form =
|
|
2151
|
+
import * as React28 from "react";
|
|
2152
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2153
|
+
var Form = React28.forwardRef(
|
|
1454
2154
|
({ variant = "default", gap, className, style, ...props }, ref) => {
|
|
1455
2155
|
const gapResolved = resolveGap(gap ?? "md");
|
|
1456
|
-
return /* @__PURE__ */
|
|
2156
|
+
return /* @__PURE__ */ jsx27(
|
|
1457
2157
|
"form",
|
|
1458
2158
|
{
|
|
1459
2159
|
ref,
|
|
@@ -1473,15 +2173,15 @@ var Form = React24.forwardRef(
|
|
|
1473
2173
|
Form.displayName = "Form";
|
|
1474
2174
|
|
|
1475
2175
|
// src/components/form-layout/FormLayout.tsx
|
|
1476
|
-
import * as
|
|
1477
|
-
import { jsx as
|
|
2176
|
+
import * as React29 from "react";
|
|
2177
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1478
2178
|
var GRID_COLUMNS = {
|
|
1479
2179
|
1: "grid-cols-1",
|
|
1480
2180
|
2: "grid-cols-2",
|
|
1481
2181
|
3: "grid-cols-3",
|
|
1482
2182
|
4: "grid-cols-4"
|
|
1483
2183
|
};
|
|
1484
|
-
var FormLayout =
|
|
2184
|
+
var FormLayout = React29.forwardRef(
|
|
1485
2185
|
({
|
|
1486
2186
|
layout = "stack",
|
|
1487
2187
|
columns = 2,
|
|
@@ -1496,7 +2196,7 @@ var FormLayout = React25.forwardRef(
|
|
|
1496
2196
|
}, ref) => {
|
|
1497
2197
|
const Tag = as;
|
|
1498
2198
|
const gapResolved = resolveGap(gap ?? "md");
|
|
1499
|
-
return /* @__PURE__ */
|
|
2199
|
+
return /* @__PURE__ */ jsxs17(
|
|
1500
2200
|
Tag,
|
|
1501
2201
|
{
|
|
1502
2202
|
ref,
|
|
@@ -1511,8 +2211,8 @@ var FormLayout = React25.forwardRef(
|
|
|
1511
2211
|
style: { ...gapResolved.style, ...style },
|
|
1512
2212
|
...props,
|
|
1513
2213
|
children: [
|
|
1514
|
-
legend && as === "fieldset" && /* @__PURE__ */
|
|
1515
|
-
description && as === "fieldset" && /* @__PURE__ */
|
|
2214
|
+
legend && as === "fieldset" && /* @__PURE__ */ jsx28("legend", { className: "col-span-full p-0 text-sm font-medium leading-none", children: legend }),
|
|
2215
|
+
description && as === "fieldset" && /* @__PURE__ */ jsx28("p", { className: "col-span-full text-xs text-muted-foreground", children: description }),
|
|
1516
2216
|
children
|
|
1517
2217
|
]
|
|
1518
2218
|
}
|
|
@@ -1522,17 +2222,17 @@ var FormLayout = React25.forwardRef(
|
|
|
1522
2222
|
FormLayout.displayName = "FormLayout";
|
|
1523
2223
|
|
|
1524
2224
|
// src/components/switch/Switch.tsx
|
|
1525
|
-
import * as
|
|
1526
|
-
import { jsx as
|
|
1527
|
-
var Switch =
|
|
2225
|
+
import * as React30 from "react";
|
|
2226
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2227
|
+
var Switch = React30.forwardRef(
|
|
1528
2228
|
({ className, checked, defaultChecked, onCheckedChange, disabled, ...props }, ref) => {
|
|
1529
|
-
const [internalChecked, setInternalChecked] =
|
|
2229
|
+
const [internalChecked, setInternalChecked] = React30.useState(defaultChecked ?? false);
|
|
1530
2230
|
const isOn = checked ?? internalChecked;
|
|
1531
2231
|
const toggle = () => {
|
|
1532
2232
|
if (checked === void 0) setInternalChecked((prev) => !prev);
|
|
1533
2233
|
onCheckedChange?.(!isOn);
|
|
1534
2234
|
};
|
|
1535
|
-
return /* @__PURE__ */
|
|
2235
|
+
return /* @__PURE__ */ jsx29(
|
|
1536
2236
|
"button",
|
|
1537
2237
|
{
|
|
1538
2238
|
type: "button",
|
|
@@ -1549,7 +2249,7 @@ var Switch = React26.forwardRef(
|
|
|
1549
2249
|
className
|
|
1550
2250
|
),
|
|
1551
2251
|
...props,
|
|
1552
|
-
children: /* @__PURE__ */
|
|
2252
|
+
children: /* @__PURE__ */ jsx29(
|
|
1553
2253
|
"span",
|
|
1554
2254
|
{
|
|
1555
2255
|
"aria-hidden": "true",
|
|
@@ -1566,9 +2266,9 @@ var Switch = React26.forwardRef(
|
|
|
1566
2266
|
Switch.displayName = "Switch";
|
|
1567
2267
|
|
|
1568
2268
|
// src/components/separator/Separator.tsx
|
|
1569
|
-
import * as
|
|
2269
|
+
import * as React31 from "react";
|
|
1570
2270
|
import { cva as cva4 } from "class-variance-authority";
|
|
1571
|
-
import { jsx as
|
|
2271
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1572
2272
|
var separatorVariants = cva4("shrink-0 bg-border", {
|
|
1573
2273
|
variants: {
|
|
1574
2274
|
orientation: {
|
|
@@ -1580,8 +2280,8 @@ var separatorVariants = cva4("shrink-0 bg-border", {
|
|
|
1580
2280
|
orientation: "horizontal"
|
|
1581
2281
|
}
|
|
1582
2282
|
});
|
|
1583
|
-
var Separator =
|
|
1584
|
-
({ className, orientation, label, ...props }, ref) => /* @__PURE__ */
|
|
2283
|
+
var Separator = React31.forwardRef(
|
|
2284
|
+
({ className, orientation, label, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
1585
2285
|
"div",
|
|
1586
2286
|
{
|
|
1587
2287
|
ref,
|
|
@@ -1597,8 +2297,8 @@ Separator.displayName = "Separator";
|
|
|
1597
2297
|
var Divider = Separator;
|
|
1598
2298
|
|
|
1599
2299
|
// src/components/skeleton/Skeleton.tsx
|
|
1600
|
-
import * as
|
|
1601
|
-
import { jsx as
|
|
2300
|
+
import * as React32 from "react";
|
|
2301
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1602
2302
|
var roundedClasses = {
|
|
1603
2303
|
none: "rounded-none",
|
|
1604
2304
|
sm: "rounded-sm",
|
|
@@ -1606,8 +2306,8 @@ var roundedClasses = {
|
|
|
1606
2306
|
lg: "rounded-lg",
|
|
1607
2307
|
full: "rounded-full"
|
|
1608
2308
|
};
|
|
1609
|
-
var Skeleton =
|
|
1610
|
-
({ className, height, width, rounded = "md", ...props }, ref) => /* @__PURE__ */
|
|
2309
|
+
var Skeleton = React32.forwardRef(
|
|
2310
|
+
({ className, height, width, rounded = "md", ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
1611
2311
|
"div",
|
|
1612
2312
|
{
|
|
1613
2313
|
ref,
|
|
@@ -1626,13 +2326,13 @@ var Skeleton = React28.forwardRef(
|
|
|
1626
2326
|
Skeleton.displayName = "Skeleton";
|
|
1627
2327
|
|
|
1628
2328
|
// src/components/progress/Progress.tsx
|
|
1629
|
-
import * as
|
|
1630
|
-
import { jsx as
|
|
1631
|
-
var Progress =
|
|
2329
|
+
import * as React33 from "react";
|
|
2330
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2331
|
+
var Progress = React33.forwardRef(
|
|
1632
2332
|
({ className, value = 0, max = 100, label, ...props }, ref) => {
|
|
1633
2333
|
const clamped = Math.min(Math.max(value, 0), max);
|
|
1634
2334
|
const percent = max > 0 ? clamped / max * 100 : 0;
|
|
1635
|
-
return /* @__PURE__ */
|
|
2335
|
+
return /* @__PURE__ */ jsx32(
|
|
1636
2336
|
"div",
|
|
1637
2337
|
{
|
|
1638
2338
|
ref,
|
|
@@ -1643,7 +2343,7 @@ var Progress = React29.forwardRef(
|
|
|
1643
2343
|
"aria-label": label,
|
|
1644
2344
|
className: cn("relative h-2 w-full overflow-hidden rounded-full bg-muted", className),
|
|
1645
2345
|
...props,
|
|
1646
|
-
children: /* @__PURE__ */
|
|
2346
|
+
children: /* @__PURE__ */ jsx32(
|
|
1647
2347
|
"div",
|
|
1648
2348
|
{
|
|
1649
2349
|
className: "h-full bg-primary transition-all duration-300 motion-reduce:transition-none",
|
|
@@ -1657,10 +2357,10 @@ var Progress = React29.forwardRef(
|
|
|
1657
2357
|
Progress.displayName = "Progress";
|
|
1658
2358
|
|
|
1659
2359
|
// src/components/tabs/Tabs.tsx
|
|
1660
|
-
import * as
|
|
2360
|
+
import * as React34 from "react";
|
|
1661
2361
|
import { cva as cva5 } from "class-variance-authority";
|
|
1662
|
-
import { jsx as
|
|
1663
|
-
var TabsContext =
|
|
2362
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2363
|
+
var TabsContext = React34.createContext({
|
|
1664
2364
|
value: "",
|
|
1665
2365
|
setValue: () => {
|
|
1666
2366
|
},
|
|
@@ -1668,19 +2368,19 @@ var TabsContext = React30.createContext({
|
|
|
1668
2368
|
variant: "default",
|
|
1669
2369
|
size: "md"
|
|
1670
2370
|
});
|
|
1671
|
-
var Tabs =
|
|
2371
|
+
var Tabs = React34.forwardRef(
|
|
1672
2372
|
({ value, defaultValue, onValueChange, variant = "default", size = "md", className, children }, ref) => {
|
|
1673
|
-
const [internalValue, setInternalValue] =
|
|
2373
|
+
const [internalValue, setInternalValue] = React34.useState(defaultValue ?? "");
|
|
1674
2374
|
const current = value ?? internalValue;
|
|
1675
|
-
const baseId =
|
|
1676
|
-
const setValue =
|
|
2375
|
+
const baseId = React34.useId();
|
|
2376
|
+
const setValue = React34.useCallback(
|
|
1677
2377
|
(next) => {
|
|
1678
2378
|
if (value === void 0) setInternalValue(next);
|
|
1679
2379
|
onValueChange?.(next);
|
|
1680
2380
|
},
|
|
1681
2381
|
[value, onValueChange]
|
|
1682
2382
|
);
|
|
1683
|
-
return /* @__PURE__ */
|
|
2383
|
+
return /* @__PURE__ */ jsx33("div", { ref, className, "data-value": current, "data-variant": variant, children: /* @__PURE__ */ jsx33(TabsContext.Provider, { value: { value: current, setValue, baseId, variant, size }, children }) });
|
|
1684
2384
|
}
|
|
1685
2385
|
);
|
|
1686
2386
|
Tabs.displayName = "Tabs";
|
|
@@ -1702,10 +2402,10 @@ var tabsListVariants = cva5("inline-flex items-center justify-center text-muted-
|
|
|
1702
2402
|
},
|
|
1703
2403
|
defaultVariants: { variant: "default", size: "md" }
|
|
1704
2404
|
});
|
|
1705
|
-
var TabsList =
|
|
2405
|
+
var TabsList = React34.forwardRef(
|
|
1706
2406
|
({ className, ...props }, ref) => {
|
|
1707
|
-
const ctx =
|
|
1708
|
-
return /* @__PURE__ */
|
|
2407
|
+
const ctx = React34.useContext(TabsContext);
|
|
2408
|
+
return /* @__PURE__ */ jsx33(
|
|
1709
2409
|
"div",
|
|
1710
2410
|
{
|
|
1711
2411
|
ref,
|
|
@@ -1745,9 +2445,9 @@ var triggerInactiveByVariant = {
|
|
|
1745
2445
|
underline: "border-transparent text-muted-foreground hover:border-border hover:text-foreground",
|
|
1746
2446
|
rounded: "hover:text-foreground"
|
|
1747
2447
|
};
|
|
1748
|
-
var TabsTrigger =
|
|
2448
|
+
var TabsTrigger = React34.forwardRef(
|
|
1749
2449
|
({ value, className, onKeyDown, ...props }, ref) => {
|
|
1750
|
-
const ctx =
|
|
2450
|
+
const ctx = React34.useContext(TabsContext);
|
|
1751
2451
|
const active = ctx.value === value;
|
|
1752
2452
|
const focusAt = (tabs, index) => {
|
|
1753
2453
|
if (tabs.length === 0) return;
|
|
@@ -1757,7 +2457,7 @@ var TabsTrigger = React30.forwardRef(
|
|
|
1757
2457
|
target.click();
|
|
1758
2458
|
};
|
|
1759
2459
|
const siblingTabs = (button) => Array.from(button.parentElement?.querySelectorAll('[role="tab"]') ?? []);
|
|
1760
|
-
return /* @__PURE__ */
|
|
2460
|
+
return /* @__PURE__ */ jsx33(
|
|
1761
2461
|
"button",
|
|
1762
2462
|
{
|
|
1763
2463
|
ref,
|
|
@@ -1803,11 +2503,11 @@ var TabsTrigger = React30.forwardRef(
|
|
|
1803
2503
|
}
|
|
1804
2504
|
);
|
|
1805
2505
|
TabsTrigger.displayName = "TabsTrigger";
|
|
1806
|
-
var TabsContent =
|
|
2506
|
+
var TabsContent = React34.forwardRef(
|
|
1807
2507
|
({ value, className, ...props }, ref) => {
|
|
1808
|
-
const ctx =
|
|
2508
|
+
const ctx = React34.useContext(TabsContext);
|
|
1809
2509
|
const active = ctx.value === value;
|
|
1810
|
-
return /* @__PURE__ */
|
|
2510
|
+
return /* @__PURE__ */ jsx33(
|
|
1811
2511
|
"div",
|
|
1812
2512
|
{
|
|
1813
2513
|
ref,
|
|
@@ -1829,25 +2529,29 @@ var TabsContent = React30.forwardRef(
|
|
|
1829
2529
|
TabsContent.displayName = "TabsContent";
|
|
1830
2530
|
|
|
1831
2531
|
// src/components/card/Card.tsx
|
|
1832
|
-
import * as
|
|
1833
|
-
import {
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
2532
|
+
import * as React35 from "react";
|
|
2533
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
2534
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2535
|
+
var Card = React35.forwardRef(
|
|
2536
|
+
({ className, asChild = false, ...props }, ref) => {
|
|
2537
|
+
const Comp = asChild ? Slot3 : "div";
|
|
2538
|
+
return /* @__PURE__ */ jsx34(
|
|
2539
|
+
Comp,
|
|
2540
|
+
{
|
|
2541
|
+
ref,
|
|
2542
|
+
className: cn("rounded-xl border border-border bg-card text-card-foreground shadow-sm", className),
|
|
2543
|
+
...props
|
|
2544
|
+
}
|
|
2545
|
+
);
|
|
2546
|
+
}
|
|
1843
2547
|
);
|
|
1844
2548
|
Card.displayName = "Card";
|
|
1845
|
-
var CardHeader =
|
|
1846
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2549
|
+
var CardHeader = React35.forwardRef(
|
|
2550
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx34("div", { ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })
|
|
1847
2551
|
);
|
|
1848
2552
|
CardHeader.displayName = "CardHeader";
|
|
1849
|
-
var CardTitle =
|
|
1850
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2553
|
+
var CardTitle = React35.forwardRef(
|
|
2554
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx34(
|
|
1851
2555
|
"h3",
|
|
1852
2556
|
{
|
|
1853
2557
|
ref,
|
|
@@ -1857,29 +2561,29 @@ var CardTitle = React31.forwardRef(
|
|
|
1857
2561
|
)
|
|
1858
2562
|
);
|
|
1859
2563
|
CardTitle.displayName = "CardTitle";
|
|
1860
|
-
var CardDescription =
|
|
1861
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2564
|
+
var CardDescription = React35.forwardRef(
|
|
2565
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx34("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props })
|
|
1862
2566
|
);
|
|
1863
2567
|
CardDescription.displayName = "CardDescription";
|
|
1864
|
-
var CardContent =
|
|
1865
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2568
|
+
var CardContent = React35.forwardRef(
|
|
2569
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx34("div", { ref, className: cn("p-6 pt-0", className), ...props })
|
|
1866
2570
|
);
|
|
1867
2571
|
CardContent.displayName = "CardContent";
|
|
1868
|
-
var CardFooter =
|
|
1869
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2572
|
+
var CardFooter = React35.forwardRef(
|
|
2573
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx34("div", { ref, className: cn("flex items-center p-6 pt-0", className), ...props })
|
|
1870
2574
|
);
|
|
1871
2575
|
CardFooter.displayName = "CardFooter";
|
|
1872
2576
|
|
|
1873
2577
|
// src/components/accordion/Accordion.tsx
|
|
1874
|
-
import * as
|
|
1875
|
-
import { jsx as
|
|
1876
|
-
var AccordionContext =
|
|
2578
|
+
import * as React36 from "react";
|
|
2579
|
+
import { jsx as jsx35, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2580
|
+
var AccordionContext = React36.createContext({
|
|
1877
2581
|
openItems: /* @__PURE__ */ new Set(),
|
|
1878
2582
|
toggle: () => {
|
|
1879
2583
|
},
|
|
1880
2584
|
collapsible: true
|
|
1881
2585
|
});
|
|
1882
|
-
var Accordion =
|
|
2586
|
+
var Accordion = React36.forwardRef(
|
|
1883
2587
|
({
|
|
1884
2588
|
value,
|
|
1885
2589
|
defaultValue = [],
|
|
@@ -1891,9 +2595,9 @@ var Accordion = React32.forwardRef(
|
|
|
1891
2595
|
style,
|
|
1892
2596
|
children
|
|
1893
2597
|
}, ref) => {
|
|
1894
|
-
const [internalOpen, setInternalOpen] =
|
|
2598
|
+
const [internalOpen, setInternalOpen] = React36.useState(defaultValue);
|
|
1895
2599
|
const current = value ?? internalOpen;
|
|
1896
|
-
const toggle =
|
|
2600
|
+
const toggle = React36.useCallback(
|
|
1897
2601
|
(id) => {
|
|
1898
2602
|
const next = current.includes(id) ? current.filter((item) => item !== id) : collapsible ? [id] : [...current, id];
|
|
1899
2603
|
if (value === void 0) setInternalOpen(next);
|
|
@@ -1902,7 +2606,7 @@ var Accordion = React32.forwardRef(
|
|
|
1902
2606
|
[current, collapsible, value, onValueChange]
|
|
1903
2607
|
);
|
|
1904
2608
|
const gapResolved = resolveGap(gap);
|
|
1905
|
-
return /* @__PURE__ */
|
|
2609
|
+
return /* @__PURE__ */ jsx35(
|
|
1906
2610
|
"div",
|
|
1907
2611
|
{
|
|
1908
2612
|
ref,
|
|
@@ -1915,25 +2619,25 @@ var Accordion = React32.forwardRef(
|
|
|
1915
2619
|
className
|
|
1916
2620
|
),
|
|
1917
2621
|
style: { ...gapResolved.style, ...style },
|
|
1918
|
-
children: /* @__PURE__ */
|
|
2622
|
+
children: /* @__PURE__ */ jsx35(AccordionContext.Provider, { value: { openItems: new Set(current), toggle, collapsible }, children })
|
|
1919
2623
|
}
|
|
1920
2624
|
);
|
|
1921
2625
|
}
|
|
1922
2626
|
);
|
|
1923
2627
|
Accordion.displayName = "Accordion";
|
|
1924
|
-
var AccordionItem =
|
|
1925
|
-
({ id, className, children }, ref) => /* @__PURE__ */
|
|
2628
|
+
var AccordionItem = React36.forwardRef(
|
|
2629
|
+
({ id, className, children }, ref) => /* @__PURE__ */ jsx35("div", { ref, "data-accordion-item": id, className, children: /* @__PURE__ */ jsx35(AccordionItemContext.Provider, { value: { id }, children }) })
|
|
1926
2630
|
);
|
|
1927
2631
|
AccordionItem.displayName = "AccordionItem";
|
|
1928
|
-
var AccordionItemContext =
|
|
1929
|
-
var AccordionTrigger =
|
|
2632
|
+
var AccordionItemContext = React36.createContext({ id: "" });
|
|
2633
|
+
var AccordionTrigger = React36.forwardRef(
|
|
1930
2634
|
({ className, children, icon, ...props }, ref) => {
|
|
1931
|
-
const { id } =
|
|
1932
|
-
const { openItems, toggle } =
|
|
2635
|
+
const { id } = React36.useContext(AccordionItemContext);
|
|
2636
|
+
const { openItems, toggle } = React36.useContext(AccordionContext);
|
|
1933
2637
|
const open = openItems.has(id);
|
|
1934
2638
|
const panelId = `${id}-panel`;
|
|
1935
2639
|
const triggerId = `${id}-trigger`;
|
|
1936
|
-
return /* @__PURE__ */
|
|
2640
|
+
return /* @__PURE__ */ jsxs18(
|
|
1937
2641
|
"button",
|
|
1938
2642
|
{
|
|
1939
2643
|
ref,
|
|
@@ -1952,7 +2656,7 @@ var AccordionTrigger = React32.forwardRef(
|
|
|
1952
2656
|
...props,
|
|
1953
2657
|
children: [
|
|
1954
2658
|
children,
|
|
1955
|
-
icon ?? /* @__PURE__ */
|
|
2659
|
+
icon ?? /* @__PURE__ */ jsx35(
|
|
1956
2660
|
"svg",
|
|
1957
2661
|
{
|
|
1958
2662
|
"aria-hidden": "true",
|
|
@@ -1962,7 +2666,7 @@ var AccordionTrigger = React32.forwardRef(
|
|
|
1962
2666
|
strokeWidth: "2",
|
|
1963
2667
|
strokeLinecap: "round",
|
|
1964
2668
|
className: cn("h-4 w-4 shrink-0 transition-transform duration-200", open && "rotate-180"),
|
|
1965
|
-
children: /* @__PURE__ */
|
|
2669
|
+
children: /* @__PURE__ */ jsx35("polyline", { points: "6 9 12 15 18 9" })
|
|
1966
2670
|
}
|
|
1967
2671
|
)
|
|
1968
2672
|
]
|
|
@@ -1971,13 +2675,13 @@ var AccordionTrigger = React32.forwardRef(
|
|
|
1971
2675
|
}
|
|
1972
2676
|
);
|
|
1973
2677
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
1974
|
-
var AccordionContent =
|
|
2678
|
+
var AccordionContent = React36.forwardRef(
|
|
1975
2679
|
({ className, children, ...props }, ref) => {
|
|
1976
|
-
const { id } =
|
|
1977
|
-
const { openItems } =
|
|
2680
|
+
const { id } = React36.useContext(AccordionItemContext);
|
|
2681
|
+
const { openItems } = React36.useContext(AccordionContext);
|
|
1978
2682
|
const open = openItems.has(id);
|
|
1979
|
-
const [expanded, setExpanded] =
|
|
1980
|
-
|
|
2683
|
+
const [expanded, setExpanded] = React36.useState(open);
|
|
2684
|
+
React36.useEffect(() => {
|
|
1981
2685
|
if (!open) {
|
|
1982
2686
|
setExpanded(false);
|
|
1983
2687
|
return;
|
|
@@ -1996,7 +2700,7 @@ var AccordionContent = React32.forwardRef(
|
|
|
1996
2700
|
cancelAnimationFrame(second);
|
|
1997
2701
|
};
|
|
1998
2702
|
}, [open]);
|
|
1999
|
-
return /* @__PURE__ */
|
|
2703
|
+
return /* @__PURE__ */ jsx35(
|
|
2000
2704
|
"div",
|
|
2001
2705
|
{
|
|
2002
2706
|
ref,
|
|
@@ -2015,7 +2719,7 @@ var AccordionContent = React32.forwardRef(
|
|
|
2015
2719
|
className
|
|
2016
2720
|
),
|
|
2017
2721
|
...props,
|
|
2018
|
-
children: /* @__PURE__ */
|
|
2722
|
+
children: /* @__PURE__ */ jsx35("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx35("div", { className: "px-4 pb-3 text-sm text-muted-foreground", children }) })
|
|
2019
2723
|
}
|
|
2020
2724
|
);
|
|
2021
2725
|
}
|
|
@@ -2023,10 +2727,10 @@ var AccordionContent = React32.forwardRef(
|
|
|
2023
2727
|
AccordionContent.displayName = "AccordionContent";
|
|
2024
2728
|
|
|
2025
2729
|
// src/components/table/Table.tsx
|
|
2026
|
-
import * as
|
|
2027
|
-
import { jsx as
|
|
2028
|
-
var Table =
|
|
2029
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2730
|
+
import * as React37 from "react";
|
|
2731
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2732
|
+
var Table = React37.forwardRef(
|
|
2733
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx36(
|
|
2030
2734
|
"table",
|
|
2031
2735
|
{
|
|
2032
2736
|
ref,
|
|
@@ -2036,16 +2740,16 @@ var Table = React33.forwardRef(
|
|
|
2036
2740
|
) })
|
|
2037
2741
|
);
|
|
2038
2742
|
Table.displayName = "Table";
|
|
2039
|
-
var TableHeader =
|
|
2040
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2743
|
+
var TableHeader = React37.forwardRef(
|
|
2744
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36("thead", { ref, className: cn("[&_tr]:border-b", className), ...props })
|
|
2041
2745
|
);
|
|
2042
2746
|
TableHeader.displayName = "TableHeader";
|
|
2043
|
-
var TableBody =
|
|
2044
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2747
|
+
var TableBody = React37.forwardRef(
|
|
2748
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props })
|
|
2045
2749
|
);
|
|
2046
2750
|
TableBody.displayName = "TableBody";
|
|
2047
|
-
var TableFooter =
|
|
2048
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2751
|
+
var TableFooter = React37.forwardRef(
|
|
2752
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
2049
2753
|
"tfoot",
|
|
2050
2754
|
{
|
|
2051
2755
|
ref,
|
|
@@ -2055,8 +2759,8 @@ var TableFooter = React33.forwardRef(
|
|
|
2055
2759
|
)
|
|
2056
2760
|
);
|
|
2057
2761
|
TableFooter.displayName = "TableFooter";
|
|
2058
|
-
var TableRow =
|
|
2059
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2762
|
+
var TableRow = React37.forwardRef(
|
|
2763
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
2060
2764
|
"tr",
|
|
2061
2765
|
{
|
|
2062
2766
|
ref,
|
|
@@ -2069,8 +2773,8 @@ var TableRow = React33.forwardRef(
|
|
|
2069
2773
|
)
|
|
2070
2774
|
);
|
|
2071
2775
|
TableRow.displayName = "TableRow";
|
|
2072
|
-
var TableHead =
|
|
2073
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2776
|
+
var TableHead = React37.forwardRef(
|
|
2777
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
2074
2778
|
"th",
|
|
2075
2779
|
{
|
|
2076
2780
|
ref,
|
|
@@ -2084,26 +2788,32 @@ var TableHead = React33.forwardRef(
|
|
|
2084
2788
|
)
|
|
2085
2789
|
);
|
|
2086
2790
|
TableHead.displayName = "TableHead";
|
|
2087
|
-
var TableCell =
|
|
2088
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2791
|
+
var TableCell = React37.forwardRef(
|
|
2792
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36("td", { ref, className: cn("px-3 py-2 align-middle", className), ...props })
|
|
2089
2793
|
);
|
|
2090
2794
|
TableCell.displayName = "TableCell";
|
|
2091
|
-
var TableCaption =
|
|
2092
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
2795
|
+
var TableCaption = React37.forwardRef(
|
|
2796
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx36("caption", { ref, className: cn("mt-3 text-xs text-muted-foreground", className), ...props })
|
|
2093
2797
|
);
|
|
2094
2798
|
TableCaption.displayName = "TableCaption";
|
|
2095
2799
|
|
|
2096
2800
|
// src/components/data-table/DataTable.tsx
|
|
2097
|
-
import * as
|
|
2801
|
+
import * as React39 from "react";
|
|
2098
2802
|
|
|
2099
2803
|
// src/components/pagination/Pagination.tsx
|
|
2100
|
-
import * as
|
|
2101
|
-
import { jsx as
|
|
2804
|
+
import * as React38 from "react";
|
|
2805
|
+
import { jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2102
2806
|
var controlClass = "inline-flex h-8 items-center rounded-md border border-border px-2.5 text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
|
|
2103
|
-
var Pagination =
|
|
2807
|
+
var Pagination = React38.forwardRef(
|
|
2104
2808
|
({
|
|
2105
|
-
page,
|
|
2106
|
-
pageCount,
|
|
2809
|
+
page: pageProp,
|
|
2810
|
+
pageCount: pageCountProp,
|
|
2811
|
+
currentPage,
|
|
2812
|
+
totalPages,
|
|
2813
|
+
pageSize,
|
|
2814
|
+
total,
|
|
2815
|
+
itemLabel = "items",
|
|
2816
|
+
showSummary,
|
|
2107
2817
|
onPageChange,
|
|
2108
2818
|
siblings = 1,
|
|
2109
2819
|
showBoundaries = false,
|
|
@@ -2113,6 +2823,9 @@ var Pagination = React34.forwardRef(
|
|
|
2113
2823
|
className,
|
|
2114
2824
|
...props
|
|
2115
2825
|
}, ref) => {
|
|
2826
|
+
const page = pageProp ?? currentPage ?? 1;
|
|
2827
|
+
const derivedPageCount = total !== void 0 && pageSize !== void 0 && pageSize > 0 ? Math.ceil(total / pageSize) : void 0;
|
|
2828
|
+
const pageCount = Math.max(1, pageCountProp ?? totalPages ?? derivedPageCount ?? 1);
|
|
2116
2829
|
const pages = [];
|
|
2117
2830
|
const start = Math.max(2, page - siblings);
|
|
2118
2831
|
const end = Math.min(pageCount - 1, page + siblings);
|
|
@@ -2123,15 +2836,18 @@ var Pagination = React34.forwardRef(
|
|
|
2123
2836
|
if (pageCount > 1) pages.push(pageCount);
|
|
2124
2837
|
const withFirst = showFirst ?? showBoundaries;
|
|
2125
2838
|
const withLast = showLast ?? showBoundaries;
|
|
2126
|
-
|
|
2839
|
+
const summaryEnabled = showSummary ?? (total !== void 0 && pageSize !== void 0);
|
|
2840
|
+
const rangeStart = pageSize !== void 0 ? (page - 1) * pageSize + 1 : void 0;
|
|
2841
|
+
const rangeEnd = pageSize !== void 0 && total !== void 0 ? Math.min(total, page * pageSize) : void 0;
|
|
2842
|
+
const nav = /* @__PURE__ */ jsxs19(
|
|
2127
2843
|
"nav",
|
|
2128
2844
|
{
|
|
2129
2845
|
ref,
|
|
2130
2846
|
"aria-label": "Pagination",
|
|
2131
|
-
className: cn("flex items-center justify-center gap-1", className),
|
|
2847
|
+
className: cn("flex items-center justify-center gap-1", summaryEnabled ? void 0 : className),
|
|
2132
2848
|
...props,
|
|
2133
2849
|
children: [
|
|
2134
|
-
withFirst && /* @__PURE__ */
|
|
2850
|
+
withFirst && /* @__PURE__ */ jsx37(
|
|
2135
2851
|
"button",
|
|
2136
2852
|
{
|
|
2137
2853
|
type: "button",
|
|
@@ -2142,7 +2858,7 @@ var Pagination = React34.forwardRef(
|
|
|
2142
2858
|
children: icons?.first ?? "\xAB"
|
|
2143
2859
|
}
|
|
2144
2860
|
),
|
|
2145
|
-
/* @__PURE__ */
|
|
2861
|
+
/* @__PURE__ */ jsx37(
|
|
2146
2862
|
"button",
|
|
2147
2863
|
{
|
|
2148
2864
|
type: "button",
|
|
@@ -2154,7 +2870,7 @@ var Pagination = React34.forwardRef(
|
|
|
2154
2870
|
}
|
|
2155
2871
|
),
|
|
2156
2872
|
pages.map(
|
|
2157
|
-
(entry, index) => entry === "ellipsis" ? /* @__PURE__ */
|
|
2873
|
+
(entry, index) => entry === "ellipsis" ? /* @__PURE__ */ jsx37(
|
|
2158
2874
|
"span",
|
|
2159
2875
|
{
|
|
2160
2876
|
"aria-hidden": "true",
|
|
@@ -2162,7 +2878,7 @@ var Pagination = React34.forwardRef(
|
|
|
2162
2878
|
children: "\u2026"
|
|
2163
2879
|
},
|
|
2164
2880
|
`ellipsis-${index}`
|
|
2165
|
-
) : /* @__PURE__ */
|
|
2881
|
+
) : /* @__PURE__ */ jsx37(
|
|
2166
2882
|
"button",
|
|
2167
2883
|
{
|
|
2168
2884
|
type: "button",
|
|
@@ -2179,7 +2895,7 @@ var Pagination = React34.forwardRef(
|
|
|
2179
2895
|
entry
|
|
2180
2896
|
)
|
|
2181
2897
|
),
|
|
2182
|
-
/* @__PURE__ */
|
|
2898
|
+
/* @__PURE__ */ jsx37(
|
|
2183
2899
|
"button",
|
|
2184
2900
|
{
|
|
2185
2901
|
type: "button",
|
|
@@ -2190,7 +2906,7 @@ var Pagination = React34.forwardRef(
|
|
|
2190
2906
|
children: icons?.next ?? "\u203A"
|
|
2191
2907
|
}
|
|
2192
2908
|
),
|
|
2193
|
-
withLast && /* @__PURE__ */
|
|
2909
|
+
withLast && /* @__PURE__ */ jsx37(
|
|
2194
2910
|
"button",
|
|
2195
2911
|
{
|
|
2196
2912
|
type: "button",
|
|
@@ -2204,12 +2920,17 @@ var Pagination = React34.forwardRef(
|
|
|
2204
2920
|
]
|
|
2205
2921
|
}
|
|
2206
2922
|
);
|
|
2923
|
+
if (!summaryEnabled) return nav;
|
|
2924
|
+
return /* @__PURE__ */ jsxs19("div", { className: cn("flex flex-wrap items-center justify-between gap-3", className), children: [
|
|
2925
|
+
/* @__PURE__ */ jsx37("p", { className: "text-sm text-muted-foreground", children: rangeStart !== void 0 && rangeEnd !== void 0 && total !== void 0 ? `Showing ${rangeStart}\u2013${rangeEnd} of ${total} ${itemLabel}` : `Page ${page} of ${pageCount}` }),
|
|
2926
|
+
nav
|
|
2927
|
+
] });
|
|
2207
2928
|
}
|
|
2208
2929
|
);
|
|
2209
2930
|
Pagination.displayName = "Pagination";
|
|
2210
2931
|
|
|
2211
2932
|
// src/components/data-table/DataTable.tsx
|
|
2212
|
-
import { jsx as
|
|
2933
|
+
import { jsx as jsx38, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2213
2934
|
function compareValues(a, b) {
|
|
2214
2935
|
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
2215
2936
|
if (a instanceof Date && b instanceof Date) return a.getTime() - b.getTime();
|
|
@@ -2239,9 +2960,9 @@ function DataTable({
|
|
|
2239
2960
|
loadingRows,
|
|
2240
2961
|
className
|
|
2241
2962
|
}) {
|
|
2242
|
-
const [internalSort, setInternalSort] =
|
|
2243
|
-
const [internalPage, setInternalPage] =
|
|
2244
|
-
const sort =
|
|
2963
|
+
const [internalSort, setInternalSort] = React39.useState(defaultSort);
|
|
2964
|
+
const [internalPage, setInternalPage] = React39.useState(1);
|
|
2965
|
+
const sort = React39.useMemo(() => {
|
|
2245
2966
|
if (sortKey !== void 0) {
|
|
2246
2967
|
return sortKey === null ? null : { key: sortKey, dir: sortDir ?? "asc" };
|
|
2247
2968
|
}
|
|
@@ -2258,7 +2979,7 @@ function DataTable({
|
|
|
2258
2979
|
if (page === void 0) setInternalPage(next);
|
|
2259
2980
|
onPageChange?.(next);
|
|
2260
2981
|
};
|
|
2261
|
-
const sorted =
|
|
2982
|
+
const sorted = React39.useMemo(() => {
|
|
2262
2983
|
if (!sort) return data;
|
|
2263
2984
|
const column = columns.find((c) => c.key === sort.key);
|
|
2264
2985
|
if (!column) return data;
|
|
@@ -2284,17 +3005,17 @@ function DataTable({
|
|
|
2284
3005
|
return String(raw);
|
|
2285
3006
|
};
|
|
2286
3007
|
const alignClass = (align) => align === "right" ? "text-right" : align === "center" ? "text-center" : "text-left";
|
|
2287
|
-
return /* @__PURE__ */
|
|
2288
|
-
/* @__PURE__ */
|
|
3008
|
+
return /* @__PURE__ */ jsxs20("div", { className: cn("w-full space-y-3", className), children: [
|
|
3009
|
+
/* @__PURE__ */ jsx38("div", { className: "w-full overflow-x-auto rounded-lg border border-border", children: /* @__PURE__ */ jsxs20(
|
|
2289
3010
|
"table",
|
|
2290
3011
|
{
|
|
2291
3012
|
className: cn("w-full caption-bottom", density === "compact" ? "text-xs" : "text-sm"),
|
|
2292
3013
|
children: [
|
|
2293
|
-
caption && /* @__PURE__ */
|
|
2294
|
-
/* @__PURE__ */
|
|
3014
|
+
caption && /* @__PURE__ */ jsx38("caption", { className: "px-3 py-2 text-left text-xs text-muted-foreground", children: caption }),
|
|
3015
|
+
/* @__PURE__ */ jsx38("thead", { className: cn("bg-muted/50", stickyHeader && "sticky top-0 z-10 bg-background"), children: /* @__PURE__ */ jsx38("tr", { children: columns.map((column) => {
|
|
2295
3016
|
const isSorted = sort?.key === column.key;
|
|
2296
3017
|
const ariaSort = !column.sortable ? void 0 : isSorted ? sort.dir === "asc" ? "ascending" : "descending" : "none";
|
|
2297
|
-
return /* @__PURE__ */
|
|
3018
|
+
return /* @__PURE__ */ jsx38(
|
|
2298
3019
|
"th",
|
|
2299
3020
|
{
|
|
2300
3021
|
scope: "col",
|
|
@@ -2304,7 +3025,7 @@ function DataTable({
|
|
|
2304
3025
|
alignClass(column.align),
|
|
2305
3026
|
column.className
|
|
2306
3027
|
),
|
|
2307
|
-
children: column.sortable ? /* @__PURE__ */
|
|
3028
|
+
children: column.sortable ? /* @__PURE__ */ jsxs20(
|
|
2308
3029
|
"button",
|
|
2309
3030
|
{
|
|
2310
3031
|
type: "button",
|
|
@@ -2312,7 +3033,7 @@ function DataTable({
|
|
|
2312
3033
|
className: "inline-flex items-center gap-1 rounded px-1 py-0.5 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
2313
3034
|
children: [
|
|
2314
3035
|
column.header,
|
|
2315
|
-
/* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ jsx38("span", { "aria-hidden": "true", className: "text-[10px] text-muted-foreground", children: renderSortIcon ? renderSortIcon(isSorted ? sort.dir === "asc" ? "asc" : "desc" : "none") : isSorted ? sort.dir === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
|
|
2316
3037
|
]
|
|
2317
3038
|
}
|
|
2318
3039
|
) : column.header
|
|
@@ -2320,17 +3041,17 @@ function DataTable({
|
|
|
2320
3041
|
column.key
|
|
2321
3042
|
);
|
|
2322
3043
|
}) }) }),
|
|
2323
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ jsx38("tbody", { "aria-busy": loading || void 0, children: loading ? Array.from(
|
|
2324
3045
|
{ length: (loadingRows ?? pageSize ?? Math.min(visible.length, 5)) || 5 },
|
|
2325
|
-
(_, skeletonRow) => /* @__PURE__ */
|
|
2326
|
-
) : visible.length === 0 ? /* @__PURE__ */
|
|
3046
|
+
(_, skeletonRow) => /* @__PURE__ */ jsx38("tr", { children: columns.map((column) => /* @__PURE__ */ jsx38("td", { className: cn("px-3 py-2", density === "compact" && "px-2 py-1"), children: /* @__PURE__ */ jsx38(Skeleton, { className: density === "compact" ? "h-3 w-full" : "h-4 w-full" }) }, column.key)) }, `skeleton-${skeletonRow}`)
|
|
3047
|
+
) : visible.length === 0 ? /* @__PURE__ */ jsx38("tr", { children: /* @__PURE__ */ jsx38(
|
|
2327
3048
|
"td",
|
|
2328
3049
|
{
|
|
2329
3050
|
colSpan: columns.length,
|
|
2330
3051
|
className: "px-3 py-8 text-center text-sm text-muted-foreground",
|
|
2331
3052
|
children: emptyMessage
|
|
2332
3053
|
}
|
|
2333
|
-
) }) : visible.map((row, index) => /* @__PURE__ */
|
|
3054
|
+
) }) : visible.map((row, index) => /* @__PURE__ */ jsx38(
|
|
2334
3055
|
"tr",
|
|
2335
3056
|
{
|
|
2336
3057
|
tabIndex: onRowClick ? 0 : void 0,
|
|
@@ -2346,7 +3067,7 @@ function DataTable({
|
|
|
2346
3067
|
zebra && "[&:nth-child(odd)]:bg-muted/30",
|
|
2347
3068
|
onRowClick && "cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"
|
|
2348
3069
|
),
|
|
2349
|
-
children: columns.map((column) => /* @__PURE__ */
|
|
3070
|
+
children: columns.map((column) => /* @__PURE__ */ jsx38(
|
|
2350
3071
|
"td",
|
|
2351
3072
|
{
|
|
2352
3073
|
className: cn(
|
|
@@ -2355,7 +3076,7 @@ function DataTable({
|
|
|
2355
3076
|
alignClass(column.align),
|
|
2356
3077
|
column.className
|
|
2357
3078
|
),
|
|
2358
|
-
children: column.onClick ? /* @__PURE__ */
|
|
3079
|
+
children: column.onClick ? /* @__PURE__ */ jsx38(
|
|
2359
3080
|
"button",
|
|
2360
3081
|
{
|
|
2361
3082
|
type: "button",
|
|
@@ -2373,8 +3094,8 @@ function DataTable({
|
|
|
2373
3094
|
]
|
|
2374
3095
|
}
|
|
2375
3096
|
) }),
|
|
2376
|
-
pageSize && pageCount > 1 && /* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
3097
|
+
pageSize && pageCount > 1 && /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2", children: [
|
|
3098
|
+
/* @__PURE__ */ jsxs20(
|
|
2378
3099
|
"p",
|
|
2379
3100
|
{
|
|
2380
3101
|
className: "min-h-8 leading-none text-xs text-muted-foreground",
|
|
@@ -2389,16 +3110,16 @@ function DataTable({
|
|
|
2389
3110
|
]
|
|
2390
3111
|
}
|
|
2391
3112
|
),
|
|
2392
|
-
/* @__PURE__ */
|
|
3113
|
+
/* @__PURE__ */ jsx38(Pagination, { page: safePage, pageCount, onPageChange: setPage })
|
|
2393
3114
|
] })
|
|
2394
3115
|
] });
|
|
2395
3116
|
}
|
|
2396
3117
|
|
|
2397
3118
|
// src/components/list/List.tsx
|
|
2398
|
-
import * as
|
|
2399
|
-
import { Fragment as
|
|
2400
|
-
var List =
|
|
2401
|
-
({ divided, bordered, size = "default", className, ...props }, ref) => /* @__PURE__ */
|
|
3119
|
+
import * as React40 from "react";
|
|
3120
|
+
import { Fragment as Fragment5, jsx as jsx39, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3121
|
+
var List = React40.forwardRef(
|
|
3122
|
+
({ divided, bordered, size = "default", className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
2402
3123
|
"ul",
|
|
2403
3124
|
{
|
|
2404
3125
|
ref,
|
|
@@ -2414,7 +3135,7 @@ var List = React36.forwardRef(
|
|
|
2414
3135
|
)
|
|
2415
3136
|
);
|
|
2416
3137
|
List.displayName = "List";
|
|
2417
|
-
var ListItem =
|
|
3138
|
+
var ListItem = React40.forwardRef(
|
|
2418
3139
|
({ leading, trailing, selected, onClick, description, disabled, className, children, ...props }, ref) => {
|
|
2419
3140
|
const padding = "px-3 py-2.5";
|
|
2420
3141
|
const rowClass = cn(
|
|
@@ -2424,23 +3145,23 @@ var ListItem = React36.forwardRef(
|
|
|
2424
3145
|
disabled && "opacity-50",
|
|
2425
3146
|
className
|
|
2426
3147
|
);
|
|
2427
|
-
const body = /* @__PURE__ */
|
|
2428
|
-
leading && /* @__PURE__ */
|
|
2429
|
-
/* @__PURE__ */
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
description && /* @__PURE__ */
|
|
3148
|
+
const body = /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
3149
|
+
leading && /* @__PURE__ */ jsx39("span", { className: "flex shrink-0 items-center", children: leading }),
|
|
3150
|
+
/* @__PURE__ */ jsxs21("span", { className: "min-w-0 flex-1", children: [
|
|
3151
|
+
/* @__PURE__ */ jsx39("span", { className: "block truncate", children }),
|
|
3152
|
+
description && /* @__PURE__ */ jsx39("span", { className: "mt-0.5 block truncate text-xs text-muted-foreground", children: description })
|
|
2432
3153
|
] }),
|
|
2433
|
-
trailing && /* @__PURE__ */
|
|
3154
|
+
trailing && /* @__PURE__ */ jsx39("span", { className: "flex shrink-0 items-center text-xs text-muted-foreground", children: trailing })
|
|
2434
3155
|
] });
|
|
2435
|
-
return /* @__PURE__ */
|
|
3156
|
+
return /* @__PURE__ */ jsx39("li", { ref, ...props, children: onClick ? /* @__PURE__ */ jsx39("button", { type: "button", onClick, disabled, className: cn(padding, rowClass), children: body }) : /* @__PURE__ */ jsx39("div", { className: cn(padding, rowClass), children: body }) });
|
|
2436
3157
|
}
|
|
2437
3158
|
);
|
|
2438
3159
|
ListItem.displayName = "ListItem";
|
|
2439
3160
|
|
|
2440
3161
|
// src/components/text/Text.tsx
|
|
2441
|
-
import * as
|
|
2442
|
-
import { jsx as
|
|
2443
|
-
var
|
|
3162
|
+
import * as React41 from "react";
|
|
3163
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3164
|
+
var sizeClasses3 = {
|
|
2444
3165
|
xs: "text-xs",
|
|
2445
3166
|
sm: "text-sm",
|
|
2446
3167
|
base: "text-base",
|
|
@@ -2453,15 +3174,15 @@ var weightClasses = {
|
|
|
2453
3174
|
semibold: "font-semibold",
|
|
2454
3175
|
bold: "font-bold"
|
|
2455
3176
|
};
|
|
2456
|
-
var Text =
|
|
3177
|
+
var Text = React41.forwardRef(
|
|
2457
3178
|
({ inline, size = "base", weight, muted, className, ...props }, ref) => {
|
|
2458
3179
|
const Tag = inline ? "span" : "p";
|
|
2459
|
-
return /* @__PURE__ */
|
|
3180
|
+
return /* @__PURE__ */ jsx40(
|
|
2460
3181
|
Tag,
|
|
2461
3182
|
{
|
|
2462
3183
|
ref,
|
|
2463
3184
|
className: cn(
|
|
2464
|
-
|
|
3185
|
+
sizeClasses3[size],
|
|
2465
3186
|
weight && weightClasses[weight],
|
|
2466
3187
|
muted && "text-muted-foreground",
|
|
2467
3188
|
inline ? "inline" : "block",
|
|
@@ -2475,8 +3196,8 @@ var Text = React37.forwardRef(
|
|
|
2475
3196
|
Text.displayName = "Text";
|
|
2476
3197
|
|
|
2477
3198
|
// src/components/heading/Heading.tsx
|
|
2478
|
-
import * as
|
|
2479
|
-
import { jsx as
|
|
3199
|
+
import * as React42 from "react";
|
|
3200
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2480
3201
|
var levelClasses = {
|
|
2481
3202
|
1: "text-4xl",
|
|
2482
3203
|
2: "text-3xl",
|
|
@@ -2485,7 +3206,7 @@ var levelClasses = {
|
|
|
2485
3206
|
5: "text-lg",
|
|
2486
3207
|
6: "text-base"
|
|
2487
3208
|
};
|
|
2488
|
-
var
|
|
3209
|
+
var sizeClasses4 = {
|
|
2489
3210
|
sm: "text-lg",
|
|
2490
3211
|
md: "text-xl",
|
|
2491
3212
|
lg: "text-2xl",
|
|
@@ -2493,16 +3214,16 @@ var sizeClasses3 = {
|
|
|
2493
3214
|
"2xl": "text-4xl",
|
|
2494
3215
|
"3xl": "text-5xl"
|
|
2495
3216
|
};
|
|
2496
|
-
var Heading =
|
|
3217
|
+
var Heading = React42.forwardRef(
|
|
2497
3218
|
({ level, size, muted, className, ...props }, ref) => {
|
|
2498
3219
|
const Tag = `h${level}`;
|
|
2499
|
-
return /* @__PURE__ */
|
|
3220
|
+
return /* @__PURE__ */ jsx41(
|
|
2500
3221
|
Tag,
|
|
2501
3222
|
{
|
|
2502
3223
|
ref,
|
|
2503
3224
|
className: cn(
|
|
2504
3225
|
"font-semibold tracking-tight",
|
|
2505
|
-
size ?
|
|
3226
|
+
size ? sizeClasses4[size] : levelClasses[level],
|
|
2506
3227
|
muted && "text-muted-foreground",
|
|
2507
3228
|
className
|
|
2508
3229
|
),
|
|
@@ -2513,13 +3234,448 @@ var Heading = React38.forwardRef(
|
|
|
2513
3234
|
);
|
|
2514
3235
|
Heading.displayName = "Heading";
|
|
2515
3236
|
|
|
3237
|
+
// src/components/empty-state/EmptyState.tsx
|
|
3238
|
+
import * as React43 from "react";
|
|
3239
|
+
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3240
|
+
var EmptyState = React43.forwardRef(function EmptyState2({ icon, title, description, action, secondaryAction, size = "md", className, children, ...props }, ref) {
|
|
3241
|
+
return /* @__PURE__ */ jsxs22(
|
|
3242
|
+
"div",
|
|
3243
|
+
{
|
|
3244
|
+
ref,
|
|
3245
|
+
className: cn(
|
|
3246
|
+
"flex flex-col items-center justify-center rounded-lg border border-dashed border-border text-center",
|
|
3247
|
+
size === "md" ? "gap-3 px-6 py-12" : "gap-2 px-4 py-6",
|
|
3248
|
+
className
|
|
3249
|
+
),
|
|
3250
|
+
...props,
|
|
3251
|
+
children: [
|
|
3252
|
+
icon && /* @__PURE__ */ jsx42("div", { className: "text-muted-foreground [&_svg]:size-8", children: icon }),
|
|
3253
|
+
/* @__PURE__ */ jsx42("p", { className: cn("font-semibold", size === "md" ? "text-base" : "text-sm"), children: title }),
|
|
3254
|
+
description && /* @__PURE__ */ jsx42("p", { className: "max-w-sm text-sm text-muted-foreground", children: description }),
|
|
3255
|
+
children,
|
|
3256
|
+
(action || secondaryAction) && /* @__PURE__ */ jsxs22("div", { className: "mt-1 flex flex-wrap items-center justify-center gap-2", children: [
|
|
3257
|
+
action,
|
|
3258
|
+
secondaryAction
|
|
3259
|
+
] })
|
|
3260
|
+
]
|
|
3261
|
+
}
|
|
3262
|
+
);
|
|
3263
|
+
});
|
|
3264
|
+
|
|
3265
|
+
// src/components/page-header/PageHeader.tsx
|
|
3266
|
+
import * as React44 from "react";
|
|
3267
|
+
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3268
|
+
var PageHeader = React44.forwardRef(function PageHeader2({ title, description, breadcrumbs, actions, className, children, ...props }, ref) {
|
|
3269
|
+
return /* @__PURE__ */ jsxs23("div", { ref, className: cn("flex flex-col gap-2", className), ...props, children: [
|
|
3270
|
+
breadcrumbs && /* @__PURE__ */ jsx43("div", { className: "text-sm text-muted-foreground", children: breadcrumbs }),
|
|
3271
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [
|
|
3272
|
+
/* @__PURE__ */ jsxs23("div", { className: "min-w-0", children: [
|
|
3273
|
+
/* @__PURE__ */ jsx43("h1", { className: "text-2xl font-semibold tracking-tight", children: title }),
|
|
3274
|
+
description && /* @__PURE__ */ jsx43("p", { className: "mt-1 max-w-2xl text-sm text-muted-foreground", children: description })
|
|
3275
|
+
] }),
|
|
3276
|
+
actions && /* @__PURE__ */ jsx43("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
3277
|
+
] }),
|
|
3278
|
+
children && /* @__PURE__ */ jsx43("div", { className: "mt-2", children })
|
|
3279
|
+
] });
|
|
3280
|
+
});
|
|
3281
|
+
|
|
3282
|
+
// src/components/metric-card/MetricCard.tsx
|
|
3283
|
+
import * as React45 from "react";
|
|
3284
|
+
import { jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3285
|
+
var trendClasses = {
|
|
3286
|
+
up: "text-success",
|
|
3287
|
+
down: "text-destructive",
|
|
3288
|
+
flat: "text-muted-foreground"
|
|
3289
|
+
};
|
|
3290
|
+
var trendGlyph = { up: "\u2191", down: "\u2193", flat: "\u2192" };
|
|
3291
|
+
var MetricCard = React45.forwardRef(function MetricCard2({ label, value, hint, delta, trend = "flat", icon, className, ...props }, ref) {
|
|
3292
|
+
return /* @__PURE__ */ jsxs24("div", { ref, className: cn("rounded-xl border border-border bg-card p-5", className), ...props, children: [
|
|
3293
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-start justify-between gap-3", children: [
|
|
3294
|
+
/* @__PURE__ */ jsx44("p", { className: "text-sm text-muted-foreground", children: label }),
|
|
3295
|
+
icon && /* @__PURE__ */ jsx44("span", { className: "text-muted-foreground [&_svg]:size-4", children: icon })
|
|
3296
|
+
] }),
|
|
3297
|
+
/* @__PURE__ */ jsx44("p", { className: "mt-2 text-2xl font-semibold tabular-nums", children: value }),
|
|
3298
|
+
(delta || hint) && /* @__PURE__ */ jsxs24("p", { className: "mt-1 flex items-center gap-2 text-sm", children: [
|
|
3299
|
+
delta && /* @__PURE__ */ jsxs24("span", { className: cn("font-medium tabular-nums", trendClasses[trend]), children: [
|
|
3300
|
+
/* @__PURE__ */ jsx44("span", { "aria-hidden": "true", children: trendGlyph[trend] }),
|
|
3301
|
+
" ",
|
|
3302
|
+
delta
|
|
3303
|
+
] }),
|
|
3304
|
+
hint && /* @__PURE__ */ jsx44("span", { className: "text-muted-foreground", children: hint })
|
|
3305
|
+
] })
|
|
3306
|
+
] });
|
|
3307
|
+
});
|
|
3308
|
+
|
|
3309
|
+
// src/components/password-input/PasswordInput.tsx
|
|
3310
|
+
import * as React46 from "react";
|
|
3311
|
+
import { jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3312
|
+
var PasswordInput = React46.forwardRef(function PasswordInput2({ className, showLabel = "Show password", hideLabel = "Hide password", ...props }, ref) {
|
|
3313
|
+
const [visible, setVisible] = React46.useState(false);
|
|
3314
|
+
return /* @__PURE__ */ jsxs25("div", { className: cn("relative flex items-center", className), children: [
|
|
3315
|
+
/* @__PURE__ */ jsx45(Input, { ref, type: visible ? "text" : "password", className: "pr-24", ...props }),
|
|
3316
|
+
/* @__PURE__ */ jsx45(
|
|
3317
|
+
Button,
|
|
3318
|
+
{
|
|
3319
|
+
type: "button",
|
|
3320
|
+
variant: "ghost",
|
|
3321
|
+
size: "sm",
|
|
3322
|
+
"aria-pressed": visible,
|
|
3323
|
+
"aria-label": visible ? hideLabel : showLabel,
|
|
3324
|
+
onClick: () => setVisible((current) => !current),
|
|
3325
|
+
className: "absolute right-1 h-8 px-2 text-xs text-muted-foreground hover:text-foreground",
|
|
3326
|
+
children: visible ? "Hide" : "Show"
|
|
3327
|
+
}
|
|
3328
|
+
)
|
|
3329
|
+
] });
|
|
3330
|
+
});
|
|
3331
|
+
|
|
3332
|
+
// src/components/auth-layout/AuthLayout.tsx
|
|
3333
|
+
import * as React47 from "react";
|
|
3334
|
+
import { jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3335
|
+
var sizeClasses5 = {
|
|
3336
|
+
sm: "max-w-sm",
|
|
3337
|
+
md: "max-w-md",
|
|
3338
|
+
lg: "max-w-lg"
|
|
3339
|
+
};
|
|
3340
|
+
var AuthLayout = React47.forwardRef(function AuthLayout2({ title, description, brand, footer, children, size = "md", className, ...props }, ref) {
|
|
3341
|
+
return /* @__PURE__ */ jsxs26(
|
|
3342
|
+
"div",
|
|
3343
|
+
{
|
|
3344
|
+
ref,
|
|
3345
|
+
className: cn("flex min-h-screen flex-col items-center justify-center bg-muted/30 px-4 py-12", className),
|
|
3346
|
+
...props,
|
|
3347
|
+
children: [
|
|
3348
|
+
brand && /* @__PURE__ */ jsx46("div", { className: "mb-6", children: brand }),
|
|
3349
|
+
/* @__PURE__ */ jsxs26("div", { className: cn("w-full rounded-xl border border-border bg-card p-6 shadow-sm sm:p-8", sizeClasses5[size]), children: [
|
|
3350
|
+
/* @__PURE__ */ jsx46("h1", { className: "text-xl font-semibold tracking-tight", children: title }),
|
|
3351
|
+
description && /* @__PURE__ */ jsx46("p", { className: "mt-1 text-sm text-muted-foreground", children: description }),
|
|
3352
|
+
/* @__PURE__ */ jsx46("div", { className: "mt-6", children })
|
|
3353
|
+
] }),
|
|
3354
|
+
footer && /* @__PURE__ */ jsx46("div", { className: "mt-6 text-center text-sm text-muted-foreground", children: footer })
|
|
3355
|
+
]
|
|
3356
|
+
}
|
|
3357
|
+
);
|
|
3358
|
+
});
|
|
3359
|
+
|
|
3360
|
+
// src/components/filter-bar/FilterBar.tsx
|
|
3361
|
+
import * as React48 from "react";
|
|
3362
|
+
import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3363
|
+
var FilterBar = React48.forwardRef(function FilterBar2({
|
|
3364
|
+
searchValue,
|
|
3365
|
+
onSearchChange,
|
|
3366
|
+
searchPlaceholder = "Search\u2026",
|
|
3367
|
+
onReset,
|
|
3368
|
+
activeCount = 0,
|
|
3369
|
+
trailing,
|
|
3370
|
+
className,
|
|
3371
|
+
children,
|
|
3372
|
+
...props
|
|
3373
|
+
}, ref) {
|
|
3374
|
+
return /* @__PURE__ */ jsxs27(
|
|
3375
|
+
"div",
|
|
3376
|
+
{
|
|
3377
|
+
ref,
|
|
3378
|
+
role: "search",
|
|
3379
|
+
className: cn(
|
|
3380
|
+
"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card p-2",
|
|
3381
|
+
className
|
|
3382
|
+
),
|
|
3383
|
+
...props,
|
|
3384
|
+
children: [
|
|
3385
|
+
onSearchChange !== void 0 && /* @__PURE__ */ jsx47(
|
|
3386
|
+
Input,
|
|
3387
|
+
{
|
|
3388
|
+
type: "search",
|
|
3389
|
+
value: searchValue,
|
|
3390
|
+
onChange: (event) => onSearchChange(event.target.value),
|
|
3391
|
+
placeholder: searchPlaceholder,
|
|
3392
|
+
"aria-label": searchPlaceholder,
|
|
3393
|
+
className: "h-9 w-full min-w-40 flex-1 sm:w-auto"
|
|
3394
|
+
}
|
|
3395
|
+
),
|
|
3396
|
+
/* @__PURE__ */ jsx47("div", { className: "flex flex-wrap items-center gap-2", children }),
|
|
3397
|
+
onReset && /* @__PURE__ */ jsxs27(Button, { type: "button", variant: "ghost", size: "sm", onClick: onReset, children: [
|
|
3398
|
+
"Reset",
|
|
3399
|
+
activeCount > 0 ? ` (${activeCount})` : ""
|
|
3400
|
+
] }),
|
|
3401
|
+
trailing && /* @__PURE__ */ jsx47("div", { className: "ml-auto flex items-center gap-2", children: trailing })
|
|
3402
|
+
]
|
|
3403
|
+
}
|
|
3404
|
+
);
|
|
3405
|
+
});
|
|
3406
|
+
|
|
3407
|
+
// src/components/date-picker/DatePicker.tsx
|
|
3408
|
+
import * as React49 from "react";
|
|
3409
|
+
import { jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3410
|
+
var DatePicker = React49.forwardRef(function DatePicker2({ value, defaultValue, onValueChange, clearable = false, className, ...props }, ref) {
|
|
3411
|
+
const [internal, setInternal] = React49.useState(defaultValue ?? "");
|
|
3412
|
+
const current = value ?? internal;
|
|
3413
|
+
const commit = (next) => {
|
|
3414
|
+
if (value === void 0) setInternal(next);
|
|
3415
|
+
onValueChange?.(next);
|
|
3416
|
+
};
|
|
3417
|
+
return /* @__PURE__ */ jsxs28("div", { className: cn("relative flex items-center", className), children: [
|
|
3418
|
+
/* @__PURE__ */ jsx48(
|
|
3419
|
+
Input,
|
|
3420
|
+
{
|
|
3421
|
+
ref,
|
|
3422
|
+
type: "date",
|
|
3423
|
+
value: current,
|
|
3424
|
+
onChange: (event) => commit(event.target.value),
|
|
3425
|
+
className: clearable && current ? "pr-9" : void 0,
|
|
3426
|
+
...props
|
|
3427
|
+
}
|
|
3428
|
+
),
|
|
3429
|
+
clearable && current && /* @__PURE__ */ jsx48(
|
|
3430
|
+
"button",
|
|
3431
|
+
{
|
|
3432
|
+
type: "button",
|
|
3433
|
+
onClick: () => commit(""),
|
|
3434
|
+
"aria-label": "Clear date",
|
|
3435
|
+
className: "absolute right-2 rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3436
|
+
children: "\u2715"
|
|
3437
|
+
}
|
|
3438
|
+
)
|
|
3439
|
+
] });
|
|
3440
|
+
});
|
|
3441
|
+
|
|
3442
|
+
// src/components/time-picker/TimePicker.tsx
|
|
3443
|
+
import * as React50 from "react";
|
|
3444
|
+
import { jsx as jsx49, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3445
|
+
var TimePicker = React50.forwardRef(function TimePicker2({ value, defaultValue, onValueChange, clearable = false, className, ...props }, ref) {
|
|
3446
|
+
const [internal, setInternal] = React50.useState(defaultValue ?? "");
|
|
3447
|
+
const current = value ?? internal;
|
|
3448
|
+
const commit = (next) => {
|
|
3449
|
+
if (value === void 0) setInternal(next);
|
|
3450
|
+
onValueChange?.(next);
|
|
3451
|
+
};
|
|
3452
|
+
return /* @__PURE__ */ jsxs29("div", { className: cn("relative flex items-center", className), children: [
|
|
3453
|
+
/* @__PURE__ */ jsx49(
|
|
3454
|
+
Input,
|
|
3455
|
+
{
|
|
3456
|
+
ref,
|
|
3457
|
+
type: "time",
|
|
3458
|
+
value: current,
|
|
3459
|
+
onChange: (event) => commit(event.target.value),
|
|
3460
|
+
className: clearable && current ? "pr-9" : void 0,
|
|
3461
|
+
...props
|
|
3462
|
+
}
|
|
3463
|
+
),
|
|
3464
|
+
clearable && current && /* @__PURE__ */ jsx49(
|
|
3465
|
+
"button",
|
|
3466
|
+
{
|
|
3467
|
+
type: "button",
|
|
3468
|
+
onClick: () => commit(""),
|
|
3469
|
+
"aria-label": "Clear time",
|
|
3470
|
+
className: "absolute right-2 rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3471
|
+
children: "\u2715"
|
|
3472
|
+
}
|
|
3473
|
+
)
|
|
3474
|
+
] });
|
|
3475
|
+
});
|
|
3476
|
+
|
|
3477
|
+
// src/components/stepper/Stepper.tsx
|
|
3478
|
+
import * as React51 from "react";
|
|
3479
|
+
import { Fragment as Fragment6, jsx as jsx50, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3480
|
+
var Stepper = React51.forwardRef(function Stepper2({ steps, current, orientation = "horizontal", onStepClick, className, ...props }, ref) {
|
|
3481
|
+
return /* @__PURE__ */ jsx50(
|
|
3482
|
+
"ol",
|
|
3483
|
+
{
|
|
3484
|
+
ref,
|
|
3485
|
+
className: cn(
|
|
3486
|
+
"flex gap-4",
|
|
3487
|
+
orientation === "vertical" ? "flex-col" : "flex-wrap items-start",
|
|
3488
|
+
className
|
|
3489
|
+
),
|
|
3490
|
+
...props,
|
|
3491
|
+
children: steps.map((step, index) => {
|
|
3492
|
+
const state = index < current ? "complete" : index === current ? "current" : "upcoming";
|
|
3493
|
+
const interactive = Boolean(onStepClick);
|
|
3494
|
+
const content = /* @__PURE__ */ jsxs30(Fragment6, { children: [
|
|
3495
|
+
/* @__PURE__ */ jsx50(
|
|
3496
|
+
"span",
|
|
3497
|
+
{
|
|
3498
|
+
"aria-hidden": "true",
|
|
3499
|
+
className: cn(
|
|
3500
|
+
"flex h-7 w-7 shrink-0 items-center justify-center rounded-full border text-xs font-medium",
|
|
3501
|
+
state === "complete" && "border-primary bg-primary text-primary-foreground",
|
|
3502
|
+
state === "current" && "border-primary text-primary",
|
|
3503
|
+
state === "upcoming" && "border-border text-muted-foreground"
|
|
3504
|
+
),
|
|
3505
|
+
children: state === "complete" ? "\u2713" : index + 1
|
|
3506
|
+
}
|
|
3507
|
+
),
|
|
3508
|
+
/* @__PURE__ */ jsxs30("span", { className: "min-w-0", children: [
|
|
3509
|
+
/* @__PURE__ */ jsx50("span", { className: cn("block text-sm", state === "upcoming" ? "text-muted-foreground" : "font-medium"), children: step.label }),
|
|
3510
|
+
step.description && /* @__PURE__ */ jsx50("span", { className: "block text-xs text-muted-foreground", children: step.description }),
|
|
3511
|
+
/* @__PURE__ */ jsx50("span", { className: "sr-only", children: state === "complete" ? " (completed)" : state === "current" ? " (current step)" : " (upcoming)" })
|
|
3512
|
+
] })
|
|
3513
|
+
] });
|
|
3514
|
+
return /* @__PURE__ */ jsxs30("li", { className: "flex min-w-0 items-start gap-2", children: [
|
|
3515
|
+
interactive ? /* @__PURE__ */ jsx50(
|
|
3516
|
+
"button",
|
|
3517
|
+
{
|
|
3518
|
+
type: "button",
|
|
3519
|
+
onClick: () => onStepClick?.(index),
|
|
3520
|
+
"aria-current": state === "current" ? "step" : void 0,
|
|
3521
|
+
className: "flex items-start gap-2 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3522
|
+
children: content
|
|
3523
|
+
}
|
|
3524
|
+
) : /* @__PURE__ */ jsx50("div", { "aria-current": state === "current" ? "step" : void 0, className: "flex items-start gap-2", children: content }),
|
|
3525
|
+
orientation === "horizontal" && index < steps.length - 1 && /* @__PURE__ */ jsx50("span", { "aria-hidden": "true", className: "mt-3.5 hidden h-px w-8 bg-border sm:block" })
|
|
3526
|
+
] }, step.label);
|
|
3527
|
+
})
|
|
3528
|
+
}
|
|
3529
|
+
);
|
|
3530
|
+
});
|
|
3531
|
+
|
|
3532
|
+
// src/components/file-upload/FileUpload.tsx
|
|
3533
|
+
import * as React52 from "react";
|
|
3534
|
+
import { jsx as jsx51, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3535
|
+
function formatSize(bytes) {
|
|
3536
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
3537
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
3538
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
3539
|
+
}
|
|
3540
|
+
var FileUpload = React52.forwardRef(function FileUpload2({
|
|
3541
|
+
files,
|
|
3542
|
+
defaultFiles,
|
|
3543
|
+
onFilesChange,
|
|
3544
|
+
label = "Drop files here or click to browse",
|
|
3545
|
+
hint,
|
|
3546
|
+
progress,
|
|
3547
|
+
multiple = true,
|
|
3548
|
+
accept,
|
|
3549
|
+
disabled,
|
|
3550
|
+
className,
|
|
3551
|
+
id,
|
|
3552
|
+
...props
|
|
3553
|
+
}, ref) {
|
|
3554
|
+
const [internal, setInternal] = React52.useState(defaultFiles ?? []);
|
|
3555
|
+
const [dragging, setDragging] = React52.useState(false);
|
|
3556
|
+
const current = files ?? internal;
|
|
3557
|
+
const generatedId = React52.useId();
|
|
3558
|
+
const inputId = id ?? generatedId;
|
|
3559
|
+
const commit = (next) => {
|
|
3560
|
+
if (files === void 0) setInternal(next);
|
|
3561
|
+
onFilesChange?.(next);
|
|
3562
|
+
};
|
|
3563
|
+
const add = (incoming) => {
|
|
3564
|
+
if (!incoming || incoming.length === 0) return;
|
|
3565
|
+
const list = Array.from(incoming);
|
|
3566
|
+
commit(multiple ? [...current, ...list] : list.slice(0, 1));
|
|
3567
|
+
};
|
|
3568
|
+
return /* @__PURE__ */ jsxs31("div", { className: cn("flex flex-col gap-3", className), children: [
|
|
3569
|
+
/* @__PURE__ */ jsxs31(
|
|
3570
|
+
"div",
|
|
3571
|
+
{
|
|
3572
|
+
onDragOver: (event) => {
|
|
3573
|
+
if (disabled) return;
|
|
3574
|
+
event.preventDefault();
|
|
3575
|
+
setDragging(true);
|
|
3576
|
+
},
|
|
3577
|
+
onDragLeave: () => setDragging(false),
|
|
3578
|
+
onDrop: (event) => {
|
|
3579
|
+
if (disabled) return;
|
|
3580
|
+
event.preventDefault();
|
|
3581
|
+
setDragging(false);
|
|
3582
|
+
add(event.dataTransfer.files);
|
|
3583
|
+
},
|
|
3584
|
+
className: cn(
|
|
3585
|
+
"rounded-lg border border-dashed border-border p-6 text-center transition-colors",
|
|
3586
|
+
dragging && "border-primary bg-primary/5",
|
|
3587
|
+
disabled && "opacity-50"
|
|
3588
|
+
),
|
|
3589
|
+
children: [
|
|
3590
|
+
/* @__PURE__ */ jsxs31("label", { htmlFor: inputId, className: cn("block text-sm", disabled ? "cursor-not-allowed" : "cursor-pointer"), children: [
|
|
3591
|
+
label,
|
|
3592
|
+
/* @__PURE__ */ jsx51(
|
|
3593
|
+
"input",
|
|
3594
|
+
{
|
|
3595
|
+
ref,
|
|
3596
|
+
id: inputId,
|
|
3597
|
+
type: "file",
|
|
3598
|
+
multiple,
|
|
3599
|
+
accept,
|
|
3600
|
+
disabled,
|
|
3601
|
+
className: "sr-only",
|
|
3602
|
+
onChange: (event) => {
|
|
3603
|
+
add(event.target.files);
|
|
3604
|
+
event.target.value = "";
|
|
3605
|
+
},
|
|
3606
|
+
...props
|
|
3607
|
+
}
|
|
3608
|
+
)
|
|
3609
|
+
] }),
|
|
3610
|
+
/* @__PURE__ */ jsx51("p", { className: "mt-1 text-xs text-muted-foreground", children: hint ?? (accept ? `Accepted: ${accept}` : "Any file type") })
|
|
3611
|
+
]
|
|
3612
|
+
}
|
|
3613
|
+
),
|
|
3614
|
+
current.length > 0 && /* @__PURE__ */ jsx51("ul", { "aria-label": "Selected files", className: "space-y-2", children: current.map((file) => /* @__PURE__ */ jsxs31("li", { className: "flex items-center justify-between gap-3 rounded-md border border-border px-3 py-2", children: [
|
|
3615
|
+
/* @__PURE__ */ jsxs31("div", { className: "min-w-0", children: [
|
|
3616
|
+
/* @__PURE__ */ jsx51("p", { className: "truncate text-sm", children: file.name }),
|
|
3617
|
+
/* @__PURE__ */ jsx51("p", { className: "text-xs text-muted-foreground", children: formatSize(file.size) }),
|
|
3618
|
+
progress?.[file.name] !== void 0 && /* @__PURE__ */ jsx51(
|
|
3619
|
+
"div",
|
|
3620
|
+
{
|
|
3621
|
+
role: "progressbar",
|
|
3622
|
+
"aria-valuenow": progress[file.name],
|
|
3623
|
+
"aria-valuemin": 0,
|
|
3624
|
+
"aria-valuemax": 100,
|
|
3625
|
+
"aria-label": `Uploading ${file.name}`,
|
|
3626
|
+
className: "mt-1 h-1.5 w-40 overflow-hidden rounded-full bg-muted",
|
|
3627
|
+
children: /* @__PURE__ */ jsx51("div", { className: "h-full bg-primary", style: { width: `${progress[file.name]}%` } })
|
|
3628
|
+
}
|
|
3629
|
+
)
|
|
3630
|
+
] }),
|
|
3631
|
+
/* @__PURE__ */ jsx51(
|
|
3632
|
+
"button",
|
|
3633
|
+
{
|
|
3634
|
+
type: "button",
|
|
3635
|
+
onClick: () => commit(current.filter((entry) => entry.name !== file.name)),
|
|
3636
|
+
"aria-label": `Remove ${file.name}`,
|
|
3637
|
+
className: "rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3638
|
+
children: "\u2715"
|
|
3639
|
+
}
|
|
3640
|
+
)
|
|
3641
|
+
] }, file.name)) })
|
|
3642
|
+
] });
|
|
3643
|
+
});
|
|
3644
|
+
|
|
3645
|
+
// src/components/timeline/Timeline.tsx
|
|
3646
|
+
import * as React53 from "react";
|
|
3647
|
+
import { jsx as jsx52, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3648
|
+
var Timeline = React53.forwardRef(function Timeline2({ items, className, ...props }, ref) {
|
|
3649
|
+
return /* @__PURE__ */ jsx52("ol", { ref, className: cn("relative flex flex-col gap-6", className), ...props, children: items.map((item, index) => /* @__PURE__ */ jsxs32("li", { className: "relative flex gap-4", children: [
|
|
3650
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-col items-center", children: [
|
|
3651
|
+
/* @__PURE__ */ jsx52(
|
|
3652
|
+
"span",
|
|
3653
|
+
{
|
|
3654
|
+
"aria-hidden": "true",
|
|
3655
|
+
className: cn(
|
|
3656
|
+
"mt-1 flex h-3 w-3 shrink-0 items-center justify-center rounded-full border-2",
|
|
3657
|
+
item.muted ? "border-border bg-background" : "border-primary bg-primary"
|
|
3658
|
+
)
|
|
3659
|
+
}
|
|
3660
|
+
),
|
|
3661
|
+
index < items.length - 1 && /* @__PURE__ */ jsx52("span", { "aria-hidden": "true", className: "mt-1 w-px flex-1 bg-border" })
|
|
3662
|
+
] }),
|
|
3663
|
+
/* @__PURE__ */ jsxs32("div", { className: cn("min-w-0 pb-1", item.muted && "opacity-60"), children: [
|
|
3664
|
+
item.period && /* @__PURE__ */ jsx52("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: item.period }),
|
|
3665
|
+
/* @__PURE__ */ jsx52("p", { className: "text-sm font-semibold", children: item.title }),
|
|
3666
|
+
item.description && /* @__PURE__ */ jsx52("p", { className: "mt-1 text-sm text-muted-foreground", children: item.description }),
|
|
3667
|
+
item.icon && /* @__PURE__ */ jsx52("div", { className: "mt-1 text-muted-foreground [&_svg]:size-4", children: item.icon })
|
|
3668
|
+
] })
|
|
3669
|
+
] }, `${item.title}-${index}`)) });
|
|
3670
|
+
});
|
|
3671
|
+
|
|
2516
3672
|
// src/components/block/Block.tsx
|
|
2517
|
-
import * as
|
|
2518
|
-
import { jsx as
|
|
2519
|
-
var Block =
|
|
3673
|
+
import * as React54 from "react";
|
|
3674
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3675
|
+
var Block = React54.forwardRef(
|
|
2520
3676
|
({ as = "div", inline, muted, className, ...props }, ref) => {
|
|
2521
3677
|
const Tag = inline ? "span" : as;
|
|
2522
|
-
return /* @__PURE__ */
|
|
3678
|
+
return /* @__PURE__ */ jsx53(
|
|
2523
3679
|
Tag,
|
|
2524
3680
|
{
|
|
2525
3681
|
ref,
|
|
@@ -2532,8 +3688,8 @@ var Block = React39.forwardRef(
|
|
|
2532
3688
|
Block.displayName = "Block";
|
|
2533
3689
|
|
|
2534
3690
|
// src/components/flex/Flex.tsx
|
|
2535
|
-
import * as
|
|
2536
|
-
import { jsx as
|
|
3691
|
+
import * as React55 from "react";
|
|
3692
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2537
3693
|
var justifyClasses = {
|
|
2538
3694
|
start: "justify-start",
|
|
2539
3695
|
center: "justify-center",
|
|
@@ -2549,11 +3705,11 @@ var alignClasses = {
|
|
|
2549
3705
|
stretch: "items-stretch",
|
|
2550
3706
|
baseline: "items-baseline"
|
|
2551
3707
|
};
|
|
2552
|
-
var Flex =
|
|
3708
|
+
var Flex = React55.forwardRef(
|
|
2553
3709
|
({ direction = "row", align, justify, wrap, gap = "md", as = "div", className, style, ...props }, ref) => {
|
|
2554
3710
|
const Tag = as;
|
|
2555
3711
|
const gapResolved = resolveGap(gap);
|
|
2556
|
-
return /* @__PURE__ */
|
|
3712
|
+
return /* @__PURE__ */ jsx54(
|
|
2557
3713
|
Tag,
|
|
2558
3714
|
{
|
|
2559
3715
|
ref,
|
|
@@ -2580,7 +3736,7 @@ var selfAlignClasses = {
|
|
|
2580
3736
|
stretch: "self-stretch",
|
|
2581
3737
|
baseline: "self-baseline"
|
|
2582
3738
|
};
|
|
2583
|
-
var FlexItem =
|
|
3739
|
+
var FlexItem = React55.forwardRef(
|
|
2584
3740
|
({ grow, shrink, basis, align, as = "div", className, ...props }, ref) => {
|
|
2585
3741
|
const Tag = as;
|
|
2586
3742
|
const style = {
|
|
@@ -2588,7 +3744,7 @@ var FlexItem = React40.forwardRef(
|
|
|
2588
3744
|
...shrink === false ? { flexShrink: 0 } : typeof shrink === "string" && shrink ? { flexShrink: Number(shrink) || shrink } : {},
|
|
2589
3745
|
...basis ? { flexBasis: basis } : {}
|
|
2590
3746
|
};
|
|
2591
|
-
return /* @__PURE__ */
|
|
3747
|
+
return /* @__PURE__ */ jsx54(
|
|
2592
3748
|
Tag,
|
|
2593
3749
|
{
|
|
2594
3750
|
ref,
|
|
@@ -2602,8 +3758,8 @@ var FlexItem = React40.forwardRef(
|
|
|
2602
3758
|
FlexItem.displayName = "FlexItem";
|
|
2603
3759
|
|
|
2604
3760
|
// src/components/grid/Grid.tsx
|
|
2605
|
-
import * as
|
|
2606
|
-
import { jsx as
|
|
3761
|
+
import * as React56 from "react";
|
|
3762
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2607
3763
|
var BASE_COLS = {
|
|
2608
3764
|
1: "grid-cols-1",
|
|
2609
3765
|
2: "grid-cols-2",
|
|
@@ -2668,11 +3824,11 @@ var LG_COL_SPAN = {
|
|
|
2668
3824
|
5: "lg:col-span-5",
|
|
2669
3825
|
6: "lg:col-span-6"
|
|
2670
3826
|
};
|
|
2671
|
-
var Grid =
|
|
3827
|
+
var Grid = React56.forwardRef(
|
|
2672
3828
|
({ cols, smCols, mdCols, lgCols, minCol, gap = "md", as = "div", className, style, ...props }, ref) => {
|
|
2673
3829
|
const Tag = as;
|
|
2674
3830
|
const gapResolved = resolveGap(gap);
|
|
2675
|
-
return /* @__PURE__ */
|
|
3831
|
+
return /* @__PURE__ */ jsx55(
|
|
2676
3832
|
Tag,
|
|
2677
3833
|
{
|
|
2678
3834
|
ref,
|
|
@@ -2696,10 +3852,10 @@ var Grid = React41.forwardRef(
|
|
|
2696
3852
|
}
|
|
2697
3853
|
);
|
|
2698
3854
|
Grid.displayName = "Grid";
|
|
2699
|
-
var GridItem =
|
|
3855
|
+
var GridItem = React56.forwardRef(
|
|
2700
3856
|
({ span, smSpan, mdSpan, lgSpan, as = "div", className, ...props }, ref) => {
|
|
2701
3857
|
const Tag = as;
|
|
2702
|
-
return /* @__PURE__ */
|
|
3858
|
+
return /* @__PURE__ */ jsx55(
|
|
2703
3859
|
Tag,
|
|
2704
3860
|
{
|
|
2705
3861
|
ref,
|
|
@@ -2718,10 +3874,11 @@ var GridItem = React41.forwardRef(
|
|
|
2718
3874
|
GridItem.displayName = "GridItem";
|
|
2719
3875
|
|
|
2720
3876
|
// src/components/menu/Menu.tsx
|
|
2721
|
-
import * as
|
|
2722
|
-
import { createPortal as
|
|
2723
|
-
import {
|
|
2724
|
-
|
|
3877
|
+
import * as React57 from "react";
|
|
3878
|
+
import { createPortal as createPortal7 } from "react-dom";
|
|
3879
|
+
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
3880
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
3881
|
+
var MenuContext = React57.createContext({
|
|
2725
3882
|
open: false,
|
|
2726
3883
|
setOpen: () => {
|
|
2727
3884
|
},
|
|
@@ -2730,13 +3887,13 @@ var MenuContext = React42.createContext({
|
|
|
2730
3887
|
},
|
|
2731
3888
|
wrapperRef: { current: null }
|
|
2732
3889
|
});
|
|
2733
|
-
var Menu =
|
|
3890
|
+
var Menu = React57.forwardRef(
|
|
2734
3891
|
({ open, onOpenChange, className, children }, ref) => {
|
|
2735
|
-
const [internalOpen, setInternalOpen] =
|
|
2736
|
-
const [activeIndex, setActiveIndex] =
|
|
3892
|
+
const [internalOpen, setInternalOpen] = React57.useState(false);
|
|
3893
|
+
const [activeIndex, setActiveIndex] = React57.useState(-1);
|
|
2737
3894
|
const current = open ?? internalOpen;
|
|
2738
|
-
const wrapperRef =
|
|
2739
|
-
const setRefs =
|
|
3895
|
+
const wrapperRef = React57.useRef(null);
|
|
3896
|
+
const setRefs = React57.useCallback(
|
|
2740
3897
|
(node) => {
|
|
2741
3898
|
wrapperRef.current = node;
|
|
2742
3899
|
if (typeof ref === "function") ref(node);
|
|
@@ -2744,7 +3901,7 @@ var Menu = React42.forwardRef(
|
|
|
2744
3901
|
},
|
|
2745
3902
|
[ref]
|
|
2746
3903
|
);
|
|
2747
|
-
const setOpen =
|
|
3904
|
+
const setOpen = React57.useCallback(
|
|
2748
3905
|
(next) => {
|
|
2749
3906
|
if (open === void 0) setInternalOpen(next);
|
|
2750
3907
|
onOpenChange?.(next);
|
|
@@ -2752,7 +3909,7 @@ var Menu = React42.forwardRef(
|
|
|
2752
3909
|
},
|
|
2753
3910
|
[open, onOpenChange]
|
|
2754
3911
|
);
|
|
2755
|
-
return /* @__PURE__ */
|
|
3912
|
+
return /* @__PURE__ */ jsx56("div", { ref: setRefs, className: cn("relative inline-block", className), children: /* @__PURE__ */ jsx56(
|
|
2756
3913
|
MenuContext.Provider,
|
|
2757
3914
|
{
|
|
2758
3915
|
value: { open: current, setOpen, activeIndex, setActiveIndex, wrapperRef },
|
|
@@ -2762,10 +3919,10 @@ var Menu = React42.forwardRef(
|
|
|
2762
3919
|
}
|
|
2763
3920
|
);
|
|
2764
3921
|
Menu.displayName = "Menu";
|
|
2765
|
-
var MenuTrigger =
|
|
3922
|
+
var MenuTrigger = React57.forwardRef(
|
|
2766
3923
|
({ className, children, ...props }, ref) => {
|
|
2767
|
-
const { open, setOpen } =
|
|
2768
|
-
return /* @__PURE__ */
|
|
3924
|
+
const { open, setOpen } = React57.useContext(MenuContext);
|
|
3925
|
+
return /* @__PURE__ */ jsx56(
|
|
2769
3926
|
"button",
|
|
2770
3927
|
{
|
|
2771
3928
|
ref,
|
|
@@ -2785,13 +3942,13 @@ var MenuTrigger = React42.forwardRef(
|
|
|
2785
3942
|
}
|
|
2786
3943
|
);
|
|
2787
3944
|
MenuTrigger.displayName = "MenuTrigger";
|
|
2788
|
-
var MenuContent =
|
|
3945
|
+
var MenuContent = React57.forwardRef(
|
|
2789
3946
|
({ className, children, ...props }, ref) => {
|
|
2790
|
-
const { open, setOpen, activeIndex, setActiveIndex, wrapperRef } =
|
|
2791
|
-
const contentRef =
|
|
2792
|
-
const [pos, setPos] =
|
|
2793
|
-
const itemsRef =
|
|
2794
|
-
|
|
3947
|
+
const { open, setOpen, activeIndex, setActiveIndex, wrapperRef } = React57.useContext(MenuContext);
|
|
3948
|
+
const contentRef = React57.useRef(null);
|
|
3949
|
+
const [pos, setPos] = React57.useState(null);
|
|
3950
|
+
const itemsRef = React57.useRef([]);
|
|
3951
|
+
React57.useLayoutEffect(() => {
|
|
2795
3952
|
if (!open) {
|
|
2796
3953
|
setPos(null);
|
|
2797
3954
|
return;
|
|
@@ -2811,7 +3968,7 @@ var MenuContent = React42.forwardRef(
|
|
|
2811
3968
|
window.removeEventListener("resize", measure);
|
|
2812
3969
|
};
|
|
2813
3970
|
}, [open, setOpen, wrapperRef]);
|
|
2814
|
-
|
|
3971
|
+
React57.useEffect(() => {
|
|
2815
3972
|
if (!open) return;
|
|
2816
3973
|
function onPointerDown(event) {
|
|
2817
3974
|
if (!contentRef.current?.contains(event.target)) setOpen(false);
|
|
@@ -2819,7 +3976,7 @@ var MenuContent = React42.forwardRef(
|
|
|
2819
3976
|
document.addEventListener("pointerdown", onPointerDown);
|
|
2820
3977
|
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
2821
3978
|
}, [open, setOpen]);
|
|
2822
|
-
|
|
3979
|
+
React57.useEffect(() => {
|
|
2823
3980
|
if (open && pos && contentRef.current) {
|
|
2824
3981
|
itemsRef.current = Array.from(
|
|
2825
3982
|
contentRef.current.querySelectorAll('[role="menuitem"]:not([disabled])')
|
|
@@ -2854,8 +4011,8 @@ var MenuContent = React42.forwardRef(
|
|
|
2854
4011
|
}
|
|
2855
4012
|
};
|
|
2856
4013
|
if (!open || !pos || typeof document === "undefined") return null;
|
|
2857
|
-
return
|
|
2858
|
-
/* @__PURE__ */
|
|
4014
|
+
return createPortal7(
|
|
4015
|
+
/* @__PURE__ */ jsx56(
|
|
2859
4016
|
"div",
|
|
2860
4017
|
{
|
|
2861
4018
|
ref: (node) => {
|
|
@@ -2879,14 +4036,16 @@ var MenuContent = React42.forwardRef(
|
|
|
2879
4036
|
}
|
|
2880
4037
|
);
|
|
2881
4038
|
MenuContent.displayName = "MenuContent";
|
|
2882
|
-
var MenuItem =
|
|
2883
|
-
({ className, destructive, onClick, ...props }, ref) => {
|
|
2884
|
-
const { setOpen } =
|
|
2885
|
-
|
|
2886
|
-
|
|
4039
|
+
var MenuItem = React57.forwardRef(
|
|
4040
|
+
({ className, destructive, asChild = false, onClick, ...props }, ref) => {
|
|
4041
|
+
const { setOpen } = React57.useContext(MenuContext);
|
|
4042
|
+
const Comp = asChild ? Slot4 : "button";
|
|
4043
|
+
const typeProp = asChild ? {} : { type: "button" };
|
|
4044
|
+
return /* @__PURE__ */ jsx56(
|
|
4045
|
+
Comp,
|
|
2887
4046
|
{
|
|
2888
4047
|
ref,
|
|
2889
|
-
|
|
4048
|
+
...typeProp,
|
|
2890
4049
|
role: "menuitem",
|
|
2891
4050
|
onClick: (event) => {
|
|
2892
4051
|
onClick?.(event);
|
|
@@ -2904,12 +4063,12 @@ var MenuItem = React42.forwardRef(
|
|
|
2904
4063
|
}
|
|
2905
4064
|
);
|
|
2906
4065
|
MenuItem.displayName = "MenuItem";
|
|
2907
|
-
var MenuSeparator =
|
|
2908
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4066
|
+
var MenuSeparator = React57.forwardRef(
|
|
4067
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx56("div", { ref, role: "separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props })
|
|
2909
4068
|
);
|
|
2910
4069
|
MenuSeparator.displayName = "MenuSeparator";
|
|
2911
|
-
var MenuLabel =
|
|
2912
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4070
|
+
var MenuLabel = React57.forwardRef(
|
|
4071
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx56(
|
|
2913
4072
|
"div",
|
|
2914
4073
|
{
|
|
2915
4074
|
ref,
|
|
@@ -2921,9 +4080,9 @@ var MenuLabel = React42.forwardRef(
|
|
|
2921
4080
|
MenuLabel.displayName = "MenuLabel";
|
|
2922
4081
|
|
|
2923
4082
|
// src/components/alert/Alert.tsx
|
|
2924
|
-
import * as
|
|
4083
|
+
import * as React58 from "react";
|
|
2925
4084
|
import { cva as cva6 } from "class-variance-authority";
|
|
2926
|
-
import { jsx as
|
|
4085
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2927
4086
|
var alertVariants = cva6(
|
|
2928
4087
|
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
2929
4088
|
{
|
|
@@ -2941,8 +4100,8 @@ var alertVariants = cva6(
|
|
|
2941
4100
|
}
|
|
2942
4101
|
}
|
|
2943
4102
|
);
|
|
2944
|
-
var Alert =
|
|
2945
|
-
({ className, variant, ...props }, ref) => /* @__PURE__ */
|
|
4103
|
+
var Alert = React58.forwardRef(
|
|
4104
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
2946
4105
|
"div",
|
|
2947
4106
|
{
|
|
2948
4107
|
ref,
|
|
@@ -2953,8 +4112,8 @@ var Alert = React43.forwardRef(
|
|
|
2953
4112
|
)
|
|
2954
4113
|
);
|
|
2955
4114
|
Alert.displayName = "Alert";
|
|
2956
|
-
var AlertTitle =
|
|
2957
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4115
|
+
var AlertTitle = React58.forwardRef(
|
|
4116
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
2958
4117
|
"h5",
|
|
2959
4118
|
{
|
|
2960
4119
|
ref,
|
|
@@ -2964,8 +4123,8 @@ var AlertTitle = React43.forwardRef(
|
|
|
2964
4123
|
)
|
|
2965
4124
|
);
|
|
2966
4125
|
AlertTitle.displayName = "AlertTitle";
|
|
2967
|
-
var AlertDescription =
|
|
2968
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
4126
|
+
var AlertDescription = React58.forwardRef(
|
|
4127
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
2969
4128
|
"div",
|
|
2970
4129
|
{
|
|
2971
4130
|
ref,
|
|
@@ -2977,10 +4136,10 @@ var AlertDescription = React43.forwardRef(
|
|
|
2977
4136
|
AlertDescription.displayName = "AlertDescription";
|
|
2978
4137
|
|
|
2979
4138
|
// src/components/popover/Popover.tsx
|
|
2980
|
-
import * as
|
|
2981
|
-
import { createPortal as
|
|
2982
|
-
import { jsx as
|
|
2983
|
-
var PopoverContext =
|
|
4139
|
+
import * as React59 from "react";
|
|
4140
|
+
import { createPortal as createPortal8 } from "react-dom";
|
|
4141
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
4142
|
+
var PopoverContext = React59.createContext({
|
|
2984
4143
|
open: false,
|
|
2985
4144
|
setOpen: () => {
|
|
2986
4145
|
},
|
|
@@ -2988,14 +4147,14 @@ var PopoverContext = React44.createContext({
|
|
|
2988
4147
|
contentId: "",
|
|
2989
4148
|
wrapperRef: { current: null }
|
|
2990
4149
|
});
|
|
2991
|
-
var Popover =
|
|
4150
|
+
var Popover = React59.forwardRef(
|
|
2992
4151
|
({ open, onOpenChange, className, children }, ref) => {
|
|
2993
|
-
const [internalOpen, setInternalOpen] =
|
|
4152
|
+
const [internalOpen, setInternalOpen] = React59.useState(false);
|
|
2994
4153
|
const current = open ?? internalOpen;
|
|
2995
|
-
const triggerId =
|
|
2996
|
-
const contentId =
|
|
2997
|
-
const wrapperRef =
|
|
2998
|
-
const setRefs =
|
|
4154
|
+
const triggerId = React59.useId();
|
|
4155
|
+
const contentId = React59.useId();
|
|
4156
|
+
const wrapperRef = React59.useRef(null);
|
|
4157
|
+
const setRefs = React59.useCallback(
|
|
2999
4158
|
(node) => {
|
|
3000
4159
|
wrapperRef.current = node;
|
|
3001
4160
|
if (typeof ref === "function") ref(node);
|
|
@@ -3003,14 +4162,14 @@ var Popover = React44.forwardRef(
|
|
|
3003
4162
|
},
|
|
3004
4163
|
[ref]
|
|
3005
4164
|
);
|
|
3006
|
-
const setOpen =
|
|
4165
|
+
const setOpen = React59.useCallback(
|
|
3007
4166
|
(next) => {
|
|
3008
4167
|
if (open === void 0) setInternalOpen(next);
|
|
3009
4168
|
onOpenChange?.(next);
|
|
3010
4169
|
},
|
|
3011
4170
|
[open, onOpenChange]
|
|
3012
4171
|
);
|
|
3013
|
-
return /* @__PURE__ */
|
|
4172
|
+
return /* @__PURE__ */ jsx58("div", { ref: setRefs, className: cn("relative inline-block", className), children: /* @__PURE__ */ jsx58(
|
|
3014
4173
|
PopoverContext.Provider,
|
|
3015
4174
|
{
|
|
3016
4175
|
value: { open: current, setOpen, triggerId, contentId, wrapperRef },
|
|
@@ -3020,10 +4179,10 @@ var Popover = React44.forwardRef(
|
|
|
3020
4179
|
}
|
|
3021
4180
|
);
|
|
3022
4181
|
Popover.displayName = "Popover";
|
|
3023
|
-
var PopoverTrigger =
|
|
4182
|
+
var PopoverTrigger = React59.forwardRef(
|
|
3024
4183
|
({ className, children, onClick, ...props }, ref) => {
|
|
3025
|
-
const { open, setOpen, triggerId, contentId } =
|
|
3026
|
-
return /* @__PURE__ */
|
|
4184
|
+
const { open, setOpen, triggerId, contentId } = React59.useContext(PopoverContext);
|
|
4185
|
+
return /* @__PURE__ */ jsx58(
|
|
3027
4186
|
"button",
|
|
3028
4187
|
{
|
|
3029
4188
|
ref,
|
|
@@ -3048,12 +4207,12 @@ var PopoverTrigger = React44.forwardRef(
|
|
|
3048
4207
|
}
|
|
3049
4208
|
);
|
|
3050
4209
|
PopoverTrigger.displayName = "PopoverTrigger";
|
|
3051
|
-
var PopoverContent =
|
|
4210
|
+
var PopoverContent = React59.forwardRef(
|
|
3052
4211
|
({ className, children, onKeyDown, ...props }, ref) => {
|
|
3053
|
-
const { open, setOpen, triggerId, contentId, wrapperRef } =
|
|
3054
|
-
const contentRef =
|
|
3055
|
-
const [pos, setPos] =
|
|
3056
|
-
|
|
4212
|
+
const { open, setOpen, triggerId, contentId, wrapperRef } = React59.useContext(PopoverContext);
|
|
4213
|
+
const contentRef = React59.useRef(null);
|
|
4214
|
+
const [pos, setPos] = React59.useState(null);
|
|
4215
|
+
React59.useLayoutEffect(() => {
|
|
3057
4216
|
if (!open) {
|
|
3058
4217
|
setPos(null);
|
|
3059
4218
|
return;
|
|
@@ -3073,7 +4232,7 @@ var PopoverContent = React44.forwardRef(
|
|
|
3073
4232
|
window.removeEventListener("resize", measure);
|
|
3074
4233
|
};
|
|
3075
4234
|
}, [open, setOpen, wrapperRef]);
|
|
3076
|
-
|
|
4235
|
+
React59.useEffect(() => {
|
|
3077
4236
|
if (!open) return;
|
|
3078
4237
|
function onPointerDown(event) {
|
|
3079
4238
|
if (!contentRef.current?.contains(event.target)) setOpen(false);
|
|
@@ -3081,14 +4240,14 @@ var PopoverContent = React44.forwardRef(
|
|
|
3081
4240
|
document.addEventListener("pointerdown", onPointerDown);
|
|
3082
4241
|
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
3083
4242
|
}, [open, setOpen]);
|
|
3084
|
-
|
|
4243
|
+
React59.useEffect(() => {
|
|
3085
4244
|
if (open && pos && contentRef.current) {
|
|
3086
4245
|
contentRef.current.focus();
|
|
3087
4246
|
}
|
|
3088
4247
|
}, [open, pos]);
|
|
3089
4248
|
if (!open || !pos || typeof document === "undefined") return null;
|
|
3090
|
-
return
|
|
3091
|
-
/* @__PURE__ */
|
|
4249
|
+
return createPortal8(
|
|
4250
|
+
/* @__PURE__ */ jsx58(
|
|
3092
4251
|
"div",
|
|
3093
4252
|
{
|
|
3094
4253
|
ref: (node) => {
|
|
@@ -3123,21 +4282,21 @@ var PopoverContent = React44.forwardRef(
|
|
|
3123
4282
|
PopoverContent.displayName = "PopoverContent";
|
|
3124
4283
|
|
|
3125
4284
|
// src/components/breadcrumb/Breadcrumb.tsx
|
|
3126
|
-
import * as
|
|
3127
|
-
import { jsx as
|
|
3128
|
-
var Breadcrumb =
|
|
3129
|
-
({ items, separator = "/", onItemClick, className, ...props }, ref) => /* @__PURE__ */
|
|
4285
|
+
import * as React60 from "react";
|
|
4286
|
+
import { jsx as jsx59, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4287
|
+
var Breadcrumb = React60.forwardRef(
|
|
4288
|
+
({ items, separator = "/", onItemClick, className, ...props }, ref) => /* @__PURE__ */ jsx59(
|
|
3130
4289
|
"nav",
|
|
3131
4290
|
{
|
|
3132
4291
|
ref,
|
|
3133
4292
|
"aria-label": "Breadcrumb",
|
|
3134
4293
|
className: cn("flex items-center space-x-1.5 text-sm text-muted-foreground", className),
|
|
3135
4294
|
...props,
|
|
3136
|
-
children: /* @__PURE__ */
|
|
4295
|
+
children: /* @__PURE__ */ jsx59("ol", { className: "flex flex-wrap items-center space-x-1.5", children: items.map((item, index) => {
|
|
3137
4296
|
const isLast = index === items.length - 1;
|
|
3138
|
-
return /* @__PURE__ */
|
|
3139
|
-
index > 0 && /* @__PURE__ */
|
|
3140
|
-
item.href && !isLast ? /* @__PURE__ */
|
|
4297
|
+
return /* @__PURE__ */ jsxs33("li", { className: "flex items-center space-x-1.5", children: [
|
|
4298
|
+
index > 0 && /* @__PURE__ */ jsx59("span", { "aria-hidden": "true", className: "text-muted-foreground/50", children: separator }),
|
|
4299
|
+
item.href && !isLast ? /* @__PURE__ */ jsx59(
|
|
3141
4300
|
"a",
|
|
3142
4301
|
{
|
|
3143
4302
|
href: item.href,
|
|
@@ -3148,7 +4307,7 @@ var Breadcrumb = React45.forwardRef(
|
|
|
3148
4307
|
} : void 0,
|
|
3149
4308
|
children: item.label
|
|
3150
4309
|
}
|
|
3151
|
-
) : /* @__PURE__ */
|
|
4310
|
+
) : /* @__PURE__ */ jsx59(
|
|
3152
4311
|
"span",
|
|
3153
4312
|
{
|
|
3154
4313
|
"aria-current": isLast ? "page" : void 0,
|
|
@@ -3170,6 +4329,8 @@ export {
|
|
|
3170
4329
|
Alert,
|
|
3171
4330
|
AlertDescription,
|
|
3172
4331
|
AlertTitle,
|
|
4332
|
+
AppShell,
|
|
4333
|
+
AuthLayout,
|
|
3173
4334
|
Autocomplete,
|
|
3174
4335
|
Avatar,
|
|
3175
4336
|
AvatarFallback,
|
|
@@ -3189,10 +4350,19 @@ export {
|
|
|
3189
4350
|
CheckboxGroup,
|
|
3190
4351
|
CheckboxGroupItem,
|
|
3191
4352
|
DataTable,
|
|
4353
|
+
DatePicker,
|
|
3192
4354
|
Dialog,
|
|
4355
|
+
DialogBody,
|
|
4356
|
+
DialogDescription,
|
|
4357
|
+
DialogFooter,
|
|
4358
|
+
DialogHeader,
|
|
4359
|
+
DialogTitle,
|
|
3193
4360
|
Divider,
|
|
3194
4361
|
Drawer,
|
|
4362
|
+
EmptyState,
|
|
3195
4363
|
Fieldset,
|
|
4364
|
+
FileUpload,
|
|
4365
|
+
FilterBar,
|
|
3196
4366
|
Flex,
|
|
3197
4367
|
FlexItem,
|
|
3198
4368
|
Form,
|
|
@@ -3213,7 +4383,10 @@ export {
|
|
|
3213
4383
|
MenuLabel,
|
|
3214
4384
|
MenuSeparator,
|
|
3215
4385
|
MenuTrigger,
|
|
4386
|
+
MetricCard,
|
|
4387
|
+
PageHeader,
|
|
3216
4388
|
Pagination,
|
|
4389
|
+
PasswordInput,
|
|
3217
4390
|
Popover,
|
|
3218
4391
|
PopoverContent,
|
|
3219
4392
|
PopoverTrigger,
|
|
@@ -3225,13 +4398,17 @@ export {
|
|
|
3225
4398
|
RadioGroupItem,
|
|
3226
4399
|
Search,
|
|
3227
4400
|
Select,
|
|
4401
|
+
SelectMenu,
|
|
3228
4402
|
Separator,
|
|
4403
|
+
Sidebar,
|
|
3229
4404
|
Skeleton,
|
|
3230
4405
|
Spinner,
|
|
4406
|
+
Stepper,
|
|
3231
4407
|
Switch,
|
|
3232
4408
|
Table,
|
|
3233
4409
|
TableBody,
|
|
3234
4410
|
TableCaption,
|
|
4411
|
+
TableCard,
|
|
3235
4412
|
TableCell,
|
|
3236
4413
|
TableFooter,
|
|
3237
4414
|
TableHead,
|
|
@@ -3243,7 +4420,10 @@ export {
|
|
|
3243
4420
|
TabsTrigger,
|
|
3244
4421
|
Text,
|
|
3245
4422
|
Textarea,
|
|
4423
|
+
TimePicker,
|
|
4424
|
+
Timeline,
|
|
3246
4425
|
ToastProvider,
|
|
4426
|
+
Toaster,
|
|
3247
4427
|
Tooltip,
|
|
3248
4428
|
alertVariants,
|
|
3249
4429
|
badgeVariants,
|
|
@@ -3253,6 +4433,7 @@ export {
|
|
|
3253
4433
|
resolveGap,
|
|
3254
4434
|
separatorVariants,
|
|
3255
4435
|
spinnerVariants,
|
|
4436
|
+
toast,
|
|
3256
4437
|
useCombobox,
|
|
3257
4438
|
usePresence,
|
|
3258
4439
|
useToast
|