@2urgseui/core 0.1.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/README.MD +221 -0
- package/dist/chunk-VGPGVDCW.js +317 -0
- package/dist/index.cjs +5478 -0
- package/dist/index.d.cts +879 -0
- package/dist/index.d.ts +879 -0
- package/dist/index.js +4936 -0
- package/dist/styles.css +1 -0
- package/dist/tokens/index.cjs +350 -0
- package/dist/tokens/index.d.cts +315 -0
- package/dist/tokens/index.d.ts +315 -0
- package/dist/tokens/index.js +20 -0
- package/package.json +129 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4936 @@
|
|
|
1
|
+
import {
|
|
2
|
+
borderRadius,
|
|
3
|
+
boxShadow,
|
|
4
|
+
breakpoints,
|
|
5
|
+
colors,
|
|
6
|
+
spacing,
|
|
7
|
+
transitionDuration,
|
|
8
|
+
transitionTimingFunction,
|
|
9
|
+
typography
|
|
10
|
+
} from "./chunk-VGPGVDCW.js";
|
|
11
|
+
|
|
12
|
+
// source/components/primitive/Alert/alert.tsx
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { cva } from "class-variance-authority";
|
|
15
|
+
|
|
16
|
+
// source/utils/cn.ts
|
|
17
|
+
import { clsx } from "clsx";
|
|
18
|
+
import { twMerge } from "tailwind-merge";
|
|
19
|
+
function cn(...inputs) {
|
|
20
|
+
return twMerge(clsx(inputs));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// source/components/primitive/Alert/alert.tsx
|
|
24
|
+
import { jsx } from "react/jsx-runtime";
|
|
25
|
+
var alertVariants = cva(
|
|
26
|
+
"relative w-full rounded-lg border p-4 text-sm",
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
default: "bg-background text-foreground border-border",
|
|
31
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive",
|
|
32
|
+
success: "border-green-500/50 text-green-600 dark:border-green-500",
|
|
33
|
+
warning: "border-yellow-500/50 text-yellow-600 dark:border-yellow-500"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: "default"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
var Alert = React.forwardRef(
|
|
42
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
ref,
|
|
46
|
+
role: "alert",
|
|
47
|
+
"data-slot": "alert",
|
|
48
|
+
className: cn(alertVariants({ variant }), className),
|
|
49
|
+
...props
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
Alert.displayName = "Alert";
|
|
54
|
+
var AlertTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
55
|
+
"h5",
|
|
56
|
+
{
|
|
57
|
+
ref,
|
|
58
|
+
"data-slot": "alert-title",
|
|
59
|
+
className: cn(
|
|
60
|
+
"mb-1 font-medium leading-none tracking-tight",
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
...props
|
|
64
|
+
}
|
|
65
|
+
));
|
|
66
|
+
AlertTitle.displayName = "AlertTitle";
|
|
67
|
+
var AlertDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
ref,
|
|
71
|
+
"data-slot": "alert-description",
|
|
72
|
+
className: cn("text-sm leading-relaxed", className),
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
));
|
|
76
|
+
AlertDescription.displayName = "AlertDescription";
|
|
77
|
+
|
|
78
|
+
// source/components/primitive/AlertDialog/alert-dialog.tsx
|
|
79
|
+
import * as React3 from "react";
|
|
80
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
81
|
+
|
|
82
|
+
// source/components/primitive/Button/button.tsx
|
|
83
|
+
import * as React2 from "react";
|
|
84
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
85
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
86
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
87
|
+
var buttonVariants = cva2(
|
|
88
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all outline-none shrink-0 disabled:pointer-events-none disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
89
|
+
{
|
|
90
|
+
variants: {
|
|
91
|
+
variant: {
|
|
92
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
93
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90",
|
|
94
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
95
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
96
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
97
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
98
|
+
// ── Glassmorphic ──────────────────────────────────────────
|
|
99
|
+
// Semi-transparent fill + backdrop blur so the gradient behind
|
|
100
|
+
// the AppShell (or any coloured container) bleeds through.
|
|
101
|
+
// Border and inner highlight simulate a frosted glass edge.
|
|
102
|
+
// Active state darkens the fill; focus uses the token ring.
|
|
103
|
+
glass: [
|
|
104
|
+
"relative overflow-hidden",
|
|
105
|
+
"bg-primary/75 dark:bg-primary/20",
|
|
106
|
+
"border border-white/30 dark:border-white/15",
|
|
107
|
+
"text-secondary",
|
|
108
|
+
"backdrop-blur-md backdrop-saturate-150",
|
|
109
|
+
"shadow-glass dark:shadow-glass-dark",
|
|
110
|
+
// Inner top-edge highlight — the "rim" of the glass
|
|
111
|
+
"before:pointer-events-none before:absolute before:inset-x-0 before:top-0",
|
|
112
|
+
"before:h-px before:bg-gradient-to-r before:from-transparent before:via-white/50 before:to-transparent",
|
|
113
|
+
"hover:bg-primary dark:hover:bg-primary/20",
|
|
114
|
+
"hover:border-white/50 dark:hover:border-white/25",
|
|
115
|
+
"hover:shadow-md",
|
|
116
|
+
"active:bg-brand-600 dark:active:bg-brand-600/45",
|
|
117
|
+
"active:scale-[0.98]"
|
|
118
|
+
].join(" ")
|
|
119
|
+
},
|
|
120
|
+
size: {
|
|
121
|
+
xs: "h-7 px-2 text-xs gap-1 has-[>svg]:px-2",
|
|
122
|
+
sm: "h-8 px-3 gap-1.5 has-[>svg]:px-2.5",
|
|
123
|
+
default: "h-9 px-4 gap-2 has-[>svg]:px-3",
|
|
124
|
+
lg: "h-10 px-6 gap-2 has-[>svg]:px-4",
|
|
125
|
+
icon: "h-9 w-9"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
defaultVariants: {
|
|
129
|
+
variant: "default",
|
|
130
|
+
size: "default"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
function ButtonSpinner() {
|
|
135
|
+
return /* @__PURE__ */ jsx2(
|
|
136
|
+
"span",
|
|
137
|
+
{
|
|
138
|
+
className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent",
|
|
139
|
+
"aria-hidden": "true"
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
var Button = React2.forwardRef(
|
|
144
|
+
({
|
|
145
|
+
className,
|
|
146
|
+
variant,
|
|
147
|
+
size,
|
|
148
|
+
asChild = false,
|
|
149
|
+
isLoading = false,
|
|
150
|
+
disabled,
|
|
151
|
+
children,
|
|
152
|
+
...props
|
|
153
|
+
}, ref) => {
|
|
154
|
+
const Comp = asChild ? Slot : "button";
|
|
155
|
+
const isDisabled = disabled || isLoading;
|
|
156
|
+
return /* @__PURE__ */ jsx2(
|
|
157
|
+
Comp,
|
|
158
|
+
{
|
|
159
|
+
ref,
|
|
160
|
+
"data-slot": "button",
|
|
161
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
162
|
+
disabled: isDisabled,
|
|
163
|
+
"aria-busy": isLoading || void 0,
|
|
164
|
+
...props,
|
|
165
|
+
children: isLoading ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
166
|
+
/* @__PURE__ */ jsx2(ButtonSpinner, {}),
|
|
167
|
+
/* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Loading" })
|
|
168
|
+
] }) : children
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
Button.displayName = "Button";
|
|
174
|
+
|
|
175
|
+
// source/components/primitive/AlertDialog/alert-dialog.tsx
|
|
176
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
177
|
+
var AlertDialog = AlertDialogPrimitive.Root;
|
|
178
|
+
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
179
|
+
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
180
|
+
var AlertDialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
181
|
+
AlertDialogPrimitive.Overlay,
|
|
182
|
+
{
|
|
183
|
+
className: cn(
|
|
184
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
185
|
+
className
|
|
186
|
+
),
|
|
187
|
+
...props,
|
|
188
|
+
ref
|
|
189
|
+
}
|
|
190
|
+
));
|
|
191
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
192
|
+
var AlertDialogContent = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs2(AlertDialogPortal, { children: [
|
|
193
|
+
/* @__PURE__ */ jsx3(AlertDialogOverlay, {}),
|
|
194
|
+
/* @__PURE__ */ jsx3(
|
|
195
|
+
AlertDialogPrimitive.Content,
|
|
196
|
+
{
|
|
197
|
+
ref,
|
|
198
|
+
className: cn(
|
|
199
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
200
|
+
className
|
|
201
|
+
),
|
|
202
|
+
...props
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
] }));
|
|
206
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
207
|
+
var AlertDialogHeader = ({
|
|
208
|
+
className,
|
|
209
|
+
...props
|
|
210
|
+
}) => /* @__PURE__ */ jsx3(
|
|
211
|
+
"div",
|
|
212
|
+
{
|
|
213
|
+
className: cn(
|
|
214
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
215
|
+
className
|
|
216
|
+
),
|
|
217
|
+
...props
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
221
|
+
var AlertDialogFooter = ({
|
|
222
|
+
className,
|
|
223
|
+
...props
|
|
224
|
+
}) => /* @__PURE__ */ jsx3(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
className: cn(
|
|
228
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
229
|
+
className
|
|
230
|
+
),
|
|
231
|
+
...props
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
235
|
+
var AlertDialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
236
|
+
AlertDialogPrimitive.Title,
|
|
237
|
+
{
|
|
238
|
+
ref,
|
|
239
|
+
className: cn("text-lg font-semibold", className),
|
|
240
|
+
...props
|
|
241
|
+
}
|
|
242
|
+
));
|
|
243
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
244
|
+
var AlertDialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
245
|
+
AlertDialogPrimitive.Description,
|
|
246
|
+
{
|
|
247
|
+
ref,
|
|
248
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
249
|
+
...props
|
|
250
|
+
}
|
|
251
|
+
));
|
|
252
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
253
|
+
var AlertDialogAction = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
254
|
+
AlertDialogPrimitive.Action,
|
|
255
|
+
{
|
|
256
|
+
ref,
|
|
257
|
+
className: cn(buttonVariants(), className),
|
|
258
|
+
...props
|
|
259
|
+
}
|
|
260
|
+
));
|
|
261
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
262
|
+
var AlertDialogCancel = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
263
|
+
AlertDialogPrimitive.Cancel,
|
|
264
|
+
{
|
|
265
|
+
ref,
|
|
266
|
+
className: cn(
|
|
267
|
+
buttonVariants({ variant: "outline" }),
|
|
268
|
+
"mt-2 sm:mt-0",
|
|
269
|
+
className
|
|
270
|
+
),
|
|
271
|
+
...props
|
|
272
|
+
}
|
|
273
|
+
));
|
|
274
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
275
|
+
|
|
276
|
+
// source/components/primitive/Accordion/accordion.tsx
|
|
277
|
+
import * as React4 from "react";
|
|
278
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
279
|
+
import { ChevronDown } from "lucide-react";
|
|
280
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
281
|
+
var Accordion = AccordionPrimitive.Root;
|
|
282
|
+
var AccordionItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
283
|
+
AccordionPrimitive.Item,
|
|
284
|
+
{
|
|
285
|
+
ref,
|
|
286
|
+
className: cn("border-b", className),
|
|
287
|
+
...props
|
|
288
|
+
}
|
|
289
|
+
));
|
|
290
|
+
AccordionItem.displayName = "AccordionItem";
|
|
291
|
+
var AccordionTrigger = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx4(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs3(
|
|
292
|
+
AccordionPrimitive.Trigger,
|
|
293
|
+
{
|
|
294
|
+
ref,
|
|
295
|
+
className: cn(
|
|
296
|
+
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
297
|
+
className
|
|
298
|
+
),
|
|
299
|
+
...props,
|
|
300
|
+
children: [
|
|
301
|
+
children,
|
|
302
|
+
/* @__PURE__ */ jsx4(ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
) }));
|
|
306
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
307
|
+
var AccordionContent = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
308
|
+
AccordionPrimitive.Content,
|
|
309
|
+
{
|
|
310
|
+
ref,
|
|
311
|
+
className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
312
|
+
...props,
|
|
313
|
+
children: /* @__PURE__ */ jsx4("div", { className: cn("pb-4 pt-0", className), children })
|
|
314
|
+
}
|
|
315
|
+
));
|
|
316
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
317
|
+
|
|
318
|
+
// source/components/primitive/AsyncSelect/async-select.tsx
|
|
319
|
+
import * as React6 from "react";
|
|
320
|
+
import { Check, ChevronDown as ChevronDown2, Loader2, Search } from "lucide-react";
|
|
321
|
+
|
|
322
|
+
// source/utils/input-surface.ts
|
|
323
|
+
var motion = "transition-[border-color,box-shadow,background-color,backdrop-filter] duration-200 ease-out motion-reduce:transition-none ";
|
|
324
|
+
var inverseShadowField = "shadow-[inset_0_2px_8px_rgb(0_0_0/0.06),inset_0_-1px_0_rgb(255_255_255/0.55)] dark:shadow-[inset_0_2px_10px_rgb(0_0_0/0.28),inset_0_-1px_0_rgb(255_255_255/0.06)] ";
|
|
325
|
+
var inverseShadowFieldFocus = "focus-visible:shadow-[inset_0_2px_10px_rgb(0_0_0/0.07),inset_0_-1px_0_rgb(255_255_255/0.58),0_0_0_1px_hsl(var(--primary)/0.2)] dark:focus-visible:shadow-[inset_0_2px_12px_rgb(0_0_0/0.38),inset_0_-1px_0_rgb(255_255_255/0.08),0_0_0_1px_hsl(var(--primary)/0.28)] ";
|
|
326
|
+
var inverseShadowContainerFocus = "focus-within:shadow-[inset_0_2px_10px_rgb(0_0_0/0.07),inset_0_-1px_0_rgb(255_255_255/0.58),0_0_0_1px_hsl(var(--primary)/0.2)] dark:focus-within:shadow-[inset_0_2px_12px_rgb(0_0_0/0.38),inset_0_-1px_0_rgb(255_255_255/0.08),0_0_0_1px_hsl(var(--primary)/0.28)] ";
|
|
327
|
+
var inputSurfaceShell = "rounded-xl border border-slate-200/95 dark:border-zinc-600/45 bg-slate-100/92 dark:bg-zinc-900/55 text-slate-800 dark:text-slate-100 backdrop-blur-md backdrop-saturate-125 ";
|
|
328
|
+
var inputSurfacePlaceholders = "placeholder:text-slate-500 dark:placeholder:text-slate-400 [&_[data-placeholder]]:text-slate-500 dark:[&_[data-placeholder]]:text-slate-400 ";
|
|
329
|
+
var inputSurfaceField = inputSurfaceShell + inverseShadowField + motion + inputSurfacePlaceholders + "hover:ring-2 hover:ring-primary/25 hover:ring-offset-0 active:border-primary dark:active:border-primary focus-visible:outline-none focus-visible:border-primary dark:focus-visible:border-primary " + inverseShadowFieldFocus + "focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-0 data-[state=open]:border-primary dark:data-[state=open]:border-primary";
|
|
330
|
+
var inputSurfaceContainer = inputSurfaceShell + inverseShadowField + motion + "hover:ring-2 hover:ring-primary/25 hover:ring-offset-0 focus-within:outline-none focus-within:border-primary dark:focus-within:border-primary " + inverseShadowContainerFocus + "focus-within:ring-2 focus-within:ring-primary/30 focus-within:ring-offset-0";
|
|
331
|
+
var inputSurfaceFieldDisabled = "disabled:cursor-not-allowed disabled:opacity-[0.38] disabled:backdrop-blur-sm disabled:shadow-none disabled:ring-0 disabled:border-slate-200/60 dark:disabled:border-zinc-700/40";
|
|
332
|
+
var inputSurfaceContainerDisabled = "has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-[0.38] has-[:disabled]:backdrop-blur-sm has-[:disabled]:shadow-none has-[:disabled]:ring-0 has-[:disabled]:border-slate-200/60 dark:has-[:disabled]:border-zinc-700/40";
|
|
333
|
+
var inputSurfaceFieldInvalid = "border-rose-400/60 dark:border-rose-400/40 bg-rose-50/55 dark:bg-rose-950/30 text-slate-800 dark:text-slate-100 shadow-[inset_0_2px_8px_rgb(244_63_94/0.08),inset_0_-1px_0_rgb(255_255_255/0.45)] dark:shadow-[inset_0_2px_10px_rgb(0_0_0/0.35),inset_0_-1px_0_rgb(255_255_255/0.05)] hover:ring-rose-500/25 dark:hover:ring-rose-400/22 focus-visible:border-rose-500 dark:focus-visible:border-rose-400 focus-visible:ring-rose-500/25 dark:focus-visible:ring-rose-400/25";
|
|
334
|
+
var inputSurfaceContainerInvalid = "border-rose-400/60 dark:border-rose-400/40 bg-rose-50/55 dark:bg-rose-950/30 text-slate-800 dark:text-slate-100 shadow-[inset_0_2px_8px_rgb(244_63_94/0.08),inset_0_-1px_0_rgb(255_255_255/0.45)] dark:shadow-[inset_0_2px_10px_rgb(0_0_0/0.35),inset_0_-1px_0_rgb(255_255_255/0.05)] hover:ring-rose-500/25 dark:hover:ring-rose-400/22 focus-within:border-rose-500 dark:focus-within:border-rose-400 focus-within:ring-2 focus-within:ring-rose-500/25 dark:focus-within:ring-rose-400/25 focus-within:ring-offset-0";
|
|
335
|
+
var inputSurfaceDashed = "rounded-xl border-2 border-dashed border-slate-300/90 dark:border-zinc-600/45 bg-slate-100/75 dark:bg-zinc-900/40 backdrop-blur-md backdrop-saturate-125 shadow-[inset_0_2px_8px_rgb(0_0_0/0.05),inset_0_-1px_0_rgb(255_255_255/0.45)] dark:shadow-[inset_0_2px_10px_rgb(0_0_0/0.26),inset_0_-1px_0_rgb(255_255_255/0.05)] " + motion + "text-slate-600 dark:text-slate-300 hover:border-slate-400/90 dark:hover:border-zinc-500/55 hover:ring-2 hover:ring-primary/20 hover:ring-offset-0 focus-visible:outline-none focus-visible:border-primary dark:focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/25 focus-visible:ring-offset-0";
|
|
336
|
+
var inputSurfaceDashedDragOver = "border-primary/65 dark:border-primary/50 bg-primary/10 dark:bg-primary/14 ring-2 ring-primary/25 ring-offset-0 shadow-[inset_0_2px_8px_rgb(0_0_0/0.05),0_0_0_1px_hsl(var(--primary)/0.22)]";
|
|
337
|
+
var inputSurfaceOtpSlot = "rounded-xl border border-slate-200/95 dark:border-zinc-600/45 bg-slate-100/92 dark:bg-zinc-900/55 text-slate-800 dark:text-slate-100 backdrop-blur-md backdrop-saturate-125 " + inverseShadowField + motion + "focus-visible:outline-none ";
|
|
338
|
+
var inputOtpContainerInvalid = "[&_[data-slot=input-otp-slot]]:border-rose-400/60 [&_[data-slot=input-otp-slot]]:dark:border-rose-400/40 [&_[data-slot=input-otp-slot]]:bg-rose-50/55 [&_[data-slot=input-otp-slot]]:dark:bg-rose-950/30 [&_[data-slot=input-otp-slot]]:shadow-[inset_0_2px_6px_rgb(244_63_94/0.1),inset_0_-1px_0_rgb(255_255_255/0.4)] [&_[data-slot=input-otp-slot]]:dark:shadow-[inset_0_2px_8px_rgb(0_0_0/0.35),inset_0_-1px_0_rgb(255_255_255/0.05)]";
|
|
339
|
+
|
|
340
|
+
// source/components/primitive/Popover/popover.tsx
|
|
341
|
+
import * as React5 from "react";
|
|
342
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
343
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
344
|
+
var Popover = PopoverPrimitive.Root;
|
|
345
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
346
|
+
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
347
|
+
var animationClasses = "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
|
|
348
|
+
var PopoverContent = React5.forwardRef(
|
|
349
|
+
({
|
|
350
|
+
className,
|
|
351
|
+
align = "center",
|
|
352
|
+
side = "bottom",
|
|
353
|
+
sideOffset = 4,
|
|
354
|
+
collisionPadding = 8,
|
|
355
|
+
showArrow = false,
|
|
356
|
+
children,
|
|
357
|
+
...props
|
|
358
|
+
}, ref) => /* @__PURE__ */ jsx5(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsxs4(
|
|
359
|
+
PopoverPrimitive.Content,
|
|
360
|
+
{
|
|
361
|
+
ref,
|
|
362
|
+
align,
|
|
363
|
+
side,
|
|
364
|
+
sideOffset,
|
|
365
|
+
collisionPadding,
|
|
366
|
+
className: cn(
|
|
367
|
+
"z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none origin-[--radix-popover-content-transform-origin]",
|
|
368
|
+
animationClasses,
|
|
369
|
+
className
|
|
370
|
+
),
|
|
371
|
+
...props,
|
|
372
|
+
children: [
|
|
373
|
+
children,
|
|
374
|
+
showArrow && /* @__PURE__ */ jsx5(PopoverPrimitive.Arrow, { className: "fill-popover" })
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
) })
|
|
378
|
+
);
|
|
379
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
380
|
+
|
|
381
|
+
// source/components/primitive/AsyncSelect/async-select.tsx
|
|
382
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
383
|
+
function getByPath(obj, path) {
|
|
384
|
+
return path.split(".").reduce((acc, key) => {
|
|
385
|
+
if (acc != null && typeof acc === "object") return acc[key];
|
|
386
|
+
return void 0;
|
|
387
|
+
}, obj);
|
|
388
|
+
}
|
|
389
|
+
var defaultFetcher = async ({ url, search, page }) => {
|
|
390
|
+
const sep = url.includes("?") ? "&" : "?";
|
|
391
|
+
const res = await fetch(
|
|
392
|
+
`${url}${sep}search=${encodeURIComponent(search)}&page=${encodeURIComponent(page)}`
|
|
393
|
+
);
|
|
394
|
+
if (!res.ok) throw new Error(`AsyncSelect fetch failed: ${res.status}`);
|
|
395
|
+
return res.json();
|
|
396
|
+
};
|
|
397
|
+
function resolveLabel(item, labelKey) {
|
|
398
|
+
if (typeof labelKey === "function") return labelKey(item);
|
|
399
|
+
return String(item[labelKey] ?? "");
|
|
400
|
+
}
|
|
401
|
+
function AsyncSelectInner(props) {
|
|
402
|
+
const {
|
|
403
|
+
url,
|
|
404
|
+
valueKey,
|
|
405
|
+
labelKey,
|
|
406
|
+
value,
|
|
407
|
+
onValueChange,
|
|
408
|
+
placeholder = "Select\u2026",
|
|
409
|
+
searchPlaceholder = "Search\u2026",
|
|
410
|
+
debounce: debounceMs = 300,
|
|
411
|
+
searchable = true,
|
|
412
|
+
clearable = true,
|
|
413
|
+
disabled = false,
|
|
414
|
+
error = false,
|
|
415
|
+
name,
|
|
416
|
+
className,
|
|
417
|
+
fetcher,
|
|
418
|
+
dataPath = "data",
|
|
419
|
+
hasMorePath = "hasMore",
|
|
420
|
+
pageSize = 20,
|
|
421
|
+
innerRef
|
|
422
|
+
} = props;
|
|
423
|
+
const [open, setOpen] = React6.useState(false);
|
|
424
|
+
const [search, setSearch] = React6.useState("");
|
|
425
|
+
const [debouncedSearch, setDebouncedSearch] = React6.useState("");
|
|
426
|
+
const [page, setPage] = React6.useState(1);
|
|
427
|
+
const [items, setItems] = React6.useState([]);
|
|
428
|
+
const [hasMore, setHasMore] = React6.useState(false);
|
|
429
|
+
const [loading, setLoading] = React6.useState(false);
|
|
430
|
+
const [loadingMore, setLoadingMore] = React6.useState(false);
|
|
431
|
+
const [fetchError, setFetchError] = React6.useState(null);
|
|
432
|
+
const [selectedItem, setSelectedItem] = React6.useState(null);
|
|
433
|
+
const sentinelRef = React6.useRef(null);
|
|
434
|
+
const searchInputRef = React6.useRef(null);
|
|
435
|
+
const abortRef = React6.useRef(null);
|
|
436
|
+
React6.useEffect(() => {
|
|
437
|
+
const id = setTimeout(() => setDebouncedSearch(search), debounceMs);
|
|
438
|
+
return () => clearTimeout(id);
|
|
439
|
+
}, [search, debounceMs]);
|
|
440
|
+
React6.useEffect(() => {
|
|
441
|
+
setPage(1);
|
|
442
|
+
setItems([]);
|
|
443
|
+
setHasMore(false);
|
|
444
|
+
}, [debouncedSearch, url]);
|
|
445
|
+
const fetchPage = React6.useCallback(
|
|
446
|
+
async (pageNum, searchTerm, append) => {
|
|
447
|
+
abortRef.current?.abort();
|
|
448
|
+
const controller = new AbortController();
|
|
449
|
+
abortRef.current = controller;
|
|
450
|
+
if (append) setLoadingMore(true);
|
|
451
|
+
else setLoading(true);
|
|
452
|
+
setFetchError(null);
|
|
453
|
+
try {
|
|
454
|
+
const doFetch = fetcher ?? defaultFetcher;
|
|
455
|
+
const result = await doFetch({ url, search: searchTerm, page: pageNum });
|
|
456
|
+
if (controller.signal.aborted) return;
|
|
457
|
+
const rawData = getByPath(result, dataPath);
|
|
458
|
+
const newItems = Array.isArray(rawData) ? rawData : [];
|
|
459
|
+
const rawHasMore = getByPath(result, hasMorePath);
|
|
460
|
+
let more;
|
|
461
|
+
if (typeof rawHasMore === "boolean") {
|
|
462
|
+
more = rawHasMore;
|
|
463
|
+
} else if (typeof rawHasMore === "number") {
|
|
464
|
+
const total = rawHasMore;
|
|
465
|
+
const loaded = (append ? items.length : 0) + newItems.length;
|
|
466
|
+
more = loaded < total;
|
|
467
|
+
} else {
|
|
468
|
+
more = newItems.length >= pageSize;
|
|
469
|
+
}
|
|
470
|
+
setItems((prev) => append ? [...prev, ...newItems] : newItems);
|
|
471
|
+
setHasMore(more);
|
|
472
|
+
} catch (err) {
|
|
473
|
+
if (controller.signal.aborted) return;
|
|
474
|
+
setFetchError(err instanceof Error ? err.message : "Fetch failed");
|
|
475
|
+
} finally {
|
|
476
|
+
if (!controller.signal.aborted) {
|
|
477
|
+
setLoading(false);
|
|
478
|
+
setLoadingMore(false);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
483
|
+
[url, fetcher, dataPath, hasMorePath, pageSize]
|
|
484
|
+
);
|
|
485
|
+
React6.useEffect(() => {
|
|
486
|
+
if (!open) return;
|
|
487
|
+
fetchPage(page, debouncedSearch, page > 1);
|
|
488
|
+
}, [open, page, debouncedSearch, fetchPage]);
|
|
489
|
+
React6.useEffect(() => {
|
|
490
|
+
const el = sentinelRef.current;
|
|
491
|
+
if (!el || !open) return;
|
|
492
|
+
const observer = new IntersectionObserver(
|
|
493
|
+
(entries) => {
|
|
494
|
+
if (entries[0]?.isIntersecting && hasMore && !loading && !loadingMore) {
|
|
495
|
+
setPage((p) => p + 1);
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
{ threshold: 0.1 }
|
|
499
|
+
);
|
|
500
|
+
observer.observe(el);
|
|
501
|
+
return () => observer.disconnect();
|
|
502
|
+
}, [open, hasMore, loading, loadingMore]);
|
|
503
|
+
React6.useEffect(() => {
|
|
504
|
+
if (open) {
|
|
505
|
+
setTimeout(() => searchInputRef.current?.focus(), 0);
|
|
506
|
+
} else {
|
|
507
|
+
setSearch("");
|
|
508
|
+
setDebouncedSearch("");
|
|
509
|
+
}
|
|
510
|
+
}, [open]);
|
|
511
|
+
React6.useEffect(() => {
|
|
512
|
+
if (!value) {
|
|
513
|
+
setSelectedItem(null);
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
const found = items.find(
|
|
517
|
+
(it) => String(it[valueKey]) === value
|
|
518
|
+
);
|
|
519
|
+
if (found) setSelectedItem(found);
|
|
520
|
+
}, [value, items, valueKey]);
|
|
521
|
+
const handleSelect = (item) => {
|
|
522
|
+
const itemValue = String(item[valueKey]);
|
|
523
|
+
if (itemValue === value && clearable) {
|
|
524
|
+
onValueChange?.("");
|
|
525
|
+
setSelectedItem(null);
|
|
526
|
+
} else {
|
|
527
|
+
onValueChange?.(itemValue);
|
|
528
|
+
setSelectedItem(item);
|
|
529
|
+
}
|
|
530
|
+
setOpen(false);
|
|
531
|
+
};
|
|
532
|
+
const handleClear = (e) => {
|
|
533
|
+
e.stopPropagation();
|
|
534
|
+
onValueChange?.("");
|
|
535
|
+
setSelectedItem(null);
|
|
536
|
+
};
|
|
537
|
+
const triggerLabel = selectedItem ? resolveLabel(selectedItem, labelKey) : null;
|
|
538
|
+
return /* @__PURE__ */ jsxs5(Popover, { open, onOpenChange: setOpen, children: [
|
|
539
|
+
name && /* @__PURE__ */ jsx6("input", { type: "hidden", name, value: value ?? "" }),
|
|
540
|
+
/* @__PURE__ */ jsx6(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs5(
|
|
541
|
+
"button",
|
|
542
|
+
{
|
|
543
|
+
ref: innerRef,
|
|
544
|
+
type: "button",
|
|
545
|
+
role: "combobox",
|
|
546
|
+
"aria-expanded": open,
|
|
547
|
+
disabled,
|
|
548
|
+
className: cn(
|
|
549
|
+
"flex h-11 w-full appearance-none items-center justify-between gap-2 px-4 text-base md:text-sm",
|
|
550
|
+
inputSurfaceField,
|
|
551
|
+
inputSurfaceFieldDisabled,
|
|
552
|
+
"[&>span]:line-clamp-1 [&>span]:text-inherit [&_svg]:text-slate-500 dark:[&_svg]:text-slate-400",
|
|
553
|
+
error && inputSurfaceFieldInvalid,
|
|
554
|
+
className
|
|
555
|
+
),
|
|
556
|
+
children: [
|
|
557
|
+
/* @__PURE__ */ jsx6(
|
|
558
|
+
"span",
|
|
559
|
+
{
|
|
560
|
+
className: cn("truncate", !triggerLabel && "text-slate-500 dark:text-slate-400"),
|
|
561
|
+
children: triggerLabel ?? placeholder
|
|
562
|
+
}
|
|
563
|
+
),
|
|
564
|
+
/* @__PURE__ */ jsxs5("span", { className: "flex shrink-0 items-center gap-1", children: [
|
|
565
|
+
clearable && value && !disabled && /* @__PURE__ */ jsx6(
|
|
566
|
+
"span",
|
|
567
|
+
{
|
|
568
|
+
role: "button",
|
|
569
|
+
tabIndex: -1,
|
|
570
|
+
"aria-label": "Clear selection",
|
|
571
|
+
onClick: handleClear,
|
|
572
|
+
onKeyDown: (e) => {
|
|
573
|
+
if (e.key === "Enter" || e.key === " ") handleClear(e);
|
|
574
|
+
},
|
|
575
|
+
className: "rounded-sm p-0.5 text-muted-foreground hover:text-foreground",
|
|
576
|
+
children: "\xD7"
|
|
577
|
+
}
|
|
578
|
+
),
|
|
579
|
+
/* @__PURE__ */ jsx6(ChevronDown2, { "aria-hidden": true, className: "h-4 w-4 shrink-0" })
|
|
580
|
+
] })
|
|
581
|
+
]
|
|
582
|
+
}
|
|
583
|
+
) }),
|
|
584
|
+
/* @__PURE__ */ jsxs5(
|
|
585
|
+
PopoverContent,
|
|
586
|
+
{
|
|
587
|
+
align: "start",
|
|
588
|
+
className: "w-[--radix-popover-trigger-width] p-0",
|
|
589
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
590
|
+
children: [
|
|
591
|
+
searchable && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 border-b px-3 py-2", children: [
|
|
592
|
+
/* @__PURE__ */ jsx6(Search, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
593
|
+
/* @__PURE__ */ jsx6(
|
|
594
|
+
"input",
|
|
595
|
+
{
|
|
596
|
+
ref: searchInputRef,
|
|
597
|
+
value: search,
|
|
598
|
+
onChange: (e) => setSearch(e.target.value),
|
|
599
|
+
placeholder: searchPlaceholder,
|
|
600
|
+
className: "h-8 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
|
601
|
+
}
|
|
602
|
+
)
|
|
603
|
+
] }),
|
|
604
|
+
/* @__PURE__ */ jsx6("div", { className: "max-h-60 overflow-y-auto p-1", children: loading && items.length === 0 ? /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground", children: [
|
|
605
|
+
/* @__PURE__ */ jsx6(Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
606
|
+
"Loading\u2026"
|
|
607
|
+
] }) : fetchError ? /* @__PURE__ */ jsx6("div", { className: "px-3 py-4 text-center text-sm text-destructive", children: fetchError }) : items.length === 0 ? /* @__PURE__ */ jsx6("div", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No results found." }) : /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
608
|
+
items.map((item) => {
|
|
609
|
+
const itemValue = String(
|
|
610
|
+
item[valueKey]
|
|
611
|
+
);
|
|
612
|
+
const isSelected = itemValue === value;
|
|
613
|
+
return /* @__PURE__ */ jsxs5(
|
|
614
|
+
"button",
|
|
615
|
+
{
|
|
616
|
+
type: "button",
|
|
617
|
+
role: "option",
|
|
618
|
+
"aria-selected": isSelected,
|
|
619
|
+
onClick: () => handleSelect(item),
|
|
620
|
+
className: cn(
|
|
621
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
622
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
623
|
+
"focus-visible:bg-accent focus-visible:text-accent-foreground",
|
|
624
|
+
isSelected && "bg-accent/50"
|
|
625
|
+
),
|
|
626
|
+
children: [
|
|
627
|
+
/* @__PURE__ */ jsx6("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: isSelected && /* @__PURE__ */ jsx6(Check, { className: "h-4 w-4" }) }),
|
|
628
|
+
/* @__PURE__ */ jsx6("span", { className: "truncate", children: resolveLabel(item, labelKey) })
|
|
629
|
+
]
|
|
630
|
+
},
|
|
631
|
+
itemValue
|
|
632
|
+
);
|
|
633
|
+
}),
|
|
634
|
+
hasMore && /* @__PURE__ */ jsx6(
|
|
635
|
+
"div",
|
|
636
|
+
{
|
|
637
|
+
ref: sentinelRef,
|
|
638
|
+
className: "flex items-center justify-center py-2",
|
|
639
|
+
children: /* @__PURE__ */ jsx6(Loader2, { className: "h-4 w-4 animate-spin text-muted-foreground" })
|
|
640
|
+
}
|
|
641
|
+
)
|
|
642
|
+
] }) })
|
|
643
|
+
]
|
|
644
|
+
}
|
|
645
|
+
)
|
|
646
|
+
] });
|
|
647
|
+
}
|
|
648
|
+
var AsyncSelect = React6.forwardRef(
|
|
649
|
+
(props, ref) => /* @__PURE__ */ jsx6(AsyncSelectInner, { ...props, innerRef: ref })
|
|
650
|
+
);
|
|
651
|
+
AsyncSelect.displayName = "AsyncSelect";
|
|
652
|
+
|
|
653
|
+
// source/components/composite/layout/AppShell/appshell.tsx
|
|
654
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
655
|
+
function AppShell({ sidebar, topbar, children, className }) {
|
|
656
|
+
return /* @__PURE__ */ jsxs6(
|
|
657
|
+
"div",
|
|
658
|
+
{
|
|
659
|
+
className: cn(
|
|
660
|
+
"relative flex h-screen w-full overflow-hidden",
|
|
661
|
+
"bg-gradient-to-br from-brand-50 via-neutral-100 to-emerald-50",
|
|
662
|
+
"dark:from-brand-950 dark:via-neutral-950 dark:to-brand-900",
|
|
663
|
+
className
|
|
664
|
+
),
|
|
665
|
+
children: [
|
|
666
|
+
sidebar,
|
|
667
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
668
|
+
topbar && /* @__PURE__ */ jsx7("header", { className: cn("sticky top-0 z-30 flex-shrink-0 my-2 mx-3 mb-0 rounded-2xl"), children: topbar }),
|
|
669
|
+
/* @__PURE__ */ jsx7("main", { className: "flex-1 overflow-y-auto", children })
|
|
670
|
+
] })
|
|
671
|
+
]
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// source/components/primitive/AspectRatio/aspect-ratio.tsx
|
|
677
|
+
import * as React7 from "react";
|
|
678
|
+
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
679
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
680
|
+
var AspectRatio = React7.forwardRef(({ className, ratio = 1, style, ...props }, ref) => {
|
|
681
|
+
return /* @__PURE__ */ jsx8(
|
|
682
|
+
AspectRatioPrimitive.Root,
|
|
683
|
+
{
|
|
684
|
+
ref,
|
|
685
|
+
"data-slot": "aspect-ratio",
|
|
686
|
+
ratio,
|
|
687
|
+
className: cn("overflow-hidden", className),
|
|
688
|
+
style,
|
|
689
|
+
...props
|
|
690
|
+
}
|
|
691
|
+
);
|
|
692
|
+
});
|
|
693
|
+
AspectRatio.displayName = "AspectRatio";
|
|
694
|
+
|
|
695
|
+
// source/components/primitive/Avatar/avatar.tsx
|
|
696
|
+
import * as React8 from "react";
|
|
697
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
698
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
699
|
+
var avatarSizes = {
|
|
700
|
+
xs: "h-6 w-6 text-[10px]",
|
|
701
|
+
sm: "h-8 w-8 text-xs",
|
|
702
|
+
md: "h-10 w-10 text-sm",
|
|
703
|
+
lg: "h-12 w-12 text-base",
|
|
704
|
+
xl: "h-16 w-16 text-lg"
|
|
705
|
+
};
|
|
706
|
+
var Avatar = React8.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
707
|
+
AvatarPrimitive.Root,
|
|
708
|
+
{
|
|
709
|
+
ref,
|
|
710
|
+
"data-slot": "avatar",
|
|
711
|
+
className: cn(
|
|
712
|
+
"relative inline-flex shrink-0 overflow-hidden rounded-full",
|
|
713
|
+
avatarSizes[size],
|
|
714
|
+
className
|
|
715
|
+
),
|
|
716
|
+
...props
|
|
717
|
+
}
|
|
718
|
+
));
|
|
719
|
+
Avatar.displayName = "Avatar";
|
|
720
|
+
var AvatarImage = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
721
|
+
AvatarPrimitive.Image,
|
|
722
|
+
{
|
|
723
|
+
ref,
|
|
724
|
+
className: cn("h-full w-full object-cover", className),
|
|
725
|
+
...props
|
|
726
|
+
}
|
|
727
|
+
));
|
|
728
|
+
AvatarImage.displayName = "AvatarImage";
|
|
729
|
+
var AvatarFallback = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
730
|
+
AvatarPrimitive.Fallback,
|
|
731
|
+
{
|
|
732
|
+
ref,
|
|
733
|
+
className: cn(
|
|
734
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground",
|
|
735
|
+
className
|
|
736
|
+
),
|
|
737
|
+
...props
|
|
738
|
+
}
|
|
739
|
+
));
|
|
740
|
+
AvatarFallback.displayName = "AvatarFallback";
|
|
741
|
+
|
|
742
|
+
// source/components/primitive/Badge/badge.tsx
|
|
743
|
+
import * as React9 from "react";
|
|
744
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
745
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
746
|
+
var badgeVariants = cva3(
|
|
747
|
+
"inline-flex items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",
|
|
748
|
+
{
|
|
749
|
+
variants: {
|
|
750
|
+
variant: {
|
|
751
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
752
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
753
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
754
|
+
outline: "text-foreground border-border",
|
|
755
|
+
success: "border-transparent bg-green-500 text-white hover:bg-green-500/80",
|
|
756
|
+
warning: "border-transparent bg-yellow-500 text-black hover:bg-yellow-500/80"
|
|
757
|
+
},
|
|
758
|
+
size: {
|
|
759
|
+
sm: "px-2 py-0 text-[10px]",
|
|
760
|
+
default: "px-2.5 py-0.5 text-xs",
|
|
761
|
+
lg: "px-3 py-1 text-sm"
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
defaultVariants: {
|
|
765
|
+
variant: "default",
|
|
766
|
+
size: "default"
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
);
|
|
770
|
+
var Badge = React9.forwardRef(
|
|
771
|
+
({ className, variant, size, ...props }, ref) => {
|
|
772
|
+
return /* @__PURE__ */ jsx10(
|
|
773
|
+
"span",
|
|
774
|
+
{
|
|
775
|
+
ref,
|
|
776
|
+
"data-slot": "badge",
|
|
777
|
+
className: cn(badgeVariants({ variant, size }), className),
|
|
778
|
+
...props
|
|
779
|
+
}
|
|
780
|
+
);
|
|
781
|
+
}
|
|
782
|
+
);
|
|
783
|
+
Badge.displayName = "Badge";
|
|
784
|
+
|
|
785
|
+
// source/components/primitive/Breadcrumb/breadcrumb.tsx
|
|
786
|
+
import * as React10 from "react";
|
|
787
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
788
|
+
|
|
789
|
+
// source/components/primitive/Icon/icon.tsx
|
|
790
|
+
import { Fragment as Fragment2, jsx as jsx11 } from "react/jsx-runtime";
|
|
791
|
+
var registry = /* @__PURE__ */ new Map();
|
|
792
|
+
function registerIcons(icons) {
|
|
793
|
+
Object.entries(icons).forEach(([name, component]) => {
|
|
794
|
+
registry.set(name, component);
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
function getIcon(name) {
|
|
798
|
+
return registry.get(name);
|
|
799
|
+
}
|
|
800
|
+
var Icon = ({ name, fallback, size = 24, ...props }) => {
|
|
801
|
+
const Component = registry.get(name);
|
|
802
|
+
if (!Component) {
|
|
803
|
+
if (fallback) return /* @__PURE__ */ jsx11(Fragment2, { children: fallback });
|
|
804
|
+
return null;
|
|
805
|
+
}
|
|
806
|
+
return /* @__PURE__ */ jsx11(Component, { size, ...props });
|
|
807
|
+
};
|
|
808
|
+
Icon.displayName = "Icon";
|
|
809
|
+
|
|
810
|
+
// source/components/primitive/Breadcrumb/breadcrumb.tsx
|
|
811
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
812
|
+
var Breadcrumb = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
813
|
+
"nav",
|
|
814
|
+
{
|
|
815
|
+
ref,
|
|
816
|
+
"aria-label": "breadcrumb",
|
|
817
|
+
"data-slot": "breadcrumb",
|
|
818
|
+
className: cn(className),
|
|
819
|
+
...props
|
|
820
|
+
}
|
|
821
|
+
));
|
|
822
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
823
|
+
var BreadcrumbList = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
824
|
+
"ol",
|
|
825
|
+
{
|
|
826
|
+
ref,
|
|
827
|
+
"data-slot": "breadcrumb-list",
|
|
828
|
+
className: cn(
|
|
829
|
+
"flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground sm:gap-2.5",
|
|
830
|
+
className
|
|
831
|
+
),
|
|
832
|
+
...props
|
|
833
|
+
}
|
|
834
|
+
));
|
|
835
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
836
|
+
var BreadcrumbItem = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
837
|
+
"li",
|
|
838
|
+
{
|
|
839
|
+
ref,
|
|
840
|
+
"data-slot": "breadcrumb-item",
|
|
841
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
842
|
+
...props
|
|
843
|
+
}
|
|
844
|
+
));
|
|
845
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
846
|
+
var BreadcrumbLink = React10.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
847
|
+
const Comp = asChild ? Slot2 : "a";
|
|
848
|
+
return /* @__PURE__ */ jsx12(
|
|
849
|
+
Comp,
|
|
850
|
+
{
|
|
851
|
+
ref,
|
|
852
|
+
"data-slot": "breadcrumb-link",
|
|
853
|
+
className: cn("transition-colors hover:text-foreground", className),
|
|
854
|
+
...props
|
|
855
|
+
}
|
|
856
|
+
);
|
|
857
|
+
});
|
|
858
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
859
|
+
var BreadcrumbPage = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
860
|
+
"span",
|
|
861
|
+
{
|
|
862
|
+
ref,
|
|
863
|
+
"data-slot": "breadcrumb-page",
|
|
864
|
+
"aria-current": "page",
|
|
865
|
+
className: cn("font-normal text-foreground", className),
|
|
866
|
+
...props
|
|
867
|
+
}
|
|
868
|
+
));
|
|
869
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
870
|
+
var BreadcrumbSeparator = ({
|
|
871
|
+
className,
|
|
872
|
+
children,
|
|
873
|
+
...props
|
|
874
|
+
}) => /* @__PURE__ */ jsx12(
|
|
875
|
+
"li",
|
|
876
|
+
{
|
|
877
|
+
role: "presentation",
|
|
878
|
+
"aria-hidden": "true",
|
|
879
|
+
"data-slot": "breadcrumb-separator",
|
|
880
|
+
className: cn(
|
|
881
|
+
"[&>svg]:h-3.5 [&>svg]:w-3.5 text-muted-foreground",
|
|
882
|
+
className
|
|
883
|
+
),
|
|
884
|
+
...props,
|
|
885
|
+
children: children ?? /* @__PURE__ */ jsx12(Icon, { name: "ChevronRight" })
|
|
886
|
+
}
|
|
887
|
+
);
|
|
888
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
889
|
+
var BreadcrumbEllipsis = ({
|
|
890
|
+
className,
|
|
891
|
+
...props
|
|
892
|
+
}) => /* @__PURE__ */ jsxs7(
|
|
893
|
+
"span",
|
|
894
|
+
{
|
|
895
|
+
role: "presentation",
|
|
896
|
+
"aria-hidden": "true",
|
|
897
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
898
|
+
className: cn(
|
|
899
|
+
"flex h-9 w-9 items-center justify-center",
|
|
900
|
+
className
|
|
901
|
+
),
|
|
902
|
+
...props,
|
|
903
|
+
children: [
|
|
904
|
+
/* @__PURE__ */ jsx12(Icon, { name: "FlipHorizontal2", className: "h-4 w-4" }),
|
|
905
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: "More" })
|
|
906
|
+
]
|
|
907
|
+
}
|
|
908
|
+
);
|
|
909
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
910
|
+
|
|
911
|
+
// source/components/primitive/Calendar/calendar.tsx
|
|
912
|
+
import * as React11 from "react";
|
|
913
|
+
import {
|
|
914
|
+
ChevronDownIcon,
|
|
915
|
+
ChevronLeftIcon,
|
|
916
|
+
ChevronRightIcon
|
|
917
|
+
} from "lucide-react";
|
|
918
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
919
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
920
|
+
function Calendar({
|
|
921
|
+
className,
|
|
922
|
+
classNames,
|
|
923
|
+
showOutsideDays = true,
|
|
924
|
+
captionLayout = "label",
|
|
925
|
+
buttonVariant = "ghost",
|
|
926
|
+
formatters,
|
|
927
|
+
components,
|
|
928
|
+
...props
|
|
929
|
+
}) {
|
|
930
|
+
const defaultClassNames = getDefaultClassNames();
|
|
931
|
+
return /* @__PURE__ */ jsx13(
|
|
932
|
+
DayPicker,
|
|
933
|
+
{
|
|
934
|
+
showOutsideDays,
|
|
935
|
+
className: cn(
|
|
936
|
+
"bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
937
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
938
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
939
|
+
className
|
|
940
|
+
),
|
|
941
|
+
captionLayout,
|
|
942
|
+
formatters: {
|
|
943
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
944
|
+
...formatters
|
|
945
|
+
},
|
|
946
|
+
classNames: {
|
|
947
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
948
|
+
months: cn(
|
|
949
|
+
"relative flex flex-col gap-4 md:flex-row",
|
|
950
|
+
defaultClassNames.months
|
|
951
|
+
),
|
|
952
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
953
|
+
nav: cn(
|
|
954
|
+
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
955
|
+
defaultClassNames.nav
|
|
956
|
+
),
|
|
957
|
+
button_previous: cn(
|
|
958
|
+
buttonVariants({ variant: buttonVariant }),
|
|
959
|
+
"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
|
|
960
|
+
defaultClassNames.button_previous
|
|
961
|
+
),
|
|
962
|
+
button_next: cn(
|
|
963
|
+
buttonVariants({ variant: buttonVariant }),
|
|
964
|
+
"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
|
|
965
|
+
defaultClassNames.button_next
|
|
966
|
+
),
|
|
967
|
+
month_caption: cn(
|
|
968
|
+
"flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",
|
|
969
|
+
defaultClassNames.month_caption
|
|
970
|
+
),
|
|
971
|
+
dropdowns: cn(
|
|
972
|
+
"flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
973
|
+
defaultClassNames.dropdowns
|
|
974
|
+
),
|
|
975
|
+
dropdown_root: cn(
|
|
976
|
+
"has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",
|
|
977
|
+
defaultClassNames.dropdown_root
|
|
978
|
+
),
|
|
979
|
+
dropdown: cn(
|
|
980
|
+
"bg-popover absolute inset-0 opacity-0",
|
|
981
|
+
defaultClassNames.dropdown
|
|
982
|
+
),
|
|
983
|
+
caption_label: cn(
|
|
984
|
+
"select-none font-medium",
|
|
985
|
+
captionLayout === "label" ? "text-sm" : "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",
|
|
986
|
+
defaultClassNames.caption_label
|
|
987
|
+
),
|
|
988
|
+
table: "w-full border-collapse",
|
|
989
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
990
|
+
weekday: cn(
|
|
991
|
+
"text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",
|
|
992
|
+
defaultClassNames.weekday
|
|
993
|
+
),
|
|
994
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
995
|
+
week_number_header: cn(
|
|
996
|
+
"w-[--cell-size] select-none",
|
|
997
|
+
defaultClassNames.week_number_header
|
|
998
|
+
),
|
|
999
|
+
week_number: cn(
|
|
1000
|
+
"text-muted-foreground select-none text-[0.8rem]",
|
|
1001
|
+
defaultClassNames.week_number
|
|
1002
|
+
),
|
|
1003
|
+
day: cn(
|
|
1004
|
+
"group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",
|
|
1005
|
+
defaultClassNames.day
|
|
1006
|
+
),
|
|
1007
|
+
range_start: cn(
|
|
1008
|
+
"bg-accent rounded-l-md",
|
|
1009
|
+
defaultClassNames.range_start
|
|
1010
|
+
),
|
|
1011
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
1012
|
+
range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end),
|
|
1013
|
+
today: cn(
|
|
1014
|
+
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
1015
|
+
defaultClassNames.today
|
|
1016
|
+
),
|
|
1017
|
+
outside: cn(
|
|
1018
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
1019
|
+
defaultClassNames.outside
|
|
1020
|
+
),
|
|
1021
|
+
disabled: cn(
|
|
1022
|
+
"text-muted-foreground opacity-50",
|
|
1023
|
+
defaultClassNames.disabled
|
|
1024
|
+
),
|
|
1025
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
1026
|
+
...classNames
|
|
1027
|
+
},
|
|
1028
|
+
components: {
|
|
1029
|
+
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
1030
|
+
return /* @__PURE__ */ jsx13(
|
|
1031
|
+
"div",
|
|
1032
|
+
{
|
|
1033
|
+
"data-slot": "calendar",
|
|
1034
|
+
ref: rootRef,
|
|
1035
|
+
className: cn(className2),
|
|
1036
|
+
...props2
|
|
1037
|
+
}
|
|
1038
|
+
);
|
|
1039
|
+
},
|
|
1040
|
+
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
1041
|
+
if (orientation === "left") {
|
|
1042
|
+
return /* @__PURE__ */ jsx13(ChevronLeftIcon, { className: cn("size-4", className2), ...props2 });
|
|
1043
|
+
}
|
|
1044
|
+
if (orientation === "right") {
|
|
1045
|
+
return /* @__PURE__ */ jsx13(
|
|
1046
|
+
ChevronRightIcon,
|
|
1047
|
+
{
|
|
1048
|
+
className: cn("size-4", className2),
|
|
1049
|
+
...props2
|
|
1050
|
+
}
|
|
1051
|
+
);
|
|
1052
|
+
}
|
|
1053
|
+
return /* @__PURE__ */ jsx13(ChevronDownIcon, { className: cn("size-4", className2), ...props2 });
|
|
1054
|
+
},
|
|
1055
|
+
DayButton: CalendarDayButton,
|
|
1056
|
+
WeekNumber: ({ children, ...props2 }) => {
|
|
1057
|
+
return /* @__PURE__ */ jsx13("td", { ...props2, children: /* @__PURE__ */ jsx13("div", { className: "flex size-[--cell-size] items-center justify-center text-center", children }) });
|
|
1058
|
+
},
|
|
1059
|
+
...components
|
|
1060
|
+
},
|
|
1061
|
+
...props
|
|
1062
|
+
}
|
|
1063
|
+
);
|
|
1064
|
+
}
|
|
1065
|
+
function CalendarDayButton({
|
|
1066
|
+
className,
|
|
1067
|
+
day,
|
|
1068
|
+
modifiers,
|
|
1069
|
+
...props
|
|
1070
|
+
}) {
|
|
1071
|
+
const defaultClassNames = getDefaultClassNames();
|
|
1072
|
+
const ref = React11.useRef(null);
|
|
1073
|
+
React11.useEffect(() => {
|
|
1074
|
+
if (modifiers.focused) ref.current?.focus();
|
|
1075
|
+
}, [modifiers.focused]);
|
|
1076
|
+
return /* @__PURE__ */ jsx13(
|
|
1077
|
+
Button,
|
|
1078
|
+
{
|
|
1079
|
+
ref,
|
|
1080
|
+
variant: "ghost",
|
|
1081
|
+
size: "icon",
|
|
1082
|
+
"data-day": day.date.toLocaleDateString(),
|
|
1083
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
1084
|
+
"data-range-start": modifiers.range_start,
|
|
1085
|
+
"data-range-end": modifiers.range_end,
|
|
1086
|
+
"data-range-middle": modifiers.range_middle,
|
|
1087
|
+
className: cn(
|
|
1088
|
+
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",
|
|
1089
|
+
defaultClassNames.day,
|
|
1090
|
+
className
|
|
1091
|
+
),
|
|
1092
|
+
...props
|
|
1093
|
+
}
|
|
1094
|
+
);
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
// source/components/primitive/Caption/caption.tsx
|
|
1098
|
+
import * as React12 from "react";
|
|
1099
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
1100
|
+
import { jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1101
|
+
var captionVariants = cva4(
|
|
1102
|
+
// Base: small, muted, slightly tracked out for readability at small sizes
|
|
1103
|
+
"text-muted-foreground text-xs leading-normal tracking-wide",
|
|
1104
|
+
{
|
|
1105
|
+
variants: {
|
|
1106
|
+
size: {
|
|
1107
|
+
"2xs": "text-2xs",
|
|
1108
|
+
xs: "text-xs",
|
|
1109
|
+
sm: "text-sm"
|
|
1110
|
+
},
|
|
1111
|
+
tone: {
|
|
1112
|
+
default: "text-muted-foreground",
|
|
1113
|
+
subtle: "text-muted-foreground/60",
|
|
1114
|
+
primary: "text-primary",
|
|
1115
|
+
destructive: "text-destructive",
|
|
1116
|
+
success: "text-success",
|
|
1117
|
+
warning: "text-warning"
|
|
1118
|
+
},
|
|
1119
|
+
align: {
|
|
1120
|
+
left: "text-left",
|
|
1121
|
+
center: "text-center",
|
|
1122
|
+
right: "text-right"
|
|
1123
|
+
},
|
|
1124
|
+
/**
|
|
1125
|
+
* When true, the caption renders as a flex row so an optional leading
|
|
1126
|
+
* icon (info, warning, etc.) sits inline with the text.
|
|
1127
|
+
*/
|
|
1128
|
+
withIcon: {
|
|
1129
|
+
true: "inline-flex items-center gap-1"
|
|
1130
|
+
},
|
|
1131
|
+
truncate: {
|
|
1132
|
+
true: "truncate"
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
defaultVariants: {
|
|
1136
|
+
size: "xs",
|
|
1137
|
+
tone: "default"
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
);
|
|
1141
|
+
var Caption = React12.forwardRef(
|
|
1142
|
+
({
|
|
1143
|
+
element = "figcaption",
|
|
1144
|
+
size,
|
|
1145
|
+
tone,
|
|
1146
|
+
align,
|
|
1147
|
+
truncate,
|
|
1148
|
+
icon,
|
|
1149
|
+
className,
|
|
1150
|
+
children,
|
|
1151
|
+
...props
|
|
1152
|
+
}, ref) => {
|
|
1153
|
+
const Tag = element;
|
|
1154
|
+
const hasIcon = Boolean(icon);
|
|
1155
|
+
return /* @__PURE__ */ jsxs8(
|
|
1156
|
+
Tag,
|
|
1157
|
+
{
|
|
1158
|
+
ref,
|
|
1159
|
+
className: cn(
|
|
1160
|
+
captionVariants({ size, tone, align, truncate, withIcon: hasIcon }),
|
|
1161
|
+
className
|
|
1162
|
+
),
|
|
1163
|
+
...props,
|
|
1164
|
+
children: [
|
|
1165
|
+
icon,
|
|
1166
|
+
children
|
|
1167
|
+
]
|
|
1168
|
+
}
|
|
1169
|
+
);
|
|
1170
|
+
}
|
|
1171
|
+
);
|
|
1172
|
+
Caption.displayName = "Caption";
|
|
1173
|
+
|
|
1174
|
+
// source/components/primitive/Card/card.tsx
|
|
1175
|
+
import * as React13 from "react";
|
|
1176
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1177
|
+
var Card = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1178
|
+
"div",
|
|
1179
|
+
{
|
|
1180
|
+
ref,
|
|
1181
|
+
className: cn(
|
|
1182
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
1183
|
+
className
|
|
1184
|
+
),
|
|
1185
|
+
...props
|
|
1186
|
+
}
|
|
1187
|
+
));
|
|
1188
|
+
Card.displayName = "Card";
|
|
1189
|
+
var CardHeader = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1190
|
+
"div",
|
|
1191
|
+
{
|
|
1192
|
+
ref,
|
|
1193
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
1194
|
+
...props
|
|
1195
|
+
}
|
|
1196
|
+
));
|
|
1197
|
+
CardHeader.displayName = "CardHeader";
|
|
1198
|
+
var CardTitle = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1199
|
+
"div",
|
|
1200
|
+
{
|
|
1201
|
+
ref,
|
|
1202
|
+
className: cn(
|
|
1203
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
1204
|
+
className
|
|
1205
|
+
),
|
|
1206
|
+
...props
|
|
1207
|
+
}
|
|
1208
|
+
));
|
|
1209
|
+
CardTitle.displayName = "CardTitle";
|
|
1210
|
+
var CardDescription = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1211
|
+
"div",
|
|
1212
|
+
{
|
|
1213
|
+
ref,
|
|
1214
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
1215
|
+
...props
|
|
1216
|
+
}
|
|
1217
|
+
));
|
|
1218
|
+
CardDescription.displayName = "CardDescription";
|
|
1219
|
+
var CardContent = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
1220
|
+
CardContent.displayName = "CardContent";
|
|
1221
|
+
var CardFooter = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
1222
|
+
"div",
|
|
1223
|
+
{
|
|
1224
|
+
ref,
|
|
1225
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
1226
|
+
...props
|
|
1227
|
+
}
|
|
1228
|
+
));
|
|
1229
|
+
CardFooter.displayName = "CardFooter";
|
|
1230
|
+
|
|
1231
|
+
// source/components/primitive/Checkbox/checkbox.tsx
|
|
1232
|
+
import * as React14 from "react";
|
|
1233
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
1234
|
+
import { Check as Check2 } from "lucide-react";
|
|
1235
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
1236
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1237
|
+
var checkboxVariants = cva5(
|
|
1238
|
+
"peer shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
1239
|
+
{
|
|
1240
|
+
variants: {
|
|
1241
|
+
size: {
|
|
1242
|
+
sm: "h-3.5 w-3.5",
|
|
1243
|
+
default: "h-4 w-4",
|
|
1244
|
+
lg: "h-5 w-5"
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
defaultVariants: {
|
|
1248
|
+
size: "default"
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
);
|
|
1252
|
+
var indicatorIconVariants = cva5("text-current", {
|
|
1253
|
+
variants: {
|
|
1254
|
+
size: {
|
|
1255
|
+
sm: "h-3 w-3",
|
|
1256
|
+
default: "h-4 w-4",
|
|
1257
|
+
lg: "h-5 w-5"
|
|
1258
|
+
}
|
|
1259
|
+
},
|
|
1260
|
+
defaultVariants: {
|
|
1261
|
+
size: "default"
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
var Checkbox = React14.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
1265
|
+
CheckboxPrimitive.Root,
|
|
1266
|
+
{
|
|
1267
|
+
ref,
|
|
1268
|
+
"data-slot": "checkbox",
|
|
1269
|
+
className: cn(checkboxVariants({ size }), className),
|
|
1270
|
+
...props,
|
|
1271
|
+
children: /* @__PURE__ */ jsx15(
|
|
1272
|
+
CheckboxPrimitive.Indicator,
|
|
1273
|
+
{
|
|
1274
|
+
"data-slot": "checkbox-indicator",
|
|
1275
|
+
className: "flex items-center justify-center",
|
|
1276
|
+
children: /* @__PURE__ */ jsx15(Check2, { className: cn(indicatorIconVariants({ size })) })
|
|
1277
|
+
}
|
|
1278
|
+
)
|
|
1279
|
+
}
|
|
1280
|
+
));
|
|
1281
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
1282
|
+
|
|
1283
|
+
// source/components/primitive/Collapsible/collapsible.tsx
|
|
1284
|
+
import * as React15 from "react";
|
|
1285
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
1286
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1287
|
+
var Collapsible = CollapsiblePrimitive.Root;
|
|
1288
|
+
var CollapsibleTrigger2 = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
1289
|
+
CollapsiblePrimitive.CollapsibleTrigger,
|
|
1290
|
+
{
|
|
1291
|
+
ref,
|
|
1292
|
+
className: cn(
|
|
1293
|
+
"flex items-center justify-between w-full",
|
|
1294
|
+
className
|
|
1295
|
+
),
|
|
1296
|
+
...props
|
|
1297
|
+
}
|
|
1298
|
+
));
|
|
1299
|
+
CollapsibleTrigger2.displayName = CollapsiblePrimitive.CollapsibleTrigger.displayName;
|
|
1300
|
+
var CollapsibleContent2 = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
1301
|
+
CollapsiblePrimitive.CollapsibleContent,
|
|
1302
|
+
{
|
|
1303
|
+
ref,
|
|
1304
|
+
className: cn(
|
|
1305
|
+
"overflow-hidden text-sm data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
|
|
1306
|
+
className
|
|
1307
|
+
),
|
|
1308
|
+
...props
|
|
1309
|
+
}
|
|
1310
|
+
));
|
|
1311
|
+
CollapsibleContent2.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
1312
|
+
|
|
1313
|
+
// source/components/primitive/Container/container.tsx
|
|
1314
|
+
import * as React16 from "react";
|
|
1315
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
1316
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1317
|
+
var containerVariants = cva6(
|
|
1318
|
+
[
|
|
1319
|
+
"relative overflow-hidden",
|
|
1320
|
+
"transition-colors",
|
|
1321
|
+
"border"
|
|
1322
|
+
].join(" "),
|
|
1323
|
+
{
|
|
1324
|
+
variants: {
|
|
1325
|
+
variant: {
|
|
1326
|
+
glass: [
|
|
1327
|
+
"backdrop-blur-md backdrop-saturate-150",
|
|
1328
|
+
"bg-background/60 dark:bg-background/30",
|
|
1329
|
+
"border-white/30 dark:border-white/15",
|
|
1330
|
+
"shadow-glass dark:shadow-glass-dark",
|
|
1331
|
+
"before:pointer-events-none before:absolute before:inset-x-0 before:top-0",
|
|
1332
|
+
"before:h-px before:bg-gradient-to-r before:from-transparent before:via-white/50 before:to-transparent"
|
|
1333
|
+
].join(" "),
|
|
1334
|
+
solid: [
|
|
1335
|
+
"bg-background",
|
|
1336
|
+
"border-border",
|
|
1337
|
+
"shadow-sm"
|
|
1338
|
+
].join(" "),
|
|
1339
|
+
bordered: [
|
|
1340
|
+
"bg-transparent",
|
|
1341
|
+
"border-border"
|
|
1342
|
+
].join(" ")
|
|
1343
|
+
},
|
|
1344
|
+
rounded: {
|
|
1345
|
+
none: "rounded-none",
|
|
1346
|
+
sm: "rounded-sm",
|
|
1347
|
+
md: "rounded-md",
|
|
1348
|
+
lg: "rounded-lg",
|
|
1349
|
+
xl: "rounded-xl",
|
|
1350
|
+
"2xl": "rounded-2xl"
|
|
1351
|
+
},
|
|
1352
|
+
padding: {
|
|
1353
|
+
none: "p-0",
|
|
1354
|
+
sm: "p-3",
|
|
1355
|
+
md: "p-4",
|
|
1356
|
+
lg: "p-6",
|
|
1357
|
+
xl: "p-8"
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
defaultVariants: {
|
|
1361
|
+
variant: "glass",
|
|
1362
|
+
rounded: "lg",
|
|
1363
|
+
padding: "md"
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
);
|
|
1367
|
+
var Container = React16.forwardRef(
|
|
1368
|
+
({
|
|
1369
|
+
className,
|
|
1370
|
+
variant,
|
|
1371
|
+
rounded,
|
|
1372
|
+
padding,
|
|
1373
|
+
header,
|
|
1374
|
+
footer,
|
|
1375
|
+
actions,
|
|
1376
|
+
loading,
|
|
1377
|
+
children,
|
|
1378
|
+
...props
|
|
1379
|
+
}, ref) => {
|
|
1380
|
+
return /* @__PURE__ */ jsxs9(
|
|
1381
|
+
"div",
|
|
1382
|
+
{
|
|
1383
|
+
ref,
|
|
1384
|
+
className: cn(
|
|
1385
|
+
containerVariants({
|
|
1386
|
+
variant,
|
|
1387
|
+
rounded,
|
|
1388
|
+
padding
|
|
1389
|
+
}),
|
|
1390
|
+
className
|
|
1391
|
+
),
|
|
1392
|
+
...props,
|
|
1393
|
+
children: [
|
|
1394
|
+
(header || actions) && /* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between mb-4", children: [
|
|
1395
|
+
header && /* @__PURE__ */ jsx17("div", { className: "text-sm font-semibold", children: header }),
|
|
1396
|
+
actions && /* @__PURE__ */ jsx17("div", { className: "flex items-center gap-2", children: actions })
|
|
1397
|
+
] }),
|
|
1398
|
+
/* @__PURE__ */ jsx17("div", { className: "relative", children: loading ? /* @__PURE__ */ jsxs9("div", { className: "animate-pulse space-y-3", children: [
|
|
1399
|
+
/* @__PURE__ */ jsx17("div", { className: "h-4 w-3/4 bg-muted rounded" }),
|
|
1400
|
+
/* @__PURE__ */ jsx17("div", { className: "h-4 w-full bg-muted rounded" }),
|
|
1401
|
+
/* @__PURE__ */ jsx17("div", { className: "h-4 w-2/3 bg-muted rounded" })
|
|
1402
|
+
] }) : children }),
|
|
1403
|
+
footer && /* @__PURE__ */ jsx17("div", { className: "mt-4 pt-4 border-t border-border", children: footer })
|
|
1404
|
+
]
|
|
1405
|
+
}
|
|
1406
|
+
);
|
|
1407
|
+
}
|
|
1408
|
+
);
|
|
1409
|
+
Container.displayName = "Container";
|
|
1410
|
+
|
|
1411
|
+
// source/components/primitive/Dialog/dialog.tsx
|
|
1412
|
+
import * as React17 from "react";
|
|
1413
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1414
|
+
import { X } from "lucide-react";
|
|
1415
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1416
|
+
var Dialog = DialogPrimitive.Root;
|
|
1417
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1418
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
1419
|
+
var DialogClose = DialogPrimitive.Close;
|
|
1420
|
+
var DialogOverlay = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
1421
|
+
DialogPrimitive.Overlay,
|
|
1422
|
+
{
|
|
1423
|
+
ref,
|
|
1424
|
+
className: cn(
|
|
1425
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1426
|
+
className
|
|
1427
|
+
),
|
|
1428
|
+
...props
|
|
1429
|
+
}
|
|
1430
|
+
));
|
|
1431
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1432
|
+
var DialogContent = React17.forwardRef(({ className, children, hideClose = false, ...props }, ref) => /* @__PURE__ */ jsxs10(DialogPortal, { children: [
|
|
1433
|
+
/* @__PURE__ */ jsx18(DialogOverlay, {}),
|
|
1434
|
+
/* @__PURE__ */ jsxs10(
|
|
1435
|
+
DialogPrimitive.Content,
|
|
1436
|
+
{
|
|
1437
|
+
ref,
|
|
1438
|
+
className: cn(
|
|
1439
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
1440
|
+
className
|
|
1441
|
+
),
|
|
1442
|
+
...props,
|
|
1443
|
+
children: [
|
|
1444
|
+
children,
|
|
1445
|
+
!hideClose && /* @__PURE__ */ jsxs10(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
1446
|
+
/* @__PURE__ */ jsx18(X, { className: "h-4 w-4" }),
|
|
1447
|
+
/* @__PURE__ */ jsx18("span", { className: "sr-only", children: "Close" })
|
|
1448
|
+
] })
|
|
1449
|
+
]
|
|
1450
|
+
}
|
|
1451
|
+
)
|
|
1452
|
+
] }));
|
|
1453
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
1454
|
+
var DialogHeader = ({
|
|
1455
|
+
className,
|
|
1456
|
+
...props
|
|
1457
|
+
}) => /* @__PURE__ */ jsx18(
|
|
1458
|
+
"div",
|
|
1459
|
+
{
|
|
1460
|
+
className: cn(
|
|
1461
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
1462
|
+
className
|
|
1463
|
+
),
|
|
1464
|
+
...props
|
|
1465
|
+
}
|
|
1466
|
+
);
|
|
1467
|
+
DialogHeader.displayName = "DialogHeader";
|
|
1468
|
+
var DialogFooter = ({
|
|
1469
|
+
className,
|
|
1470
|
+
...props
|
|
1471
|
+
}) => /* @__PURE__ */ jsx18(
|
|
1472
|
+
"div",
|
|
1473
|
+
{
|
|
1474
|
+
className: cn(
|
|
1475
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
1476
|
+
className
|
|
1477
|
+
),
|
|
1478
|
+
...props
|
|
1479
|
+
}
|
|
1480
|
+
);
|
|
1481
|
+
DialogFooter.displayName = "DialogFooter";
|
|
1482
|
+
var DialogTitle = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
1483
|
+
DialogPrimitive.Title,
|
|
1484
|
+
{
|
|
1485
|
+
ref,
|
|
1486
|
+
className: cn(
|
|
1487
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
1488
|
+
className
|
|
1489
|
+
),
|
|
1490
|
+
...props
|
|
1491
|
+
}
|
|
1492
|
+
));
|
|
1493
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
1494
|
+
var DialogDescription = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
1495
|
+
DialogPrimitive.Description,
|
|
1496
|
+
{
|
|
1497
|
+
ref,
|
|
1498
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
1499
|
+
...props
|
|
1500
|
+
}
|
|
1501
|
+
));
|
|
1502
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
1503
|
+
|
|
1504
|
+
// source/components/primitive/DropdownMenu/dropdown-menu.tsx
|
|
1505
|
+
import * as React18 from "react";
|
|
1506
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1507
|
+
import { Check as Check3, ChevronRight, Circle } from "lucide-react";
|
|
1508
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1509
|
+
var dropdownItemStyles = "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0";
|
|
1510
|
+
var dropdownAnimation = "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
|
|
1511
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1512
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1513
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
1514
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
1515
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
1516
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
1517
|
+
var DropdownMenuSubTrigger = React18.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1518
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
1519
|
+
{
|
|
1520
|
+
ref,
|
|
1521
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
1522
|
+
className: cn(
|
|
1523
|
+
dropdownItemStyles,
|
|
1524
|
+
"focus:bg-accent data-[state=open]:bg-accent",
|
|
1525
|
+
inset && "pl-8",
|
|
1526
|
+
className
|
|
1527
|
+
),
|
|
1528
|
+
...props,
|
|
1529
|
+
children: [
|
|
1530
|
+
children,
|
|
1531
|
+
/* @__PURE__ */ jsx19(ChevronRight, { className: "ml-auto" })
|
|
1532
|
+
]
|
|
1533
|
+
}
|
|
1534
|
+
));
|
|
1535
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1536
|
+
var DropdownMenuSubContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1537
|
+
DropdownMenuPrimitive.SubContent,
|
|
1538
|
+
{
|
|
1539
|
+
ref,
|
|
1540
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
1541
|
+
className: cn(
|
|
1542
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg",
|
|
1543
|
+
dropdownAnimation,
|
|
1544
|
+
className
|
|
1545
|
+
),
|
|
1546
|
+
...props
|
|
1547
|
+
}
|
|
1548
|
+
));
|
|
1549
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1550
|
+
var DropdownMenuContent = React18.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx19(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx19(
|
|
1551
|
+
DropdownMenuPrimitive.Content,
|
|
1552
|
+
{
|
|
1553
|
+
ref,
|
|
1554
|
+
"data-slot": "dropdown-menu-content",
|
|
1555
|
+
sideOffset,
|
|
1556
|
+
className: cn(
|
|
1557
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
1558
|
+
dropdownAnimation,
|
|
1559
|
+
className
|
|
1560
|
+
),
|
|
1561
|
+
...props
|
|
1562
|
+
}
|
|
1563
|
+
) }));
|
|
1564
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1565
|
+
var DropdownMenuItem = React18.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1566
|
+
DropdownMenuPrimitive.Item,
|
|
1567
|
+
{
|
|
1568
|
+
ref,
|
|
1569
|
+
"data-slot": "dropdown-menu-item",
|
|
1570
|
+
className: cn(dropdownItemStyles, inset && "pl-8", className),
|
|
1571
|
+
...props
|
|
1572
|
+
}
|
|
1573
|
+
));
|
|
1574
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1575
|
+
var DropdownMenuCheckboxItem = React18.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1576
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
1577
|
+
{
|
|
1578
|
+
ref,
|
|
1579
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
1580
|
+
className: cn(
|
|
1581
|
+
dropdownItemStyles,
|
|
1582
|
+
"pl-8 pr-2",
|
|
1583
|
+
className
|
|
1584
|
+
),
|
|
1585
|
+
checked,
|
|
1586
|
+
...props,
|
|
1587
|
+
children: [
|
|
1588
|
+
/* @__PURE__ */ jsx19("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx19(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx19(Check3, { className: "size-4" }) }) }),
|
|
1589
|
+
children
|
|
1590
|
+
]
|
|
1591
|
+
}
|
|
1592
|
+
));
|
|
1593
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1594
|
+
var DropdownMenuRadioItem = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
1595
|
+
DropdownMenuPrimitive.RadioItem,
|
|
1596
|
+
{
|
|
1597
|
+
ref,
|
|
1598
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
1599
|
+
className: cn(
|
|
1600
|
+
dropdownItemStyles,
|
|
1601
|
+
"pl-8 pr-2",
|
|
1602
|
+
className
|
|
1603
|
+
),
|
|
1604
|
+
...props,
|
|
1605
|
+
children: [
|
|
1606
|
+
/* @__PURE__ */ jsx19("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx19(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx19(Circle, { className: "size-2 fill-current" }) }) }),
|
|
1607
|
+
children
|
|
1608
|
+
]
|
|
1609
|
+
}
|
|
1610
|
+
));
|
|
1611
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1612
|
+
var DropdownMenuLabel = React18.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1613
|
+
DropdownMenuPrimitive.Label,
|
|
1614
|
+
{
|
|
1615
|
+
ref,
|
|
1616
|
+
"data-slot": "dropdown-menu-label",
|
|
1617
|
+
className: cn(
|
|
1618
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
1619
|
+
inset && "pl-8",
|
|
1620
|
+
className
|
|
1621
|
+
),
|
|
1622
|
+
...props
|
|
1623
|
+
}
|
|
1624
|
+
));
|
|
1625
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1626
|
+
var DropdownMenuSeparator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1627
|
+
DropdownMenuPrimitive.Separator,
|
|
1628
|
+
{
|
|
1629
|
+
ref,
|
|
1630
|
+
"data-slot": "dropdown-menu-separator",
|
|
1631
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
1632
|
+
...props
|
|
1633
|
+
}
|
|
1634
|
+
));
|
|
1635
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
1636
|
+
var DropdownMenuShortcut = ({
|
|
1637
|
+
className,
|
|
1638
|
+
...props
|
|
1639
|
+
}) => /* @__PURE__ */ jsx19(
|
|
1640
|
+
"span",
|
|
1641
|
+
{
|
|
1642
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
1643
|
+
className: cn(
|
|
1644
|
+
"ml-auto text-xs tracking-widest opacity-60",
|
|
1645
|
+
className
|
|
1646
|
+
),
|
|
1647
|
+
...props
|
|
1648
|
+
}
|
|
1649
|
+
);
|
|
1650
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1651
|
+
|
|
1652
|
+
// source/components/primitive/Drawer/drawer.tsx
|
|
1653
|
+
import * as React19 from "react";
|
|
1654
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
1655
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1656
|
+
var Drawer = ({
|
|
1657
|
+
shouldScaleBackground = true,
|
|
1658
|
+
...props
|
|
1659
|
+
}) => /* @__PURE__ */ jsx20(
|
|
1660
|
+
DrawerPrimitive.Root,
|
|
1661
|
+
{
|
|
1662
|
+
shouldScaleBackground,
|
|
1663
|
+
...props
|
|
1664
|
+
}
|
|
1665
|
+
);
|
|
1666
|
+
Drawer.displayName = "Drawer";
|
|
1667
|
+
var DrawerTrigger = DrawerPrimitive.Trigger;
|
|
1668
|
+
var DrawerPortal = DrawerPrimitive.Portal;
|
|
1669
|
+
var DrawerClose = DrawerPrimitive.Close;
|
|
1670
|
+
var DrawerOverlay = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
1671
|
+
DrawerPrimitive.Overlay,
|
|
1672
|
+
{
|
|
1673
|
+
ref,
|
|
1674
|
+
className: cn("fixed inset-0 z-50 bg-black/80", className),
|
|
1675
|
+
...props
|
|
1676
|
+
}
|
|
1677
|
+
));
|
|
1678
|
+
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
1679
|
+
var DrawerContent = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs12(DrawerPortal, { children: [
|
|
1680
|
+
/* @__PURE__ */ jsx20(DrawerOverlay, {}),
|
|
1681
|
+
/* @__PURE__ */ jsxs12(
|
|
1682
|
+
DrawerPrimitive.Content,
|
|
1683
|
+
{
|
|
1684
|
+
ref,
|
|
1685
|
+
className: cn(
|
|
1686
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
|
|
1687
|
+
className
|
|
1688
|
+
),
|
|
1689
|
+
...props,
|
|
1690
|
+
children: [
|
|
1691
|
+
/* @__PURE__ */ jsx20("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
|
|
1692
|
+
children
|
|
1693
|
+
]
|
|
1694
|
+
}
|
|
1695
|
+
)
|
|
1696
|
+
] }));
|
|
1697
|
+
DrawerContent.displayName = "DrawerContent";
|
|
1698
|
+
var DrawerHeader = ({
|
|
1699
|
+
className,
|
|
1700
|
+
...props
|
|
1701
|
+
}) => /* @__PURE__ */ jsx20(
|
|
1702
|
+
"div",
|
|
1703
|
+
{
|
|
1704
|
+
className: cn("grid gap-1.5 p-4 text-center sm:text-left", className),
|
|
1705
|
+
...props
|
|
1706
|
+
}
|
|
1707
|
+
);
|
|
1708
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
1709
|
+
var DrawerFooter = ({
|
|
1710
|
+
className,
|
|
1711
|
+
...props
|
|
1712
|
+
}) => /* @__PURE__ */ jsx20(
|
|
1713
|
+
"div",
|
|
1714
|
+
{
|
|
1715
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
1716
|
+
...props
|
|
1717
|
+
}
|
|
1718
|
+
);
|
|
1719
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
1720
|
+
var DrawerTitle = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
1721
|
+
DrawerPrimitive.Title,
|
|
1722
|
+
{
|
|
1723
|
+
ref,
|
|
1724
|
+
className: cn(
|
|
1725
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
1726
|
+
className
|
|
1727
|
+
),
|
|
1728
|
+
...props
|
|
1729
|
+
}
|
|
1730
|
+
));
|
|
1731
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
1732
|
+
var DrawerDescription = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
1733
|
+
DrawerPrimitive.Description,
|
|
1734
|
+
{
|
|
1735
|
+
ref,
|
|
1736
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
1737
|
+
...props
|
|
1738
|
+
}
|
|
1739
|
+
));
|
|
1740
|
+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
1741
|
+
|
|
1742
|
+
// source/components/primitive/FileDropzone/file-dropzone.tsx
|
|
1743
|
+
import * as React20 from "react";
|
|
1744
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1745
|
+
var FileDropzone = React20.forwardRef(
|
|
1746
|
+
({
|
|
1747
|
+
className,
|
|
1748
|
+
id,
|
|
1749
|
+
name,
|
|
1750
|
+
error,
|
|
1751
|
+
disabled,
|
|
1752
|
+
multiple,
|
|
1753
|
+
onBlur,
|
|
1754
|
+
onChange,
|
|
1755
|
+
onFilesSelected,
|
|
1756
|
+
accept,
|
|
1757
|
+
helperText,
|
|
1758
|
+
value: _value,
|
|
1759
|
+
...props
|
|
1760
|
+
}, ref) => {
|
|
1761
|
+
const inputRef = React20.useRef(null);
|
|
1762
|
+
const [isDragging, setIsDragging] = React20.useState(false);
|
|
1763
|
+
const [selectedFiles, setSelectedFiles] = React20.useState([]);
|
|
1764
|
+
React20.useEffect(() => {
|
|
1765
|
+
const v = _value;
|
|
1766
|
+
if (v === null) {
|
|
1767
|
+
setSelectedFiles([]);
|
|
1768
|
+
if (inputRef.current) inputRef.current.value = "";
|
|
1769
|
+
return;
|
|
1770
|
+
}
|
|
1771
|
+
if (typeof FileList !== "undefined" && v instanceof FileList) {
|
|
1772
|
+
if (v.length === 0) {
|
|
1773
|
+
setSelectedFiles([]);
|
|
1774
|
+
if (inputRef.current) inputRef.current.value = "";
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
setSelectedFiles(Array.from(v));
|
|
1778
|
+
const node = inputRef.current;
|
|
1779
|
+
if (!node) return;
|
|
1780
|
+
const transfer = new DataTransfer();
|
|
1781
|
+
for (const f of Array.from(v)) transfer.items.add(f);
|
|
1782
|
+
try {
|
|
1783
|
+
node.files = transfer.files;
|
|
1784
|
+
} catch {
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
}, [_value]);
|
|
1788
|
+
const assignRef = React20.useCallback(
|
|
1789
|
+
(node) => {
|
|
1790
|
+
inputRef.current = node;
|
|
1791
|
+
if (!ref) return;
|
|
1792
|
+
if (typeof ref === "function") {
|
|
1793
|
+
ref(node);
|
|
1794
|
+
return;
|
|
1795
|
+
}
|
|
1796
|
+
ref.current = node;
|
|
1797
|
+
},
|
|
1798
|
+
[ref]
|
|
1799
|
+
);
|
|
1800
|
+
const notifyChange = React20.useCallback(
|
|
1801
|
+
(files) => {
|
|
1802
|
+
setSelectedFiles(files);
|
|
1803
|
+
onFilesSelected?.(files);
|
|
1804
|
+
const node = inputRef.current;
|
|
1805
|
+
if (!node) return;
|
|
1806
|
+
const transfer = new DataTransfer();
|
|
1807
|
+
for (const file of files) transfer.items.add(file);
|
|
1808
|
+
try {
|
|
1809
|
+
node.files = transfer.files;
|
|
1810
|
+
const event = {
|
|
1811
|
+
target: node
|
|
1812
|
+
};
|
|
1813
|
+
onChange?.(event);
|
|
1814
|
+
} catch {
|
|
1815
|
+
onChange?.({
|
|
1816
|
+
target: {
|
|
1817
|
+
name,
|
|
1818
|
+
files: transfer.files
|
|
1819
|
+
}
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1822
|
+
},
|
|
1823
|
+
[name, onChange, onFilesSelected]
|
|
1824
|
+
);
|
|
1825
|
+
const handleNativeChange = (event) => {
|
|
1826
|
+
const files = Array.from(event.target.files ?? []);
|
|
1827
|
+
setSelectedFiles(files);
|
|
1828
|
+
onFilesSelected?.(files);
|
|
1829
|
+
onChange?.(event);
|
|
1830
|
+
};
|
|
1831
|
+
const handleDrop = (event) => {
|
|
1832
|
+
event.preventDefault();
|
|
1833
|
+
event.stopPropagation();
|
|
1834
|
+
setIsDragging(false);
|
|
1835
|
+
if (disabled) return;
|
|
1836
|
+
const dropped = Array.from(event.dataTransfer.files ?? []);
|
|
1837
|
+
if (dropped.length === 0) return;
|
|
1838
|
+
notifyChange(multiple ? dropped : [dropped[0]]);
|
|
1839
|
+
};
|
|
1840
|
+
const openPicker = () => {
|
|
1841
|
+
if (disabled) return;
|
|
1842
|
+
inputRef.current?.click();
|
|
1843
|
+
};
|
|
1844
|
+
const fileLabel = selectedFiles.length === 0 ? "Drop file(s) here or click to browse" : selectedFiles.map((file) => file.name).join(", ");
|
|
1845
|
+
return /* @__PURE__ */ jsxs13("div", { className: "w-full min-w-0 space-y-2", children: [
|
|
1846
|
+
/* @__PURE__ */ jsx21(
|
|
1847
|
+
"input",
|
|
1848
|
+
{
|
|
1849
|
+
...props,
|
|
1850
|
+
ref: assignRef,
|
|
1851
|
+
id,
|
|
1852
|
+
name,
|
|
1853
|
+
type: "file",
|
|
1854
|
+
accept,
|
|
1855
|
+
disabled,
|
|
1856
|
+
multiple,
|
|
1857
|
+
className: "sr-only",
|
|
1858
|
+
onBlur,
|
|
1859
|
+
onChange: handleNativeChange
|
|
1860
|
+
}
|
|
1861
|
+
),
|
|
1862
|
+
/* @__PURE__ */ jsx21(
|
|
1863
|
+
"div",
|
|
1864
|
+
{
|
|
1865
|
+
role: "button",
|
|
1866
|
+
tabIndex: disabled ? -1 : 0,
|
|
1867
|
+
"aria-disabled": disabled || void 0,
|
|
1868
|
+
"aria-invalid": error || void 0,
|
|
1869
|
+
onClick: openPicker,
|
|
1870
|
+
onDrop: handleDrop,
|
|
1871
|
+
onDragOver: (event) => {
|
|
1872
|
+
event.preventDefault();
|
|
1873
|
+
if (!disabled) setIsDragging(true);
|
|
1874
|
+
},
|
|
1875
|
+
onDragLeave: (event) => {
|
|
1876
|
+
event.preventDefault();
|
|
1877
|
+
setIsDragging(false);
|
|
1878
|
+
},
|
|
1879
|
+
onKeyDown: (event) => {
|
|
1880
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
1881
|
+
event.preventDefault();
|
|
1882
|
+
openPicker();
|
|
1883
|
+
}
|
|
1884
|
+
},
|
|
1885
|
+
className: cn(
|
|
1886
|
+
"flex min-h-28 w-full cursor-pointer items-center justify-center px-4 py-5 text-sm text-muted-foreground",
|
|
1887
|
+
inputSurfaceDashed,
|
|
1888
|
+
disabled && "pointer-events-none cursor-not-allowed opacity-[0.38] backdrop-blur-sm shadow-none ring-0 border-white/14 dark:border-white/8",
|
|
1889
|
+
isDragging && !disabled && inputSurfaceDashedDragOver,
|
|
1890
|
+
error && inputSurfaceFieldInvalid,
|
|
1891
|
+
className
|
|
1892
|
+
),
|
|
1893
|
+
children: /* @__PURE__ */ jsx21("span", { className: "text-center", children: fileLabel })
|
|
1894
|
+
}
|
|
1895
|
+
),
|
|
1896
|
+
helperText && /* @__PURE__ */ jsx21("p", { className: "text-xs text-muted-foreground", children: helperText })
|
|
1897
|
+
] });
|
|
1898
|
+
}
|
|
1899
|
+
);
|
|
1900
|
+
FileDropzone.displayName = "FileDropzone";
|
|
1901
|
+
|
|
1902
|
+
// source/components/primitive/FormField/form-field.tsx
|
|
1903
|
+
import * as React29 from "react";
|
|
1904
|
+
import {
|
|
1905
|
+
Controller
|
|
1906
|
+
} from "react-hook-form";
|
|
1907
|
+
|
|
1908
|
+
// source/components/primitive/InputOtp/input-otp.tsx
|
|
1909
|
+
import * as React21 from "react";
|
|
1910
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
|
1911
|
+
import { Dot } from "lucide-react";
|
|
1912
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1913
|
+
var InputOTPInvalidContext = React21.createContext(false);
|
|
1914
|
+
var slotLayout = "relative flex h-11 w-10 min-w-0 items-center justify-center rounded-xl px-0 py-0 text-base font-medium tabular-nums";
|
|
1915
|
+
var InputOTP = React21.forwardRef(({ className, containerClassName, invalid, children, render, ...props }, ref) => /* @__PURE__ */ jsx22(InputOTPInvalidContext.Provider, { value: Boolean(invalid), children: /* @__PURE__ */ jsx22(
|
|
1916
|
+
OTPInput,
|
|
1917
|
+
{
|
|
1918
|
+
ref,
|
|
1919
|
+
inputMode: "numeric",
|
|
1920
|
+
autoComplete: "one-time-code",
|
|
1921
|
+
containerClassName: cn(
|
|
1922
|
+
"flex w-full min-w-0 items-center gap-2 has-[:disabled]:opacity-[0.38]",
|
|
1923
|
+
containerClassName
|
|
1924
|
+
),
|
|
1925
|
+
className: cn(inputSurfaceFieldDisabled, className),
|
|
1926
|
+
...props,
|
|
1927
|
+
...render != null ? { render } : { children }
|
|
1928
|
+
}
|
|
1929
|
+
) }));
|
|
1930
|
+
InputOTP.displayName = "InputOTP";
|
|
1931
|
+
var InputOTPGroup = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
1932
|
+
"div",
|
|
1933
|
+
{
|
|
1934
|
+
ref,
|
|
1935
|
+
className: cn("flex w-full min-w-0 items-center gap-2.5", className),
|
|
1936
|
+
...props
|
|
1937
|
+
}
|
|
1938
|
+
));
|
|
1939
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1940
|
+
var InputOTPSlot = React21.memo(
|
|
1941
|
+
React21.forwardRef(({ index, className, ...props }, ref) => {
|
|
1942
|
+
const ctx = React21.useContext(OTPInputContext);
|
|
1943
|
+
const invalid = React21.useContext(InputOTPInvalidContext);
|
|
1944
|
+
const slot = ctx?.slots?.[index];
|
|
1945
|
+
if (!slot) return null;
|
|
1946
|
+
const { char, hasFakeCaret, isActive } = slot;
|
|
1947
|
+
return /* @__PURE__ */ jsxs14(
|
|
1948
|
+
"div",
|
|
1949
|
+
{
|
|
1950
|
+
ref,
|
|
1951
|
+
"data-slot": "input-otp-slot",
|
|
1952
|
+
className: cn(
|
|
1953
|
+
slotLayout,
|
|
1954
|
+
inputSurfaceOtpSlot,
|
|
1955
|
+
isActive && (invalid ? "z-10 border-rose-500/75 dark:border-rose-400/60 shadow-[inset_0_2px_8px_rgb(244_63_94/0.12)] ring-2 ring-rose-500/30 dark:ring-rose-400/25 ring-offset-0" : "z-10 border-primary shadow-[inset_0_2px_8px_rgb(0_0_0/0.06)] ring-2 ring-primary/30 ring-offset-0"),
|
|
1956
|
+
className
|
|
1957
|
+
),
|
|
1958
|
+
...props,
|
|
1959
|
+
children: [
|
|
1960
|
+
char,
|
|
1961
|
+
hasFakeCaret && /* @__PURE__ */ jsx22("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx22("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) })
|
|
1962
|
+
]
|
|
1963
|
+
}
|
|
1964
|
+
);
|
|
1965
|
+
})
|
|
1966
|
+
);
|
|
1967
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
1968
|
+
var InputOTPSeparator = React21.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx22("div", { ref, role: "separator", ...props, children: children ?? /* @__PURE__ */ jsx22(Dot, {}) }));
|
|
1969
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
1970
|
+
|
|
1971
|
+
// source/components/primitive/Input/input.tsx
|
|
1972
|
+
import * as React22 from "react";
|
|
1973
|
+
import { cva as cva7 } from "class-variance-authority";
|
|
1974
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1975
|
+
var inputVariants = cva7(
|
|
1976
|
+
[
|
|
1977
|
+
"block w-full appearance-none px-4 text-base md:text-sm",
|
|
1978
|
+
"file:mr-4 file:rounded-md file:border-0 file:bg-secondary file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-foreground file:cursor-pointer",
|
|
1979
|
+
inputSurfaceField,
|
|
1980
|
+
inputSurfaceFieldDisabled
|
|
1981
|
+
].join(" "),
|
|
1982
|
+
{
|
|
1983
|
+
variants: {
|
|
1984
|
+
size: {
|
|
1985
|
+
/** Default `h-11` (44px). */
|
|
1986
|
+
default: "h-11",
|
|
1987
|
+
sm: "h-9 px-3 text-sm",
|
|
1988
|
+
lg: "h-[52px] px-5 text-base"
|
|
1989
|
+
}
|
|
1990
|
+
},
|
|
1991
|
+
defaultVariants: {
|
|
1992
|
+
size: "default"
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
);
|
|
1996
|
+
var Input = React22.forwardRef(
|
|
1997
|
+
({ className, type, size, invalid, error, ...props }, ref) => {
|
|
1998
|
+
const isInvalid = error ?? invalid;
|
|
1999
|
+
return /* @__PURE__ */ jsx23(
|
|
2000
|
+
"input",
|
|
2001
|
+
{
|
|
2002
|
+
ref,
|
|
2003
|
+
type,
|
|
2004
|
+
"aria-invalid": isInvalid || void 0,
|
|
2005
|
+
"data-invalid": isInvalid || void 0,
|
|
2006
|
+
className: cn(
|
|
2007
|
+
inputVariants({ size }),
|
|
2008
|
+
isInvalid && inputSurfaceFieldInvalid,
|
|
2009
|
+
className
|
|
2010
|
+
),
|
|
2011
|
+
...props
|
|
2012
|
+
}
|
|
2013
|
+
);
|
|
2014
|
+
}
|
|
2015
|
+
);
|
|
2016
|
+
Input.displayName = "Input";
|
|
2017
|
+
|
|
2018
|
+
// source/components/primitive/Label/label.tsx
|
|
2019
|
+
import * as React23 from "react";
|
|
2020
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2021
|
+
import { cva as cva8 } from "class-variance-authority";
|
|
2022
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2023
|
+
var labelVariants = cva8(
|
|
2024
|
+
"font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2025
|
+
{
|
|
2026
|
+
variants: {
|
|
2027
|
+
tone: {
|
|
2028
|
+
default: "text-foreground",
|
|
2029
|
+
muted: "text-muted-foreground"
|
|
2030
|
+
},
|
|
2031
|
+
size: {
|
|
2032
|
+
sm: "text-xs",
|
|
2033
|
+
md: "text-sm",
|
|
2034
|
+
lg: "text-base"
|
|
2035
|
+
}
|
|
2036
|
+
},
|
|
2037
|
+
defaultVariants: {
|
|
2038
|
+
tone: "default",
|
|
2039
|
+
size: "md"
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
);
|
|
2043
|
+
var Label2 = React23.forwardRef(({ className, tone, size, required, children, ...props }, ref) => /* @__PURE__ */ jsxs15(
|
|
2044
|
+
LabelPrimitive.Root,
|
|
2045
|
+
{
|
|
2046
|
+
ref,
|
|
2047
|
+
className: cn(labelVariants({ tone, size }), className),
|
|
2048
|
+
...props,
|
|
2049
|
+
children: [
|
|
2050
|
+
children,
|
|
2051
|
+
required && /* @__PURE__ */ jsx24("span", { className: "ml-0.5 text-destructive", children: "*" })
|
|
2052
|
+
]
|
|
2053
|
+
}
|
|
2054
|
+
));
|
|
2055
|
+
Label2.displayName = LabelPrimitive.Root.displayName;
|
|
2056
|
+
|
|
2057
|
+
// source/components/primitive/RadioGroup/radiogroup.tsx
|
|
2058
|
+
import * as React24 from "react";
|
|
2059
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
2060
|
+
import { Circle as Circle2 } from "lucide-react";
|
|
2061
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2062
|
+
var RadioGroup2 = React24.forwardRef(({ className, ...props }, ref) => {
|
|
2063
|
+
return /* @__PURE__ */ jsx25(
|
|
2064
|
+
RadioGroupPrimitive.Root,
|
|
2065
|
+
{
|
|
2066
|
+
ref,
|
|
2067
|
+
className: cn("grid gap-2", className),
|
|
2068
|
+
...props
|
|
2069
|
+
}
|
|
2070
|
+
);
|
|
2071
|
+
});
|
|
2072
|
+
RadioGroup2.displayName = "RadioGroup";
|
|
2073
|
+
var RadioGroupItem = React24.forwardRef(({ className, ...props }, ref) => {
|
|
2074
|
+
return /* @__PURE__ */ jsx25(
|
|
2075
|
+
RadioGroupPrimitive.Item,
|
|
2076
|
+
{
|
|
2077
|
+
ref,
|
|
2078
|
+
className: cn(
|
|
2079
|
+
"aspect-square h-4 w-4 rounded-full border border-primary text-primary",
|
|
2080
|
+
"ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
2081
|
+
"data-[state=checked]:border-primary",
|
|
2082
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
2083
|
+
className
|
|
2084
|
+
),
|
|
2085
|
+
...props,
|
|
2086
|
+
children: /* @__PURE__ */ jsx25(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx25(Circle2, { className: "h-2.5 w-2.5 shrink-0 fill-current text-current" }) })
|
|
2087
|
+
}
|
|
2088
|
+
);
|
|
2089
|
+
});
|
|
2090
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
2091
|
+
|
|
2092
|
+
// source/components/primitive/RichTextArea/richtext-editor.tsx
|
|
2093
|
+
import { EditorContent, useEditor } from "@tiptap/react";
|
|
2094
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
2095
|
+
import Placeholder from "@tiptap/extension-placeholder";
|
|
2096
|
+
import Image2 from "@tiptap/extension-image";
|
|
2097
|
+
import Link from "@tiptap/extension-link";
|
|
2098
|
+
|
|
2099
|
+
// source/components/primitive/RichTextArea/richtext-toolbar.tsx
|
|
2100
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2101
|
+
function RichTextToolbar({ editor }) {
|
|
2102
|
+
if (!editor) return null;
|
|
2103
|
+
return /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-2 border-b p-2", children: [
|
|
2104
|
+
/* @__PURE__ */ jsx26("button", { onClick: () => editor.chain().focus().toggleBold().run(), children: "Bold" }),
|
|
2105
|
+
/* @__PURE__ */ jsx26("button", { onClick: () => editor.chain().focus().toggleItalic().run(), children: "Italic" }),
|
|
2106
|
+
/* @__PURE__ */ jsx26("button", { onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(), children: "H2" }),
|
|
2107
|
+
/* @__PURE__ */ jsx26("button", { onClick: () => editor.chain().focus().toggleBulletList().run(), children: "List" }),
|
|
2108
|
+
/* @__PURE__ */ jsx26("button", { onClick: () => editor.chain().focus().toggleCodeBlock().run(), children: "Code" })
|
|
2109
|
+
] });
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
// source/components/primitive/RichTextArea/richtext-editor.tsx
|
|
2113
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2114
|
+
var RichTextEditor = ({
|
|
2115
|
+
value,
|
|
2116
|
+
onChange,
|
|
2117
|
+
placeholder,
|
|
2118
|
+
className,
|
|
2119
|
+
disabled
|
|
2120
|
+
}) => {
|
|
2121
|
+
const editor = useEditor({
|
|
2122
|
+
extensions: [
|
|
2123
|
+
StarterKit,
|
|
2124
|
+
Image2,
|
|
2125
|
+
Link,
|
|
2126
|
+
Placeholder.configure({
|
|
2127
|
+
placeholder: placeholder ?? "Start writing..."
|
|
2128
|
+
})
|
|
2129
|
+
],
|
|
2130
|
+
content: value,
|
|
2131
|
+
editable: !disabled,
|
|
2132
|
+
onUpdate({ editor: editor2 }) {
|
|
2133
|
+
onChange?.(editor2.getHTML());
|
|
2134
|
+
}
|
|
2135
|
+
});
|
|
2136
|
+
if (!editor) return null;
|
|
2137
|
+
return /* @__PURE__ */ jsxs17(
|
|
2138
|
+
"div",
|
|
2139
|
+
{
|
|
2140
|
+
className: cn(
|
|
2141
|
+
"w-full overflow-hidden",
|
|
2142
|
+
inputSurfaceContainer,
|
|
2143
|
+
inputSurfaceContainerDisabled,
|
|
2144
|
+
className
|
|
2145
|
+
),
|
|
2146
|
+
children: [
|
|
2147
|
+
/* @__PURE__ */ jsx27(RichTextToolbar, { editor }),
|
|
2148
|
+
/* @__PURE__ */ jsx27(
|
|
2149
|
+
EditorContent,
|
|
2150
|
+
{
|
|
2151
|
+
editor,
|
|
2152
|
+
className: "min-h-[200px] px-4 py-3 text-sm outline-none"
|
|
2153
|
+
}
|
|
2154
|
+
)
|
|
2155
|
+
]
|
|
2156
|
+
}
|
|
2157
|
+
);
|
|
2158
|
+
};
|
|
2159
|
+
|
|
2160
|
+
// source/components/primitive/Select/select.tsx
|
|
2161
|
+
import * as React25 from "react";
|
|
2162
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2163
|
+
import { Check as Check4, ChevronDown as ChevronDown3, ChevronUp } from "lucide-react";
|
|
2164
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2165
|
+
var Select = SelectPrimitive.Root;
|
|
2166
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
2167
|
+
var SelectValue = SelectPrimitive.Value;
|
|
2168
|
+
var SelectTrigger = React25.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs18(
|
|
2169
|
+
SelectPrimitive.Trigger,
|
|
2170
|
+
{
|
|
2171
|
+
ref,
|
|
2172
|
+
className: cn(
|
|
2173
|
+
"flex h-11 w-full appearance-none items-center justify-between gap-2 px-4 text-base md:text-sm",
|
|
2174
|
+
inputSurfaceField,
|
|
2175
|
+
inputSurfaceFieldDisabled,
|
|
2176
|
+
"[&>span]:line-clamp-1 [&>span]:text-inherit [&_svg]:text-slate-500 dark:[&_svg]:text-slate-400",
|
|
2177
|
+
className
|
|
2178
|
+
),
|
|
2179
|
+
...props,
|
|
2180
|
+
children: [
|
|
2181
|
+
children,
|
|
2182
|
+
/* @__PURE__ */ jsx28(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
2183
|
+
ChevronDown3,
|
|
2184
|
+
{
|
|
2185
|
+
"aria-hidden": "true",
|
|
2186
|
+
className: "h-4 w-4 shrink-0"
|
|
2187
|
+
}
|
|
2188
|
+
) })
|
|
2189
|
+
]
|
|
2190
|
+
}
|
|
2191
|
+
));
|
|
2192
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
2193
|
+
var SelectScrollUpButton = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
2194
|
+
SelectPrimitive.ScrollUpButton,
|
|
2195
|
+
{
|
|
2196
|
+
ref,
|
|
2197
|
+
className: cn(
|
|
2198
|
+
"flex cursor-default items-center justify-center py-1",
|
|
2199
|
+
className
|
|
2200
|
+
),
|
|
2201
|
+
...props,
|
|
2202
|
+
children: /* @__PURE__ */ jsx28(ChevronUp, { className: "h-4 w-4" })
|
|
2203
|
+
}
|
|
2204
|
+
));
|
|
2205
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
2206
|
+
var SelectScrollDownButton = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
2207
|
+
SelectPrimitive.ScrollDownButton,
|
|
2208
|
+
{
|
|
2209
|
+
ref,
|
|
2210
|
+
className: cn(
|
|
2211
|
+
"flex cursor-default items-center justify-center py-1",
|
|
2212
|
+
className
|
|
2213
|
+
),
|
|
2214
|
+
...props,
|
|
2215
|
+
children: /* @__PURE__ */ jsx28(ChevronDown3, { className: "h-4 w-4" })
|
|
2216
|
+
}
|
|
2217
|
+
));
|
|
2218
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
2219
|
+
var SelectContent = React25.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx28(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs18(
|
|
2220
|
+
SelectPrimitive.Content,
|
|
2221
|
+
{
|
|
2222
|
+
ref,
|
|
2223
|
+
className: cn(
|
|
2224
|
+
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
|
|
2225
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
2226
|
+
className
|
|
2227
|
+
),
|
|
2228
|
+
position,
|
|
2229
|
+
...props,
|
|
2230
|
+
children: [
|
|
2231
|
+
/* @__PURE__ */ jsx28(SelectScrollUpButton, {}),
|
|
2232
|
+
/* @__PURE__ */ jsx28(
|
|
2233
|
+
SelectPrimitive.Viewport,
|
|
2234
|
+
{
|
|
2235
|
+
className: cn(
|
|
2236
|
+
"p-1",
|
|
2237
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
2238
|
+
),
|
|
2239
|
+
children
|
|
2240
|
+
}
|
|
2241
|
+
),
|
|
2242
|
+
/* @__PURE__ */ jsx28(SelectScrollDownButton, {})
|
|
2243
|
+
]
|
|
2244
|
+
}
|
|
2245
|
+
) }));
|
|
2246
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2247
|
+
var SelectLabel = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
2248
|
+
SelectPrimitive.Label,
|
|
2249
|
+
{
|
|
2250
|
+
ref,
|
|
2251
|
+
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
2252
|
+
...props
|
|
2253
|
+
}
|
|
2254
|
+
));
|
|
2255
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2256
|
+
var SelectItem = React25.forwardRef(({ value, className, children, ...props }, ref) => {
|
|
2257
|
+
if (value === "") {
|
|
2258
|
+
throw new Error(
|
|
2259
|
+
'SelectItem: `value` must not be an empty string \u2014 Radix uses "" to reset the Select and show the placeholder. Omit that option and use `<SelectValue placeholder="\u2026">`, or assign a sentinel value such as `"none"`.'
|
|
2260
|
+
);
|
|
2261
|
+
}
|
|
2262
|
+
return /* @__PURE__ */ jsxs18(
|
|
2263
|
+
SelectPrimitive.Item,
|
|
2264
|
+
{
|
|
2265
|
+
ref,
|
|
2266
|
+
value,
|
|
2267
|
+
className: cn(
|
|
2268
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2269
|
+
className
|
|
2270
|
+
),
|
|
2271
|
+
...props,
|
|
2272
|
+
children: [
|
|
2273
|
+
/* @__PURE__ */ jsx28("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx28(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx28(Check4, { className: "h-4 w-4" }) }) }),
|
|
2274
|
+
/* @__PURE__ */ jsx28(SelectPrimitive.ItemText, { children })
|
|
2275
|
+
]
|
|
2276
|
+
}
|
|
2277
|
+
);
|
|
2278
|
+
});
|
|
2279
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2280
|
+
var SelectSeparator = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
2281
|
+
SelectPrimitive.Separator,
|
|
2282
|
+
{
|
|
2283
|
+
ref,
|
|
2284
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
2285
|
+
...props
|
|
2286
|
+
}
|
|
2287
|
+
));
|
|
2288
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
2289
|
+
|
|
2290
|
+
// source/components/primitive/Switch/switch.tsx
|
|
2291
|
+
import * as React26 from "react";
|
|
2292
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
2293
|
+
import { cva as cva9 } from "class-variance-authority";
|
|
2294
|
+
import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2295
|
+
var switchRootVariants = cva9(
|
|
2296
|
+
[
|
|
2297
|
+
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
|
|
2298
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
2299
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
2300
|
+
"data-[state=checked]:bg-primary data-[state=unchecked]:bg-input"
|
|
2301
|
+
].join(" "),
|
|
2302
|
+
{
|
|
2303
|
+
variants: {
|
|
2304
|
+
size: {
|
|
2305
|
+
default: "h-6 w-11",
|
|
2306
|
+
sm: "h-5 w-9"
|
|
2307
|
+
}
|
|
2308
|
+
},
|
|
2309
|
+
defaultVariants: {
|
|
2310
|
+
size: "default"
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
);
|
|
2314
|
+
var switchThumbVariants = cva9(
|
|
2315
|
+
"pointer-events-none block rounded-full bg-background shadow-lg transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
2316
|
+
{
|
|
2317
|
+
variants: {
|
|
2318
|
+
size: {
|
|
2319
|
+
default: "h-5 w-5",
|
|
2320
|
+
sm: "h-4 w-4 data-[state=checked]:translate-x-4"
|
|
2321
|
+
}
|
|
2322
|
+
},
|
|
2323
|
+
defaultVariants: {
|
|
2324
|
+
size: "default"
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
);
|
|
2328
|
+
var Switch = React26.forwardRef(
|
|
2329
|
+
({ className, label, description, error, size, id: idProp, ...props }, ref) => {
|
|
2330
|
+
const generatedId = React26.useId();
|
|
2331
|
+
const id = idProp ?? generatedId;
|
|
2332
|
+
const descriptionId = description ? `${id}-description` : void 0;
|
|
2333
|
+
const errorId = error ? `${id}-error` : void 0;
|
|
2334
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex items-start gap-3", children: [
|
|
2335
|
+
/* @__PURE__ */ jsx29(
|
|
2336
|
+
SwitchPrimitives.Root,
|
|
2337
|
+
{
|
|
2338
|
+
ref,
|
|
2339
|
+
id,
|
|
2340
|
+
"aria-describedby": [descriptionId, errorId].filter(Boolean).join(" ") || void 0,
|
|
2341
|
+
"aria-invalid": !!error,
|
|
2342
|
+
className: cn(
|
|
2343
|
+
switchRootVariants({ size }),
|
|
2344
|
+
error && "border-destructive",
|
|
2345
|
+
className
|
|
2346
|
+
),
|
|
2347
|
+
...props,
|
|
2348
|
+
children: /* @__PURE__ */ jsx29(
|
|
2349
|
+
SwitchPrimitives.Thumb,
|
|
2350
|
+
{
|
|
2351
|
+
className: cn(switchThumbVariants({ size }))
|
|
2352
|
+
}
|
|
2353
|
+
)
|
|
2354
|
+
}
|
|
2355
|
+
),
|
|
2356
|
+
(label || description || error) && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col leading-tight", children: [
|
|
2357
|
+
label && /* @__PURE__ */ jsx29(
|
|
2358
|
+
"label",
|
|
2359
|
+
{
|
|
2360
|
+
htmlFor: id,
|
|
2361
|
+
className: "text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2362
|
+
children: label
|
|
2363
|
+
}
|
|
2364
|
+
),
|
|
2365
|
+
description && /* @__PURE__ */ jsx29(
|
|
2366
|
+
"p",
|
|
2367
|
+
{
|
|
2368
|
+
id: descriptionId,
|
|
2369
|
+
className: "text-sm text-muted-foreground",
|
|
2370
|
+
children: description
|
|
2371
|
+
}
|
|
2372
|
+
),
|
|
2373
|
+
error && /* @__PURE__ */ jsx29(
|
|
2374
|
+
"p",
|
|
2375
|
+
{
|
|
2376
|
+
id: errorId,
|
|
2377
|
+
className: "text-sm text-destructive",
|
|
2378
|
+
children: error
|
|
2379
|
+
}
|
|
2380
|
+
)
|
|
2381
|
+
] })
|
|
2382
|
+
] });
|
|
2383
|
+
}
|
|
2384
|
+
);
|
|
2385
|
+
Switch.displayName = "Switch";
|
|
2386
|
+
|
|
2387
|
+
// source/components/primitive/Text/text.tsx
|
|
2388
|
+
import * as React27 from "react";
|
|
2389
|
+
import { cva as cva10 } from "class-variance-authority";
|
|
2390
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2391
|
+
var textVariants = cva10("text-foreground", {
|
|
2392
|
+
variants: {
|
|
2393
|
+
element: {
|
|
2394
|
+
p: "block",
|
|
2395
|
+
span: "inline",
|
|
2396
|
+
label: "inline-block",
|
|
2397
|
+
div: "block"
|
|
2398
|
+
},
|
|
2399
|
+
size: {
|
|
2400
|
+
xs: "text-xs",
|
|
2401
|
+
sm: "text-sm",
|
|
2402
|
+
base: "text-base",
|
|
2403
|
+
lg: "text-lg",
|
|
2404
|
+
xl: "text-xl",
|
|
2405
|
+
"2xl": "text-2xl",
|
|
2406
|
+
"3xl": "text-3xl",
|
|
2407
|
+
"4xl": "text-4xl"
|
|
2408
|
+
},
|
|
2409
|
+
weight: {
|
|
2410
|
+
normal: "font-normal",
|
|
2411
|
+
medium: "font-medium",
|
|
2412
|
+
semibold: "font-semibold",
|
|
2413
|
+
bold: "font-bold"
|
|
2414
|
+
},
|
|
2415
|
+
tone: {
|
|
2416
|
+
default: "text-foreground",
|
|
2417
|
+
muted: "text-muted-foreground",
|
|
2418
|
+
subtle: "text-muted-foreground/70",
|
|
2419
|
+
destructive: "text-destructive",
|
|
2420
|
+
success: "text-green-600",
|
|
2421
|
+
warning: "text-yellow-600"
|
|
2422
|
+
},
|
|
2423
|
+
align: {
|
|
2424
|
+
left: "text-left",
|
|
2425
|
+
center: "text-center",
|
|
2426
|
+
right: "text-right"
|
|
2427
|
+
},
|
|
2428
|
+
truncate: {
|
|
2429
|
+
true: "truncate"
|
|
2430
|
+
}
|
|
2431
|
+
},
|
|
2432
|
+
defaultVariants: {
|
|
2433
|
+
element: "p",
|
|
2434
|
+
size: "base",
|
|
2435
|
+
weight: "normal",
|
|
2436
|
+
tone: "default"
|
|
2437
|
+
}
|
|
2438
|
+
});
|
|
2439
|
+
var Text = React27.forwardRef(
|
|
2440
|
+
({
|
|
2441
|
+
element = "p",
|
|
2442
|
+
size,
|
|
2443
|
+
weight,
|
|
2444
|
+
tone,
|
|
2445
|
+
align,
|
|
2446
|
+
truncate,
|
|
2447
|
+
className,
|
|
2448
|
+
...props
|
|
2449
|
+
}, ref) => {
|
|
2450
|
+
const Comp = element;
|
|
2451
|
+
const variantElement = element === "div" ? "p" : element;
|
|
2452
|
+
return /* @__PURE__ */ jsx30(
|
|
2453
|
+
Comp,
|
|
2454
|
+
{
|
|
2455
|
+
ref,
|
|
2456
|
+
className: cn(
|
|
2457
|
+
textVariants({
|
|
2458
|
+
element: variantElement,
|
|
2459
|
+
size,
|
|
2460
|
+
weight,
|
|
2461
|
+
tone,
|
|
2462
|
+
align,
|
|
2463
|
+
truncate
|
|
2464
|
+
}),
|
|
2465
|
+
className
|
|
2466
|
+
),
|
|
2467
|
+
...props
|
|
2468
|
+
}
|
|
2469
|
+
);
|
|
2470
|
+
}
|
|
2471
|
+
);
|
|
2472
|
+
Text.displayName = "Text";
|
|
2473
|
+
|
|
2474
|
+
// source/components/primitive/TextArea/textarea.tsx
|
|
2475
|
+
import * as React28 from "react";
|
|
2476
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2477
|
+
var resizeClasses = {
|
|
2478
|
+
none: "resize-none",
|
|
2479
|
+
vertical: "resize-y",
|
|
2480
|
+
horizontal: "resize-x",
|
|
2481
|
+
both: "resize"
|
|
2482
|
+
};
|
|
2483
|
+
var layout = "block min-h-[120px] w-full min-w-0 px-4 py-2 text-sm md:text-base";
|
|
2484
|
+
var Textarea = React28.forwardRef(
|
|
2485
|
+
({ className, error, resize = "vertical", ...props }, ref) => {
|
|
2486
|
+
return /* @__PURE__ */ jsx31(
|
|
2487
|
+
"textarea",
|
|
2488
|
+
{
|
|
2489
|
+
ref,
|
|
2490
|
+
"aria-invalid": error || void 0,
|
|
2491
|
+
"data-invalid": error ? "" : void 0,
|
|
2492
|
+
className: cn(
|
|
2493
|
+
layout,
|
|
2494
|
+
resizeClasses[resize],
|
|
2495
|
+
inputSurfaceField,
|
|
2496
|
+
inputSurfaceFieldDisabled,
|
|
2497
|
+
error && inputSurfaceFieldInvalid,
|
|
2498
|
+
className
|
|
2499
|
+
),
|
|
2500
|
+
...props
|
|
2501
|
+
}
|
|
2502
|
+
);
|
|
2503
|
+
}
|
|
2504
|
+
);
|
|
2505
|
+
Textarea.displayName = "Textarea";
|
|
2506
|
+
|
|
2507
|
+
// source/components/primitive/FormField/form-field.tsx
|
|
2508
|
+
import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2509
|
+
var VARIANTS_NEED_CONTROL = [
|
|
2510
|
+
"checkbox",
|
|
2511
|
+
"switch",
|
|
2512
|
+
"select",
|
|
2513
|
+
"async-select",
|
|
2514
|
+
"radio",
|
|
2515
|
+
"otp",
|
|
2516
|
+
"richtext",
|
|
2517
|
+
"dropzone"
|
|
2518
|
+
];
|
|
2519
|
+
function defaultOtpGroups(maxLength) {
|
|
2520
|
+
return [Array.from({ length: maxLength }, (_, i) => i)];
|
|
2521
|
+
}
|
|
2522
|
+
function formFieldHasLabel(label) {
|
|
2523
|
+
if (label == null) return false;
|
|
2524
|
+
if (typeof label === "string" && label.trim() === "") return false;
|
|
2525
|
+
return true;
|
|
2526
|
+
}
|
|
2527
|
+
function FormField({
|
|
2528
|
+
name,
|
|
2529
|
+
label,
|
|
2530
|
+
register,
|
|
2531
|
+
control,
|
|
2532
|
+
rules,
|
|
2533
|
+
description,
|
|
2534
|
+
required,
|
|
2535
|
+
error,
|
|
2536
|
+
variant = "input",
|
|
2537
|
+
inputProps,
|
|
2538
|
+
textareaProps,
|
|
2539
|
+
checkboxProps,
|
|
2540
|
+
switchProps,
|
|
2541
|
+
selectProps,
|
|
2542
|
+
radioProps,
|
|
2543
|
+
otpProps,
|
|
2544
|
+
richTextProps,
|
|
2545
|
+
dropzoneProps,
|
|
2546
|
+
asyncSelectProps,
|
|
2547
|
+
className,
|
|
2548
|
+
renderInput
|
|
2549
|
+
}) {
|
|
2550
|
+
const generatedId = React29.useId();
|
|
2551
|
+
const inputId = `field-${generatedId}`;
|
|
2552
|
+
const descriptionId = description ? `${inputId}-description` : void 0;
|
|
2553
|
+
const externalError = error ? String(error) : void 0;
|
|
2554
|
+
if (!control && VARIANTS_NEED_CONTROL.includes(variant)) {
|
|
2555
|
+
throw new Error(
|
|
2556
|
+
`FormField variant "${variant}" requires the control prop (React Hook Form Controller).`
|
|
2557
|
+
);
|
|
2558
|
+
}
|
|
2559
|
+
if (control) {
|
|
2560
|
+
return /* @__PURE__ */ jsx32(
|
|
2561
|
+
Controller,
|
|
2562
|
+
{
|
|
2563
|
+
name,
|
|
2564
|
+
control,
|
|
2565
|
+
rules,
|
|
2566
|
+
render: ({ field, fieldState }) => {
|
|
2567
|
+
const message = externalError ?? fieldState.error?.message;
|
|
2568
|
+
const errorId = message ? `${inputId}-error` : void 0;
|
|
2569
|
+
const describedBy2 = [descriptionId, errorId].filter(Boolean).join(" ") || void 0;
|
|
2570
|
+
const hasError = Boolean(message);
|
|
2571
|
+
const legendId = `${inputId}-legend`;
|
|
2572
|
+
const isCheckboxInline = variant === "checkbox" && !renderInput;
|
|
2573
|
+
const hasFieldLabel2 = formFieldHasLabel(label);
|
|
2574
|
+
const sharedInputShell = {
|
|
2575
|
+
...inputProps,
|
|
2576
|
+
id: inputId,
|
|
2577
|
+
name: field.name,
|
|
2578
|
+
"aria-describedby": describedBy2,
|
|
2579
|
+
error: hasError
|
|
2580
|
+
};
|
|
2581
|
+
const controlNode = renderInput ? renderInput({
|
|
2582
|
+
...sharedInputShell,
|
|
2583
|
+
value: field.value ?? "",
|
|
2584
|
+
onChange: field.onChange,
|
|
2585
|
+
onBlur: field.onBlur,
|
|
2586
|
+
ref: field.ref
|
|
2587
|
+
}) : /* @__PURE__ */ jsx32(
|
|
2588
|
+
FormFieldVariantControl,
|
|
2589
|
+
{
|
|
2590
|
+
variant,
|
|
2591
|
+
inputId,
|
|
2592
|
+
legendId,
|
|
2593
|
+
hasFieldLabel: hasFieldLabel2,
|
|
2594
|
+
fieldNameAria: String(name),
|
|
2595
|
+
describedBy: describedBy2,
|
|
2596
|
+
hasError,
|
|
2597
|
+
field,
|
|
2598
|
+
inputProps,
|
|
2599
|
+
textareaProps,
|
|
2600
|
+
checkboxProps,
|
|
2601
|
+
switchProps,
|
|
2602
|
+
selectProps,
|
|
2603
|
+
radioProps,
|
|
2604
|
+
otpProps,
|
|
2605
|
+
richTextProps,
|
|
2606
|
+
dropzoneProps,
|
|
2607
|
+
asyncSelectProps
|
|
2608
|
+
}
|
|
2609
|
+
);
|
|
2610
|
+
const labelBlock = isCheckboxInline || !hasFieldLabel2 ? null : /* @__PURE__ */ jsx32(
|
|
2611
|
+
Label2,
|
|
2612
|
+
{
|
|
2613
|
+
id: variant === "radio" || variant === "richtext" ? legendId : void 0,
|
|
2614
|
+
htmlFor: variant === "radio" || variant === "richtext" ? void 0 : inputId,
|
|
2615
|
+
size: "sm",
|
|
2616
|
+
required,
|
|
2617
|
+
children: label
|
|
2618
|
+
}
|
|
2619
|
+
);
|
|
2620
|
+
const checkboxInline = isCheckboxInline ? hasFieldLabel2 ? /* @__PURE__ */ jsxs20("div", { className: "flex w-full min-w-0 items-start gap-2", children: [
|
|
2621
|
+
/* @__PURE__ */ jsx32(
|
|
2622
|
+
Checkbox,
|
|
2623
|
+
{
|
|
2624
|
+
...checkboxProps,
|
|
2625
|
+
id: inputId,
|
|
2626
|
+
name: field.name,
|
|
2627
|
+
checked: Boolean(field.value),
|
|
2628
|
+
onCheckedChange: (checked) => field.onChange(checked === true),
|
|
2629
|
+
onBlur: field.onBlur,
|
|
2630
|
+
ref: field.ref,
|
|
2631
|
+
disabled: field.disabled,
|
|
2632
|
+
"aria-describedby": describedBy2,
|
|
2633
|
+
"aria-invalid": hasError || void 0
|
|
2634
|
+
}
|
|
2635
|
+
),
|
|
2636
|
+
/* @__PURE__ */ jsx32(
|
|
2637
|
+
Label2,
|
|
2638
|
+
{
|
|
2639
|
+
htmlFor: inputId,
|
|
2640
|
+
required,
|
|
2641
|
+
size: "sm",
|
|
2642
|
+
className: "font-normal leading-snug",
|
|
2643
|
+
children: label
|
|
2644
|
+
}
|
|
2645
|
+
)
|
|
2646
|
+
] }) : /* @__PURE__ */ jsx32(
|
|
2647
|
+
Checkbox,
|
|
2648
|
+
{
|
|
2649
|
+
...checkboxProps,
|
|
2650
|
+
id: inputId,
|
|
2651
|
+
name: field.name,
|
|
2652
|
+
checked: Boolean(field.value),
|
|
2653
|
+
onCheckedChange: (checked) => field.onChange(checked === true),
|
|
2654
|
+
onBlur: field.onBlur,
|
|
2655
|
+
ref: field.ref,
|
|
2656
|
+
disabled: field.disabled,
|
|
2657
|
+
"aria-describedby": describedBy2,
|
|
2658
|
+
"aria-invalid": hasError || void 0
|
|
2659
|
+
}
|
|
2660
|
+
) : null;
|
|
2661
|
+
return /* @__PURE__ */ jsxs20(
|
|
2662
|
+
"div",
|
|
2663
|
+
{
|
|
2664
|
+
className: cn(
|
|
2665
|
+
"flex w-full min-w-0 flex-col gap-2",
|
|
2666
|
+
className
|
|
2667
|
+
),
|
|
2668
|
+
children: [
|
|
2669
|
+
isCheckboxInline ? checkboxInline : /* @__PURE__ */ jsxs20("div", { className: "flex w-full min-w-0 flex-col gap-1.5", children: [
|
|
2670
|
+
labelBlock,
|
|
2671
|
+
controlNode
|
|
2672
|
+
] }),
|
|
2673
|
+
description && /* @__PURE__ */ jsx32(Text, { id: descriptionId, size: "sm", tone: "muted", children: description }),
|
|
2674
|
+
message && /* @__PURE__ */ jsx32(Text, { id: errorId, size: "sm", tone: "destructive", children: message })
|
|
2675
|
+
]
|
|
2676
|
+
}
|
|
2677
|
+
);
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
);
|
|
2681
|
+
}
|
|
2682
|
+
if (!register) {
|
|
2683
|
+
throw new Error("FormField requires either a register function or a control prop.");
|
|
2684
|
+
}
|
|
2685
|
+
if (variant !== "input" && variant !== "textarea") {
|
|
2686
|
+
throw new Error(
|
|
2687
|
+
`FormField variant "${variant}" is not supported with register(). Use control instead.`
|
|
2688
|
+
);
|
|
2689
|
+
}
|
|
2690
|
+
const registered = register(name, rules);
|
|
2691
|
+
const describedBy = [descriptionId, externalError ? `${inputId}-error` : void 0].filter(Boolean).join(" ") || void 0;
|
|
2692
|
+
const hasFieldLabel = formFieldHasLabel(label);
|
|
2693
|
+
const registeredControl = renderInput ? renderInput({
|
|
2694
|
+
...inputProps,
|
|
2695
|
+
id: inputId,
|
|
2696
|
+
"aria-describedby": describedBy,
|
|
2697
|
+
error: Boolean(externalError),
|
|
2698
|
+
...registered
|
|
2699
|
+
}) : variant === "textarea" ? /* @__PURE__ */ jsx32(
|
|
2700
|
+
Textarea,
|
|
2701
|
+
{
|
|
2702
|
+
id: inputId,
|
|
2703
|
+
"aria-describedby": describedBy,
|
|
2704
|
+
error: Boolean(externalError),
|
|
2705
|
+
...textareaProps,
|
|
2706
|
+
...registered
|
|
2707
|
+
}
|
|
2708
|
+
) : /* @__PURE__ */ jsx32(
|
|
2709
|
+
Input,
|
|
2710
|
+
{
|
|
2711
|
+
id: inputId,
|
|
2712
|
+
"aria-describedby": describedBy,
|
|
2713
|
+
error: Boolean(externalError),
|
|
2714
|
+
...inputProps,
|
|
2715
|
+
...registered
|
|
2716
|
+
}
|
|
2717
|
+
);
|
|
2718
|
+
return /* @__PURE__ */ jsxs20("div", { className: cn("mt-4 flex w-full min-w-0 flex-col gap-2", className), children: [
|
|
2719
|
+
hasFieldLabel ? /* @__PURE__ */ jsxs20("div", { className: "flex w-full min-w-0 flex-col gap-1.5", children: [
|
|
2720
|
+
/* @__PURE__ */ jsx32(Label2, { htmlFor: inputId, required, size: "sm", children: label }),
|
|
2721
|
+
registeredControl
|
|
2722
|
+
] }) : /* @__PURE__ */ jsx32("div", { className: "w-full min-w-0", children: registeredControl }),
|
|
2723
|
+
description && /* @__PURE__ */ jsx32(Text, { id: descriptionId, size: "sm", tone: "muted", children: description }),
|
|
2724
|
+
externalError && /* @__PURE__ */ jsx32(Text, { id: `${inputId}-error`, size: "sm", tone: "destructive", children: externalError })
|
|
2725
|
+
] });
|
|
2726
|
+
}
|
|
2727
|
+
function FormFieldVariantControl({
|
|
2728
|
+
variant,
|
|
2729
|
+
inputId,
|
|
2730
|
+
legendId,
|
|
2731
|
+
hasFieldLabel,
|
|
2732
|
+
fieldNameAria,
|
|
2733
|
+
describedBy,
|
|
2734
|
+
hasError,
|
|
2735
|
+
field,
|
|
2736
|
+
inputProps,
|
|
2737
|
+
textareaProps,
|
|
2738
|
+
checkboxProps,
|
|
2739
|
+
switchProps,
|
|
2740
|
+
selectProps,
|
|
2741
|
+
radioProps,
|
|
2742
|
+
otpProps,
|
|
2743
|
+
richTextProps,
|
|
2744
|
+
dropzoneProps,
|
|
2745
|
+
asyncSelectProps
|
|
2746
|
+
}) {
|
|
2747
|
+
switch (variant) {
|
|
2748
|
+
case "textarea":
|
|
2749
|
+
return /* @__PURE__ */ jsx32("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx32(
|
|
2750
|
+
Textarea,
|
|
2751
|
+
{
|
|
2752
|
+
...textareaProps,
|
|
2753
|
+
id: inputId,
|
|
2754
|
+
name: field.name,
|
|
2755
|
+
"aria-describedby": describedBy,
|
|
2756
|
+
error: hasError,
|
|
2757
|
+
value: field.value ?? "",
|
|
2758
|
+
onChange: field.onChange,
|
|
2759
|
+
onBlur: field.onBlur,
|
|
2760
|
+
ref: field.ref,
|
|
2761
|
+
disabled: field.disabled
|
|
2762
|
+
}
|
|
2763
|
+
) });
|
|
2764
|
+
case "checkbox":
|
|
2765
|
+
return null;
|
|
2766
|
+
case "switch":
|
|
2767
|
+
return /* @__PURE__ */ jsx32("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx32(
|
|
2768
|
+
Switch,
|
|
2769
|
+
{
|
|
2770
|
+
...switchProps,
|
|
2771
|
+
id: inputId,
|
|
2772
|
+
name: field.name,
|
|
2773
|
+
checked: Boolean(field.value),
|
|
2774
|
+
onCheckedChange: (checked) => field.onChange(checked === true),
|
|
2775
|
+
onBlur: field.onBlur,
|
|
2776
|
+
ref: field.ref,
|
|
2777
|
+
disabled: field.disabled,
|
|
2778
|
+
"aria-describedby": describedBy,
|
|
2779
|
+
"aria-invalid": hasError || switchProps?.["aria-invalid"]
|
|
2780
|
+
}
|
|
2781
|
+
) });
|
|
2782
|
+
case "select": {
|
|
2783
|
+
if (!selectProps?.items?.length) {
|
|
2784
|
+
throw new Error('FormField variant "select" requires selectProps.items.');
|
|
2785
|
+
}
|
|
2786
|
+
const {
|
|
2787
|
+
placeholder,
|
|
2788
|
+
items,
|
|
2789
|
+
triggerClassName,
|
|
2790
|
+
contentClassName,
|
|
2791
|
+
...selectRootRest
|
|
2792
|
+
} = selectProps;
|
|
2793
|
+
const emptyValueItems = items.filter((item) => item.value === "");
|
|
2794
|
+
if (emptyValueItems.length > 0) {
|
|
2795
|
+
throw new Error(
|
|
2796
|
+
'FormField variant "select": every `items[].value` must be non-empty \u2014 Radix Select reserves "" for clearing. Use `placeholder` for an empty-looking state.'
|
|
2797
|
+
);
|
|
2798
|
+
}
|
|
2799
|
+
const value = field.value == null || field.value === "" ? void 0 : String(field.value);
|
|
2800
|
+
return /* @__PURE__ */ jsx32("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsxs20(
|
|
2801
|
+
Select,
|
|
2802
|
+
{
|
|
2803
|
+
...selectRootRest,
|
|
2804
|
+
value,
|
|
2805
|
+
onValueChange: field.onChange,
|
|
2806
|
+
disabled: field.disabled,
|
|
2807
|
+
name: field.name,
|
|
2808
|
+
children: [
|
|
2809
|
+
/* @__PURE__ */ jsx32(
|
|
2810
|
+
SelectTrigger,
|
|
2811
|
+
{
|
|
2812
|
+
id: inputId,
|
|
2813
|
+
ref: field.ref,
|
|
2814
|
+
"aria-describedby": describedBy,
|
|
2815
|
+
"aria-invalid": hasError || void 0,
|
|
2816
|
+
className: cn(
|
|
2817
|
+
hasError && inputSurfaceFieldInvalid,
|
|
2818
|
+
triggerClassName
|
|
2819
|
+
),
|
|
2820
|
+
onBlur: field.onBlur,
|
|
2821
|
+
children: /* @__PURE__ */ jsx32(SelectValue, { placeholder })
|
|
2822
|
+
}
|
|
2823
|
+
),
|
|
2824
|
+
/* @__PURE__ */ jsx32(SelectContent, { className: contentClassName, children: items.map((item) => /* @__PURE__ */ jsx32(
|
|
2825
|
+
SelectItem,
|
|
2826
|
+
{
|
|
2827
|
+
value: item.value,
|
|
2828
|
+
disabled: item.disabled,
|
|
2829
|
+
children: item.label
|
|
2830
|
+
},
|
|
2831
|
+
item.value
|
|
2832
|
+
)) })
|
|
2833
|
+
]
|
|
2834
|
+
}
|
|
2835
|
+
) });
|
|
2836
|
+
}
|
|
2837
|
+
case "async-select": {
|
|
2838
|
+
if (!asyncSelectProps?.url) {
|
|
2839
|
+
throw new Error('FormField variant "async-select" requires asyncSelectProps.url.');
|
|
2840
|
+
}
|
|
2841
|
+
if (!asyncSelectProps?.valueKey) {
|
|
2842
|
+
throw new Error('FormField variant "async-select" requires asyncSelectProps.valueKey.');
|
|
2843
|
+
}
|
|
2844
|
+
if (!asyncSelectProps?.labelKey) {
|
|
2845
|
+
throw new Error('FormField variant "async-select" requires asyncSelectProps.labelKey.');
|
|
2846
|
+
}
|
|
2847
|
+
return /* @__PURE__ */ jsx32("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx32(
|
|
2848
|
+
AsyncSelect,
|
|
2849
|
+
{
|
|
2850
|
+
...asyncSelectProps,
|
|
2851
|
+
value: field.value == null || field.value === "" ? void 0 : String(field.value),
|
|
2852
|
+
onValueChange: field.onChange,
|
|
2853
|
+
disabled: field.disabled,
|
|
2854
|
+
error: hasError,
|
|
2855
|
+
name: field.name,
|
|
2856
|
+
ref: field.ref
|
|
2857
|
+
}
|
|
2858
|
+
) });
|
|
2859
|
+
}
|
|
2860
|
+
case "radio": {
|
|
2861
|
+
if (!radioProps?.options?.length) {
|
|
2862
|
+
throw new Error('FormField variant "radio" requires radioProps.options.');
|
|
2863
|
+
}
|
|
2864
|
+
const {
|
|
2865
|
+
options,
|
|
2866
|
+
groupClassName,
|
|
2867
|
+
className: radioClassName,
|
|
2868
|
+
...radioGroupRest
|
|
2869
|
+
} = radioProps;
|
|
2870
|
+
return /* @__PURE__ */ jsx32(
|
|
2871
|
+
RadioGroup2,
|
|
2872
|
+
{
|
|
2873
|
+
...radioGroupRest,
|
|
2874
|
+
className: cn("w-full min-w-0", groupClassName, radioClassName),
|
|
2875
|
+
value: field.value == null ? void 0 : String(field.value),
|
|
2876
|
+
onValueChange: field.onChange,
|
|
2877
|
+
onBlur: field.onBlur,
|
|
2878
|
+
disabled: field.disabled,
|
|
2879
|
+
name: field.name,
|
|
2880
|
+
"aria-labelledby": hasFieldLabel ? legendId : void 0,
|
|
2881
|
+
"aria-label": hasFieldLabel ? void 0 : fieldNameAria,
|
|
2882
|
+
"aria-describedby": describedBy,
|
|
2883
|
+
"aria-invalid": hasError || void 0,
|
|
2884
|
+
ref: field.ref,
|
|
2885
|
+
children: options.map((opt) => /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2", children: [
|
|
2886
|
+
/* @__PURE__ */ jsx32(
|
|
2887
|
+
RadioGroupItem,
|
|
2888
|
+
{
|
|
2889
|
+
value: opt.value,
|
|
2890
|
+
id: opt.id ?? `${inputId}-${opt.value}`,
|
|
2891
|
+
disabled: opt.disabled
|
|
2892
|
+
}
|
|
2893
|
+
),
|
|
2894
|
+
/* @__PURE__ */ jsx32(
|
|
2895
|
+
Label2,
|
|
2896
|
+
{
|
|
2897
|
+
htmlFor: opt.id ?? `${inputId}-${opt.value}`,
|
|
2898
|
+
size: "sm",
|
|
2899
|
+
className: "font-normal",
|
|
2900
|
+
children: opt.label
|
|
2901
|
+
}
|
|
2902
|
+
)
|
|
2903
|
+
] }, opt.value))
|
|
2904
|
+
}
|
|
2905
|
+
);
|
|
2906
|
+
}
|
|
2907
|
+
case "otp": {
|
|
2908
|
+
if (!otpProps?.maxLength) {
|
|
2909
|
+
throw new Error('FormField variant "otp" requires otpProps.maxLength.');
|
|
2910
|
+
}
|
|
2911
|
+
const { maxLength, groups, containerClassName, ...otpRest } = otpProps;
|
|
2912
|
+
const slotGroups = groups?.length ? groups : defaultOtpGroups(maxLength);
|
|
2913
|
+
return /* @__PURE__ */ jsx32("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx32(
|
|
2914
|
+
InputOTP,
|
|
2915
|
+
{
|
|
2916
|
+
...otpRest,
|
|
2917
|
+
invalid: hasError,
|
|
2918
|
+
maxLength,
|
|
2919
|
+
value: field.value ?? "",
|
|
2920
|
+
onChange: field.onChange,
|
|
2921
|
+
onBlur: field.onBlur,
|
|
2922
|
+
ref: field.ref,
|
|
2923
|
+
disabled: field.disabled,
|
|
2924
|
+
name: field.name,
|
|
2925
|
+
id: inputId,
|
|
2926
|
+
"aria-describedby": describedBy,
|
|
2927
|
+
"aria-invalid": hasError || void 0,
|
|
2928
|
+
containerClassName: cn(
|
|
2929
|
+
hasError && inputOtpContainerInvalid,
|
|
2930
|
+
containerClassName
|
|
2931
|
+
),
|
|
2932
|
+
children: slotGroups.map((indices, gi) => /* @__PURE__ */ jsxs20(React29.Fragment, { children: [
|
|
2933
|
+
gi > 0 ? /* @__PURE__ */ jsx32(InputOTPSeparator, {}) : null,
|
|
2934
|
+
/* @__PURE__ */ jsx32(InputOTPGroup, { children: indices.map((index) => /* @__PURE__ */ jsx32(InputOTPSlot, { index }, index)) })
|
|
2935
|
+
] }, gi))
|
|
2936
|
+
}
|
|
2937
|
+
) });
|
|
2938
|
+
}
|
|
2939
|
+
case "richtext":
|
|
2940
|
+
return /* @__PURE__ */ jsx32(
|
|
2941
|
+
"div",
|
|
2942
|
+
{
|
|
2943
|
+
className: "w-full min-w-0",
|
|
2944
|
+
role: "group",
|
|
2945
|
+
"aria-labelledby": hasFieldLabel ? legendId : void 0,
|
|
2946
|
+
"aria-label": hasFieldLabel ? void 0 : fieldNameAria,
|
|
2947
|
+
"aria-describedby": describedBy,
|
|
2948
|
+
"aria-invalid": hasError || void 0,
|
|
2949
|
+
onBlur: field.onBlur,
|
|
2950
|
+
children: /* @__PURE__ */ jsx32(
|
|
2951
|
+
RichTextEditor,
|
|
2952
|
+
{
|
|
2953
|
+
value: field.value ?? "",
|
|
2954
|
+
onChange: (html) => field.onChange(html),
|
|
2955
|
+
disabled: field.disabled,
|
|
2956
|
+
...richTextProps
|
|
2957
|
+
}
|
|
2958
|
+
)
|
|
2959
|
+
}
|
|
2960
|
+
);
|
|
2961
|
+
case "dropzone":
|
|
2962
|
+
return /* @__PURE__ */ jsx32("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx32(
|
|
2963
|
+
FileDropzone,
|
|
2964
|
+
{
|
|
2965
|
+
...dropzoneProps,
|
|
2966
|
+
id: inputId,
|
|
2967
|
+
name: field.name,
|
|
2968
|
+
ref: field.ref,
|
|
2969
|
+
disabled: field.disabled,
|
|
2970
|
+
error: hasError,
|
|
2971
|
+
"aria-describedby": describedBy,
|
|
2972
|
+
value: field.value,
|
|
2973
|
+
onBlur: field.onBlur,
|
|
2974
|
+
onChange: (ev) => {
|
|
2975
|
+
const target = "target" in ev && ev.target && typeof ev.target === "object" && "files" in ev.target ? ev.target : null;
|
|
2976
|
+
field.onChange(target?.files ?? null);
|
|
2977
|
+
}
|
|
2978
|
+
},
|
|
2979
|
+
`${String(field.name)}-${field.value === null ? "cleared" : typeof FileList !== "undefined" && field.value instanceof FileList ? field.value.length : "open"}`
|
|
2980
|
+
) });
|
|
2981
|
+
case "input":
|
|
2982
|
+
default:
|
|
2983
|
+
return /* @__PURE__ */ jsx32("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx32(
|
|
2984
|
+
Input,
|
|
2985
|
+
{
|
|
2986
|
+
...inputProps,
|
|
2987
|
+
id: inputId,
|
|
2988
|
+
name: field.name,
|
|
2989
|
+
"aria-describedby": describedBy,
|
|
2990
|
+
error: hasError,
|
|
2991
|
+
value: field.value ?? "",
|
|
2992
|
+
onChange: field.onChange,
|
|
2993
|
+
onBlur: field.onBlur,
|
|
2994
|
+
ref: field.ref,
|
|
2995
|
+
disabled: field.disabled
|
|
2996
|
+
}
|
|
2997
|
+
) });
|
|
2998
|
+
}
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
// source/components/primitive/Heading/heading.tsx
|
|
3002
|
+
import * as React30 from "react";
|
|
3003
|
+
import { cva as cva11 } from "class-variance-authority";
|
|
3004
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3005
|
+
var headingVariants = cva11(
|
|
3006
|
+
"text-foreground tracking-tight",
|
|
3007
|
+
{
|
|
3008
|
+
variants: {
|
|
3009
|
+
/**
|
|
3010
|
+
* Controls the rendered HTML element AND the default size/weight.
|
|
3011
|
+
* Always override with `size` or `weight` if the visual hierarchy
|
|
3012
|
+
* needs to diverge from the semantic level.
|
|
3013
|
+
*/
|
|
3014
|
+
level: {
|
|
3015
|
+
1: "text-5xl font-bold leading-none",
|
|
3016
|
+
2: "text-4xl font-bold leading-tight",
|
|
3017
|
+
3: "text-3xl font-semibold leading-snug",
|
|
3018
|
+
4: "text-2xl font-semibold leading-snug",
|
|
3019
|
+
5: "text-xl font-medium leading-normal",
|
|
3020
|
+
6: "text-lg font-medium leading-normal"
|
|
3021
|
+
},
|
|
3022
|
+
/** Override the size independently of the semantic level. */
|
|
3023
|
+
size: {
|
|
3024
|
+
"2xs": "text-2xs",
|
|
3025
|
+
xs: "text-xs",
|
|
3026
|
+
sm: "text-sm",
|
|
3027
|
+
base: "text-base",
|
|
3028
|
+
lg: "text-lg",
|
|
3029
|
+
xl: "text-xl",
|
|
3030
|
+
"2xl": "text-2xl",
|
|
3031
|
+
"3xl": "text-3xl",
|
|
3032
|
+
"4xl": "text-4xl",
|
|
3033
|
+
"5xl": "text-5xl"
|
|
3034
|
+
},
|
|
3035
|
+
/** Override the weight independently of the semantic level. */
|
|
3036
|
+
weight: {
|
|
3037
|
+
regular: "font-normal",
|
|
3038
|
+
medium: "font-medium",
|
|
3039
|
+
semibold: "font-semibold",
|
|
3040
|
+
bold: "font-bold"
|
|
3041
|
+
},
|
|
3042
|
+
tone: {
|
|
3043
|
+
default: "text-foreground",
|
|
3044
|
+
muted: "text-muted-foreground",
|
|
3045
|
+
primary: "text-primary",
|
|
3046
|
+
destructive: "text-destructive"
|
|
3047
|
+
},
|
|
3048
|
+
align: {
|
|
3049
|
+
left: "text-left",
|
|
3050
|
+
center: "text-center",
|
|
3051
|
+
right: "text-right"
|
|
3052
|
+
},
|
|
3053
|
+
/**
|
|
3054
|
+
* Uses the display font family (Cal Sans → Inter Variable fallback)
|
|
3055
|
+
* for hero headings, landing pages, and marketing copy.
|
|
3056
|
+
*/
|
|
3057
|
+
display: {
|
|
3058
|
+
true: "font-display"
|
|
3059
|
+
},
|
|
3060
|
+
truncate: {
|
|
3061
|
+
true: "truncate"
|
|
3062
|
+
}
|
|
3063
|
+
},
|
|
3064
|
+
defaultVariants: {
|
|
3065
|
+
level: 1,
|
|
3066
|
+
tone: "default"
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
);
|
|
3070
|
+
var Heading = React30.forwardRef(
|
|
3071
|
+
({
|
|
3072
|
+
level = 1,
|
|
3073
|
+
size,
|
|
3074
|
+
weight,
|
|
3075
|
+
tone,
|
|
3076
|
+
align,
|
|
3077
|
+
display,
|
|
3078
|
+
truncate,
|
|
3079
|
+
className,
|
|
3080
|
+
...props
|
|
3081
|
+
}, ref) => {
|
|
3082
|
+
const Tag = `h${level}`;
|
|
3083
|
+
return /* @__PURE__ */ jsx33(
|
|
3084
|
+
Tag,
|
|
3085
|
+
{
|
|
3086
|
+
ref,
|
|
3087
|
+
className: cn(
|
|
3088
|
+
headingVariants({ level, size, weight, tone, align, display, truncate }),
|
|
3089
|
+
className
|
|
3090
|
+
),
|
|
3091
|
+
...props
|
|
3092
|
+
}
|
|
3093
|
+
);
|
|
3094
|
+
}
|
|
3095
|
+
);
|
|
3096
|
+
Heading.displayName = "Heading";
|
|
3097
|
+
|
|
3098
|
+
// source/components/primitive/InputGroup/input-group.tsx
|
|
3099
|
+
import * as React31 from "react";
|
|
3100
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3101
|
+
var InputGroup = React31.forwardRef(
|
|
3102
|
+
({ className, error, children, ...props }, ref) => /* @__PURE__ */ jsx34(
|
|
3103
|
+
"div",
|
|
3104
|
+
{
|
|
3105
|
+
ref,
|
|
3106
|
+
"data-slot": "input-group",
|
|
3107
|
+
className: cn(
|
|
3108
|
+
"flex h-11 w-full min-w-0 items-center gap-3 px-4",
|
|
3109
|
+
inputSurfaceContainer,
|
|
3110
|
+
inputSurfaceContainerDisabled,
|
|
3111
|
+
error && inputSurfaceContainerInvalid,
|
|
3112
|
+
className
|
|
3113
|
+
),
|
|
3114
|
+
...props,
|
|
3115
|
+
children
|
|
3116
|
+
}
|
|
3117
|
+
)
|
|
3118
|
+
);
|
|
3119
|
+
InputGroup.displayName = "InputGroup";
|
|
3120
|
+
var InputGroupIcon = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx34(
|
|
3121
|
+
"span",
|
|
3122
|
+
{
|
|
3123
|
+
ref,
|
|
3124
|
+
"data-slot": "input-group-icon",
|
|
3125
|
+
className: cn(
|
|
3126
|
+
"pointer-events-none flex shrink-0 select-none text-primary [&_svg]:h-5 [&_svg]:w-5",
|
|
3127
|
+
className
|
|
3128
|
+
),
|
|
3129
|
+
...props
|
|
3130
|
+
}
|
|
3131
|
+
));
|
|
3132
|
+
InputGroupIcon.displayName = "InputGroupIcon";
|
|
3133
|
+
var InputGroupInput = React31.forwardRef(
|
|
3134
|
+
({ className, type, ...props }, ref) => /* @__PURE__ */ jsx34(
|
|
3135
|
+
"input",
|
|
3136
|
+
{
|
|
3137
|
+
ref,
|
|
3138
|
+
type: type ?? "text",
|
|
3139
|
+
className: cn(
|
|
3140
|
+
"min-h-0 min-w-0 flex-1 border-0 bg-transparent p-0 text-base text-inherit shadow-none outline-none md:text-sm",
|
|
3141
|
+
"placeholder:text-slate-500 dark:placeholder:text-slate-400",
|
|
3142
|
+
"focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
3143
|
+
className
|
|
3144
|
+
),
|
|
3145
|
+
...props
|
|
3146
|
+
}
|
|
3147
|
+
)
|
|
3148
|
+
);
|
|
3149
|
+
InputGroupInput.displayName = "InputGroupInput";
|
|
3150
|
+
var inputGroupSelectTriggerTextAlignClass = "pl-12";
|
|
3151
|
+
|
|
3152
|
+
// source/components/primitive/Pagination/pagination.tsx
|
|
3153
|
+
import * as React32 from "react";
|
|
3154
|
+
import { ChevronLeft, ChevronRight as ChevronRight2, MoreHorizontal } from "lucide-react";
|
|
3155
|
+
import { jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3156
|
+
var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx35(
|
|
3157
|
+
"nav",
|
|
3158
|
+
{
|
|
3159
|
+
role: "navigation",
|
|
3160
|
+
"aria-label": "pagination",
|
|
3161
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
3162
|
+
...props
|
|
3163
|
+
}
|
|
3164
|
+
);
|
|
3165
|
+
Pagination.displayName = "Pagination";
|
|
3166
|
+
var PaginationContent = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
3167
|
+
"ul",
|
|
3168
|
+
{
|
|
3169
|
+
ref,
|
|
3170
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
3171
|
+
...props
|
|
3172
|
+
}
|
|
3173
|
+
));
|
|
3174
|
+
PaginationContent.displayName = "PaginationContent";
|
|
3175
|
+
var PaginationItem = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35("li", { ref, className: cn("", className), ...props }));
|
|
3176
|
+
PaginationItem.displayName = "PaginationItem";
|
|
3177
|
+
var PaginationLink = ({
|
|
3178
|
+
className,
|
|
3179
|
+
isActive,
|
|
3180
|
+
size = "icon",
|
|
3181
|
+
...props
|
|
3182
|
+
}) => /* @__PURE__ */ jsx35(
|
|
3183
|
+
"a",
|
|
3184
|
+
{
|
|
3185
|
+
"aria-current": isActive ? "page" : void 0,
|
|
3186
|
+
className: cn(
|
|
3187
|
+
buttonVariants({
|
|
3188
|
+
variant: isActive ? "outline" : "ghost",
|
|
3189
|
+
size
|
|
3190
|
+
}),
|
|
3191
|
+
className
|
|
3192
|
+
),
|
|
3193
|
+
...props
|
|
3194
|
+
}
|
|
3195
|
+
);
|
|
3196
|
+
PaginationLink.displayName = "PaginationLink";
|
|
3197
|
+
var PaginationPrevious = ({
|
|
3198
|
+
className,
|
|
3199
|
+
...props
|
|
3200
|
+
}) => /* @__PURE__ */ jsxs21(
|
|
3201
|
+
PaginationLink,
|
|
3202
|
+
{
|
|
3203
|
+
"aria-label": "Go to previous page",
|
|
3204
|
+
className: cn("gap-1 pl-2.5", className),
|
|
3205
|
+
size: "default",
|
|
3206
|
+
...props,
|
|
3207
|
+
children: [
|
|
3208
|
+
/* @__PURE__ */ jsx35(ChevronLeft, { className: "h-4 w-4" }),
|
|
3209
|
+
/* @__PURE__ */ jsx35("span", { children: "Previous" })
|
|
3210
|
+
]
|
|
3211
|
+
}
|
|
3212
|
+
);
|
|
3213
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
3214
|
+
var PaginationNext = ({
|
|
3215
|
+
className,
|
|
3216
|
+
...props
|
|
3217
|
+
}) => /* @__PURE__ */ jsxs21(
|
|
3218
|
+
PaginationLink,
|
|
3219
|
+
{
|
|
3220
|
+
"aria-label": "Go to next page",
|
|
3221
|
+
className: cn("gap-1 pr-2.5", className),
|
|
3222
|
+
size: "default",
|
|
3223
|
+
...props,
|
|
3224
|
+
children: [
|
|
3225
|
+
/* @__PURE__ */ jsx35("span", { children: "Next" }),
|
|
3226
|
+
/* @__PURE__ */ jsx35(ChevronRight2, { className: "h-4 w-4" })
|
|
3227
|
+
]
|
|
3228
|
+
}
|
|
3229
|
+
);
|
|
3230
|
+
PaginationNext.displayName = "PaginationNext";
|
|
3231
|
+
var PaginationEllipsis = ({
|
|
3232
|
+
className,
|
|
3233
|
+
...props
|
|
3234
|
+
}) => /* @__PURE__ */ jsxs21(
|
|
3235
|
+
"span",
|
|
3236
|
+
{
|
|
3237
|
+
"aria-hidden": true,
|
|
3238
|
+
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
3239
|
+
...props,
|
|
3240
|
+
children: [
|
|
3241
|
+
/* @__PURE__ */ jsx35(MoreHorizontal, { className: "h-4 w-4" }),
|
|
3242
|
+
/* @__PURE__ */ jsx35("span", { className: "sr-only", children: "More pages" })
|
|
3243
|
+
]
|
|
3244
|
+
}
|
|
3245
|
+
);
|
|
3246
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
3247
|
+
|
|
3248
|
+
// source/components/primitive/Progress/progress.tsx
|
|
3249
|
+
import * as React33 from "react";
|
|
3250
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3251
|
+
import { jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3252
|
+
var variantStyles = {
|
|
3253
|
+
default: "bg-primary",
|
|
3254
|
+
success: "bg-green-500",
|
|
3255
|
+
warning: "bg-yellow-500",
|
|
3256
|
+
error: "bg-red-500"
|
|
3257
|
+
};
|
|
3258
|
+
var Progress = React33.forwardRef(
|
|
3259
|
+
({
|
|
3260
|
+
className,
|
|
3261
|
+
value = 0,
|
|
3262
|
+
max = 100,
|
|
3263
|
+
label,
|
|
3264
|
+
showValue,
|
|
3265
|
+
variant = "default",
|
|
3266
|
+
indeterminate,
|
|
3267
|
+
...props
|
|
3268
|
+
}, ref) => {
|
|
3269
|
+
const safeMax = max > 0 ? max : 100;
|
|
3270
|
+
const safeValue = Math.min(Math.max(value, 0), safeMax);
|
|
3271
|
+
const percentage = Math.min(safeValue / safeMax * 100, 100);
|
|
3272
|
+
return /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1", children: [
|
|
3273
|
+
(label || showValue) && /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
|
|
3274
|
+
label && /* @__PURE__ */ jsx36("span", { className: "text-sm font-medium", children: label }),
|
|
3275
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs22("span", { className: "text-xs text-muted-foreground", children: [
|
|
3276
|
+
Math.round(percentage),
|
|
3277
|
+
"%"
|
|
3278
|
+
] })
|
|
3279
|
+
] }),
|
|
3280
|
+
/* @__PURE__ */ jsx36(
|
|
3281
|
+
ProgressPrimitive.Root,
|
|
3282
|
+
{
|
|
3283
|
+
ref,
|
|
3284
|
+
className: cn(
|
|
3285
|
+
"relative h-3 w-full overflow-hidden rounded-full bg-secondary",
|
|
3286
|
+
className
|
|
3287
|
+
),
|
|
3288
|
+
value: indeterminate ? void 0 : safeValue,
|
|
3289
|
+
"aria-valuemin": 0,
|
|
3290
|
+
"aria-valuemax": safeMax,
|
|
3291
|
+
"aria-valuenow": indeterminate ? void 0 : safeValue,
|
|
3292
|
+
...props,
|
|
3293
|
+
children: /* @__PURE__ */ jsx36(
|
|
3294
|
+
ProgressPrimitive.Indicator,
|
|
3295
|
+
{
|
|
3296
|
+
className: cn(
|
|
3297
|
+
"h-full w-full flex-1 transition-transform duration-300",
|
|
3298
|
+
variantStyles[variant],
|
|
3299
|
+
indeterminate && "animate-pulse"
|
|
3300
|
+
),
|
|
3301
|
+
style: {
|
|
3302
|
+
transform: indeterminate ? "translateX(0)" : `translateX(-${100 - percentage}%)`
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3305
|
+
)
|
|
3306
|
+
}
|
|
3307
|
+
)
|
|
3308
|
+
] });
|
|
3309
|
+
}
|
|
3310
|
+
);
|
|
3311
|
+
Progress.displayName = "Progress";
|
|
3312
|
+
|
|
3313
|
+
// source/components/primitive/RichHtml/rich-html.tsx
|
|
3314
|
+
import * as React34 from "react";
|
|
3315
|
+
import DOMPurify from "dompurify";
|
|
3316
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3317
|
+
var defaultSanitizeConfig = {
|
|
3318
|
+
USE_PROFILES: { html: true }
|
|
3319
|
+
};
|
|
3320
|
+
var richHtmlChrome = cn(
|
|
3321
|
+
"max-w-none text-base leading-relaxed text-foreground",
|
|
3322
|
+
// Block flow
|
|
3323
|
+
"[&_p]:mb-3 [&_p:last-child]:mb-0 [&_blockquote]:my-4 [&_blockquote]:border-l-2 [&_blockquote]:border-muted [&_blockquote]:pl-4 [&_blockquote]:italic",
|
|
3324
|
+
// Lists
|
|
3325
|
+
"[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-6 [&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-6 [&_li]:my-1 [&_li]:pl-1",
|
|
3326
|
+
// Headings (common for TipTap / CMS output)
|
|
3327
|
+
"[&_h1]:mb-3 [&_h1]:mt-8 [&_h1]:text-3xl [&_h1]:font-semibold [&_h1]:first:mt-0",
|
|
3328
|
+
"[&_h2]:mb-2 [&_h2]:mt-6 [&_h2]:text-2xl [&_h2]:font-semibold [&_h2]:first:mt-0",
|
|
3329
|
+
"[&_h3]:mb-2 [&_h3]:mt-5 [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:first:mt-0",
|
|
3330
|
+
"[&_h4]:mb-2 [&_h4]:mt-4 [&_h4]:text-lg [&_h4]:font-semibold [&_h4]:first:mt-0",
|
|
3331
|
+
// Links & media
|
|
3332
|
+
"[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2 [&_a]:outline-none [&_a]:focus-visible:ring-2 [&_a]:focus-visible:ring-ring [&_a]:focus-visible:ring-offset-2",
|
|
3333
|
+
"[&_img]:my-4 [&_img]:max-h-[min(480px,70vh)] [&_img]:max-w-full [&_img]:rounded-md [&_img]:object-contain",
|
|
3334
|
+
"[&_hr]:my-6 [&_hr]:border-border",
|
|
3335
|
+
// Code
|
|
3336
|
+
"[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[0.9em]",
|
|
3337
|
+
"[&_pre]:my-4 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-sm"
|
|
3338
|
+
);
|
|
3339
|
+
var RichHtml = React34.forwardRef(
|
|
3340
|
+
({
|
|
3341
|
+
html,
|
|
3342
|
+
sanitize = true,
|
|
3343
|
+
sanitizeConfig,
|
|
3344
|
+
className,
|
|
3345
|
+
suppressHydrationWarning,
|
|
3346
|
+
...props
|
|
3347
|
+
}, ref) => {
|
|
3348
|
+
const markup = React34.useMemo(() => {
|
|
3349
|
+
if (html === void 0 || html === null || html === "") {
|
|
3350
|
+
return "";
|
|
3351
|
+
}
|
|
3352
|
+
if (!sanitize) {
|
|
3353
|
+
return html;
|
|
3354
|
+
}
|
|
3355
|
+
if (typeof window === "undefined") {
|
|
3356
|
+
return "";
|
|
3357
|
+
}
|
|
3358
|
+
const config = {
|
|
3359
|
+
...defaultSanitizeConfig,
|
|
3360
|
+
...sanitizeConfig
|
|
3361
|
+
};
|
|
3362
|
+
return DOMPurify.sanitize(html, config);
|
|
3363
|
+
}, [html, sanitize, sanitizeConfig]);
|
|
3364
|
+
const resolvedSuppressHydration = suppressHydrationWarning ?? sanitize;
|
|
3365
|
+
if (html === void 0 || html === null || html === "") {
|
|
3366
|
+
return null;
|
|
3367
|
+
}
|
|
3368
|
+
return /* @__PURE__ */ jsx37(
|
|
3369
|
+
"div",
|
|
3370
|
+
{
|
|
3371
|
+
ref,
|
|
3372
|
+
suppressHydrationWarning: resolvedSuppressHydration,
|
|
3373
|
+
className: cn(richHtmlChrome, className),
|
|
3374
|
+
...props,
|
|
3375
|
+
dangerouslySetInnerHTML: { __html: markup }
|
|
3376
|
+
}
|
|
3377
|
+
);
|
|
3378
|
+
}
|
|
3379
|
+
);
|
|
3380
|
+
RichHtml.displayName = "RichHtml";
|
|
3381
|
+
|
|
3382
|
+
// source/components/primitive/ScrollArea/scroll-area.tsx
|
|
3383
|
+
import * as React35 from "react";
|
|
3384
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3385
|
+
import { jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3386
|
+
var ScrollArea = React35.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs23(
|
|
3387
|
+
ScrollAreaPrimitive.Root,
|
|
3388
|
+
{
|
|
3389
|
+
ref,
|
|
3390
|
+
className: cn("relative overflow-hidden", className),
|
|
3391
|
+
...props,
|
|
3392
|
+
children: [
|
|
3393
|
+
/* @__PURE__ */ jsx38(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
3394
|
+
/* @__PURE__ */ jsx38(ScrollBar, {}),
|
|
3395
|
+
/* @__PURE__ */ jsx38(ScrollAreaPrimitive.Corner, {})
|
|
3396
|
+
]
|
|
3397
|
+
}
|
|
3398
|
+
));
|
|
3399
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
3400
|
+
var ScrollBar = React35.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3401
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
3402
|
+
{
|
|
3403
|
+
ref,
|
|
3404
|
+
orientation,
|
|
3405
|
+
className: cn(
|
|
3406
|
+
"flex touch-none select-none transition-colors",
|
|
3407
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
3408
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
3409
|
+
className
|
|
3410
|
+
),
|
|
3411
|
+
...props,
|
|
3412
|
+
children: /* @__PURE__ */ jsx38(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
3413
|
+
}
|
|
3414
|
+
));
|
|
3415
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
3416
|
+
|
|
3417
|
+
// source/components/primitive/Separator/separator.tsx
|
|
3418
|
+
import * as React36 from "react";
|
|
3419
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3420
|
+
import { cva as cva12 } from "class-variance-authority";
|
|
3421
|
+
import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3422
|
+
var separatorVariants = cva12("shrink-0", {
|
|
3423
|
+
variants: {
|
|
3424
|
+
orientation: {
|
|
3425
|
+
horizontal: "h-[1px] w-full",
|
|
3426
|
+
vertical: "h-full w-[1px]"
|
|
3427
|
+
},
|
|
3428
|
+
line: {
|
|
3429
|
+
solid: "bg-border",
|
|
3430
|
+
dashed: "border-t border-dashed border-border bg-transparent",
|
|
3431
|
+
dotted: "border-t border-dotted border-border bg-transparent"
|
|
3432
|
+
}
|
|
3433
|
+
},
|
|
3434
|
+
defaultVariants: {
|
|
3435
|
+
orientation: "horizontal",
|
|
3436
|
+
line: "solid"
|
|
3437
|
+
}
|
|
3438
|
+
});
|
|
3439
|
+
var Separator3 = React36.forwardRef(
|
|
3440
|
+
({
|
|
3441
|
+
className,
|
|
3442
|
+
orientation = "horizontal",
|
|
3443
|
+
decorative = true,
|
|
3444
|
+
line: lineProp,
|
|
3445
|
+
variant,
|
|
3446
|
+
label,
|
|
3447
|
+
...props
|
|
3448
|
+
}, ref) => {
|
|
3449
|
+
const line = lineProp ?? variant ?? "solid";
|
|
3450
|
+
if (label && orientation === "horizontal") {
|
|
3451
|
+
return /* @__PURE__ */ jsxs24(
|
|
3452
|
+
"div",
|
|
3453
|
+
{
|
|
3454
|
+
role: "separator",
|
|
3455
|
+
className: "flex items-center gap-3",
|
|
3456
|
+
children: [
|
|
3457
|
+
/* @__PURE__ */ jsx39(
|
|
3458
|
+
"div",
|
|
3459
|
+
{
|
|
3460
|
+
className: cn(
|
|
3461
|
+
"flex-1",
|
|
3462
|
+
separatorVariants({ orientation: "horizontal", line })
|
|
3463
|
+
)
|
|
3464
|
+
}
|
|
3465
|
+
),
|
|
3466
|
+
/* @__PURE__ */ jsx39("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: label }),
|
|
3467
|
+
/* @__PURE__ */ jsx39(
|
|
3468
|
+
"div",
|
|
3469
|
+
{
|
|
3470
|
+
className: cn(
|
|
3471
|
+
"flex-1",
|
|
3472
|
+
separatorVariants({ orientation: "horizontal", line })
|
|
3473
|
+
)
|
|
3474
|
+
}
|
|
3475
|
+
)
|
|
3476
|
+
]
|
|
3477
|
+
}
|
|
3478
|
+
);
|
|
3479
|
+
}
|
|
3480
|
+
return /* @__PURE__ */ jsx39(
|
|
3481
|
+
SeparatorPrimitive.Root,
|
|
3482
|
+
{
|
|
3483
|
+
ref,
|
|
3484
|
+
decorative,
|
|
3485
|
+
orientation,
|
|
3486
|
+
className: cn(
|
|
3487
|
+
separatorVariants({ orientation, line }),
|
|
3488
|
+
className
|
|
3489
|
+
),
|
|
3490
|
+
...props
|
|
3491
|
+
}
|
|
3492
|
+
);
|
|
3493
|
+
}
|
|
3494
|
+
);
|
|
3495
|
+
Separator3.displayName = "Separator";
|
|
3496
|
+
|
|
3497
|
+
// source/components/primitive/Sheet/sheet.tsx
|
|
3498
|
+
import * as React37 from "react";
|
|
3499
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3500
|
+
import { cva as cva13 } from "class-variance-authority";
|
|
3501
|
+
import { X as X2 } from "lucide-react";
|
|
3502
|
+
import { jsx as jsx40, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3503
|
+
var Sheet = SheetPrimitive.Root;
|
|
3504
|
+
var SheetTrigger = SheetPrimitive.Trigger;
|
|
3505
|
+
var SheetClose = SheetPrimitive.Close;
|
|
3506
|
+
var SheetPortal = SheetPrimitive.Portal;
|
|
3507
|
+
var SheetOverlay = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3508
|
+
SheetPrimitive.Overlay,
|
|
3509
|
+
{
|
|
3510
|
+
className: cn(
|
|
3511
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
3512
|
+
className
|
|
3513
|
+
),
|
|
3514
|
+
...props,
|
|
3515
|
+
ref
|
|
3516
|
+
}
|
|
3517
|
+
));
|
|
3518
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
3519
|
+
var sheetVariants = cva13(
|
|
3520
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
3521
|
+
{
|
|
3522
|
+
variants: {
|
|
3523
|
+
side: {
|
|
3524
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
3525
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
3526
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
3527
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
3528
|
+
}
|
|
3529
|
+
},
|
|
3530
|
+
defaultVariants: {
|
|
3531
|
+
side: "right"
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
);
|
|
3535
|
+
var SheetContent = React37.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs25(SheetPortal, { children: [
|
|
3536
|
+
/* @__PURE__ */ jsx40(SheetOverlay, {}),
|
|
3537
|
+
/* @__PURE__ */ jsxs25(
|
|
3538
|
+
SheetPrimitive.Content,
|
|
3539
|
+
{
|
|
3540
|
+
ref,
|
|
3541
|
+
className: cn(sheetVariants({ side }), className),
|
|
3542
|
+
...props,
|
|
3543
|
+
children: [
|
|
3544
|
+
children,
|
|
3545
|
+
/* @__PURE__ */ jsxs25(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
3546
|
+
/* @__PURE__ */ jsx40(X2, { className: "h-4 w-4" }),
|
|
3547
|
+
/* @__PURE__ */ jsx40("span", { className: "sr-only", children: "Close" })
|
|
3548
|
+
] })
|
|
3549
|
+
]
|
|
3550
|
+
}
|
|
3551
|
+
)
|
|
3552
|
+
] }));
|
|
3553
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
3554
|
+
var SheetHeader = ({
|
|
3555
|
+
className,
|
|
3556
|
+
...props
|
|
3557
|
+
}) => /* @__PURE__ */ jsx40(
|
|
3558
|
+
"div",
|
|
3559
|
+
{
|
|
3560
|
+
className: cn(
|
|
3561
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
3562
|
+
className
|
|
3563
|
+
),
|
|
3564
|
+
...props
|
|
3565
|
+
}
|
|
3566
|
+
);
|
|
3567
|
+
SheetHeader.displayName = "SheetHeader";
|
|
3568
|
+
var SheetFooter = ({
|
|
3569
|
+
className,
|
|
3570
|
+
...props
|
|
3571
|
+
}) => /* @__PURE__ */ jsx40(
|
|
3572
|
+
"div",
|
|
3573
|
+
{
|
|
3574
|
+
className: cn(
|
|
3575
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
3576
|
+
className
|
|
3577
|
+
),
|
|
3578
|
+
...props
|
|
3579
|
+
}
|
|
3580
|
+
);
|
|
3581
|
+
SheetFooter.displayName = "SheetFooter";
|
|
3582
|
+
var SheetTitle = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3583
|
+
SheetPrimitive.Title,
|
|
3584
|
+
{
|
|
3585
|
+
ref,
|
|
3586
|
+
className: cn("text-lg font-semibold text-foreground", className),
|
|
3587
|
+
...props
|
|
3588
|
+
}
|
|
3589
|
+
));
|
|
3590
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
3591
|
+
var SheetDescription = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3592
|
+
SheetPrimitive.Description,
|
|
3593
|
+
{
|
|
3594
|
+
ref,
|
|
3595
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
3596
|
+
...props
|
|
3597
|
+
}
|
|
3598
|
+
));
|
|
3599
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
3600
|
+
|
|
3601
|
+
// source/components/primitive/Sidebar/sidebar.tsx
|
|
3602
|
+
import * as React41 from "react";
|
|
3603
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
3604
|
+
import { cva as cva15 } from "class-variance-authority";
|
|
3605
|
+
import { PanelLeft } from "lucide-react";
|
|
3606
|
+
|
|
3607
|
+
// source/hooks/use-mobile.ts
|
|
3608
|
+
import * as React38 from "react";
|
|
3609
|
+
var MOBILE_MAX = 768;
|
|
3610
|
+
function useIsMobile(breakpoint = MOBILE_MAX) {
|
|
3611
|
+
const [isMobile, setIsMobile] = React38.useState(
|
|
3612
|
+
() => typeof window !== "undefined" ? window.innerWidth < breakpoint : false
|
|
3613
|
+
);
|
|
3614
|
+
React38.useEffect(() => {
|
|
3615
|
+
const mq = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
3616
|
+
const onChange = () => setIsMobile(mq.matches);
|
|
3617
|
+
onChange();
|
|
3618
|
+
mq.addEventListener("change", onChange);
|
|
3619
|
+
return () => mq.removeEventListener("change", onChange);
|
|
3620
|
+
}, [breakpoint]);
|
|
3621
|
+
return isMobile;
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3624
|
+
// source/components/primitive/Skeleton/skeleton.tsx
|
|
3625
|
+
import * as React39 from "react";
|
|
3626
|
+
import { cva as cva14 } from "class-variance-authority";
|
|
3627
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3628
|
+
var skeletonVariants = cva14(
|
|
3629
|
+
"animate-pulse bg-muted",
|
|
3630
|
+
{
|
|
3631
|
+
variants: {
|
|
3632
|
+
rounded: {
|
|
3633
|
+
default: "rounded-md",
|
|
3634
|
+
sm: "rounded-sm",
|
|
3635
|
+
lg: "rounded-lg",
|
|
3636
|
+
full: "rounded-full"
|
|
3637
|
+
}
|
|
3638
|
+
},
|
|
3639
|
+
defaultVariants: {
|
|
3640
|
+
rounded: "default"
|
|
3641
|
+
}
|
|
3642
|
+
}
|
|
3643
|
+
);
|
|
3644
|
+
var Skeleton = React39.forwardRef(
|
|
3645
|
+
({ className, rounded, ...props }, ref) => {
|
|
3646
|
+
return /* @__PURE__ */ jsx41(
|
|
3647
|
+
"div",
|
|
3648
|
+
{
|
|
3649
|
+
ref,
|
|
3650
|
+
"aria-busy": "true",
|
|
3651
|
+
"aria-live": "polite",
|
|
3652
|
+
className: cn(skeletonVariants({ rounded }), className),
|
|
3653
|
+
...props
|
|
3654
|
+
}
|
|
3655
|
+
);
|
|
3656
|
+
}
|
|
3657
|
+
);
|
|
3658
|
+
Skeleton.displayName = "Skeleton";
|
|
3659
|
+
|
|
3660
|
+
// source/components/primitive/ToolTip/tooltip.tsx
|
|
3661
|
+
import * as React40 from "react";
|
|
3662
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3663
|
+
import { jsx as jsx42, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3664
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
3665
|
+
var Tooltip = ({ ...props }) => {
|
|
3666
|
+
return /* @__PURE__ */ jsx42(TooltipPrimitive.Root, { ...props });
|
|
3667
|
+
};
|
|
3668
|
+
Tooltip.displayName = "Tooltip";
|
|
3669
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
3670
|
+
TooltipTrigger.displayName = "TooltipTrigger";
|
|
3671
|
+
var TooltipContent = React40.forwardRef(({ className, sideOffset = 4, arrow = false, children, ...props }, ref) => {
|
|
3672
|
+
return /* @__PURE__ */ jsx42(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs26(
|
|
3673
|
+
TooltipPrimitive.Content,
|
|
3674
|
+
{
|
|
3675
|
+
ref,
|
|
3676
|
+
sideOffset,
|
|
3677
|
+
className: cn(
|
|
3678
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md",
|
|
3679
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
3680
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3681
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
3682
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
3683
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
3684
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
3685
|
+
className
|
|
3686
|
+
),
|
|
3687
|
+
...props,
|
|
3688
|
+
children: [
|
|
3689
|
+
children,
|
|
3690
|
+
arrow && /* @__PURE__ */ jsx42(TooltipPrimitive.Arrow, { className: "fill-popover" })
|
|
3691
|
+
]
|
|
3692
|
+
}
|
|
3693
|
+
) });
|
|
3694
|
+
});
|
|
3695
|
+
TooltipContent.displayName = "TooltipContent";
|
|
3696
|
+
|
|
3697
|
+
// source/components/primitive/Sidebar/sidebar.tsx
|
|
3698
|
+
import { jsx as jsx43, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3699
|
+
var SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
3700
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
3701
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
3702
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
3703
|
+
var SIDEBAR_WIDTH_ICON = "4rem";
|
|
3704
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
3705
|
+
var SidebarContext = React41.createContext(null);
|
|
3706
|
+
function useSidebar() {
|
|
3707
|
+
const context = React41.useContext(SidebarContext);
|
|
3708
|
+
if (!context) {
|
|
3709
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
3710
|
+
}
|
|
3711
|
+
return context;
|
|
3712
|
+
}
|
|
3713
|
+
var SidebarProvider = React41.forwardRef(
|
|
3714
|
+
({
|
|
3715
|
+
defaultOpen = true,
|
|
3716
|
+
open: openProp,
|
|
3717
|
+
onOpenChange: setOpenProp,
|
|
3718
|
+
className,
|
|
3719
|
+
style,
|
|
3720
|
+
children,
|
|
3721
|
+
...props
|
|
3722
|
+
}, ref) => {
|
|
3723
|
+
const isMobile = useIsMobile();
|
|
3724
|
+
const [openMobile, setOpenMobile] = React41.useState(false);
|
|
3725
|
+
const [_open, _setOpen] = React41.useState(() => {
|
|
3726
|
+
if (typeof window === "undefined") return defaultOpen;
|
|
3727
|
+
const cookie = document.cookie.split("; ").find((row) => row.startsWith(`${SIDEBAR_COOKIE_NAME}=`));
|
|
3728
|
+
if (!cookie) return defaultOpen;
|
|
3729
|
+
return cookie.split("=")[1] === "true";
|
|
3730
|
+
});
|
|
3731
|
+
const open = openProp ?? _open;
|
|
3732
|
+
const setOpen = React41.useCallback(
|
|
3733
|
+
(value) => {
|
|
3734
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
3735
|
+
if (setOpenProp) {
|
|
3736
|
+
setOpenProp(openState);
|
|
3737
|
+
} else {
|
|
3738
|
+
_setOpen(openState);
|
|
3739
|
+
}
|
|
3740
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
3741
|
+
},
|
|
3742
|
+
[setOpenProp, open]
|
|
3743
|
+
);
|
|
3744
|
+
const toggleSidebar = React41.useCallback(() => {
|
|
3745
|
+
if (isMobile) {
|
|
3746
|
+
setOpenMobile((v) => !v);
|
|
3747
|
+
} else {
|
|
3748
|
+
setOpen((v) => !v);
|
|
3749
|
+
}
|
|
3750
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
3751
|
+
React41.useEffect(() => {
|
|
3752
|
+
const cookie = document.cookie.split("; ").find((row) => row.startsWith(`${SIDEBAR_COOKIE_NAME}=`));
|
|
3753
|
+
if (cookie) {
|
|
3754
|
+
const value = cookie.split("=")[1];
|
|
3755
|
+
_setOpen(value === "true");
|
|
3756
|
+
}
|
|
3757
|
+
}, []);
|
|
3758
|
+
React41.useEffect(() => {
|
|
3759
|
+
const handleKeyDown = (event) => {
|
|
3760
|
+
if (event.key === "Escape") {
|
|
3761
|
+
setOpenMobile(false);
|
|
3762
|
+
}
|
|
3763
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
3764
|
+
event.preventDefault();
|
|
3765
|
+
toggleSidebar();
|
|
3766
|
+
}
|
|
3767
|
+
};
|
|
3768
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
3769
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
3770
|
+
}, [toggleSidebar]);
|
|
3771
|
+
const state = open ? "expanded" : "collapsed";
|
|
3772
|
+
const contextValue = React41.useMemo(
|
|
3773
|
+
() => ({
|
|
3774
|
+
state,
|
|
3775
|
+
open,
|
|
3776
|
+
setOpen,
|
|
3777
|
+
isMobile,
|
|
3778
|
+
openMobile,
|
|
3779
|
+
setOpenMobile,
|
|
3780
|
+
toggleSidebar
|
|
3781
|
+
}),
|
|
3782
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
3783
|
+
);
|
|
3784
|
+
return /* @__PURE__ */ jsx43(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx43(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx43(
|
|
3785
|
+
"div",
|
|
3786
|
+
{
|
|
3787
|
+
style: {
|
|
3788
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
3789
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
3790
|
+
...style
|
|
3791
|
+
},
|
|
3792
|
+
className: cn(
|
|
3793
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
|
|
3794
|
+
className
|
|
3795
|
+
),
|
|
3796
|
+
ref,
|
|
3797
|
+
...props,
|
|
3798
|
+
children
|
|
3799
|
+
}
|
|
3800
|
+
) }) });
|
|
3801
|
+
}
|
|
3802
|
+
);
|
|
3803
|
+
SidebarProvider.displayName = "SidebarProvider";
|
|
3804
|
+
var Sidebar = React41.forwardRef(
|
|
3805
|
+
({
|
|
3806
|
+
side = "left",
|
|
3807
|
+
variant = "sidebar",
|
|
3808
|
+
collapsible = "offcanvas",
|
|
3809
|
+
className,
|
|
3810
|
+
children,
|
|
3811
|
+
...props
|
|
3812
|
+
}, ref) => {
|
|
3813
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
3814
|
+
if (collapsible === "none") {
|
|
3815
|
+
return /* @__PURE__ */ jsx43(
|
|
3816
|
+
"div",
|
|
3817
|
+
{
|
|
3818
|
+
className: cn(
|
|
3819
|
+
"flex h-full w-[--sidebar-width] flex-col text-sidebar-foreground",
|
|
3820
|
+
"bg-background/55 dark:bg-background/30",
|
|
3821
|
+
"backdrop-blur-xl backdrop-saturate-150",
|
|
3822
|
+
className
|
|
3823
|
+
),
|
|
3824
|
+
ref,
|
|
3825
|
+
...props,
|
|
3826
|
+
children
|
|
3827
|
+
}
|
|
3828
|
+
);
|
|
3829
|
+
}
|
|
3830
|
+
if (isMobile) {
|
|
3831
|
+
return /* @__PURE__ */ jsx43(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsx43(
|
|
3832
|
+
SheetContent,
|
|
3833
|
+
{
|
|
3834
|
+
"data-sidebar": "sidebar",
|
|
3835
|
+
"data-mobile": "true",
|
|
3836
|
+
className: "w-[--sidebar-width] bg-background/80 backdrop-blur-xl backdrop-saturate-150 p-0 text-sidebar-foreground [&>button]:hidden",
|
|
3837
|
+
style: {
|
|
3838
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
3839
|
+
},
|
|
3840
|
+
side,
|
|
3841
|
+
children: /* @__PURE__ */ jsx43("div", { className: "flex h-full w-full flex-col", children })
|
|
3842
|
+
}
|
|
3843
|
+
) });
|
|
3844
|
+
}
|
|
3845
|
+
return /* @__PURE__ */ jsxs27(
|
|
3846
|
+
"div",
|
|
3847
|
+
{
|
|
3848
|
+
ref,
|
|
3849
|
+
className: "group peer hidden md:block text-sidebar-foreground",
|
|
3850
|
+
"data-state": state,
|
|
3851
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
3852
|
+
"data-variant": variant,
|
|
3853
|
+
"data-side": side,
|
|
3854
|
+
children: [
|
|
3855
|
+
/* @__PURE__ */ jsx43(
|
|
3856
|
+
"div",
|
|
3857
|
+
{
|
|
3858
|
+
className: cn(
|
|
3859
|
+
"duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear",
|
|
3860
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
3861
|
+
"group-data-[side=right]:rotate-180",
|
|
3862
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
|
|
3863
|
+
)
|
|
3864
|
+
}
|
|
3865
|
+
),
|
|
3866
|
+
/* @__PURE__ */ jsx43(
|
|
3867
|
+
"div",
|
|
3868
|
+
{
|
|
3869
|
+
className: cn(
|
|
3870
|
+
"duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-all duration-300 ease-in-out ease-linear md:flex",
|
|
3871
|
+
side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
3872
|
+
// Adjust the padding for floating and inset variants.
|
|
3873
|
+
variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
3874
|
+
className
|
|
3875
|
+
),
|
|
3876
|
+
...props,
|
|
3877
|
+
children: /* @__PURE__ */ jsx43(
|
|
3878
|
+
"div",
|
|
3879
|
+
{
|
|
3880
|
+
"data-sidebar": "sidebar",
|
|
3881
|
+
className: cn(
|
|
3882
|
+
"flex h-full w-full flex-col",
|
|
3883
|
+
"bg-background/55 dark:bg-background/30",
|
|
3884
|
+
"backdrop-blur-xl backdrop-saturate-150",
|
|
3885
|
+
"text-sidebar-foreground",
|
|
3886
|
+
"group-data-[variant=floating]:rounded-2xl",
|
|
3887
|
+
"group-data-[variant=floating]:border group-data-[variant=floating]:border-white/30 dark:group-data-[variant=floating]:border-white/10",
|
|
3888
|
+
"group-data-[variant=floating]:shadow-glass dark:group-data-[variant=floating]:shadow-glass-dark"
|
|
3889
|
+
),
|
|
3890
|
+
children
|
|
3891
|
+
}
|
|
3892
|
+
)
|
|
3893
|
+
}
|
|
3894
|
+
)
|
|
3895
|
+
]
|
|
3896
|
+
}
|
|
3897
|
+
);
|
|
3898
|
+
}
|
|
3899
|
+
);
|
|
3900
|
+
Sidebar.displayName = "Sidebar";
|
|
3901
|
+
var SidebarTrigger = React41.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
3902
|
+
const { toggleSidebar } = useSidebar();
|
|
3903
|
+
return /* @__PURE__ */ jsxs27(
|
|
3904
|
+
Button,
|
|
3905
|
+
{
|
|
3906
|
+
ref,
|
|
3907
|
+
"data-sidebar": "trigger",
|
|
3908
|
+
variant: "ghost",
|
|
3909
|
+
size: "icon",
|
|
3910
|
+
className: cn("h-7 w-7", className),
|
|
3911
|
+
onClick: (event) => {
|
|
3912
|
+
onClick?.(event);
|
|
3913
|
+
toggleSidebar();
|
|
3914
|
+
},
|
|
3915
|
+
...props,
|
|
3916
|
+
children: [
|
|
3917
|
+
/* @__PURE__ */ jsx43(PanelLeft, {}),
|
|
3918
|
+
/* @__PURE__ */ jsx43("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
3919
|
+
]
|
|
3920
|
+
}
|
|
3921
|
+
);
|
|
3922
|
+
});
|
|
3923
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
3924
|
+
var SidebarRail = React41.forwardRef(({ className, ...props }, ref) => {
|
|
3925
|
+
const { toggleSidebar } = useSidebar();
|
|
3926
|
+
return /* @__PURE__ */ jsx43(
|
|
3927
|
+
"button",
|
|
3928
|
+
{
|
|
3929
|
+
ref,
|
|
3930
|
+
"data-sidebar": "rail",
|
|
3931
|
+
"aria-label": "Toggle Sidebar",
|
|
3932
|
+
tabIndex: -1,
|
|
3933
|
+
onClick: toggleSidebar,
|
|
3934
|
+
title: "Toggle Sidebar",
|
|
3935
|
+
className: cn(
|
|
3936
|
+
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
|
3937
|
+
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
3938
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
3939
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
|
|
3940
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
3941
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
3942
|
+
className
|
|
3943
|
+
),
|
|
3944
|
+
...props
|
|
3945
|
+
}
|
|
3946
|
+
);
|
|
3947
|
+
});
|
|
3948
|
+
SidebarRail.displayName = "SidebarRail";
|
|
3949
|
+
var SidebarInset = React41.forwardRef(({ className, ...props }, ref) => {
|
|
3950
|
+
return /* @__PURE__ */ jsx43(
|
|
3951
|
+
"main",
|
|
3952
|
+
{
|
|
3953
|
+
ref,
|
|
3954
|
+
className: cn(
|
|
3955
|
+
"relative flex min-h-svh flex-1 flex-col bg-background",
|
|
3956
|
+
"peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
|
|
3957
|
+
className
|
|
3958
|
+
),
|
|
3959
|
+
...props
|
|
3960
|
+
}
|
|
3961
|
+
);
|
|
3962
|
+
});
|
|
3963
|
+
SidebarInset.displayName = "SidebarInset";
|
|
3964
|
+
var SidebarInput = React41.forwardRef(({ className, ...props }, ref) => {
|
|
3965
|
+
return /* @__PURE__ */ jsx43(
|
|
3966
|
+
Input,
|
|
3967
|
+
{
|
|
3968
|
+
ref,
|
|
3969
|
+
"data-sidebar": "input",
|
|
3970
|
+
className: cn(
|
|
3971
|
+
"h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
|
|
3972
|
+
className
|
|
3973
|
+
),
|
|
3974
|
+
...props
|
|
3975
|
+
}
|
|
3976
|
+
);
|
|
3977
|
+
});
|
|
3978
|
+
SidebarInput.displayName = "SidebarInput";
|
|
3979
|
+
var SidebarHeader = React41.forwardRef(({ className, ...props }, ref) => {
|
|
3980
|
+
return /* @__PURE__ */ jsx43(
|
|
3981
|
+
"div",
|
|
3982
|
+
{
|
|
3983
|
+
ref,
|
|
3984
|
+
"data-sidebar": "header",
|
|
3985
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
3986
|
+
...props
|
|
3987
|
+
}
|
|
3988
|
+
);
|
|
3989
|
+
});
|
|
3990
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
3991
|
+
var SidebarFooter = React41.forwardRef(({ className, ...props }, ref) => {
|
|
3992
|
+
return /* @__PURE__ */ jsx43(
|
|
3993
|
+
"div",
|
|
3994
|
+
{
|
|
3995
|
+
ref,
|
|
3996
|
+
"data-sidebar": "footer",
|
|
3997
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
3998
|
+
...props
|
|
3999
|
+
}
|
|
4000
|
+
);
|
|
4001
|
+
});
|
|
4002
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
4003
|
+
var SidebarSeparator = React41.forwardRef(({ className, ...props }, ref) => {
|
|
4004
|
+
return /* @__PURE__ */ jsx43(
|
|
4005
|
+
Separator3,
|
|
4006
|
+
{
|
|
4007
|
+
ref,
|
|
4008
|
+
"data-sidebar": "separator",
|
|
4009
|
+
className: cn("mx-2 w-auto bg-brand-600/10 dark:bg-brand-400/10", className),
|
|
4010
|
+
...props
|
|
4011
|
+
}
|
|
4012
|
+
);
|
|
4013
|
+
});
|
|
4014
|
+
SidebarSeparator.displayName = "SidebarSeparator";
|
|
4015
|
+
var SidebarContent = React41.forwardRef(({ className, ...props }, ref) => {
|
|
4016
|
+
return /* @__PURE__ */ jsx43(
|
|
4017
|
+
"div",
|
|
4018
|
+
{
|
|
4019
|
+
ref,
|
|
4020
|
+
"data-sidebar": "content",
|
|
4021
|
+
className: cn(
|
|
4022
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
4023
|
+
className
|
|
4024
|
+
),
|
|
4025
|
+
...props
|
|
4026
|
+
}
|
|
4027
|
+
);
|
|
4028
|
+
});
|
|
4029
|
+
SidebarContent.displayName = "SidebarContent";
|
|
4030
|
+
var SidebarGroup = React41.forwardRef(({ className, ...props }, ref) => {
|
|
4031
|
+
return /* @__PURE__ */ jsx43(
|
|
4032
|
+
"div",
|
|
4033
|
+
{
|
|
4034
|
+
ref,
|
|
4035
|
+
"data-sidebar": "group",
|
|
4036
|
+
className: cn("relative flex w-full min-w-0 flex-col p-2", className),
|
|
4037
|
+
...props
|
|
4038
|
+
}
|
|
4039
|
+
);
|
|
4040
|
+
});
|
|
4041
|
+
SidebarGroup.displayName = "SidebarGroup";
|
|
4042
|
+
var SidebarGroupLabel = React41.forwardRef(({ className, asChild = false, showLabel = true, ...props }, ref) => {
|
|
4043
|
+
if (!showLabel) return null;
|
|
4044
|
+
const Comp = asChild ? Slot3 : "div";
|
|
4045
|
+
return /* @__PURE__ */ jsx43(
|
|
4046
|
+
Comp,
|
|
4047
|
+
{
|
|
4048
|
+
ref,
|
|
4049
|
+
"data-sidebar": "group-label",
|
|
4050
|
+
className: cn(
|
|
4051
|
+
"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-semibold uppercase tracking-wide text-brand-700/70 dark:text-brand-400/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
4052
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
4053
|
+
className
|
|
4054
|
+
),
|
|
4055
|
+
...props
|
|
4056
|
+
}
|
|
4057
|
+
);
|
|
4058
|
+
});
|
|
4059
|
+
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
4060
|
+
var SidebarGroupAction = React41.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
4061
|
+
const Comp = asChild ? Slot3 : "button";
|
|
4062
|
+
return /* @__PURE__ */ jsx43(
|
|
4063
|
+
Comp,
|
|
4064
|
+
{
|
|
4065
|
+
ref,
|
|
4066
|
+
"data-sidebar": "group-action",
|
|
4067
|
+
className: cn(
|
|
4068
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
4069
|
+
// Increases the hit area of the button on mobile.
|
|
4070
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
4071
|
+
"group-data-[collapsible=icon]:hidden",
|
|
4072
|
+
className
|
|
4073
|
+
),
|
|
4074
|
+
...props
|
|
4075
|
+
}
|
|
4076
|
+
);
|
|
4077
|
+
});
|
|
4078
|
+
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
4079
|
+
var SidebarGroupContent = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx43(
|
|
4080
|
+
"div",
|
|
4081
|
+
{
|
|
4082
|
+
ref,
|
|
4083
|
+
"data-sidebar": "group-content",
|
|
4084
|
+
className: cn("w-full text-sm", className),
|
|
4085
|
+
...props
|
|
4086
|
+
}
|
|
4087
|
+
));
|
|
4088
|
+
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
4089
|
+
var SidebarMenu = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx43(
|
|
4090
|
+
"ul",
|
|
4091
|
+
{
|
|
4092
|
+
ref,
|
|
4093
|
+
"data-sidebar": "menu",
|
|
4094
|
+
className: cn("flex w-full min-w-0 flex-col gap-1", className),
|
|
4095
|
+
...props
|
|
4096
|
+
}
|
|
4097
|
+
));
|
|
4098
|
+
SidebarMenu.displayName = "SidebarMenu";
|
|
4099
|
+
var SidebarMenuItem = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx43(
|
|
4100
|
+
"li",
|
|
4101
|
+
{
|
|
4102
|
+
ref,
|
|
4103
|
+
"data-sidebar": "menu-item",
|
|
4104
|
+
className: cn("group/menu-item relative", className),
|
|
4105
|
+
...props
|
|
4106
|
+
}
|
|
4107
|
+
));
|
|
4108
|
+
SidebarMenuItem.displayName = "SidebarMenuItem";
|
|
4109
|
+
var sidebarMenuButtonVariants = cva15(
|
|
4110
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-brand-600/10 hover:text-foreground focus-visible:ring-2 active:bg-brand-600/15 active:text-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-brand-600/15 data-[active=true]:font-medium data-[active=true]:text-brand-700 dark:data-[active=true]:text-brand-400 data-[state=open]:hover:bg-brand-600/10 data-[state=open]:hover:text-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-brand-600 dark:[&>svg]:text-brand-400",
|
|
4111
|
+
{
|
|
4112
|
+
variants: {
|
|
4113
|
+
variant: {
|
|
4114
|
+
default: "hover:bg-brand-600/10 hover:text-foreground",
|
|
4115
|
+
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-brand-600/10 hover:text-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
4116
|
+
},
|
|
4117
|
+
size: {
|
|
4118
|
+
default: "h-8 text-sm",
|
|
4119
|
+
sm: "h-7 text-xs",
|
|
4120
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0"
|
|
4121
|
+
}
|
|
4122
|
+
},
|
|
4123
|
+
defaultVariants: {
|
|
4124
|
+
variant: "default",
|
|
4125
|
+
size: "default"
|
|
4126
|
+
}
|
|
4127
|
+
}
|
|
4128
|
+
);
|
|
4129
|
+
var SidebarMenuButton = React41.forwardRef(
|
|
4130
|
+
({
|
|
4131
|
+
asChild = false,
|
|
4132
|
+
isActive = false,
|
|
4133
|
+
variant = "default",
|
|
4134
|
+
size = "default",
|
|
4135
|
+
tooltip,
|
|
4136
|
+
className,
|
|
4137
|
+
...props
|
|
4138
|
+
}, ref) => {
|
|
4139
|
+
const Comp = asChild ? Slot3 : "button";
|
|
4140
|
+
const { isMobile, state } = useSidebar();
|
|
4141
|
+
const button = /* @__PURE__ */ jsx43(
|
|
4142
|
+
Comp,
|
|
4143
|
+
{
|
|
4144
|
+
ref,
|
|
4145
|
+
"data-sidebar": "menu-button",
|
|
4146
|
+
"data-size": size,
|
|
4147
|
+
"data-active": isActive,
|
|
4148
|
+
className: cn(sidebarMenuButtonVariants({ variant, size }), className),
|
|
4149
|
+
...props
|
|
4150
|
+
}
|
|
4151
|
+
);
|
|
4152
|
+
if (!tooltip) {
|
|
4153
|
+
return button;
|
|
4154
|
+
}
|
|
4155
|
+
if (typeof tooltip === "string") {
|
|
4156
|
+
tooltip = {
|
|
4157
|
+
children: tooltip
|
|
4158
|
+
};
|
|
4159
|
+
}
|
|
4160
|
+
return /* @__PURE__ */ jsxs27(Tooltip, { children: [
|
|
4161
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: button }),
|
|
4162
|
+
/* @__PURE__ */ jsx43(
|
|
4163
|
+
TooltipContent,
|
|
4164
|
+
{
|
|
4165
|
+
side: "right",
|
|
4166
|
+
align: "center",
|
|
4167
|
+
hidden: state !== "collapsed" || isMobile,
|
|
4168
|
+
...tooltip
|
|
4169
|
+
}
|
|
4170
|
+
)
|
|
4171
|
+
] });
|
|
4172
|
+
}
|
|
4173
|
+
);
|
|
4174
|
+
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
4175
|
+
var SidebarMenuAction = React41.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
4176
|
+
const Comp = asChild ? Slot3 : "button";
|
|
4177
|
+
return /* @__PURE__ */ jsx43(
|
|
4178
|
+
Comp,
|
|
4179
|
+
{
|
|
4180
|
+
ref,
|
|
4181
|
+
"data-sidebar": "menu-action",
|
|
4182
|
+
className: cn(
|
|
4183
|
+
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
|
4184
|
+
// Increases the hit area of the button on mobile.
|
|
4185
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
4186
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
4187
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
4188
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
4189
|
+
"group-data-[collapsible=icon]:hidden",
|
|
4190
|
+
showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",
|
|
4191
|
+
className
|
|
4192
|
+
),
|
|
4193
|
+
...props
|
|
4194
|
+
}
|
|
4195
|
+
);
|
|
4196
|
+
});
|
|
4197
|
+
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
4198
|
+
var SidebarMenuBadge = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx43(
|
|
4199
|
+
"div",
|
|
4200
|
+
{
|
|
4201
|
+
ref,
|
|
4202
|
+
"data-sidebar": "menu-badge",
|
|
4203
|
+
className: cn(
|
|
4204
|
+
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none",
|
|
4205
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
4206
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
4207
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
4208
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
4209
|
+
"group-data-[collapsible=icon]:hidden",
|
|
4210
|
+
className
|
|
4211
|
+
),
|
|
4212
|
+
...props
|
|
4213
|
+
}
|
|
4214
|
+
));
|
|
4215
|
+
SidebarMenuBadge.displayName = "SidebarMenuBadge";
|
|
4216
|
+
var SidebarMenuSkeleton = React41.forwardRef(({ className, showIcon = false, ...props }, ref) => {
|
|
4217
|
+
const width = React41.useMemo(() => {
|
|
4218
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
4219
|
+
}, []);
|
|
4220
|
+
return /* @__PURE__ */ jsxs27(
|
|
4221
|
+
"div",
|
|
4222
|
+
{
|
|
4223
|
+
ref,
|
|
4224
|
+
"data-sidebar": "menu-skeleton",
|
|
4225
|
+
className: cn("rounded-md h-8 flex gap-2 px-2 items-center", className),
|
|
4226
|
+
...props,
|
|
4227
|
+
children: [
|
|
4228
|
+
showIcon && /* @__PURE__ */ jsx43(
|
|
4229
|
+
Skeleton,
|
|
4230
|
+
{
|
|
4231
|
+
className: "size-4 rounded-md",
|
|
4232
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
4233
|
+
}
|
|
4234
|
+
),
|
|
4235
|
+
/* @__PURE__ */ jsx43(
|
|
4236
|
+
Skeleton,
|
|
4237
|
+
{
|
|
4238
|
+
className: "h-4 flex-1 max-w-[--skeleton-width]",
|
|
4239
|
+
"data-sidebar": "menu-skeleton-text",
|
|
4240
|
+
style: {
|
|
4241
|
+
"--skeleton-width": width
|
|
4242
|
+
}
|
|
4243
|
+
}
|
|
4244
|
+
)
|
|
4245
|
+
]
|
|
4246
|
+
}
|
|
4247
|
+
);
|
|
4248
|
+
});
|
|
4249
|
+
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
4250
|
+
var SidebarMenuSub = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx43(
|
|
4251
|
+
"ul",
|
|
4252
|
+
{
|
|
4253
|
+
ref,
|
|
4254
|
+
"data-sidebar": "menu-sub",
|
|
4255
|
+
className: cn(
|
|
4256
|
+
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-brand-600/20 dark:border-brand-400/20 px-2.5 py-0.5",
|
|
4257
|
+
"group-data-[collapsible=icon]:hidden",
|
|
4258
|
+
className
|
|
4259
|
+
),
|
|
4260
|
+
...props
|
|
4261
|
+
}
|
|
4262
|
+
));
|
|
4263
|
+
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
4264
|
+
var SidebarMenuSubItem = React41.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx43("li", { ref, ...props }));
|
|
4265
|
+
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
4266
|
+
var SidebarMenuSubButton = React41.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
|
4267
|
+
const Comp = asChild ? Slot3 : "a";
|
|
4268
|
+
return /* @__PURE__ */ jsx43(
|
|
4269
|
+
Comp,
|
|
4270
|
+
{
|
|
4271
|
+
ref,
|
|
4272
|
+
"data-sidebar": "menu-sub-button",
|
|
4273
|
+
"data-size": size,
|
|
4274
|
+
"data-active": isActive,
|
|
4275
|
+
className: cn(
|
|
4276
|
+
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-lg px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-brand-600/10 hover:text-foreground focus-visible:ring-2 active:bg-brand-600/15 active:text-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-brand-600 dark:[&>svg]:text-brand-400",
|
|
4277
|
+
"data-[active=true]:bg-brand-600/15 data-[active=true]:text-brand-700 dark:data-[active=true]:text-brand-400",
|
|
4278
|
+
size === "sm" && "text-xs",
|
|
4279
|
+
size === "md" && "text-sm",
|
|
4280
|
+
"group-data-[collapsible=icon]:hidden",
|
|
4281
|
+
className
|
|
4282
|
+
),
|
|
4283
|
+
...props
|
|
4284
|
+
}
|
|
4285
|
+
);
|
|
4286
|
+
});
|
|
4287
|
+
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
4288
|
+
|
|
4289
|
+
// source/components/primitive/Slider/slider.tsx
|
|
4290
|
+
import * as React42 from "react";
|
|
4291
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
4292
|
+
import { jsx as jsx44, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4293
|
+
var Slider = React42.forwardRef(
|
|
4294
|
+
({
|
|
4295
|
+
className,
|
|
4296
|
+
label,
|
|
4297
|
+
showValue,
|
|
4298
|
+
minLabel,
|
|
4299
|
+
maxLabel,
|
|
4300
|
+
defaultValue,
|
|
4301
|
+
value,
|
|
4302
|
+
...props
|
|
4303
|
+
}, ref) => {
|
|
4304
|
+
const [internalValue, setInternalValue] = React42.useState(
|
|
4305
|
+
value || defaultValue || [0]
|
|
4306
|
+
);
|
|
4307
|
+
const currentValue = value ?? internalValue;
|
|
4308
|
+
return /* @__PURE__ */ jsxs28("div", { className: "flex w-full flex-col gap-2", children: [
|
|
4309
|
+
(label || showValue) && /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
|
|
4310
|
+
label && /* @__PURE__ */ jsx44("label", { className: "text-sm font-medium", children: label }),
|
|
4311
|
+
showValue && /* @__PURE__ */ jsx44("span", { className: "text-sm text-muted-foreground", children: currentValue?.[0] })
|
|
4312
|
+
] }),
|
|
4313
|
+
/* @__PURE__ */ jsxs28(
|
|
4314
|
+
SliderPrimitive.Root,
|
|
4315
|
+
{
|
|
4316
|
+
ref,
|
|
4317
|
+
value,
|
|
4318
|
+
defaultValue,
|
|
4319
|
+
onValueChange: (v) => {
|
|
4320
|
+
setInternalValue(v);
|
|
4321
|
+
props.onValueChange?.(v);
|
|
4322
|
+
},
|
|
4323
|
+
className: cn(
|
|
4324
|
+
"relative flex w-full touch-none select-none items-center",
|
|
4325
|
+
className
|
|
4326
|
+
),
|
|
4327
|
+
...props,
|
|
4328
|
+
children: [
|
|
4329
|
+
/* @__PURE__ */ jsx44(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ jsx44(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
4330
|
+
/* @__PURE__ */ jsx44(
|
|
4331
|
+
SliderPrimitive.Thumb,
|
|
4332
|
+
{
|
|
4333
|
+
className: cn(
|
|
4334
|
+
"block h-5 w-5 rounded-full border-2 border-primary bg-background",
|
|
4335
|
+
"ring-offset-background transition-colors",
|
|
4336
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
4337
|
+
"disabled:pointer-events-none disabled:opacity-50"
|
|
4338
|
+
)
|
|
4339
|
+
}
|
|
4340
|
+
)
|
|
4341
|
+
]
|
|
4342
|
+
}
|
|
4343
|
+
),
|
|
4344
|
+
(minLabel || maxLabel) && /* @__PURE__ */ jsxs28("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
|
|
4345
|
+
/* @__PURE__ */ jsx44("span", { children: minLabel }),
|
|
4346
|
+
/* @__PURE__ */ jsx44("span", { children: maxLabel })
|
|
4347
|
+
] })
|
|
4348
|
+
] });
|
|
4349
|
+
}
|
|
4350
|
+
);
|
|
4351
|
+
Slider.displayName = "Slider";
|
|
4352
|
+
|
|
4353
|
+
// source/components/primitive/Table/table.tsx
|
|
4354
|
+
import * as React43 from "react";
|
|
4355
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
4356
|
+
var Table = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx45(
|
|
4357
|
+
"table",
|
|
4358
|
+
{
|
|
4359
|
+
ref,
|
|
4360
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
4361
|
+
...props
|
|
4362
|
+
}
|
|
4363
|
+
) }));
|
|
4364
|
+
Table.displayName = "Table";
|
|
4365
|
+
var TableHeader = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
4366
|
+
TableHeader.displayName = "TableHeader";
|
|
4367
|
+
var TableBody = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
4368
|
+
"tbody",
|
|
4369
|
+
{
|
|
4370
|
+
ref,
|
|
4371
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
4372
|
+
...props
|
|
4373
|
+
}
|
|
4374
|
+
));
|
|
4375
|
+
TableBody.displayName = "TableBody";
|
|
4376
|
+
var TableFooter = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
4377
|
+
"tfoot",
|
|
4378
|
+
{
|
|
4379
|
+
ref,
|
|
4380
|
+
className: cn(
|
|
4381
|
+
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
4382
|
+
className
|
|
4383
|
+
),
|
|
4384
|
+
...props
|
|
4385
|
+
}
|
|
4386
|
+
));
|
|
4387
|
+
TableFooter.displayName = "TableFooter";
|
|
4388
|
+
var TableRow = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
4389
|
+
"tr",
|
|
4390
|
+
{
|
|
4391
|
+
ref,
|
|
4392
|
+
className: cn(
|
|
4393
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
4394
|
+
className
|
|
4395
|
+
),
|
|
4396
|
+
...props
|
|
4397
|
+
}
|
|
4398
|
+
));
|
|
4399
|
+
TableRow.displayName = "TableRow";
|
|
4400
|
+
var TableHead = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
4401
|
+
"th",
|
|
4402
|
+
{
|
|
4403
|
+
ref,
|
|
4404
|
+
className: cn(
|
|
4405
|
+
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
4406
|
+
className
|
|
4407
|
+
),
|
|
4408
|
+
...props
|
|
4409
|
+
}
|
|
4410
|
+
));
|
|
4411
|
+
TableHead.displayName = "TableHead";
|
|
4412
|
+
var TableCell = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
4413
|
+
"td",
|
|
4414
|
+
{
|
|
4415
|
+
ref,
|
|
4416
|
+
className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
|
|
4417
|
+
...props
|
|
4418
|
+
}
|
|
4419
|
+
));
|
|
4420
|
+
TableCell.displayName = "TableCell";
|
|
4421
|
+
var TableCaption = React43.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
4422
|
+
"caption",
|
|
4423
|
+
{
|
|
4424
|
+
ref,
|
|
4425
|
+
className: cn("mt-4 text-sm text-muted-foreground", className),
|
|
4426
|
+
...props
|
|
4427
|
+
}
|
|
4428
|
+
));
|
|
4429
|
+
TableCaption.displayName = "TableCaption";
|
|
4430
|
+
|
|
4431
|
+
// source/components/primitive/Tabs/tabs.tsx
|
|
4432
|
+
import * as React44 from "react";
|
|
4433
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
4434
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4435
|
+
var Tabs = TabsPrimitive.Root;
|
|
4436
|
+
var TabsList = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4437
|
+
TabsPrimitive.List,
|
|
4438
|
+
{
|
|
4439
|
+
ref,
|
|
4440
|
+
className: cn(
|
|
4441
|
+
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
4442
|
+
className
|
|
4443
|
+
),
|
|
4444
|
+
...props
|
|
4445
|
+
}
|
|
4446
|
+
));
|
|
4447
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
4448
|
+
var TabsTrigger = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4449
|
+
TabsPrimitive.Trigger,
|
|
4450
|
+
{
|
|
4451
|
+
ref,
|
|
4452
|
+
className: cn(
|
|
4453
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm",
|
|
4454
|
+
className
|
|
4455
|
+
),
|
|
4456
|
+
...props
|
|
4457
|
+
}
|
|
4458
|
+
));
|
|
4459
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
4460
|
+
var TabsContent = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(
|
|
4461
|
+
TabsPrimitive.Content,
|
|
4462
|
+
{
|
|
4463
|
+
ref,
|
|
4464
|
+
className: cn(
|
|
4465
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
4466
|
+
className
|
|
4467
|
+
),
|
|
4468
|
+
...props
|
|
4469
|
+
}
|
|
4470
|
+
));
|
|
4471
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
4472
|
+
|
|
4473
|
+
// source/components/primitive/Toast/toast.tsx
|
|
4474
|
+
import * as React45 from "react";
|
|
4475
|
+
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
4476
|
+
import { cva as cva16 } from "class-variance-authority";
|
|
4477
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4478
|
+
var ToastProvider = ToastPrimitive.Provider;
|
|
4479
|
+
var ToastViewport = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4480
|
+
ToastPrimitive.Viewport,
|
|
4481
|
+
{
|
|
4482
|
+
ref,
|
|
4483
|
+
className: cn(
|
|
4484
|
+
"fixed top-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:w-auto md:max-w-[420px]",
|
|
4485
|
+
className
|
|
4486
|
+
),
|
|
4487
|
+
...props
|
|
4488
|
+
}
|
|
4489
|
+
));
|
|
4490
|
+
ToastViewport.displayName = ToastPrimitive.Viewport.displayName;
|
|
4491
|
+
var toastVariants = cva16(
|
|
4492
|
+
[
|
|
4493
|
+
"group pointer-events-auto relative flex w-full items-center justify-between gap-4",
|
|
4494
|
+
"overflow-hidden rounded-xl border p-4 pr-8",
|
|
4495
|
+
"backdrop-blur-md backdrop-saturate-125",
|
|
4496
|
+
"shadow-[0_4px_24px_-2px_rgb(0_0_0/0.10),inset_0_-1px_0_rgb(255_255_255/0.45)]",
|
|
4497
|
+
"dark:shadow-[0_4px_24px_-2px_rgb(0_0_0/0.40),inset_0_-1px_0_rgb(255_255_255/0.06)]",
|
|
4498
|
+
"transition-all",
|
|
4499
|
+
"data-[swipe=cancel]:translate-x-0",
|
|
4500
|
+
"data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)]",
|
|
4501
|
+
"data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)]",
|
|
4502
|
+
"data-[swipe=move]:transition-none",
|
|
4503
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
4504
|
+
"data-[swipe=end]:animate-out data-[state=closed]:fade-out-80",
|
|
4505
|
+
"data-[state=closed]:slide-out-to-right-full",
|
|
4506
|
+
"data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full"
|
|
4507
|
+
],
|
|
4508
|
+
{
|
|
4509
|
+
variants: {
|
|
4510
|
+
variant: {
|
|
4511
|
+
default: [
|
|
4512
|
+
"border-slate-200/90 bg-slate-100/90 text-slate-900",
|
|
4513
|
+
"dark:border-zinc-600/50 dark:bg-zinc-900/80 dark:text-slate-100"
|
|
4514
|
+
],
|
|
4515
|
+
success: [
|
|
4516
|
+
"border-emerald-300/70 bg-emerald-50/85 text-emerald-950",
|
|
4517
|
+
"dark:border-emerald-500/40 dark:bg-emerald-950/70 dark:text-emerald-100"
|
|
4518
|
+
],
|
|
4519
|
+
warning: [
|
|
4520
|
+
"border-amber-300/70 bg-amber-50/85 text-amber-950",
|
|
4521
|
+
"dark:border-amber-500/40 dark:bg-amber-950/70 dark:text-amber-100"
|
|
4522
|
+
],
|
|
4523
|
+
danger: [
|
|
4524
|
+
"border-rose-300/70 bg-rose-50/85 text-rose-950",
|
|
4525
|
+
"dark:border-rose-500/40 dark:bg-rose-950/70 dark:text-rose-100"
|
|
4526
|
+
],
|
|
4527
|
+
destructive: [
|
|
4528
|
+
"border-rose-300/70 bg-rose-50/85 text-rose-950",
|
|
4529
|
+
"dark:border-rose-500/40 dark:bg-rose-950/70 dark:text-rose-100"
|
|
4530
|
+
]
|
|
4531
|
+
}
|
|
4532
|
+
},
|
|
4533
|
+
defaultVariants: {
|
|
4534
|
+
variant: "default"
|
|
4535
|
+
}
|
|
4536
|
+
}
|
|
4537
|
+
);
|
|
4538
|
+
var Toast = React45.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4539
|
+
ToastPrimitive.Root,
|
|
4540
|
+
{
|
|
4541
|
+
ref,
|
|
4542
|
+
className: cn(toastVariants({ variant }), className),
|
|
4543
|
+
...props
|
|
4544
|
+
}
|
|
4545
|
+
));
|
|
4546
|
+
Toast.displayName = ToastPrimitive.Root.displayName;
|
|
4547
|
+
var ToastAction = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4548
|
+
ToastPrimitive.Action,
|
|
4549
|
+
{
|
|
4550
|
+
ref,
|
|
4551
|
+
className: cn(
|
|
4552
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-lg border border-current/20 bg-white/40 px-3 text-sm font-medium backdrop-blur-sm transition-colors",
|
|
4553
|
+
"hover:bg-white/60 focus:outline-none focus:ring-2 focus:ring-ring/40 focus:ring-offset-0",
|
|
4554
|
+
"dark:bg-white/10 dark:hover:bg-white/20",
|
|
4555
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
4556
|
+
className
|
|
4557
|
+
),
|
|
4558
|
+
...props
|
|
4559
|
+
}
|
|
4560
|
+
));
|
|
4561
|
+
ToastAction.displayName = ToastPrimitive.Action.displayName;
|
|
4562
|
+
var ToastClose = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4563
|
+
ToastPrimitive.Close,
|
|
4564
|
+
{
|
|
4565
|
+
ref,
|
|
4566
|
+
className: cn(
|
|
4567
|
+
"absolute right-2 top-2 rounded-md p-1 text-current/50 opacity-0 transition-opacity",
|
|
4568
|
+
"hover:text-current focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-current/20",
|
|
4569
|
+
"group-hover:opacity-100",
|
|
4570
|
+
className
|
|
4571
|
+
),
|
|
4572
|
+
...props
|
|
4573
|
+
}
|
|
4574
|
+
));
|
|
4575
|
+
ToastClose.displayName = ToastPrimitive.Close.displayName;
|
|
4576
|
+
var ToastTitle = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4577
|
+
ToastPrimitive.Title,
|
|
4578
|
+
{
|
|
4579
|
+
ref,
|
|
4580
|
+
className: cn("text-sm font-semibold [&+div]:text-xs", className),
|
|
4581
|
+
...props
|
|
4582
|
+
}
|
|
4583
|
+
));
|
|
4584
|
+
ToastTitle.displayName = ToastPrimitive.Title.displayName;
|
|
4585
|
+
var ToastDescription = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(
|
|
4586
|
+
ToastPrimitive.Description,
|
|
4587
|
+
{
|
|
4588
|
+
ref,
|
|
4589
|
+
className: cn("text-sm opacity-90", className),
|
|
4590
|
+
...props
|
|
4591
|
+
}
|
|
4592
|
+
));
|
|
4593
|
+
ToastDescription.displayName = ToastPrimitive.Description.displayName;
|
|
4594
|
+
|
|
4595
|
+
// source/components/primitive/Toast/toast-state.ts
|
|
4596
|
+
var TOAST_LIMIT = 5;
|
|
4597
|
+
var memoryState = [];
|
|
4598
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
4599
|
+
function genId() {
|
|
4600
|
+
const c = globalThis.crypto;
|
|
4601
|
+
if (c && "randomUUID" in c) {
|
|
4602
|
+
return c.randomUUID();
|
|
4603
|
+
}
|
|
4604
|
+
return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
4605
|
+
}
|
|
4606
|
+
function publish() {
|
|
4607
|
+
const snapshot = [...memoryState];
|
|
4608
|
+
listeners.forEach((l) => l(snapshot));
|
|
4609
|
+
}
|
|
4610
|
+
function addToast(payload) {
|
|
4611
|
+
const id = genId();
|
|
4612
|
+
memoryState = [...memoryState, { id, ...payload }].slice(-TOAST_LIMIT);
|
|
4613
|
+
publish();
|
|
4614
|
+
return id;
|
|
4615
|
+
}
|
|
4616
|
+
function removeToast(id) {
|
|
4617
|
+
memoryState = memoryState.filter((t) => t.id !== id);
|
|
4618
|
+
publish();
|
|
4619
|
+
}
|
|
4620
|
+
function toast(payload) {
|
|
4621
|
+
return addToast(payload);
|
|
4622
|
+
}
|
|
4623
|
+
function dismissToast(id) {
|
|
4624
|
+
removeToast(id);
|
|
4625
|
+
}
|
|
4626
|
+
function subscribeToasts(listener) {
|
|
4627
|
+
listeners.add(listener);
|
|
4628
|
+
listener(memoryState);
|
|
4629
|
+
return () => {
|
|
4630
|
+
listeners.delete(listener);
|
|
4631
|
+
};
|
|
4632
|
+
}
|
|
4633
|
+
function getToastSnapshot() {
|
|
4634
|
+
return [...memoryState];
|
|
4635
|
+
}
|
|
4636
|
+
|
|
4637
|
+
// source/components/primitive/Toast/toaster.tsx
|
|
4638
|
+
import * as React46 from "react";
|
|
4639
|
+
import { jsx as jsx48, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4640
|
+
function useToast() {
|
|
4641
|
+
const [toasts, setToasts] = React46.useState(() => getToastSnapshot());
|
|
4642
|
+
React46.useEffect(() => subscribeToasts((s) => setToasts([...s])), []);
|
|
4643
|
+
return {
|
|
4644
|
+
toasts,
|
|
4645
|
+
toast,
|
|
4646
|
+
dismiss: dismissToast
|
|
4647
|
+
};
|
|
4648
|
+
}
|
|
4649
|
+
function Toaster({
|
|
4650
|
+
duration = 5e3,
|
|
4651
|
+
label = "Notifications",
|
|
4652
|
+
swipeDirection = "right",
|
|
4653
|
+
viewportClassName,
|
|
4654
|
+
...providerProps
|
|
4655
|
+
}) {
|
|
4656
|
+
const { toasts } = useToast();
|
|
4657
|
+
return /* @__PURE__ */ jsxs29(
|
|
4658
|
+
ToastProvider,
|
|
4659
|
+
{
|
|
4660
|
+
duration,
|
|
4661
|
+
label,
|
|
4662
|
+
swipeDirection,
|
|
4663
|
+
...providerProps,
|
|
4664
|
+
children: [
|
|
4665
|
+
toasts.map(
|
|
4666
|
+
({
|
|
4667
|
+
id,
|
|
4668
|
+
title,
|
|
4669
|
+
description,
|
|
4670
|
+
variant,
|
|
4671
|
+
duration: itemDuration,
|
|
4672
|
+
action
|
|
4673
|
+
}) => {
|
|
4674
|
+
const v = variant ?? "default";
|
|
4675
|
+
return /* @__PURE__ */ jsxs29(
|
|
4676
|
+
Toast,
|
|
4677
|
+
{
|
|
4678
|
+
variant,
|
|
4679
|
+
duration: itemDuration,
|
|
4680
|
+
onOpenChange: (open) => {
|
|
4681
|
+
if (!open) dismissToast(id);
|
|
4682
|
+
},
|
|
4683
|
+
children: [
|
|
4684
|
+
/* @__PURE__ */ jsxs29("div", { className: "grid flex-1 gap-1 pl-1", children: [
|
|
4685
|
+
title ? /* @__PURE__ */ jsx48(ToastTitle, { children: title }) : null,
|
|
4686
|
+
description ? /* @__PURE__ */ jsx48(ToastDescription, { children: description }) : null
|
|
4687
|
+
] }),
|
|
4688
|
+
action ? /* @__PURE__ */ jsx48(
|
|
4689
|
+
ToastAction,
|
|
4690
|
+
{
|
|
4691
|
+
altText: action.altText,
|
|
4692
|
+
onClick: () => {
|
|
4693
|
+
action.onClick();
|
|
4694
|
+
dismissToast(id);
|
|
4695
|
+
},
|
|
4696
|
+
children: action.label
|
|
4697
|
+
}
|
|
4698
|
+
) : null,
|
|
4699
|
+
/* @__PURE__ */ jsx48(ToastClose, { "aria-label": "Dismiss notification", children: /* @__PURE__ */ jsx48(
|
|
4700
|
+
"span",
|
|
4701
|
+
{
|
|
4702
|
+
"aria-hidden": true,
|
|
4703
|
+
className: "text-base leading-none font-light",
|
|
4704
|
+
children: "\xD7"
|
|
4705
|
+
}
|
|
4706
|
+
) })
|
|
4707
|
+
]
|
|
4708
|
+
},
|
|
4709
|
+
id
|
|
4710
|
+
);
|
|
4711
|
+
}
|
|
4712
|
+
),
|
|
4713
|
+
/* @__PURE__ */ jsx48(ToastViewport, { className: cn(viewportClassName) })
|
|
4714
|
+
]
|
|
4715
|
+
}
|
|
4716
|
+
);
|
|
4717
|
+
}
|
|
4718
|
+
Toaster.displayName = "Toaster";
|
|
4719
|
+
export {
|
|
4720
|
+
Accordion,
|
|
4721
|
+
AccordionContent,
|
|
4722
|
+
AccordionItem,
|
|
4723
|
+
AccordionTrigger,
|
|
4724
|
+
Alert,
|
|
4725
|
+
AlertDescription,
|
|
4726
|
+
AlertDialog,
|
|
4727
|
+
AlertDialogAction,
|
|
4728
|
+
AlertDialogCancel,
|
|
4729
|
+
AlertDialogContent,
|
|
4730
|
+
AlertDialogDescription,
|
|
4731
|
+
AlertDialogFooter,
|
|
4732
|
+
AlertDialogHeader,
|
|
4733
|
+
AlertDialogOverlay,
|
|
4734
|
+
AlertDialogPortal,
|
|
4735
|
+
AlertDialogTitle,
|
|
4736
|
+
AlertDialogTrigger,
|
|
4737
|
+
AlertTitle,
|
|
4738
|
+
AppShell,
|
|
4739
|
+
AspectRatio,
|
|
4740
|
+
AsyncSelect,
|
|
4741
|
+
Avatar,
|
|
4742
|
+
AvatarFallback,
|
|
4743
|
+
AvatarImage,
|
|
4744
|
+
Badge,
|
|
4745
|
+
Breadcrumb,
|
|
4746
|
+
BreadcrumbEllipsis,
|
|
4747
|
+
BreadcrumbItem,
|
|
4748
|
+
BreadcrumbLink,
|
|
4749
|
+
BreadcrumbList,
|
|
4750
|
+
BreadcrumbPage,
|
|
4751
|
+
BreadcrumbSeparator,
|
|
4752
|
+
Button,
|
|
4753
|
+
Calendar,
|
|
4754
|
+
CalendarDayButton,
|
|
4755
|
+
Caption,
|
|
4756
|
+
Card,
|
|
4757
|
+
CardContent,
|
|
4758
|
+
CardDescription,
|
|
4759
|
+
CardFooter,
|
|
4760
|
+
CardHeader,
|
|
4761
|
+
CardTitle,
|
|
4762
|
+
Checkbox,
|
|
4763
|
+
Collapsible,
|
|
4764
|
+
CollapsibleContent2 as CollapsibleContent,
|
|
4765
|
+
CollapsibleTrigger2 as CollapsibleTrigger,
|
|
4766
|
+
Container,
|
|
4767
|
+
Dialog,
|
|
4768
|
+
DialogClose,
|
|
4769
|
+
DialogContent,
|
|
4770
|
+
DialogDescription,
|
|
4771
|
+
DialogFooter,
|
|
4772
|
+
DialogHeader,
|
|
4773
|
+
DialogOverlay,
|
|
4774
|
+
DialogPortal,
|
|
4775
|
+
DialogTitle,
|
|
4776
|
+
DialogTrigger,
|
|
4777
|
+
Drawer,
|
|
4778
|
+
DrawerClose,
|
|
4779
|
+
DrawerContent,
|
|
4780
|
+
DrawerDescription,
|
|
4781
|
+
DrawerFooter,
|
|
4782
|
+
DrawerHeader,
|
|
4783
|
+
DrawerOverlay,
|
|
4784
|
+
DrawerPortal,
|
|
4785
|
+
DrawerTitle,
|
|
4786
|
+
DrawerTrigger,
|
|
4787
|
+
DropdownMenu,
|
|
4788
|
+
DropdownMenuCheckboxItem,
|
|
4789
|
+
DropdownMenuContent,
|
|
4790
|
+
DropdownMenuGroup,
|
|
4791
|
+
DropdownMenuItem,
|
|
4792
|
+
DropdownMenuLabel,
|
|
4793
|
+
DropdownMenuPortal,
|
|
4794
|
+
DropdownMenuRadioGroup,
|
|
4795
|
+
DropdownMenuRadioItem,
|
|
4796
|
+
DropdownMenuSeparator,
|
|
4797
|
+
DropdownMenuShortcut,
|
|
4798
|
+
DropdownMenuSub,
|
|
4799
|
+
DropdownMenuSubContent,
|
|
4800
|
+
DropdownMenuSubTrigger,
|
|
4801
|
+
DropdownMenuTrigger,
|
|
4802
|
+
FileDropzone,
|
|
4803
|
+
FormField,
|
|
4804
|
+
Heading,
|
|
4805
|
+
Icon,
|
|
4806
|
+
Input,
|
|
4807
|
+
InputGroup,
|
|
4808
|
+
InputGroupIcon,
|
|
4809
|
+
InputGroupInput,
|
|
4810
|
+
InputOTP,
|
|
4811
|
+
InputOTPGroup,
|
|
4812
|
+
InputOTPSeparator,
|
|
4813
|
+
InputOTPSlot,
|
|
4814
|
+
Label2 as Label,
|
|
4815
|
+
Pagination,
|
|
4816
|
+
PaginationContent,
|
|
4817
|
+
PaginationEllipsis,
|
|
4818
|
+
PaginationItem,
|
|
4819
|
+
PaginationLink,
|
|
4820
|
+
PaginationNext,
|
|
4821
|
+
PaginationPrevious,
|
|
4822
|
+
Popover,
|
|
4823
|
+
PopoverAnchor,
|
|
4824
|
+
PopoverContent,
|
|
4825
|
+
PopoverTrigger,
|
|
4826
|
+
Progress,
|
|
4827
|
+
RadioGroup2 as RadioGroup,
|
|
4828
|
+
RadioGroupItem,
|
|
4829
|
+
RichHtml,
|
|
4830
|
+
RichTextEditor,
|
|
4831
|
+
ScrollArea,
|
|
4832
|
+
ScrollBar,
|
|
4833
|
+
Select,
|
|
4834
|
+
SelectContent,
|
|
4835
|
+
SelectGroup,
|
|
4836
|
+
SelectItem,
|
|
4837
|
+
SelectLabel,
|
|
4838
|
+
SelectScrollDownButton,
|
|
4839
|
+
SelectScrollUpButton,
|
|
4840
|
+
SelectSeparator,
|
|
4841
|
+
SelectTrigger,
|
|
4842
|
+
SelectValue,
|
|
4843
|
+
Separator3 as Separator,
|
|
4844
|
+
Sheet,
|
|
4845
|
+
SheetClose,
|
|
4846
|
+
SheetContent,
|
|
4847
|
+
SheetDescription,
|
|
4848
|
+
SheetFooter,
|
|
4849
|
+
SheetHeader,
|
|
4850
|
+
SheetOverlay,
|
|
4851
|
+
SheetPortal,
|
|
4852
|
+
SheetTitle,
|
|
4853
|
+
SheetTrigger,
|
|
4854
|
+
Sidebar,
|
|
4855
|
+
SidebarContent,
|
|
4856
|
+
SidebarFooter,
|
|
4857
|
+
SidebarGroup,
|
|
4858
|
+
SidebarGroupAction,
|
|
4859
|
+
SidebarGroupContent,
|
|
4860
|
+
SidebarGroupLabel,
|
|
4861
|
+
SidebarHeader,
|
|
4862
|
+
SidebarInput,
|
|
4863
|
+
SidebarInset,
|
|
4864
|
+
SidebarMenu,
|
|
4865
|
+
SidebarMenuAction,
|
|
4866
|
+
SidebarMenuBadge,
|
|
4867
|
+
SidebarMenuButton,
|
|
4868
|
+
SidebarMenuItem,
|
|
4869
|
+
SidebarMenuSkeleton,
|
|
4870
|
+
SidebarMenuSub,
|
|
4871
|
+
SidebarMenuSubButton,
|
|
4872
|
+
SidebarMenuSubItem,
|
|
4873
|
+
SidebarProvider,
|
|
4874
|
+
SidebarRail,
|
|
4875
|
+
SidebarSeparator,
|
|
4876
|
+
SidebarTrigger,
|
|
4877
|
+
Skeleton,
|
|
4878
|
+
Slider,
|
|
4879
|
+
Switch,
|
|
4880
|
+
Table,
|
|
4881
|
+
TableBody,
|
|
4882
|
+
TableCaption,
|
|
4883
|
+
TableCell,
|
|
4884
|
+
TableFooter,
|
|
4885
|
+
TableHead,
|
|
4886
|
+
TableHeader,
|
|
4887
|
+
TableRow,
|
|
4888
|
+
Tabs,
|
|
4889
|
+
TabsContent,
|
|
4890
|
+
TabsList,
|
|
4891
|
+
TabsTrigger,
|
|
4892
|
+
Text,
|
|
4893
|
+
Textarea,
|
|
4894
|
+
Toast,
|
|
4895
|
+
ToastAction,
|
|
4896
|
+
ToastClose,
|
|
4897
|
+
ToastDescription,
|
|
4898
|
+
ToastProvider,
|
|
4899
|
+
ToastTitle,
|
|
4900
|
+
ToastViewport,
|
|
4901
|
+
Toaster,
|
|
4902
|
+
Tooltip,
|
|
4903
|
+
TooltipContent,
|
|
4904
|
+
TooltipProvider,
|
|
4905
|
+
TooltipTrigger,
|
|
4906
|
+
badgeVariants,
|
|
4907
|
+
borderRadius,
|
|
4908
|
+
boxShadow,
|
|
4909
|
+
breakpoints,
|
|
4910
|
+
buttonVariants,
|
|
4911
|
+
captionVariants,
|
|
4912
|
+
checkboxVariants,
|
|
4913
|
+
colors,
|
|
4914
|
+
containerVariants,
|
|
4915
|
+
dismissToast,
|
|
4916
|
+
getIcon,
|
|
4917
|
+
headingVariants,
|
|
4918
|
+
inputGroupSelectTriggerTextAlignClass,
|
|
4919
|
+
inputVariants,
|
|
4920
|
+
labelVariants,
|
|
4921
|
+
registerIcons,
|
|
4922
|
+
separatorVariants,
|
|
4923
|
+
sidebarMenuButtonVariants,
|
|
4924
|
+
skeletonVariants,
|
|
4925
|
+
spacing,
|
|
4926
|
+
switchRootVariants,
|
|
4927
|
+
switchThumbVariants,
|
|
4928
|
+
textVariants,
|
|
4929
|
+
toast,
|
|
4930
|
+
toastVariants,
|
|
4931
|
+
transitionDuration,
|
|
4932
|
+
transitionTimingFunction,
|
|
4933
|
+
typography,
|
|
4934
|
+
useSidebar,
|
|
4935
|
+
useToast
|
|
4936
|
+
};
|