@onesaz/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/README.md +117 -0
- package/dist/index.d.ts +191 -0
- package/dist/index.js +1204 -0
- package/dist/index.js.map +1 -0
- package/package.json +74 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1204 @@
|
|
|
1
|
+
// src/theme/provider.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import {
|
|
4
|
+
accentColors,
|
|
5
|
+
grayColors,
|
|
6
|
+
radiusPresets,
|
|
7
|
+
lightTheme,
|
|
8
|
+
darkTheme
|
|
9
|
+
} from "@onesaz/tokens";
|
|
10
|
+
|
|
11
|
+
// src/theme/context.ts
|
|
12
|
+
import { createContext } from "react";
|
|
13
|
+
var ThemeContext = createContext(void 0);
|
|
14
|
+
|
|
15
|
+
// src/theme/provider.tsx
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
function getSystemTheme() {
|
|
18
|
+
if (typeof window === "undefined") return "light";
|
|
19
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
20
|
+
}
|
|
21
|
+
function ThemeProvider({
|
|
22
|
+
children,
|
|
23
|
+
defaultTheme = "system",
|
|
24
|
+
accentColor: defaultAccent = "purple",
|
|
25
|
+
grayColor: defaultGray = "slate",
|
|
26
|
+
radius: defaultRadius = "medium",
|
|
27
|
+
storageKey = "onesaz-theme"
|
|
28
|
+
}) {
|
|
29
|
+
const [theme, setThemeState] = React.useState(() => {
|
|
30
|
+
if (typeof window === "undefined") return defaultTheme;
|
|
31
|
+
const stored = localStorage.getItem(`${storageKey}-mode`);
|
|
32
|
+
return stored || defaultTheme;
|
|
33
|
+
});
|
|
34
|
+
const [accentColor, setAccentColorState] = React.useState(() => {
|
|
35
|
+
if (typeof window === "undefined") return defaultAccent;
|
|
36
|
+
const stored = localStorage.getItem(`${storageKey}-accent`);
|
|
37
|
+
return stored || defaultAccent;
|
|
38
|
+
});
|
|
39
|
+
const [grayColor, setGrayColorState] = React.useState(() => {
|
|
40
|
+
if (typeof window === "undefined") return defaultGray;
|
|
41
|
+
const stored = localStorage.getItem(`${storageKey}-gray`);
|
|
42
|
+
return stored || defaultGray;
|
|
43
|
+
});
|
|
44
|
+
const [radius, setRadiusState] = React.useState(() => {
|
|
45
|
+
if (typeof window === "undefined") return defaultRadius;
|
|
46
|
+
const stored = localStorage.getItem(`${storageKey}-radius`);
|
|
47
|
+
return stored || defaultRadius;
|
|
48
|
+
});
|
|
49
|
+
const [resolvedTheme, setResolvedTheme] = React.useState(
|
|
50
|
+
() => theme === "system" ? getSystemTheme() : theme
|
|
51
|
+
);
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
if (theme !== "system") {
|
|
54
|
+
setResolvedTheme(theme);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
58
|
+
setResolvedTheme(mediaQuery.matches ? "dark" : "light");
|
|
59
|
+
const handler = (e) => {
|
|
60
|
+
setResolvedTheme(e.matches ? "dark" : "light");
|
|
61
|
+
};
|
|
62
|
+
mediaQuery.addEventListener("change", handler);
|
|
63
|
+
return () => mediaQuery.removeEventListener("change", handler);
|
|
64
|
+
}, [theme]);
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
const root = document.documentElement;
|
|
67
|
+
const themeTokens = resolvedTheme === "dark" ? darkTheme : lightTheme;
|
|
68
|
+
const accent = accentColors[accentColor];
|
|
69
|
+
const gray = grayColors[grayColor];
|
|
70
|
+
const radiusValues = radiusPresets[radius];
|
|
71
|
+
root.setAttribute("data-theme", resolvedTheme);
|
|
72
|
+
root.setAttribute("data-accent", accentColor);
|
|
73
|
+
root.style.setProperty("--background", gray[themeTokens.background]);
|
|
74
|
+
root.style.setProperty("--foreground", gray[themeTokens.foreground]);
|
|
75
|
+
root.style.setProperty("--card", gray[themeTokens.card]);
|
|
76
|
+
root.style.setProperty("--card-foreground", gray[themeTokens.cardForeground]);
|
|
77
|
+
root.style.setProperty("--popover", gray[themeTokens.popover]);
|
|
78
|
+
root.style.setProperty("--popover-foreground", gray[themeTokens.popoverForeground]);
|
|
79
|
+
root.style.setProperty("--muted", gray[themeTokens.muted]);
|
|
80
|
+
root.style.setProperty("--muted-foreground", gray[themeTokens.mutedForeground]);
|
|
81
|
+
root.style.setProperty("--border", gray[themeTokens.border]);
|
|
82
|
+
root.style.setProperty("--input", gray[themeTokens.input]);
|
|
83
|
+
root.style.setProperty("--accent", accent[6]);
|
|
84
|
+
root.style.setProperty("--accent-foreground", "#ffffff");
|
|
85
|
+
root.style.setProperty("--accent-hover", accent[7]);
|
|
86
|
+
root.style.setProperty("--ring", accent[6]);
|
|
87
|
+
Object.entries(accent).forEach(([step, value2]) => {
|
|
88
|
+
root.style.setProperty(`--accent-${step}`, value2);
|
|
89
|
+
});
|
|
90
|
+
root.style.setProperty("--destructive", resolvedTheme === "dark" ? "#ef4444" : "#dc2626");
|
|
91
|
+
root.style.setProperty("--destructive-foreground", "#ffffff");
|
|
92
|
+
root.style.setProperty("--radius", radiusValues.md);
|
|
93
|
+
root.style.setProperty("--radius-sm", radiusValues.sm);
|
|
94
|
+
root.style.setProperty("--radius-lg", radiusValues.lg);
|
|
95
|
+
}, [resolvedTheme, accentColor, grayColor, radius]);
|
|
96
|
+
const setTheme = React.useCallback((newTheme) => {
|
|
97
|
+
localStorage.setItem(`${storageKey}-mode`, newTheme);
|
|
98
|
+
setThemeState(newTheme);
|
|
99
|
+
}, [storageKey]);
|
|
100
|
+
const setAccentColor = React.useCallback((color) => {
|
|
101
|
+
localStorage.setItem(`${storageKey}-accent`, color);
|
|
102
|
+
setAccentColorState(color);
|
|
103
|
+
}, [storageKey]);
|
|
104
|
+
const setGrayColor = React.useCallback((color) => {
|
|
105
|
+
localStorage.setItem(`${storageKey}-gray`, color);
|
|
106
|
+
setGrayColorState(color);
|
|
107
|
+
}, [storageKey]);
|
|
108
|
+
const setRadius = React.useCallback((newRadius) => {
|
|
109
|
+
localStorage.setItem(`${storageKey}-radius`, newRadius);
|
|
110
|
+
setRadiusState(newRadius);
|
|
111
|
+
}, [storageKey]);
|
|
112
|
+
const value = React.useMemo(
|
|
113
|
+
() => ({
|
|
114
|
+
theme,
|
|
115
|
+
resolvedTheme,
|
|
116
|
+
accentColor,
|
|
117
|
+
grayColor,
|
|
118
|
+
radius,
|
|
119
|
+
setTheme,
|
|
120
|
+
setAccentColor,
|
|
121
|
+
setGrayColor,
|
|
122
|
+
setRadius
|
|
123
|
+
}),
|
|
124
|
+
[theme, resolvedTheme, accentColor, grayColor, radius, setTheme, setAccentColor, setGrayColor, setRadius]
|
|
125
|
+
);
|
|
126
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
|
|
127
|
+
}
|
|
128
|
+
ThemeProvider.displayName = "ThemeProvider";
|
|
129
|
+
|
|
130
|
+
// src/theme/use-theme.ts
|
|
131
|
+
import { useContext } from "react";
|
|
132
|
+
function useTheme() {
|
|
133
|
+
const context = useContext(ThemeContext);
|
|
134
|
+
if (!context) {
|
|
135
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
136
|
+
}
|
|
137
|
+
return context;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// src/utils/cn.ts
|
|
141
|
+
import { clsx } from "clsx";
|
|
142
|
+
import { twMerge } from "tailwind-merge";
|
|
143
|
+
function cn(...inputs) {
|
|
144
|
+
return twMerge(clsx(inputs));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// src/components/button.tsx
|
|
148
|
+
import * as React2 from "react";
|
|
149
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
150
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
151
|
+
var Button = React2.forwardRef(
|
|
152
|
+
({ className, variant = "default", size = "default", asChild = false, ...props }, ref) => {
|
|
153
|
+
const Comp = asChild ? Slot : "button";
|
|
154
|
+
return /* @__PURE__ */ jsx2(
|
|
155
|
+
Comp,
|
|
156
|
+
{
|
|
157
|
+
className: cn(
|
|
158
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-[var(--radius)] text-sm font-medium transition-colors",
|
|
159
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2",
|
|
160
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
161
|
+
{
|
|
162
|
+
"bg-[var(--accent)] text-[var(--accent-foreground)] hover:bg-[var(--accent-hover)]": variant === "default",
|
|
163
|
+
"bg-[var(--destructive)] text-[var(--destructive-foreground)] hover:bg-[var(--destructive)]/90": variant === "destructive",
|
|
164
|
+
"border border-[var(--input)] bg-[var(--background)] hover:bg-[var(--muted)] hover:text-[var(--foreground)]": variant === "outline",
|
|
165
|
+
"bg-[var(--muted)] text-[var(--foreground)] hover:bg-[var(--muted)]/80": variant === "secondary",
|
|
166
|
+
"hover:bg-[var(--muted)] hover:text-[var(--foreground)]": variant === "ghost",
|
|
167
|
+
"text-[var(--accent)] underline-offset-4 hover:underline": variant === "link"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"h-10 px-4 py-2": size === "default",
|
|
171
|
+
"h-9 rounded-[var(--radius)] px-3": size === "sm",
|
|
172
|
+
"h-11 rounded-[var(--radius)] px-8": size === "lg",
|
|
173
|
+
"h-10 w-10": size === "icon"
|
|
174
|
+
},
|
|
175
|
+
className
|
|
176
|
+
),
|
|
177
|
+
ref,
|
|
178
|
+
...props
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
Button.displayName = "Button";
|
|
184
|
+
|
|
185
|
+
// src/components/input.tsx
|
|
186
|
+
import * as React3 from "react";
|
|
187
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
188
|
+
var Input = React3.forwardRef(
|
|
189
|
+
({ className, type, ...props }, ref) => {
|
|
190
|
+
return /* @__PURE__ */ jsx3(
|
|
191
|
+
"input",
|
|
192
|
+
{
|
|
193
|
+
type,
|
|
194
|
+
className: cn(
|
|
195
|
+
"flex h-10 w-full rounded-[var(--radius)] border border-[var(--input)] bg-[var(--background)] px-3 py-2 text-sm",
|
|
196
|
+
"ring-offset-[var(--background)] file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
197
|
+
"placeholder:text-[var(--muted-foreground)]",
|
|
198
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2",
|
|
199
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
200
|
+
className
|
|
201
|
+
),
|
|
202
|
+
ref,
|
|
203
|
+
...props
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
Input.displayName = "Input";
|
|
209
|
+
|
|
210
|
+
// src/components/textarea.tsx
|
|
211
|
+
import * as React4 from "react";
|
|
212
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
213
|
+
var Textarea = React4.forwardRef(
|
|
214
|
+
({ className, ...props }, ref) => {
|
|
215
|
+
return /* @__PURE__ */ jsx4(
|
|
216
|
+
"textarea",
|
|
217
|
+
{
|
|
218
|
+
className: cn(
|
|
219
|
+
"flex min-h-[80px] w-full rounded-[var(--radius)] border border-[var(--input)] bg-[var(--background)] px-3 py-2 text-sm",
|
|
220
|
+
"ring-offset-[var(--background)]",
|
|
221
|
+
"placeholder:text-[var(--muted-foreground)]",
|
|
222
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2",
|
|
223
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
224
|
+
className
|
|
225
|
+
),
|
|
226
|
+
ref,
|
|
227
|
+
...props
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
Textarea.displayName = "Textarea";
|
|
233
|
+
|
|
234
|
+
// src/components/card.tsx
|
|
235
|
+
import * as React5 from "react";
|
|
236
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
237
|
+
var Card = React5.forwardRef(
|
|
238
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
ref,
|
|
242
|
+
className: cn(
|
|
243
|
+
"rounded-[var(--radius-lg)] border border-[var(--border)] bg-[var(--card)] text-[var(--card-foreground)] shadow-sm",
|
|
244
|
+
className
|
|
245
|
+
),
|
|
246
|
+
...props
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
);
|
|
250
|
+
Card.displayName = "Card";
|
|
251
|
+
var CardHeader = React5.forwardRef(
|
|
252
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
ref,
|
|
256
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
257
|
+
...props
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
);
|
|
261
|
+
CardHeader.displayName = "CardHeader";
|
|
262
|
+
var CardTitle = React5.forwardRef(
|
|
263
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
264
|
+
"h3",
|
|
265
|
+
{
|
|
266
|
+
ref,
|
|
267
|
+
className: cn("text-2xl font-semibold leading-none tracking-tight", className),
|
|
268
|
+
...props
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
);
|
|
272
|
+
CardTitle.displayName = "CardTitle";
|
|
273
|
+
var CardDescription = React5.forwardRef(
|
|
274
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
275
|
+
"p",
|
|
276
|
+
{
|
|
277
|
+
ref,
|
|
278
|
+
className: cn("text-sm text-[var(--muted-foreground)]", className),
|
|
279
|
+
...props
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
);
|
|
283
|
+
CardDescription.displayName = "CardDescription";
|
|
284
|
+
var CardContent = React5.forwardRef(
|
|
285
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx5("div", { ref, className: cn("p-6 pt-0", className), ...props })
|
|
286
|
+
);
|
|
287
|
+
CardContent.displayName = "CardContent";
|
|
288
|
+
var CardFooter = React5.forwardRef(
|
|
289
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
290
|
+
"div",
|
|
291
|
+
{
|
|
292
|
+
ref,
|
|
293
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
294
|
+
...props
|
|
295
|
+
}
|
|
296
|
+
)
|
|
297
|
+
);
|
|
298
|
+
CardFooter.displayName = "CardFooter";
|
|
299
|
+
|
|
300
|
+
// src/components/badge.tsx
|
|
301
|
+
import * as React6 from "react";
|
|
302
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
303
|
+
var Badge = React6.forwardRef(
|
|
304
|
+
({ className, variant = "default", ...props }, ref) => {
|
|
305
|
+
return /* @__PURE__ */ jsx6(
|
|
306
|
+
"div",
|
|
307
|
+
{
|
|
308
|
+
ref,
|
|
309
|
+
className: cn(
|
|
310
|
+
"inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",
|
|
311
|
+
"focus:outline-none focus:ring-2 focus:ring-[var(--ring)] focus:ring-offset-2",
|
|
312
|
+
{
|
|
313
|
+
"border-transparent bg-[var(--accent)] text-[var(--accent-foreground)]": variant === "default",
|
|
314
|
+
"border-transparent bg-[var(--muted)] text-[var(--foreground)]": variant === "secondary",
|
|
315
|
+
"border-transparent bg-[var(--destructive)] text-[var(--destructive-foreground)]": variant === "destructive",
|
|
316
|
+
"border border-[var(--border)] text-[var(--foreground)]": variant === "outline"
|
|
317
|
+
},
|
|
318
|
+
className
|
|
319
|
+
),
|
|
320
|
+
...props
|
|
321
|
+
}
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
Badge.displayName = "Badge";
|
|
326
|
+
|
|
327
|
+
// src/components/label.tsx
|
|
328
|
+
import * as React7 from "react";
|
|
329
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
330
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
331
|
+
var Label = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
332
|
+
LabelPrimitive.Root,
|
|
333
|
+
{
|
|
334
|
+
ref,
|
|
335
|
+
className: cn(
|
|
336
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
337
|
+
className
|
|
338
|
+
),
|
|
339
|
+
...props
|
|
340
|
+
}
|
|
341
|
+
));
|
|
342
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
343
|
+
|
|
344
|
+
// src/components/checkbox.tsx
|
|
345
|
+
import * as React8 from "react";
|
|
346
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
347
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
348
|
+
var Checkbox = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
349
|
+
CheckboxPrimitive.Root,
|
|
350
|
+
{
|
|
351
|
+
ref,
|
|
352
|
+
className: cn(
|
|
353
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-[var(--accent)]",
|
|
354
|
+
"ring-offset-[var(--background)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2",
|
|
355
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
356
|
+
"data-[state=checked]:bg-[var(--accent)] data-[state=checked]:text-[var(--accent-foreground)]",
|
|
357
|
+
className
|
|
358
|
+
),
|
|
359
|
+
...props,
|
|
360
|
+
children: /* @__PURE__ */ jsx8(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: /* @__PURE__ */ jsx8(
|
|
361
|
+
"svg",
|
|
362
|
+
{
|
|
363
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
364
|
+
viewBox: "0 0 24 24",
|
|
365
|
+
fill: "none",
|
|
366
|
+
stroke: "currentColor",
|
|
367
|
+
strokeWidth: "3",
|
|
368
|
+
strokeLinecap: "round",
|
|
369
|
+
strokeLinejoin: "round",
|
|
370
|
+
className: "h-3 w-3",
|
|
371
|
+
children: /* @__PURE__ */ jsx8("polyline", { points: "20 6 9 17 4 12" })
|
|
372
|
+
}
|
|
373
|
+
) })
|
|
374
|
+
}
|
|
375
|
+
));
|
|
376
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
377
|
+
|
|
378
|
+
// src/components/switch.tsx
|
|
379
|
+
import * as React9 from "react";
|
|
380
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
381
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
382
|
+
var Switch = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
383
|
+
SwitchPrimitives.Root,
|
|
384
|
+
{
|
|
385
|
+
className: cn(
|
|
386
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
|
|
387
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--background)]",
|
|
388
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
389
|
+
"data-[state=checked]:bg-[var(--accent)] data-[state=unchecked]:bg-[var(--input)]",
|
|
390
|
+
className
|
|
391
|
+
),
|
|
392
|
+
...props,
|
|
393
|
+
ref,
|
|
394
|
+
children: /* @__PURE__ */ jsx9(
|
|
395
|
+
SwitchPrimitives.Thumb,
|
|
396
|
+
{
|
|
397
|
+
className: cn(
|
|
398
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-[var(--background)] shadow-lg ring-0 transition-transform",
|
|
399
|
+
"data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
400
|
+
)
|
|
401
|
+
}
|
|
402
|
+
)
|
|
403
|
+
}
|
|
404
|
+
));
|
|
405
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
406
|
+
|
|
407
|
+
// src/components/separator.tsx
|
|
408
|
+
import * as React10 from "react";
|
|
409
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
410
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
411
|
+
var Separator = React10.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
412
|
+
SeparatorPrimitive.Root,
|
|
413
|
+
{
|
|
414
|
+
ref,
|
|
415
|
+
decorative,
|
|
416
|
+
orientation,
|
|
417
|
+
className: cn(
|
|
418
|
+
"shrink-0 bg-[var(--border)]",
|
|
419
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
420
|
+
className
|
|
421
|
+
),
|
|
422
|
+
...props
|
|
423
|
+
}
|
|
424
|
+
));
|
|
425
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
426
|
+
|
|
427
|
+
// src/components/select/index.tsx
|
|
428
|
+
import * as React11 from "react";
|
|
429
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
430
|
+
import { jsx as jsx11, jsxs } from "react/jsx-runtime";
|
|
431
|
+
var Select = SelectPrimitive.Root;
|
|
432
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
433
|
+
var SelectValue = SelectPrimitive.Value;
|
|
434
|
+
var SelectTrigger = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
435
|
+
SelectPrimitive.Trigger,
|
|
436
|
+
{
|
|
437
|
+
ref,
|
|
438
|
+
className: cn(
|
|
439
|
+
"flex h-10 w-full items-center justify-between rounded-[var(--radius)] border border-[var(--input)] bg-[var(--background)] px-3 py-2 text-sm",
|
|
440
|
+
"ring-offset-[var(--background)] placeholder:text-[var(--muted-foreground)]",
|
|
441
|
+
"focus:outline-none focus:ring-2 focus:ring-[var(--ring)] focus:ring-offset-2",
|
|
442
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
443
|
+
"[&>span]:line-clamp-1",
|
|
444
|
+
className
|
|
445
|
+
),
|
|
446
|
+
...props,
|
|
447
|
+
children: [
|
|
448
|
+
children,
|
|
449
|
+
/* @__PURE__ */ jsx11(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx11(
|
|
450
|
+
"svg",
|
|
451
|
+
{
|
|
452
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
453
|
+
width: "24",
|
|
454
|
+
height: "24",
|
|
455
|
+
viewBox: "0 0 24 24",
|
|
456
|
+
fill: "none",
|
|
457
|
+
stroke: "currentColor",
|
|
458
|
+
strokeWidth: "2",
|
|
459
|
+
strokeLinecap: "round",
|
|
460
|
+
strokeLinejoin: "round",
|
|
461
|
+
className: "h-4 w-4 opacity-50",
|
|
462
|
+
children: /* @__PURE__ */ jsx11("path", { d: "m6 9 6 6 6-6" })
|
|
463
|
+
}
|
|
464
|
+
) })
|
|
465
|
+
]
|
|
466
|
+
}
|
|
467
|
+
));
|
|
468
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
469
|
+
var SelectScrollUpButton = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
470
|
+
SelectPrimitive.ScrollUpButton,
|
|
471
|
+
{
|
|
472
|
+
ref,
|
|
473
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
474
|
+
...props,
|
|
475
|
+
children: /* @__PURE__ */ jsx11(
|
|
476
|
+
"svg",
|
|
477
|
+
{
|
|
478
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
479
|
+
width: "24",
|
|
480
|
+
height: "24",
|
|
481
|
+
viewBox: "0 0 24 24",
|
|
482
|
+
fill: "none",
|
|
483
|
+
stroke: "currentColor",
|
|
484
|
+
strokeWidth: "2",
|
|
485
|
+
strokeLinecap: "round",
|
|
486
|
+
strokeLinejoin: "round",
|
|
487
|
+
className: "h-4 w-4",
|
|
488
|
+
children: /* @__PURE__ */ jsx11("path", { d: "m18 15-6-6-6 6" })
|
|
489
|
+
}
|
|
490
|
+
)
|
|
491
|
+
}
|
|
492
|
+
));
|
|
493
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
494
|
+
var SelectScrollDownButton = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
495
|
+
SelectPrimitive.ScrollDownButton,
|
|
496
|
+
{
|
|
497
|
+
ref,
|
|
498
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
499
|
+
...props,
|
|
500
|
+
children: /* @__PURE__ */ jsx11(
|
|
501
|
+
"svg",
|
|
502
|
+
{
|
|
503
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
504
|
+
width: "24",
|
|
505
|
+
height: "24",
|
|
506
|
+
viewBox: "0 0 24 24",
|
|
507
|
+
fill: "none",
|
|
508
|
+
stroke: "currentColor",
|
|
509
|
+
strokeWidth: "2",
|
|
510
|
+
strokeLinecap: "round",
|
|
511
|
+
strokeLinejoin: "round",
|
|
512
|
+
className: "h-4 w-4",
|
|
513
|
+
children: /* @__PURE__ */ jsx11("path", { d: "m6 9 6 6 6-6" })
|
|
514
|
+
}
|
|
515
|
+
)
|
|
516
|
+
}
|
|
517
|
+
));
|
|
518
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
519
|
+
var SelectContent = React11.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx11(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
520
|
+
SelectPrimitive.Content,
|
|
521
|
+
{
|
|
522
|
+
ref,
|
|
523
|
+
className: cn(
|
|
524
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-[var(--radius)] border border-[var(--border)] bg-[var(--popover)] text-[var(--popover-foreground)] shadow-md",
|
|
525
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
526
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
527
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
528
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
529
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
530
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
531
|
+
className
|
|
532
|
+
),
|
|
533
|
+
position,
|
|
534
|
+
...props,
|
|
535
|
+
children: [
|
|
536
|
+
/* @__PURE__ */ jsx11(SelectScrollUpButton, {}),
|
|
537
|
+
/* @__PURE__ */ jsx11(
|
|
538
|
+
SelectPrimitive.Viewport,
|
|
539
|
+
{
|
|
540
|
+
className: cn(
|
|
541
|
+
"p-1",
|
|
542
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
543
|
+
),
|
|
544
|
+
children
|
|
545
|
+
}
|
|
546
|
+
),
|
|
547
|
+
/* @__PURE__ */ jsx11(SelectScrollDownButton, {})
|
|
548
|
+
]
|
|
549
|
+
}
|
|
550
|
+
) }));
|
|
551
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
552
|
+
var SelectLabel = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
553
|
+
SelectPrimitive.Label,
|
|
554
|
+
{
|
|
555
|
+
ref,
|
|
556
|
+
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
557
|
+
...props
|
|
558
|
+
}
|
|
559
|
+
));
|
|
560
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
561
|
+
var SelectItem = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
562
|
+
SelectPrimitive.Item,
|
|
563
|
+
{
|
|
564
|
+
ref,
|
|
565
|
+
className: cn(
|
|
566
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
567
|
+
"focus:bg-[var(--muted)] focus:text-[var(--foreground)]",
|
|
568
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
569
|
+
className
|
|
570
|
+
),
|
|
571
|
+
...props,
|
|
572
|
+
children: [
|
|
573
|
+
/* @__PURE__ */ jsx11("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx11(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx11(
|
|
574
|
+
"svg",
|
|
575
|
+
{
|
|
576
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
577
|
+
width: "24",
|
|
578
|
+
height: "24",
|
|
579
|
+
viewBox: "0 0 24 24",
|
|
580
|
+
fill: "none",
|
|
581
|
+
stroke: "currentColor",
|
|
582
|
+
strokeWidth: "2",
|
|
583
|
+
strokeLinecap: "round",
|
|
584
|
+
strokeLinejoin: "round",
|
|
585
|
+
className: "h-4 w-4",
|
|
586
|
+
children: /* @__PURE__ */ jsx11("polyline", { points: "20 6 9 17 4 12" })
|
|
587
|
+
}
|
|
588
|
+
) }) }),
|
|
589
|
+
/* @__PURE__ */ jsx11(SelectPrimitive.ItemText, { children })
|
|
590
|
+
]
|
|
591
|
+
}
|
|
592
|
+
));
|
|
593
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
594
|
+
var SelectSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
595
|
+
SelectPrimitive.Separator,
|
|
596
|
+
{
|
|
597
|
+
ref,
|
|
598
|
+
className: cn("-mx-1 my-1 h-px bg-[var(--muted)]", className),
|
|
599
|
+
...props
|
|
600
|
+
}
|
|
601
|
+
));
|
|
602
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
603
|
+
var SelectNamespace = Object.assign(Select, {
|
|
604
|
+
Group: SelectGroup,
|
|
605
|
+
Value: SelectValue,
|
|
606
|
+
Trigger: SelectTrigger,
|
|
607
|
+
Content: SelectContent,
|
|
608
|
+
Label: SelectLabel,
|
|
609
|
+
Item: SelectItem,
|
|
610
|
+
Separator: SelectSeparator,
|
|
611
|
+
ScrollUpButton: SelectScrollUpButton,
|
|
612
|
+
ScrollDownButton: SelectScrollDownButton
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
// src/components/dialog/index.tsx
|
|
616
|
+
import * as React12 from "react";
|
|
617
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
618
|
+
import { jsx as jsx12, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
619
|
+
var Dialog = DialogPrimitive.Root;
|
|
620
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
621
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
622
|
+
var DialogClose = DialogPrimitive.Close;
|
|
623
|
+
var DialogOverlay = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
624
|
+
DialogPrimitive.Overlay,
|
|
625
|
+
{
|
|
626
|
+
ref,
|
|
627
|
+
className: cn(
|
|
628
|
+
"fixed inset-0 z-50 bg-black/80",
|
|
629
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
630
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
631
|
+
className
|
|
632
|
+
),
|
|
633
|
+
...props
|
|
634
|
+
}
|
|
635
|
+
));
|
|
636
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
637
|
+
var DialogContent = React12.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs2(DialogPortal, { children: [
|
|
638
|
+
/* @__PURE__ */ jsx12(DialogOverlay, {}),
|
|
639
|
+
/* @__PURE__ */ jsxs2(
|
|
640
|
+
DialogPrimitive.Content,
|
|
641
|
+
{
|
|
642
|
+
ref,
|
|
643
|
+
className: cn(
|
|
644
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-[var(--border)] bg-[var(--background)] p-6 shadow-lg duration-200",
|
|
645
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
646
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
647
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
648
|
+
"data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",
|
|
649
|
+
"data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
650
|
+
"sm:rounded-[var(--radius-lg)]",
|
|
651
|
+
className
|
|
652
|
+
),
|
|
653
|
+
...props,
|
|
654
|
+
children: [
|
|
655
|
+
children,
|
|
656
|
+
/* @__PURE__ */ jsxs2(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-[var(--background)] transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[var(--ring)] focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-[var(--accent)] data-[state=open]:text-[var(--muted-foreground)]", children: [
|
|
657
|
+
/* @__PURE__ */ jsxs2(
|
|
658
|
+
"svg",
|
|
659
|
+
{
|
|
660
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
661
|
+
width: "24",
|
|
662
|
+
height: "24",
|
|
663
|
+
viewBox: "0 0 24 24",
|
|
664
|
+
fill: "none",
|
|
665
|
+
stroke: "currentColor",
|
|
666
|
+
strokeWidth: "2",
|
|
667
|
+
strokeLinecap: "round",
|
|
668
|
+
strokeLinejoin: "round",
|
|
669
|
+
className: "h-4 w-4",
|
|
670
|
+
children: [
|
|
671
|
+
/* @__PURE__ */ jsx12("path", { d: "M18 6 6 18" }),
|
|
672
|
+
/* @__PURE__ */ jsx12("path", { d: "m6 6 12 12" })
|
|
673
|
+
]
|
|
674
|
+
}
|
|
675
|
+
),
|
|
676
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Close" })
|
|
677
|
+
] })
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
)
|
|
681
|
+
] }));
|
|
682
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
683
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx12("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
684
|
+
DialogHeader.displayName = "DialogHeader";
|
|
685
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx12(
|
|
686
|
+
"div",
|
|
687
|
+
{
|
|
688
|
+
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
689
|
+
...props
|
|
690
|
+
}
|
|
691
|
+
);
|
|
692
|
+
DialogFooter.displayName = "DialogFooter";
|
|
693
|
+
var DialogTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
694
|
+
DialogPrimitive.Title,
|
|
695
|
+
{
|
|
696
|
+
ref,
|
|
697
|
+
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
698
|
+
...props
|
|
699
|
+
}
|
|
700
|
+
));
|
|
701
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
702
|
+
var DialogDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
703
|
+
DialogPrimitive.Description,
|
|
704
|
+
{
|
|
705
|
+
ref,
|
|
706
|
+
className: cn("text-sm text-[var(--muted-foreground)]", className),
|
|
707
|
+
...props
|
|
708
|
+
}
|
|
709
|
+
));
|
|
710
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
711
|
+
var DialogNamespace = Object.assign(Dialog, {
|
|
712
|
+
Portal: DialogPortal,
|
|
713
|
+
Overlay: DialogOverlay,
|
|
714
|
+
Close: DialogClose,
|
|
715
|
+
Trigger: DialogTrigger,
|
|
716
|
+
Content: DialogContent,
|
|
717
|
+
Header: DialogHeader,
|
|
718
|
+
Footer: DialogFooter,
|
|
719
|
+
Title: DialogTitle,
|
|
720
|
+
Description: DialogDescription
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
// src/components/spinner.tsx
|
|
724
|
+
import * as React13 from "react";
|
|
725
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
726
|
+
var Spinner = React13.forwardRef(
|
|
727
|
+
({ className, size = "default", ...props }, ref) => {
|
|
728
|
+
return /* @__PURE__ */ jsx13(
|
|
729
|
+
"div",
|
|
730
|
+
{
|
|
731
|
+
ref,
|
|
732
|
+
role: "status",
|
|
733
|
+
"aria-label": "Loading",
|
|
734
|
+
className: cn(
|
|
735
|
+
"inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent motion-reduce:animate-[spin_1.5s_linear_infinite]",
|
|
736
|
+
{
|
|
737
|
+
"h-4 w-4": size === "sm",
|
|
738
|
+
"h-6 w-6": size === "default",
|
|
739
|
+
"h-8 w-8": size === "lg"
|
|
740
|
+
},
|
|
741
|
+
"text-[var(--accent)]",
|
|
742
|
+
className
|
|
743
|
+
),
|
|
744
|
+
...props,
|
|
745
|
+
children: /* @__PURE__ */ jsx13("span", { className: "sr-only", children: "Loading..." })
|
|
746
|
+
}
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
);
|
|
750
|
+
Spinner.displayName = "Spinner";
|
|
751
|
+
|
|
752
|
+
// src/components/table.tsx
|
|
753
|
+
import * as React14 from "react";
|
|
754
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
755
|
+
var Table = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx14(
|
|
756
|
+
"table",
|
|
757
|
+
{
|
|
758
|
+
ref,
|
|
759
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
760
|
+
...props
|
|
761
|
+
}
|
|
762
|
+
) }));
|
|
763
|
+
Table.displayName = "Table";
|
|
764
|
+
var TableHeader = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
765
|
+
TableHeader.displayName = "TableHeader";
|
|
766
|
+
var TableBody = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
767
|
+
"tbody",
|
|
768
|
+
{
|
|
769
|
+
ref,
|
|
770
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
771
|
+
...props
|
|
772
|
+
}
|
|
773
|
+
));
|
|
774
|
+
TableBody.displayName = "TableBody";
|
|
775
|
+
var TableFooter = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
776
|
+
"tfoot",
|
|
777
|
+
{
|
|
778
|
+
ref,
|
|
779
|
+
className: cn(
|
|
780
|
+
"border-t bg-[var(--muted)]/50 font-medium [&>tr]:last:border-b-0",
|
|
781
|
+
className
|
|
782
|
+
),
|
|
783
|
+
...props
|
|
784
|
+
}
|
|
785
|
+
));
|
|
786
|
+
TableFooter.displayName = "TableFooter";
|
|
787
|
+
var TableRow = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
788
|
+
"tr",
|
|
789
|
+
{
|
|
790
|
+
ref,
|
|
791
|
+
className: cn(
|
|
792
|
+
"border-b border-[var(--border)] transition-colors",
|
|
793
|
+
"hover:bg-[var(--muted)]/50",
|
|
794
|
+
"data-[state=selected]:bg-[var(--muted)]",
|
|
795
|
+
className
|
|
796
|
+
),
|
|
797
|
+
...props
|
|
798
|
+
}
|
|
799
|
+
));
|
|
800
|
+
TableRow.displayName = "TableRow";
|
|
801
|
+
var TableHead = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
802
|
+
"th",
|
|
803
|
+
{
|
|
804
|
+
ref,
|
|
805
|
+
className: cn(
|
|
806
|
+
"h-12 px-4 text-left align-middle font-medium text-[var(--muted-foreground)]",
|
|
807
|
+
"[&:has([role=checkbox])]:pr-0",
|
|
808
|
+
className
|
|
809
|
+
),
|
|
810
|
+
...props
|
|
811
|
+
}
|
|
812
|
+
));
|
|
813
|
+
TableHead.displayName = "TableHead";
|
|
814
|
+
var TableCell = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
815
|
+
"td",
|
|
816
|
+
{
|
|
817
|
+
ref,
|
|
818
|
+
className: cn(
|
|
819
|
+
"p-4 align-middle [&:has([role=checkbox])]:pr-0",
|
|
820
|
+
className
|
|
821
|
+
),
|
|
822
|
+
...props
|
|
823
|
+
}
|
|
824
|
+
));
|
|
825
|
+
TableCell.displayName = "TableCell";
|
|
826
|
+
var TableCaption = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
827
|
+
"caption",
|
|
828
|
+
{
|
|
829
|
+
ref,
|
|
830
|
+
className: cn("mt-4 text-sm text-[var(--muted-foreground)]", className),
|
|
831
|
+
...props
|
|
832
|
+
}
|
|
833
|
+
));
|
|
834
|
+
TableCaption.displayName = "TableCaption";
|
|
835
|
+
var TableNamespace = Object.assign(Table, {
|
|
836
|
+
Header: TableHeader,
|
|
837
|
+
Body: TableBody,
|
|
838
|
+
Footer: TableFooter,
|
|
839
|
+
Row: TableRow,
|
|
840
|
+
Head: TableHead,
|
|
841
|
+
Cell: TableCell,
|
|
842
|
+
Caption: TableCaption
|
|
843
|
+
});
|
|
844
|
+
|
|
845
|
+
// src/components/pagination.tsx
|
|
846
|
+
import * as React15 from "react";
|
|
847
|
+
import { jsx as jsx15, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
848
|
+
var Pagination = React15.forwardRef(
|
|
849
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
850
|
+
"nav",
|
|
851
|
+
{
|
|
852
|
+
ref,
|
|
853
|
+
role: "navigation",
|
|
854
|
+
"aria-label": "pagination",
|
|
855
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
856
|
+
...props
|
|
857
|
+
}
|
|
858
|
+
)
|
|
859
|
+
);
|
|
860
|
+
Pagination.displayName = "Pagination";
|
|
861
|
+
var PaginationContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
862
|
+
"ul",
|
|
863
|
+
{
|
|
864
|
+
ref,
|
|
865
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
866
|
+
...props
|
|
867
|
+
}
|
|
868
|
+
));
|
|
869
|
+
PaginationContent.displayName = "PaginationContent";
|
|
870
|
+
var PaginationItem = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15("li", { ref, className: cn("", className), ...props }));
|
|
871
|
+
PaginationItem.displayName = "PaginationItem";
|
|
872
|
+
var PaginationLink = React15.forwardRef(
|
|
873
|
+
({ className, isActive, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
874
|
+
Button,
|
|
875
|
+
{
|
|
876
|
+
ref,
|
|
877
|
+
variant: isActive ? "default" : "outline",
|
|
878
|
+
size: "icon",
|
|
879
|
+
className: cn("h-9 w-9", className),
|
|
880
|
+
...props
|
|
881
|
+
}
|
|
882
|
+
)
|
|
883
|
+
);
|
|
884
|
+
PaginationLink.displayName = "PaginationLink";
|
|
885
|
+
var PaginationPrevious = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs3(
|
|
886
|
+
Button,
|
|
887
|
+
{
|
|
888
|
+
ref,
|
|
889
|
+
variant: "outline",
|
|
890
|
+
size: "default",
|
|
891
|
+
className: cn("gap-1 pl-2.5", className),
|
|
892
|
+
...props,
|
|
893
|
+
children: [
|
|
894
|
+
/* @__PURE__ */ jsx15(
|
|
895
|
+
"svg",
|
|
896
|
+
{
|
|
897
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
898
|
+
width: "24",
|
|
899
|
+
height: "24",
|
|
900
|
+
viewBox: "0 0 24 24",
|
|
901
|
+
fill: "none",
|
|
902
|
+
stroke: "currentColor",
|
|
903
|
+
strokeWidth: "2",
|
|
904
|
+
strokeLinecap: "round",
|
|
905
|
+
strokeLinejoin: "round",
|
|
906
|
+
className: "h-4 w-4",
|
|
907
|
+
children: /* @__PURE__ */ jsx15("path", { d: "m15 18-6-6 6-6" })
|
|
908
|
+
}
|
|
909
|
+
),
|
|
910
|
+
/* @__PURE__ */ jsx15("span", { children: "Previous" })
|
|
911
|
+
]
|
|
912
|
+
}
|
|
913
|
+
));
|
|
914
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
915
|
+
var PaginationNext = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs3(
|
|
916
|
+
Button,
|
|
917
|
+
{
|
|
918
|
+
ref,
|
|
919
|
+
variant: "outline",
|
|
920
|
+
size: "default",
|
|
921
|
+
className: cn("gap-1 pr-2.5", className),
|
|
922
|
+
...props,
|
|
923
|
+
children: [
|
|
924
|
+
/* @__PURE__ */ jsx15("span", { children: "Next" }),
|
|
925
|
+
/* @__PURE__ */ jsx15(
|
|
926
|
+
"svg",
|
|
927
|
+
{
|
|
928
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
929
|
+
width: "24",
|
|
930
|
+
height: "24",
|
|
931
|
+
viewBox: "0 0 24 24",
|
|
932
|
+
fill: "none",
|
|
933
|
+
stroke: "currentColor",
|
|
934
|
+
strokeWidth: "2",
|
|
935
|
+
strokeLinecap: "round",
|
|
936
|
+
strokeLinejoin: "round",
|
|
937
|
+
className: "h-4 w-4",
|
|
938
|
+
children: /* @__PURE__ */ jsx15("path", { d: "m9 18 6-6-6-6" })
|
|
939
|
+
}
|
|
940
|
+
)
|
|
941
|
+
]
|
|
942
|
+
}
|
|
943
|
+
));
|
|
944
|
+
PaginationNext.displayName = "PaginationNext";
|
|
945
|
+
var PaginationEllipsis = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs3(
|
|
946
|
+
"span",
|
|
947
|
+
{
|
|
948
|
+
ref,
|
|
949
|
+
"aria-hidden": true,
|
|
950
|
+
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
951
|
+
...props,
|
|
952
|
+
children: [
|
|
953
|
+
/* @__PURE__ */ jsxs3(
|
|
954
|
+
"svg",
|
|
955
|
+
{
|
|
956
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
957
|
+
width: "24",
|
|
958
|
+
height: "24",
|
|
959
|
+
viewBox: "0 0 24 24",
|
|
960
|
+
fill: "none",
|
|
961
|
+
stroke: "currentColor",
|
|
962
|
+
strokeWidth: "2",
|
|
963
|
+
strokeLinecap: "round",
|
|
964
|
+
strokeLinejoin: "round",
|
|
965
|
+
className: "h-4 w-4",
|
|
966
|
+
children: [
|
|
967
|
+
/* @__PURE__ */ jsx15("circle", { cx: "12", cy: "12", r: "1" }),
|
|
968
|
+
/* @__PURE__ */ jsx15("circle", { cx: "19", cy: "12", r: "1" }),
|
|
969
|
+
/* @__PURE__ */ jsx15("circle", { cx: "5", cy: "12", r: "1" })
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
),
|
|
973
|
+
/* @__PURE__ */ jsx15("span", { className: "sr-only", children: "More pages" })
|
|
974
|
+
]
|
|
975
|
+
}
|
|
976
|
+
));
|
|
977
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
978
|
+
var PaginationNamespace = Object.assign(Pagination, {
|
|
979
|
+
Content: PaginationContent,
|
|
980
|
+
Item: PaginationItem,
|
|
981
|
+
Link: PaginationLink,
|
|
982
|
+
Previous: PaginationPrevious,
|
|
983
|
+
Next: PaginationNext,
|
|
984
|
+
Ellipsis: PaginationEllipsis
|
|
985
|
+
});
|
|
986
|
+
|
|
987
|
+
// src/components/combobox/index.tsx
|
|
988
|
+
import * as React16 from "react";
|
|
989
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
990
|
+
import { jsx as jsx16, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
991
|
+
var Combobox = React16.forwardRef(
|
|
992
|
+
({
|
|
993
|
+
options,
|
|
994
|
+
value: controlledValue,
|
|
995
|
+
defaultValue,
|
|
996
|
+
onValueChange,
|
|
997
|
+
placeholder = "Select option...",
|
|
998
|
+
searchPlaceholder = "Search...",
|
|
999
|
+
emptyMessage = "No results found.",
|
|
1000
|
+
disabled = false,
|
|
1001
|
+
className
|
|
1002
|
+
}, ref) => {
|
|
1003
|
+
const [open, setOpen] = React16.useState(false);
|
|
1004
|
+
const [search, setSearch] = React16.useState("");
|
|
1005
|
+
const [internalValue, setInternalValue] = React16.useState(defaultValue ?? "");
|
|
1006
|
+
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
1007
|
+
const filteredOptions = React16.useMemo(() => {
|
|
1008
|
+
if (!search) return options;
|
|
1009
|
+
return options.filter(
|
|
1010
|
+
(option) => option.label.toLowerCase().includes(search.toLowerCase())
|
|
1011
|
+
);
|
|
1012
|
+
}, [options, search]);
|
|
1013
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
1014
|
+
const handleSelect = (optionValue) => {
|
|
1015
|
+
if (controlledValue === void 0) {
|
|
1016
|
+
setInternalValue(optionValue);
|
|
1017
|
+
}
|
|
1018
|
+
onValueChange?.(optionValue);
|
|
1019
|
+
setOpen(false);
|
|
1020
|
+
setSearch("");
|
|
1021
|
+
};
|
|
1022
|
+
return /* @__PURE__ */ jsxs4(PopoverPrimitive.Root, { open, onOpenChange: setOpen, children: [
|
|
1023
|
+
/* @__PURE__ */ jsx16(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs4(
|
|
1024
|
+
"button",
|
|
1025
|
+
{
|
|
1026
|
+
ref,
|
|
1027
|
+
type: "button",
|
|
1028
|
+
role: "combobox",
|
|
1029
|
+
"aria-expanded": open,
|
|
1030
|
+
disabled,
|
|
1031
|
+
className: cn(
|
|
1032
|
+
"flex h-10 w-full items-center justify-between rounded-[var(--radius)] border border-[var(--input)] bg-[var(--background)] px-3 py-2 text-sm",
|
|
1033
|
+
"ring-offset-[var(--background)]",
|
|
1034
|
+
"placeholder:text-[var(--muted-foreground)]",
|
|
1035
|
+
"focus:outline-none focus:ring-2 focus:ring-[var(--ring)] focus:ring-offset-2",
|
|
1036
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1037
|
+
className
|
|
1038
|
+
),
|
|
1039
|
+
children: [
|
|
1040
|
+
/* @__PURE__ */ jsx16("span", { className: cn(!selectedOption && "text-[var(--muted-foreground)]"), children: selectedOption?.label ?? placeholder }),
|
|
1041
|
+
/* @__PURE__ */ jsx16(
|
|
1042
|
+
"svg",
|
|
1043
|
+
{
|
|
1044
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1045
|
+
width: "24",
|
|
1046
|
+
height: "24",
|
|
1047
|
+
viewBox: "0 0 24 24",
|
|
1048
|
+
fill: "none",
|
|
1049
|
+
stroke: "currentColor",
|
|
1050
|
+
strokeWidth: "2",
|
|
1051
|
+
strokeLinecap: "round",
|
|
1052
|
+
strokeLinejoin: "round",
|
|
1053
|
+
className: cn(
|
|
1054
|
+
"ml-2 h-4 w-4 shrink-0 opacity-50 transition-transform",
|
|
1055
|
+
open && "rotate-180"
|
|
1056
|
+
),
|
|
1057
|
+
children: /* @__PURE__ */ jsx16("path", { d: "m6 9 6 6 6-6" })
|
|
1058
|
+
}
|
|
1059
|
+
)
|
|
1060
|
+
]
|
|
1061
|
+
}
|
|
1062
|
+
) }),
|
|
1063
|
+
/* @__PURE__ */ jsx16(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsxs4(
|
|
1064
|
+
PopoverPrimitive.Content,
|
|
1065
|
+
{
|
|
1066
|
+
className: cn(
|
|
1067
|
+
"z-50 w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-[var(--radius)] border border-[var(--border)] bg-[var(--popover)] text-[var(--popover-foreground)] shadow-md",
|
|
1068
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1069
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1070
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
1071
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2"
|
|
1072
|
+
),
|
|
1073
|
+
sideOffset: 4,
|
|
1074
|
+
children: [
|
|
1075
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center border-b border-[var(--border)] px-3", children: [
|
|
1076
|
+
/* @__PURE__ */ jsxs4(
|
|
1077
|
+
"svg",
|
|
1078
|
+
{
|
|
1079
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1080
|
+
width: "24",
|
|
1081
|
+
height: "24",
|
|
1082
|
+
viewBox: "0 0 24 24",
|
|
1083
|
+
fill: "none",
|
|
1084
|
+
stroke: "currentColor",
|
|
1085
|
+
strokeWidth: "2",
|
|
1086
|
+
strokeLinecap: "round",
|
|
1087
|
+
strokeLinejoin: "round",
|
|
1088
|
+
className: "mr-2 h-4 w-4 shrink-0 opacity-50",
|
|
1089
|
+
children: [
|
|
1090
|
+
/* @__PURE__ */ jsx16("circle", { cx: "11", cy: "11", r: "8" }),
|
|
1091
|
+
/* @__PURE__ */ jsx16("path", { d: "m21 21-4.3-4.3" })
|
|
1092
|
+
]
|
|
1093
|
+
}
|
|
1094
|
+
),
|
|
1095
|
+
/* @__PURE__ */ jsx16(
|
|
1096
|
+
"input",
|
|
1097
|
+
{
|
|
1098
|
+
className: "flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-[var(--muted-foreground)]",
|
|
1099
|
+
placeholder: searchPlaceholder,
|
|
1100
|
+
value: search,
|
|
1101
|
+
onChange: (e) => setSearch(e.target.value)
|
|
1102
|
+
}
|
|
1103
|
+
)
|
|
1104
|
+
] }),
|
|
1105
|
+
/* @__PURE__ */ jsx16("div", { className: "max-h-[300px] overflow-y-auto p-1", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx16("div", { className: "py-6 text-center text-sm text-[var(--muted-foreground)]", children: emptyMessage }) : filteredOptions.map((option) => /* @__PURE__ */ jsxs4(
|
|
1106
|
+
"button",
|
|
1107
|
+
{
|
|
1108
|
+
type: "button",
|
|
1109
|
+
disabled: option.disabled,
|
|
1110
|
+
onClick: () => handleSelect(option.value),
|
|
1111
|
+
className: cn(
|
|
1112
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
1113
|
+
"hover:bg-[var(--muted)] hover:text-[var(--foreground)]",
|
|
1114
|
+
"focus:bg-[var(--muted)] focus:text-[var(--foreground)]",
|
|
1115
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
1116
|
+
option.value === value && "bg-[var(--muted)]"
|
|
1117
|
+
),
|
|
1118
|
+
children: [
|
|
1119
|
+
/* @__PURE__ */ jsx16("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: option.value === value && /* @__PURE__ */ jsx16(
|
|
1120
|
+
"svg",
|
|
1121
|
+
{
|
|
1122
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1123
|
+
width: "24",
|
|
1124
|
+
height: "24",
|
|
1125
|
+
viewBox: "0 0 24 24",
|
|
1126
|
+
fill: "none",
|
|
1127
|
+
stroke: "currentColor",
|
|
1128
|
+
strokeWidth: "2",
|
|
1129
|
+
strokeLinecap: "round",
|
|
1130
|
+
strokeLinejoin: "round",
|
|
1131
|
+
className: "h-4 w-4",
|
|
1132
|
+
children: /* @__PURE__ */ jsx16("polyline", { points: "20 6 9 17 4 12" })
|
|
1133
|
+
}
|
|
1134
|
+
) }),
|
|
1135
|
+
option.label
|
|
1136
|
+
]
|
|
1137
|
+
},
|
|
1138
|
+
option.value
|
|
1139
|
+
)) })
|
|
1140
|
+
]
|
|
1141
|
+
}
|
|
1142
|
+
) })
|
|
1143
|
+
] });
|
|
1144
|
+
}
|
|
1145
|
+
);
|
|
1146
|
+
Combobox.displayName = "Combobox";
|
|
1147
|
+
export {
|
|
1148
|
+
Badge,
|
|
1149
|
+
Button,
|
|
1150
|
+
Card,
|
|
1151
|
+
CardContent,
|
|
1152
|
+
CardDescription,
|
|
1153
|
+
CardFooter,
|
|
1154
|
+
CardHeader,
|
|
1155
|
+
CardTitle,
|
|
1156
|
+
Checkbox,
|
|
1157
|
+
Combobox,
|
|
1158
|
+
DialogNamespace as Dialog,
|
|
1159
|
+
DialogClose,
|
|
1160
|
+
DialogContent,
|
|
1161
|
+
DialogDescription,
|
|
1162
|
+
DialogFooter,
|
|
1163
|
+
DialogHeader,
|
|
1164
|
+
DialogOverlay,
|
|
1165
|
+
DialogPortal,
|
|
1166
|
+
DialogTitle,
|
|
1167
|
+
DialogTrigger,
|
|
1168
|
+
Input,
|
|
1169
|
+
Label,
|
|
1170
|
+
PaginationNamespace as Pagination,
|
|
1171
|
+
PaginationContent,
|
|
1172
|
+
PaginationEllipsis,
|
|
1173
|
+
PaginationItem,
|
|
1174
|
+
PaginationLink,
|
|
1175
|
+
PaginationNext,
|
|
1176
|
+
PaginationPrevious,
|
|
1177
|
+
SelectNamespace as Select,
|
|
1178
|
+
SelectContent,
|
|
1179
|
+
SelectGroup,
|
|
1180
|
+
SelectItem,
|
|
1181
|
+
SelectLabel,
|
|
1182
|
+
SelectScrollDownButton,
|
|
1183
|
+
SelectScrollUpButton,
|
|
1184
|
+
SelectSeparator,
|
|
1185
|
+
SelectTrigger,
|
|
1186
|
+
SelectValue,
|
|
1187
|
+
Separator,
|
|
1188
|
+
Spinner,
|
|
1189
|
+
Switch,
|
|
1190
|
+
TableNamespace as Table,
|
|
1191
|
+
TableBody,
|
|
1192
|
+
TableCaption,
|
|
1193
|
+
TableCell,
|
|
1194
|
+
TableFooter,
|
|
1195
|
+
TableHead,
|
|
1196
|
+
TableHeader,
|
|
1197
|
+
TableRow,
|
|
1198
|
+
Textarea,
|
|
1199
|
+
ThemeContext,
|
|
1200
|
+
ThemeProvider,
|
|
1201
|
+
cn,
|
|
1202
|
+
useTheme
|
|
1203
|
+
};
|
|
1204
|
+
//# sourceMappingURL=index.js.map
|