@storm-ds/ui 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/LICENSE +21 -0
- package/README.md +33 -0
- package/dist/charts.d.mts +136 -0
- package/dist/charts.d.ts +136 -0
- package/dist/charts.js +406 -0
- package/dist/charts.js.map +1 -0
- package/dist/charts.mjs +410 -0
- package/dist/charts.mjs.map +1 -0
- package/dist/index.d.mts +927 -0
- package/dist/index.d.ts +927 -0
- package/dist/index.js +3987 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3987 -0
- package/dist/index.mjs.map +1 -0
- package/dist/plugin.d.mts +8 -0
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.js +159 -0
- package/dist/plugin.js.map +1 -0
- package/dist/plugin.mjs +128 -0
- package/dist/plugin.mjs.map +1 -0
- package/package.json +72 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3987 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// src/components/Button.tsx
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
|
|
6
|
+
// src/utils/cn.ts
|
|
7
|
+
import { twMerge } from "tailwind-merge";
|
|
8
|
+
function toClassString(input) {
|
|
9
|
+
if (!input) return "";
|
|
10
|
+
if (typeof input === "string") return input;
|
|
11
|
+
if (Array.isArray(input)) return input.map(toClassString).filter(Boolean).join(" ");
|
|
12
|
+
return Object.entries(input).filter(([, value]) => Boolean(value)).map(([key]) => key).join(" ");
|
|
13
|
+
}
|
|
14
|
+
function cn(...inputs) {
|
|
15
|
+
return twMerge(inputs.map(toClassString).filter(Boolean).join(" "));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// src/components/Button.tsx
|
|
19
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
var variantStyles = {
|
|
21
|
+
default: "border border-storm-primary bg-storm-primary text-storm-primary-foreground hover:bg-storm-primary/90",
|
|
22
|
+
secondary: "border border-storm-secondary bg-storm-secondary text-storm-secondary-foreground hover:bg-storm-secondary/80",
|
|
23
|
+
outline: "border border-storm-border bg-transparent text-storm-foreground hover:bg-storm-accent/10",
|
|
24
|
+
ghost: "border border-transparent bg-transparent text-storm-foreground hover:bg-storm-accent/10",
|
|
25
|
+
destructive: "border border-storm-destructive bg-storm-destructive text-white hover:bg-storm-destructive/90"
|
|
26
|
+
};
|
|
27
|
+
var sizeStyles = {
|
|
28
|
+
sm: "px-3 py-1.5 text-sm",
|
|
29
|
+
md: "px-4 py-2 text-base",
|
|
30
|
+
lg: "px-6 py-3 text-lg"
|
|
31
|
+
};
|
|
32
|
+
var iconOnlySizeStyles = {
|
|
33
|
+
sm: "h-8 w-8",
|
|
34
|
+
md: "h-10 w-10",
|
|
35
|
+
lg: "h-12 w-12"
|
|
36
|
+
};
|
|
37
|
+
var Button = forwardRef(
|
|
38
|
+
({ className, variant = "default", size = "md", loading, iconOnly, disabled, children, ...props }, ref) => {
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
disabled: disabled || loading,
|
|
44
|
+
className: cn(
|
|
45
|
+
"relative inline-flex items-center justify-center rounded-storm-md font-medium transition-colors",
|
|
46
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
47
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
48
|
+
variantStyles[variant],
|
|
49
|
+
iconOnly ? iconOnlySizeStyles[size] : sizeStyles[size],
|
|
50
|
+
iconOnly && "p-0",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
...props,
|
|
54
|
+
children: [
|
|
55
|
+
loading && /* @__PURE__ */ jsxs("svg", { className: "absolute h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
|
|
56
|
+
/* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
57
|
+
/* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: cn(loading && "opacity-0"), children })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
Button.displayName = "Button";
|
|
66
|
+
|
|
67
|
+
// src/components/Card.tsx
|
|
68
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
69
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
70
|
+
var variantStyles2 = {
|
|
71
|
+
outlined: "border border-storm-border bg-storm-background",
|
|
72
|
+
filled: "border border-transparent bg-storm-muted",
|
|
73
|
+
ghost: "border border-transparent bg-transparent"
|
|
74
|
+
};
|
|
75
|
+
var Card = forwardRef2(
|
|
76
|
+
({ className, variant = "outlined", interactive, ...props }, ref) => {
|
|
77
|
+
return /* @__PURE__ */ jsx2(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
ref,
|
|
81
|
+
className: cn(
|
|
82
|
+
"rounded-storm-lg text-storm-foreground",
|
|
83
|
+
variantStyles2[variant],
|
|
84
|
+
interactive && "cursor-pointer transition-colors hover:border-storm-primary/50",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
var CardHeader = forwardRef2(
|
|
93
|
+
({ className, ...props }, ref) => {
|
|
94
|
+
return /* @__PURE__ */ jsx2(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
ref,
|
|
98
|
+
className: cn("p-6 pb-0", className),
|
|
99
|
+
...props
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
var CardBody = forwardRef2(
|
|
105
|
+
({ className, ...props }, ref) => {
|
|
106
|
+
return /* @__PURE__ */ jsx2(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
ref,
|
|
110
|
+
className: cn("p-6", className),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
var CardFooter = forwardRef2(
|
|
117
|
+
({ className, ...props }, ref) => {
|
|
118
|
+
return /* @__PURE__ */ jsx2(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
ref,
|
|
122
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
123
|
+
...props
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
var CardImage = forwardRef2(
|
|
129
|
+
({ className, aspectRatio, alt = "", ...props }, ref) => {
|
|
130
|
+
return /* @__PURE__ */ jsx2(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
className: cn(
|
|
134
|
+
"overflow-hidden",
|
|
135
|
+
aspectRatio === "square" && "aspect-square",
|
|
136
|
+
aspectRatio === "video" && "aspect-video",
|
|
137
|
+
aspectRatio === "4/3" && "aspect-[4/3]",
|
|
138
|
+
aspectRatio === "21/9" && "aspect-[21/9]"
|
|
139
|
+
),
|
|
140
|
+
children: /* @__PURE__ */ jsx2(
|
|
141
|
+
"img",
|
|
142
|
+
{
|
|
143
|
+
ref,
|
|
144
|
+
className: cn("h-full w-full object-cover", className),
|
|
145
|
+
alt,
|
|
146
|
+
...props
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
var CardTitle = forwardRef2(
|
|
154
|
+
({ className, ...props }, ref) => {
|
|
155
|
+
return /* @__PURE__ */ jsx2(
|
|
156
|
+
"h3",
|
|
157
|
+
{
|
|
158
|
+
ref,
|
|
159
|
+
className: cn("text-lg font-semibold text-storm-foreground", className),
|
|
160
|
+
...props
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
var CardDescription = forwardRef2(
|
|
166
|
+
({ className, ...props }, ref) => {
|
|
167
|
+
return /* @__PURE__ */ jsx2(
|
|
168
|
+
"p",
|
|
169
|
+
{
|
|
170
|
+
ref,
|
|
171
|
+
className: cn("text-sm text-storm-muted-foreground", className),
|
|
172
|
+
...props
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
Card.displayName = "Card";
|
|
178
|
+
CardHeader.displayName = "CardHeader";
|
|
179
|
+
CardBody.displayName = "CardBody";
|
|
180
|
+
CardFooter.displayName = "CardFooter";
|
|
181
|
+
CardImage.displayName = "CardImage";
|
|
182
|
+
CardTitle.displayName = "CardTitle";
|
|
183
|
+
CardDescription.displayName = "CardDescription";
|
|
184
|
+
|
|
185
|
+
// src/components/Input.tsx
|
|
186
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
187
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
188
|
+
var sizeStyles2 = {
|
|
189
|
+
sm: "h-8 px-3 py-1.5 text-sm",
|
|
190
|
+
md: "h-10 px-4 py-2 text-base",
|
|
191
|
+
lg: "h-12 px-6 py-3 text-lg"
|
|
192
|
+
};
|
|
193
|
+
var Input = forwardRef3(
|
|
194
|
+
({ className, size = "md", type = "text", error, ...props }, ref) => {
|
|
195
|
+
return /* @__PURE__ */ jsx3(
|
|
196
|
+
"input",
|
|
197
|
+
{
|
|
198
|
+
ref,
|
|
199
|
+
type,
|
|
200
|
+
"aria-invalid": error || void 0,
|
|
201
|
+
className: cn(
|
|
202
|
+
"w-full rounded-storm-md border bg-storm-background text-storm-foreground transition-colors",
|
|
203
|
+
"placeholder:text-storm-muted-foreground",
|
|
204
|
+
error ? "border-storm-destructive focus-visible:ring-storm-destructive" : "border-storm-border focus-visible:border-storm-primary",
|
|
205
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
206
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
207
|
+
sizeStyles2[size],
|
|
208
|
+
className
|
|
209
|
+
),
|
|
210
|
+
...props
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
Input.displayName = "Input";
|
|
216
|
+
|
|
217
|
+
// src/components/Textarea.tsx
|
|
218
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
219
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
220
|
+
var resizeStyles = {
|
|
221
|
+
none: "resize-none",
|
|
222
|
+
vertical: "resize-y",
|
|
223
|
+
horizontal: "resize-x",
|
|
224
|
+
both: "resize"
|
|
225
|
+
};
|
|
226
|
+
var Textarea = forwardRef4(
|
|
227
|
+
({ className, error, resize = "vertical", ...props }, ref) => {
|
|
228
|
+
return /* @__PURE__ */ jsx4(
|
|
229
|
+
"textarea",
|
|
230
|
+
{
|
|
231
|
+
ref,
|
|
232
|
+
"aria-invalid": error || void 0,
|
|
233
|
+
className: cn(
|
|
234
|
+
"w-full min-h-[120px] rounded-storm-md border bg-storm-background px-4 py-2 text-base text-storm-foreground transition-colors",
|
|
235
|
+
"placeholder:text-storm-muted-foreground",
|
|
236
|
+
error ? "border-storm-destructive focus-visible:ring-storm-destructive" : "border-storm-border focus-visible:border-storm-primary",
|
|
237
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
238
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
239
|
+
resizeStyles[resize],
|
|
240
|
+
className
|
|
241
|
+
),
|
|
242
|
+
...props
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
Textarea.displayName = "Textarea";
|
|
248
|
+
|
|
249
|
+
// src/components/Label.tsx
|
|
250
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
251
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
252
|
+
var Label = forwardRef5(
|
|
253
|
+
({ className, required, children, ...props }, ref) => {
|
|
254
|
+
return /* @__PURE__ */ jsxs2(
|
|
255
|
+
"label",
|
|
256
|
+
{
|
|
257
|
+
ref,
|
|
258
|
+
className: cn(
|
|
259
|
+
"text-sm font-medium text-storm-foreground",
|
|
260
|
+
"peer-disabled:opacity-50 peer-disabled:cursor-not-allowed",
|
|
261
|
+
className
|
|
262
|
+
),
|
|
263
|
+
...props,
|
|
264
|
+
children: [
|
|
265
|
+
children,
|
|
266
|
+
required && /* @__PURE__ */ jsx5("span", { className: "text-storm-destructive ml-0.5", "aria-hidden": "true", children: "*" })
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
Label.displayName = "Label";
|
|
273
|
+
|
|
274
|
+
// src/components/Select.tsx
|
|
275
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
276
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
277
|
+
var sizeStyles3 = {
|
|
278
|
+
sm: "h-8 px-3 py-1.5 text-sm",
|
|
279
|
+
md: "h-10 px-4 py-2 text-base",
|
|
280
|
+
lg: "h-12 px-6 py-2 text-lg"
|
|
281
|
+
};
|
|
282
|
+
var Select = forwardRef6(
|
|
283
|
+
({ className, size = "md", error, children, ...props }, ref) => {
|
|
284
|
+
return /* @__PURE__ */ jsx6(
|
|
285
|
+
"select",
|
|
286
|
+
{
|
|
287
|
+
ref,
|
|
288
|
+
"aria-invalid": error || void 0,
|
|
289
|
+
className: cn(
|
|
290
|
+
"w-full appearance-none rounded-storm-md border bg-storm-background pr-10 text-storm-foreground transition-colors",
|
|
291
|
+
`bg-[url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2371717A'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E")] bg-[position:right_0.75rem_center] bg-[length:1.25rem_1.25rem] bg-no-repeat`,
|
|
292
|
+
error ? "border-storm-destructive focus-visible:ring-storm-destructive" : "border-storm-border focus-visible:border-storm-primary",
|
|
293
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
294
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
295
|
+
sizeStyles3[size],
|
|
296
|
+
className
|
|
297
|
+
),
|
|
298
|
+
...props,
|
|
299
|
+
children
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
Select.displayName = "Select";
|
|
305
|
+
|
|
306
|
+
// src/components/Checkbox.tsx
|
|
307
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
308
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
309
|
+
var sizeStyles4 = {
|
|
310
|
+
sm: "h-4 w-4",
|
|
311
|
+
md: "h-5 w-5",
|
|
312
|
+
lg: "h-6 w-6"
|
|
313
|
+
};
|
|
314
|
+
var Checkbox = forwardRef7(
|
|
315
|
+
({ className, size = "md", ...props }, ref) => {
|
|
316
|
+
return /* @__PURE__ */ jsx7(
|
|
317
|
+
"input",
|
|
318
|
+
{
|
|
319
|
+
ref,
|
|
320
|
+
type: "checkbox",
|
|
321
|
+
className: cn(
|
|
322
|
+
"shrink-0 cursor-pointer appearance-none rounded-storm-sm border border-storm-border bg-storm-background transition-colors",
|
|
323
|
+
"checked:border-storm-primary checked:bg-storm-primary",
|
|
324
|
+
`checked:bg-[url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E")] checked:bg-center checked:bg-no-repeat checked:bg-[length:100%_100%]`,
|
|
325
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
326
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
327
|
+
sizeStyles4[size],
|
|
328
|
+
className
|
|
329
|
+
),
|
|
330
|
+
...props
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
Checkbox.displayName = "Checkbox";
|
|
336
|
+
|
|
337
|
+
// src/components/Switch.tsx
|
|
338
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
339
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
340
|
+
var trackSizeStyles = {
|
|
341
|
+
sm: "h-5 w-9",
|
|
342
|
+
md: "h-6 w-11",
|
|
343
|
+
lg: "h-7 w-14"
|
|
344
|
+
};
|
|
345
|
+
var thumbSizeStyles = {
|
|
346
|
+
sm: "h-3 w-3",
|
|
347
|
+
md: "h-4 w-4",
|
|
348
|
+
lg: "h-5 w-5"
|
|
349
|
+
};
|
|
350
|
+
var thumbTranslateStyles = {
|
|
351
|
+
sm: "translate-x-4",
|
|
352
|
+
md: "translate-x-5",
|
|
353
|
+
lg: "translate-x-7"
|
|
354
|
+
};
|
|
355
|
+
var Switch = forwardRef8(
|
|
356
|
+
({ className, checked = false, onChange, disabled, size = "md", ...props }, ref) => {
|
|
357
|
+
return /* @__PURE__ */ jsx8(
|
|
358
|
+
"button",
|
|
359
|
+
{
|
|
360
|
+
ref,
|
|
361
|
+
type: "button",
|
|
362
|
+
role: "switch",
|
|
363
|
+
"aria-checked": checked,
|
|
364
|
+
disabled,
|
|
365
|
+
onClick: () => onChange?.(!checked),
|
|
366
|
+
className: cn(
|
|
367
|
+
"inline-flex shrink-0 cursor-pointer items-center rounded-full border transition-colors",
|
|
368
|
+
checked ? "border-storm-primary bg-storm-primary" : "border-storm-border bg-storm-muted",
|
|
369
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
370
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
371
|
+
trackSizeStyles[size],
|
|
372
|
+
className
|
|
373
|
+
),
|
|
374
|
+
...props,
|
|
375
|
+
children: /* @__PURE__ */ jsx8(
|
|
376
|
+
"span",
|
|
377
|
+
{
|
|
378
|
+
className: cn(
|
|
379
|
+
"pointer-events-none block rounded-full bg-storm-background transition-transform",
|
|
380
|
+
thumbSizeStyles[size],
|
|
381
|
+
checked ? thumbTranslateStyles[size] : "translate-x-0.5"
|
|
382
|
+
)
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
Switch.displayName = "Switch";
|
|
390
|
+
|
|
391
|
+
// src/components/RadioGroup.tsx
|
|
392
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
393
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
394
|
+
var sizeStyles5 = {
|
|
395
|
+
sm: "h-4 w-4",
|
|
396
|
+
md: "h-5 w-5",
|
|
397
|
+
lg: "h-6 w-6"
|
|
398
|
+
};
|
|
399
|
+
var RadioGroup = forwardRef9(
|
|
400
|
+
({ className, orientation = "vertical", ...props }, ref) => {
|
|
401
|
+
return /* @__PURE__ */ jsx9(
|
|
402
|
+
"div",
|
|
403
|
+
{
|
|
404
|
+
ref,
|
|
405
|
+
role: "radiogroup",
|
|
406
|
+
className: cn(
|
|
407
|
+
"flex gap-2",
|
|
408
|
+
orientation === "vertical" ? "flex-col" : "flex-row items-center",
|
|
409
|
+
className
|
|
410
|
+
),
|
|
411
|
+
...props
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
var RadioGroupItem = forwardRef9(
|
|
417
|
+
({ className, size = "md", ...props }, ref) => {
|
|
418
|
+
return /* @__PURE__ */ jsx9(
|
|
419
|
+
"input",
|
|
420
|
+
{
|
|
421
|
+
ref,
|
|
422
|
+
type: "radio",
|
|
423
|
+
className: cn(
|
|
424
|
+
"shrink-0 cursor-pointer appearance-none rounded-full border border-storm-border bg-storm-background transition-colors",
|
|
425
|
+
"checked:border-storm-primary checked:bg-storm-primary",
|
|
426
|
+
`checked:bg-[url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")] checked:bg-center checked:bg-no-repeat checked:bg-[length:100%_100%]`,
|
|
427
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
428
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
429
|
+
sizeStyles5[size],
|
|
430
|
+
className
|
|
431
|
+
),
|
|
432
|
+
...props
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
);
|
|
437
|
+
RadioGroup.displayName = "RadioGroup";
|
|
438
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
439
|
+
|
|
440
|
+
// src/components/InputGroup.tsx
|
|
441
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
442
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
443
|
+
var InputGroup = forwardRef10(
|
|
444
|
+
({ className, ...props }, ref) => {
|
|
445
|
+
return /* @__PURE__ */ jsx10(
|
|
446
|
+
"div",
|
|
447
|
+
{
|
|
448
|
+
ref,
|
|
449
|
+
className: cn(
|
|
450
|
+
"flex items-stretch",
|
|
451
|
+
"[&>*:first-child]:rounded-l-storm-md [&>*:first-child]:rounded-r-none",
|
|
452
|
+
"[&>*:last-child]:rounded-r-storm-md [&>*:last-child]:rounded-l-none",
|
|
453
|
+
"[&>*:not(:first-child):not(:last-child)]:rounded-none",
|
|
454
|
+
"[&>*:not(:first-child)]:-ml-0.5",
|
|
455
|
+
className
|
|
456
|
+
),
|
|
457
|
+
...props
|
|
458
|
+
}
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
);
|
|
462
|
+
var InputGroupAddon = forwardRef10(
|
|
463
|
+
({ className, ...props }, ref) => {
|
|
464
|
+
return /* @__PURE__ */ jsx10(
|
|
465
|
+
"div",
|
|
466
|
+
{
|
|
467
|
+
ref,
|
|
468
|
+
className: cn(
|
|
469
|
+
"inline-flex items-center border border-storm-border bg-storm-muted px-3 text-sm text-storm-muted-foreground",
|
|
470
|
+
className
|
|
471
|
+
),
|
|
472
|
+
...props
|
|
473
|
+
}
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
InputGroup.displayName = "InputGroup";
|
|
478
|
+
InputGroupAddon.displayName = "InputGroupAddon";
|
|
479
|
+
|
|
480
|
+
// src/components/Alert.tsx
|
|
481
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
482
|
+
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
483
|
+
var variantStyles3 = {
|
|
484
|
+
default: "border border-storm-border bg-storm-background text-storm-foreground",
|
|
485
|
+
secondary: "border border-storm-secondary bg-storm-secondary text-storm-secondary-foreground",
|
|
486
|
+
destructive: "border border-storm-destructive/50 bg-storm-destructive/10 text-storm-destructive",
|
|
487
|
+
success: "border border-storm-success/50 bg-storm-success/10 text-storm-success",
|
|
488
|
+
warning: "border border-storm-warning/50 bg-storm-warning/10 text-storm-warning",
|
|
489
|
+
info: "border border-storm-info/50 bg-storm-info/10 text-storm-info"
|
|
490
|
+
};
|
|
491
|
+
var Alert = forwardRef11(
|
|
492
|
+
({ className, variant = "default", icon, children, ...props }, ref) => {
|
|
493
|
+
return /* @__PURE__ */ jsxs3(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
ref,
|
|
497
|
+
role: "alert",
|
|
498
|
+
className: cn(
|
|
499
|
+
"relative w-full rounded-storm-md p-4",
|
|
500
|
+
icon ? "flex gap-3" : "",
|
|
501
|
+
variantStyles3[variant],
|
|
502
|
+
className
|
|
503
|
+
),
|
|
504
|
+
...props,
|
|
505
|
+
children: [
|
|
506
|
+
icon && /* @__PURE__ */ jsx11("span", { className: "shrink-0 [&>svg]:h-5 [&>svg]:w-5", children: icon }),
|
|
507
|
+
icon ? /* @__PURE__ */ jsx11("div", { className: "flex-1", children }) : children
|
|
508
|
+
]
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
);
|
|
513
|
+
var AlertTitle = forwardRef11(
|
|
514
|
+
({ className, ...props }, ref) => {
|
|
515
|
+
return /* @__PURE__ */ jsx11(
|
|
516
|
+
"h5",
|
|
517
|
+
{
|
|
518
|
+
ref,
|
|
519
|
+
className: cn("mb-1 font-medium leading-none", className),
|
|
520
|
+
...props
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
var AlertDescription = forwardRef11(
|
|
526
|
+
({ className, ...props }, ref) => {
|
|
527
|
+
return /* @__PURE__ */ jsx11(
|
|
528
|
+
"p",
|
|
529
|
+
{
|
|
530
|
+
ref,
|
|
531
|
+
className: cn("text-sm opacity-90", className),
|
|
532
|
+
...props
|
|
533
|
+
}
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
);
|
|
537
|
+
Alert.displayName = "Alert";
|
|
538
|
+
AlertTitle.displayName = "AlertTitle";
|
|
539
|
+
AlertDescription.displayName = "AlertDescription";
|
|
540
|
+
|
|
541
|
+
// src/components/Badge.tsx
|
|
542
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
543
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
544
|
+
var variantStyles4 = {
|
|
545
|
+
default: "border border-storm-primary bg-storm-primary text-storm-primary-foreground",
|
|
546
|
+
secondary: "border border-storm-secondary bg-storm-secondary text-storm-secondary-foreground",
|
|
547
|
+
outline: "border border-storm-border bg-transparent text-storm-foreground",
|
|
548
|
+
destructive: "border border-storm-destructive bg-storm-destructive text-white",
|
|
549
|
+
success: "border border-storm-success bg-storm-success text-storm-success-foreground",
|
|
550
|
+
warning: "border border-storm-warning bg-storm-warning text-storm-warning-foreground",
|
|
551
|
+
info: "border border-storm-info bg-storm-info text-storm-info-foreground"
|
|
552
|
+
};
|
|
553
|
+
var sizeStyles6 = {
|
|
554
|
+
sm: "px-1.5 py-0.5 text-[10px]",
|
|
555
|
+
md: "px-2.5 py-0.5 text-xs",
|
|
556
|
+
lg: "px-3 py-1 text-sm"
|
|
557
|
+
};
|
|
558
|
+
var Badge = forwardRef12(
|
|
559
|
+
({ className, variant = "default", size = "md", ...props }, ref) => {
|
|
560
|
+
return /* @__PURE__ */ jsx12(
|
|
561
|
+
"span",
|
|
562
|
+
{
|
|
563
|
+
ref,
|
|
564
|
+
className: cn(
|
|
565
|
+
"inline-flex items-center rounded-storm-sm font-medium transition-colors",
|
|
566
|
+
variantStyles4[variant],
|
|
567
|
+
sizeStyles6[size],
|
|
568
|
+
className
|
|
569
|
+
),
|
|
570
|
+
...props
|
|
571
|
+
}
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
Badge.displayName = "Badge";
|
|
576
|
+
|
|
577
|
+
// src/components/Avatar.tsx
|
|
578
|
+
import { forwardRef as forwardRef13, useState } from "react";
|
|
579
|
+
import { jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
580
|
+
var sizeStyles7 = {
|
|
581
|
+
sm: "h-8 w-8 text-xs",
|
|
582
|
+
md: "h-10 w-10 text-sm",
|
|
583
|
+
lg: "h-12 w-12 text-base"
|
|
584
|
+
};
|
|
585
|
+
var Avatar = forwardRef13(
|
|
586
|
+
({ className, size = "md", src, alt, fallback, ...props }, ref) => {
|
|
587
|
+
const [imgError, setImgError] = useState(false);
|
|
588
|
+
const initials = fallback || (alt ? alt.split(" ").map((w) => w[0]).slice(0, 2).join("").toUpperCase() : "?");
|
|
589
|
+
return /* @__PURE__ */ jsx13(
|
|
590
|
+
"span",
|
|
591
|
+
{
|
|
592
|
+
ref,
|
|
593
|
+
className: cn(
|
|
594
|
+
"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-storm-border bg-storm-muted font-medium text-storm-muted-foreground",
|
|
595
|
+
sizeStyles7[size],
|
|
596
|
+
className
|
|
597
|
+
),
|
|
598
|
+
"aria-label": alt,
|
|
599
|
+
...props,
|
|
600
|
+
children: src && !imgError ? /* @__PURE__ */ jsx13(
|
|
601
|
+
"img",
|
|
602
|
+
{
|
|
603
|
+
src,
|
|
604
|
+
alt: alt || "",
|
|
605
|
+
className: "h-full w-full object-cover",
|
|
606
|
+
onError: () => setImgError(true)
|
|
607
|
+
}
|
|
608
|
+
) : initials
|
|
609
|
+
}
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
);
|
|
613
|
+
var AvatarGroup = forwardRef13(
|
|
614
|
+
({ className, max, children, ...props }, ref) => {
|
|
615
|
+
const childArray = Array.isArray(children) ? children : [children];
|
|
616
|
+
const visibleChildren = max ? childArray.slice(0, max) : childArray;
|
|
617
|
+
const overflow = max ? childArray.length - max : 0;
|
|
618
|
+
return /* @__PURE__ */ jsxs4(
|
|
619
|
+
"div",
|
|
620
|
+
{
|
|
621
|
+
ref,
|
|
622
|
+
className: cn("flex items-center -space-x-2", className),
|
|
623
|
+
...props,
|
|
624
|
+
children: [
|
|
625
|
+
visibleChildren,
|
|
626
|
+
overflow > 0 && /* @__PURE__ */ jsxs4("span", { className: "relative inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full border border-storm-border bg-storm-muted text-xs font-medium text-storm-muted-foreground", children: [
|
|
627
|
+
"+",
|
|
628
|
+
overflow
|
|
629
|
+
] })
|
|
630
|
+
]
|
|
631
|
+
}
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
);
|
|
635
|
+
Avatar.displayName = "Avatar";
|
|
636
|
+
AvatarGroup.displayName = "AvatarGroup";
|
|
637
|
+
|
|
638
|
+
// src/components/Skeleton.tsx
|
|
639
|
+
import { forwardRef as forwardRef14 } from "react";
|
|
640
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
641
|
+
var variantStyles5 = {
|
|
642
|
+
default: "rounded-storm-md",
|
|
643
|
+
circle: "rounded-full",
|
|
644
|
+
text: "rounded-storm-sm h-4"
|
|
645
|
+
};
|
|
646
|
+
var Skeleton = forwardRef14(
|
|
647
|
+
({ className, variant = "default", ...props }, ref) => {
|
|
648
|
+
return /* @__PURE__ */ jsx14(
|
|
649
|
+
"div",
|
|
650
|
+
{
|
|
651
|
+
ref,
|
|
652
|
+
className: cn(
|
|
653
|
+
"animate-pulse bg-storm-muted",
|
|
654
|
+
variantStyles5[variant],
|
|
655
|
+
className
|
|
656
|
+
),
|
|
657
|
+
...props
|
|
658
|
+
}
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
);
|
|
662
|
+
Skeleton.displayName = "Skeleton";
|
|
663
|
+
|
|
664
|
+
// src/components/Separator.tsx
|
|
665
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
666
|
+
import { jsx as jsx15, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
667
|
+
var orientationStyles = {
|
|
668
|
+
horizontal: "h-0 w-full border-t border-storm-border",
|
|
669
|
+
vertical: "w-0 self-stretch border-l border-storm-border"
|
|
670
|
+
};
|
|
671
|
+
var Separator = forwardRef15(
|
|
672
|
+
({ className, orientation = "horizontal", label, ...props }, ref) => {
|
|
673
|
+
if (label && orientation === "horizontal") {
|
|
674
|
+
return /* @__PURE__ */ jsxs5(
|
|
675
|
+
"div",
|
|
676
|
+
{
|
|
677
|
+
ref,
|
|
678
|
+
className: cn("flex items-center gap-3", className),
|
|
679
|
+
role: "separator",
|
|
680
|
+
...props,
|
|
681
|
+
children: [
|
|
682
|
+
/* @__PURE__ */ jsx15("hr", { className: "flex-1 border-0 border-t border-storm-border" }),
|
|
683
|
+
/* @__PURE__ */ jsx15("span", { className: "shrink-0 text-xs text-storm-muted-foreground", children: label }),
|
|
684
|
+
/* @__PURE__ */ jsx15("hr", { className: "flex-1 border-0 border-t border-storm-border" })
|
|
685
|
+
]
|
|
686
|
+
}
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
return /* @__PURE__ */ jsx15(
|
|
690
|
+
"hr",
|
|
691
|
+
{
|
|
692
|
+
ref,
|
|
693
|
+
className: cn(
|
|
694
|
+
"border-0",
|
|
695
|
+
orientationStyles[orientation],
|
|
696
|
+
className
|
|
697
|
+
),
|
|
698
|
+
...props
|
|
699
|
+
}
|
|
700
|
+
);
|
|
701
|
+
}
|
|
702
|
+
);
|
|
703
|
+
Separator.displayName = "Separator";
|
|
704
|
+
|
|
705
|
+
// src/components/Breadcrumb.tsx
|
|
706
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
707
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
708
|
+
var Breadcrumb = forwardRef16(
|
|
709
|
+
({ className, separator = "/", children, ...props }, ref) => {
|
|
710
|
+
return /* @__PURE__ */ jsx16("nav", { ref, "aria-label": "Breadcrumb", ...props, children: /* @__PURE__ */ jsx16(
|
|
711
|
+
"ol",
|
|
712
|
+
{
|
|
713
|
+
className: cn(
|
|
714
|
+
"flex items-center gap-2 text-sm text-storm-muted-foreground",
|
|
715
|
+
className
|
|
716
|
+
),
|
|
717
|
+
children
|
|
718
|
+
}
|
|
719
|
+
) });
|
|
720
|
+
}
|
|
721
|
+
);
|
|
722
|
+
var BreadcrumbItem = forwardRef16(
|
|
723
|
+
({ className, active, children, ...props }, ref) => {
|
|
724
|
+
return /* @__PURE__ */ jsx16(
|
|
725
|
+
"li",
|
|
726
|
+
{
|
|
727
|
+
ref,
|
|
728
|
+
"aria-current": active ? "page" : void 0,
|
|
729
|
+
className: cn(
|
|
730
|
+
"inline-flex items-center gap-2",
|
|
731
|
+
active ? "text-storm-foreground font-medium" : "text-storm-muted-foreground",
|
|
732
|
+
className
|
|
733
|
+
),
|
|
734
|
+
...props,
|
|
735
|
+
children
|
|
736
|
+
}
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
);
|
|
740
|
+
var BreadcrumbSeparator = forwardRef16(
|
|
741
|
+
({ className, children, ...props }, ref) => {
|
|
742
|
+
return /* @__PURE__ */ jsx16(
|
|
743
|
+
"span",
|
|
744
|
+
{
|
|
745
|
+
ref,
|
|
746
|
+
role: "presentation",
|
|
747
|
+
"aria-hidden": "true",
|
|
748
|
+
className: cn("text-storm-muted-foreground", className),
|
|
749
|
+
...props,
|
|
750
|
+
children: children || "/"
|
|
751
|
+
}
|
|
752
|
+
);
|
|
753
|
+
}
|
|
754
|
+
);
|
|
755
|
+
var BreadcrumbEllipsis = forwardRef16(
|
|
756
|
+
({ className, ...props }, ref) => {
|
|
757
|
+
return /* @__PURE__ */ jsx16(
|
|
758
|
+
"span",
|
|
759
|
+
{
|
|
760
|
+
ref,
|
|
761
|
+
"aria-hidden": "true",
|
|
762
|
+
className: cn("inline-flex items-center text-storm-muted-foreground", className),
|
|
763
|
+
...props,
|
|
764
|
+
children: "\u2026"
|
|
765
|
+
}
|
|
766
|
+
);
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
770
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
771
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
772
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
773
|
+
|
|
774
|
+
// src/components/Pagination.tsx
|
|
775
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
776
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
777
|
+
var sizeStyles8 = {
|
|
778
|
+
sm: "h-8 w-8 text-xs",
|
|
779
|
+
md: "h-10 w-10 text-sm",
|
|
780
|
+
lg: "h-12 w-12 text-base"
|
|
781
|
+
};
|
|
782
|
+
var Pagination = forwardRef17(
|
|
783
|
+
({ className, ...props }, ref) => {
|
|
784
|
+
return /* @__PURE__ */ jsx17(
|
|
785
|
+
"nav",
|
|
786
|
+
{
|
|
787
|
+
ref,
|
|
788
|
+
role: "navigation",
|
|
789
|
+
"aria-label": "Pagination",
|
|
790
|
+
className: cn("flex items-center gap-1", className),
|
|
791
|
+
...props
|
|
792
|
+
}
|
|
793
|
+
);
|
|
794
|
+
}
|
|
795
|
+
);
|
|
796
|
+
var PaginationItem = forwardRef17(
|
|
797
|
+
({ className, active, disabled, size = "md", ...props }, ref) => {
|
|
798
|
+
return /* @__PURE__ */ jsx17(
|
|
799
|
+
"button",
|
|
800
|
+
{
|
|
801
|
+
ref,
|
|
802
|
+
disabled,
|
|
803
|
+
"aria-current": active ? "page" : void 0,
|
|
804
|
+
className: cn(
|
|
805
|
+
"inline-flex items-center justify-center rounded-storm-md border font-medium transition-colors",
|
|
806
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
807
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
808
|
+
active ? "border-storm-primary bg-storm-primary text-storm-primary-foreground" : "border-storm-border bg-storm-background text-storm-foreground hover:bg-storm-accent/10",
|
|
809
|
+
sizeStyles8[size],
|
|
810
|
+
className
|
|
811
|
+
),
|
|
812
|
+
...props
|
|
813
|
+
}
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
);
|
|
817
|
+
var PaginationPrevious = forwardRef17(
|
|
818
|
+
({ className, children, ...props }, ref) => {
|
|
819
|
+
return /* @__PURE__ */ jsx17(
|
|
820
|
+
"button",
|
|
821
|
+
{
|
|
822
|
+
ref,
|
|
823
|
+
"aria-label": "Go to previous page",
|
|
824
|
+
className: cn(
|
|
825
|
+
"inline-flex h-10 items-center justify-center gap-1 rounded-storm-md border border-storm-border bg-storm-background px-3 text-sm font-medium text-storm-foreground transition-colors",
|
|
826
|
+
"hover:bg-storm-accent/10",
|
|
827
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
828
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
829
|
+
className
|
|
830
|
+
),
|
|
831
|
+
...props,
|
|
832
|
+
children: children || "Previous"
|
|
833
|
+
}
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
);
|
|
837
|
+
var PaginationNext = forwardRef17(
|
|
838
|
+
({ className, children, ...props }, ref) => {
|
|
839
|
+
return /* @__PURE__ */ jsx17(
|
|
840
|
+
"button",
|
|
841
|
+
{
|
|
842
|
+
ref,
|
|
843
|
+
"aria-label": "Go to next page",
|
|
844
|
+
className: cn(
|
|
845
|
+
"inline-flex h-10 items-center justify-center gap-1 rounded-storm-md border border-storm-border bg-storm-background px-3 text-sm font-medium text-storm-foreground transition-colors",
|
|
846
|
+
"hover:bg-storm-accent/10",
|
|
847
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
848
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
849
|
+
className
|
|
850
|
+
),
|
|
851
|
+
...props,
|
|
852
|
+
children: children || "Next"
|
|
853
|
+
}
|
|
854
|
+
);
|
|
855
|
+
}
|
|
856
|
+
);
|
|
857
|
+
var PaginationEllipsis = forwardRef17(
|
|
858
|
+
({ className, ...props }, ref) => {
|
|
859
|
+
return /* @__PURE__ */ jsx17(
|
|
860
|
+
"span",
|
|
861
|
+
{
|
|
862
|
+
ref,
|
|
863
|
+
"aria-hidden": "true",
|
|
864
|
+
className: cn(
|
|
865
|
+
"inline-flex h-10 w-10 items-center justify-center text-sm text-storm-muted-foreground",
|
|
866
|
+
className
|
|
867
|
+
),
|
|
868
|
+
...props,
|
|
869
|
+
children: "\u2026"
|
|
870
|
+
}
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
Pagination.displayName = "Pagination";
|
|
875
|
+
PaginationItem.displayName = "PaginationItem";
|
|
876
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
877
|
+
PaginationNext.displayName = "PaginationNext";
|
|
878
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
879
|
+
|
|
880
|
+
// src/components/NavigationMenu.tsx
|
|
881
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
882
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
883
|
+
var NavigationMenu = forwardRef18(
|
|
884
|
+
({ className, ...props }, ref) => {
|
|
885
|
+
return /* @__PURE__ */ jsx18(
|
|
886
|
+
"nav",
|
|
887
|
+
{
|
|
888
|
+
ref,
|
|
889
|
+
className: cn(
|
|
890
|
+
"flex items-center gap-1",
|
|
891
|
+
className
|
|
892
|
+
),
|
|
893
|
+
...props
|
|
894
|
+
}
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
);
|
|
898
|
+
var NavigationMenuItem = forwardRef18(
|
|
899
|
+
({ className, ...props }, ref) => {
|
|
900
|
+
return /* @__PURE__ */ jsx18(
|
|
901
|
+
"div",
|
|
902
|
+
{
|
|
903
|
+
ref,
|
|
904
|
+
className: cn("relative", className),
|
|
905
|
+
...props
|
|
906
|
+
}
|
|
907
|
+
);
|
|
908
|
+
}
|
|
909
|
+
);
|
|
910
|
+
var NavigationMenuLink = forwardRef18(
|
|
911
|
+
({ className, active, ...props }, ref) => {
|
|
912
|
+
return /* @__PURE__ */ jsx18(
|
|
913
|
+
"a",
|
|
914
|
+
{
|
|
915
|
+
ref,
|
|
916
|
+
className: cn(
|
|
917
|
+
"inline-flex items-center rounded-storm-md px-3 py-2 text-sm font-medium transition-colors",
|
|
918
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
919
|
+
active ? "text-storm-primary" : "text-storm-foreground hover:text-storm-primary hover:bg-storm-accent/10",
|
|
920
|
+
className
|
|
921
|
+
),
|
|
922
|
+
...props
|
|
923
|
+
}
|
|
924
|
+
);
|
|
925
|
+
}
|
|
926
|
+
);
|
|
927
|
+
NavigationMenu.displayName = "NavigationMenu";
|
|
928
|
+
NavigationMenuItem.displayName = "NavigationMenuItem";
|
|
929
|
+
NavigationMenuLink.displayName = "NavigationMenuLink";
|
|
930
|
+
|
|
931
|
+
// src/components/Dialog.tsx
|
|
932
|
+
import { forwardRef as forwardRef19 } from "react";
|
|
933
|
+
import { X } from "@storm-ds/icons";
|
|
934
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
935
|
+
var sizeStyles9 = {
|
|
936
|
+
sm: "max-w-sm",
|
|
937
|
+
md: "max-w-lg",
|
|
938
|
+
lg: "max-w-2xl",
|
|
939
|
+
xl: "max-w-4xl",
|
|
940
|
+
full: "max-w-[calc(100vw-2rem)]"
|
|
941
|
+
};
|
|
942
|
+
var Dialog = forwardRef19(
|
|
943
|
+
({ className, children, size = "md", ...props }, ref) => {
|
|
944
|
+
return /* @__PURE__ */ jsx19(
|
|
945
|
+
"dialog",
|
|
946
|
+
{
|
|
947
|
+
ref,
|
|
948
|
+
className: cn(
|
|
949
|
+
"fixed inset-0 z-50 m-auto max-h-[85vh] w-full rounded-storm-lg border border-storm-border bg-storm-background p-0 text-storm-foreground backdrop:bg-black/50",
|
|
950
|
+
"open:animate-in open:fade-in-0 open:zoom-in-95",
|
|
951
|
+
sizeStyles9[size],
|
|
952
|
+
className
|
|
953
|
+
),
|
|
954
|
+
...props,
|
|
955
|
+
children
|
|
956
|
+
}
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
);
|
|
960
|
+
var DialogContent = forwardRef19(
|
|
961
|
+
({ className, ...props }, ref) => {
|
|
962
|
+
return /* @__PURE__ */ jsx19(
|
|
963
|
+
"div",
|
|
964
|
+
{
|
|
965
|
+
ref,
|
|
966
|
+
className: cn("p-6", className),
|
|
967
|
+
...props
|
|
968
|
+
}
|
|
969
|
+
);
|
|
970
|
+
}
|
|
971
|
+
);
|
|
972
|
+
var DialogHeader = forwardRef19(
|
|
973
|
+
({ className, ...props }, ref) => {
|
|
974
|
+
return /* @__PURE__ */ jsx19(
|
|
975
|
+
"div",
|
|
976
|
+
{
|
|
977
|
+
ref,
|
|
978
|
+
className: cn("mb-4 space-y-1.5", className),
|
|
979
|
+
...props
|
|
980
|
+
}
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
);
|
|
984
|
+
var DialogTitle = forwardRef19(
|
|
985
|
+
({ className, ...props }, ref) => {
|
|
986
|
+
return /* @__PURE__ */ jsx19(
|
|
987
|
+
"h2",
|
|
988
|
+
{
|
|
989
|
+
ref,
|
|
990
|
+
className: cn("text-lg font-semibold text-storm-foreground", className),
|
|
991
|
+
...props
|
|
992
|
+
}
|
|
993
|
+
);
|
|
994
|
+
}
|
|
995
|
+
);
|
|
996
|
+
var DialogDescription = forwardRef19(
|
|
997
|
+
({ className, ...props }, ref) => {
|
|
998
|
+
return /* @__PURE__ */ jsx19(
|
|
999
|
+
"p",
|
|
1000
|
+
{
|
|
1001
|
+
ref,
|
|
1002
|
+
className: cn("text-sm text-storm-muted-foreground", className),
|
|
1003
|
+
...props
|
|
1004
|
+
}
|
|
1005
|
+
);
|
|
1006
|
+
}
|
|
1007
|
+
);
|
|
1008
|
+
var DialogFooter = forwardRef19(
|
|
1009
|
+
({ className, ...props }, ref) => {
|
|
1010
|
+
return /* @__PURE__ */ jsx19(
|
|
1011
|
+
"div",
|
|
1012
|
+
{
|
|
1013
|
+
ref,
|
|
1014
|
+
className: cn("flex justify-end gap-2 pt-4", className),
|
|
1015
|
+
...props
|
|
1016
|
+
}
|
|
1017
|
+
);
|
|
1018
|
+
}
|
|
1019
|
+
);
|
|
1020
|
+
var DialogClose = forwardRef19(
|
|
1021
|
+
({ className, ...props }, ref) => {
|
|
1022
|
+
return /* @__PURE__ */ jsx19(
|
|
1023
|
+
"button",
|
|
1024
|
+
{
|
|
1025
|
+
ref,
|
|
1026
|
+
type: "button",
|
|
1027
|
+
className: cn(
|
|
1028
|
+
"absolute right-4 top-4 rounded-storm-sm p-1 text-storm-muted-foreground transition-colors",
|
|
1029
|
+
"hover:text-storm-foreground",
|
|
1030
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1031
|
+
className
|
|
1032
|
+
),
|
|
1033
|
+
...props,
|
|
1034
|
+
children: /* @__PURE__ */ jsx19(X, { className: "h-4 w-4" })
|
|
1035
|
+
}
|
|
1036
|
+
);
|
|
1037
|
+
}
|
|
1038
|
+
);
|
|
1039
|
+
Dialog.displayName = "Dialog";
|
|
1040
|
+
DialogContent.displayName = "DialogContent";
|
|
1041
|
+
DialogHeader.displayName = "DialogHeader";
|
|
1042
|
+
DialogTitle.displayName = "DialogTitle";
|
|
1043
|
+
DialogDescription.displayName = "DialogDescription";
|
|
1044
|
+
DialogFooter.displayName = "DialogFooter";
|
|
1045
|
+
DialogClose.displayName = "DialogClose";
|
|
1046
|
+
|
|
1047
|
+
// src/components/DropdownMenu.tsx
|
|
1048
|
+
import { forwardRef as forwardRef20 } from "react";
|
|
1049
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1050
|
+
var DropdownMenu = forwardRef20(
|
|
1051
|
+
({ className, ...props }, ref) => {
|
|
1052
|
+
return /* @__PURE__ */ jsx20(
|
|
1053
|
+
"div",
|
|
1054
|
+
{
|
|
1055
|
+
ref,
|
|
1056
|
+
className: cn("relative inline-block", className),
|
|
1057
|
+
...props
|
|
1058
|
+
}
|
|
1059
|
+
);
|
|
1060
|
+
}
|
|
1061
|
+
);
|
|
1062
|
+
var DropdownMenuTrigger = forwardRef20(
|
|
1063
|
+
({ className, ...props }, ref) => {
|
|
1064
|
+
return /* @__PURE__ */ jsx20(
|
|
1065
|
+
"button",
|
|
1066
|
+
{
|
|
1067
|
+
ref,
|
|
1068
|
+
type: "button",
|
|
1069
|
+
className: cn(
|
|
1070
|
+
"inline-flex items-center justify-center transition-colors",
|
|
1071
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1072
|
+
className
|
|
1073
|
+
),
|
|
1074
|
+
...props
|
|
1075
|
+
}
|
|
1076
|
+
);
|
|
1077
|
+
}
|
|
1078
|
+
);
|
|
1079
|
+
var DropdownMenuContent = forwardRef20(
|
|
1080
|
+
({ className, ...props }, ref) => {
|
|
1081
|
+
return /* @__PURE__ */ jsx20(
|
|
1082
|
+
"div",
|
|
1083
|
+
{
|
|
1084
|
+
ref,
|
|
1085
|
+
role: "menu",
|
|
1086
|
+
className: cn(
|
|
1087
|
+
"absolute z-50 mt-1 min-w-[8rem] overflow-hidden rounded-storm-md border border-storm-border bg-storm-background p-1",
|
|
1088
|
+
className
|
|
1089
|
+
),
|
|
1090
|
+
...props
|
|
1091
|
+
}
|
|
1092
|
+
);
|
|
1093
|
+
}
|
|
1094
|
+
);
|
|
1095
|
+
var DropdownMenuItem = forwardRef20(
|
|
1096
|
+
({ className, destructive, ...props }, ref) => {
|
|
1097
|
+
return /* @__PURE__ */ jsx20(
|
|
1098
|
+
"button",
|
|
1099
|
+
{
|
|
1100
|
+
ref,
|
|
1101
|
+
role: "menuitem",
|
|
1102
|
+
type: "button",
|
|
1103
|
+
className: cn(
|
|
1104
|
+
"flex w-full items-center rounded-storm-sm px-2 py-1.5 text-sm transition-colors",
|
|
1105
|
+
"focus-visible:outline-none",
|
|
1106
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
1107
|
+
destructive ? "text-storm-destructive hover:bg-storm-destructive/10 focus-visible:bg-storm-destructive/10" : "text-storm-foreground hover:bg-storm-accent/10 focus-visible:bg-storm-accent/10",
|
|
1108
|
+
className
|
|
1109
|
+
),
|
|
1110
|
+
...props
|
|
1111
|
+
}
|
|
1112
|
+
);
|
|
1113
|
+
}
|
|
1114
|
+
);
|
|
1115
|
+
var DropdownMenuSeparator = forwardRef20(
|
|
1116
|
+
({ className, ...props }, ref) => {
|
|
1117
|
+
return /* @__PURE__ */ jsx20(
|
|
1118
|
+
"hr",
|
|
1119
|
+
{
|
|
1120
|
+
ref,
|
|
1121
|
+
className: cn("my-1 border-0 border-t border-storm-border", className),
|
|
1122
|
+
...props
|
|
1123
|
+
}
|
|
1124
|
+
);
|
|
1125
|
+
}
|
|
1126
|
+
);
|
|
1127
|
+
var DropdownMenuLabel = forwardRef20(
|
|
1128
|
+
({ className, ...props }, ref) => {
|
|
1129
|
+
return /* @__PURE__ */ jsx20(
|
|
1130
|
+
"div",
|
|
1131
|
+
{
|
|
1132
|
+
ref,
|
|
1133
|
+
className: cn("px-2 py-1.5 text-xs font-semibold text-storm-muted-foreground", className),
|
|
1134
|
+
...props
|
|
1135
|
+
}
|
|
1136
|
+
);
|
|
1137
|
+
}
|
|
1138
|
+
);
|
|
1139
|
+
DropdownMenu.displayName = "DropdownMenu";
|
|
1140
|
+
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
1141
|
+
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
1142
|
+
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
1143
|
+
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
1144
|
+
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
1145
|
+
|
|
1146
|
+
// src/components/Tabs.tsx
|
|
1147
|
+
import { forwardRef as forwardRef21, useState as useState2, createContext, useContext } from "react";
|
|
1148
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1149
|
+
var TabsContext = createContext({ activeTab: "", setActiveTab: () => {
|
|
1150
|
+
} });
|
|
1151
|
+
var Tabs = forwardRef21(
|
|
1152
|
+
({ className, defaultValue = "", children, ...props }, ref) => {
|
|
1153
|
+
const [activeTab, setActiveTab] = useState2(defaultValue);
|
|
1154
|
+
return /* @__PURE__ */ jsx21(TabsContext.Provider, { value: { activeTab, setActiveTab }, children: /* @__PURE__ */ jsx21(
|
|
1155
|
+
"div",
|
|
1156
|
+
{
|
|
1157
|
+
ref,
|
|
1158
|
+
className: cn("w-full", className),
|
|
1159
|
+
...props,
|
|
1160
|
+
children
|
|
1161
|
+
}
|
|
1162
|
+
) });
|
|
1163
|
+
}
|
|
1164
|
+
);
|
|
1165
|
+
var TabsList = forwardRef21(
|
|
1166
|
+
({ className, fullWidth, ...props }, ref) => {
|
|
1167
|
+
return /* @__PURE__ */ jsx21(
|
|
1168
|
+
"div",
|
|
1169
|
+
{
|
|
1170
|
+
ref,
|
|
1171
|
+
role: "tablist",
|
|
1172
|
+
className: cn(
|
|
1173
|
+
"inline-flex items-center gap-1 rounded-storm-md border border-storm-border bg-storm-muted p-1",
|
|
1174
|
+
fullWidth && "w-full [&>*]:flex-1",
|
|
1175
|
+
className
|
|
1176
|
+
),
|
|
1177
|
+
...props
|
|
1178
|
+
}
|
|
1179
|
+
);
|
|
1180
|
+
}
|
|
1181
|
+
);
|
|
1182
|
+
var TabsTrigger = forwardRef21(
|
|
1183
|
+
({ className, value, ...props }, ref) => {
|
|
1184
|
+
const { activeTab, setActiveTab } = useContext(TabsContext);
|
|
1185
|
+
const active = activeTab === value;
|
|
1186
|
+
return /* @__PURE__ */ jsx21(
|
|
1187
|
+
"button",
|
|
1188
|
+
{
|
|
1189
|
+
ref,
|
|
1190
|
+
type: "button",
|
|
1191
|
+
role: "tab",
|
|
1192
|
+
"aria-selected": active,
|
|
1193
|
+
className: cn(
|
|
1194
|
+
"inline-flex items-center justify-center rounded-storm-sm px-3 py-1.5 text-sm font-medium transition-colors",
|
|
1195
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1196
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
1197
|
+
active ? "bg-storm-background text-storm-foreground border border-storm-border" : "text-storm-muted-foreground hover:text-storm-foreground border border-transparent",
|
|
1198
|
+
className
|
|
1199
|
+
),
|
|
1200
|
+
onClick: () => setActiveTab(value),
|
|
1201
|
+
...props
|
|
1202
|
+
}
|
|
1203
|
+
);
|
|
1204
|
+
}
|
|
1205
|
+
);
|
|
1206
|
+
var TabsContent = forwardRef21(
|
|
1207
|
+
({ className, value, ...props }, ref) => {
|
|
1208
|
+
const { activeTab } = useContext(TabsContext);
|
|
1209
|
+
if (activeTab !== value) return null;
|
|
1210
|
+
return /* @__PURE__ */ jsx21(
|
|
1211
|
+
"div",
|
|
1212
|
+
{
|
|
1213
|
+
ref,
|
|
1214
|
+
role: "tabpanel",
|
|
1215
|
+
className: cn("mt-2", className),
|
|
1216
|
+
...props
|
|
1217
|
+
}
|
|
1218
|
+
);
|
|
1219
|
+
}
|
|
1220
|
+
);
|
|
1221
|
+
Tabs.displayName = "Tabs";
|
|
1222
|
+
TabsList.displayName = "TabsList";
|
|
1223
|
+
TabsTrigger.displayName = "TabsTrigger";
|
|
1224
|
+
TabsContent.displayName = "TabsContent";
|
|
1225
|
+
|
|
1226
|
+
// src/components/Toast.tsx
|
|
1227
|
+
import { forwardRef as forwardRef22 } from "react";
|
|
1228
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1229
|
+
var variantStyles6 = {
|
|
1230
|
+
default: "border border-storm-border bg-storm-background text-storm-foreground",
|
|
1231
|
+
destructive: "border border-storm-destructive/50 bg-storm-destructive/10 text-storm-destructive",
|
|
1232
|
+
success: "border border-storm-success/50 bg-storm-success/10 text-storm-success",
|
|
1233
|
+
warning: "border border-storm-warning/50 bg-storm-warning/10 text-storm-warning",
|
|
1234
|
+
info: "border border-storm-info/50 bg-storm-info/10 text-storm-info"
|
|
1235
|
+
};
|
|
1236
|
+
var Toast = forwardRef22(
|
|
1237
|
+
({ className, variant = "default", ...props }, ref) => {
|
|
1238
|
+
return /* @__PURE__ */ jsx22(
|
|
1239
|
+
"div",
|
|
1240
|
+
{
|
|
1241
|
+
ref,
|
|
1242
|
+
role: "alert",
|
|
1243
|
+
className: cn(
|
|
1244
|
+
"pointer-events-auto w-full max-w-sm rounded-storm-md p-4",
|
|
1245
|
+
variantStyles6[variant],
|
|
1246
|
+
className
|
|
1247
|
+
),
|
|
1248
|
+
...props
|
|
1249
|
+
}
|
|
1250
|
+
);
|
|
1251
|
+
}
|
|
1252
|
+
);
|
|
1253
|
+
var ToastTitle = forwardRef22(
|
|
1254
|
+
({ className, ...props }, ref) => {
|
|
1255
|
+
return /* @__PURE__ */ jsx22(
|
|
1256
|
+
"div",
|
|
1257
|
+
{
|
|
1258
|
+
ref,
|
|
1259
|
+
className: cn("text-sm font-semibold", className),
|
|
1260
|
+
...props
|
|
1261
|
+
}
|
|
1262
|
+
);
|
|
1263
|
+
}
|
|
1264
|
+
);
|
|
1265
|
+
var ToastDescription = forwardRef22(
|
|
1266
|
+
({ className, ...props }, ref) => {
|
|
1267
|
+
return /* @__PURE__ */ jsx22(
|
|
1268
|
+
"div",
|
|
1269
|
+
{
|
|
1270
|
+
ref,
|
|
1271
|
+
className: cn("text-sm opacity-90", className),
|
|
1272
|
+
...props
|
|
1273
|
+
}
|
|
1274
|
+
);
|
|
1275
|
+
}
|
|
1276
|
+
);
|
|
1277
|
+
var ToastClose = forwardRef22(
|
|
1278
|
+
({ className, children, ...props }, ref) => {
|
|
1279
|
+
return /* @__PURE__ */ jsx22(
|
|
1280
|
+
"button",
|
|
1281
|
+
{
|
|
1282
|
+
ref,
|
|
1283
|
+
type: "button",
|
|
1284
|
+
className: cn(
|
|
1285
|
+
"absolute right-2 top-2 rounded-storm-sm p-1 opacity-70 transition-opacity",
|
|
1286
|
+
"hover:opacity-100",
|
|
1287
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1288
|
+
className
|
|
1289
|
+
),
|
|
1290
|
+
...props,
|
|
1291
|
+
children: children || "\xD7"
|
|
1292
|
+
}
|
|
1293
|
+
);
|
|
1294
|
+
}
|
|
1295
|
+
);
|
|
1296
|
+
var ToastAction = forwardRef22(
|
|
1297
|
+
({ className, ...props }, ref) => {
|
|
1298
|
+
return /* @__PURE__ */ jsx22(
|
|
1299
|
+
"button",
|
|
1300
|
+
{
|
|
1301
|
+
ref,
|
|
1302
|
+
type: "button",
|
|
1303
|
+
className: cn(
|
|
1304
|
+
"inline-flex shrink-0 items-center justify-center rounded-storm-sm border border-storm-border bg-transparent px-3 py-1 text-sm font-medium transition-colors",
|
|
1305
|
+
"hover:bg-storm-accent/10",
|
|
1306
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1307
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
1308
|
+
className
|
|
1309
|
+
),
|
|
1310
|
+
...props
|
|
1311
|
+
}
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1314
|
+
);
|
|
1315
|
+
Toast.displayName = "Toast";
|
|
1316
|
+
ToastTitle.displayName = "ToastTitle";
|
|
1317
|
+
ToastDescription.displayName = "ToastDescription";
|
|
1318
|
+
ToastClose.displayName = "ToastClose";
|
|
1319
|
+
ToastAction.displayName = "ToastAction";
|
|
1320
|
+
|
|
1321
|
+
// src/components/Tooltip.tsx
|
|
1322
|
+
import { forwardRef as forwardRef23 } from "react";
|
|
1323
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1324
|
+
var sideStyles = {
|
|
1325
|
+
top: "bottom-full left-1/2 mb-2 -translate-x-1/2",
|
|
1326
|
+
bottom: "top-full left-1/2 mt-2 -translate-x-1/2",
|
|
1327
|
+
left: "right-full top-1/2 mr-2 -translate-y-1/2",
|
|
1328
|
+
right: "left-full top-1/2 ml-2 -translate-y-1/2"
|
|
1329
|
+
};
|
|
1330
|
+
var Tooltip = forwardRef23(
|
|
1331
|
+
({ className, ...props }, ref) => {
|
|
1332
|
+
return /* @__PURE__ */ jsx23(
|
|
1333
|
+
"div",
|
|
1334
|
+
{
|
|
1335
|
+
ref,
|
|
1336
|
+
className: cn("relative inline-block group/tooltip", className),
|
|
1337
|
+
...props
|
|
1338
|
+
}
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1341
|
+
);
|
|
1342
|
+
var TooltipTrigger = forwardRef23(
|
|
1343
|
+
({ className, ...props }, ref) => {
|
|
1344
|
+
return /* @__PURE__ */ jsx23(
|
|
1345
|
+
"div",
|
|
1346
|
+
{
|
|
1347
|
+
ref,
|
|
1348
|
+
className: cn("inline-flex", className),
|
|
1349
|
+
...props
|
|
1350
|
+
}
|
|
1351
|
+
);
|
|
1352
|
+
}
|
|
1353
|
+
);
|
|
1354
|
+
var TooltipContent = forwardRef23(
|
|
1355
|
+
({ className, side = "top", ...props }, ref) => {
|
|
1356
|
+
return /* @__PURE__ */ jsx23(
|
|
1357
|
+
"div",
|
|
1358
|
+
{
|
|
1359
|
+
ref,
|
|
1360
|
+
role: "tooltip",
|
|
1361
|
+
className: cn(
|
|
1362
|
+
"absolute z-50 rounded-storm-sm border border-storm-border bg-storm-foreground px-3 py-1.5 text-xs text-storm-background whitespace-nowrap",
|
|
1363
|
+
"invisible opacity-0 group-hover/tooltip:visible group-hover/tooltip:opacity-100 transition-opacity",
|
|
1364
|
+
sideStyles[side],
|
|
1365
|
+
className
|
|
1366
|
+
),
|
|
1367
|
+
...props
|
|
1368
|
+
}
|
|
1369
|
+
);
|
|
1370
|
+
}
|
|
1371
|
+
);
|
|
1372
|
+
Tooltip.displayName = "Tooltip";
|
|
1373
|
+
TooltipTrigger.displayName = "TooltipTrigger";
|
|
1374
|
+
TooltipContent.displayName = "TooltipContent";
|
|
1375
|
+
|
|
1376
|
+
// src/components/ButtonGroup.tsx
|
|
1377
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
1378
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1379
|
+
var ButtonGroup = forwardRef24(
|
|
1380
|
+
({ className, ...props }, ref) => {
|
|
1381
|
+
return /* @__PURE__ */ jsx24(
|
|
1382
|
+
"div",
|
|
1383
|
+
{
|
|
1384
|
+
ref,
|
|
1385
|
+
role: "group",
|
|
1386
|
+
className: cn(
|
|
1387
|
+
"inline-flex",
|
|
1388
|
+
"[&>*:first-child]:rounded-r-none",
|
|
1389
|
+
"[&>*:last-child]:rounded-l-none",
|
|
1390
|
+
"[&>*:not(:first-child):not(:last-child)]:rounded-none",
|
|
1391
|
+
"[&>*:not(:first-child)]:-ml-0.5",
|
|
1392
|
+
className
|
|
1393
|
+
),
|
|
1394
|
+
...props
|
|
1395
|
+
}
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
);
|
|
1399
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
1400
|
+
|
|
1401
|
+
// src/components/Table.tsx
|
|
1402
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
1403
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1404
|
+
var Table = forwardRef25(
|
|
1405
|
+
({ className, ...props }, ref) => {
|
|
1406
|
+
return /* @__PURE__ */ jsx25("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx25(
|
|
1407
|
+
"table",
|
|
1408
|
+
{
|
|
1409
|
+
ref,
|
|
1410
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
1411
|
+
...props
|
|
1412
|
+
}
|
|
1413
|
+
) });
|
|
1414
|
+
}
|
|
1415
|
+
);
|
|
1416
|
+
var TableHeader = forwardRef25(
|
|
1417
|
+
({ className, ...props }, ref) => {
|
|
1418
|
+
return /* @__PURE__ */ jsx25(
|
|
1419
|
+
"thead",
|
|
1420
|
+
{
|
|
1421
|
+
ref,
|
|
1422
|
+
className: cn("[&_tr]:border-b [&_tr]:border-storm-border", className),
|
|
1423
|
+
...props
|
|
1424
|
+
}
|
|
1425
|
+
);
|
|
1426
|
+
}
|
|
1427
|
+
);
|
|
1428
|
+
var TableBody = forwardRef25(
|
|
1429
|
+
({ className, ...props }, ref) => {
|
|
1430
|
+
return /* @__PURE__ */ jsx25(
|
|
1431
|
+
"tbody",
|
|
1432
|
+
{
|
|
1433
|
+
ref,
|
|
1434
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
1435
|
+
...props
|
|
1436
|
+
}
|
|
1437
|
+
);
|
|
1438
|
+
}
|
|
1439
|
+
);
|
|
1440
|
+
var TableFooter = forwardRef25(
|
|
1441
|
+
({ className, ...props }, ref) => {
|
|
1442
|
+
return /* @__PURE__ */ jsx25(
|
|
1443
|
+
"tfoot",
|
|
1444
|
+
{
|
|
1445
|
+
ref,
|
|
1446
|
+
className: cn("border-t border-storm-border bg-storm-accent/5 font-medium", className),
|
|
1447
|
+
...props
|
|
1448
|
+
}
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
);
|
|
1452
|
+
var TableRow = forwardRef25(
|
|
1453
|
+
({ className, ...props }, ref) => {
|
|
1454
|
+
return /* @__PURE__ */ jsx25(
|
|
1455
|
+
"tr",
|
|
1456
|
+
{
|
|
1457
|
+
ref,
|
|
1458
|
+
className: cn(
|
|
1459
|
+
"border-b border-storm-border transition-colors",
|
|
1460
|
+
"hover:bg-storm-accent/5",
|
|
1461
|
+
className
|
|
1462
|
+
),
|
|
1463
|
+
...props
|
|
1464
|
+
}
|
|
1465
|
+
);
|
|
1466
|
+
}
|
|
1467
|
+
);
|
|
1468
|
+
var TableHead = forwardRef25(
|
|
1469
|
+
({ className, ...props }, ref) => {
|
|
1470
|
+
return /* @__PURE__ */ jsx25(
|
|
1471
|
+
"th",
|
|
1472
|
+
{
|
|
1473
|
+
ref,
|
|
1474
|
+
className: cn(
|
|
1475
|
+
"h-10 px-3 text-left align-middle font-medium text-storm-muted-foreground",
|
|
1476
|
+
"[&:has([role=checkbox])]:pr-0",
|
|
1477
|
+
className
|
|
1478
|
+
),
|
|
1479
|
+
...props
|
|
1480
|
+
}
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1483
|
+
);
|
|
1484
|
+
var TableCell = forwardRef25(
|
|
1485
|
+
({ className, ...props }, ref) => {
|
|
1486
|
+
return /* @__PURE__ */ jsx25(
|
|
1487
|
+
"td",
|
|
1488
|
+
{
|
|
1489
|
+
ref,
|
|
1490
|
+
className: cn(
|
|
1491
|
+
"p-3 align-middle",
|
|
1492
|
+
"[&:has([role=checkbox])]:pr-0",
|
|
1493
|
+
className
|
|
1494
|
+
),
|
|
1495
|
+
...props
|
|
1496
|
+
}
|
|
1497
|
+
);
|
|
1498
|
+
}
|
|
1499
|
+
);
|
|
1500
|
+
var TableCaption = forwardRef25(
|
|
1501
|
+
({ className, ...props }, ref) => {
|
|
1502
|
+
return /* @__PURE__ */ jsx25(
|
|
1503
|
+
"caption",
|
|
1504
|
+
{
|
|
1505
|
+
ref,
|
|
1506
|
+
className: cn("mt-4 text-sm text-storm-muted-foreground", className),
|
|
1507
|
+
...props
|
|
1508
|
+
}
|
|
1509
|
+
);
|
|
1510
|
+
}
|
|
1511
|
+
);
|
|
1512
|
+
Table.displayName = "Table";
|
|
1513
|
+
TableHeader.displayName = "TableHeader";
|
|
1514
|
+
TableBody.displayName = "TableBody";
|
|
1515
|
+
TableFooter.displayName = "TableFooter";
|
|
1516
|
+
TableRow.displayName = "TableRow";
|
|
1517
|
+
TableHead.displayName = "TableHead";
|
|
1518
|
+
TableCell.displayName = "TableCell";
|
|
1519
|
+
TableCaption.displayName = "TableCaption";
|
|
1520
|
+
|
|
1521
|
+
// src/components/Progress.tsx
|
|
1522
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
1523
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1524
|
+
var sizeStyles10 = {
|
|
1525
|
+
sm: "h-1",
|
|
1526
|
+
md: "h-2",
|
|
1527
|
+
lg: "h-3"
|
|
1528
|
+
};
|
|
1529
|
+
var variantStyles7 = {
|
|
1530
|
+
default: "bg-storm-primary",
|
|
1531
|
+
secondary: "bg-storm-secondary-foreground",
|
|
1532
|
+
destructive: "bg-storm-destructive",
|
|
1533
|
+
success: "bg-green-500"
|
|
1534
|
+
};
|
|
1535
|
+
var Progress = forwardRef26(
|
|
1536
|
+
({ className, value = 0, max = 100, size = "md", variant = "default", ...props }, ref) => {
|
|
1537
|
+
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
1538
|
+
return /* @__PURE__ */ jsx26(
|
|
1539
|
+
"div",
|
|
1540
|
+
{
|
|
1541
|
+
ref,
|
|
1542
|
+
role: "progressbar",
|
|
1543
|
+
"aria-valuenow": value,
|
|
1544
|
+
"aria-valuemin": 0,
|
|
1545
|
+
"aria-valuemax": max,
|
|
1546
|
+
className: cn(
|
|
1547
|
+
"w-full overflow-hidden rounded-full bg-storm-accent/20",
|
|
1548
|
+
sizeStyles10[size],
|
|
1549
|
+
className
|
|
1550
|
+
),
|
|
1551
|
+
...props,
|
|
1552
|
+
children: /* @__PURE__ */ jsx26(
|
|
1553
|
+
"div",
|
|
1554
|
+
{
|
|
1555
|
+
className: cn(
|
|
1556
|
+
"h-full rounded-full transition-all duration-300",
|
|
1557
|
+
variantStyles7[variant]
|
|
1558
|
+
),
|
|
1559
|
+
style: { width: `${percentage}%` }
|
|
1560
|
+
}
|
|
1561
|
+
)
|
|
1562
|
+
}
|
|
1563
|
+
);
|
|
1564
|
+
}
|
|
1565
|
+
);
|
|
1566
|
+
Progress.displayName = "Progress";
|
|
1567
|
+
|
|
1568
|
+
// src/components/Slider.tsx
|
|
1569
|
+
import { forwardRef as forwardRef27, useState as useState3, useRef, useCallback, useEffect } from "react";
|
|
1570
|
+
import { jsx as jsx27, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1571
|
+
var sizeStyles11 = {
|
|
1572
|
+
sm: { track: "h-1", thumb: "h-3 w-3" },
|
|
1573
|
+
md: { track: "h-2", thumb: "h-4 w-4" },
|
|
1574
|
+
lg: { track: "h-3", thumb: "h-5 w-5" }
|
|
1575
|
+
};
|
|
1576
|
+
var Slider = forwardRef27(
|
|
1577
|
+
({ className, value: controlledValue, defaultValue = 0, min = 0, max = 100, step = 1, size = "md", disabled, onChange, ...props }, ref) => {
|
|
1578
|
+
const [internalValue, setInternalValue] = useState3(defaultValue);
|
|
1579
|
+
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
1580
|
+
const trackRef = useRef(null);
|
|
1581
|
+
const dragging = useRef(false);
|
|
1582
|
+
const percentage = Math.min(100, Math.max(0, (value - min) / (max - min) * 100));
|
|
1583
|
+
const updateValue = useCallback((clientX) => {
|
|
1584
|
+
if (!trackRef.current || disabled) return;
|
|
1585
|
+
const rect = trackRef.current.getBoundingClientRect();
|
|
1586
|
+
const ratio = Math.min(1, Math.max(0, (clientX - rect.left) / rect.width));
|
|
1587
|
+
const raw = min + ratio * (max - min);
|
|
1588
|
+
const stepped = Math.round(raw / step) * step;
|
|
1589
|
+
const clamped = Math.min(max, Math.max(min, stepped));
|
|
1590
|
+
if (controlledValue === void 0) setInternalValue(clamped);
|
|
1591
|
+
onChange?.(clamped);
|
|
1592
|
+
}, [min, max, step, disabled, controlledValue, onChange]);
|
|
1593
|
+
useEffect(() => {
|
|
1594
|
+
const handleMove = (e) => {
|
|
1595
|
+
if (dragging.current) updateValue(e.clientX);
|
|
1596
|
+
};
|
|
1597
|
+
const handleUp = () => {
|
|
1598
|
+
dragging.current = false;
|
|
1599
|
+
};
|
|
1600
|
+
document.addEventListener("mousemove", handleMove);
|
|
1601
|
+
document.addEventListener("mouseup", handleUp);
|
|
1602
|
+
return () => {
|
|
1603
|
+
document.removeEventListener("mousemove", handleMove);
|
|
1604
|
+
document.removeEventListener("mouseup", handleUp);
|
|
1605
|
+
};
|
|
1606
|
+
}, [updateValue]);
|
|
1607
|
+
return /* @__PURE__ */ jsxs6(
|
|
1608
|
+
"div",
|
|
1609
|
+
{
|
|
1610
|
+
ref,
|
|
1611
|
+
className: cn(
|
|
1612
|
+
"relative flex w-full touch-none select-none items-center",
|
|
1613
|
+
disabled && "pointer-events-none opacity-50",
|
|
1614
|
+
className
|
|
1615
|
+
),
|
|
1616
|
+
...props,
|
|
1617
|
+
children: [
|
|
1618
|
+
/* @__PURE__ */ jsx27(
|
|
1619
|
+
"div",
|
|
1620
|
+
{
|
|
1621
|
+
ref: trackRef,
|
|
1622
|
+
className: cn(
|
|
1623
|
+
"relative w-full cursor-pointer overflow-hidden rounded-full bg-storm-accent/20",
|
|
1624
|
+
sizeStyles11[size].track
|
|
1625
|
+
),
|
|
1626
|
+
onMouseDown: (e) => {
|
|
1627
|
+
dragging.current = true;
|
|
1628
|
+
updateValue(e.clientX);
|
|
1629
|
+
},
|
|
1630
|
+
children: /* @__PURE__ */ jsx27(
|
|
1631
|
+
"div",
|
|
1632
|
+
{
|
|
1633
|
+
className: "h-full rounded-full bg-storm-primary transition-all",
|
|
1634
|
+
style: { width: `${percentage}%` }
|
|
1635
|
+
}
|
|
1636
|
+
)
|
|
1637
|
+
}
|
|
1638
|
+
),
|
|
1639
|
+
/* @__PURE__ */ jsx27(
|
|
1640
|
+
"div",
|
|
1641
|
+
{
|
|
1642
|
+
className: cn(
|
|
1643
|
+
"absolute rounded-full border border-storm-border bg-storm-background cursor-grab active:cursor-grabbing",
|
|
1644
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1645
|
+
sizeStyles11[size].thumb
|
|
1646
|
+
),
|
|
1647
|
+
style: { left: `calc(${percentage}% - ${size === "sm" ? 6 : size === "md" ? 8 : 10}px)` },
|
|
1648
|
+
role: "slider",
|
|
1649
|
+
tabIndex: disabled ? -1 : 0,
|
|
1650
|
+
"aria-valuenow": value,
|
|
1651
|
+
"aria-valuemin": min,
|
|
1652
|
+
"aria-valuemax": max,
|
|
1653
|
+
onMouseDown: () => {
|
|
1654
|
+
dragging.current = true;
|
|
1655
|
+
},
|
|
1656
|
+
onKeyDown: (e) => {
|
|
1657
|
+
if (e.key === "ArrowRight" || e.key === "ArrowUp") {
|
|
1658
|
+
e.preventDefault();
|
|
1659
|
+
const next = Math.min(max, value + step);
|
|
1660
|
+
if (controlledValue === void 0) setInternalValue(next);
|
|
1661
|
+
onChange?.(next);
|
|
1662
|
+
} else if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
|
|
1663
|
+
e.preventDefault();
|
|
1664
|
+
const next = Math.max(min, value - step);
|
|
1665
|
+
if (controlledValue === void 0) setInternalValue(next);
|
|
1666
|
+
onChange?.(next);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
)
|
|
1671
|
+
]
|
|
1672
|
+
}
|
|
1673
|
+
);
|
|
1674
|
+
}
|
|
1675
|
+
);
|
|
1676
|
+
Slider.displayName = "Slider";
|
|
1677
|
+
|
|
1678
|
+
// src/components/Toggle.tsx
|
|
1679
|
+
import { forwardRef as forwardRef28 } from "react";
|
|
1680
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1681
|
+
var variantStyles8 = {
|
|
1682
|
+
default: "hover:bg-storm-accent/10 data-[state=on]:bg-storm-accent/20 data-[state=on]:text-storm-foreground",
|
|
1683
|
+
outline: "border border-storm-border hover:bg-storm-accent/10 data-[state=on]:bg-storm-accent/20 data-[state=on]:text-storm-foreground"
|
|
1684
|
+
};
|
|
1685
|
+
var sizeStyles12 = {
|
|
1686
|
+
sm: "h-8 px-2 text-sm",
|
|
1687
|
+
md: "h-10 px-3 text-base",
|
|
1688
|
+
lg: "h-12 px-4 text-lg"
|
|
1689
|
+
};
|
|
1690
|
+
var Toggle = forwardRef28(
|
|
1691
|
+
({ className, variant = "default", size = "md", pressed, defaultPressed, onPressedChange, onClick, ...props }, ref) => {
|
|
1692
|
+
const isControlled = pressed !== void 0;
|
|
1693
|
+
const state = isControlled ? pressed : void 0;
|
|
1694
|
+
return /* @__PURE__ */ jsx28(
|
|
1695
|
+
"button",
|
|
1696
|
+
{
|
|
1697
|
+
ref,
|
|
1698
|
+
type: "button",
|
|
1699
|
+
role: "switch",
|
|
1700
|
+
"aria-pressed": state,
|
|
1701
|
+
"data-state": state ? "on" : "off",
|
|
1702
|
+
className: cn(
|
|
1703
|
+
"inline-flex items-center justify-center rounded-storm-md font-medium transition-colors",
|
|
1704
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1705
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
1706
|
+
"text-storm-muted-foreground",
|
|
1707
|
+
variantStyles8[variant],
|
|
1708
|
+
sizeStyles12[size],
|
|
1709
|
+
className
|
|
1710
|
+
),
|
|
1711
|
+
onClick: (e) => {
|
|
1712
|
+
onPressedChange?.(!state);
|
|
1713
|
+
onClick?.(e);
|
|
1714
|
+
},
|
|
1715
|
+
...props
|
|
1716
|
+
}
|
|
1717
|
+
);
|
|
1718
|
+
}
|
|
1719
|
+
);
|
|
1720
|
+
Toggle.displayName = "Toggle";
|
|
1721
|
+
|
|
1722
|
+
// src/components/ToggleGroup.tsx
|
|
1723
|
+
import { forwardRef as forwardRef29 } from "react";
|
|
1724
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1725
|
+
var sizeStyles13 = {
|
|
1726
|
+
sm: "h-8 px-2 text-sm",
|
|
1727
|
+
md: "h-10 px-3 text-base",
|
|
1728
|
+
lg: "h-12 px-4 text-lg"
|
|
1729
|
+
};
|
|
1730
|
+
var ToggleGroup = forwardRef29(
|
|
1731
|
+
({ className, variant = "default", size = "md", ...props }, ref) => {
|
|
1732
|
+
return /* @__PURE__ */ jsx29(
|
|
1733
|
+
"div",
|
|
1734
|
+
{
|
|
1735
|
+
ref,
|
|
1736
|
+
role: "group",
|
|
1737
|
+
className: cn(
|
|
1738
|
+
"inline-flex items-center gap-1",
|
|
1739
|
+
variant === "outline" && "rounded-storm-md border border-storm-border p-1",
|
|
1740
|
+
className
|
|
1741
|
+
),
|
|
1742
|
+
...props
|
|
1743
|
+
}
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1746
|
+
);
|
|
1747
|
+
var ToggleGroupItem = forwardRef29(
|
|
1748
|
+
({ className, active, size = "md", ...props }, ref) => {
|
|
1749
|
+
return /* @__PURE__ */ jsx29(
|
|
1750
|
+
"button",
|
|
1751
|
+
{
|
|
1752
|
+
ref,
|
|
1753
|
+
type: "button",
|
|
1754
|
+
"data-state": active ? "on" : "off",
|
|
1755
|
+
className: cn(
|
|
1756
|
+
"inline-flex items-center justify-center rounded-storm-md font-medium transition-colors",
|
|
1757
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1758
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
1759
|
+
"text-storm-muted-foreground hover:bg-storm-accent/10",
|
|
1760
|
+
active && "bg-storm-accent/20 text-storm-foreground",
|
|
1761
|
+
sizeStyles13[size],
|
|
1762
|
+
className
|
|
1763
|
+
),
|
|
1764
|
+
...props
|
|
1765
|
+
}
|
|
1766
|
+
);
|
|
1767
|
+
}
|
|
1768
|
+
);
|
|
1769
|
+
ToggleGroup.displayName = "ToggleGroup";
|
|
1770
|
+
ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
1771
|
+
|
|
1772
|
+
// src/components/Sheet.tsx
|
|
1773
|
+
import { forwardRef as forwardRef30 } from "react";
|
|
1774
|
+
import { jsx as jsx30, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1775
|
+
var sideStyles2 = {
|
|
1776
|
+
left: "inset-y-0 left-0 border-r border-storm-border data-[open]:animate-in data-[open]:slide-in-from-left",
|
|
1777
|
+
right: "inset-y-0 right-0 border-l border-storm-border data-[open]:animate-in data-[open]:slide-in-from-right",
|
|
1778
|
+
top: "inset-x-0 top-0 border-b border-storm-border data-[open]:animate-in data-[open]:slide-in-from-top",
|
|
1779
|
+
bottom: "inset-x-0 bottom-0 border-t border-storm-border data-[open]:animate-in data-[open]:slide-in-from-bottom"
|
|
1780
|
+
};
|
|
1781
|
+
var sizeMap = {
|
|
1782
|
+
left: { sm: "w-64", md: "w-80", lg: "w-96", xl: "w-[480px]", full: "w-screen" },
|
|
1783
|
+
right: { sm: "w-64", md: "w-80", lg: "w-96", xl: "w-[480px]", full: "w-screen" },
|
|
1784
|
+
top: { sm: "h-32", md: "h-48", lg: "h-64", xl: "h-96", full: "h-screen" },
|
|
1785
|
+
bottom: { sm: "h-32", md: "h-48", lg: "h-64", xl: "h-96", full: "h-screen" }
|
|
1786
|
+
};
|
|
1787
|
+
var Sheet = forwardRef30(
|
|
1788
|
+
({ className, children, side = "right", size = "md", ...props }, ref) => {
|
|
1789
|
+
return /* @__PURE__ */ jsx30(
|
|
1790
|
+
"dialog",
|
|
1791
|
+
{
|
|
1792
|
+
ref,
|
|
1793
|
+
className: cn(
|
|
1794
|
+
"fixed z-50 m-0 bg-storm-background p-0 text-storm-foreground backdrop:bg-black/50",
|
|
1795
|
+
sideStyles2[side],
|
|
1796
|
+
sizeMap[side][size],
|
|
1797
|
+
className
|
|
1798
|
+
),
|
|
1799
|
+
...props,
|
|
1800
|
+
children
|
|
1801
|
+
}
|
|
1802
|
+
);
|
|
1803
|
+
}
|
|
1804
|
+
);
|
|
1805
|
+
var SheetContent = forwardRef30(
|
|
1806
|
+
({ className, ...props }, ref) => {
|
|
1807
|
+
return /* @__PURE__ */ jsx30(
|
|
1808
|
+
"div",
|
|
1809
|
+
{
|
|
1810
|
+
ref,
|
|
1811
|
+
className: cn("flex h-full flex-col p-6", className),
|
|
1812
|
+
...props
|
|
1813
|
+
}
|
|
1814
|
+
);
|
|
1815
|
+
}
|
|
1816
|
+
);
|
|
1817
|
+
var SheetHeader = forwardRef30(
|
|
1818
|
+
({ className, ...props }, ref) => {
|
|
1819
|
+
return /* @__PURE__ */ jsx30(
|
|
1820
|
+
"div",
|
|
1821
|
+
{
|
|
1822
|
+
ref,
|
|
1823
|
+
className: cn("mb-4 space-y-1.5", className),
|
|
1824
|
+
...props
|
|
1825
|
+
}
|
|
1826
|
+
);
|
|
1827
|
+
}
|
|
1828
|
+
);
|
|
1829
|
+
var SheetTitle = forwardRef30(
|
|
1830
|
+
({ className, ...props }, ref) => {
|
|
1831
|
+
return /* @__PURE__ */ jsx30(
|
|
1832
|
+
"h2",
|
|
1833
|
+
{
|
|
1834
|
+
ref,
|
|
1835
|
+
className: cn("text-lg font-semibold text-storm-foreground", className),
|
|
1836
|
+
...props
|
|
1837
|
+
}
|
|
1838
|
+
);
|
|
1839
|
+
}
|
|
1840
|
+
);
|
|
1841
|
+
var SheetDescription = forwardRef30(
|
|
1842
|
+
({ className, ...props }, ref) => {
|
|
1843
|
+
return /* @__PURE__ */ jsx30(
|
|
1844
|
+
"p",
|
|
1845
|
+
{
|
|
1846
|
+
ref,
|
|
1847
|
+
className: cn("text-sm text-storm-muted-foreground", className),
|
|
1848
|
+
...props
|
|
1849
|
+
}
|
|
1850
|
+
);
|
|
1851
|
+
}
|
|
1852
|
+
);
|
|
1853
|
+
var SheetFooter = forwardRef30(
|
|
1854
|
+
({ className, ...props }, ref) => {
|
|
1855
|
+
return /* @__PURE__ */ jsx30(
|
|
1856
|
+
"div",
|
|
1857
|
+
{
|
|
1858
|
+
ref,
|
|
1859
|
+
className: cn("mt-auto flex justify-end gap-2 pt-4", className),
|
|
1860
|
+
...props
|
|
1861
|
+
}
|
|
1862
|
+
);
|
|
1863
|
+
}
|
|
1864
|
+
);
|
|
1865
|
+
var SheetClose = forwardRef30(
|
|
1866
|
+
({ className, ...props }, ref) => {
|
|
1867
|
+
return /* @__PURE__ */ jsx30(
|
|
1868
|
+
"button",
|
|
1869
|
+
{
|
|
1870
|
+
ref,
|
|
1871
|
+
type: "button",
|
|
1872
|
+
className: cn(
|
|
1873
|
+
"absolute right-4 top-4 rounded-storm-sm p-1 text-storm-muted-foreground transition-colors",
|
|
1874
|
+
"hover:text-storm-foreground",
|
|
1875
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1876
|
+
className
|
|
1877
|
+
),
|
|
1878
|
+
...props,
|
|
1879
|
+
children: /* @__PURE__ */ jsxs7("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1880
|
+
/* @__PURE__ */ jsx30("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1881
|
+
/* @__PURE__ */ jsx30("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1882
|
+
] })
|
|
1883
|
+
}
|
|
1884
|
+
);
|
|
1885
|
+
}
|
|
1886
|
+
);
|
|
1887
|
+
Sheet.displayName = "Sheet";
|
|
1888
|
+
SheetContent.displayName = "SheetContent";
|
|
1889
|
+
SheetHeader.displayName = "SheetHeader";
|
|
1890
|
+
SheetTitle.displayName = "SheetTitle";
|
|
1891
|
+
SheetDescription.displayName = "SheetDescription";
|
|
1892
|
+
SheetFooter.displayName = "SheetFooter";
|
|
1893
|
+
SheetClose.displayName = "SheetClose";
|
|
1894
|
+
|
|
1895
|
+
// src/components/Popover.tsx
|
|
1896
|
+
import { forwardRef as forwardRef31 } from "react";
|
|
1897
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1898
|
+
var Popover = forwardRef31(
|
|
1899
|
+
({ className, ...props }, ref) => {
|
|
1900
|
+
return /* @__PURE__ */ jsx31(
|
|
1901
|
+
"div",
|
|
1902
|
+
{
|
|
1903
|
+
ref,
|
|
1904
|
+
className: cn("relative inline-block", className),
|
|
1905
|
+
...props
|
|
1906
|
+
}
|
|
1907
|
+
);
|
|
1908
|
+
}
|
|
1909
|
+
);
|
|
1910
|
+
var PopoverTrigger = forwardRef31(
|
|
1911
|
+
({ className, ...props }, ref) => {
|
|
1912
|
+
return /* @__PURE__ */ jsx31(
|
|
1913
|
+
"div",
|
|
1914
|
+
{
|
|
1915
|
+
ref,
|
|
1916
|
+
className: cn("inline-flex", className),
|
|
1917
|
+
...props
|
|
1918
|
+
}
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
);
|
|
1922
|
+
var alignStyles = {
|
|
1923
|
+
start: "left-0",
|
|
1924
|
+
center: "left-1/2 -translate-x-1/2",
|
|
1925
|
+
end: "right-0"
|
|
1926
|
+
};
|
|
1927
|
+
var sideStyles3 = {
|
|
1928
|
+
top: "bottom-full mb-2",
|
|
1929
|
+
bottom: "top-full mt-2"
|
|
1930
|
+
};
|
|
1931
|
+
var PopoverContent = forwardRef31(
|
|
1932
|
+
({ className, align = "center", side = "bottom", ...props }, ref) => {
|
|
1933
|
+
return /* @__PURE__ */ jsx31(
|
|
1934
|
+
"div",
|
|
1935
|
+
{
|
|
1936
|
+
ref,
|
|
1937
|
+
className: cn(
|
|
1938
|
+
"absolute z-50 w-72 rounded-storm-lg border border-storm-border bg-storm-background p-4 text-storm-foreground",
|
|
1939
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
1940
|
+
sideStyles3[side],
|
|
1941
|
+
alignStyles[align],
|
|
1942
|
+
className
|
|
1943
|
+
),
|
|
1944
|
+
...props
|
|
1945
|
+
}
|
|
1946
|
+
);
|
|
1947
|
+
}
|
|
1948
|
+
);
|
|
1949
|
+
Popover.displayName = "Popover";
|
|
1950
|
+
PopoverTrigger.displayName = "PopoverTrigger";
|
|
1951
|
+
PopoverContent.displayName = "PopoverContent";
|
|
1952
|
+
|
|
1953
|
+
// src/components/Collapsible.tsx
|
|
1954
|
+
import { forwardRef as forwardRef32 } from "react";
|
|
1955
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1956
|
+
var Collapsible = forwardRef32(
|
|
1957
|
+
({ className, ...props }, ref) => {
|
|
1958
|
+
return /* @__PURE__ */ jsx32(
|
|
1959
|
+
"div",
|
|
1960
|
+
{
|
|
1961
|
+
ref,
|
|
1962
|
+
className: cn("w-full", className),
|
|
1963
|
+
...props
|
|
1964
|
+
}
|
|
1965
|
+
);
|
|
1966
|
+
}
|
|
1967
|
+
);
|
|
1968
|
+
var CollapsibleTrigger = forwardRef32(
|
|
1969
|
+
({ className, ...props }, ref) => {
|
|
1970
|
+
return /* @__PURE__ */ jsx32(
|
|
1971
|
+
"button",
|
|
1972
|
+
{
|
|
1973
|
+
ref,
|
|
1974
|
+
type: "button",
|
|
1975
|
+
className: cn(
|
|
1976
|
+
"flex w-full items-center justify-between py-2 text-sm font-medium transition-colors",
|
|
1977
|
+
"hover:text-storm-foreground",
|
|
1978
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
1979
|
+
className
|
|
1980
|
+
),
|
|
1981
|
+
...props
|
|
1982
|
+
}
|
|
1983
|
+
);
|
|
1984
|
+
}
|
|
1985
|
+
);
|
|
1986
|
+
var CollapsibleContent = forwardRef32(
|
|
1987
|
+
({ className, open, ...props }, ref) => {
|
|
1988
|
+
if (!open) return null;
|
|
1989
|
+
return /* @__PURE__ */ jsx32(
|
|
1990
|
+
"div",
|
|
1991
|
+
{
|
|
1992
|
+
ref,
|
|
1993
|
+
className: cn("overflow-hidden animate-in fade-in-0", className),
|
|
1994
|
+
...props
|
|
1995
|
+
}
|
|
1996
|
+
);
|
|
1997
|
+
}
|
|
1998
|
+
);
|
|
1999
|
+
Collapsible.displayName = "Collapsible";
|
|
2000
|
+
CollapsibleTrigger.displayName = "CollapsibleTrigger";
|
|
2001
|
+
CollapsibleContent.displayName = "CollapsibleContent";
|
|
2002
|
+
|
|
2003
|
+
// src/components/ScrollArea.tsx
|
|
2004
|
+
import { forwardRef as forwardRef33 } from "react";
|
|
2005
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2006
|
+
var ScrollArea = forwardRef33(
|
|
2007
|
+
({ className, orientation = "vertical", ...props }, ref) => {
|
|
2008
|
+
return /* @__PURE__ */ jsx33(
|
|
2009
|
+
"div",
|
|
2010
|
+
{
|
|
2011
|
+
ref,
|
|
2012
|
+
className: cn(
|
|
2013
|
+
"relative",
|
|
2014
|
+
orientation === "vertical" && "overflow-y-auto overflow-x-hidden",
|
|
2015
|
+
orientation === "horizontal" && "overflow-x-auto overflow-y-hidden",
|
|
2016
|
+
orientation === "both" && "overflow-auto",
|
|
2017
|
+
"[&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar]:h-2",
|
|
2018
|
+
"[&::-webkit-scrollbar-track]:bg-transparent",
|
|
2019
|
+
"[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-storm-accent/30",
|
|
2020
|
+
"[&::-webkit-scrollbar-thumb:hover]:bg-storm-accent/50",
|
|
2021
|
+
className
|
|
2022
|
+
),
|
|
2023
|
+
...props
|
|
2024
|
+
}
|
|
2025
|
+
);
|
|
2026
|
+
}
|
|
2027
|
+
);
|
|
2028
|
+
ScrollArea.displayName = "ScrollArea";
|
|
2029
|
+
|
|
2030
|
+
// src/components/AspectRatio.tsx
|
|
2031
|
+
import { forwardRef as forwardRef34 } from "react";
|
|
2032
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2033
|
+
var AspectRatio = forwardRef34(
|
|
2034
|
+
({ className, ratio = 16 / 9, style, children, ...props }, ref) => {
|
|
2035
|
+
return /* @__PURE__ */ jsx34(
|
|
2036
|
+
"div",
|
|
2037
|
+
{
|
|
2038
|
+
ref,
|
|
2039
|
+
className: cn("relative w-full overflow-hidden", className),
|
|
2040
|
+
style: { ...style, paddingBottom: `${1 / ratio * 100}%` },
|
|
2041
|
+
...props,
|
|
2042
|
+
children: /* @__PURE__ */ jsx34("div", { className: "absolute inset-0", children })
|
|
2043
|
+
}
|
|
2044
|
+
);
|
|
2045
|
+
}
|
|
2046
|
+
);
|
|
2047
|
+
AspectRatio.displayName = "AspectRatio";
|
|
2048
|
+
|
|
2049
|
+
// src/components/Accordion.tsx
|
|
2050
|
+
import { forwardRef as forwardRef35, useState as useState4, createContext as createContext2, useContext as useContext2 } from "react";
|
|
2051
|
+
import { ChevronDown } from "@storm-ds/icons";
|
|
2052
|
+
import { jsx as jsx35, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2053
|
+
var AccordionContext = createContext2({ openItems: /* @__PURE__ */ new Set(), toggle: () => {
|
|
2054
|
+
} });
|
|
2055
|
+
var Accordion = forwardRef35(
|
|
2056
|
+
({ className, type = "single", defaultValue, children, ...props }, ref) => {
|
|
2057
|
+
const [openItems, setOpenItems] = useState4(() => {
|
|
2058
|
+
if (!defaultValue) return /* @__PURE__ */ new Set();
|
|
2059
|
+
return new Set(Array.isArray(defaultValue) ? defaultValue : [defaultValue]);
|
|
2060
|
+
});
|
|
2061
|
+
const toggle = (value) => {
|
|
2062
|
+
setOpenItems((prev) => {
|
|
2063
|
+
const next = new Set(prev);
|
|
2064
|
+
if (next.has(value)) {
|
|
2065
|
+
next.delete(value);
|
|
2066
|
+
} else {
|
|
2067
|
+
if (type === "single") next.clear();
|
|
2068
|
+
next.add(value);
|
|
2069
|
+
}
|
|
2070
|
+
return next;
|
|
2071
|
+
});
|
|
2072
|
+
};
|
|
2073
|
+
return /* @__PURE__ */ jsx35(AccordionContext.Provider, { value: { openItems, toggle }, children: /* @__PURE__ */ jsx35("div", { ref, className: cn("w-full", className), ...props, children }) });
|
|
2074
|
+
}
|
|
2075
|
+
);
|
|
2076
|
+
var AccordionItem = forwardRef35(
|
|
2077
|
+
({ className, value, children, ...props }, ref) => {
|
|
2078
|
+
return /* @__PURE__ */ jsx35(
|
|
2079
|
+
"div",
|
|
2080
|
+
{
|
|
2081
|
+
ref,
|
|
2082
|
+
"data-value": value,
|
|
2083
|
+
className: cn("border-b border-storm-border last:border-b-0", className),
|
|
2084
|
+
...props,
|
|
2085
|
+
children
|
|
2086
|
+
}
|
|
2087
|
+
);
|
|
2088
|
+
}
|
|
2089
|
+
);
|
|
2090
|
+
var AccordionTrigger = forwardRef35(
|
|
2091
|
+
({ className, value, children, ...props }, ref) => {
|
|
2092
|
+
const { openItems, toggle } = useContext2(AccordionContext);
|
|
2093
|
+
const isOpen = openItems.has(value);
|
|
2094
|
+
return /* @__PURE__ */ jsxs8(
|
|
2095
|
+
"button",
|
|
2096
|
+
{
|
|
2097
|
+
ref,
|
|
2098
|
+
type: "button",
|
|
2099
|
+
"aria-expanded": isOpen,
|
|
2100
|
+
className: cn(
|
|
2101
|
+
"flex w-full items-center justify-between py-4 text-sm font-medium text-storm-foreground transition-colors",
|
|
2102
|
+
"hover:text-storm-foreground/80",
|
|
2103
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
2104
|
+
className
|
|
2105
|
+
),
|
|
2106
|
+
onClick: () => toggle(value),
|
|
2107
|
+
...props,
|
|
2108
|
+
children: [
|
|
2109
|
+
children,
|
|
2110
|
+
/* @__PURE__ */ jsx35(ChevronDown, { className: cn("h-4 w-4 shrink-0 text-storm-muted-foreground transition-transform duration-200", isOpen && "rotate-180") })
|
|
2111
|
+
]
|
|
2112
|
+
}
|
|
2113
|
+
);
|
|
2114
|
+
}
|
|
2115
|
+
);
|
|
2116
|
+
var AccordionContent = forwardRef35(
|
|
2117
|
+
({ className, value, children, ...props }, ref) => {
|
|
2118
|
+
const { openItems } = useContext2(AccordionContext);
|
|
2119
|
+
const isOpen = openItems.has(value);
|
|
2120
|
+
if (!isOpen) return null;
|
|
2121
|
+
return /* @__PURE__ */ jsx35(
|
|
2122
|
+
"div",
|
|
2123
|
+
{
|
|
2124
|
+
ref,
|
|
2125
|
+
className: cn("pb-4 text-sm text-storm-muted-foreground animate-in fade-in-0", className),
|
|
2126
|
+
...props,
|
|
2127
|
+
children
|
|
2128
|
+
}
|
|
2129
|
+
);
|
|
2130
|
+
}
|
|
2131
|
+
);
|
|
2132
|
+
Accordion.displayName = "Accordion";
|
|
2133
|
+
AccordionItem.displayName = "AccordionItem";
|
|
2134
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
2135
|
+
AccordionContent.displayName = "AccordionContent";
|
|
2136
|
+
|
|
2137
|
+
// src/components/AlertDialog.tsx
|
|
2138
|
+
import { forwardRef as forwardRef36 } from "react";
|
|
2139
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2140
|
+
var AlertDialog = forwardRef36(
|
|
2141
|
+
({ className, children, ...props }, ref) => {
|
|
2142
|
+
return /* @__PURE__ */ jsx36(
|
|
2143
|
+
"dialog",
|
|
2144
|
+
{
|
|
2145
|
+
ref,
|
|
2146
|
+
className: cn(
|
|
2147
|
+
"fixed inset-0 z-50 m-auto max-h-[85vh] w-full max-w-lg rounded-storm-lg border border-storm-border bg-storm-background p-0 text-storm-foreground backdrop:bg-black/50",
|
|
2148
|
+
"open:animate-in open:fade-in-0 open:zoom-in-95",
|
|
2149
|
+
className
|
|
2150
|
+
),
|
|
2151
|
+
...props,
|
|
2152
|
+
children
|
|
2153
|
+
}
|
|
2154
|
+
);
|
|
2155
|
+
}
|
|
2156
|
+
);
|
|
2157
|
+
var AlertDialogContent = forwardRef36(
|
|
2158
|
+
({ className, ...props }, ref) => {
|
|
2159
|
+
return /* @__PURE__ */ jsx36("div", { ref, className: cn("p-6", className), ...props });
|
|
2160
|
+
}
|
|
2161
|
+
);
|
|
2162
|
+
var AlertDialogHeader = forwardRef36(
|
|
2163
|
+
({ className, ...props }, ref) => {
|
|
2164
|
+
return /* @__PURE__ */ jsx36("div", { ref, className: cn("mb-4 space-y-2", className), ...props });
|
|
2165
|
+
}
|
|
2166
|
+
);
|
|
2167
|
+
var AlertDialogTitle = forwardRef36(
|
|
2168
|
+
({ className, ...props }, ref) => {
|
|
2169
|
+
return /* @__PURE__ */ jsx36("h2", { ref, className: cn("text-lg font-semibold text-storm-foreground", className), ...props });
|
|
2170
|
+
}
|
|
2171
|
+
);
|
|
2172
|
+
var AlertDialogDescription = forwardRef36(
|
|
2173
|
+
({ className, ...props }, ref) => {
|
|
2174
|
+
return /* @__PURE__ */ jsx36("p", { ref, className: cn("text-sm text-storm-muted-foreground", className), ...props });
|
|
2175
|
+
}
|
|
2176
|
+
);
|
|
2177
|
+
var AlertDialogFooter = forwardRef36(
|
|
2178
|
+
({ className, ...props }, ref) => {
|
|
2179
|
+
return /* @__PURE__ */ jsx36("div", { ref, className: cn("flex justify-end gap-2 pt-4", className), ...props });
|
|
2180
|
+
}
|
|
2181
|
+
);
|
|
2182
|
+
var AlertDialogAction = forwardRef36(
|
|
2183
|
+
({ className, variant = "default", ...props }, ref) => {
|
|
2184
|
+
return /* @__PURE__ */ jsx36(
|
|
2185
|
+
"button",
|
|
2186
|
+
{
|
|
2187
|
+
ref,
|
|
2188
|
+
type: "button",
|
|
2189
|
+
className: cn(
|
|
2190
|
+
"inline-flex items-center justify-center rounded-storm-md px-4 py-2 text-sm font-medium transition-colors",
|
|
2191
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
2192
|
+
variant === "destructive" ? "border border-storm-destructive bg-storm-destructive text-white hover:bg-storm-destructive/90" : "border border-storm-primary bg-storm-primary text-storm-primary-foreground hover:bg-storm-primary/90",
|
|
2193
|
+
className
|
|
2194
|
+
),
|
|
2195
|
+
...props
|
|
2196
|
+
}
|
|
2197
|
+
);
|
|
2198
|
+
}
|
|
2199
|
+
);
|
|
2200
|
+
var AlertDialogCancel = forwardRef36(
|
|
2201
|
+
({ className, ...props }, ref) => {
|
|
2202
|
+
return /* @__PURE__ */ jsx36(
|
|
2203
|
+
"button",
|
|
2204
|
+
{
|
|
2205
|
+
ref,
|
|
2206
|
+
type: "button",
|
|
2207
|
+
className: cn(
|
|
2208
|
+
"inline-flex items-center justify-center rounded-storm-md border border-storm-border bg-transparent px-4 py-2 text-sm font-medium text-storm-foreground transition-colors",
|
|
2209
|
+
"hover:bg-storm-accent/10",
|
|
2210
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
2211
|
+
className
|
|
2212
|
+
),
|
|
2213
|
+
...props
|
|
2214
|
+
}
|
|
2215
|
+
);
|
|
2216
|
+
}
|
|
2217
|
+
);
|
|
2218
|
+
AlertDialog.displayName = "AlertDialog";
|
|
2219
|
+
AlertDialogContent.displayName = "AlertDialogContent";
|
|
2220
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
2221
|
+
AlertDialogTitle.displayName = "AlertDialogTitle";
|
|
2222
|
+
AlertDialogDescription.displayName = "AlertDialogDescription";
|
|
2223
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
2224
|
+
AlertDialogAction.displayName = "AlertDialogAction";
|
|
2225
|
+
AlertDialogCancel.displayName = "AlertDialogCancel";
|
|
2226
|
+
|
|
2227
|
+
// src/components/Calendar.tsx
|
|
2228
|
+
import { forwardRef as forwardRef37, useState as useState5 } from "react";
|
|
2229
|
+
import { jsx as jsx37, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2230
|
+
var DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
2231
|
+
var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
2232
|
+
function getDaysInMonth(year, month) {
|
|
2233
|
+
return new Date(year, month + 1, 0).getDate();
|
|
2234
|
+
}
|
|
2235
|
+
function getFirstDayOfMonth(year, month) {
|
|
2236
|
+
return new Date(year, month, 1).getDay();
|
|
2237
|
+
}
|
|
2238
|
+
var Calendar = forwardRef37(
|
|
2239
|
+
({ className, value, defaultValue, onChange, min, max, ...props }, ref) => {
|
|
2240
|
+
const today = /* @__PURE__ */ new Date();
|
|
2241
|
+
const [internalValue, setInternalValue] = useState5(defaultValue);
|
|
2242
|
+
const selected = value ?? internalValue;
|
|
2243
|
+
const [viewYear, setViewYear] = useState5(selected?.getFullYear() ?? today.getFullYear());
|
|
2244
|
+
const [viewMonth, setViewMonth] = useState5(selected?.getMonth() ?? today.getMonth());
|
|
2245
|
+
const daysInMonth = getDaysInMonth(viewYear, viewMonth);
|
|
2246
|
+
const firstDay = getFirstDayOfMonth(viewYear, viewMonth);
|
|
2247
|
+
const prevMonth = () => {
|
|
2248
|
+
if (viewMonth === 0) {
|
|
2249
|
+
setViewMonth(11);
|
|
2250
|
+
setViewYear(viewYear - 1);
|
|
2251
|
+
} else setViewMonth(viewMonth - 1);
|
|
2252
|
+
};
|
|
2253
|
+
const nextMonth = () => {
|
|
2254
|
+
if (viewMonth === 11) {
|
|
2255
|
+
setViewMonth(0);
|
|
2256
|
+
setViewYear(viewYear + 1);
|
|
2257
|
+
} else setViewMonth(viewMonth + 1);
|
|
2258
|
+
};
|
|
2259
|
+
const selectDate = (day) => {
|
|
2260
|
+
const date = new Date(viewYear, viewMonth, day);
|
|
2261
|
+
if (min && date < min) return;
|
|
2262
|
+
if (max && date > max) return;
|
|
2263
|
+
if (value === void 0) setInternalValue(date);
|
|
2264
|
+
onChange?.(date);
|
|
2265
|
+
};
|
|
2266
|
+
const isSelected = (day) => {
|
|
2267
|
+
if (!selected) return false;
|
|
2268
|
+
return selected.getDate() === day && selected.getMonth() === viewMonth && selected.getFullYear() === viewYear;
|
|
2269
|
+
};
|
|
2270
|
+
const isToday = (day) => {
|
|
2271
|
+
return today.getDate() === day && today.getMonth() === viewMonth && today.getFullYear() === viewYear;
|
|
2272
|
+
};
|
|
2273
|
+
const isDisabled = (day) => {
|
|
2274
|
+
const date = new Date(viewYear, viewMonth, day);
|
|
2275
|
+
if (min && date < new Date(min.getFullYear(), min.getMonth(), min.getDate())) return true;
|
|
2276
|
+
if (max && date > max) return true;
|
|
2277
|
+
return false;
|
|
2278
|
+
};
|
|
2279
|
+
return /* @__PURE__ */ jsxs9(
|
|
2280
|
+
"div",
|
|
2281
|
+
{
|
|
2282
|
+
ref,
|
|
2283
|
+
className: cn("w-[280px] rounded-storm-lg border border-storm-border bg-storm-background p-3", className),
|
|
2284
|
+
...props,
|
|
2285
|
+
children: [
|
|
2286
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between mb-2", children: [
|
|
2287
|
+
/* @__PURE__ */ jsx37(
|
|
2288
|
+
"button",
|
|
2289
|
+
{
|
|
2290
|
+
type: "button",
|
|
2291
|
+
onClick: prevMonth,
|
|
2292
|
+
className: "inline-flex h-7 w-7 items-center justify-center rounded-storm-sm text-storm-muted-foreground hover:text-storm-foreground hover:bg-storm-accent/10 transition-colors",
|
|
2293
|
+
children: /* @__PURE__ */ jsx37("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx37("polyline", { points: "15 18 9 12 15 6" }) })
|
|
2294
|
+
}
|
|
2295
|
+
),
|
|
2296
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-sm font-medium text-storm-foreground", children: [
|
|
2297
|
+
MONTHS[viewMonth],
|
|
2298
|
+
" ",
|
|
2299
|
+
viewYear
|
|
2300
|
+
] }),
|
|
2301
|
+
/* @__PURE__ */ jsx37(
|
|
2302
|
+
"button",
|
|
2303
|
+
{
|
|
2304
|
+
type: "button",
|
|
2305
|
+
onClick: nextMonth,
|
|
2306
|
+
className: "inline-flex h-7 w-7 items-center justify-center rounded-storm-sm text-storm-muted-foreground hover:text-storm-foreground hover:bg-storm-accent/10 transition-colors",
|
|
2307
|
+
children: /* @__PURE__ */ jsx37("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx37("polyline", { points: "9 18 15 12 9 6" }) })
|
|
2308
|
+
}
|
|
2309
|
+
)
|
|
2310
|
+
] }),
|
|
2311
|
+
/* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-7 gap-0", children: [
|
|
2312
|
+
DAYS.map((d) => /* @__PURE__ */ jsx37("div", { className: "flex h-8 items-center justify-center text-xs text-storm-muted-foreground font-medium", children: d }, d)),
|
|
2313
|
+
Array.from({ length: firstDay }, (_, i) => /* @__PURE__ */ jsx37("div", { className: "h-8" }, `empty-${i}`)),
|
|
2314
|
+
Array.from({ length: daysInMonth }, (_, i) => {
|
|
2315
|
+
const day = i + 1;
|
|
2316
|
+
const disabled = isDisabled(day);
|
|
2317
|
+
return /* @__PURE__ */ jsx37(
|
|
2318
|
+
"button",
|
|
2319
|
+
{
|
|
2320
|
+
type: "button",
|
|
2321
|
+
disabled,
|
|
2322
|
+
onClick: () => selectDate(day),
|
|
2323
|
+
className: cn(
|
|
2324
|
+
"flex h-8 w-8 items-center justify-center rounded-storm-sm text-sm transition-colors mx-auto",
|
|
2325
|
+
"hover:bg-storm-accent/10",
|
|
2326
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
2327
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
2328
|
+
isSelected(day) && "bg-storm-primary text-storm-primary-foreground hover:bg-storm-primary/90",
|
|
2329
|
+
isToday(day) && !isSelected(day) && "border border-storm-primary text-storm-primary"
|
|
2330
|
+
),
|
|
2331
|
+
children: day
|
|
2332
|
+
},
|
|
2333
|
+
day
|
|
2334
|
+
);
|
|
2335
|
+
})
|
|
2336
|
+
] })
|
|
2337
|
+
]
|
|
2338
|
+
}
|
|
2339
|
+
);
|
|
2340
|
+
}
|
|
2341
|
+
);
|
|
2342
|
+
Calendar.displayName = "Calendar";
|
|
2343
|
+
|
|
2344
|
+
// src/components/DatePicker.tsx
|
|
2345
|
+
import { forwardRef as forwardRef38, useState as useState6, useRef as useRef2, useEffect as useEffect2 } from "react";
|
|
2346
|
+
import { jsx as jsx38, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2347
|
+
var DatePicker = forwardRef38(
|
|
2348
|
+
({ className, value, defaultValue, onChange, placeholder = "Pick a date", min, max, disabled, ...props }, ref) => {
|
|
2349
|
+
const [internalValue, setInternalValue] = useState6(defaultValue);
|
|
2350
|
+
const selected = value ?? internalValue;
|
|
2351
|
+
const [open, setOpen] = useState6(false);
|
|
2352
|
+
const containerRef = useRef2(null);
|
|
2353
|
+
useEffect2(() => {
|
|
2354
|
+
const handleClick = (e) => {
|
|
2355
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
2356
|
+
setOpen(false);
|
|
2357
|
+
}
|
|
2358
|
+
};
|
|
2359
|
+
document.addEventListener("mousedown", handleClick);
|
|
2360
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
2361
|
+
}, []);
|
|
2362
|
+
const formatDate = (date) => {
|
|
2363
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
2364
|
+
};
|
|
2365
|
+
return /* @__PURE__ */ jsxs10("div", { ref: containerRef, className: cn("relative", className), children: [
|
|
2366
|
+
/* @__PURE__ */ jsxs10(
|
|
2367
|
+
"button",
|
|
2368
|
+
{
|
|
2369
|
+
ref,
|
|
2370
|
+
type: "button",
|
|
2371
|
+
disabled,
|
|
2372
|
+
onClick: () => setOpen(!open),
|
|
2373
|
+
className: cn(
|
|
2374
|
+
"inline-flex h-10 w-full min-w-[200px] items-center justify-between rounded-storm-md border border-storm-border bg-storm-background px-3 py-2 text-sm transition-colors",
|
|
2375
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
2376
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
2377
|
+
selected ? "text-storm-foreground" : "text-storm-muted-foreground"
|
|
2378
|
+
),
|
|
2379
|
+
...props,
|
|
2380
|
+
children: [
|
|
2381
|
+
/* @__PURE__ */ jsx38("span", { children: selected ? formatDate(selected) : placeholder }),
|
|
2382
|
+
/* @__PURE__ */ jsxs10("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-storm-muted-foreground", children: [
|
|
2383
|
+
/* @__PURE__ */ jsx38("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
2384
|
+
/* @__PURE__ */ jsx38("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
|
2385
|
+
/* @__PURE__ */ jsx38("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
|
2386
|
+
/* @__PURE__ */ jsx38("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
|
2387
|
+
] })
|
|
2388
|
+
]
|
|
2389
|
+
}
|
|
2390
|
+
),
|
|
2391
|
+
open && /* @__PURE__ */ jsx38("div", { className: "absolute left-0 top-full z-50 mt-1 animate-in fade-in-0 zoom-in-95", children: /* @__PURE__ */ jsx38(
|
|
2392
|
+
Calendar,
|
|
2393
|
+
{
|
|
2394
|
+
value: selected,
|
|
2395
|
+
min,
|
|
2396
|
+
max,
|
|
2397
|
+
onChange: (date) => {
|
|
2398
|
+
if (value === void 0) setInternalValue(date);
|
|
2399
|
+
onChange?.(date);
|
|
2400
|
+
setOpen(false);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
) })
|
|
2404
|
+
] });
|
|
2405
|
+
}
|
|
2406
|
+
);
|
|
2407
|
+
DatePicker.displayName = "DatePicker";
|
|
2408
|
+
|
|
2409
|
+
// src/components/Combobox.tsx
|
|
2410
|
+
import { forwardRef as forwardRef39, useState as useState7, useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
2411
|
+
import { ChevronDown as ChevronDown2, Check } from "@storm-ds/icons";
|
|
2412
|
+
import { jsx as jsx39, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2413
|
+
var Combobox = forwardRef39(
|
|
2414
|
+
({ className, options, value, defaultValue = "", onChange, placeholder = "Select...", searchPlaceholder = "Search...", emptyMessage = "No results found.", disabled, ...props }, ref) => {
|
|
2415
|
+
const [internalValue, setInternalValue] = useState7(defaultValue);
|
|
2416
|
+
const selected = value ?? internalValue;
|
|
2417
|
+
const [open, setOpen] = useState7(false);
|
|
2418
|
+
const [search, setSearch] = useState7("");
|
|
2419
|
+
const containerRef = useRef3(null);
|
|
2420
|
+
const inputRef = useRef3(null);
|
|
2421
|
+
const filtered = options.filter((o) => o.label.toLowerCase().includes(search.toLowerCase()));
|
|
2422
|
+
const selectedOption = options.find((o) => o.value === selected);
|
|
2423
|
+
useEffect3(() => {
|
|
2424
|
+
const handleClick = (e) => {
|
|
2425
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
2426
|
+
setOpen(false);
|
|
2427
|
+
setSearch("");
|
|
2428
|
+
}
|
|
2429
|
+
};
|
|
2430
|
+
document.addEventListener("mousedown", handleClick);
|
|
2431
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
2432
|
+
}, []);
|
|
2433
|
+
useEffect3(() => {
|
|
2434
|
+
if (open && inputRef.current) inputRef.current.focus();
|
|
2435
|
+
}, [open]);
|
|
2436
|
+
const select = (val) => {
|
|
2437
|
+
if (value === void 0) setInternalValue(val);
|
|
2438
|
+
onChange?.(val);
|
|
2439
|
+
setOpen(false);
|
|
2440
|
+
setSearch("");
|
|
2441
|
+
};
|
|
2442
|
+
return /* @__PURE__ */ jsxs11("div", { ref: containerRef, className: cn("relative", className), children: [
|
|
2443
|
+
/* @__PURE__ */ jsxs11(
|
|
2444
|
+
"button",
|
|
2445
|
+
{
|
|
2446
|
+
ref,
|
|
2447
|
+
type: "button",
|
|
2448
|
+
disabled,
|
|
2449
|
+
onClick: () => setOpen(!open),
|
|
2450
|
+
className: cn(
|
|
2451
|
+
"inline-flex h-10 w-full min-w-[200px] items-center justify-between rounded-storm-md border border-storm-border bg-storm-background px-3 py-2 text-sm transition-colors",
|
|
2452
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
2453
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
2454
|
+
selected ? "text-storm-foreground" : "text-storm-muted-foreground"
|
|
2455
|
+
),
|
|
2456
|
+
...props,
|
|
2457
|
+
children: [
|
|
2458
|
+
/* @__PURE__ */ jsx39("span", { children: selectedOption?.label || placeholder }),
|
|
2459
|
+
/* @__PURE__ */ jsx39(ChevronDown2, { className: "h-3.5 w-3.5 text-storm-muted-foreground" })
|
|
2460
|
+
]
|
|
2461
|
+
}
|
|
2462
|
+
),
|
|
2463
|
+
open && /* @__PURE__ */ jsxs11("div", { className: "absolute left-0 top-full z-50 mt-1 w-full min-w-[200px] rounded-storm-md border border-storm-border bg-storm-background p-1 animate-in fade-in-0 zoom-in-95", children: [
|
|
2464
|
+
/* @__PURE__ */ jsx39("div", { className: "px-2 pb-1", children: /* @__PURE__ */ jsx39(
|
|
2465
|
+
"input",
|
|
2466
|
+
{
|
|
2467
|
+
ref: inputRef,
|
|
2468
|
+
type: "text",
|
|
2469
|
+
value: search,
|
|
2470
|
+
onChange: (e) => setSearch(e.target.value),
|
|
2471
|
+
placeholder: searchPlaceholder,
|
|
2472
|
+
className: "h-8 w-full rounded-storm-sm border border-storm-border bg-transparent px-2 text-sm text-storm-foreground placeholder:text-storm-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring"
|
|
2473
|
+
}
|
|
2474
|
+
) }),
|
|
2475
|
+
/* @__PURE__ */ jsx39("div", { className: "max-h-48 overflow-y-auto", children: filtered.length === 0 ? /* @__PURE__ */ jsx39("p", { className: "px-2 py-4 text-center text-sm text-storm-muted-foreground", children: emptyMessage }) : filtered.map((option) => /* @__PURE__ */ jsxs11(
|
|
2476
|
+
"button",
|
|
2477
|
+
{
|
|
2478
|
+
type: "button",
|
|
2479
|
+
disabled: option.disabled,
|
|
2480
|
+
onClick: () => select(option.value),
|
|
2481
|
+
className: cn(
|
|
2482
|
+
"flex w-full items-center gap-2 rounded-storm-sm px-2 py-1.5 text-sm transition-colors",
|
|
2483
|
+
"hover:bg-storm-accent/10",
|
|
2484
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
2485
|
+
option.value === selected && "bg-storm-accent/10 font-medium"
|
|
2486
|
+
),
|
|
2487
|
+
children: [
|
|
2488
|
+
/* @__PURE__ */ jsx39(
|
|
2489
|
+
Check,
|
|
2490
|
+
{
|
|
2491
|
+
className: cn("h-3.5 w-3.5 shrink-0", option.value === selected ? "opacity-100" : "opacity-0")
|
|
2492
|
+
}
|
|
2493
|
+
),
|
|
2494
|
+
option.label
|
|
2495
|
+
]
|
|
2496
|
+
},
|
|
2497
|
+
option.value
|
|
2498
|
+
)) })
|
|
2499
|
+
] })
|
|
2500
|
+
] });
|
|
2501
|
+
}
|
|
2502
|
+
);
|
|
2503
|
+
Combobox.displayName = "Combobox";
|
|
2504
|
+
|
|
2505
|
+
// src/components/Command.tsx
|
|
2506
|
+
import { forwardRef as forwardRef40 } from "react";
|
|
2507
|
+
import { Search } from "@storm-ds/icons";
|
|
2508
|
+
import { jsx as jsx40, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2509
|
+
var Command = forwardRef40(
|
|
2510
|
+
({ className, ...props }, ref) => {
|
|
2511
|
+
return /* @__PURE__ */ jsx40(
|
|
2512
|
+
"div",
|
|
2513
|
+
{
|
|
2514
|
+
ref,
|
|
2515
|
+
className: cn(
|
|
2516
|
+
"flex w-full flex-col overflow-hidden rounded-storm-lg border border-storm-border bg-storm-background text-storm-foreground",
|
|
2517
|
+
className
|
|
2518
|
+
),
|
|
2519
|
+
...props
|
|
2520
|
+
}
|
|
2521
|
+
);
|
|
2522
|
+
}
|
|
2523
|
+
);
|
|
2524
|
+
var CommandInput = forwardRef40(
|
|
2525
|
+
({ className, ...props }, ref) => {
|
|
2526
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center border-b border-storm-border px-3", children: [
|
|
2527
|
+
/* @__PURE__ */ jsx40(Search, { className: "mr-2 h-4 w-4 shrink-0 text-storm-muted-foreground" }),
|
|
2528
|
+
/* @__PURE__ */ jsx40(
|
|
2529
|
+
"input",
|
|
2530
|
+
{
|
|
2531
|
+
ref,
|
|
2532
|
+
className: cn(
|
|
2533
|
+
"flex h-10 w-full bg-transparent text-sm text-storm-foreground placeholder:text-storm-muted-foreground",
|
|
2534
|
+
"focus:outline-none",
|
|
2535
|
+
className
|
|
2536
|
+
),
|
|
2537
|
+
...props
|
|
2538
|
+
}
|
|
2539
|
+
)
|
|
2540
|
+
] });
|
|
2541
|
+
}
|
|
2542
|
+
);
|
|
2543
|
+
var CommandList = forwardRef40(
|
|
2544
|
+
({ className, ...props }, ref) => {
|
|
2545
|
+
return /* @__PURE__ */ jsx40(
|
|
2546
|
+
"div",
|
|
2547
|
+
{
|
|
2548
|
+
ref,
|
|
2549
|
+
className: cn("max-h-[300px] overflow-y-auto p-1", className),
|
|
2550
|
+
...props
|
|
2551
|
+
}
|
|
2552
|
+
);
|
|
2553
|
+
}
|
|
2554
|
+
);
|
|
2555
|
+
var CommandGroup = forwardRef40(
|
|
2556
|
+
({ className, heading, children, ...props }, ref) => {
|
|
2557
|
+
return /* @__PURE__ */ jsxs12("div", { ref, className: cn("py-1", className), ...props, children: [
|
|
2558
|
+
heading && /* @__PURE__ */ jsx40("p", { className: "px-2 py-1.5 text-xs font-medium text-storm-muted-foreground", children: heading }),
|
|
2559
|
+
children
|
|
2560
|
+
] });
|
|
2561
|
+
}
|
|
2562
|
+
);
|
|
2563
|
+
var CommandItem = forwardRef40(
|
|
2564
|
+
({ className, disabled, ...props }, ref) => {
|
|
2565
|
+
return /* @__PURE__ */ jsx40(
|
|
2566
|
+
"div",
|
|
2567
|
+
{
|
|
2568
|
+
ref,
|
|
2569
|
+
className: cn(
|
|
2570
|
+
"flex cursor-pointer items-center gap-2 rounded-storm-sm px-2 py-1.5 text-sm transition-colors",
|
|
2571
|
+
"hover:bg-storm-accent/10",
|
|
2572
|
+
disabled && "pointer-events-none opacity-50",
|
|
2573
|
+
className
|
|
2574
|
+
),
|
|
2575
|
+
...props
|
|
2576
|
+
}
|
|
2577
|
+
);
|
|
2578
|
+
}
|
|
2579
|
+
);
|
|
2580
|
+
var CommandSeparator = forwardRef40(
|
|
2581
|
+
({ className, ...props }, ref) => {
|
|
2582
|
+
return /* @__PURE__ */ jsx40(
|
|
2583
|
+
"div",
|
|
2584
|
+
{
|
|
2585
|
+
ref,
|
|
2586
|
+
className: cn("-mx-1 my-1 h-px bg-storm-border", className),
|
|
2587
|
+
...props
|
|
2588
|
+
}
|
|
2589
|
+
);
|
|
2590
|
+
}
|
|
2591
|
+
);
|
|
2592
|
+
var CommandEmpty = forwardRef40(
|
|
2593
|
+
({ className, ...props }, ref) => {
|
|
2594
|
+
return /* @__PURE__ */ jsx40(
|
|
2595
|
+
"div",
|
|
2596
|
+
{
|
|
2597
|
+
ref,
|
|
2598
|
+
className: cn("py-6 text-center text-sm text-storm-muted-foreground", className),
|
|
2599
|
+
...props
|
|
2600
|
+
}
|
|
2601
|
+
);
|
|
2602
|
+
}
|
|
2603
|
+
);
|
|
2604
|
+
var CommandShortcut = forwardRef40(
|
|
2605
|
+
({ className, ...props }, ref) => {
|
|
2606
|
+
return /* @__PURE__ */ jsx40(
|
|
2607
|
+
"span",
|
|
2608
|
+
{
|
|
2609
|
+
ref,
|
|
2610
|
+
className: cn("ml-auto text-xs text-storm-muted-foreground", className),
|
|
2611
|
+
...props
|
|
2612
|
+
}
|
|
2613
|
+
);
|
|
2614
|
+
}
|
|
2615
|
+
);
|
|
2616
|
+
var CommandDialog = forwardRef40(
|
|
2617
|
+
({ className, children, ...props }, ref) => {
|
|
2618
|
+
return /* @__PURE__ */ jsx40(
|
|
2619
|
+
"dialog",
|
|
2620
|
+
{
|
|
2621
|
+
ref,
|
|
2622
|
+
className: cn(
|
|
2623
|
+
"fixed inset-0 z-50 m-auto max-h-[85vh] w-full max-w-lg rounded-storm-lg border-0 bg-transparent p-0 backdrop:bg-black/50",
|
|
2624
|
+
"open:animate-in open:fade-in-0 open:zoom-in-95",
|
|
2625
|
+
className
|
|
2626
|
+
),
|
|
2627
|
+
...props,
|
|
2628
|
+
children
|
|
2629
|
+
}
|
|
2630
|
+
);
|
|
2631
|
+
}
|
|
2632
|
+
);
|
|
2633
|
+
Command.displayName = "Command";
|
|
2634
|
+
CommandInput.displayName = "CommandInput";
|
|
2635
|
+
CommandList.displayName = "CommandList";
|
|
2636
|
+
CommandGroup.displayName = "CommandGroup";
|
|
2637
|
+
CommandItem.displayName = "CommandItem";
|
|
2638
|
+
CommandSeparator.displayName = "CommandSeparator";
|
|
2639
|
+
CommandEmpty.displayName = "CommandEmpty";
|
|
2640
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
2641
|
+
CommandDialog.displayName = "CommandDialog";
|
|
2642
|
+
|
|
2643
|
+
// src/components/ContextMenu.tsx
|
|
2644
|
+
import { forwardRef as forwardRef41, useState as useState8, useRef as useRef4, useEffect as useEffect4 } from "react";
|
|
2645
|
+
import { jsx as jsx41, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2646
|
+
var ContextMenu = forwardRef41(
|
|
2647
|
+
({ className, children, onContextMenu, ...props }, ref) => {
|
|
2648
|
+
const [position, setPosition] = useState8(null);
|
|
2649
|
+
const containerRef = useRef4(null);
|
|
2650
|
+
useEffect4(() => {
|
|
2651
|
+
const handleClick = () => setPosition(null);
|
|
2652
|
+
document.addEventListener("click", handleClick);
|
|
2653
|
+
return () => document.removeEventListener("click", handleClick);
|
|
2654
|
+
}, []);
|
|
2655
|
+
const handleContextMenu = (e) => {
|
|
2656
|
+
e.preventDefault();
|
|
2657
|
+
setPosition({ x: e.clientX, y: e.clientY });
|
|
2658
|
+
onContextMenu?.(e);
|
|
2659
|
+
};
|
|
2660
|
+
const childArray = Array.isArray(children) ? children : [children];
|
|
2661
|
+
const trigger = childArray[0];
|
|
2662
|
+
const content = childArray[1];
|
|
2663
|
+
return /* @__PURE__ */ jsxs13("div", { ref: containerRef, className: cn("relative", className), onContextMenu: handleContextMenu, ...props, children: [
|
|
2664
|
+
trigger,
|
|
2665
|
+
position && /* @__PURE__ */ jsx41(
|
|
2666
|
+
"div",
|
|
2667
|
+
{
|
|
2668
|
+
className: "fixed z-50 animate-in fade-in-0 zoom-in-95",
|
|
2669
|
+
style: { left: position.x, top: position.y },
|
|
2670
|
+
children: content
|
|
2671
|
+
}
|
|
2672
|
+
)
|
|
2673
|
+
] });
|
|
2674
|
+
}
|
|
2675
|
+
);
|
|
2676
|
+
var ContextMenuContent = forwardRef41(
|
|
2677
|
+
({ className, ...props }, ref) => {
|
|
2678
|
+
return /* @__PURE__ */ jsx41(
|
|
2679
|
+
"div",
|
|
2680
|
+
{
|
|
2681
|
+
ref,
|
|
2682
|
+
className: cn(
|
|
2683
|
+
"min-w-[180px] rounded-storm-md border border-storm-border bg-storm-background p-1 text-storm-foreground",
|
|
2684
|
+
className
|
|
2685
|
+
),
|
|
2686
|
+
...props
|
|
2687
|
+
}
|
|
2688
|
+
);
|
|
2689
|
+
}
|
|
2690
|
+
);
|
|
2691
|
+
var ContextMenuItem = forwardRef41(
|
|
2692
|
+
({ className, destructive, disabled, ...props }, ref) => {
|
|
2693
|
+
return /* @__PURE__ */ jsx41(
|
|
2694
|
+
"div",
|
|
2695
|
+
{
|
|
2696
|
+
ref,
|
|
2697
|
+
className: cn(
|
|
2698
|
+
"flex cursor-pointer items-center rounded-storm-sm px-2 py-1.5 text-sm transition-colors",
|
|
2699
|
+
"hover:bg-storm-accent/10",
|
|
2700
|
+
destructive && "text-storm-destructive hover:bg-storm-destructive/10",
|
|
2701
|
+
disabled && "pointer-events-none opacity-50",
|
|
2702
|
+
className
|
|
2703
|
+
),
|
|
2704
|
+
...props
|
|
2705
|
+
}
|
|
2706
|
+
);
|
|
2707
|
+
}
|
|
2708
|
+
);
|
|
2709
|
+
var ContextMenuSeparator = forwardRef41(
|
|
2710
|
+
({ className, ...props }, ref) => {
|
|
2711
|
+
return /* @__PURE__ */ jsx41("div", { ref, className: cn("-mx-1 my-1 h-px bg-storm-border", className), ...props });
|
|
2712
|
+
}
|
|
2713
|
+
);
|
|
2714
|
+
var ContextMenuLabel = forwardRef41(
|
|
2715
|
+
({ className, ...props }, ref) => {
|
|
2716
|
+
return /* @__PURE__ */ jsx41("div", { ref, className: cn("px-2 py-1.5 text-xs font-semibold text-storm-muted-foreground", className), ...props });
|
|
2717
|
+
}
|
|
2718
|
+
);
|
|
2719
|
+
ContextMenu.displayName = "ContextMenu";
|
|
2720
|
+
ContextMenuContent.displayName = "ContextMenuContent";
|
|
2721
|
+
ContextMenuItem.displayName = "ContextMenuItem";
|
|
2722
|
+
ContextMenuSeparator.displayName = "ContextMenuSeparator";
|
|
2723
|
+
ContextMenuLabel.displayName = "ContextMenuLabel";
|
|
2724
|
+
|
|
2725
|
+
// src/components/HoverCard.tsx
|
|
2726
|
+
import { forwardRef as forwardRef42 } from "react";
|
|
2727
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2728
|
+
var HoverCard = forwardRef42(
|
|
2729
|
+
({ className, ...props }, ref) => {
|
|
2730
|
+
return /* @__PURE__ */ jsx42(
|
|
2731
|
+
"div",
|
|
2732
|
+
{
|
|
2733
|
+
ref,
|
|
2734
|
+
className: cn("group relative inline-block", className),
|
|
2735
|
+
...props
|
|
2736
|
+
}
|
|
2737
|
+
);
|
|
2738
|
+
}
|
|
2739
|
+
);
|
|
2740
|
+
var HoverCardTrigger = forwardRef42(
|
|
2741
|
+
({ className, ...props }, ref) => {
|
|
2742
|
+
return /* @__PURE__ */ jsx42("div", { ref, className: cn("inline-flex", className), ...props });
|
|
2743
|
+
}
|
|
2744
|
+
);
|
|
2745
|
+
var alignStyles2 = {
|
|
2746
|
+
start: "left-0",
|
|
2747
|
+
center: "left-1/2 -translate-x-1/2",
|
|
2748
|
+
end: "right-0"
|
|
2749
|
+
};
|
|
2750
|
+
var sideStyles4 = {
|
|
2751
|
+
top: "bottom-full mb-2",
|
|
2752
|
+
bottom: "top-full mt-2"
|
|
2753
|
+
};
|
|
2754
|
+
var HoverCardContent = forwardRef42(
|
|
2755
|
+
({ className, align = "center", side = "bottom", ...props }, ref) => {
|
|
2756
|
+
return /* @__PURE__ */ jsx42(
|
|
2757
|
+
"div",
|
|
2758
|
+
{
|
|
2759
|
+
ref,
|
|
2760
|
+
className: cn(
|
|
2761
|
+
"invisible absolute z-50 w-64 rounded-storm-lg border border-storm-border bg-storm-background p-4 text-storm-foreground opacity-0 transition-all duration-200",
|
|
2762
|
+
"group-hover:visible group-hover:opacity-100",
|
|
2763
|
+
sideStyles4[side],
|
|
2764
|
+
alignStyles2[align],
|
|
2765
|
+
className
|
|
2766
|
+
),
|
|
2767
|
+
...props
|
|
2768
|
+
}
|
|
2769
|
+
);
|
|
2770
|
+
}
|
|
2771
|
+
);
|
|
2772
|
+
HoverCard.displayName = "HoverCard";
|
|
2773
|
+
HoverCardTrigger.displayName = "HoverCardTrigger";
|
|
2774
|
+
HoverCardContent.displayName = "HoverCardContent";
|
|
2775
|
+
|
|
2776
|
+
// src/components/Menubar.tsx
|
|
2777
|
+
import { forwardRef as forwardRef43, useState as useState9, useRef as useRef5, useEffect as useEffect5 } from "react";
|
|
2778
|
+
import { Fragment, jsx as jsx43, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2779
|
+
var Menubar = forwardRef43(
|
|
2780
|
+
({ className, ...props }, ref) => {
|
|
2781
|
+
return /* @__PURE__ */ jsx43(
|
|
2782
|
+
"div",
|
|
2783
|
+
{
|
|
2784
|
+
ref,
|
|
2785
|
+
className: cn(
|
|
2786
|
+
"inline-flex items-center gap-1 rounded-storm-md border border-storm-border bg-storm-background p-1",
|
|
2787
|
+
className
|
|
2788
|
+
),
|
|
2789
|
+
...props
|
|
2790
|
+
}
|
|
2791
|
+
);
|
|
2792
|
+
}
|
|
2793
|
+
);
|
|
2794
|
+
var MenubarMenu = forwardRef43(
|
|
2795
|
+
({ className, children, ...props }, ref) => {
|
|
2796
|
+
const [open, setOpen] = useState9(false);
|
|
2797
|
+
const menuRef = useRef5(null);
|
|
2798
|
+
useEffect5(() => {
|
|
2799
|
+
const handleClick = (e) => {
|
|
2800
|
+
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
2801
|
+
setOpen(false);
|
|
2802
|
+
}
|
|
2803
|
+
};
|
|
2804
|
+
document.addEventListener("mousedown", handleClick);
|
|
2805
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
2806
|
+
}, []);
|
|
2807
|
+
const childArray = Array.isArray(children) ? children : [children];
|
|
2808
|
+
const trigger = childArray[0];
|
|
2809
|
+
const content = childArray.slice(1);
|
|
2810
|
+
return /* @__PURE__ */ jsxs14("div", { ref: menuRef, className: cn("relative", className), ...props, children: [
|
|
2811
|
+
/* @__PURE__ */ jsx43("div", { onClick: () => setOpen(!open), children: trigger }),
|
|
2812
|
+
open && /* @__PURE__ */ jsx43(Fragment, { children: content })
|
|
2813
|
+
] });
|
|
2814
|
+
}
|
|
2815
|
+
);
|
|
2816
|
+
var MenubarTrigger = forwardRef43(
|
|
2817
|
+
({ className, ...props }, ref) => {
|
|
2818
|
+
return /* @__PURE__ */ jsx43(
|
|
2819
|
+
"button",
|
|
2820
|
+
{
|
|
2821
|
+
ref,
|
|
2822
|
+
type: "button",
|
|
2823
|
+
className: cn(
|
|
2824
|
+
"inline-flex items-center rounded-storm-sm px-3 py-1 text-sm font-medium text-storm-foreground transition-colors",
|
|
2825
|
+
"hover:bg-storm-accent/10",
|
|
2826
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
2827
|
+
className
|
|
2828
|
+
),
|
|
2829
|
+
...props
|
|
2830
|
+
}
|
|
2831
|
+
);
|
|
2832
|
+
}
|
|
2833
|
+
);
|
|
2834
|
+
var MenubarContent = forwardRef43(
|
|
2835
|
+
({ className, ...props }, ref) => {
|
|
2836
|
+
return /* @__PURE__ */ jsx43(
|
|
2837
|
+
"div",
|
|
2838
|
+
{
|
|
2839
|
+
ref,
|
|
2840
|
+
className: cn(
|
|
2841
|
+
"absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-storm-md border border-storm-border bg-storm-background p-1 animate-in fade-in-0 zoom-in-95",
|
|
2842
|
+
className
|
|
2843
|
+
),
|
|
2844
|
+
...props
|
|
2845
|
+
}
|
|
2846
|
+
);
|
|
2847
|
+
}
|
|
2848
|
+
);
|
|
2849
|
+
var MenubarItem = forwardRef43(
|
|
2850
|
+
({ className, disabled, ...props }, ref) => {
|
|
2851
|
+
return /* @__PURE__ */ jsx43(
|
|
2852
|
+
"div",
|
|
2853
|
+
{
|
|
2854
|
+
ref,
|
|
2855
|
+
className: cn(
|
|
2856
|
+
"flex cursor-pointer items-center rounded-storm-sm px-2 py-1.5 text-sm transition-colors",
|
|
2857
|
+
"hover:bg-storm-accent/10",
|
|
2858
|
+
disabled && "pointer-events-none opacity-50",
|
|
2859
|
+
className
|
|
2860
|
+
),
|
|
2861
|
+
...props
|
|
2862
|
+
}
|
|
2863
|
+
);
|
|
2864
|
+
}
|
|
2865
|
+
);
|
|
2866
|
+
var MenubarSeparator = forwardRef43(
|
|
2867
|
+
({ className, ...props }, ref) => {
|
|
2868
|
+
return /* @__PURE__ */ jsx43("div", { ref, className: cn("-mx-1 my-1 h-px bg-storm-border", className), ...props });
|
|
2869
|
+
}
|
|
2870
|
+
);
|
|
2871
|
+
var MenubarShortcut = forwardRef43(
|
|
2872
|
+
({ className, ...props }, ref) => {
|
|
2873
|
+
return /* @__PURE__ */ jsx43("span", { ref, className: cn("ml-auto text-xs text-storm-muted-foreground", className), ...props });
|
|
2874
|
+
}
|
|
2875
|
+
);
|
|
2876
|
+
Menubar.displayName = "Menubar";
|
|
2877
|
+
MenubarMenu.displayName = "MenubarMenu";
|
|
2878
|
+
MenubarTrigger.displayName = "MenubarTrigger";
|
|
2879
|
+
MenubarContent.displayName = "MenubarContent";
|
|
2880
|
+
MenubarItem.displayName = "MenubarItem";
|
|
2881
|
+
MenubarSeparator.displayName = "MenubarSeparator";
|
|
2882
|
+
MenubarShortcut.displayName = "MenubarShortcut";
|
|
2883
|
+
|
|
2884
|
+
// src/components/Drawer.tsx
|
|
2885
|
+
import { forwardRef as forwardRef44 } from "react";
|
|
2886
|
+
import { jsx as jsx44, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2887
|
+
var Drawer = forwardRef44(
|
|
2888
|
+
({ className, children, ...props }, ref) => {
|
|
2889
|
+
return /* @__PURE__ */ jsx44(
|
|
2890
|
+
"dialog",
|
|
2891
|
+
{
|
|
2892
|
+
ref,
|
|
2893
|
+
className: cn(
|
|
2894
|
+
"fixed inset-x-0 bottom-0 z-50 m-0 w-full max-w-full rounded-t-storm-xl border-t border-storm-border bg-storm-background p-0 text-storm-foreground backdrop:bg-black/50",
|
|
2895
|
+
"open:animate-in open:slide-in-from-bottom",
|
|
2896
|
+
className
|
|
2897
|
+
),
|
|
2898
|
+
...props,
|
|
2899
|
+
children
|
|
2900
|
+
}
|
|
2901
|
+
);
|
|
2902
|
+
}
|
|
2903
|
+
);
|
|
2904
|
+
var DrawerContent = forwardRef44(
|
|
2905
|
+
({ className, children, ...props }, ref) => {
|
|
2906
|
+
return /* @__PURE__ */ jsxs15("div", { ref, className: cn("mx-auto max-w-lg p-6", className), ...props, children: [
|
|
2907
|
+
/* @__PURE__ */ jsx44("div", { className: "mx-auto mb-4 h-1.5 w-12 rounded-full bg-storm-accent/30" }),
|
|
2908
|
+
children
|
|
2909
|
+
] });
|
|
2910
|
+
}
|
|
2911
|
+
);
|
|
2912
|
+
var DrawerHeader = forwardRef44(
|
|
2913
|
+
({ className, ...props }, ref) => {
|
|
2914
|
+
return /* @__PURE__ */ jsx44("div", { ref, className: cn("mb-4 space-y-1.5 text-center", className), ...props });
|
|
2915
|
+
}
|
|
2916
|
+
);
|
|
2917
|
+
var DrawerTitle = forwardRef44(
|
|
2918
|
+
({ className, ...props }, ref) => {
|
|
2919
|
+
return /* @__PURE__ */ jsx44("h2", { ref, className: cn("text-lg font-semibold text-storm-foreground", className), ...props });
|
|
2920
|
+
}
|
|
2921
|
+
);
|
|
2922
|
+
var DrawerDescription = forwardRef44(
|
|
2923
|
+
({ className, ...props }, ref) => {
|
|
2924
|
+
return /* @__PURE__ */ jsx44("p", { ref, className: cn("text-sm text-storm-muted-foreground", className), ...props });
|
|
2925
|
+
}
|
|
2926
|
+
);
|
|
2927
|
+
var DrawerFooter = forwardRef44(
|
|
2928
|
+
({ className, ...props }, ref) => {
|
|
2929
|
+
return /* @__PURE__ */ jsx44("div", { ref, className: cn("flex flex-col gap-2 pt-4", className), ...props });
|
|
2930
|
+
}
|
|
2931
|
+
);
|
|
2932
|
+
var DrawerClose = forwardRef44(
|
|
2933
|
+
({ className, ...props }, ref) => {
|
|
2934
|
+
return /* @__PURE__ */ jsx44(
|
|
2935
|
+
"button",
|
|
2936
|
+
{
|
|
2937
|
+
ref,
|
|
2938
|
+
type: "button",
|
|
2939
|
+
className: cn(
|
|
2940
|
+
"absolute right-4 top-4 rounded-storm-sm p-1 text-storm-muted-foreground transition-colors",
|
|
2941
|
+
"hover:text-storm-foreground",
|
|
2942
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
2943
|
+
className
|
|
2944
|
+
),
|
|
2945
|
+
...props,
|
|
2946
|
+
children: /* @__PURE__ */ jsxs15("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2947
|
+
/* @__PURE__ */ jsx44("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2948
|
+
/* @__PURE__ */ jsx44("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2949
|
+
] })
|
|
2950
|
+
}
|
|
2951
|
+
);
|
|
2952
|
+
}
|
|
2953
|
+
);
|
|
2954
|
+
Drawer.displayName = "Drawer";
|
|
2955
|
+
DrawerContent.displayName = "DrawerContent";
|
|
2956
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
2957
|
+
DrawerTitle.displayName = "DrawerTitle";
|
|
2958
|
+
DrawerDescription.displayName = "DrawerDescription";
|
|
2959
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
2960
|
+
DrawerClose.displayName = "DrawerClose";
|
|
2961
|
+
|
|
2962
|
+
// src/components/Resizable.tsx
|
|
2963
|
+
import { forwardRef as forwardRef45 } from "react";
|
|
2964
|
+
import { jsx as jsx45, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2965
|
+
var ResizablePanelGroup = forwardRef45(
|
|
2966
|
+
({ className, direction = "horizontal", ...props }, ref) => {
|
|
2967
|
+
return /* @__PURE__ */ jsx45(
|
|
2968
|
+
"div",
|
|
2969
|
+
{
|
|
2970
|
+
ref,
|
|
2971
|
+
"data-direction": direction,
|
|
2972
|
+
className: cn(
|
|
2973
|
+
"flex w-full overflow-hidden rounded-storm-lg border border-storm-border",
|
|
2974
|
+
direction === "horizontal" ? "flex-row" : "flex-col",
|
|
2975
|
+
className
|
|
2976
|
+
),
|
|
2977
|
+
...props
|
|
2978
|
+
}
|
|
2979
|
+
);
|
|
2980
|
+
}
|
|
2981
|
+
);
|
|
2982
|
+
var ResizablePanel = forwardRef45(
|
|
2983
|
+
({ className, defaultSize = 50, minSize = 10, maxSize = 90, style, ...props }, ref) => {
|
|
2984
|
+
return /* @__PURE__ */ jsx45(
|
|
2985
|
+
"div",
|
|
2986
|
+
{
|
|
2987
|
+
ref,
|
|
2988
|
+
className: cn("flex-shrink-0 overflow-auto", className),
|
|
2989
|
+
style: { ...style, flexBasis: `${defaultSize}%`, flexGrow: 0 },
|
|
2990
|
+
...props
|
|
2991
|
+
}
|
|
2992
|
+
);
|
|
2993
|
+
}
|
|
2994
|
+
);
|
|
2995
|
+
var ResizableHandle = forwardRef45(
|
|
2996
|
+
({ className, withHandle = false, ...props }, ref) => {
|
|
2997
|
+
return /* @__PURE__ */ jsx45(
|
|
2998
|
+
"div",
|
|
2999
|
+
{
|
|
3000
|
+
ref,
|
|
3001
|
+
className: cn(
|
|
3002
|
+
"relative flex shrink-0 items-center justify-center bg-storm-border transition-colors",
|
|
3003
|
+
"after:absolute after:inset-0 after:z-10",
|
|
3004
|
+
"hover:bg-storm-primary/30",
|
|
3005
|
+
"data-[direction=horizontal]:w-px data-[direction=horizontal]:cursor-col-resize",
|
|
3006
|
+
"data-[direction=vertical]:h-px data-[direction=vertical]:cursor-row-resize",
|
|
3007
|
+
"w-px cursor-col-resize",
|
|
3008
|
+
className
|
|
3009
|
+
),
|
|
3010
|
+
...props,
|
|
3011
|
+
children: withHandle && /* @__PURE__ */ jsx45("div", { className: "z-20 flex h-4 w-3 items-center justify-center rounded-sm border border-storm-border bg-storm-background", children: /* @__PURE__ */ jsxs16("svg", { xmlns: "http://www.w3.org/2000/svg", width: "8", height: "8", viewBox: "0 0 24 24", fill: "currentColor", className: "text-storm-muted-foreground", children: [
|
|
3012
|
+
/* @__PURE__ */ jsx45("circle", { cx: "9", cy: "12", r: "1.5" }),
|
|
3013
|
+
/* @__PURE__ */ jsx45("circle", { cx: "15", cy: "12", r: "1.5" })
|
|
3014
|
+
] }) })
|
|
3015
|
+
}
|
|
3016
|
+
);
|
|
3017
|
+
}
|
|
3018
|
+
);
|
|
3019
|
+
ResizablePanelGroup.displayName = "ResizablePanelGroup";
|
|
3020
|
+
ResizablePanel.displayName = "ResizablePanel";
|
|
3021
|
+
ResizableHandle.displayName = "ResizableHandle";
|
|
3022
|
+
|
|
3023
|
+
// src/components/InputOTP.tsx
|
|
3024
|
+
import { forwardRef as forwardRef46, useState as useState11, useRef as useRef7 } from "react";
|
|
3025
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3026
|
+
var InputOTP = forwardRef46(
|
|
3027
|
+
({ className, length = 6, value: controlledValue, onChange, disabled, ...props }, ref) => {
|
|
3028
|
+
const [internalValue, setInternalValue] = useState11("");
|
|
3029
|
+
const value = controlledValue ?? internalValue;
|
|
3030
|
+
const inputRefs = useRef7([]);
|
|
3031
|
+
const handleChange = (index, char) => {
|
|
3032
|
+
if (disabled) return;
|
|
3033
|
+
const sanitized = char.replace(/[^0-9]/g, "");
|
|
3034
|
+
if (!sanitized && char !== "") return;
|
|
3035
|
+
const chars = value.split("");
|
|
3036
|
+
chars[index] = sanitized;
|
|
3037
|
+
const newValue = chars.join("").slice(0, length);
|
|
3038
|
+
if (controlledValue === void 0) setInternalValue(newValue);
|
|
3039
|
+
onChange?.(newValue);
|
|
3040
|
+
if (sanitized && index < length - 1) {
|
|
3041
|
+
inputRefs.current[index + 1]?.focus();
|
|
3042
|
+
}
|
|
3043
|
+
};
|
|
3044
|
+
const handleKeyDown = (index, e) => {
|
|
3045
|
+
if (e.key === "Backspace" && !value[index] && index > 0) {
|
|
3046
|
+
inputRefs.current[index - 1]?.focus();
|
|
3047
|
+
const chars = value.split("");
|
|
3048
|
+
chars[index - 1] = "";
|
|
3049
|
+
const newValue = chars.join("");
|
|
3050
|
+
if (controlledValue === void 0) setInternalValue(newValue);
|
|
3051
|
+
onChange?.(newValue);
|
|
3052
|
+
}
|
|
3053
|
+
if (e.key === "ArrowLeft" && index > 0) {
|
|
3054
|
+
inputRefs.current[index - 1]?.focus();
|
|
3055
|
+
}
|
|
3056
|
+
if (e.key === "ArrowRight" && index < length - 1) {
|
|
3057
|
+
inputRefs.current[index + 1]?.focus();
|
|
3058
|
+
}
|
|
3059
|
+
};
|
|
3060
|
+
const handlePaste = (e) => {
|
|
3061
|
+
e.preventDefault();
|
|
3062
|
+
const pasted = e.clipboardData.getData("text").replace(/[^0-9]/g, "").slice(0, length);
|
|
3063
|
+
if (controlledValue === void 0) setInternalValue(pasted);
|
|
3064
|
+
onChange?.(pasted);
|
|
3065
|
+
const focusIndex = Math.min(pasted.length, length - 1);
|
|
3066
|
+
inputRefs.current[focusIndex]?.focus();
|
|
3067
|
+
};
|
|
3068
|
+
return /* @__PURE__ */ jsx46(
|
|
3069
|
+
"div",
|
|
3070
|
+
{
|
|
3071
|
+
ref,
|
|
3072
|
+
className: cn("flex items-center gap-2", className),
|
|
3073
|
+
...props,
|
|
3074
|
+
children: Array.from({ length }, (_, i) => /* @__PURE__ */ jsx46(
|
|
3075
|
+
"input",
|
|
3076
|
+
{
|
|
3077
|
+
ref: (el) => {
|
|
3078
|
+
inputRefs.current[i] = el;
|
|
3079
|
+
},
|
|
3080
|
+
type: "text",
|
|
3081
|
+
inputMode: "numeric",
|
|
3082
|
+
maxLength: 1,
|
|
3083
|
+
disabled,
|
|
3084
|
+
value: value[i] || "",
|
|
3085
|
+
onChange: (e) => handleChange(i, e.target.value),
|
|
3086
|
+
onKeyDown: (e) => handleKeyDown(i, e),
|
|
3087
|
+
onPaste: i === 0 ? handlePaste : void 0,
|
|
3088
|
+
className: cn(
|
|
3089
|
+
"h-10 w-10 rounded-storm-md border border-storm-border bg-storm-background text-center text-sm font-medium text-storm-foreground transition-colors",
|
|
3090
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
3091
|
+
"disabled:pointer-events-none disabled:opacity-50"
|
|
3092
|
+
)
|
|
3093
|
+
},
|
|
3094
|
+
i
|
|
3095
|
+
))
|
|
3096
|
+
}
|
|
3097
|
+
);
|
|
3098
|
+
}
|
|
3099
|
+
);
|
|
3100
|
+
var InputOTPSeparator = forwardRef46(
|
|
3101
|
+
({ className, ...props }, ref) => {
|
|
3102
|
+
return /* @__PURE__ */ jsx46("div", { ref, className: cn("flex items-center text-storm-muted-foreground", className), ...props, children: /* @__PURE__ */ jsx46("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx46("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) }) });
|
|
3103
|
+
}
|
|
3104
|
+
);
|
|
3105
|
+
InputOTP.displayName = "InputOTP";
|
|
3106
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
3107
|
+
|
|
3108
|
+
// src/components/Kbd.tsx
|
|
3109
|
+
import { forwardRef as forwardRef47 } from "react";
|
|
3110
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3111
|
+
var sizeStyles14 = {
|
|
3112
|
+
sm: "min-w-[1.25rem] h-5 px-1 text-[10px]",
|
|
3113
|
+
md: "min-w-[1.5rem] h-6 px-1.5 text-xs",
|
|
3114
|
+
lg: "min-w-[1.75rem] h-7 px-2 text-sm"
|
|
3115
|
+
};
|
|
3116
|
+
var Kbd = forwardRef47(
|
|
3117
|
+
({ className, size = "md", ...props }, ref) => {
|
|
3118
|
+
return /* @__PURE__ */ jsx47(
|
|
3119
|
+
"kbd",
|
|
3120
|
+
{
|
|
3121
|
+
ref,
|
|
3122
|
+
className: cn(
|
|
3123
|
+
"inline-flex items-center justify-center rounded-storm-sm border border-storm-border bg-storm-muted font-storm-mono font-medium text-storm-muted-foreground",
|
|
3124
|
+
sizeStyles14[size],
|
|
3125
|
+
className
|
|
3126
|
+
),
|
|
3127
|
+
...props
|
|
3128
|
+
}
|
|
3129
|
+
);
|
|
3130
|
+
}
|
|
3131
|
+
);
|
|
3132
|
+
Kbd.displayName = "Kbd";
|
|
3133
|
+
|
|
3134
|
+
// src/components/Spinner.tsx
|
|
3135
|
+
import { forwardRef as forwardRef48 } from "react";
|
|
3136
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3137
|
+
var sizeStyles15 = {
|
|
3138
|
+
sm: "h-4 w-4 border-[1.5px]",
|
|
3139
|
+
md: "h-5 w-5 border-2",
|
|
3140
|
+
lg: "h-8 w-8 border-2"
|
|
3141
|
+
};
|
|
3142
|
+
var Spinner = forwardRef48(
|
|
3143
|
+
({ className, size = "md", ...props }, ref) => {
|
|
3144
|
+
return /* @__PURE__ */ jsx48(
|
|
3145
|
+
"div",
|
|
3146
|
+
{
|
|
3147
|
+
ref,
|
|
3148
|
+
role: "status",
|
|
3149
|
+
"aria-label": "Loading",
|
|
3150
|
+
className: cn(
|
|
3151
|
+
"inline-block animate-spin rounded-full border-storm-primary border-t-transparent",
|
|
3152
|
+
sizeStyles15[size],
|
|
3153
|
+
className
|
|
3154
|
+
),
|
|
3155
|
+
...props
|
|
3156
|
+
}
|
|
3157
|
+
);
|
|
3158
|
+
}
|
|
3159
|
+
);
|
|
3160
|
+
Spinner.displayName = "Spinner";
|
|
3161
|
+
|
|
3162
|
+
// src/components/Typography.tsx
|
|
3163
|
+
import { forwardRef as forwardRef49 } from "react";
|
|
3164
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
3165
|
+
var TypographyH1 = forwardRef49(
|
|
3166
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("h1", { ref, className: cn("scroll-m-20 text-4xl font-bold tracking-tight text-storm-foreground lg:text-5xl", className), ...props })
|
|
3167
|
+
);
|
|
3168
|
+
var TypographyH2 = forwardRef49(
|
|
3169
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("h2", { ref, className: cn("scroll-m-20 border-b border-storm-border pb-2 text-3xl font-semibold tracking-tight text-storm-foreground first:mt-0", className), ...props })
|
|
3170
|
+
);
|
|
3171
|
+
var TypographyH3 = forwardRef49(
|
|
3172
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("h3", { ref, className: cn("scroll-m-20 text-2xl font-semibold tracking-tight text-storm-foreground", className), ...props })
|
|
3173
|
+
);
|
|
3174
|
+
var TypographyH4 = forwardRef49(
|
|
3175
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("h4", { ref, className: cn("scroll-m-20 text-xl font-semibold tracking-tight text-storm-foreground", className), ...props })
|
|
3176
|
+
);
|
|
3177
|
+
var TypographyP = forwardRef49(
|
|
3178
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("p", { ref, className: cn("leading-7 text-storm-foreground [&:not(:first-child)]:mt-6", className), ...props })
|
|
3179
|
+
);
|
|
3180
|
+
var TypographyLead = forwardRef49(
|
|
3181
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("p", { ref, className: cn("text-xl text-storm-muted-foreground", className), ...props })
|
|
3182
|
+
);
|
|
3183
|
+
var TypographyLarge = forwardRef49(
|
|
3184
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("div", { ref, className: cn("text-lg font-semibold text-storm-foreground", className), ...props })
|
|
3185
|
+
);
|
|
3186
|
+
var TypographySmall = forwardRef49(
|
|
3187
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("small", { ref, className: cn("text-sm font-medium leading-none text-storm-foreground", className), ...props })
|
|
3188
|
+
);
|
|
3189
|
+
var TypographyMuted = forwardRef49(
|
|
3190
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("p", { ref, className: cn("text-sm text-storm-muted-foreground", className), ...props })
|
|
3191
|
+
);
|
|
3192
|
+
var TypographyBlockquote = forwardRef49(
|
|
3193
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("blockquote", { ref, className: cn("mt-6 border-l-2 border-storm-border pl-6 italic text-storm-muted-foreground", className), ...props })
|
|
3194
|
+
);
|
|
3195
|
+
var TypographyInlineCode = forwardRef49(
|
|
3196
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("code", { ref, className: cn("relative rounded bg-storm-muted px-[0.3rem] py-[0.2rem] font-storm-mono text-sm font-semibold text-storm-foreground", className), ...props })
|
|
3197
|
+
);
|
|
3198
|
+
var TypographyList = forwardRef49(
|
|
3199
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("ul", { ref, className: cn("my-6 ml-6 list-disc text-storm-foreground [&>li]:mt-2", className), ...props })
|
|
3200
|
+
);
|
|
3201
|
+
TypographyH1.displayName = "TypographyH1";
|
|
3202
|
+
TypographyH2.displayName = "TypographyH2";
|
|
3203
|
+
TypographyH3.displayName = "TypographyH3";
|
|
3204
|
+
TypographyH4.displayName = "TypographyH4";
|
|
3205
|
+
TypographyP.displayName = "TypographyP";
|
|
3206
|
+
TypographyLead.displayName = "TypographyLead";
|
|
3207
|
+
TypographyLarge.displayName = "TypographyLarge";
|
|
3208
|
+
TypographySmall.displayName = "TypographySmall";
|
|
3209
|
+
TypographyMuted.displayName = "TypographyMuted";
|
|
3210
|
+
TypographyBlockquote.displayName = "TypographyBlockquote";
|
|
3211
|
+
TypographyInlineCode.displayName = "TypographyInlineCode";
|
|
3212
|
+
TypographyList.displayName = "TypographyList";
|
|
3213
|
+
|
|
3214
|
+
// src/components/Empty.tsx
|
|
3215
|
+
import { forwardRef as forwardRef50 } from "react";
|
|
3216
|
+
import { jsx as jsx50, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3217
|
+
var Empty = forwardRef50(
|
|
3218
|
+
({ className, icon, title, description, action, children, ...props }, ref) => {
|
|
3219
|
+
return /* @__PURE__ */ jsxs17(
|
|
3220
|
+
"div",
|
|
3221
|
+
{
|
|
3222
|
+
ref,
|
|
3223
|
+
className: cn("flex flex-col items-center justify-center py-12 px-4 text-center", className),
|
|
3224
|
+
...props,
|
|
3225
|
+
children: [
|
|
3226
|
+
icon && /* @__PURE__ */ jsx50("div", { className: "mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-storm-muted text-storm-muted-foreground", children: icon }),
|
|
3227
|
+
title && /* @__PURE__ */ jsx50("h3", { className: "text-lg font-semibold text-storm-foreground mb-1", children: title }),
|
|
3228
|
+
description && /* @__PURE__ */ jsx50("p", { className: "text-sm text-storm-muted-foreground max-w-sm mb-4", children: description }),
|
|
3229
|
+
action && /* @__PURE__ */ jsx50("div", { className: "mt-2", children: action }),
|
|
3230
|
+
children
|
|
3231
|
+
]
|
|
3232
|
+
}
|
|
3233
|
+
);
|
|
3234
|
+
}
|
|
3235
|
+
);
|
|
3236
|
+
Empty.displayName = "Empty";
|
|
3237
|
+
|
|
3238
|
+
// src/components/Field.tsx
|
|
3239
|
+
import { forwardRef as forwardRef51 } from "react";
|
|
3240
|
+
import { jsx as jsx51, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3241
|
+
var Field = forwardRef51(
|
|
3242
|
+
({ className, label, htmlFor, required, error, description, children, ...props }, ref) => {
|
|
3243
|
+
return /* @__PURE__ */ jsxs18("div", { ref, className: cn("space-y-2", className), ...props, children: [
|
|
3244
|
+
label && /* @__PURE__ */ jsxs18(
|
|
3245
|
+
"label",
|
|
3246
|
+
{
|
|
3247
|
+
htmlFor,
|
|
3248
|
+
className: cn(
|
|
3249
|
+
"text-sm font-medium leading-none text-storm-foreground",
|
|
3250
|
+
"peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
3251
|
+
),
|
|
3252
|
+
children: [
|
|
3253
|
+
label,
|
|
3254
|
+
required && /* @__PURE__ */ jsx51("span", { className: "text-storm-destructive ml-1", children: "*" })
|
|
3255
|
+
]
|
|
3256
|
+
}
|
|
3257
|
+
),
|
|
3258
|
+
description && /* @__PURE__ */ jsx51("p", { className: "text-xs text-storm-muted-foreground", children: description }),
|
|
3259
|
+
children,
|
|
3260
|
+
error && /* @__PURE__ */ jsx51("p", { className: "text-sm text-storm-destructive", children: error })
|
|
3261
|
+
] });
|
|
3262
|
+
}
|
|
3263
|
+
);
|
|
3264
|
+
Field.displayName = "Field";
|
|
3265
|
+
|
|
3266
|
+
// src/components/Direction.tsx
|
|
3267
|
+
import { createContext as createContext3, useContext as useContext3, forwardRef as forwardRef52 } from "react";
|
|
3268
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3269
|
+
var DirectionContext = createContext3("ltr");
|
|
3270
|
+
function useDirection() {
|
|
3271
|
+
return useContext3(DirectionContext);
|
|
3272
|
+
}
|
|
3273
|
+
var DirectionProvider = forwardRef52(
|
|
3274
|
+
({ className, dir, children, ...props }, ref) => {
|
|
3275
|
+
return /* @__PURE__ */ jsx52(DirectionContext.Provider, { value: dir, children: /* @__PURE__ */ jsx52("div", { ref, dir, className: cn(className), ...props, children }) });
|
|
3276
|
+
}
|
|
3277
|
+
);
|
|
3278
|
+
DirectionProvider.displayName = "DirectionProvider";
|
|
3279
|
+
|
|
3280
|
+
// src/components/NativeSelect.tsx
|
|
3281
|
+
import { forwardRef as forwardRef53 } from "react";
|
|
3282
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3283
|
+
var sizeStyles16 = {
|
|
3284
|
+
sm: "h-8 text-sm px-2",
|
|
3285
|
+
md: "h-10 text-sm px-3",
|
|
3286
|
+
lg: "h-12 text-base px-4"
|
|
3287
|
+
};
|
|
3288
|
+
var NativeSelect = forwardRef53(
|
|
3289
|
+
({ className, error, selectSize = "md", ...props }, ref) => {
|
|
3290
|
+
return /* @__PURE__ */ jsx53(
|
|
3291
|
+
"select",
|
|
3292
|
+
{
|
|
3293
|
+
ref,
|
|
3294
|
+
className: cn(
|
|
3295
|
+
"w-full rounded-storm-md border bg-storm-background text-storm-foreground transition-colors appearance-none",
|
|
3296
|
+
'bg-[url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-width%3D%222%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%2F%3E%3C%2Fsvg%3E")] bg-[length:12px] bg-[right_12px_center] bg-no-repeat pr-8',
|
|
3297
|
+
error ? "border-storm-destructive" : "border-storm-border",
|
|
3298
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
3299
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
3300
|
+
sizeStyles16[selectSize],
|
|
3301
|
+
className
|
|
3302
|
+
),
|
|
3303
|
+
...props
|
|
3304
|
+
}
|
|
3305
|
+
);
|
|
3306
|
+
}
|
|
3307
|
+
);
|
|
3308
|
+
NativeSelect.displayName = "NativeSelect";
|
|
3309
|
+
|
|
3310
|
+
// src/components/Item.tsx
|
|
3311
|
+
import { forwardRef as forwardRef54 } from "react";
|
|
3312
|
+
import { jsx as jsx54, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3313
|
+
var Item = forwardRef54(
|
|
3314
|
+
({ className, active, disabled, leading, trailing, children, ...props }, ref) => {
|
|
3315
|
+
return /* @__PURE__ */ jsxs19(
|
|
3316
|
+
"div",
|
|
3317
|
+
{
|
|
3318
|
+
ref,
|
|
3319
|
+
"data-active": active ? "" : void 0,
|
|
3320
|
+
"data-disabled": disabled ? "" : void 0,
|
|
3321
|
+
className: cn(
|
|
3322
|
+
"flex items-center gap-3 px-3 py-2 rounded-storm-md text-sm transition-colors cursor-pointer",
|
|
3323
|
+
active ? "bg-storm-primary/10 text-storm-primary" : "text-storm-foreground hover:bg-storm-muted",
|
|
3324
|
+
disabled && "pointer-events-none opacity-50",
|
|
3325
|
+
className
|
|
3326
|
+
),
|
|
3327
|
+
...props,
|
|
3328
|
+
children: [
|
|
3329
|
+
leading && /* @__PURE__ */ jsx54("span", { className: "shrink-0", children: leading }),
|
|
3330
|
+
/* @__PURE__ */ jsx54("span", { className: "flex-1 min-w-0", children }),
|
|
3331
|
+
trailing && /* @__PURE__ */ jsx54("span", { className: "shrink-0 text-storm-muted-foreground", children: trailing })
|
|
3332
|
+
]
|
|
3333
|
+
}
|
|
3334
|
+
);
|
|
3335
|
+
}
|
|
3336
|
+
);
|
|
3337
|
+
Item.displayName = "Item";
|
|
3338
|
+
|
|
3339
|
+
// src/components/Carousel.tsx
|
|
3340
|
+
import { forwardRef as forwardRef55, useState as useState12, useRef as useRef8, useCallback as useCallback3, useEffect as useEffect7, createContext as createContext4, useContext as useContext4 } from "react";
|
|
3341
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
3342
|
+
var CarouselContext = createContext4({
|
|
3343
|
+
current: 0,
|
|
3344
|
+
total: 0,
|
|
3345
|
+
scrollTo: () => {
|
|
3346
|
+
},
|
|
3347
|
+
next: () => {
|
|
3348
|
+
},
|
|
3349
|
+
previous: () => {
|
|
3350
|
+
},
|
|
3351
|
+
orientation: "horizontal",
|
|
3352
|
+
containerRef: { current: null }
|
|
3353
|
+
});
|
|
3354
|
+
function useCarousel() {
|
|
3355
|
+
return useContext4(CarouselContext);
|
|
3356
|
+
}
|
|
3357
|
+
var Carousel = forwardRef55(
|
|
3358
|
+
({ className, orientation = "horizontal", loop = false, autoplay = false, autoplayInterval = 3e3, children, ...props }, ref) => {
|
|
3359
|
+
const [current, setCurrent] = useState12(0);
|
|
3360
|
+
const [total, setTotal] = useState12(0);
|
|
3361
|
+
const containerRef = useRef8(null);
|
|
3362
|
+
const scrollTo = useCallback3((index) => {
|
|
3363
|
+
const container = containerRef.current;
|
|
3364
|
+
if (!container) return;
|
|
3365
|
+
const items = container.children;
|
|
3366
|
+
if (items.length === 0) return;
|
|
3367
|
+
setTotal(items.length);
|
|
3368
|
+
let target = index;
|
|
3369
|
+
if (loop) {
|
|
3370
|
+
target = (index % items.length + items.length) % items.length;
|
|
3371
|
+
} else {
|
|
3372
|
+
target = Math.max(0, Math.min(index, items.length - 1));
|
|
3373
|
+
}
|
|
3374
|
+
setCurrent(target);
|
|
3375
|
+
const child = items[target];
|
|
3376
|
+
if (orientation === "horizontal") {
|
|
3377
|
+
container.scrollTo({ left: child.offsetLeft, behavior: "smooth" });
|
|
3378
|
+
} else {
|
|
3379
|
+
container.scrollTo({ top: child.offsetTop, behavior: "smooth" });
|
|
3380
|
+
}
|
|
3381
|
+
}, [loop, orientation]);
|
|
3382
|
+
const next = useCallback3(() => scrollTo(current + 1), [current, scrollTo]);
|
|
3383
|
+
const previous = useCallback3(() => scrollTo(current - 1), [current, scrollTo]);
|
|
3384
|
+
useEffect7(() => {
|
|
3385
|
+
const container = containerRef.current;
|
|
3386
|
+
if (container) setTotal(container.children.length);
|
|
3387
|
+
}, []);
|
|
3388
|
+
useEffect7(() => {
|
|
3389
|
+
if (!autoplay) return;
|
|
3390
|
+
const timer = setInterval(next, autoplayInterval);
|
|
3391
|
+
return () => clearInterval(timer);
|
|
3392
|
+
}, [autoplay, autoplayInterval, next]);
|
|
3393
|
+
return /* @__PURE__ */ jsx55("div", { ref, className: cn("relative", className), ...props, children: /* @__PURE__ */ jsx55(CarouselContext.Provider, { value: { current, total, scrollTo, next, previous, orientation, containerRef }, children }) });
|
|
3394
|
+
}
|
|
3395
|
+
);
|
|
3396
|
+
var CarouselContent = forwardRef55(
|
|
3397
|
+
({ className, ...props }, ref) => {
|
|
3398
|
+
const { orientation, containerRef } = useCarousel();
|
|
3399
|
+
const setRefs = useCallback3((node) => {
|
|
3400
|
+
containerRef.current = node;
|
|
3401
|
+
if (typeof ref === "function") ref(node);
|
|
3402
|
+
else if (ref) ref.current = node;
|
|
3403
|
+
}, [ref, containerRef]);
|
|
3404
|
+
return /* @__PURE__ */ jsx55(
|
|
3405
|
+
"div",
|
|
3406
|
+
{
|
|
3407
|
+
ref: setRefs,
|
|
3408
|
+
className: cn(
|
|
3409
|
+
"flex snap-mandatory overflow-hidden scrollbar-hide",
|
|
3410
|
+
orientation === "horizontal" ? "snap-x flex-row" : "snap-y flex-col h-full",
|
|
3411
|
+
className
|
|
3412
|
+
),
|
|
3413
|
+
...props
|
|
3414
|
+
}
|
|
3415
|
+
);
|
|
3416
|
+
}
|
|
3417
|
+
);
|
|
3418
|
+
var CarouselItem = forwardRef55(
|
|
3419
|
+
({ className, ...props }, ref) => {
|
|
3420
|
+
return /* @__PURE__ */ jsx55(
|
|
3421
|
+
"div",
|
|
3422
|
+
{
|
|
3423
|
+
ref,
|
|
3424
|
+
className: cn("min-w-0 shrink-0 grow-0 basis-full snap-start", className),
|
|
3425
|
+
...props
|
|
3426
|
+
}
|
|
3427
|
+
);
|
|
3428
|
+
}
|
|
3429
|
+
);
|
|
3430
|
+
var CarouselPrevious = forwardRef55(
|
|
3431
|
+
({ className, ...props }, ref) => {
|
|
3432
|
+
const { previous } = useCarousel();
|
|
3433
|
+
return /* @__PURE__ */ jsx55(
|
|
3434
|
+
"button",
|
|
3435
|
+
{
|
|
3436
|
+
ref,
|
|
3437
|
+
type: "button",
|
|
3438
|
+
onClick: previous,
|
|
3439
|
+
className: cn(
|
|
3440
|
+
"absolute left-2 top-1/2 -translate-y-1/2 z-10 inline-flex h-8 w-8 items-center justify-center rounded-full border border-storm-border bg-storm-background text-storm-foreground hover:bg-storm-muted transition-colors",
|
|
3441
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
3442
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
3443
|
+
className
|
|
3444
|
+
),
|
|
3445
|
+
...props,
|
|
3446
|
+
children: /* @__PURE__ */ jsx55("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx55("polyline", { points: "15 18 9 12 15 6" }) })
|
|
3447
|
+
}
|
|
3448
|
+
);
|
|
3449
|
+
}
|
|
3450
|
+
);
|
|
3451
|
+
var CarouselNext = forwardRef55(
|
|
3452
|
+
({ className, ...props }, ref) => {
|
|
3453
|
+
const { next } = useCarousel();
|
|
3454
|
+
return /* @__PURE__ */ jsx55(
|
|
3455
|
+
"button",
|
|
3456
|
+
{
|
|
3457
|
+
ref,
|
|
3458
|
+
type: "button",
|
|
3459
|
+
onClick: next,
|
|
3460
|
+
className: cn(
|
|
3461
|
+
"absolute right-2 top-1/2 -translate-y-1/2 z-10 inline-flex h-8 w-8 items-center justify-center rounded-full border border-storm-border bg-storm-background text-storm-foreground hover:bg-storm-muted transition-colors",
|
|
3462
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
3463
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
3464
|
+
className
|
|
3465
|
+
),
|
|
3466
|
+
...props,
|
|
3467
|
+
children: /* @__PURE__ */ jsx55("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx55("polyline", { points: "9 18 15 12 9 6" }) })
|
|
3468
|
+
}
|
|
3469
|
+
);
|
|
3470
|
+
}
|
|
3471
|
+
);
|
|
3472
|
+
Carousel.displayName = "Carousel";
|
|
3473
|
+
CarouselContent.displayName = "CarouselContent";
|
|
3474
|
+
CarouselItem.displayName = "CarouselItem";
|
|
3475
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
|
3476
|
+
CarouselNext.displayName = "CarouselNext";
|
|
3477
|
+
|
|
3478
|
+
// src/components/DataTable.tsx
|
|
3479
|
+
import { forwardRef as forwardRef56, useState as useState13, useMemo } from "react";
|
|
3480
|
+
import { ChevronUp, ChevronDown as ChevronDown3, ChevronLeft, ChevronRight } from "@storm-ds/icons";
|
|
3481
|
+
import { jsx as jsx56, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3482
|
+
function DataTableInner({ className, columns, data, pageSize = 10, searchable = false, searchPlaceholder = "Search...", emptyMessage = "No results.", resultsLabel = "results", ...props }, ref) {
|
|
3483
|
+
const [page, setPage] = useState13(0);
|
|
3484
|
+
const [sortKey, setSortKey] = useState13(null);
|
|
3485
|
+
const [sortDir, setSortDir] = useState13("asc");
|
|
3486
|
+
const [search, setSearch] = useState13("");
|
|
3487
|
+
const filtered = useMemo(() => {
|
|
3488
|
+
if (!search) return data;
|
|
3489
|
+
const lower = search.toLowerCase();
|
|
3490
|
+
return data.filter(
|
|
3491
|
+
(row) => columns.some((col) => {
|
|
3492
|
+
const val = row[col.key];
|
|
3493
|
+
return val != null && String(val).toLowerCase().includes(lower);
|
|
3494
|
+
})
|
|
3495
|
+
);
|
|
3496
|
+
}, [data, search, columns]);
|
|
3497
|
+
const sorted = useMemo(() => {
|
|
3498
|
+
if (!sortKey) return filtered;
|
|
3499
|
+
return [...filtered].sort((a, b) => {
|
|
3500
|
+
const aVal = a[sortKey];
|
|
3501
|
+
const bVal = b[sortKey];
|
|
3502
|
+
if (aVal == null || bVal == null) return 0;
|
|
3503
|
+
const cmp = String(aVal).localeCompare(String(bVal), void 0, { numeric: true });
|
|
3504
|
+
return sortDir === "asc" ? cmp : -cmp;
|
|
3505
|
+
});
|
|
3506
|
+
}, [filtered, sortKey, sortDir]);
|
|
3507
|
+
const totalPages = Math.max(1, Math.ceil(sorted.length / pageSize));
|
|
3508
|
+
const pageData = sorted.slice(page * pageSize, (page + 1) * pageSize);
|
|
3509
|
+
const handleSort = (key) => {
|
|
3510
|
+
if (sortKey === key) {
|
|
3511
|
+
setSortDir(sortDir === "asc" ? "desc" : "asc");
|
|
3512
|
+
} else {
|
|
3513
|
+
setSortKey(key);
|
|
3514
|
+
setSortDir("asc");
|
|
3515
|
+
}
|
|
3516
|
+
setPage(0);
|
|
3517
|
+
};
|
|
3518
|
+
return /* @__PURE__ */ jsxs20("div", { ref, className: cn("space-y-4", className), ...props, children: [
|
|
3519
|
+
searchable && /* @__PURE__ */ jsx56(
|
|
3520
|
+
"input",
|
|
3521
|
+
{
|
|
3522
|
+
type: "text",
|
|
3523
|
+
value: search,
|
|
3524
|
+
onChange: (e) => {
|
|
3525
|
+
setSearch(e.target.value);
|
|
3526
|
+
setPage(0);
|
|
3527
|
+
},
|
|
3528
|
+
placeholder: searchPlaceholder,
|
|
3529
|
+
className: "h-9 w-full max-w-sm rounded-storm-md border border-storm-border bg-storm-background px-3 text-sm text-storm-foreground placeholder:text-storm-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring"
|
|
3530
|
+
}
|
|
3531
|
+
),
|
|
3532
|
+
/* @__PURE__ */ jsx56("div", { className: "rounded-storm-md border border-storm-border overflow-hidden", children: /* @__PURE__ */ jsxs20("table", { className: "w-full caption-bottom text-sm", children: [
|
|
3533
|
+
/* @__PURE__ */ jsx56("thead", { className: "border-b border-storm-border bg-storm-muted/50", children: /* @__PURE__ */ jsx56("tr", { children: columns.map((col) => /* @__PURE__ */ jsx56(
|
|
3534
|
+
"th",
|
|
3535
|
+
{
|
|
3536
|
+
className: cn(
|
|
3537
|
+
"h-10 px-4 text-left align-middle font-medium text-storm-muted-foreground",
|
|
3538
|
+
col.sortable && "cursor-pointer select-none hover:text-storm-foreground"
|
|
3539
|
+
),
|
|
3540
|
+
onClick: col.sortable ? () => handleSort(col.key) : void 0,
|
|
3541
|
+
children: /* @__PURE__ */ jsxs20("span", { className: "inline-flex items-center gap-1", children: [
|
|
3542
|
+
col.header,
|
|
3543
|
+
col.sortable && sortKey === col.key && (sortDir === "asc" ? /* @__PURE__ */ jsx56(ChevronUp, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx56(ChevronDown3, { className: "h-3 w-3" }))
|
|
3544
|
+
] })
|
|
3545
|
+
},
|
|
3546
|
+
col.key
|
|
3547
|
+
)) }) }),
|
|
3548
|
+
/* @__PURE__ */ jsx56("tbody", { children: pageData.length === 0 ? /* @__PURE__ */ jsx56("tr", { children: /* @__PURE__ */ jsx56("td", { colSpan: columns.length, className: "h-24 text-center text-storm-muted-foreground", children: emptyMessage }) }) : pageData.map((row, i) => /* @__PURE__ */ jsx56("tr", { className: "border-b border-storm-border last:border-0 hover:bg-storm-muted/50 transition-colors", children: columns.map((col) => /* @__PURE__ */ jsx56("td", { className: "px-4 py-3 align-middle text-storm-foreground", children: col.render ? col.render(row) : String(row[col.key] ?? "") }, col.key)) }, i)) })
|
|
3549
|
+
] }) }),
|
|
3550
|
+
totalPages > 1 && /* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between", children: [
|
|
3551
|
+
/* @__PURE__ */ jsxs20("p", { className: "text-sm text-storm-muted-foreground", children: [
|
|
3552
|
+
sorted.length,
|
|
3553
|
+
" ",
|
|
3554
|
+
resultsLabel
|
|
3555
|
+
] }),
|
|
3556
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-1", children: [
|
|
3557
|
+
/* @__PURE__ */ jsx56(
|
|
3558
|
+
"button",
|
|
3559
|
+
{
|
|
3560
|
+
type: "button",
|
|
3561
|
+
disabled: page === 0,
|
|
3562
|
+
onClick: () => setPage(page - 1),
|
|
3563
|
+
className: "inline-flex h-8 w-8 items-center justify-center rounded-storm-sm border border-storm-border text-sm text-storm-foreground hover:bg-storm-muted transition-colors disabled:pointer-events-none disabled:opacity-50",
|
|
3564
|
+
children: /* @__PURE__ */ jsx56(ChevronLeft, { className: "h-3.5 w-3.5" })
|
|
3565
|
+
}
|
|
3566
|
+
),
|
|
3567
|
+
/* @__PURE__ */ jsxs20("span", { className: "px-2 text-sm text-storm-muted-foreground", children: [
|
|
3568
|
+
page + 1,
|
|
3569
|
+
" / ",
|
|
3570
|
+
totalPages
|
|
3571
|
+
] }),
|
|
3572
|
+
/* @__PURE__ */ jsx56(
|
|
3573
|
+
"button",
|
|
3574
|
+
{
|
|
3575
|
+
type: "button",
|
|
3576
|
+
disabled: page >= totalPages - 1,
|
|
3577
|
+
onClick: () => setPage(page + 1),
|
|
3578
|
+
className: "inline-flex h-8 w-8 items-center justify-center rounded-storm-sm border border-storm-border text-sm text-storm-foreground hover:bg-storm-muted transition-colors disabled:pointer-events-none disabled:opacity-50",
|
|
3579
|
+
children: /* @__PURE__ */ jsx56(ChevronRight, { className: "h-3.5 w-3.5" })
|
|
3580
|
+
}
|
|
3581
|
+
)
|
|
3582
|
+
] })
|
|
3583
|
+
] })
|
|
3584
|
+
] });
|
|
3585
|
+
}
|
|
3586
|
+
var DataTable = forwardRef56(DataTableInner);
|
|
3587
|
+
DataTable.displayName = "DataTable";
|
|
3588
|
+
|
|
3589
|
+
// src/components/StormSidebar.tsx
|
|
3590
|
+
import { forwardRef as forwardRef57, useState as useState14, createContext as createContext5, useContext as useContext5 } from "react";
|
|
3591
|
+
import { jsx as jsx57, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3592
|
+
var SidebarContext = createContext5({
|
|
3593
|
+
collapsed: false,
|
|
3594
|
+
setCollapsed: () => {
|
|
3595
|
+
},
|
|
3596
|
+
toggle: () => {
|
|
3597
|
+
}
|
|
3598
|
+
});
|
|
3599
|
+
function useSidebar() {
|
|
3600
|
+
return useContext5(SidebarContext);
|
|
3601
|
+
}
|
|
3602
|
+
var SidebarProvider = forwardRef57(
|
|
3603
|
+
({ className, defaultCollapsed = false, children, ...props }, ref) => {
|
|
3604
|
+
const [collapsed, setCollapsed] = useState14(defaultCollapsed);
|
|
3605
|
+
const toggle = () => setCollapsed((v) => !v);
|
|
3606
|
+
return /* @__PURE__ */ jsx57(SidebarContext.Provider, { value: { collapsed, setCollapsed, toggle }, children: /* @__PURE__ */ jsx57("div", { ref, className: cn("flex min-h-screen", className), ...props, children }) });
|
|
3607
|
+
}
|
|
3608
|
+
);
|
|
3609
|
+
var StormSidebar = forwardRef57(
|
|
3610
|
+
({ className, side = "left", children, ...props }, ref) => {
|
|
3611
|
+
const { collapsed } = useSidebar();
|
|
3612
|
+
return /* @__PURE__ */ jsx57(
|
|
3613
|
+
"aside",
|
|
3614
|
+
{
|
|
3615
|
+
ref,
|
|
3616
|
+
"data-side": side,
|
|
3617
|
+
"data-collapsed": collapsed ? "" : void 0,
|
|
3618
|
+
className: cn(
|
|
3619
|
+
"flex flex-col border-storm-border bg-storm-background transition-[width] duration-200",
|
|
3620
|
+
side === "left" ? "border-r" : "border-l order-last",
|
|
3621
|
+
collapsed ? "w-16" : "w-64",
|
|
3622
|
+
className
|
|
3623
|
+
),
|
|
3624
|
+
...props,
|
|
3625
|
+
children
|
|
3626
|
+
}
|
|
3627
|
+
);
|
|
3628
|
+
}
|
|
3629
|
+
);
|
|
3630
|
+
var SidebarHeader = forwardRef57(
|
|
3631
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx57("div", { ref, className: cn("flex items-center h-14 px-4 border-b border-storm-border shrink-0", className), ...props })
|
|
3632
|
+
);
|
|
3633
|
+
var SidebarContent = forwardRef57(
|
|
3634
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx57("div", { ref, className: cn("flex-1 overflow-y-auto px-3 py-4 space-y-4", className), ...props })
|
|
3635
|
+
);
|
|
3636
|
+
var SidebarFooter = forwardRef57(
|
|
3637
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx57("div", { ref, className: cn("flex items-center px-4 py-3 border-t border-storm-border shrink-0", className), ...props })
|
|
3638
|
+
);
|
|
3639
|
+
var SidebarGroup = forwardRef57(
|
|
3640
|
+
({ className, label, children, ...props }, ref) => /* @__PURE__ */ jsxs21("div", { ref, className: cn("space-y-1", className), ...props, children: [
|
|
3641
|
+
label && /* @__PURE__ */ jsx57("p", { className: "px-3 mb-1 text-[11px] font-semibold uppercase tracking-wider text-storm-muted-foreground", children: label }),
|
|
3642
|
+
children
|
|
3643
|
+
] })
|
|
3644
|
+
);
|
|
3645
|
+
var SidebarItem = forwardRef57(
|
|
3646
|
+
({ className, active, icon, children, ...props }, ref) => {
|
|
3647
|
+
const { collapsed } = useSidebar();
|
|
3648
|
+
return /* @__PURE__ */ jsxs21(
|
|
3649
|
+
"div",
|
|
3650
|
+
{
|
|
3651
|
+
ref,
|
|
3652
|
+
"data-active": active ? "" : void 0,
|
|
3653
|
+
className: cn(
|
|
3654
|
+
"flex items-center gap-3 rounded-storm-sm px-3 py-2 text-sm cursor-pointer transition-colors",
|
|
3655
|
+
active ? "bg-storm-muted text-storm-foreground font-medium" : "text-storm-muted-foreground hover:text-storm-foreground hover:bg-storm-muted/50",
|
|
3656
|
+
collapsed && "justify-center px-0",
|
|
3657
|
+
className
|
|
3658
|
+
),
|
|
3659
|
+
...props,
|
|
3660
|
+
children: [
|
|
3661
|
+
icon && /* @__PURE__ */ jsx57("span", { className: "shrink-0", children: icon }),
|
|
3662
|
+
!collapsed && /* @__PURE__ */ jsx57("span", { className: "truncate", children })
|
|
3663
|
+
]
|
|
3664
|
+
}
|
|
3665
|
+
);
|
|
3666
|
+
}
|
|
3667
|
+
);
|
|
3668
|
+
var SidebarTrigger = forwardRef57(
|
|
3669
|
+
({ className, ...props }, ref) => {
|
|
3670
|
+
const { toggle } = useSidebar();
|
|
3671
|
+
return /* @__PURE__ */ jsx57(
|
|
3672
|
+
"button",
|
|
3673
|
+
{
|
|
3674
|
+
ref,
|
|
3675
|
+
type: "button",
|
|
3676
|
+
onClick: toggle,
|
|
3677
|
+
className: cn(
|
|
3678
|
+
"inline-flex h-8 w-8 items-center justify-center rounded-storm-sm border border-storm-border text-storm-foreground hover:bg-storm-muted transition-colors",
|
|
3679
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
3680
|
+
className
|
|
3681
|
+
),
|
|
3682
|
+
...props,
|
|
3683
|
+
children: /* @__PURE__ */ jsxs21("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3684
|
+
/* @__PURE__ */ jsx57("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
|
3685
|
+
/* @__PURE__ */ jsx57("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
|
3686
|
+
/* @__PURE__ */ jsx57("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
|
3687
|
+
] })
|
|
3688
|
+
}
|
|
3689
|
+
);
|
|
3690
|
+
}
|
|
3691
|
+
);
|
|
3692
|
+
SidebarProvider.displayName = "SidebarProvider";
|
|
3693
|
+
StormSidebar.displayName = "StormSidebar";
|
|
3694
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
3695
|
+
SidebarContent.displayName = "SidebarContent";
|
|
3696
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
3697
|
+
SidebarGroup.displayName = "SidebarGroup";
|
|
3698
|
+
SidebarItem.displayName = "SidebarItem";
|
|
3699
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
3700
|
+
|
|
3701
|
+
// src/components/Sonner.tsx
|
|
3702
|
+
import { forwardRef as forwardRef58, useState as useState15, useEffect as useEffect8, useCallback as useCallback4, createContext as createContext6, useContext as useContext6 } from "react";
|
|
3703
|
+
import { jsx as jsx58, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3704
|
+
var SonnerContext = createContext6({
|
|
3705
|
+
toasts: [],
|
|
3706
|
+
addToast: () => "",
|
|
3707
|
+
removeToast: () => {
|
|
3708
|
+
}
|
|
3709
|
+
});
|
|
3710
|
+
function useSonner() {
|
|
3711
|
+
return useContext6(SonnerContext);
|
|
3712
|
+
}
|
|
3713
|
+
var globalId = 0;
|
|
3714
|
+
function SonnerProvider({ children }) {
|
|
3715
|
+
const [toasts, setToasts] = useState15([]);
|
|
3716
|
+
const addToast = useCallback4((toast) => {
|
|
3717
|
+
const id = `sonner-${++globalId}`;
|
|
3718
|
+
setToasts((prev) => [...prev, { ...toast, id }]);
|
|
3719
|
+
return id;
|
|
3720
|
+
}, []);
|
|
3721
|
+
const removeToast = useCallback4((id) => {
|
|
3722
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
3723
|
+
}, []);
|
|
3724
|
+
return /* @__PURE__ */ jsx58(SonnerContext.Provider, { value: { toasts, addToast, removeToast }, children });
|
|
3725
|
+
}
|
|
3726
|
+
var variantStyles9 = {
|
|
3727
|
+
default: "border-storm-border bg-storm-background text-storm-foreground",
|
|
3728
|
+
success: "border-green-500/30 bg-green-500/10 text-storm-foreground",
|
|
3729
|
+
error: "border-storm-destructive/30 bg-storm-destructive/10 text-storm-foreground",
|
|
3730
|
+
warning: "border-amber-500/30 bg-amber-500/10 text-storm-foreground",
|
|
3731
|
+
info: "border-blue-500/30 bg-blue-500/10 text-storm-foreground"
|
|
3732
|
+
};
|
|
3733
|
+
var positionStyles = {
|
|
3734
|
+
"top-left": "top-4 left-4",
|
|
3735
|
+
"top-right": "top-4 right-4",
|
|
3736
|
+
"top-center": "top-4 left-1/2 -translate-x-1/2",
|
|
3737
|
+
"bottom-left": "bottom-4 left-4",
|
|
3738
|
+
"bottom-right": "bottom-4 right-4",
|
|
3739
|
+
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2"
|
|
3740
|
+
};
|
|
3741
|
+
var SonnerToaster = forwardRef58(
|
|
3742
|
+
({ className, position = "bottom-right", ...props }, ref) => {
|
|
3743
|
+
const { toasts, removeToast } = useSonner();
|
|
3744
|
+
return /* @__PURE__ */ jsx58(
|
|
3745
|
+
"div",
|
|
3746
|
+
{
|
|
3747
|
+
ref,
|
|
3748
|
+
className: cn("fixed z-[100] flex flex-col gap-2 w-[356px] max-w-[calc(100vw-2rem)]", positionStyles[position], className),
|
|
3749
|
+
...props,
|
|
3750
|
+
children: toasts.map((toast) => /* @__PURE__ */ jsx58(SonnerToastItem, { toast, onDismiss: () => removeToast(toast.id) }, toast.id))
|
|
3751
|
+
}
|
|
3752
|
+
);
|
|
3753
|
+
}
|
|
3754
|
+
);
|
|
3755
|
+
function SonnerToastItem({ toast, onDismiss }) {
|
|
3756
|
+
useEffect8(() => {
|
|
3757
|
+
const duration = toast.duration ?? 4e3;
|
|
3758
|
+
const timer = setTimeout(onDismiss, duration);
|
|
3759
|
+
return () => clearTimeout(timer);
|
|
3760
|
+
}, [toast.duration, onDismiss]);
|
|
3761
|
+
return /* @__PURE__ */ jsxs22(
|
|
3762
|
+
"div",
|
|
3763
|
+
{
|
|
3764
|
+
className: cn(
|
|
3765
|
+
"flex items-start gap-3 rounded-storm-md border p-4 animate-in slide-in-from-right-full fade-in-0",
|
|
3766
|
+
variantStyles9[toast.variant ?? "default"]
|
|
3767
|
+
),
|
|
3768
|
+
children: [
|
|
3769
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex-1 min-w-0", children: [
|
|
3770
|
+
toast.title && /* @__PURE__ */ jsx58("p", { className: "text-sm font-semibold", children: toast.title }),
|
|
3771
|
+
toast.description && /* @__PURE__ */ jsx58("p", { className: "text-sm text-storm-muted-foreground mt-0.5", children: toast.description })
|
|
3772
|
+
] }),
|
|
3773
|
+
toast.action && /* @__PURE__ */ jsx58(
|
|
3774
|
+
"button",
|
|
3775
|
+
{
|
|
3776
|
+
type: "button",
|
|
3777
|
+
onClick: () => {
|
|
3778
|
+
toast.action?.onClick();
|
|
3779
|
+
onDismiss();
|
|
3780
|
+
},
|
|
3781
|
+
className: "shrink-0 text-sm font-medium text-storm-primary hover:text-storm-primary/80 transition-colors",
|
|
3782
|
+
children: toast.action.label
|
|
3783
|
+
}
|
|
3784
|
+
),
|
|
3785
|
+
/* @__PURE__ */ jsx58(
|
|
3786
|
+
"button",
|
|
3787
|
+
{
|
|
3788
|
+
type: "button",
|
|
3789
|
+
onClick: onDismiss,
|
|
3790
|
+
className: "shrink-0 text-storm-muted-foreground hover:text-storm-foreground transition-colors",
|
|
3791
|
+
children: /* @__PURE__ */ jsxs22("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3792
|
+
/* @__PURE__ */ jsx58("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
3793
|
+
/* @__PURE__ */ jsx58("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
3794
|
+
] })
|
|
3795
|
+
}
|
|
3796
|
+
)
|
|
3797
|
+
]
|
|
3798
|
+
}
|
|
3799
|
+
);
|
|
3800
|
+
}
|
|
3801
|
+
SonnerProvider.displayName = "SonnerProvider";
|
|
3802
|
+
SonnerToaster.displayName = "SonnerToaster";
|
|
3803
|
+
export {
|
|
3804
|
+
Accordion,
|
|
3805
|
+
AccordionContent,
|
|
3806
|
+
AccordionItem,
|
|
3807
|
+
AccordionTrigger,
|
|
3808
|
+
Alert,
|
|
3809
|
+
AlertDescription,
|
|
3810
|
+
AlertDialog,
|
|
3811
|
+
AlertDialogAction,
|
|
3812
|
+
AlertDialogCancel,
|
|
3813
|
+
AlertDialogContent,
|
|
3814
|
+
AlertDialogDescription,
|
|
3815
|
+
AlertDialogFooter,
|
|
3816
|
+
AlertDialogHeader,
|
|
3817
|
+
AlertDialogTitle,
|
|
3818
|
+
AlertTitle,
|
|
3819
|
+
AspectRatio,
|
|
3820
|
+
Avatar,
|
|
3821
|
+
AvatarGroup,
|
|
3822
|
+
Badge,
|
|
3823
|
+
Breadcrumb,
|
|
3824
|
+
BreadcrumbEllipsis,
|
|
3825
|
+
BreadcrumbItem,
|
|
3826
|
+
BreadcrumbSeparator,
|
|
3827
|
+
Button,
|
|
3828
|
+
ButtonGroup,
|
|
3829
|
+
Calendar,
|
|
3830
|
+
Card,
|
|
3831
|
+
CardBody,
|
|
3832
|
+
CardDescription,
|
|
3833
|
+
CardFooter,
|
|
3834
|
+
CardHeader,
|
|
3835
|
+
CardImage,
|
|
3836
|
+
CardTitle,
|
|
3837
|
+
Carousel,
|
|
3838
|
+
CarouselContent,
|
|
3839
|
+
CarouselItem,
|
|
3840
|
+
CarouselNext,
|
|
3841
|
+
CarouselPrevious,
|
|
3842
|
+
Checkbox,
|
|
3843
|
+
Collapsible,
|
|
3844
|
+
CollapsibleContent,
|
|
3845
|
+
CollapsibleTrigger,
|
|
3846
|
+
Combobox,
|
|
3847
|
+
Command,
|
|
3848
|
+
CommandDialog,
|
|
3849
|
+
CommandEmpty,
|
|
3850
|
+
CommandGroup,
|
|
3851
|
+
CommandInput,
|
|
3852
|
+
CommandItem,
|
|
3853
|
+
CommandList,
|
|
3854
|
+
CommandSeparator,
|
|
3855
|
+
CommandShortcut,
|
|
3856
|
+
ContextMenu,
|
|
3857
|
+
ContextMenuContent,
|
|
3858
|
+
ContextMenuItem,
|
|
3859
|
+
ContextMenuLabel,
|
|
3860
|
+
ContextMenuSeparator,
|
|
3861
|
+
DataTable,
|
|
3862
|
+
DatePicker,
|
|
3863
|
+
Dialog,
|
|
3864
|
+
DialogClose,
|
|
3865
|
+
DialogContent,
|
|
3866
|
+
DialogDescription,
|
|
3867
|
+
DialogFooter,
|
|
3868
|
+
DialogHeader,
|
|
3869
|
+
DialogTitle,
|
|
3870
|
+
DirectionProvider,
|
|
3871
|
+
Drawer,
|
|
3872
|
+
DrawerClose,
|
|
3873
|
+
DrawerContent,
|
|
3874
|
+
DrawerDescription,
|
|
3875
|
+
DrawerFooter,
|
|
3876
|
+
DrawerHeader,
|
|
3877
|
+
DrawerTitle,
|
|
3878
|
+
DropdownMenu,
|
|
3879
|
+
DropdownMenuContent,
|
|
3880
|
+
DropdownMenuItem,
|
|
3881
|
+
DropdownMenuLabel,
|
|
3882
|
+
DropdownMenuSeparator,
|
|
3883
|
+
DropdownMenuTrigger,
|
|
3884
|
+
Empty,
|
|
3885
|
+
Field,
|
|
3886
|
+
HoverCard,
|
|
3887
|
+
HoverCardContent,
|
|
3888
|
+
HoverCardTrigger,
|
|
3889
|
+
Input,
|
|
3890
|
+
InputGroup,
|
|
3891
|
+
InputGroupAddon,
|
|
3892
|
+
InputOTP,
|
|
3893
|
+
InputOTPSeparator,
|
|
3894
|
+
Item,
|
|
3895
|
+
Kbd,
|
|
3896
|
+
Label,
|
|
3897
|
+
Menubar,
|
|
3898
|
+
MenubarContent,
|
|
3899
|
+
MenubarItem,
|
|
3900
|
+
MenubarMenu,
|
|
3901
|
+
MenubarSeparator,
|
|
3902
|
+
MenubarShortcut,
|
|
3903
|
+
MenubarTrigger,
|
|
3904
|
+
NativeSelect,
|
|
3905
|
+
NavigationMenu,
|
|
3906
|
+
NavigationMenuItem,
|
|
3907
|
+
NavigationMenuLink,
|
|
3908
|
+
Pagination,
|
|
3909
|
+
PaginationEllipsis,
|
|
3910
|
+
PaginationItem,
|
|
3911
|
+
PaginationNext,
|
|
3912
|
+
PaginationPrevious,
|
|
3913
|
+
Popover,
|
|
3914
|
+
PopoverContent,
|
|
3915
|
+
PopoverTrigger,
|
|
3916
|
+
Progress,
|
|
3917
|
+
RadioGroup,
|
|
3918
|
+
RadioGroupItem,
|
|
3919
|
+
ResizableHandle,
|
|
3920
|
+
ResizablePanel,
|
|
3921
|
+
ResizablePanelGroup,
|
|
3922
|
+
ScrollArea,
|
|
3923
|
+
Select,
|
|
3924
|
+
Separator,
|
|
3925
|
+
Sheet,
|
|
3926
|
+
SheetClose,
|
|
3927
|
+
SheetContent,
|
|
3928
|
+
SheetDescription,
|
|
3929
|
+
SheetFooter,
|
|
3930
|
+
SheetHeader,
|
|
3931
|
+
SheetTitle,
|
|
3932
|
+
SidebarContent,
|
|
3933
|
+
SidebarFooter,
|
|
3934
|
+
SidebarGroup,
|
|
3935
|
+
SidebarHeader,
|
|
3936
|
+
SidebarItem,
|
|
3937
|
+
SidebarProvider,
|
|
3938
|
+
SidebarTrigger,
|
|
3939
|
+
Skeleton,
|
|
3940
|
+
Slider,
|
|
3941
|
+
SonnerProvider,
|
|
3942
|
+
SonnerToaster,
|
|
3943
|
+
Spinner,
|
|
3944
|
+
StormSidebar,
|
|
3945
|
+
Switch,
|
|
3946
|
+
Table,
|
|
3947
|
+
TableBody,
|
|
3948
|
+
TableCaption,
|
|
3949
|
+
TableCell,
|
|
3950
|
+
TableFooter,
|
|
3951
|
+
TableHead,
|
|
3952
|
+
TableHeader,
|
|
3953
|
+
TableRow,
|
|
3954
|
+
Tabs,
|
|
3955
|
+
TabsContent,
|
|
3956
|
+
TabsList,
|
|
3957
|
+
TabsTrigger,
|
|
3958
|
+
Textarea,
|
|
3959
|
+
Toast,
|
|
3960
|
+
ToastAction,
|
|
3961
|
+
ToastClose,
|
|
3962
|
+
ToastDescription,
|
|
3963
|
+
ToastTitle,
|
|
3964
|
+
Toggle,
|
|
3965
|
+
ToggleGroup,
|
|
3966
|
+
ToggleGroupItem,
|
|
3967
|
+
Tooltip,
|
|
3968
|
+
TooltipContent,
|
|
3969
|
+
TooltipTrigger,
|
|
3970
|
+
TypographyBlockquote,
|
|
3971
|
+
TypographyH1,
|
|
3972
|
+
TypographyH2,
|
|
3973
|
+
TypographyH3,
|
|
3974
|
+
TypographyH4,
|
|
3975
|
+
TypographyInlineCode,
|
|
3976
|
+
TypographyLarge,
|
|
3977
|
+
TypographyLead,
|
|
3978
|
+
TypographyList,
|
|
3979
|
+
TypographyMuted,
|
|
3980
|
+
TypographyP,
|
|
3981
|
+
TypographySmall,
|
|
3982
|
+
cn,
|
|
3983
|
+
useDirection,
|
|
3984
|
+
useSidebar,
|
|
3985
|
+
useSonner
|
|
3986
|
+
};
|
|
3987
|
+
//# sourceMappingURL=index.mjs.map
|