@colineapp/ui 0.2.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 +66 -0
- package/dist/index.d.ts +203 -0
- package/dist/index.js +1961 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +64 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1961 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/lib/utils.ts
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { twMerge } from "tailwind-merge";
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// src/provider.tsx
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import {
|
|
13
|
+
connectGuestBridge
|
|
14
|
+
} from "@colineapp/app-runtime";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
var ColineRuntimeContext = React.createContext(null);
|
|
17
|
+
function applyTheme(theme, colorScheme) {
|
|
18
|
+
const root = document.documentElement;
|
|
19
|
+
for (const [token, value] of Object.entries(theme)) {
|
|
20
|
+
if (token.startsWith("--")) {
|
|
21
|
+
root.style.setProperty(token, value);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
root.classList.toggle("dark", colorScheme === "dark");
|
|
25
|
+
}
|
|
26
|
+
function ColineAppProvider({ children }) {
|
|
27
|
+
const [runtime, setRuntime] = React.useState(null);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
let disposed = false;
|
|
30
|
+
let removeThemeListener = null;
|
|
31
|
+
void connectGuestBridge().then((bridge) => {
|
|
32
|
+
if (disposed) return;
|
|
33
|
+
applyTheme(bridge.theme, bridge.colorScheme);
|
|
34
|
+
removeThemeListener = bridge.onThemeChange((theme, colorScheme) => {
|
|
35
|
+
applyTheme(theme, colorScheme);
|
|
36
|
+
setRuntime(
|
|
37
|
+
(current) => current ? { ...current, colorScheme } : current
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
setRuntime({
|
|
41
|
+
bridge,
|
|
42
|
+
coline: bridge.coline,
|
|
43
|
+
context: bridge.context,
|
|
44
|
+
colorScheme: bridge.colorScheme
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
return () => {
|
|
48
|
+
disposed = true;
|
|
49
|
+
removeThemeListener?.();
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
if (!runtime) return;
|
|
54
|
+
const observer = new ResizeObserver(() => {
|
|
55
|
+
runtime.bridge.reportHeight(document.documentElement.scrollHeight);
|
|
56
|
+
});
|
|
57
|
+
observer.observe(document.documentElement);
|
|
58
|
+
return () => observer.disconnect();
|
|
59
|
+
}, [runtime]);
|
|
60
|
+
if (!runtime) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return /* @__PURE__ */ jsx(ColineRuntimeContext.Provider, { value: runtime, children });
|
|
64
|
+
}
|
|
65
|
+
function useColine() {
|
|
66
|
+
const runtime = React.useContext(ColineRuntimeContext);
|
|
67
|
+
if (!runtime) {
|
|
68
|
+
throw new Error("useColine must be used inside <ColineAppProvider>.");
|
|
69
|
+
}
|
|
70
|
+
return runtime.coline;
|
|
71
|
+
}
|
|
72
|
+
function useColineContext() {
|
|
73
|
+
const runtime = React.useContext(ColineRuntimeContext);
|
|
74
|
+
if (!runtime) {
|
|
75
|
+
throw new Error("useColineContext must be used inside <ColineAppProvider>.");
|
|
76
|
+
}
|
|
77
|
+
return runtime.context;
|
|
78
|
+
}
|
|
79
|
+
function useColorScheme() {
|
|
80
|
+
const runtime = React.useContext(ColineRuntimeContext);
|
|
81
|
+
if (!runtime) {
|
|
82
|
+
throw new Error("useColorScheme must be used inside <ColineAppProvider>.");
|
|
83
|
+
}
|
|
84
|
+
return runtime.colorScheme;
|
|
85
|
+
}
|
|
86
|
+
function useColineQuery(loader, deps = []) {
|
|
87
|
+
const coline = useColine();
|
|
88
|
+
const [state, setState] = React.useState({ data: null, error: null, isLoading: true });
|
|
89
|
+
const [nonce, setNonce] = React.useState(0);
|
|
90
|
+
const loaderRef = React.useRef(loader);
|
|
91
|
+
loaderRef.current = loader;
|
|
92
|
+
React.useEffect(() => {
|
|
93
|
+
let cancelled = false;
|
|
94
|
+
setState((current) => ({ ...current, isLoading: true, error: null }));
|
|
95
|
+
void loaderRef.current(coline).then((data) => {
|
|
96
|
+
if (!cancelled) setState({ data, error: null, isLoading: false });
|
|
97
|
+
}).catch((error) => {
|
|
98
|
+
if (!cancelled) {
|
|
99
|
+
setState({
|
|
100
|
+
data: null,
|
|
101
|
+
error: error instanceof Error ? error.message : String(error),
|
|
102
|
+
isLoading: false
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
return () => {
|
|
107
|
+
cancelled = true;
|
|
108
|
+
};
|
|
109
|
+
}, [coline, nonce, ...deps]);
|
|
110
|
+
const refetch = React.useCallback(() => setNonce((value) => value + 1), []);
|
|
111
|
+
return { ...state, refetch };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// src/components/badge.tsx
|
|
115
|
+
import "react";
|
|
116
|
+
import { cva } from "class-variance-authority";
|
|
117
|
+
import { Slot } from "radix-ui";
|
|
118
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
119
|
+
var badgeVariants = cva(
|
|
120
|
+
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
121
|
+
{
|
|
122
|
+
variants: {
|
|
123
|
+
variant: {
|
|
124
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
125
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
126
|
+
destructive: "bg-destructive/10 text-destructive dark:bg-destructive/20 [a]:hover:bg-destructive/20",
|
|
127
|
+
outline: "border-border bg-input/30 text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
128
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
129
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
defaultVariants: {
|
|
133
|
+
variant: "default"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
function Badge({
|
|
138
|
+
className,
|
|
139
|
+
variant = "default",
|
|
140
|
+
asChild = false,
|
|
141
|
+
...props
|
|
142
|
+
}) {
|
|
143
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
144
|
+
return /* @__PURE__ */ jsx2(
|
|
145
|
+
Comp,
|
|
146
|
+
{
|
|
147
|
+
"data-slot": "badge",
|
|
148
|
+
"data-variant": variant,
|
|
149
|
+
className: cn(badgeVariants({ variant }), className),
|
|
150
|
+
...props
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/components/button.tsx
|
|
156
|
+
import * as React3 from "react";
|
|
157
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
158
|
+
import { Slot as Slot2 } from "radix-ui";
|
|
159
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
160
|
+
var buttonVariants = cva2(
|
|
161
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-white/20 text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color] duration-200 ease-out outline-none select-none focus-visible:border-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 dark:border-white/[0.06] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
162
|
+
{
|
|
163
|
+
variants: {
|
|
164
|
+
variant: {
|
|
165
|
+
default: "bg-gradient-to-b from-blue-50 to-blue-100 text-blue-700 border-blue-200/50 hover:from-blue-100 hover:to-blue-150 shadow-[inset_0_1px_0_0_rgba(255,255,255,0.1),0_1px_3px_0_rgba(0,0,0,0.1)] dark:from-blue-950/50 dark:to-blue-900/50 dark:text-blue-300 dark:border-blue-800/30 dark:hover:from-blue-900/60 dark:hover:to-blue-800/60 dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.05),0_1px_3px_0_rgba(0,0,0,0.3)]",
|
|
166
|
+
outline: "border-border/40 bg-background/60 shadow-[inset_0_1px_0_rgba(255,255,255,0.5),inset_0_-1px_2px_rgba(0,0,0,0.03)] hover:bg-background/80 hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.6),inset_0_-1px_3px_rgba(0,0,0,0.04)] hover:text-foreground active:shadow-[inset_0_2px_6px_rgba(0,0,0,0.06)] dark:bg-white/[0.04] dark:shadow-[inset_0_1px_0_rgba(255,255,255,0.04),inset_0_-1px_2px_rgba(0,0,0,0.2)] dark:hover:bg-white/[0.07] dark:hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.06),inset_0_-1px_3px_rgba(0,0,0,0.25)] dark:active:shadow-[inset_0_2px_6px_rgba(0,0,0,0.35)] aria-expanded:bg-muted aria-expanded:text-foreground aria-expanded:shadow-[inset_0_2px_4px_rgba(0,0,0,0.06)]",
|
|
167
|
+
secondary: "bg-secondary/70 text-secondary-foreground shadow-[inset_0_1px_0_rgba(255,255,255,0.6),inset_0_-1px_2px_rgba(0,0,0,0.04)] hover:bg-secondary/85 hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.7),inset_0_-1px_3px_rgba(0,0,0,0.05)] active:shadow-[inset_0_2px_6px_rgba(0,0,0,0.07)] dark:bg-secondary/50 dark:shadow-[inset_0_1px_0_rgba(255,255,255,0.04),inset_0_-1px_2px_rgba(0,0,0,0.2)] dark:hover:bg-secondary/60 dark:hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.06),inset_0_-1px_3px_rgba(0,0,0,0.25)] dark:active:shadow-[inset_0_2px_6px_rgba(0,0,0,0.35)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground aria-expanded:shadow-[inset_0_2px_4px_rgba(0,0,0,0.05)]",
|
|
168
|
+
ghost: "hover:bg-muted/50 hover:text-foreground hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.4),inset_0_-1px_2px_rgba(0,0,0,0.03)] active:shadow-[inset_0_2px_5px_rgba(0,0,0,0.06)] dark:hover:bg-white/[0.04] dark:hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.03),inset_0_-1px_2px_rgba(0,0,0,0.15)] dark:active:shadow-[inset_0_2px_5px_rgba(0,0,0,0.3)] aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
169
|
+
destructive: "bg-destructive/8 text-destructive shadow-[inset_0_1px_0_rgba(255,255,255,0.4),inset_0_-1px_2px_rgba(220,38,38,0.06)] hover:bg-destructive/12 hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.5),inset_0_-1px_3px_rgba(220,38,38,0.08)] active:shadow-[inset_0_2px_6px_rgba(220,38,38,0.12)] focus-visible:border-destructive/40 dark:bg-destructive/15 dark:shadow-[inset_0_1px_0_rgba(255,255,255,0.03),inset_0_-1px_2px_rgba(0,0,0,0.2)] dark:hover:bg-destructive/22 dark:hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.05),inset_0_-1px_3px_rgba(0,0,0,0.25)] dark:active:shadow-[inset_0_2px_6px_rgba(0,0,0,0.35)]",
|
|
170
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
171
|
+
},
|
|
172
|
+
size: {
|
|
173
|
+
default: "h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
|
|
174
|
+
xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
175
|
+
sm: "h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
176
|
+
lg: "h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
|
|
177
|
+
icon: "size-9",
|
|
178
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
179
|
+
"icon-sm": "size-8",
|
|
180
|
+
"icon-lg": "size-10"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
defaultVariants: {
|
|
184
|
+
variant: "default",
|
|
185
|
+
size: "default"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
var Button = React3.forwardRef(function Button2({
|
|
190
|
+
className,
|
|
191
|
+
variant = "default",
|
|
192
|
+
size = "default",
|
|
193
|
+
asChild = false,
|
|
194
|
+
...props
|
|
195
|
+
}, ref) {
|
|
196
|
+
const Comp = asChild ? Slot2.Root : "button";
|
|
197
|
+
return /* @__PURE__ */ jsx3(
|
|
198
|
+
Comp,
|
|
199
|
+
{
|
|
200
|
+
ref,
|
|
201
|
+
"data-slot": "button",
|
|
202
|
+
"data-variant": variant,
|
|
203
|
+
"data-size": size,
|
|
204
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
205
|
+
...props
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// src/components/card.tsx
|
|
211
|
+
import "react";
|
|
212
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
213
|
+
function Card({
|
|
214
|
+
className,
|
|
215
|
+
size = "default",
|
|
216
|
+
...props
|
|
217
|
+
}) {
|
|
218
|
+
return /* @__PURE__ */ jsx4(
|
|
219
|
+
"div",
|
|
220
|
+
{
|
|
221
|
+
"data-slot": "card",
|
|
222
|
+
"data-size": size,
|
|
223
|
+
className: cn(
|
|
224
|
+
"group/card flex flex-col gap-6 overflow-hidden rounded-2xl bg-card py-6 text-sm text-card-foreground ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
|
|
225
|
+
className
|
|
226
|
+
),
|
|
227
|
+
...props
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
function CardHeader({ className, ...props }) {
|
|
232
|
+
return /* @__PURE__ */ jsx4(
|
|
233
|
+
"div",
|
|
234
|
+
{
|
|
235
|
+
"data-slot": "card-header",
|
|
236
|
+
className: cn(
|
|
237
|
+
"group/card-header @container/card-header grid auto-rows-min items-start gap-2 rounded-t-xl px-6 group-data-[size=sm]/card:px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4",
|
|
238
|
+
className
|
|
239
|
+
),
|
|
240
|
+
...props
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
function CardTitle({ className, ...props }) {
|
|
245
|
+
return /* @__PURE__ */ jsx4(
|
|
246
|
+
"div",
|
|
247
|
+
{
|
|
248
|
+
"data-slot": "card-title",
|
|
249
|
+
className: cn("text-base font-medium", className),
|
|
250
|
+
...props
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
function CardDescription({ className, ...props }) {
|
|
255
|
+
return /* @__PURE__ */ jsx4(
|
|
256
|
+
"div",
|
|
257
|
+
{
|
|
258
|
+
"data-slot": "card-description",
|
|
259
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
260
|
+
...props
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
function CardAction({ className, ...props }) {
|
|
265
|
+
return /* @__PURE__ */ jsx4(
|
|
266
|
+
"div",
|
|
267
|
+
{
|
|
268
|
+
"data-slot": "card-action",
|
|
269
|
+
className: cn(
|
|
270
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
271
|
+
className
|
|
272
|
+
),
|
|
273
|
+
...props
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
function CardContent({ className, ...props }) {
|
|
278
|
+
return /* @__PURE__ */ jsx4(
|
|
279
|
+
"div",
|
|
280
|
+
{
|
|
281
|
+
"data-slot": "card-content",
|
|
282
|
+
className: cn("px-6 group-data-[size=sm]/card:px-4", className),
|
|
283
|
+
...props
|
|
284
|
+
}
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
function CardFooter({ className, ...props }) {
|
|
288
|
+
return /* @__PURE__ */ jsx4(
|
|
289
|
+
"div",
|
|
290
|
+
{
|
|
291
|
+
"data-slot": "card-footer",
|
|
292
|
+
className: cn(
|
|
293
|
+
"flex items-center rounded-b-xl px-6 group-data-[size=sm]/card:px-4 [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4",
|
|
294
|
+
className
|
|
295
|
+
),
|
|
296
|
+
...props
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// src/components/checkbox.tsx
|
|
302
|
+
import "react";
|
|
303
|
+
import { IconCheck } from "@tabler/icons-react";
|
|
304
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
305
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
306
|
+
function Checkbox({
|
|
307
|
+
className,
|
|
308
|
+
...props
|
|
309
|
+
}) {
|
|
310
|
+
return /* @__PURE__ */ jsx5(
|
|
311
|
+
CheckboxPrimitive.Root,
|
|
312
|
+
{
|
|
313
|
+
"data-slot": "checkbox",
|
|
314
|
+
className: cn(
|
|
315
|
+
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[6px] border border-input outline-none transition-[transform,background-color,border-color,box-shadow] duration-150 ease-out after:absolute after:-inset-x-3 after:-inset-y-2 hover:border-foreground/30 active:scale-[0.88] group-has-disabled/field:opacity-50 focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-checked:shadow-[0_0_0_2px_color-mix(in_oklab,var(--primary)_18%,transparent)] dark:data-checked:bg-primary motion-reduce:transition-none",
|
|
316
|
+
className
|
|
317
|
+
),
|
|
318
|
+
...props,
|
|
319
|
+
children: /* @__PURE__ */ jsx5(
|
|
320
|
+
CheckboxPrimitive.Indicator,
|
|
321
|
+
{
|
|
322
|
+
"data-slot": "checkbox-indicator",
|
|
323
|
+
className: "grid place-content-center text-current data-[state=checked]:animate-in data-[state=checked]:zoom-in-75 data-[state=checked]:fade-in data-[state=checked]:duration-150 data-[state=checked]:ease-out motion-reduce:animate-none [&>svg]:size-3.5",
|
|
324
|
+
children: /* @__PURE__ */ jsx5(IconCheck, {})
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// src/components/dialog.tsx
|
|
332
|
+
import "react";
|
|
333
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
334
|
+
import { IconX } from "@tabler/icons-react";
|
|
335
|
+
import { jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
336
|
+
function Dialog({
|
|
337
|
+
...props
|
|
338
|
+
}) {
|
|
339
|
+
return /* @__PURE__ */ jsx6(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
340
|
+
}
|
|
341
|
+
function DialogTrigger({
|
|
342
|
+
...props
|
|
343
|
+
}) {
|
|
344
|
+
return /* @__PURE__ */ jsx6(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
345
|
+
}
|
|
346
|
+
function DialogPortal({
|
|
347
|
+
...props
|
|
348
|
+
}) {
|
|
349
|
+
return /* @__PURE__ */ jsx6(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
350
|
+
}
|
|
351
|
+
function DialogClose({
|
|
352
|
+
...props
|
|
353
|
+
}) {
|
|
354
|
+
return /* @__PURE__ */ jsx6(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
355
|
+
}
|
|
356
|
+
function DialogOverlay({
|
|
357
|
+
className,
|
|
358
|
+
...props
|
|
359
|
+
}) {
|
|
360
|
+
return /* @__PURE__ */ jsx6(
|
|
361
|
+
DialogPrimitive.Overlay,
|
|
362
|
+
{
|
|
363
|
+
"data-slot": "dialog-overlay",
|
|
364
|
+
className: cn(
|
|
365
|
+
"fixed inset-0 isolate z-50 bg-black/30 supports-backdrop-filter:backdrop-blur-sm",
|
|
366
|
+
className
|
|
367
|
+
),
|
|
368
|
+
...props
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
function DialogContent({
|
|
373
|
+
className,
|
|
374
|
+
children,
|
|
375
|
+
showCloseButton = true,
|
|
376
|
+
...props
|
|
377
|
+
}) {
|
|
378
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
379
|
+
/* @__PURE__ */ jsx6(DialogOverlay, {}),
|
|
380
|
+
/* @__PURE__ */ jsxs(
|
|
381
|
+
DialogPrimitive.Content,
|
|
382
|
+
{
|
|
383
|
+
"data-slot": "dialog-content",
|
|
384
|
+
className: cn(
|
|
385
|
+
// Mobile: bottom-sheet style, pinned to bottom with slide-up
|
|
386
|
+
"fixed z-50 grid w-full gap-4 bg-background/75 dark:bg-zinc-900/75 backdrop-blur-sm p-4 text-sm shadow-xl shadow-black/10 dark:shadow-black/30 ring-1 ring-white/15 dark:ring-white/10 inset-ring inset-ring-white/10 dark:inset-ring-white/5 outline-none",
|
|
387
|
+
"inset-x-0 bottom-0 max-h-[85dvh] overflow-y-auto rounded-t-3xl pb-[max(1rem,env(safe-area-inset-bottom))]",
|
|
388
|
+
// Desktop: centered modal
|
|
389
|
+
"sm:inset-x-auto sm:bottom-auto sm:top-1/2 sm:left-1/2 sm:max-w-md sm:max-h-[calc(100dvh-4rem)] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-4xl sm:p-6 sm:gap-6 sm:pb-6",
|
|
390
|
+
className
|
|
391
|
+
),
|
|
392
|
+
...props,
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ jsx6("div", { className: "mx-auto h-1 w-10 shrink-0 rounded-full bg-muted-foreground/30 sm:hidden" }),
|
|
395
|
+
children,
|
|
396
|
+
showCloseButton && /* @__PURE__ */ jsx6(DialogPrimitive.Close, { "data-slot": "dialog-close", asChild: true, children: /* @__PURE__ */ jsxs(
|
|
397
|
+
Button,
|
|
398
|
+
{
|
|
399
|
+
variant: "ghost",
|
|
400
|
+
className: "absolute top-4 right-4",
|
|
401
|
+
size: "icon-sm",
|
|
402
|
+
children: [
|
|
403
|
+
/* @__PURE__ */ jsx6(IconX, {}),
|
|
404
|
+
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Close" })
|
|
405
|
+
]
|
|
406
|
+
}
|
|
407
|
+
) })
|
|
408
|
+
]
|
|
409
|
+
}
|
|
410
|
+
)
|
|
411
|
+
] });
|
|
412
|
+
}
|
|
413
|
+
function DialogHeader({ className, ...props }) {
|
|
414
|
+
return /* @__PURE__ */ jsx6(
|
|
415
|
+
"div",
|
|
416
|
+
{
|
|
417
|
+
"data-slot": "dialog-header",
|
|
418
|
+
className: cn("flex flex-col gap-2", className),
|
|
419
|
+
...props
|
|
420
|
+
}
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
function DialogFooter({
|
|
424
|
+
className,
|
|
425
|
+
showCloseButton = false,
|
|
426
|
+
children,
|
|
427
|
+
...props
|
|
428
|
+
}) {
|
|
429
|
+
return /* @__PURE__ */ jsxs(
|
|
430
|
+
"div",
|
|
431
|
+
{
|
|
432
|
+
"data-slot": "dialog-footer",
|
|
433
|
+
className: cn(
|
|
434
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
435
|
+
className
|
|
436
|
+
),
|
|
437
|
+
...props,
|
|
438
|
+
children: [
|
|
439
|
+
children,
|
|
440
|
+
showCloseButton && /* @__PURE__ */ jsx6(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx6(Button, { variant: "outline", children: "Close" }) })
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
function DialogTitle({
|
|
446
|
+
className,
|
|
447
|
+
...props
|
|
448
|
+
}) {
|
|
449
|
+
return /* @__PURE__ */ jsx6(
|
|
450
|
+
DialogPrimitive.Title,
|
|
451
|
+
{
|
|
452
|
+
"data-slot": "dialog-title",
|
|
453
|
+
className: cn("text-base leading-none font-medium", className),
|
|
454
|
+
...props
|
|
455
|
+
}
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
function DialogDescription({
|
|
459
|
+
className,
|
|
460
|
+
...props
|
|
461
|
+
}) {
|
|
462
|
+
return /* @__PURE__ */ jsx6(
|
|
463
|
+
DialogPrimitive.Description,
|
|
464
|
+
{
|
|
465
|
+
"data-slot": "dialog-description",
|
|
466
|
+
className: cn(
|
|
467
|
+
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
468
|
+
className
|
|
469
|
+
),
|
|
470
|
+
...props
|
|
471
|
+
}
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// src/components/dropdown-menu.tsx
|
|
476
|
+
import * as React8 from "react";
|
|
477
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
478
|
+
import { IconCheck as IconCheck2, IconChevronRight } from "@tabler/icons-react";
|
|
479
|
+
|
|
480
|
+
// src/components/liquid-menu-surface.ts
|
|
481
|
+
var liquidMenuSurfaceClasses = "rounded-2xl bg-popover/75 dark:bg-zinc-900/75 backdrop-blur-[3px] border border-black/[0.08] text-popover-foreground shadow-[0_4px_16px_-4px_rgba(0,0,0,0.08),0_16px_48px_-12px_rgba(0,0,0,0.28)] dark:border-white/[0.09] dark:bg-[#141417] dark:shadow-[0_4px_16px_-4px_rgba(0,0,0,0.4),0_16px_48px_-12px_rgba(0,0,0,0.7)]";
|
|
482
|
+
|
|
483
|
+
// src/components/menu-highlight.tsx
|
|
484
|
+
import * as React7 from "react";
|
|
485
|
+
import { motion } from "framer-motion";
|
|
486
|
+
import { createSuperHover } from "super-hover";
|
|
487
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
488
|
+
var SUPER_HOVER_ATTR = { "data-super-hover": "" };
|
|
489
|
+
var MenuHighlightContext = React7.createContext({ reportHover: () => {
|
|
490
|
+
} });
|
|
491
|
+
function useMenuHighlight(contentRef) {
|
|
492
|
+
const [rect, setRect] = React7.useState(null);
|
|
493
|
+
const [visible, setVisible] = React7.useState(false);
|
|
494
|
+
const [instant, setInstant] = React7.useState(true);
|
|
495
|
+
const visibleRef = React7.useRef(false);
|
|
496
|
+
const nextAppearIsInstantRef = React7.useRef(true);
|
|
497
|
+
const resetTimerRef = React7.useRef(null);
|
|
498
|
+
const reportHover = React7.useCallback(
|
|
499
|
+
(element2) => {
|
|
500
|
+
const content = contentRef.current;
|
|
501
|
+
if (!content) return;
|
|
502
|
+
const contentRect = content.getBoundingClientRect();
|
|
503
|
+
const itemRect = element2.getBoundingClientRect();
|
|
504
|
+
setRect({
|
|
505
|
+
top: itemRect.top - contentRect.top + content.scrollTop,
|
|
506
|
+
height: itemRect.height
|
|
507
|
+
});
|
|
508
|
+
if (resetTimerRef.current !== null) {
|
|
509
|
+
window.clearTimeout(resetTimerRef.current);
|
|
510
|
+
resetTimerRef.current = null;
|
|
511
|
+
}
|
|
512
|
+
setInstant(visibleRef.current ? false : nextAppearIsInstantRef.current);
|
|
513
|
+
nextAppearIsInstantRef.current = false;
|
|
514
|
+
visibleRef.current = true;
|
|
515
|
+
setVisible(true);
|
|
516
|
+
},
|
|
517
|
+
[contentRef]
|
|
518
|
+
);
|
|
519
|
+
const clear = React7.useCallback(() => {
|
|
520
|
+
visibleRef.current = false;
|
|
521
|
+
setVisible(false);
|
|
522
|
+
if (resetTimerRef.current !== null) {
|
|
523
|
+
window.clearTimeout(resetTimerRef.current);
|
|
524
|
+
}
|
|
525
|
+
resetTimerRef.current = window.setTimeout(() => {
|
|
526
|
+
nextAppearIsInstantRef.current = true;
|
|
527
|
+
resetTimerRef.current = null;
|
|
528
|
+
}, 50);
|
|
529
|
+
}, []);
|
|
530
|
+
React7.useEffect(
|
|
531
|
+
() => () => {
|
|
532
|
+
if (resetTimerRef.current !== null) {
|
|
533
|
+
window.clearTimeout(resetTimerRef.current);
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
[]
|
|
537
|
+
);
|
|
538
|
+
React7.useEffect(() => {
|
|
539
|
+
const content = contentRef.current;
|
|
540
|
+
if (!content) return void 0;
|
|
541
|
+
const handleEnter = (event) => {
|
|
542
|
+
const detail = event.detail;
|
|
543
|
+
if (detail.current instanceof HTMLElement) {
|
|
544
|
+
reportHover(detail.current);
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
const handleLeave = (event) => {
|
|
548
|
+
const detail = event.detail;
|
|
549
|
+
if (!detail.current) {
|
|
550
|
+
clear();
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
content.addEventListener("superhoverenter", handleEnter);
|
|
554
|
+
content.addEventListener("superhoverleave", handleLeave);
|
|
555
|
+
const controller = createSuperHover({
|
|
556
|
+
root: content,
|
|
557
|
+
events: ["enter", "leave"]
|
|
558
|
+
});
|
|
559
|
+
return () => {
|
|
560
|
+
content.removeEventListener("superhoverenter", handleEnter);
|
|
561
|
+
content.removeEventListener("superhoverleave", handleLeave);
|
|
562
|
+
controller.destroy();
|
|
563
|
+
};
|
|
564
|
+
}, [clear, contentRef, reportHover]);
|
|
565
|
+
const ctx = React7.useMemo(() => ({ reportHover }), [reportHover]);
|
|
566
|
+
const element = /* @__PURE__ */ jsx7(
|
|
567
|
+
motion.div,
|
|
568
|
+
{
|
|
569
|
+
className: "pointer-events-none absolute inset-x-1 top-0 z-0 rounded-2xl bg-black/[0.045] transform-gpu will-change-[transform,opacity] dark:bg-white/[0.08]",
|
|
570
|
+
initial: false,
|
|
571
|
+
animate: {
|
|
572
|
+
y: rect?.top ?? 0,
|
|
573
|
+
height: rect?.height ?? 0,
|
|
574
|
+
opacity: visible ? 1 : 0
|
|
575
|
+
},
|
|
576
|
+
transition: {
|
|
577
|
+
y: instant ? { duration: 0 } : { type: "spring", bounce: 0, duration: 0.15 },
|
|
578
|
+
height: instant ? { duration: 0 } : { type: "spring", bounce: 0, duration: 0.15 },
|
|
579
|
+
opacity: {
|
|
580
|
+
duration: instant ? 0.05 : 0.1,
|
|
581
|
+
ease: "linear"
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
);
|
|
586
|
+
return { ctx, clear, element };
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
// src/components/dropdown-menu.tsx
|
|
590
|
+
import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
591
|
+
var contentClasses = cn(
|
|
592
|
+
"relative z-50 overflow-x-hidden overflow-y-auto p-1",
|
|
593
|
+
liquidMenuSurfaceClasses
|
|
594
|
+
);
|
|
595
|
+
var subContentClasses = cn(
|
|
596
|
+
"relative z-50 isolate overflow-x-hidden overflow-y-auto p-1",
|
|
597
|
+
liquidMenuSurfaceClasses,
|
|
598
|
+
"after:pointer-events-none after:absolute after:inset-y-1 after:left-0 after:w-px after:bg-neutral-500/20"
|
|
599
|
+
);
|
|
600
|
+
function DropdownMenu({
|
|
601
|
+
...props
|
|
602
|
+
}) {
|
|
603
|
+
return /* @__PURE__ */ jsx8(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
604
|
+
}
|
|
605
|
+
function DropdownMenuPortal({
|
|
606
|
+
...props
|
|
607
|
+
}) {
|
|
608
|
+
return /* @__PURE__ */ jsx8(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
609
|
+
}
|
|
610
|
+
function DropdownMenuTrigger({
|
|
611
|
+
...props
|
|
612
|
+
}) {
|
|
613
|
+
return /* @__PURE__ */ jsx8(
|
|
614
|
+
DropdownMenuPrimitive.Trigger,
|
|
615
|
+
{
|
|
616
|
+
"data-slot": "dropdown-menu-trigger",
|
|
617
|
+
...props
|
|
618
|
+
}
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
function DropdownMenuContent({
|
|
622
|
+
className,
|
|
623
|
+
align = "start",
|
|
624
|
+
sideOffset = 4,
|
|
625
|
+
children,
|
|
626
|
+
...props
|
|
627
|
+
}) {
|
|
628
|
+
const contentRef = React8.useRef(null);
|
|
629
|
+
const glass = useMenuHighlight(contentRef);
|
|
630
|
+
return /* @__PURE__ */ jsx8(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsxs2(
|
|
631
|
+
DropdownMenuPrimitive.Content,
|
|
632
|
+
{
|
|
633
|
+
ref: contentRef,
|
|
634
|
+
"data-slot": "dropdown-menu-content",
|
|
635
|
+
sideOffset,
|
|
636
|
+
align,
|
|
637
|
+
onPointerLeave: glass.clear,
|
|
638
|
+
className: cn(
|
|
639
|
+
contentClasses,
|
|
640
|
+
"max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-48 origin-(--radix-dropdown-menu-content-transform-origin) duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] data-[state=closed]:overflow-hidden data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
641
|
+
className
|
|
642
|
+
),
|
|
643
|
+
...props,
|
|
644
|
+
children: [
|
|
645
|
+
glass.element,
|
|
646
|
+
/* @__PURE__ */ jsx8("div", { className: "relative z-10", children: /* @__PURE__ */ jsx8(MenuHighlightContext.Provider, { value: glass.ctx, children }) })
|
|
647
|
+
]
|
|
648
|
+
}
|
|
649
|
+
) });
|
|
650
|
+
}
|
|
651
|
+
function DropdownMenuGroup({
|
|
652
|
+
...props
|
|
653
|
+
}) {
|
|
654
|
+
return /* @__PURE__ */ jsx8(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
655
|
+
}
|
|
656
|
+
function DropdownMenuItem({
|
|
657
|
+
className,
|
|
658
|
+
inset,
|
|
659
|
+
variant = "default",
|
|
660
|
+
onPointerEnter,
|
|
661
|
+
onFocus,
|
|
662
|
+
...props
|
|
663
|
+
}) {
|
|
664
|
+
const { reportHover } = React8.useContext(MenuHighlightContext);
|
|
665
|
+
return /* @__PURE__ */ jsx8(
|
|
666
|
+
DropdownMenuPrimitive.Item,
|
|
667
|
+
{
|
|
668
|
+
"data-slot": "dropdown-menu-item",
|
|
669
|
+
...SUPER_HOVER_ATTR,
|
|
670
|
+
"data-inset": inset,
|
|
671
|
+
"data-variant": variant,
|
|
672
|
+
onFocus: (e) => {
|
|
673
|
+
reportHover(e.currentTarget);
|
|
674
|
+
onFocus?.(e);
|
|
675
|
+
},
|
|
676
|
+
onPointerEnter: (e) => {
|
|
677
|
+
reportHover(e.currentTarget);
|
|
678
|
+
onPointerEnter?.(e);
|
|
679
|
+
},
|
|
680
|
+
className: cn(
|
|
681
|
+
"group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm font-medium leading-5 outline-hidden select-none focus-visible:text-accent-foreground not-data-[variant=destructive]:focus-visible:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus-visible:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:text-muted-foreground/75 data-[variant=destructive]:*:[svg]:text-destructive",
|
|
682
|
+
className
|
|
683
|
+
),
|
|
684
|
+
...props
|
|
685
|
+
}
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
function DropdownMenuCheckboxItem({
|
|
689
|
+
className,
|
|
690
|
+
children,
|
|
691
|
+
checked,
|
|
692
|
+
inset,
|
|
693
|
+
onPointerEnter,
|
|
694
|
+
onFocus,
|
|
695
|
+
...props
|
|
696
|
+
}) {
|
|
697
|
+
const { reportHover } = React8.useContext(MenuHighlightContext);
|
|
698
|
+
return /* @__PURE__ */ jsxs2(
|
|
699
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
700
|
+
{
|
|
701
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
702
|
+
...SUPER_HOVER_ATTR,
|
|
703
|
+
"data-inset": inset,
|
|
704
|
+
onFocus: (e) => {
|
|
705
|
+
reportHover(e.currentTarget);
|
|
706
|
+
onFocus?.(e);
|
|
707
|
+
},
|
|
708
|
+
onPointerEnter: (e) => {
|
|
709
|
+
reportHover(e.currentTarget);
|
|
710
|
+
onPointerEnter?.(e);
|
|
711
|
+
},
|
|
712
|
+
className: cn(
|
|
713
|
+
"relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2.5 text-sm font-medium leading-5 outline-hidden select-none focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:text-muted-foreground/75",
|
|
714
|
+
className
|
|
715
|
+
),
|
|
716
|
+
...checked !== void 0 ? { checked } : {},
|
|
717
|
+
...props,
|
|
718
|
+
children: [
|
|
719
|
+
/* @__PURE__ */ jsx8(
|
|
720
|
+
"span",
|
|
721
|
+
{
|
|
722
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
723
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
724
|
+
children: /* @__PURE__ */ jsx8(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx8(IconCheck2, {}) })
|
|
725
|
+
}
|
|
726
|
+
),
|
|
727
|
+
children
|
|
728
|
+
]
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
function DropdownMenuRadioGroup({
|
|
733
|
+
...props
|
|
734
|
+
}) {
|
|
735
|
+
return /* @__PURE__ */ jsx8(
|
|
736
|
+
DropdownMenuPrimitive.RadioGroup,
|
|
737
|
+
{
|
|
738
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
739
|
+
...props
|
|
740
|
+
}
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
function DropdownMenuRadioItem({
|
|
744
|
+
className,
|
|
745
|
+
children,
|
|
746
|
+
inset,
|
|
747
|
+
onPointerEnter,
|
|
748
|
+
onFocus,
|
|
749
|
+
...props
|
|
750
|
+
}) {
|
|
751
|
+
const { reportHover } = React8.useContext(MenuHighlightContext);
|
|
752
|
+
return /* @__PURE__ */ jsxs2(
|
|
753
|
+
DropdownMenuPrimitive.RadioItem,
|
|
754
|
+
{
|
|
755
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
756
|
+
...SUPER_HOVER_ATTR,
|
|
757
|
+
"data-inset": inset,
|
|
758
|
+
onFocus: (e) => {
|
|
759
|
+
reportHover(e.currentTarget);
|
|
760
|
+
onFocus?.(e);
|
|
761
|
+
},
|
|
762
|
+
onPointerEnter: (e) => {
|
|
763
|
+
reportHover(e.currentTarget);
|
|
764
|
+
onPointerEnter?.(e);
|
|
765
|
+
},
|
|
766
|
+
className: cn(
|
|
767
|
+
"relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2.5 text-sm font-medium leading-5 outline-hidden select-none focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:text-muted-foreground/75",
|
|
768
|
+
className
|
|
769
|
+
),
|
|
770
|
+
...props,
|
|
771
|
+
children: [
|
|
772
|
+
/* @__PURE__ */ jsx8(
|
|
773
|
+
"span",
|
|
774
|
+
{
|
|
775
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
776
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
777
|
+
children: /* @__PURE__ */ jsx8(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx8(IconCheck2, {}) })
|
|
778
|
+
}
|
|
779
|
+
),
|
|
780
|
+
children
|
|
781
|
+
]
|
|
782
|
+
}
|
|
783
|
+
);
|
|
784
|
+
}
|
|
785
|
+
function DropdownMenuLabel({
|
|
786
|
+
className,
|
|
787
|
+
inset,
|
|
788
|
+
...props
|
|
789
|
+
}) {
|
|
790
|
+
return /* @__PURE__ */ jsx8(
|
|
791
|
+
DropdownMenuPrimitive.Label,
|
|
792
|
+
{
|
|
793
|
+
"data-slot": "dropdown-menu-label",
|
|
794
|
+
"data-inset": inset,
|
|
795
|
+
className: cn(
|
|
796
|
+
"px-2.5 pt-2 pb-1 text-xs font-medium text-muted-foreground/60 data-inset:pl-8",
|
|
797
|
+
className
|
|
798
|
+
),
|
|
799
|
+
...props
|
|
800
|
+
}
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
function DropdownMenuSeparator({
|
|
804
|
+
className,
|
|
805
|
+
...props
|
|
806
|
+
}) {
|
|
807
|
+
return /* @__PURE__ */ jsx8(
|
|
808
|
+
DropdownMenuPrimitive.Separator,
|
|
809
|
+
{
|
|
810
|
+
"data-slot": "dropdown-menu-separator",
|
|
811
|
+
className: cn("mx-1.5 my-1 h-px bg-black/[0.06] dark:bg-white/[0.07]", className),
|
|
812
|
+
...props
|
|
813
|
+
}
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
function DropdownMenuShortcut({
|
|
817
|
+
className,
|
|
818
|
+
...props
|
|
819
|
+
}) {
|
|
820
|
+
return /* @__PURE__ */ jsx8(
|
|
821
|
+
"span",
|
|
822
|
+
{
|
|
823
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
824
|
+
className: cn(
|
|
825
|
+
"ml-auto text-xs text-muted-foreground/60 group-focus-visible/dropdown-menu-item:text-accent-foreground",
|
|
826
|
+
className
|
|
827
|
+
),
|
|
828
|
+
...props
|
|
829
|
+
}
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
function DropdownMenuSub({
|
|
833
|
+
...props
|
|
834
|
+
}) {
|
|
835
|
+
return /* @__PURE__ */ jsx8(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
836
|
+
}
|
|
837
|
+
function DropdownMenuSubTrigger({
|
|
838
|
+
className,
|
|
839
|
+
inset,
|
|
840
|
+
children,
|
|
841
|
+
onPointerEnter,
|
|
842
|
+
onFocus,
|
|
843
|
+
...props
|
|
844
|
+
}) {
|
|
845
|
+
const { reportHover } = React8.useContext(MenuHighlightContext);
|
|
846
|
+
return /* @__PURE__ */ jsxs2(
|
|
847
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
848
|
+
{
|
|
849
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
850
|
+
...SUPER_HOVER_ATTR,
|
|
851
|
+
"data-inset": inset,
|
|
852
|
+
onFocus: (e) => {
|
|
853
|
+
reportHover(e.currentTarget);
|
|
854
|
+
onFocus?.(e);
|
|
855
|
+
},
|
|
856
|
+
onPointerEnter: (e) => {
|
|
857
|
+
reportHover(e.currentTarget);
|
|
858
|
+
onPointerEnter?.(e);
|
|
859
|
+
},
|
|
860
|
+
className: cn(
|
|
861
|
+
"flex cursor-default items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm font-medium leading-5 outline-hidden select-none focus-visible:text-accent-foreground not-data-[variant=destructive]:focus-visible:**:text-accent-foreground data-inset:pl-8 data-[state=open]:bg-black/[0.045] dark:data-[state=open]:bg-white/[0.08] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:text-muted-foreground/75",
|
|
862
|
+
className
|
|
863
|
+
),
|
|
864
|
+
...props,
|
|
865
|
+
children: [
|
|
866
|
+
children,
|
|
867
|
+
/* @__PURE__ */ jsx8(IconChevronRight, { className: "ml-auto" })
|
|
868
|
+
]
|
|
869
|
+
}
|
|
870
|
+
);
|
|
871
|
+
}
|
|
872
|
+
function DropdownMenuSubContent({
|
|
873
|
+
className,
|
|
874
|
+
children,
|
|
875
|
+
...props
|
|
876
|
+
}) {
|
|
877
|
+
const contentRef = React8.useRef(null);
|
|
878
|
+
const glass = useMenuHighlight(contentRef);
|
|
879
|
+
return /* @__PURE__ */ jsx8(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsxs2(
|
|
880
|
+
DropdownMenuPrimitive.SubContent,
|
|
881
|
+
{
|
|
882
|
+
ref: contentRef,
|
|
883
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
884
|
+
onPointerLeave: glass.clear,
|
|
885
|
+
className: cn(
|
|
886
|
+
subContentClasses,
|
|
887
|
+
"min-w-36 origin-(--radix-dropdown-menu-content-transform-origin) transform-gpu will-change-[opacity,transform] duration-160 ease-[cubic-bezier(0.23,1,0.32,1)] data-[state=closed]:overflow-hidden data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
888
|
+
className
|
|
889
|
+
),
|
|
890
|
+
...props,
|
|
891
|
+
children: [
|
|
892
|
+
glass.element,
|
|
893
|
+
/* @__PURE__ */ jsx8("div", { className: "relative z-10", children: /* @__PURE__ */ jsx8(MenuHighlightContext.Provider, { value: glass.ctx, children }) })
|
|
894
|
+
]
|
|
895
|
+
}
|
|
896
|
+
) });
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// src/components/field.tsx
|
|
900
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
901
|
+
|
|
902
|
+
// src/components/label.tsx
|
|
903
|
+
import "react";
|
|
904
|
+
import { Label as LabelPrimitive } from "radix-ui";
|
|
905
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
906
|
+
function Label({
|
|
907
|
+
className,
|
|
908
|
+
...props
|
|
909
|
+
}) {
|
|
910
|
+
return /* @__PURE__ */ jsx9(
|
|
911
|
+
LabelPrimitive.Root,
|
|
912
|
+
{
|
|
913
|
+
"data-slot": "label",
|
|
914
|
+
className: cn(
|
|
915
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
916
|
+
className
|
|
917
|
+
),
|
|
918
|
+
...props
|
|
919
|
+
}
|
|
920
|
+
);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
// src/components/separator.tsx
|
|
924
|
+
import "react";
|
|
925
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
926
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
927
|
+
function Separator({
|
|
928
|
+
className,
|
|
929
|
+
orientation = "horizontal",
|
|
930
|
+
decorative = true,
|
|
931
|
+
...props
|
|
932
|
+
}) {
|
|
933
|
+
return /* @__PURE__ */ jsx10(
|
|
934
|
+
SeparatorPrimitive.Root,
|
|
935
|
+
{
|
|
936
|
+
"data-slot": "separator",
|
|
937
|
+
decorative,
|
|
938
|
+
orientation,
|
|
939
|
+
className: cn(
|
|
940
|
+
"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
|
|
941
|
+
className
|
|
942
|
+
),
|
|
943
|
+
...props
|
|
944
|
+
}
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
// src/components/field.tsx
|
|
949
|
+
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
950
|
+
function FieldSet({ className, ...props }) {
|
|
951
|
+
return /* @__PURE__ */ jsx11(
|
|
952
|
+
"fieldset",
|
|
953
|
+
{
|
|
954
|
+
"data-slot": "field-set",
|
|
955
|
+
className: cn(
|
|
956
|
+
"flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
957
|
+
className
|
|
958
|
+
),
|
|
959
|
+
...props
|
|
960
|
+
}
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
function FieldLegend({
|
|
964
|
+
className,
|
|
965
|
+
variant = "legend",
|
|
966
|
+
...props
|
|
967
|
+
}) {
|
|
968
|
+
return /* @__PURE__ */ jsx11(
|
|
969
|
+
"legend",
|
|
970
|
+
{
|
|
971
|
+
"data-slot": "field-legend",
|
|
972
|
+
"data-variant": variant,
|
|
973
|
+
className: cn(
|
|
974
|
+
"mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",
|
|
975
|
+
className
|
|
976
|
+
),
|
|
977
|
+
...props
|
|
978
|
+
}
|
|
979
|
+
);
|
|
980
|
+
}
|
|
981
|
+
function FieldGroup({ className, ...props }) {
|
|
982
|
+
return /* @__PURE__ */ jsx11(
|
|
983
|
+
"div",
|
|
984
|
+
{
|
|
985
|
+
"data-slot": "field-group",
|
|
986
|
+
className: cn(
|
|
987
|
+
"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",
|
|
988
|
+
className
|
|
989
|
+
),
|
|
990
|
+
...props
|
|
991
|
+
}
|
|
992
|
+
);
|
|
993
|
+
}
|
|
994
|
+
var fieldVariants = cva3(
|
|
995
|
+
"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
996
|
+
{
|
|
997
|
+
variants: {
|
|
998
|
+
orientation: {
|
|
999
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
1000
|
+
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
1001
|
+
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
defaultVariants: {
|
|
1005
|
+
orientation: "vertical"
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
);
|
|
1009
|
+
function Field({
|
|
1010
|
+
className,
|
|
1011
|
+
orientation = "vertical",
|
|
1012
|
+
...props
|
|
1013
|
+
}) {
|
|
1014
|
+
return /* @__PURE__ */ jsx11(
|
|
1015
|
+
"div",
|
|
1016
|
+
{
|
|
1017
|
+
role: "group",
|
|
1018
|
+
"data-slot": "field",
|
|
1019
|
+
"data-orientation": orientation,
|
|
1020
|
+
className: cn(fieldVariants({ orientation }), className),
|
|
1021
|
+
...props
|
|
1022
|
+
}
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
function FieldContent({ className, ...props }) {
|
|
1026
|
+
return /* @__PURE__ */ jsx11(
|
|
1027
|
+
"div",
|
|
1028
|
+
{
|
|
1029
|
+
"data-slot": "field-content",
|
|
1030
|
+
className: cn(
|
|
1031
|
+
"group/field-content flex flex-1 flex-col gap-1 leading-snug",
|
|
1032
|
+
className
|
|
1033
|
+
),
|
|
1034
|
+
...props
|
|
1035
|
+
}
|
|
1036
|
+
);
|
|
1037
|
+
}
|
|
1038
|
+
function FieldLabel({
|
|
1039
|
+
className,
|
|
1040
|
+
...props
|
|
1041
|
+
}) {
|
|
1042
|
+
return /* @__PURE__ */ jsx11(
|
|
1043
|
+
Label,
|
|
1044
|
+
{
|
|
1045
|
+
"data-slot": "field-label",
|
|
1046
|
+
className: cn(
|
|
1047
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-xl has-[>[data-slot=field]]:border *:data-[slot=field]:p-4 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10",
|
|
1048
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",
|
|
1049
|
+
className
|
|
1050
|
+
),
|
|
1051
|
+
...props
|
|
1052
|
+
}
|
|
1053
|
+
);
|
|
1054
|
+
}
|
|
1055
|
+
function FieldTitle({ className, ...props }) {
|
|
1056
|
+
return /* @__PURE__ */ jsx11(
|
|
1057
|
+
"div",
|
|
1058
|
+
{
|
|
1059
|
+
"data-slot": "field-label",
|
|
1060
|
+
className: cn(
|
|
1061
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
|
|
1062
|
+
className
|
|
1063
|
+
),
|
|
1064
|
+
...props
|
|
1065
|
+
}
|
|
1066
|
+
);
|
|
1067
|
+
}
|
|
1068
|
+
function FieldDescription({ className, ...props }) {
|
|
1069
|
+
return /* @__PURE__ */ jsx11(
|
|
1070
|
+
"p",
|
|
1071
|
+
{
|
|
1072
|
+
"data-slot": "field-description",
|
|
1073
|
+
className: cn(
|
|
1074
|
+
"text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5",
|
|
1075
|
+
"last:mt-0 nth-last-2:-mt-1",
|
|
1076
|
+
"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
1077
|
+
className
|
|
1078
|
+
),
|
|
1079
|
+
...props
|
|
1080
|
+
}
|
|
1081
|
+
);
|
|
1082
|
+
}
|
|
1083
|
+
function FieldSeparator({
|
|
1084
|
+
children,
|
|
1085
|
+
className,
|
|
1086
|
+
...props
|
|
1087
|
+
}) {
|
|
1088
|
+
return /* @__PURE__ */ jsxs3(
|
|
1089
|
+
"div",
|
|
1090
|
+
{
|
|
1091
|
+
"data-slot": "field-separator",
|
|
1092
|
+
"data-content": !!children,
|
|
1093
|
+
className: cn(
|
|
1094
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
1095
|
+
className
|
|
1096
|
+
),
|
|
1097
|
+
...props,
|
|
1098
|
+
children: [
|
|
1099
|
+
/* @__PURE__ */ jsx11(Separator, { className: "absolute inset-0 top-1/2" }),
|
|
1100
|
+
children && /* @__PURE__ */ jsx11(
|
|
1101
|
+
"span",
|
|
1102
|
+
{
|
|
1103
|
+
className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
|
|
1104
|
+
"data-slot": "field-separator-content",
|
|
1105
|
+
children
|
|
1106
|
+
}
|
|
1107
|
+
)
|
|
1108
|
+
]
|
|
1109
|
+
}
|
|
1110
|
+
);
|
|
1111
|
+
}
|
|
1112
|
+
function FieldError({
|
|
1113
|
+
className,
|
|
1114
|
+
children,
|
|
1115
|
+
errors,
|
|
1116
|
+
...props
|
|
1117
|
+
}) {
|
|
1118
|
+
const uniqueErrors = errors?.length ? [...new Map(errors.map((error) => [error?.message, error])).values()] : [];
|
|
1119
|
+
const content = children ?? (uniqueErrors.length === 1 ? uniqueErrors[0]?.message : uniqueErrors.length > 1 ? /* @__PURE__ */ jsx11("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
|
|
1120
|
+
(error, index) => error?.message && /* @__PURE__ */ jsx11("li", { children: error.message }, index)
|
|
1121
|
+
) }) : null);
|
|
1122
|
+
if (!content) {
|
|
1123
|
+
return null;
|
|
1124
|
+
}
|
|
1125
|
+
return /* @__PURE__ */ jsx11(
|
|
1126
|
+
"div",
|
|
1127
|
+
{
|
|
1128
|
+
role: "alert",
|
|
1129
|
+
"data-slot": "field-error",
|
|
1130
|
+
className: cn("text-sm font-normal text-destructive", className),
|
|
1131
|
+
...props,
|
|
1132
|
+
children: content
|
|
1133
|
+
}
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
// src/components/input.tsx
|
|
1138
|
+
import "react";
|
|
1139
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1140
|
+
function Input({ className, type, ...props }) {
|
|
1141
|
+
return /* @__PURE__ */ jsx12(
|
|
1142
|
+
"input",
|
|
1143
|
+
{
|
|
1144
|
+
type,
|
|
1145
|
+
"data-slot": "input",
|
|
1146
|
+
className: cn(
|
|
1147
|
+
"h-9 w-full min-w-0 rounded-4xl border border-input bg-input/30 px-3 py-1 text-base transition-colors outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-foreground/25 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
1148
|
+
className
|
|
1149
|
+
),
|
|
1150
|
+
...props
|
|
1151
|
+
}
|
|
1152
|
+
);
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
// src/components/popover.tsx
|
|
1156
|
+
import "react";
|
|
1157
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
1158
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1159
|
+
function Popover({
|
|
1160
|
+
...props
|
|
1161
|
+
}) {
|
|
1162
|
+
return /* @__PURE__ */ jsx13(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
1163
|
+
}
|
|
1164
|
+
function PopoverTrigger({
|
|
1165
|
+
...props
|
|
1166
|
+
}) {
|
|
1167
|
+
return /* @__PURE__ */ jsx13(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
1168
|
+
}
|
|
1169
|
+
function PopoverContent({
|
|
1170
|
+
className,
|
|
1171
|
+
align = "center",
|
|
1172
|
+
sideOffset = 4,
|
|
1173
|
+
...props
|
|
1174
|
+
}) {
|
|
1175
|
+
return /* @__PURE__ */ jsx13(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx13(
|
|
1176
|
+
PopoverPrimitive.Content,
|
|
1177
|
+
{
|
|
1178
|
+
"data-slot": "popover-content",
|
|
1179
|
+
align,
|
|
1180
|
+
sideOffset,
|
|
1181
|
+
className: cn(
|
|
1182
|
+
"z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-4 rounded-2xl bg-popover/75 dark:bg-zinc-900/75 backdrop-blur-[3px] p-4 text-sm text-popover-foreground shadow-xl shadow-black/10 dark:shadow-black/30 ring-1 ring-white/15 dark:ring-white/10 inset-ring inset-ring-white/10 dark:inset-ring-white/5 outline-hidden duration-200 ease-out data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
1183
|
+
className
|
|
1184
|
+
),
|
|
1185
|
+
...props
|
|
1186
|
+
}
|
|
1187
|
+
) });
|
|
1188
|
+
}
|
|
1189
|
+
function PopoverAnchor({
|
|
1190
|
+
...props
|
|
1191
|
+
}) {
|
|
1192
|
+
return /* @__PURE__ */ jsx13(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
1193
|
+
}
|
|
1194
|
+
function PopoverHeader({ className, ...props }) {
|
|
1195
|
+
return /* @__PURE__ */ jsx13(
|
|
1196
|
+
"div",
|
|
1197
|
+
{
|
|
1198
|
+
"data-slot": "popover-header",
|
|
1199
|
+
className: cn("flex flex-col gap-1 text-sm", className),
|
|
1200
|
+
...props
|
|
1201
|
+
}
|
|
1202
|
+
);
|
|
1203
|
+
}
|
|
1204
|
+
function PopoverTitle({ className, ...props }) {
|
|
1205
|
+
return /* @__PURE__ */ jsx13(
|
|
1206
|
+
"div",
|
|
1207
|
+
{
|
|
1208
|
+
"data-slot": "popover-title",
|
|
1209
|
+
className: cn("text-base font-medium", className),
|
|
1210
|
+
...props
|
|
1211
|
+
}
|
|
1212
|
+
);
|
|
1213
|
+
}
|
|
1214
|
+
function PopoverDescription({
|
|
1215
|
+
className,
|
|
1216
|
+
...props
|
|
1217
|
+
}) {
|
|
1218
|
+
return /* @__PURE__ */ jsx13(
|
|
1219
|
+
"p",
|
|
1220
|
+
{
|
|
1221
|
+
"data-slot": "popover-description",
|
|
1222
|
+
className: cn("text-muted-foreground", className),
|
|
1223
|
+
...props
|
|
1224
|
+
}
|
|
1225
|
+
);
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
// src/components/progress.tsx
|
|
1229
|
+
import "react";
|
|
1230
|
+
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
1231
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1232
|
+
function Progress({
|
|
1233
|
+
className,
|
|
1234
|
+
value,
|
|
1235
|
+
...props
|
|
1236
|
+
}) {
|
|
1237
|
+
return /* @__PURE__ */ jsx14(
|
|
1238
|
+
ProgressPrimitive.Root,
|
|
1239
|
+
{
|
|
1240
|
+
"data-slot": "progress",
|
|
1241
|
+
className: cn(
|
|
1242
|
+
"relative flex h-3 w-full items-center overflow-x-hidden rounded-4xl bg-muted",
|
|
1243
|
+
className
|
|
1244
|
+
),
|
|
1245
|
+
...props,
|
|
1246
|
+
children: /* @__PURE__ */ jsx14(
|
|
1247
|
+
ProgressPrimitive.Indicator,
|
|
1248
|
+
{
|
|
1249
|
+
"data-slot": "progress-indicator",
|
|
1250
|
+
className: "size-full flex-1 bg-primary transition-all",
|
|
1251
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
1252
|
+
}
|
|
1253
|
+
)
|
|
1254
|
+
}
|
|
1255
|
+
);
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
// src/components/select.tsx
|
|
1259
|
+
import "react";
|
|
1260
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
1261
|
+
import { IconCheck as IconCheck3, IconChevronDown, IconChevronUp, IconSelector } from "@tabler/icons-react";
|
|
1262
|
+
import { jsx as jsx15, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1263
|
+
var contentClasses2 = cn(
|
|
1264
|
+
"relative z-50 overflow-x-hidden overflow-y-auto p-1",
|
|
1265
|
+
liquidMenuSurfaceClasses
|
|
1266
|
+
);
|
|
1267
|
+
function Select({
|
|
1268
|
+
...props
|
|
1269
|
+
}) {
|
|
1270
|
+
return /* @__PURE__ */ jsx15(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
1271
|
+
}
|
|
1272
|
+
function SelectGroup({
|
|
1273
|
+
className,
|
|
1274
|
+
...props
|
|
1275
|
+
}) {
|
|
1276
|
+
return /* @__PURE__ */ jsx15(
|
|
1277
|
+
SelectPrimitive.Group,
|
|
1278
|
+
{
|
|
1279
|
+
"data-slot": "select-group",
|
|
1280
|
+
className: cn("scroll-my-1", className),
|
|
1281
|
+
...props
|
|
1282
|
+
}
|
|
1283
|
+
);
|
|
1284
|
+
}
|
|
1285
|
+
function SelectValue({
|
|
1286
|
+
...props
|
|
1287
|
+
}) {
|
|
1288
|
+
return /* @__PURE__ */ jsx15(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
1289
|
+
}
|
|
1290
|
+
function SelectTrigger({
|
|
1291
|
+
className,
|
|
1292
|
+
size = "default",
|
|
1293
|
+
children,
|
|
1294
|
+
...props
|
|
1295
|
+
}) {
|
|
1296
|
+
return /* @__PURE__ */ jsxs4(
|
|
1297
|
+
SelectPrimitive.Trigger,
|
|
1298
|
+
{
|
|
1299
|
+
"data-slot": "select-trigger",
|
|
1300
|
+
"data-size": size,
|
|
1301
|
+
className: cn(
|
|
1302
|
+
"flex w-fit items-center justify-between gap-1.5 rounded-4xl border border-input bg-input/30 px-3 py-2 text-sm whitespace-nowrap outline-none transition-[color,background-color,border-color,box-shadow,transform] duration-150 ease-out motion-safe:active:scale-[0.98] focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1303
|
+
className
|
|
1304
|
+
),
|
|
1305
|
+
...props,
|
|
1306
|
+
children: [
|
|
1307
|
+
children,
|
|
1308
|
+
/* @__PURE__ */ jsx15(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx15(IconSelector, { className: "pointer-events-none size-4 text-muted-foreground" }) })
|
|
1309
|
+
]
|
|
1310
|
+
}
|
|
1311
|
+
);
|
|
1312
|
+
}
|
|
1313
|
+
function SelectContent({
|
|
1314
|
+
className,
|
|
1315
|
+
children,
|
|
1316
|
+
position = "item-aligned",
|
|
1317
|
+
align = "center",
|
|
1318
|
+
...props
|
|
1319
|
+
}) {
|
|
1320
|
+
return /* @__PURE__ */ jsx15(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs4(
|
|
1321
|
+
SelectPrimitive.Content,
|
|
1322
|
+
{
|
|
1323
|
+
"data-slot": "select-content",
|
|
1324
|
+
"data-align-trigger": position === "item-aligned",
|
|
1325
|
+
className: cn(
|
|
1326
|
+
contentClasses2,
|
|
1327
|
+
"max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) transform-gpu will-change-[opacity,transform] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] data-[state=closed]:overflow-hidden data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
1328
|
+
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",
|
|
1329
|
+
className
|
|
1330
|
+
),
|
|
1331
|
+
position,
|
|
1332
|
+
align,
|
|
1333
|
+
...props,
|
|
1334
|
+
children: [
|
|
1335
|
+
/* @__PURE__ */ jsx15(SelectScrollUpButton, {}),
|
|
1336
|
+
/* @__PURE__ */ jsx15(
|
|
1337
|
+
SelectPrimitive.Viewport,
|
|
1338
|
+
{
|
|
1339
|
+
"data-position": position,
|
|
1340
|
+
className: cn(
|
|
1341
|
+
"data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)"
|
|
1342
|
+
),
|
|
1343
|
+
children
|
|
1344
|
+
}
|
|
1345
|
+
),
|
|
1346
|
+
/* @__PURE__ */ jsx15(SelectScrollDownButton, {})
|
|
1347
|
+
]
|
|
1348
|
+
}
|
|
1349
|
+
) });
|
|
1350
|
+
}
|
|
1351
|
+
function SelectLabel({
|
|
1352
|
+
className,
|
|
1353
|
+
...props
|
|
1354
|
+
}) {
|
|
1355
|
+
return /* @__PURE__ */ jsx15(
|
|
1356
|
+
SelectPrimitive.Label,
|
|
1357
|
+
{
|
|
1358
|
+
"data-slot": "select-label",
|
|
1359
|
+
className: cn("px-2.5 pt-2 pb-1 text-xs font-medium text-muted-foreground/60", className),
|
|
1360
|
+
...props
|
|
1361
|
+
}
|
|
1362
|
+
);
|
|
1363
|
+
}
|
|
1364
|
+
function SelectItem({
|
|
1365
|
+
className,
|
|
1366
|
+
children,
|
|
1367
|
+
...props
|
|
1368
|
+
}) {
|
|
1369
|
+
return /* @__PURE__ */ jsxs4(
|
|
1370
|
+
SelectPrimitive.Item,
|
|
1371
|
+
{
|
|
1372
|
+
"data-slot": "select-item",
|
|
1373
|
+
className: cn(
|
|
1374
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2.5 text-sm font-medium leading-5 outline-hidden select-none transition-colors duration-100 ease-out focus:bg-black/[0.045] focus:text-accent-foreground dark:focus:bg-white/[0.08] not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:text-muted-foreground/75 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
1375
|
+
className
|
|
1376
|
+
),
|
|
1377
|
+
...props,
|
|
1378
|
+
children: [
|
|
1379
|
+
/* @__PURE__ */ jsx15("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx15(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx15(IconCheck3, { className: "pointer-events-none" }) }) }),
|
|
1380
|
+
/* @__PURE__ */ jsx15(SelectPrimitive.ItemText, { children })
|
|
1381
|
+
]
|
|
1382
|
+
}
|
|
1383
|
+
);
|
|
1384
|
+
}
|
|
1385
|
+
function SelectSeparator({
|
|
1386
|
+
className,
|
|
1387
|
+
...props
|
|
1388
|
+
}) {
|
|
1389
|
+
return /* @__PURE__ */ jsx15(
|
|
1390
|
+
SelectPrimitive.Separator,
|
|
1391
|
+
{
|
|
1392
|
+
"data-slot": "select-separator",
|
|
1393
|
+
className: cn("-mx-1 my-1 h-px bg-border/50", className),
|
|
1394
|
+
...props
|
|
1395
|
+
}
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
function SelectScrollUpButton({
|
|
1399
|
+
className,
|
|
1400
|
+
...props
|
|
1401
|
+
}) {
|
|
1402
|
+
return /* @__PURE__ */ jsx15(
|
|
1403
|
+
SelectPrimitive.ScrollUpButton,
|
|
1404
|
+
{
|
|
1405
|
+
"data-slot": "select-scroll-up-button",
|
|
1406
|
+
className: cn(
|
|
1407
|
+
"z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
1408
|
+
className
|
|
1409
|
+
),
|
|
1410
|
+
...props,
|
|
1411
|
+
children: /* @__PURE__ */ jsx15(IconChevronUp, {})
|
|
1412
|
+
}
|
|
1413
|
+
);
|
|
1414
|
+
}
|
|
1415
|
+
function SelectScrollDownButton({
|
|
1416
|
+
className,
|
|
1417
|
+
...props
|
|
1418
|
+
}) {
|
|
1419
|
+
return /* @__PURE__ */ jsx15(
|
|
1420
|
+
SelectPrimitive.ScrollDownButton,
|
|
1421
|
+
{
|
|
1422
|
+
"data-slot": "select-scroll-down-button",
|
|
1423
|
+
className: cn(
|
|
1424
|
+
"z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
1425
|
+
className
|
|
1426
|
+
),
|
|
1427
|
+
...props,
|
|
1428
|
+
children: /* @__PURE__ */ jsx15(IconChevronDown, {})
|
|
1429
|
+
}
|
|
1430
|
+
);
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// src/components/skeleton.tsx
|
|
1434
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1435
|
+
function Skeleton({ className, ...props }) {
|
|
1436
|
+
return /* @__PURE__ */ jsx16(
|
|
1437
|
+
"div",
|
|
1438
|
+
{
|
|
1439
|
+
"data-slot": "skeleton",
|
|
1440
|
+
className: cn("animate-pulse rounded-xl bg-muted", className),
|
|
1441
|
+
...props
|
|
1442
|
+
}
|
|
1443
|
+
);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
// src/components/slider.tsx
|
|
1447
|
+
import * as React15 from "react";
|
|
1448
|
+
import { Slider as SliderPrimitive } from "radix-ui";
|
|
1449
|
+
import { jsx as jsx17, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1450
|
+
function Slider({
|
|
1451
|
+
className,
|
|
1452
|
+
defaultValue,
|
|
1453
|
+
value,
|
|
1454
|
+
min = 0,
|
|
1455
|
+
max = 100,
|
|
1456
|
+
...props
|
|
1457
|
+
}) {
|
|
1458
|
+
const _values = React15.useMemo(
|
|
1459
|
+
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
1460
|
+
[value, defaultValue, min, max]
|
|
1461
|
+
);
|
|
1462
|
+
const optionalProps = {};
|
|
1463
|
+
if (defaultValue !== void 0) optionalProps.defaultValue = defaultValue;
|
|
1464
|
+
if (value !== void 0) optionalProps.value = value;
|
|
1465
|
+
if (min !== void 0) optionalProps.min = min;
|
|
1466
|
+
if (max !== void 0) optionalProps.max = max;
|
|
1467
|
+
return /* @__PURE__ */ jsxs5(
|
|
1468
|
+
SliderPrimitive.Root,
|
|
1469
|
+
{
|
|
1470
|
+
"data-slot": "slider",
|
|
1471
|
+
...optionalProps,
|
|
1472
|
+
className: cn(
|
|
1473
|
+
"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",
|
|
1474
|
+
className
|
|
1475
|
+
),
|
|
1476
|
+
...props,
|
|
1477
|
+
children: [
|
|
1478
|
+
/* @__PURE__ */ jsx17(
|
|
1479
|
+
SliderPrimitive.Track,
|
|
1480
|
+
{
|
|
1481
|
+
"data-slot": "slider-track",
|
|
1482
|
+
className: "relative grow overflow-hidden rounded-4xl bg-muted data-horizontal:h-3 data-horizontal:w-full data-vertical:h-full data-vertical:w-3",
|
|
1483
|
+
children: /* @__PURE__ */ jsx17(
|
|
1484
|
+
SliderPrimitive.Range,
|
|
1485
|
+
{
|
|
1486
|
+
"data-slot": "slider-range",
|
|
1487
|
+
className: "absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full"
|
|
1488
|
+
}
|
|
1489
|
+
)
|
|
1490
|
+
}
|
|
1491
|
+
),
|
|
1492
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx17(
|
|
1493
|
+
SliderPrimitive.Thumb,
|
|
1494
|
+
{
|
|
1495
|
+
"data-slot": "slider-thumb",
|
|
1496
|
+
className: "block size-4 shrink-0 rounded-4xl border border-primary bg-white shadow-sm ring-ring/50 transition-colors select-none hover:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 dark:bg-foreground"
|
|
1497
|
+
},
|
|
1498
|
+
index
|
|
1499
|
+
))
|
|
1500
|
+
]
|
|
1501
|
+
}
|
|
1502
|
+
);
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
// src/components/switch.tsx
|
|
1506
|
+
import "react";
|
|
1507
|
+
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
1508
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1509
|
+
function Switch({
|
|
1510
|
+
className,
|
|
1511
|
+
size = "default",
|
|
1512
|
+
...props
|
|
1513
|
+
}) {
|
|
1514
|
+
return /* @__PURE__ */ jsx18(
|
|
1515
|
+
SwitchPrimitive.Root,
|
|
1516
|
+
{
|
|
1517
|
+
"data-slot": "switch",
|
|
1518
|
+
"data-size": size,
|
|
1519
|
+
className: cn(
|
|
1520
|
+
"peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-muted-foreground/30 data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
1521
|
+
className
|
|
1522
|
+
),
|
|
1523
|
+
...props,
|
|
1524
|
+
children: /* @__PURE__ */ jsx18(
|
|
1525
|
+
SwitchPrimitive.Thumb,
|
|
1526
|
+
{
|
|
1527
|
+
"data-slot": "switch-thumb",
|
|
1528
|
+
className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
|
|
1529
|
+
}
|
|
1530
|
+
)
|
|
1531
|
+
}
|
|
1532
|
+
);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
// src/components/table.tsx
|
|
1536
|
+
import "react";
|
|
1537
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1538
|
+
function Table({ className, ...props }) {
|
|
1539
|
+
return /* @__PURE__ */ jsx19(
|
|
1540
|
+
"div",
|
|
1541
|
+
{
|
|
1542
|
+
"data-slot": "table-container",
|
|
1543
|
+
className: "relative w-full overflow-x-auto",
|
|
1544
|
+
children: /* @__PURE__ */ jsx19(
|
|
1545
|
+
"table",
|
|
1546
|
+
{
|
|
1547
|
+
"data-slot": "table",
|
|
1548
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
1549
|
+
...props
|
|
1550
|
+
}
|
|
1551
|
+
)
|
|
1552
|
+
}
|
|
1553
|
+
);
|
|
1554
|
+
}
|
|
1555
|
+
function TableHeader({ className, ...props }) {
|
|
1556
|
+
return /* @__PURE__ */ jsx19(
|
|
1557
|
+
"thead",
|
|
1558
|
+
{
|
|
1559
|
+
"data-slot": "table-header",
|
|
1560
|
+
className: cn("[&_tr]:border-b [&_tr]:border-border/60", className),
|
|
1561
|
+
...props
|
|
1562
|
+
}
|
|
1563
|
+
);
|
|
1564
|
+
}
|
|
1565
|
+
function TableBody({ className, ...props }) {
|
|
1566
|
+
return /* @__PURE__ */ jsx19(
|
|
1567
|
+
"tbody",
|
|
1568
|
+
{
|
|
1569
|
+
"data-slot": "table-body",
|
|
1570
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
1571
|
+
...props
|
|
1572
|
+
}
|
|
1573
|
+
);
|
|
1574
|
+
}
|
|
1575
|
+
function TableFooter({ className, ...props }) {
|
|
1576
|
+
return /* @__PURE__ */ jsx19(
|
|
1577
|
+
"tfoot",
|
|
1578
|
+
{
|
|
1579
|
+
"data-slot": "table-footer",
|
|
1580
|
+
className: cn(
|
|
1581
|
+
"border-t border-border/60 bg-muted/40 font-medium [&>tr]:last:border-b-0",
|
|
1582
|
+
className
|
|
1583
|
+
),
|
|
1584
|
+
...props
|
|
1585
|
+
}
|
|
1586
|
+
);
|
|
1587
|
+
}
|
|
1588
|
+
function TableRow({ className, ...props }) {
|
|
1589
|
+
return /* @__PURE__ */ jsx19(
|
|
1590
|
+
"tr",
|
|
1591
|
+
{
|
|
1592
|
+
"data-slot": "table-row",
|
|
1593
|
+
className: cn(
|
|
1594
|
+
"border-b border-border/60 transition-colors hover:bg-muted/40 data-[state=selected]:bg-muted",
|
|
1595
|
+
className
|
|
1596
|
+
),
|
|
1597
|
+
...props
|
|
1598
|
+
}
|
|
1599
|
+
);
|
|
1600
|
+
}
|
|
1601
|
+
function TableHead({ className, ...props }) {
|
|
1602
|
+
return /* @__PURE__ */ jsx19(
|
|
1603
|
+
"th",
|
|
1604
|
+
{
|
|
1605
|
+
"data-slot": "table-head",
|
|
1606
|
+
className: cn(
|
|
1607
|
+
"h-9 px-4 text-left align-middle text-xs font-medium whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
1608
|
+
className
|
|
1609
|
+
),
|
|
1610
|
+
...props
|
|
1611
|
+
}
|
|
1612
|
+
);
|
|
1613
|
+
}
|
|
1614
|
+
function TableCell({ className, ...props }) {
|
|
1615
|
+
return /* @__PURE__ */ jsx19(
|
|
1616
|
+
"td",
|
|
1617
|
+
{
|
|
1618
|
+
"data-slot": "table-cell",
|
|
1619
|
+
className: cn(
|
|
1620
|
+
"px-4 py-3 align-middle whitespace-nowrap tabular-nums [&:has([role=checkbox])]:pr-0",
|
|
1621
|
+
className
|
|
1622
|
+
),
|
|
1623
|
+
...props
|
|
1624
|
+
}
|
|
1625
|
+
);
|
|
1626
|
+
}
|
|
1627
|
+
function TableCaption({
|
|
1628
|
+
className,
|
|
1629
|
+
...props
|
|
1630
|
+
}) {
|
|
1631
|
+
return /* @__PURE__ */ jsx19(
|
|
1632
|
+
"caption",
|
|
1633
|
+
{
|
|
1634
|
+
"data-slot": "table-caption",
|
|
1635
|
+
className: cn("mt-3 text-sm text-muted-foreground", className),
|
|
1636
|
+
...props
|
|
1637
|
+
}
|
|
1638
|
+
);
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
// src/components/tabs.tsx
|
|
1642
|
+
import "react";
|
|
1643
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
1644
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
1645
|
+
import { motion as motion2 } from "framer-motion";
|
|
1646
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1647
|
+
var TABS_LAYOUT_SPRING = {
|
|
1648
|
+
type: "spring",
|
|
1649
|
+
stiffness: 720,
|
|
1650
|
+
damping: 46,
|
|
1651
|
+
mass: 0.48
|
|
1652
|
+
};
|
|
1653
|
+
function Tabs({
|
|
1654
|
+
className,
|
|
1655
|
+
orientation = "horizontal",
|
|
1656
|
+
...props
|
|
1657
|
+
}) {
|
|
1658
|
+
return /* @__PURE__ */ jsx20(
|
|
1659
|
+
TabsPrimitive.Root,
|
|
1660
|
+
{
|
|
1661
|
+
"data-slot": "tabs",
|
|
1662
|
+
"data-orientation": orientation,
|
|
1663
|
+
className: cn(
|
|
1664
|
+
"group/tabs flex gap-2 data-horizontal:flex-col",
|
|
1665
|
+
className
|
|
1666
|
+
),
|
|
1667
|
+
...props
|
|
1668
|
+
}
|
|
1669
|
+
);
|
|
1670
|
+
}
|
|
1671
|
+
var tabsListVariants = cva4(
|
|
1672
|
+
"group/tabs-list relative inline-flex w-fit items-center justify-center rounded-4xl p-[3px] text-muted-foreground group-data-horizontal/tabs:h-9 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col group-data-vertical/tabs:rounded-2xl data-[variant=line]:rounded-none",
|
|
1673
|
+
{
|
|
1674
|
+
variants: {
|
|
1675
|
+
variant: {
|
|
1676
|
+
default: "bg-muted/70 border border-black/4 shadow-[inset_0_1px_2px_rgba(0,0,0,0.06)] dark:bg-white/4 dark:border-white/4 dark:shadow-[inset_0_1px_3px_rgba(0,0,0,0.3)]",
|
|
1677
|
+
line: "gap-1 bg-transparent"
|
|
1678
|
+
}
|
|
1679
|
+
},
|
|
1680
|
+
defaultVariants: {
|
|
1681
|
+
variant: "default"
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
);
|
|
1685
|
+
function TabsList({
|
|
1686
|
+
className,
|
|
1687
|
+
variant = "default",
|
|
1688
|
+
...props
|
|
1689
|
+
}) {
|
|
1690
|
+
return /* @__PURE__ */ jsx20(
|
|
1691
|
+
TabsPrimitive.List,
|
|
1692
|
+
{
|
|
1693
|
+
"data-slot": "tabs-list",
|
|
1694
|
+
"data-variant": variant,
|
|
1695
|
+
className: cn(tabsListVariants({ variant }), className),
|
|
1696
|
+
...props
|
|
1697
|
+
}
|
|
1698
|
+
);
|
|
1699
|
+
}
|
|
1700
|
+
function TabsTrigger({
|
|
1701
|
+
className,
|
|
1702
|
+
...props
|
|
1703
|
+
}) {
|
|
1704
|
+
return /* @__PURE__ */ jsx20(
|
|
1705
|
+
TabsPrimitive.Trigger,
|
|
1706
|
+
{
|
|
1707
|
+
"data-slot": "tabs-trigger",
|
|
1708
|
+
className: cn(
|
|
1709
|
+
"relative z-1 inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/50 transition-[color,background-color,border-color] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:px-2.5 group-data-vertical/tabs:py-1.5 hover:text-foreground/80 focus-visible:border-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground/70 dark:hover:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1710
|
+
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent group-data-[variant=line]/tabs-list:data-active:shadow-none dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
1711
|
+
"data-active:text-foreground data-active:hover:text-foreground dark:data-active:text-foreground dark:data-active:hover:text-foreground",
|
|
1712
|
+
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:-bottom-1.25 group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
1713
|
+
className
|
|
1714
|
+
),
|
|
1715
|
+
...props
|
|
1716
|
+
}
|
|
1717
|
+
);
|
|
1718
|
+
}
|
|
1719
|
+
function TabsIndicator({
|
|
1720
|
+
className,
|
|
1721
|
+
layoutId = "tabs-indicator"
|
|
1722
|
+
}) {
|
|
1723
|
+
return /* @__PURE__ */ jsx20(
|
|
1724
|
+
motion2.div,
|
|
1725
|
+
{
|
|
1726
|
+
layout: "position",
|
|
1727
|
+
layoutId,
|
|
1728
|
+
className: cn(
|
|
1729
|
+
"absolute inset-0 z-[-1] rounded-xl bg-background border border-black/6 shadow-[0_1px_3px_0_rgba(0,0,0,0.08)] dark:bg-white/7 dark:border-white/6 dark:shadow-[0_1px_3px_0_rgba(0,0,0,0.3),inset_0_1px_0_0_rgba(255,255,255,0.04)]",
|
|
1730
|
+
className
|
|
1731
|
+
),
|
|
1732
|
+
transition: TABS_LAYOUT_SPRING
|
|
1733
|
+
}
|
|
1734
|
+
);
|
|
1735
|
+
}
|
|
1736
|
+
function TabsContent({
|
|
1737
|
+
className,
|
|
1738
|
+
...props
|
|
1739
|
+
}) {
|
|
1740
|
+
return /* @__PURE__ */ jsx20(
|
|
1741
|
+
TabsPrimitive.Content,
|
|
1742
|
+
{
|
|
1743
|
+
"data-slot": "tabs-content",
|
|
1744
|
+
className: cn(
|
|
1745
|
+
"flex-1 text-sm outline-none animate-in fade-in-0 slide-in-from-bottom-0.5 duration-100 ease-out",
|
|
1746
|
+
className
|
|
1747
|
+
),
|
|
1748
|
+
...props
|
|
1749
|
+
}
|
|
1750
|
+
);
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
// src/components/textarea.tsx
|
|
1754
|
+
import "react";
|
|
1755
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1756
|
+
function Textarea({ className, ...props }) {
|
|
1757
|
+
return /* @__PURE__ */ jsx21(
|
|
1758
|
+
"textarea",
|
|
1759
|
+
{
|
|
1760
|
+
"data-slot": "textarea",
|
|
1761
|
+
className: cn(
|
|
1762
|
+
"flex field-sizing-content min-h-16 w-full resize-none rounded-xl border border-input bg-input/30 px-3 py-3 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-foreground/25 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
1763
|
+
className
|
|
1764
|
+
),
|
|
1765
|
+
...props
|
|
1766
|
+
}
|
|
1767
|
+
);
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
// src/components/toggle.tsx
|
|
1771
|
+
import "react";
|
|
1772
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
1773
|
+
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
1774
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1775
|
+
var toggleVariants = cva5(
|
|
1776
|
+
"group/toggle inline-flex items-center justify-center gap-1 rounded-[min(var(--radius-2xl),12px)] text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1777
|
+
{
|
|
1778
|
+
variants: {
|
|
1779
|
+
variant: {
|
|
1780
|
+
default: "bg-transparent",
|
|
1781
|
+
outline: "border border-input bg-transparent hover:bg-muted"
|
|
1782
|
+
},
|
|
1783
|
+
size: {
|
|
1784
|
+
default: "h-9 min-w-9 px-2.5",
|
|
1785
|
+
sm: "h-8 min-w-8 px-2",
|
|
1786
|
+
lg: "h-10 min-w-10 px-2.5"
|
|
1787
|
+
}
|
|
1788
|
+
},
|
|
1789
|
+
defaultVariants: {
|
|
1790
|
+
variant: "default",
|
|
1791
|
+
size: "default"
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
);
|
|
1795
|
+
function Toggle({
|
|
1796
|
+
className,
|
|
1797
|
+
variant = "default",
|
|
1798
|
+
size = "default",
|
|
1799
|
+
...props
|
|
1800
|
+
}) {
|
|
1801
|
+
return /* @__PURE__ */ jsx22(
|
|
1802
|
+
TogglePrimitive.Root,
|
|
1803
|
+
{
|
|
1804
|
+
"data-slot": "toggle",
|
|
1805
|
+
className: cn(toggleVariants({ variant, size, className })),
|
|
1806
|
+
...props
|
|
1807
|
+
}
|
|
1808
|
+
);
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
// src/components/tooltip.tsx
|
|
1812
|
+
import "react";
|
|
1813
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
1814
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1815
|
+
function TooltipProvider({
|
|
1816
|
+
delayDuration = 0,
|
|
1817
|
+
...props
|
|
1818
|
+
}) {
|
|
1819
|
+
return /* @__PURE__ */ jsx23(
|
|
1820
|
+
TooltipPrimitive.Provider,
|
|
1821
|
+
{
|
|
1822
|
+
"data-slot": "tooltip-provider",
|
|
1823
|
+
delayDuration,
|
|
1824
|
+
...props
|
|
1825
|
+
}
|
|
1826
|
+
);
|
|
1827
|
+
}
|
|
1828
|
+
function Tooltip({
|
|
1829
|
+
...props
|
|
1830
|
+
}) {
|
|
1831
|
+
return /* @__PURE__ */ jsx23(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
1832
|
+
}
|
|
1833
|
+
function TooltipTrigger({
|
|
1834
|
+
...props
|
|
1835
|
+
}) {
|
|
1836
|
+
return /* @__PURE__ */ jsx23(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
1837
|
+
}
|
|
1838
|
+
function TooltipContent({
|
|
1839
|
+
className,
|
|
1840
|
+
sideOffset = 0,
|
|
1841
|
+
children,
|
|
1842
|
+
...props
|
|
1843
|
+
}) {
|
|
1844
|
+
return /* @__PURE__ */ jsx23(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx23(
|
|
1845
|
+
TooltipPrimitive.Content,
|
|
1846
|
+
{
|
|
1847
|
+
"data-slot": "tooltip-content",
|
|
1848
|
+
sideOffset,
|
|
1849
|
+
className: cn(
|
|
1850
|
+
"relative z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) overflow-hidden px-3 py-1.5 text-xs duration-150 ease-[cubic-bezier(0.23,1,0.32,1)]",
|
|
1851
|
+
liquidMenuSurfaceClasses,
|
|
1852
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:rounded-4xl data-[state$=-open]:animate-in data-[state$=-open]:fade-in-0 data-[state$=-open]:zoom-in-95",
|
|
1853
|
+
className
|
|
1854
|
+
),
|
|
1855
|
+
...props,
|
|
1856
|
+
children
|
|
1857
|
+
}
|
|
1858
|
+
) });
|
|
1859
|
+
}
|
|
1860
|
+
export {
|
|
1861
|
+
Badge,
|
|
1862
|
+
Button,
|
|
1863
|
+
Card,
|
|
1864
|
+
CardAction,
|
|
1865
|
+
CardContent,
|
|
1866
|
+
CardDescription,
|
|
1867
|
+
CardFooter,
|
|
1868
|
+
CardHeader,
|
|
1869
|
+
CardTitle,
|
|
1870
|
+
Checkbox,
|
|
1871
|
+
ColineAppProvider,
|
|
1872
|
+
Dialog,
|
|
1873
|
+
DialogClose,
|
|
1874
|
+
DialogContent,
|
|
1875
|
+
DialogDescription,
|
|
1876
|
+
DialogFooter,
|
|
1877
|
+
DialogHeader,
|
|
1878
|
+
DialogOverlay,
|
|
1879
|
+
DialogPortal,
|
|
1880
|
+
DialogTitle,
|
|
1881
|
+
DialogTrigger,
|
|
1882
|
+
DropdownMenu,
|
|
1883
|
+
DropdownMenuCheckboxItem,
|
|
1884
|
+
DropdownMenuContent,
|
|
1885
|
+
DropdownMenuGroup,
|
|
1886
|
+
DropdownMenuItem,
|
|
1887
|
+
DropdownMenuLabel,
|
|
1888
|
+
DropdownMenuPortal,
|
|
1889
|
+
DropdownMenuRadioGroup,
|
|
1890
|
+
DropdownMenuRadioItem,
|
|
1891
|
+
DropdownMenuSeparator,
|
|
1892
|
+
DropdownMenuShortcut,
|
|
1893
|
+
DropdownMenuSub,
|
|
1894
|
+
DropdownMenuSubContent,
|
|
1895
|
+
DropdownMenuSubTrigger,
|
|
1896
|
+
DropdownMenuTrigger,
|
|
1897
|
+
Field,
|
|
1898
|
+
FieldContent,
|
|
1899
|
+
FieldDescription,
|
|
1900
|
+
FieldError,
|
|
1901
|
+
FieldGroup,
|
|
1902
|
+
FieldLabel,
|
|
1903
|
+
FieldLegend,
|
|
1904
|
+
FieldSeparator,
|
|
1905
|
+
FieldSet,
|
|
1906
|
+
FieldTitle,
|
|
1907
|
+
Input,
|
|
1908
|
+
Label,
|
|
1909
|
+
Popover,
|
|
1910
|
+
PopoverAnchor,
|
|
1911
|
+
PopoverContent,
|
|
1912
|
+
PopoverDescription,
|
|
1913
|
+
PopoverHeader,
|
|
1914
|
+
PopoverTitle,
|
|
1915
|
+
PopoverTrigger,
|
|
1916
|
+
Progress,
|
|
1917
|
+
Select,
|
|
1918
|
+
SelectContent,
|
|
1919
|
+
SelectGroup,
|
|
1920
|
+
SelectItem,
|
|
1921
|
+
SelectLabel,
|
|
1922
|
+
SelectScrollDownButton,
|
|
1923
|
+
SelectScrollUpButton,
|
|
1924
|
+
SelectSeparator,
|
|
1925
|
+
SelectTrigger,
|
|
1926
|
+
SelectValue,
|
|
1927
|
+
Separator,
|
|
1928
|
+
Skeleton,
|
|
1929
|
+
Slider,
|
|
1930
|
+
Switch,
|
|
1931
|
+
TABS_LAYOUT_SPRING,
|
|
1932
|
+
Table,
|
|
1933
|
+
TableBody,
|
|
1934
|
+
TableCaption,
|
|
1935
|
+
TableCell,
|
|
1936
|
+
TableFooter,
|
|
1937
|
+
TableHead,
|
|
1938
|
+
TableHeader,
|
|
1939
|
+
TableRow,
|
|
1940
|
+
Tabs,
|
|
1941
|
+
TabsContent,
|
|
1942
|
+
TabsIndicator,
|
|
1943
|
+
TabsList,
|
|
1944
|
+
TabsTrigger,
|
|
1945
|
+
Textarea,
|
|
1946
|
+
Toggle,
|
|
1947
|
+
Tooltip,
|
|
1948
|
+
TooltipContent,
|
|
1949
|
+
TooltipProvider,
|
|
1950
|
+
TooltipTrigger,
|
|
1951
|
+
badgeVariants,
|
|
1952
|
+
buttonVariants,
|
|
1953
|
+
cn,
|
|
1954
|
+
tabsListVariants,
|
|
1955
|
+
toggleVariants,
|
|
1956
|
+
useColine,
|
|
1957
|
+
useColineContext,
|
|
1958
|
+
useColineQuery,
|
|
1959
|
+
useColorScheme
|
|
1960
|
+
};
|
|
1961
|
+
//# sourceMappingURL=index.js.map
|