@evinvest/uikit 0.1.2 → 0.3.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 +13 -3
- package/dist/index.d.ts +33 -4
- package/dist/index.js +639 -442
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/tokens.css +190 -1
package/dist/index.js
CHANGED
|
@@ -1890,12 +1890,29 @@ function CollapsibleContent({
|
|
|
1890
1890
|
return /* @__PURE__ */ jsx24("div", { "data-slot": "collapsible-content", "data-state": "open", ...props, children });
|
|
1891
1891
|
}
|
|
1892
1892
|
|
|
1893
|
-
// src/components/
|
|
1894
|
-
import
|
|
1893
|
+
// src/components/container.tsx
|
|
1894
|
+
import "react";
|
|
1895
1895
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1896
|
-
|
|
1896
|
+
function Container({ className, ...props }) {
|
|
1897
|
+
return /* @__PURE__ */ jsx25(
|
|
1898
|
+
"div",
|
|
1899
|
+
{
|
|
1900
|
+
"data-slot": "container",
|
|
1901
|
+
className: cn(
|
|
1902
|
+
"mx-auto w-full max-w-[var(--page-max,90rem)] px-[var(--page-px,1rem)]",
|
|
1903
|
+
className
|
|
1904
|
+
),
|
|
1905
|
+
...props
|
|
1906
|
+
}
|
|
1907
|
+
);
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
// src/components/tabs.tsx
|
|
1911
|
+
import * as React35 from "react";
|
|
1912
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1913
|
+
var TabsContext = React35.createContext(null);
|
|
1897
1914
|
function useTabs() {
|
|
1898
|
-
const ctx =
|
|
1915
|
+
const ctx = React35.useContext(TabsContext);
|
|
1899
1916
|
if (!ctx) throw new Error("Tabs parts must be used within <Tabs>");
|
|
1900
1917
|
return ctx;
|
|
1901
1918
|
}
|
|
@@ -1913,7 +1930,7 @@ function Tabs({
|
|
|
1913
1930
|
defaultValue,
|
|
1914
1931
|
...onValueChange ? { onChange: onValueChange } : {}
|
|
1915
1932
|
});
|
|
1916
|
-
return /* @__PURE__ */
|
|
1933
|
+
return /* @__PURE__ */ jsx26(TabsContext.Provider, { value: { value: active, setValue, orientation }, children: /* @__PURE__ */ jsx26(
|
|
1917
1934
|
"div",
|
|
1918
1935
|
{
|
|
1919
1936
|
"data-slot": "tabs",
|
|
@@ -1931,12 +1948,12 @@ function TabsList({
|
|
|
1931
1948
|
...props
|
|
1932
1949
|
}) {
|
|
1933
1950
|
const { orientation } = useTabs();
|
|
1934
|
-
const items =
|
|
1951
|
+
const items = React35.Children.toArray(children);
|
|
1935
1952
|
const { activeIndex, setActiveIndex, onKeyDown: rovingKeyDown } = useRovingFocus({
|
|
1936
1953
|
count: items.length,
|
|
1937
1954
|
orientation: orientation === "vertical" ? "vertical" : "horizontal"
|
|
1938
1955
|
});
|
|
1939
|
-
return /* @__PURE__ */
|
|
1956
|
+
return /* @__PURE__ */ jsx26(
|
|
1940
1957
|
"div",
|
|
1941
1958
|
{
|
|
1942
1959
|
role: "tablist",
|
|
@@ -1952,7 +1969,7 @@ function TabsList({
|
|
|
1952
1969
|
},
|
|
1953
1970
|
...props,
|
|
1954
1971
|
children: items.map(
|
|
1955
|
-
(child, index) =>
|
|
1972
|
+
(child, index) => React35.isValidElement(child) ? React35.cloneElement(child, {
|
|
1956
1973
|
__index: index,
|
|
1957
1974
|
__isFocusItem: index === activeIndex,
|
|
1958
1975
|
__onFocusItem: () => setActiveIndex(index)
|
|
@@ -1972,7 +1989,7 @@ function TabsTrigger({
|
|
|
1972
1989
|
}) {
|
|
1973
1990
|
const { value: active, setValue } = useTabs();
|
|
1974
1991
|
const selected = active === value;
|
|
1975
|
-
return /* @__PURE__ */
|
|
1992
|
+
return /* @__PURE__ */ jsx26(
|
|
1976
1993
|
"button",
|
|
1977
1994
|
{
|
|
1978
1995
|
type: "button",
|
|
@@ -2006,7 +2023,7 @@ function TabsContent({
|
|
|
2006
2023
|
}) {
|
|
2007
2024
|
const { value: active } = useTabs();
|
|
2008
2025
|
if (active !== value) return null;
|
|
2009
|
-
return /* @__PURE__ */
|
|
2026
|
+
return /* @__PURE__ */ jsx26(
|
|
2010
2027
|
"div",
|
|
2011
2028
|
{
|
|
2012
2029
|
role: "tabpanel",
|
|
@@ -2021,7 +2038,7 @@ function TabsContent({
|
|
|
2021
2038
|
|
|
2022
2039
|
// src/components/toggle.tsx
|
|
2023
2040
|
import "react";
|
|
2024
|
-
import { jsx as
|
|
2041
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2025
2042
|
var TOGGLE_BASE = "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 aria-invalid:border-destructive whitespace-nowrap";
|
|
2026
2043
|
var toggleVariantClasses = {
|
|
2027
2044
|
default: "bg-transparent",
|
|
@@ -2054,7 +2071,7 @@ function Toggle({
|
|
|
2054
2071
|
defaultValue: defaultPressed,
|
|
2055
2072
|
...onPressedChange ? { onChange: onPressedChange } : {}
|
|
2056
2073
|
});
|
|
2057
|
-
return /* @__PURE__ */
|
|
2074
|
+
return /* @__PURE__ */ jsx27(
|
|
2058
2075
|
"button",
|
|
2059
2076
|
{
|
|
2060
2077
|
type: "button",
|
|
@@ -2072,9 +2089,9 @@ function Toggle({
|
|
|
2072
2089
|
}
|
|
2073
2090
|
|
|
2074
2091
|
// src/components/toggle-group.tsx
|
|
2075
|
-
import * as
|
|
2076
|
-
import { jsx as
|
|
2077
|
-
var ToggleGroupContext =
|
|
2092
|
+
import * as React37 from "react";
|
|
2093
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2094
|
+
var ToggleGroupContext = React37.createContext({
|
|
2078
2095
|
variant: "default",
|
|
2079
2096
|
size: "default",
|
|
2080
2097
|
value: [],
|
|
@@ -2101,7 +2118,7 @@ function ToggleGroup({
|
|
|
2101
2118
|
defaultValue: toArray(defaultValue),
|
|
2102
2119
|
onChange: (next) => onValueChange?.(type === "single" ? next[0] ?? "" : next)
|
|
2103
2120
|
});
|
|
2104
|
-
const toggle =
|
|
2121
|
+
const toggle = React37.useCallback(
|
|
2105
2122
|
(itemValue) => {
|
|
2106
2123
|
if (type === "single") {
|
|
2107
2124
|
setSelected(selected.includes(itemValue) ? [] : [itemValue]);
|
|
@@ -2113,7 +2130,7 @@ function ToggleGroup({
|
|
|
2113
2130
|
},
|
|
2114
2131
|
[type, selected, setSelected]
|
|
2115
2132
|
);
|
|
2116
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ jsx28(
|
|
2117
2134
|
"div",
|
|
2118
2135
|
{
|
|
2119
2136
|
"data-slot": "toggle-group",
|
|
@@ -2124,7 +2141,7 @@ function ToggleGroup({
|
|
|
2124
2141
|
className
|
|
2125
2142
|
),
|
|
2126
2143
|
...props,
|
|
2127
|
-
children: /* @__PURE__ */
|
|
2144
|
+
children: /* @__PURE__ */ jsx28(ToggleGroupContext.Provider, { value: { variant, size, value: selected, toggle }, children })
|
|
2128
2145
|
}
|
|
2129
2146
|
);
|
|
2130
2147
|
}
|
|
@@ -2137,11 +2154,11 @@ function ToggleGroupItem({
|
|
|
2137
2154
|
onClick,
|
|
2138
2155
|
...props
|
|
2139
2156
|
}) {
|
|
2140
|
-
const context =
|
|
2157
|
+
const context = React37.useContext(ToggleGroupContext);
|
|
2141
2158
|
const resolvedVariant = context.variant || variant || "default";
|
|
2142
2159
|
const resolvedSize = context.size || size || "default";
|
|
2143
2160
|
const on = context.value.includes(value);
|
|
2144
|
-
return /* @__PURE__ */
|
|
2161
|
+
return /* @__PURE__ */ jsx28(
|
|
2145
2162
|
"button",
|
|
2146
2163
|
{
|
|
2147
2164
|
type: "button",
|
|
@@ -2167,7 +2184,7 @@ function ToggleGroupItem({
|
|
|
2167
2184
|
|
|
2168
2185
|
// src/components/switch.tsx
|
|
2169
2186
|
import "react";
|
|
2170
|
-
import { jsx as
|
|
2187
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2171
2188
|
function Switch({
|
|
2172
2189
|
className,
|
|
2173
2190
|
checked,
|
|
@@ -2183,7 +2200,7 @@ function Switch({
|
|
|
2183
2200
|
...onCheckedChange ? { onChange: onCheckedChange } : {}
|
|
2184
2201
|
});
|
|
2185
2202
|
const state = on ? "checked" : "unchecked";
|
|
2186
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ jsx29(
|
|
2187
2204
|
"button",
|
|
2188
2205
|
{
|
|
2189
2206
|
type: "button",
|
|
@@ -2201,7 +2218,7 @@ function Switch({
|
|
|
2201
2218
|
setOn(!on);
|
|
2202
2219
|
},
|
|
2203
2220
|
...props,
|
|
2204
|
-
children: /* @__PURE__ */
|
|
2221
|
+
children: /* @__PURE__ */ jsx29(
|
|
2205
2222
|
"span",
|
|
2206
2223
|
{
|
|
2207
2224
|
"data-slot": "switch-thumb",
|
|
@@ -2215,7 +2232,7 @@ function Switch({
|
|
|
2215
2232
|
|
|
2216
2233
|
// src/components/checkbox.tsx
|
|
2217
2234
|
import "react";
|
|
2218
|
-
import { jsx as
|
|
2235
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2219
2236
|
function Checkbox({
|
|
2220
2237
|
className,
|
|
2221
2238
|
checked,
|
|
@@ -2231,7 +2248,7 @@ function Checkbox({
|
|
|
2231
2248
|
...onCheckedChange ? { onChange: onCheckedChange } : {}
|
|
2232
2249
|
});
|
|
2233
2250
|
const state = on ? "checked" : "unchecked";
|
|
2234
|
-
return /* @__PURE__ */
|
|
2251
|
+
return /* @__PURE__ */ jsx30(
|
|
2235
2252
|
"button",
|
|
2236
2253
|
{
|
|
2237
2254
|
type: "button",
|
|
@@ -2249,12 +2266,12 @@ function Checkbox({
|
|
|
2249
2266
|
setOn(!on);
|
|
2250
2267
|
},
|
|
2251
2268
|
...props,
|
|
2252
|
-
children: on && /* @__PURE__ */
|
|
2269
|
+
children: on && /* @__PURE__ */ jsx30(
|
|
2253
2270
|
"span",
|
|
2254
2271
|
{
|
|
2255
2272
|
"data-slot": "checkbox-indicator",
|
|
2256
2273
|
className: "flex items-center justify-center text-current transition-none",
|
|
2257
|
-
children: /* @__PURE__ */
|
|
2274
|
+
children: /* @__PURE__ */ jsx30(
|
|
2258
2275
|
"svg",
|
|
2259
2276
|
{
|
|
2260
2277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2266,7 +2283,7 @@ function Checkbox({
|
|
|
2266
2283
|
strokeLinejoin: "round",
|
|
2267
2284
|
className: "size-3.5",
|
|
2268
2285
|
"aria-hidden": "true",
|
|
2269
|
-
children: /* @__PURE__ */
|
|
2286
|
+
children: /* @__PURE__ */ jsx30("path", { d: "M20 6 9 17l-5-5" })
|
|
2270
2287
|
}
|
|
2271
2288
|
)
|
|
2272
2289
|
}
|
|
@@ -2276,11 +2293,11 @@ function Checkbox({
|
|
|
2276
2293
|
}
|
|
2277
2294
|
|
|
2278
2295
|
// src/components/radio-group.tsx
|
|
2279
|
-
import * as
|
|
2280
|
-
import { jsx as
|
|
2296
|
+
import * as React40 from "react";
|
|
2297
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2281
2298
|
var ROOT_BASE = "grid gap-3";
|
|
2282
2299
|
var ITEM_BASE2 = "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50";
|
|
2283
|
-
var RadioGroupContext =
|
|
2300
|
+
var RadioGroupContext = React40.createContext(
|
|
2284
2301
|
null
|
|
2285
2302
|
);
|
|
2286
2303
|
function RadioGroup({
|
|
@@ -2297,10 +2314,10 @@ function RadioGroup({
|
|
|
2297
2314
|
defaultValue,
|
|
2298
2315
|
...onValueChange ? { onChange: onValueChange } : {}
|
|
2299
2316
|
});
|
|
2300
|
-
const itemsRef =
|
|
2301
|
-
const [count, setCount] =
|
|
2317
|
+
const itemsRef = React40.useRef([]);
|
|
2318
|
+
const [count, setCount] = React40.useState(0);
|
|
2302
2319
|
const { activeIndex, setActiveIndex, onKeyDown: rovingKeyDown } = useRovingFocus({ count, orientation: "vertical", loop: true });
|
|
2303
|
-
const register =
|
|
2320
|
+
const register = React40.useCallback((el) => {
|
|
2304
2321
|
const list = itemsRef.current;
|
|
2305
2322
|
let index = list.indexOf(el);
|
|
2306
2323
|
if (index === -1) {
|
|
@@ -2310,11 +2327,11 @@ function RadioGroup({
|
|
|
2310
2327
|
}
|
|
2311
2328
|
return index;
|
|
2312
2329
|
}, []);
|
|
2313
|
-
const ctx =
|
|
2330
|
+
const ctx = React40.useMemo(
|
|
2314
2331
|
() => ({ value: current, setValue: setCurrent, register, activeIndex, setActiveIndex }),
|
|
2315
2332
|
[current, setCurrent, register, activeIndex, setActiveIndex]
|
|
2316
2333
|
);
|
|
2317
|
-
return /* @__PURE__ */
|
|
2334
|
+
return /* @__PURE__ */ jsx31(RadioGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx31(
|
|
2318
2335
|
"div",
|
|
2319
2336
|
{
|
|
2320
2337
|
"data-slot": "radio-group",
|
|
@@ -2336,14 +2353,14 @@ function RadioGroupItem({
|
|
|
2336
2353
|
onClick,
|
|
2337
2354
|
...props
|
|
2338
2355
|
}) {
|
|
2339
|
-
const ctx =
|
|
2356
|
+
const ctx = React40.useContext(RadioGroupContext);
|
|
2340
2357
|
if (!ctx) throw new Error("RadioGroupItem must be used within a RadioGroup");
|
|
2341
|
-
const indexRef =
|
|
2358
|
+
const indexRef = React40.useRef(-1);
|
|
2342
2359
|
const checked = ctx.value === value;
|
|
2343
|
-
|
|
2360
|
+
React40.useEffect(() => {
|
|
2344
2361
|
if (checked) ctx.setActiveIndex(indexRef.current);
|
|
2345
2362
|
}, [checked]);
|
|
2346
|
-
return /* @__PURE__ */
|
|
2363
|
+
return /* @__PURE__ */ jsx31(
|
|
2347
2364
|
"button",
|
|
2348
2365
|
{
|
|
2349
2366
|
ref: (el) => {
|
|
@@ -2362,18 +2379,18 @@ function RadioGroupItem({
|
|
|
2362
2379
|
ctx.setValue(value);
|
|
2363
2380
|
},
|
|
2364
2381
|
...props,
|
|
2365
|
-
children: checked ? /* @__PURE__ */
|
|
2382
|
+
children: checked ? /* @__PURE__ */ jsx31(
|
|
2366
2383
|
"span",
|
|
2367
2384
|
{
|
|
2368
2385
|
"data-slot": "radio-group-indicator",
|
|
2369
2386
|
className: "relative flex items-center justify-center",
|
|
2370
|
-
children: /* @__PURE__ */
|
|
2387
|
+
children: /* @__PURE__ */ jsx31(
|
|
2371
2388
|
"svg",
|
|
2372
2389
|
{
|
|
2373
2390
|
className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2",
|
|
2374
2391
|
viewBox: "0 0 24 24",
|
|
2375
2392
|
"aria-hidden": "true",
|
|
2376
|
-
children: /* @__PURE__ */
|
|
2393
|
+
children: /* @__PURE__ */ jsx31("circle", { cx: "12", cy: "12", r: "10" })
|
|
2377
2394
|
}
|
|
2378
2395
|
)
|
|
2379
2396
|
}
|
|
@@ -2383,8 +2400,8 @@ function RadioGroupItem({
|
|
|
2383
2400
|
}
|
|
2384
2401
|
|
|
2385
2402
|
// src/components/slider.tsx
|
|
2386
|
-
import * as
|
|
2387
|
-
import { jsx as
|
|
2403
|
+
import * as React41 from "react";
|
|
2404
|
+
import { jsx as jsx32, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2388
2405
|
var ROOT_BASE2 = "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col";
|
|
2389
2406
|
var TRACK_BASE = "bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5";
|
|
2390
2407
|
var RANGE_BASE = "bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full";
|
|
@@ -2415,9 +2432,9 @@ function Slider({
|
|
|
2415
2432
|
const current = clampStep(raw, min, max, step);
|
|
2416
2433
|
const span = Math.max(max - min, Number.EPSILON);
|
|
2417
2434
|
const percent = Math.min(100, Math.max(0, (current - min) / span * 100));
|
|
2418
|
-
const trackRef =
|
|
2419
|
-
const draggingRef =
|
|
2420
|
-
const valueFromPointer =
|
|
2435
|
+
const trackRef = React41.useRef(null);
|
|
2436
|
+
const draggingRef = React41.useRef(false);
|
|
2437
|
+
const valueFromPointer = React41.useCallback(
|
|
2421
2438
|
(clientX, clientY) => {
|
|
2422
2439
|
const rect = trackRef.current?.getBoundingClientRect();
|
|
2423
2440
|
if (!rect) return current;
|
|
@@ -2478,14 +2495,14 @@ function Slider({
|
|
|
2478
2495
|
onPointerMove,
|
|
2479
2496
|
onPointerUp,
|
|
2480
2497
|
children: [
|
|
2481
|
-
/* @__PURE__ */
|
|
2498
|
+
/* @__PURE__ */ jsx32(
|
|
2482
2499
|
"span",
|
|
2483
2500
|
{
|
|
2484
2501
|
ref: trackRef,
|
|
2485
2502
|
"data-slot": "slider-track",
|
|
2486
2503
|
"data-orientation": orientation,
|
|
2487
2504
|
className: TRACK_BASE,
|
|
2488
|
-
children: /* @__PURE__ */
|
|
2505
|
+
children: /* @__PURE__ */ jsx32(
|
|
2489
2506
|
"span",
|
|
2490
2507
|
{
|
|
2491
2508
|
"data-slot": "slider-range",
|
|
@@ -2496,7 +2513,7 @@ function Slider({
|
|
|
2496
2513
|
)
|
|
2497
2514
|
}
|
|
2498
2515
|
),
|
|
2499
|
-
/* @__PURE__ */
|
|
2516
|
+
/* @__PURE__ */ jsx32(
|
|
2500
2517
|
"span",
|
|
2501
2518
|
{
|
|
2502
2519
|
"data-slot": "slider-thumb",
|
|
@@ -2520,14 +2537,14 @@ function Slider({
|
|
|
2520
2537
|
|
|
2521
2538
|
// src/components/scroll-area.tsx
|
|
2522
2539
|
import "react";
|
|
2523
|
-
import { jsx as
|
|
2540
|
+
import { jsx as jsx33, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2524
2541
|
function ScrollArea({
|
|
2525
2542
|
className,
|
|
2526
2543
|
children,
|
|
2527
2544
|
...props
|
|
2528
2545
|
}) {
|
|
2529
2546
|
return /* @__PURE__ */ jsxs6("div", { "data-slot": "scroll-area", className: cn("relative", className), ...props, children: [
|
|
2530
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ jsx33(
|
|
2531
2548
|
"div",
|
|
2532
2549
|
{
|
|
2533
2550
|
"data-slot": "scroll-area-viewport",
|
|
@@ -2535,7 +2552,7 @@ function ScrollArea({
|
|
|
2535
2552
|
children
|
|
2536
2553
|
}
|
|
2537
2554
|
),
|
|
2538
|
-
/* @__PURE__ */
|
|
2555
|
+
/* @__PURE__ */ jsx33(ScrollBar, {})
|
|
2539
2556
|
] });
|
|
2540
2557
|
}
|
|
2541
2558
|
function ScrollBar({
|
|
@@ -2543,7 +2560,7 @@ function ScrollBar({
|
|
|
2543
2560
|
orientation = "vertical",
|
|
2544
2561
|
...props
|
|
2545
2562
|
}) {
|
|
2546
|
-
return /* @__PURE__ */
|
|
2563
|
+
return /* @__PURE__ */ jsx33(
|
|
2547
2564
|
"div",
|
|
2548
2565
|
{
|
|
2549
2566
|
"data-slot": "scroll-area-scrollbar",
|
|
@@ -2555,7 +2572,7 @@ function ScrollBar({
|
|
|
2555
2572
|
className
|
|
2556
2573
|
),
|
|
2557
2574
|
...props,
|
|
2558
|
-
children: /* @__PURE__ */
|
|
2575
|
+
children: /* @__PURE__ */ jsx33(
|
|
2559
2576
|
"div",
|
|
2560
2577
|
{
|
|
2561
2578
|
"data-slot": "scroll-area-thumb",
|
|
@@ -2567,13 +2584,13 @@ function ScrollBar({
|
|
|
2567
2584
|
}
|
|
2568
2585
|
|
|
2569
2586
|
// src/components/sidebar.tsx
|
|
2570
|
-
import * as
|
|
2571
|
-
import { jsx as
|
|
2587
|
+
import * as React43 from "react";
|
|
2588
|
+
import { jsx as jsx34, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2572
2589
|
var SIDEBAR_WIDTH = "16rem";
|
|
2573
2590
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
2574
|
-
var SidebarContext =
|
|
2591
|
+
var SidebarContext = React43.createContext(null);
|
|
2575
2592
|
function useSidebar() {
|
|
2576
|
-
const ctx =
|
|
2593
|
+
const ctx = React43.useContext(SidebarContext);
|
|
2577
2594
|
if (!ctx) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
2578
2595
|
return ctx;
|
|
2579
2596
|
}
|
|
@@ -2591,16 +2608,16 @@ function SidebarProvider({
|
|
|
2591
2608
|
defaultValue: defaultOpen,
|
|
2592
2609
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
2593
2610
|
});
|
|
2594
|
-
const toggleSidebar =
|
|
2611
|
+
const toggleSidebar = React43.useCallback(
|
|
2595
2612
|
() => setOpen(!open),
|
|
2596
2613
|
[open, setOpen]
|
|
2597
2614
|
);
|
|
2598
2615
|
const state = open ? "expanded" : "collapsed";
|
|
2599
|
-
const contextValue =
|
|
2616
|
+
const contextValue = React43.useMemo(
|
|
2600
2617
|
() => ({ state, open, setOpen, toggleSidebar }),
|
|
2601
2618
|
[state, open, setOpen, toggleSidebar]
|
|
2602
2619
|
);
|
|
2603
|
-
return /* @__PURE__ */
|
|
2620
|
+
return /* @__PURE__ */ jsx34(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx34(
|
|
2604
2621
|
"div",
|
|
2605
2622
|
{
|
|
2606
2623
|
"data-slot": "sidebar-wrapper",
|
|
@@ -2628,7 +2645,7 @@ function Sidebar({
|
|
|
2628
2645
|
}) {
|
|
2629
2646
|
const { state } = useSidebar();
|
|
2630
2647
|
if (collapsible === "none") {
|
|
2631
|
-
return /* @__PURE__ */
|
|
2648
|
+
return /* @__PURE__ */ jsx34(
|
|
2632
2649
|
"div",
|
|
2633
2650
|
{
|
|
2634
2651
|
"data-slot": "sidebar",
|
|
@@ -2641,7 +2658,7 @@ function Sidebar({
|
|
|
2641
2658
|
}
|
|
2642
2659
|
);
|
|
2643
2660
|
}
|
|
2644
|
-
return /* @__PURE__ */
|
|
2661
|
+
return /* @__PURE__ */ jsx34(
|
|
2645
2662
|
"div",
|
|
2646
2663
|
{
|
|
2647
2664
|
className: "group peer text-sidebar-foreground hidden md:block",
|
|
@@ -2650,7 +2667,7 @@ function Sidebar({
|
|
|
2650
2667
|
"data-variant": variant,
|
|
2651
2668
|
"data-side": side,
|
|
2652
2669
|
"data-slot": "sidebar",
|
|
2653
|
-
children: /* @__PURE__ */
|
|
2670
|
+
children: /* @__PURE__ */ jsx34(
|
|
2654
2671
|
"div",
|
|
2655
2672
|
{
|
|
2656
2673
|
"data-slot": "sidebar-inner",
|
|
@@ -2690,7 +2707,7 @@ function SidebarTrigger({
|
|
|
2690
2707
|
...props,
|
|
2691
2708
|
children: [
|
|
2692
2709
|
children,
|
|
2693
|
-
/* @__PURE__ */
|
|
2710
|
+
/* @__PURE__ */ jsx34("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
2694
2711
|
]
|
|
2695
2712
|
}
|
|
2696
2713
|
);
|
|
@@ -2700,7 +2717,7 @@ function SidebarRail({
|
|
|
2700
2717
|
...props
|
|
2701
2718
|
}) {
|
|
2702
2719
|
const { toggleSidebar } = useSidebar();
|
|
2703
|
-
return /* @__PURE__ */
|
|
2720
|
+
return /* @__PURE__ */ jsx34(
|
|
2704
2721
|
"button",
|
|
2705
2722
|
{
|
|
2706
2723
|
type: "button",
|
|
@@ -2719,7 +2736,7 @@ function SidebarRail({
|
|
|
2719
2736
|
);
|
|
2720
2737
|
}
|
|
2721
2738
|
function SidebarInset({ className, ...props }) {
|
|
2722
|
-
return /* @__PURE__ */
|
|
2739
|
+
return /* @__PURE__ */ jsx34(
|
|
2723
2740
|
"main",
|
|
2724
2741
|
{
|
|
2725
2742
|
"data-slot": "sidebar-inset",
|
|
@@ -2733,7 +2750,7 @@ function SidebarInset({ className, ...props }) {
|
|
|
2733
2750
|
);
|
|
2734
2751
|
}
|
|
2735
2752
|
function SidebarHeader({ className, ...props }) {
|
|
2736
|
-
return /* @__PURE__ */
|
|
2753
|
+
return /* @__PURE__ */ jsx34(
|
|
2737
2754
|
"div",
|
|
2738
2755
|
{
|
|
2739
2756
|
"data-slot": "sidebar-header",
|
|
@@ -2744,7 +2761,7 @@ function SidebarHeader({ className, ...props }) {
|
|
|
2744
2761
|
);
|
|
2745
2762
|
}
|
|
2746
2763
|
function SidebarFooter({ className, ...props }) {
|
|
2747
|
-
return /* @__PURE__ */
|
|
2764
|
+
return /* @__PURE__ */ jsx34(
|
|
2748
2765
|
"div",
|
|
2749
2766
|
{
|
|
2750
2767
|
"data-slot": "sidebar-footer",
|
|
@@ -2758,7 +2775,7 @@ function SidebarSeparator({
|
|
|
2758
2775
|
className,
|
|
2759
2776
|
...props
|
|
2760
2777
|
}) {
|
|
2761
|
-
return /* @__PURE__ */
|
|
2778
|
+
return /* @__PURE__ */ jsx34(
|
|
2762
2779
|
"div",
|
|
2763
2780
|
{
|
|
2764
2781
|
"data-slot": "sidebar-separator",
|
|
@@ -2770,7 +2787,7 @@ function SidebarSeparator({
|
|
|
2770
2787
|
);
|
|
2771
2788
|
}
|
|
2772
2789
|
function SidebarContent({ className, ...props }) {
|
|
2773
|
-
return /* @__PURE__ */
|
|
2790
|
+
return /* @__PURE__ */ jsx34(
|
|
2774
2791
|
"div",
|
|
2775
2792
|
{
|
|
2776
2793
|
"data-slot": "sidebar-content",
|
|
@@ -2784,7 +2801,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
2784
2801
|
);
|
|
2785
2802
|
}
|
|
2786
2803
|
function SidebarGroup({ className, ...props }) {
|
|
2787
|
-
return /* @__PURE__ */
|
|
2804
|
+
return /* @__PURE__ */ jsx34(
|
|
2788
2805
|
"div",
|
|
2789
2806
|
{
|
|
2790
2807
|
"data-slot": "sidebar-group",
|
|
@@ -2800,7 +2817,7 @@ function SidebarGroupLabel({
|
|
|
2800
2817
|
...props
|
|
2801
2818
|
}) {
|
|
2802
2819
|
const Comp = asChild ? Slot : "div";
|
|
2803
|
-
return /* @__PURE__ */
|
|
2820
|
+
return /* @__PURE__ */ jsx34(
|
|
2804
2821
|
Comp,
|
|
2805
2822
|
{
|
|
2806
2823
|
"data-slot": "sidebar-group-label",
|
|
@@ -2818,7 +2835,7 @@ function SidebarGroupContent({
|
|
|
2818
2835
|
className,
|
|
2819
2836
|
...props
|
|
2820
2837
|
}) {
|
|
2821
|
-
return /* @__PURE__ */
|
|
2838
|
+
return /* @__PURE__ */ jsx34(
|
|
2822
2839
|
"div",
|
|
2823
2840
|
{
|
|
2824
2841
|
"data-slot": "sidebar-group-content",
|
|
@@ -2829,7 +2846,7 @@ function SidebarGroupContent({
|
|
|
2829
2846
|
);
|
|
2830
2847
|
}
|
|
2831
2848
|
function SidebarMenu({ className, ...props }) {
|
|
2832
|
-
return /* @__PURE__ */
|
|
2849
|
+
return /* @__PURE__ */ jsx34(
|
|
2833
2850
|
"ul",
|
|
2834
2851
|
{
|
|
2835
2852
|
"data-slot": "sidebar-menu",
|
|
@@ -2840,7 +2857,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
2840
2857
|
);
|
|
2841
2858
|
}
|
|
2842
2859
|
function SidebarMenuItem({ className, ...props }) {
|
|
2843
|
-
return /* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ jsx34(
|
|
2844
2861
|
"li",
|
|
2845
2862
|
{
|
|
2846
2863
|
"data-slot": "sidebar-menu-item",
|
|
@@ -2869,7 +2886,7 @@ function SidebarMenuButton({
|
|
|
2869
2886
|
...props
|
|
2870
2887
|
}) {
|
|
2871
2888
|
const Comp = asChild ? Slot : "button";
|
|
2872
|
-
return /* @__PURE__ */
|
|
2889
|
+
return /* @__PURE__ */ jsx34(
|
|
2873
2890
|
Comp,
|
|
2874
2891
|
{
|
|
2875
2892
|
"data-slot": "sidebar-menu-button",
|
|
@@ -2888,11 +2905,11 @@ function SidebarMenuButton({
|
|
|
2888
2905
|
}
|
|
2889
2906
|
|
|
2890
2907
|
// src/components/carousel.tsx
|
|
2891
|
-
import * as
|
|
2892
|
-
import { jsx as
|
|
2893
|
-
var CarouselContext =
|
|
2908
|
+
import * as React44 from "react";
|
|
2909
|
+
import { jsx as jsx35, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2910
|
+
var CarouselContext = React44.createContext(null);
|
|
2894
2911
|
function useCarousel() {
|
|
2895
|
-
const context =
|
|
2912
|
+
const context = React44.useContext(CarouselContext);
|
|
2896
2913
|
if (!context) {
|
|
2897
2914
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
2898
2915
|
}
|
|
@@ -2913,13 +2930,13 @@ function Carousel({
|
|
|
2913
2930
|
defaultValue: defaultIndex,
|
|
2914
2931
|
onChange: onIndexChange
|
|
2915
2932
|
});
|
|
2916
|
-
const [count, setCount] =
|
|
2933
|
+
const [count, setCount] = React44.useState(0);
|
|
2917
2934
|
const canScrollPrev = index > 0;
|
|
2918
2935
|
const canScrollNext = index < count - 1;
|
|
2919
|
-
const scrollPrev =
|
|
2936
|
+
const scrollPrev = React44.useCallback(() => {
|
|
2920
2937
|
if (index > 0) setIndex(index - 1);
|
|
2921
2938
|
}, [index, setIndex]);
|
|
2922
|
-
const scrollNext =
|
|
2939
|
+
const scrollNext = React44.useCallback(() => {
|
|
2923
2940
|
if (index < count - 1) setIndex(index + 1);
|
|
2924
2941
|
}, [index, count, setIndex]);
|
|
2925
2942
|
const handleKeyDown = (event) => {
|
|
@@ -2932,7 +2949,7 @@ function Carousel({
|
|
|
2932
2949
|
}
|
|
2933
2950
|
onKeyDown?.(event);
|
|
2934
2951
|
};
|
|
2935
|
-
return /* @__PURE__ */
|
|
2952
|
+
return /* @__PURE__ */ jsx35(
|
|
2936
2953
|
CarouselContext.Provider,
|
|
2937
2954
|
{
|
|
2938
2955
|
value: {
|
|
@@ -2945,7 +2962,7 @@ function Carousel({
|
|
|
2945
2962
|
canScrollPrev,
|
|
2946
2963
|
canScrollNext
|
|
2947
2964
|
},
|
|
2948
|
-
children: /* @__PURE__ */
|
|
2965
|
+
children: /* @__PURE__ */ jsx35(
|
|
2949
2966
|
"div",
|
|
2950
2967
|
{
|
|
2951
2968
|
onKeyDownCapture: handleKeyDown,
|
|
@@ -2967,12 +2984,12 @@ function CarouselContent({
|
|
|
2967
2984
|
...props
|
|
2968
2985
|
}) {
|
|
2969
2986
|
const { orientation, index, setCount } = useCarousel();
|
|
2970
|
-
const childCount =
|
|
2971
|
-
|
|
2987
|
+
const childCount = React44.Children.count(children);
|
|
2988
|
+
React44.useEffect(() => {
|
|
2972
2989
|
setCount(childCount);
|
|
2973
2990
|
}, [childCount, setCount]);
|
|
2974
2991
|
const transform = orientation === "horizontal" ? `translate3d(-${index * 100}%, 0, 0)` : `translate3d(0, -${index * 100}%, 0)`;
|
|
2975
|
-
return /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ jsx35("div", { className: "overflow-hidden", "data-slot": "carousel-content", children: /* @__PURE__ */ jsx35(
|
|
2976
2993
|
"div",
|
|
2977
2994
|
{
|
|
2978
2995
|
className: cn(
|
|
@@ -2991,7 +3008,7 @@ function CarouselItem({
|
|
|
2991
3008
|
...props
|
|
2992
3009
|
}) {
|
|
2993
3010
|
const { orientation } = useCarousel();
|
|
2994
|
-
return /* @__PURE__ */
|
|
3011
|
+
return /* @__PURE__ */ jsx35(
|
|
2995
3012
|
"div",
|
|
2996
3013
|
{
|
|
2997
3014
|
role: "group",
|
|
@@ -3028,7 +3045,7 @@ function CarouselPrevious({
|
|
|
3028
3045
|
onClick: scrollPrev,
|
|
3029
3046
|
...props,
|
|
3030
3047
|
children: [
|
|
3031
|
-
/* @__PURE__ */
|
|
3048
|
+
/* @__PURE__ */ jsx35(
|
|
3032
3049
|
"svg",
|
|
3033
3050
|
{
|
|
3034
3051
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3039,10 +3056,10 @@ function CarouselPrevious({
|
|
|
3039
3056
|
strokeLinecap: "round",
|
|
3040
3057
|
strokeLinejoin: "round",
|
|
3041
3058
|
"aria-hidden": "true",
|
|
3042
|
-
children: /* @__PURE__ */
|
|
3059
|
+
children: /* @__PURE__ */ jsx35("path", { d: "m15 18-6-6 6-6" })
|
|
3043
3060
|
}
|
|
3044
3061
|
),
|
|
3045
|
-
/* @__PURE__ */
|
|
3062
|
+
/* @__PURE__ */ jsx35("span", { className: "sr-only", children: "Previous slide" })
|
|
3046
3063
|
]
|
|
3047
3064
|
}
|
|
3048
3065
|
);
|
|
@@ -3069,7 +3086,7 @@ function CarouselNext({
|
|
|
3069
3086
|
onClick: scrollNext,
|
|
3070
3087
|
...props,
|
|
3071
3088
|
children: [
|
|
3072
|
-
/* @__PURE__ */
|
|
3089
|
+
/* @__PURE__ */ jsx35(
|
|
3073
3090
|
"svg",
|
|
3074
3091
|
{
|
|
3075
3092
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3080,21 +3097,21 @@ function CarouselNext({
|
|
|
3080
3097
|
strokeLinecap: "round",
|
|
3081
3098
|
strokeLinejoin: "round",
|
|
3082
3099
|
"aria-hidden": "true",
|
|
3083
|
-
children: /* @__PURE__ */
|
|
3100
|
+
children: /* @__PURE__ */ jsx35("path", { d: "m9 18 6-6-6-6" })
|
|
3084
3101
|
}
|
|
3085
3102
|
),
|
|
3086
|
-
/* @__PURE__ */
|
|
3103
|
+
/* @__PURE__ */ jsx35("span", { className: "sr-only", children: "Next slide" })
|
|
3087
3104
|
]
|
|
3088
3105
|
}
|
|
3089
3106
|
);
|
|
3090
3107
|
}
|
|
3091
3108
|
|
|
3092
3109
|
// src/components/input-otp.tsx
|
|
3093
|
-
import * as
|
|
3094
|
-
import { jsx as
|
|
3095
|
-
var InputOTPContext =
|
|
3110
|
+
import * as React45 from "react";
|
|
3111
|
+
import { jsx as jsx36, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3112
|
+
var InputOTPContext = React45.createContext(null);
|
|
3096
3113
|
function useInputOTP() {
|
|
3097
|
-
const context =
|
|
3114
|
+
const context = React45.useContext(InputOTPContext);
|
|
3098
3115
|
if (!context) {
|
|
3099
3116
|
throw new Error("InputOTP slots must be used within an <InputOTP />");
|
|
3100
3117
|
}
|
|
@@ -3116,9 +3133,9 @@ function InputOTP({
|
|
|
3116
3133
|
defaultValue,
|
|
3117
3134
|
onChange
|
|
3118
3135
|
});
|
|
3119
|
-
const [focused, setFocused] =
|
|
3136
|
+
const [focused, setFocused] = React45.useState(false);
|
|
3120
3137
|
const activeIndex = focused ? Math.min(value.length, maxLength - 1) : -1;
|
|
3121
|
-
return /* @__PURE__ */
|
|
3138
|
+
return /* @__PURE__ */ jsx36(InputOTPContext.Provider, { value: { value, maxLength, activeIndex }, children: /* @__PURE__ */ jsxs9(
|
|
3122
3139
|
"div",
|
|
3123
3140
|
{
|
|
3124
3141
|
"data-slot": "input-otp",
|
|
@@ -3128,7 +3145,7 @@ function InputOTP({
|
|
|
3128
3145
|
),
|
|
3129
3146
|
children: [
|
|
3130
3147
|
children,
|
|
3131
|
-
/* @__PURE__ */
|
|
3148
|
+
/* @__PURE__ */ jsx36(
|
|
3132
3149
|
"input",
|
|
3133
3150
|
{
|
|
3134
3151
|
inputMode: "numeric",
|
|
@@ -3154,7 +3171,7 @@ function InputOTPGroup({
|
|
|
3154
3171
|
className,
|
|
3155
3172
|
...props
|
|
3156
3173
|
}) {
|
|
3157
|
-
return /* @__PURE__ */
|
|
3174
|
+
return /* @__PURE__ */ jsx36(
|
|
3158
3175
|
"div",
|
|
3159
3176
|
{
|
|
3160
3177
|
"data-slot": "input-otp-group",
|
|
@@ -3180,13 +3197,13 @@ function InputOTPSlot({ index, className, ...props }) {
|
|
|
3180
3197
|
...props,
|
|
3181
3198
|
children: [
|
|
3182
3199
|
char,
|
|
3183
|
-
hasFakeCaret && /* @__PURE__ */
|
|
3200
|
+
hasFakeCaret && /* @__PURE__ */ jsx36("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx36("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
|
|
3184
3201
|
]
|
|
3185
3202
|
}
|
|
3186
3203
|
);
|
|
3187
3204
|
}
|
|
3188
3205
|
function InputOTPSeparator({ ...props }) {
|
|
3189
|
-
return /* @__PURE__ */
|
|
3206
|
+
return /* @__PURE__ */ jsx36("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx36(
|
|
3190
3207
|
"svg",
|
|
3191
3208
|
{
|
|
3192
3209
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3197,22 +3214,22 @@ function InputOTPSeparator({ ...props }) {
|
|
|
3197
3214
|
strokeLinecap: "round",
|
|
3198
3215
|
strokeLinejoin: "round",
|
|
3199
3216
|
"aria-hidden": "true",
|
|
3200
|
-
children: /* @__PURE__ */
|
|
3217
|
+
children: /* @__PURE__ */ jsx36("path", { d: "M5 12h14" })
|
|
3201
3218
|
}
|
|
3202
3219
|
) });
|
|
3203
3220
|
}
|
|
3204
3221
|
|
|
3205
3222
|
// src/components/tooltip.tsx
|
|
3206
|
-
import * as
|
|
3207
|
-
import { Fragment, jsx as
|
|
3208
|
-
var TooltipContext =
|
|
3223
|
+
import * as React46 from "react";
|
|
3224
|
+
import { Fragment, jsx as jsx37 } from "react/jsx-runtime";
|
|
3225
|
+
var TooltipContext = React46.createContext(null);
|
|
3209
3226
|
function useTooltip() {
|
|
3210
|
-
const ctx =
|
|
3227
|
+
const ctx = React46.useContext(TooltipContext);
|
|
3211
3228
|
if (!ctx) throw new Error("Tooltip parts must be used within <Tooltip>");
|
|
3212
3229
|
return ctx;
|
|
3213
3230
|
}
|
|
3214
3231
|
function TooltipProvider({ children }) {
|
|
3215
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ jsx37(Fragment, { children });
|
|
3216
3233
|
}
|
|
3217
3234
|
function Tooltip({ open, defaultOpen = false, onOpenChange, children }) {
|
|
3218
3235
|
const [isOpen, setOpen] = useControllableState({
|
|
@@ -3220,8 +3237,8 @@ function Tooltip({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3220
3237
|
defaultValue: defaultOpen,
|
|
3221
3238
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3222
3239
|
});
|
|
3223
|
-
const anchorRef =
|
|
3224
|
-
return /* @__PURE__ */
|
|
3240
|
+
const anchorRef = React46.useRef(null);
|
|
3241
|
+
return /* @__PURE__ */ jsx37(TooltipProvider, { children: /* @__PURE__ */ jsx37(TooltipContext.Provider, { value: { open: isOpen, setOpen, anchorRef }, children }) });
|
|
3225
3242
|
}
|
|
3226
3243
|
function TooltipTrigger({
|
|
3227
3244
|
asChild = false,
|
|
@@ -3233,7 +3250,7 @@ function TooltipTrigger({
|
|
|
3233
3250
|
}) {
|
|
3234
3251
|
const { setOpen, anchorRef } = useTooltip();
|
|
3235
3252
|
const Comp = asChild ? Slot : "button";
|
|
3236
|
-
return /* @__PURE__ */
|
|
3253
|
+
return /* @__PURE__ */ jsx37(
|
|
3237
3254
|
Comp,
|
|
3238
3255
|
{
|
|
3239
3256
|
"data-slot": "tooltip-trigger",
|
|
@@ -3274,7 +3291,7 @@ function TooltipContent({
|
|
|
3274
3291
|
offset: sideOffset
|
|
3275
3292
|
});
|
|
3276
3293
|
if (!isPresent) return null;
|
|
3277
|
-
return /* @__PURE__ */
|
|
3294
|
+
return /* @__PURE__ */ jsx37(Portal, { children: /* @__PURE__ */ jsx37(
|
|
3278
3295
|
"div",
|
|
3279
3296
|
{
|
|
3280
3297
|
"data-slot": "tooltip-content",
|
|
@@ -3294,11 +3311,11 @@ function TooltipContent({
|
|
|
3294
3311
|
}
|
|
3295
3312
|
|
|
3296
3313
|
// src/components/popover.tsx
|
|
3297
|
-
import * as
|
|
3298
|
-
import { jsx as
|
|
3299
|
-
var PopoverContext =
|
|
3314
|
+
import * as React47 from "react";
|
|
3315
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3316
|
+
var PopoverContext = React47.createContext(null);
|
|
3300
3317
|
function usePopover() {
|
|
3301
|
-
const ctx =
|
|
3318
|
+
const ctx = React47.useContext(PopoverContext);
|
|
3302
3319
|
if (!ctx) throw new Error("Popover parts must be used within <Popover>");
|
|
3303
3320
|
return ctx;
|
|
3304
3321
|
}
|
|
@@ -3308,13 +3325,13 @@ function Popover({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3308
3325
|
defaultValue: defaultOpen,
|
|
3309
3326
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3310
3327
|
});
|
|
3311
|
-
const anchorRef =
|
|
3312
|
-
return /* @__PURE__ */
|
|
3328
|
+
const anchorRef = React47.useRef(null);
|
|
3329
|
+
return /* @__PURE__ */ jsx38(PopoverContext.Provider, { value: { open: isOpen, setOpen, anchorRef }, children });
|
|
3313
3330
|
}
|
|
3314
3331
|
function PopoverTrigger({ asChild = false, onClick, ...props }) {
|
|
3315
3332
|
const { open, setOpen, anchorRef } = usePopover();
|
|
3316
3333
|
const Comp = asChild ? Slot : "button";
|
|
3317
|
-
return /* @__PURE__ */
|
|
3334
|
+
return /* @__PURE__ */ jsx38(
|
|
3318
3335
|
Comp,
|
|
3319
3336
|
{
|
|
3320
3337
|
"data-slot": "popover-trigger",
|
|
@@ -3331,7 +3348,7 @@ function PopoverTrigger({ asChild = false, onClick, ...props }) {
|
|
|
3331
3348
|
function PopoverAnchor({ asChild = false, ...props }) {
|
|
3332
3349
|
const { anchorRef } = usePopover();
|
|
3333
3350
|
const Comp = asChild ? Slot : "div";
|
|
3334
|
-
return /* @__PURE__ */
|
|
3351
|
+
return /* @__PURE__ */ jsx38(
|
|
3335
3352
|
Comp,
|
|
3336
3353
|
{
|
|
3337
3354
|
"data-slot": "popover-anchor",
|
|
@@ -3363,7 +3380,7 @@ function PopoverContent({
|
|
|
3363
3380
|
exclude: [anchorRef]
|
|
3364
3381
|
});
|
|
3365
3382
|
if (!isPresent) return null;
|
|
3366
|
-
return /* @__PURE__ */
|
|
3383
|
+
return /* @__PURE__ */ jsx38(Portal, { children: /* @__PURE__ */ jsx38(
|
|
3367
3384
|
"div",
|
|
3368
3385
|
{
|
|
3369
3386
|
"data-slot": "popover-content",
|
|
@@ -3383,11 +3400,11 @@ function PopoverContent({
|
|
|
3383
3400
|
}
|
|
3384
3401
|
|
|
3385
3402
|
// src/components/hover-card.tsx
|
|
3386
|
-
import * as
|
|
3387
|
-
import { jsx as
|
|
3388
|
-
var HoverCardContext =
|
|
3403
|
+
import * as React48 from "react";
|
|
3404
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3405
|
+
var HoverCardContext = React48.createContext(null);
|
|
3389
3406
|
function useHoverCard() {
|
|
3390
|
-
const ctx =
|
|
3407
|
+
const ctx = React48.useContext(HoverCardContext);
|
|
3391
3408
|
if (!ctx) throw new Error("HoverCard parts must be used within <HoverCard>");
|
|
3392
3409
|
return ctx;
|
|
3393
3410
|
}
|
|
@@ -3397,8 +3414,8 @@ function HoverCard({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3397
3414
|
defaultValue: defaultOpen,
|
|
3398
3415
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3399
3416
|
});
|
|
3400
|
-
const anchorRef =
|
|
3401
|
-
return /* @__PURE__ */
|
|
3417
|
+
const anchorRef = React48.useRef(null);
|
|
3418
|
+
return /* @__PURE__ */ jsx39(HoverCardContext.Provider, { value: { open: isOpen, setOpen, anchorRef }, children });
|
|
3402
3419
|
}
|
|
3403
3420
|
function HoverCardTrigger({
|
|
3404
3421
|
asChild = false,
|
|
@@ -3408,7 +3425,7 @@ function HoverCardTrigger({
|
|
|
3408
3425
|
}) {
|
|
3409
3426
|
const { setOpen, anchorRef } = useHoverCard();
|
|
3410
3427
|
const Comp = asChild ? Slot : "a";
|
|
3411
|
-
return /* @__PURE__ */
|
|
3428
|
+
return /* @__PURE__ */ jsx39(
|
|
3412
3429
|
Comp,
|
|
3413
3430
|
{
|
|
3414
3431
|
"data-slot": "hover-card-trigger",
|
|
@@ -3443,7 +3460,7 @@ function HoverCardContent({
|
|
|
3443
3460
|
offset: sideOffset
|
|
3444
3461
|
});
|
|
3445
3462
|
if (!isPresent) return null;
|
|
3446
|
-
return /* @__PURE__ */
|
|
3463
|
+
return /* @__PURE__ */ jsx39(Portal, { children: /* @__PURE__ */ jsx39(
|
|
3447
3464
|
"div",
|
|
3448
3465
|
{
|
|
3449
3466
|
"data-slot": "hover-card-content",
|
|
@@ -3463,13 +3480,13 @@ function HoverCardContent({
|
|
|
3463
3480
|
}
|
|
3464
3481
|
|
|
3465
3482
|
// src/components/dropdown-menu.tsx
|
|
3466
|
-
import * as
|
|
3467
|
-
import { jsx as
|
|
3468
|
-
var DropdownMenuContext =
|
|
3483
|
+
import * as React49 from "react";
|
|
3484
|
+
import { jsx as jsx40, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3485
|
+
var DropdownMenuContext = React49.createContext(
|
|
3469
3486
|
null
|
|
3470
3487
|
);
|
|
3471
3488
|
function useDropdownMenu() {
|
|
3472
|
-
const ctx =
|
|
3489
|
+
const ctx = React49.useContext(DropdownMenuContext);
|
|
3473
3490
|
if (!ctx) throw new Error("DropdownMenu parts must be used within <DropdownMenu>");
|
|
3474
3491
|
return ctx;
|
|
3475
3492
|
}
|
|
@@ -3479,16 +3496,16 @@ function DropdownMenu({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3479
3496
|
defaultValue: defaultOpen,
|
|
3480
3497
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3481
3498
|
});
|
|
3482
|
-
const anchorRef =
|
|
3483
|
-
return /* @__PURE__ */
|
|
3499
|
+
const anchorRef = React49.useRef(null);
|
|
3500
|
+
return /* @__PURE__ */ jsx40(DropdownMenuContext.Provider, { value: { open: isOpen, setOpen, anchorRef }, children: /* @__PURE__ */ jsx40("div", { "data-slot": "dropdown-menu", children }) });
|
|
3484
3501
|
}
|
|
3485
3502
|
function DropdownMenuPortal({ children }) {
|
|
3486
|
-
return /* @__PURE__ */
|
|
3503
|
+
return /* @__PURE__ */ jsx40(Portal, { children });
|
|
3487
3504
|
}
|
|
3488
3505
|
function DropdownMenuTrigger({ asChild = false, onClick, ...props }) {
|
|
3489
3506
|
const { open, setOpen, anchorRef } = useDropdownMenu();
|
|
3490
3507
|
const Comp = asChild ? Slot : "button";
|
|
3491
|
-
return /* @__PURE__ */
|
|
3508
|
+
return /* @__PURE__ */ jsx40(
|
|
3492
3509
|
Comp,
|
|
3493
3510
|
{
|
|
3494
3511
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -3524,7 +3541,7 @@ function DropdownMenuContent({
|
|
|
3524
3541
|
onDismiss: () => setOpen(false),
|
|
3525
3542
|
exclude: [anchorRef]
|
|
3526
3543
|
});
|
|
3527
|
-
const contentRef =
|
|
3544
|
+
const contentRef = React49.useRef(null);
|
|
3528
3545
|
const items = () => Array.from(
|
|
3529
3546
|
contentRef.current?.querySelectorAll("[role^='menuitem']") ?? []
|
|
3530
3547
|
).filter((el) => el.getAttribute("data-disabled") === null);
|
|
@@ -3533,13 +3550,13 @@ function DropdownMenuContent({
|
|
|
3533
3550
|
orientation: "vertical",
|
|
3534
3551
|
loop: true
|
|
3535
3552
|
});
|
|
3536
|
-
|
|
3553
|
+
React49.useEffect(() => {
|
|
3537
3554
|
if (!open) return;
|
|
3538
3555
|
items()[activeIndex]?.focus();
|
|
3539
3556
|
}, [open, activeIndex]);
|
|
3540
|
-
const close =
|
|
3557
|
+
const close = React49.useCallback(() => setOpen(false), [setOpen]);
|
|
3541
3558
|
if (!isPresent) return null;
|
|
3542
|
-
return /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsx40(Portal, { children: /* @__PURE__ */ jsx40(DropdownMenuCloseContext.Provider, { value: close, children: /* @__PURE__ */ jsx40(
|
|
3543
3560
|
"div",
|
|
3544
3561
|
{
|
|
3545
3562
|
"data-slot": "dropdown-menu-content",
|
|
@@ -3562,10 +3579,10 @@ function DropdownMenuContent({
|
|
|
3562
3579
|
}
|
|
3563
3580
|
) }) });
|
|
3564
3581
|
}
|
|
3565
|
-
var DropdownMenuCloseContext =
|
|
3582
|
+
var DropdownMenuCloseContext = React49.createContext(() => {
|
|
3566
3583
|
});
|
|
3567
3584
|
function DropdownMenuGroup({ className, ...props }) {
|
|
3568
|
-
return /* @__PURE__ */
|
|
3585
|
+
return /* @__PURE__ */ jsx40("div", { "data-slot": "dropdown-menu-group", role: "group", className, ...props });
|
|
3569
3586
|
}
|
|
3570
3587
|
function DropdownMenuItem({
|
|
3571
3588
|
className,
|
|
@@ -3576,8 +3593,8 @@ function DropdownMenuItem({
|
|
|
3576
3593
|
onKeyDown,
|
|
3577
3594
|
...props
|
|
3578
3595
|
}) {
|
|
3579
|
-
const close =
|
|
3580
|
-
return /* @__PURE__ */
|
|
3596
|
+
const close = React49.useContext(DropdownMenuCloseContext);
|
|
3597
|
+
return /* @__PURE__ */ jsx40(
|
|
3581
3598
|
"div",
|
|
3582
3599
|
{
|
|
3583
3600
|
"data-slot": "dropdown-menu-item",
|
|
@@ -3614,7 +3631,7 @@ function DropdownMenuCheckboxItem({
|
|
|
3614
3631
|
onClick,
|
|
3615
3632
|
...props
|
|
3616
3633
|
}) {
|
|
3617
|
-
const close =
|
|
3634
|
+
const close = React49.useContext(DropdownMenuCloseContext);
|
|
3618
3635
|
return /* @__PURE__ */ jsxs10(
|
|
3619
3636
|
"div",
|
|
3620
3637
|
{
|
|
@@ -3635,13 +3652,13 @@ function DropdownMenuCheckboxItem({
|
|
|
3635
3652
|
},
|
|
3636
3653
|
...props,
|
|
3637
3654
|
children: [
|
|
3638
|
-
/* @__PURE__ */
|
|
3655
|
+
/* @__PURE__ */ jsx40("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: checked ? /* @__PURE__ */ jsx40("svg", { className: "size-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx40("path", { d: "M20 6 9 17l-5-5" }) }) : null }),
|
|
3639
3656
|
children
|
|
3640
3657
|
]
|
|
3641
3658
|
}
|
|
3642
3659
|
);
|
|
3643
3660
|
}
|
|
3644
|
-
var DropdownMenuRadioGroupContext =
|
|
3661
|
+
var DropdownMenuRadioGroupContext = React49.createContext(null);
|
|
3645
3662
|
function DropdownMenuRadioGroup({
|
|
3646
3663
|
className,
|
|
3647
3664
|
value,
|
|
@@ -3649,11 +3666,11 @@ function DropdownMenuRadioGroup({
|
|
|
3649
3666
|
children,
|
|
3650
3667
|
...props
|
|
3651
3668
|
}) {
|
|
3652
|
-
const ctx =
|
|
3669
|
+
const ctx = React49.useMemo(
|
|
3653
3670
|
() => ({ value, setValue: (next) => onValueChange?.(next) }),
|
|
3654
3671
|
[value, onValueChange]
|
|
3655
3672
|
);
|
|
3656
|
-
return /* @__PURE__ */
|
|
3673
|
+
return /* @__PURE__ */ jsx40(DropdownMenuRadioGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx40("div", { "data-slot": "dropdown-menu-radio-group", role: "group", className, ...props, children }) });
|
|
3657
3674
|
}
|
|
3658
3675
|
function DropdownMenuRadioItem({
|
|
3659
3676
|
className,
|
|
@@ -3663,8 +3680,8 @@ function DropdownMenuRadioItem({
|
|
|
3663
3680
|
onClick,
|
|
3664
3681
|
...props
|
|
3665
3682
|
}) {
|
|
3666
|
-
const close =
|
|
3667
|
-
const group =
|
|
3683
|
+
const close = React49.useContext(DropdownMenuCloseContext);
|
|
3684
|
+
const group = React49.useContext(DropdownMenuRadioGroupContext);
|
|
3668
3685
|
const checked = group?.value === value;
|
|
3669
3686
|
return /* @__PURE__ */ jsxs10(
|
|
3670
3687
|
"div",
|
|
@@ -3687,14 +3704,14 @@ function DropdownMenuRadioItem({
|
|
|
3687
3704
|
},
|
|
3688
3705
|
...props,
|
|
3689
3706
|
children: [
|
|
3690
|
-
/* @__PURE__ */
|
|
3707
|
+
/* @__PURE__ */ jsx40("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: checked ? /* @__PURE__ */ jsx40("svg", { className: "size-2 fill-current", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx40("circle", { cx: "12", cy: "12", r: "10" }) }) : null }),
|
|
3691
3708
|
children
|
|
3692
3709
|
]
|
|
3693
3710
|
}
|
|
3694
3711
|
);
|
|
3695
3712
|
}
|
|
3696
3713
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
3697
|
-
return /* @__PURE__ */
|
|
3714
|
+
return /* @__PURE__ */ jsx40(
|
|
3698
3715
|
"div",
|
|
3699
3716
|
{
|
|
3700
3717
|
"data-slot": "dropdown-menu-label",
|
|
@@ -3705,7 +3722,7 @@ function DropdownMenuLabel({ className, inset, ...props }) {
|
|
|
3705
3722
|
);
|
|
3706
3723
|
}
|
|
3707
3724
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
3708
|
-
return /* @__PURE__ */
|
|
3725
|
+
return /* @__PURE__ */ jsx40(
|
|
3709
3726
|
"div",
|
|
3710
3727
|
{
|
|
3711
3728
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -3716,7 +3733,7 @@ function DropdownMenuSeparator({ className, ...props }) {
|
|
|
3716
3733
|
);
|
|
3717
3734
|
}
|
|
3718
3735
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
3719
|
-
return /* @__PURE__ */
|
|
3736
|
+
return /* @__PURE__ */ jsx40(
|
|
3720
3737
|
"span",
|
|
3721
3738
|
{
|
|
3722
3739
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -3725,17 +3742,17 @@ function DropdownMenuShortcut({ className, ...props }) {
|
|
|
3725
3742
|
}
|
|
3726
3743
|
);
|
|
3727
3744
|
}
|
|
3728
|
-
var DropdownMenuSubContext =
|
|
3745
|
+
var DropdownMenuSubContext = React49.createContext(null);
|
|
3729
3746
|
function DropdownMenuSub({ open, defaultOpen = false, onOpenChange, children }) {
|
|
3730
3747
|
const [isOpen, setOpen] = useControllableState({
|
|
3731
3748
|
...open !== void 0 ? { value: open } : {},
|
|
3732
3749
|
defaultValue: defaultOpen,
|
|
3733
3750
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3734
3751
|
});
|
|
3735
|
-
return /* @__PURE__ */
|
|
3752
|
+
return /* @__PURE__ */ jsx40(DropdownMenuSubContext.Provider, { value: { open: isOpen, setOpen }, children: /* @__PURE__ */ jsx40("div", { "data-slot": "dropdown-menu-sub", children }) });
|
|
3736
3753
|
}
|
|
3737
3754
|
function DropdownMenuSubTrigger({ className, inset, children, onClick, ...props }) {
|
|
3738
|
-
const ctx =
|
|
3755
|
+
const ctx = React49.useContext(DropdownMenuSubContext);
|
|
3739
3756
|
return /* @__PURE__ */ jsxs10(
|
|
3740
3757
|
"div",
|
|
3741
3758
|
{
|
|
@@ -3757,15 +3774,15 @@ function DropdownMenuSubTrigger({ className, inset, children, onClick, ...props
|
|
|
3757
3774
|
...props,
|
|
3758
3775
|
children: [
|
|
3759
3776
|
children,
|
|
3760
|
-
/* @__PURE__ */
|
|
3777
|
+
/* @__PURE__ */ jsx40("svg", { className: "ml-auto size-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx40("path", { d: "m9 18 6-6-6-6" }) })
|
|
3761
3778
|
]
|
|
3762
3779
|
}
|
|
3763
3780
|
);
|
|
3764
3781
|
}
|
|
3765
3782
|
function DropdownMenuSubContent({ className, children, ...props }) {
|
|
3766
|
-
const ctx =
|
|
3783
|
+
const ctx = React49.useContext(DropdownMenuSubContext);
|
|
3767
3784
|
if (!ctx?.open) return null;
|
|
3768
|
-
return /* @__PURE__ */
|
|
3785
|
+
return /* @__PURE__ */ jsx40(
|
|
3769
3786
|
"div",
|
|
3770
3787
|
{
|
|
3771
3788
|
"data-slot": "dropdown-menu-sub-content",
|
|
@@ -3782,11 +3799,11 @@ function DropdownMenuSubContent({ className, children, ...props }) {
|
|
|
3782
3799
|
}
|
|
3783
3800
|
|
|
3784
3801
|
// src/components/context-menu.tsx
|
|
3785
|
-
import * as
|
|
3786
|
-
import { jsx as
|
|
3787
|
-
var ContextMenuContext =
|
|
3802
|
+
import * as React50 from "react";
|
|
3803
|
+
import { jsx as jsx41, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3804
|
+
var ContextMenuContext = React50.createContext(null);
|
|
3788
3805
|
function useContextMenu() {
|
|
3789
|
-
const ctx =
|
|
3806
|
+
const ctx = React50.useContext(ContextMenuContext);
|
|
3790
3807
|
if (!ctx) throw new Error("ContextMenu parts must be used within <ContextMenu>");
|
|
3791
3808
|
return ctx;
|
|
3792
3809
|
}
|
|
@@ -3796,16 +3813,16 @@ function ContextMenu({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3796
3813
|
defaultValue: defaultOpen,
|
|
3797
3814
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3798
3815
|
});
|
|
3799
|
-
const [point, setPoint] =
|
|
3800
|
-
return /* @__PURE__ */
|
|
3816
|
+
const [point, setPoint] = React50.useState({ x: 0, y: 0 });
|
|
3817
|
+
return /* @__PURE__ */ jsx41(ContextMenuContext.Provider, { value: { open: isOpen, setOpen, point, setPoint }, children: /* @__PURE__ */ jsx41("div", { "data-slot": "context-menu", children }) });
|
|
3801
3818
|
}
|
|
3802
3819
|
function ContextMenuPortal({ children }) {
|
|
3803
|
-
return /* @__PURE__ */
|
|
3820
|
+
return /* @__PURE__ */ jsx41(Portal, { children });
|
|
3804
3821
|
}
|
|
3805
3822
|
function ContextMenuTrigger({ asChild = false, onContextMenu, ...props }) {
|
|
3806
3823
|
const { setOpen, setPoint } = useContextMenu();
|
|
3807
3824
|
const Comp = asChild ? Slot : "div";
|
|
3808
|
-
return /* @__PURE__ */
|
|
3825
|
+
return /* @__PURE__ */ jsx41(
|
|
3809
3826
|
Comp,
|
|
3810
3827
|
{
|
|
3811
3828
|
"data-slot": "context-menu-trigger",
|
|
@@ -3820,9 +3837,9 @@ function ContextMenuTrigger({ asChild = false, onContextMenu, ...props }) {
|
|
|
3820
3837
|
);
|
|
3821
3838
|
}
|
|
3822
3839
|
function ContextMenuGroup({ className, ...props }) {
|
|
3823
|
-
return /* @__PURE__ */
|
|
3840
|
+
return /* @__PURE__ */ jsx41("div", { "data-slot": "context-menu-group", role: "group", className, ...props });
|
|
3824
3841
|
}
|
|
3825
|
-
var ContextMenuCloseContext =
|
|
3842
|
+
var ContextMenuCloseContext = React50.createContext(() => {
|
|
3826
3843
|
});
|
|
3827
3844
|
function ContextMenuContent({ className, children, ...props }) {
|
|
3828
3845
|
const { open, setOpen, point } = useContextMenu();
|
|
@@ -3831,7 +3848,7 @@ function ContextMenuContent({ className, children, ...props }) {
|
|
|
3831
3848
|
enabled: open,
|
|
3832
3849
|
onDismiss: () => setOpen(false)
|
|
3833
3850
|
});
|
|
3834
|
-
const contentRef =
|
|
3851
|
+
const contentRef = React50.useRef(null);
|
|
3835
3852
|
const items = () => Array.from(
|
|
3836
3853
|
contentRef.current?.querySelectorAll("[role^='menuitem']") ?? []
|
|
3837
3854
|
).filter((el) => el.getAttribute("data-disabled") === null);
|
|
@@ -3840,13 +3857,13 @@ function ContextMenuContent({ className, children, ...props }) {
|
|
|
3840
3857
|
orientation: "vertical",
|
|
3841
3858
|
loop: true
|
|
3842
3859
|
});
|
|
3843
|
-
|
|
3860
|
+
React50.useEffect(() => {
|
|
3844
3861
|
if (!open) return;
|
|
3845
3862
|
items()[activeIndex]?.focus();
|
|
3846
3863
|
}, [open, activeIndex]);
|
|
3847
|
-
const close =
|
|
3864
|
+
const close = React50.useCallback(() => setOpen(false), [setOpen]);
|
|
3848
3865
|
if (!isPresent) return null;
|
|
3849
|
-
return /* @__PURE__ */
|
|
3866
|
+
return /* @__PURE__ */ jsx41(Portal, { children: /* @__PURE__ */ jsx41(ContextMenuCloseContext.Provider, { value: close, children: /* @__PURE__ */ jsx41(
|
|
3850
3867
|
"div",
|
|
3851
3868
|
{
|
|
3852
3869
|
"data-slot": "context-menu-content",
|
|
@@ -3878,8 +3895,8 @@ function ContextMenuItem({
|
|
|
3878
3895
|
onKeyDown,
|
|
3879
3896
|
...props
|
|
3880
3897
|
}) {
|
|
3881
|
-
const close =
|
|
3882
|
-
return /* @__PURE__ */
|
|
3898
|
+
const close = React50.useContext(ContextMenuCloseContext);
|
|
3899
|
+
return /* @__PURE__ */ jsx41(
|
|
3883
3900
|
"div",
|
|
3884
3901
|
{
|
|
3885
3902
|
"data-slot": "context-menu-item",
|
|
@@ -3916,7 +3933,7 @@ function ContextMenuCheckboxItem({
|
|
|
3916
3933
|
onClick,
|
|
3917
3934
|
...props
|
|
3918
3935
|
}) {
|
|
3919
|
-
const close =
|
|
3936
|
+
const close = React50.useContext(ContextMenuCloseContext);
|
|
3920
3937
|
return /* @__PURE__ */ jsxs11(
|
|
3921
3938
|
"div",
|
|
3922
3939
|
{
|
|
@@ -3937,13 +3954,13 @@ function ContextMenuCheckboxItem({
|
|
|
3937
3954
|
},
|
|
3938
3955
|
...props,
|
|
3939
3956
|
children: [
|
|
3940
|
-
/* @__PURE__ */
|
|
3957
|
+
/* @__PURE__ */ jsx41("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: checked ? /* @__PURE__ */ jsx41("svg", { className: "size-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx41("path", { d: "M20 6 9 17l-5-5" }) }) : null }),
|
|
3941
3958
|
children
|
|
3942
3959
|
]
|
|
3943
3960
|
}
|
|
3944
3961
|
);
|
|
3945
3962
|
}
|
|
3946
|
-
var ContextMenuRadioGroupContext =
|
|
3963
|
+
var ContextMenuRadioGroupContext = React50.createContext(null);
|
|
3947
3964
|
function ContextMenuRadioGroup({
|
|
3948
3965
|
className,
|
|
3949
3966
|
value,
|
|
@@ -3951,11 +3968,11 @@ function ContextMenuRadioGroup({
|
|
|
3951
3968
|
children,
|
|
3952
3969
|
...props
|
|
3953
3970
|
}) {
|
|
3954
|
-
const ctx =
|
|
3971
|
+
const ctx = React50.useMemo(
|
|
3955
3972
|
() => ({ value, setValue: (next) => onValueChange?.(next) }),
|
|
3956
3973
|
[value, onValueChange]
|
|
3957
3974
|
);
|
|
3958
|
-
return /* @__PURE__ */
|
|
3975
|
+
return /* @__PURE__ */ jsx41(ContextMenuRadioGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx41("div", { "data-slot": "context-menu-radio-group", role: "group", className, ...props, children }) });
|
|
3959
3976
|
}
|
|
3960
3977
|
function ContextMenuRadioItem({
|
|
3961
3978
|
className,
|
|
@@ -3965,8 +3982,8 @@ function ContextMenuRadioItem({
|
|
|
3965
3982
|
onClick,
|
|
3966
3983
|
...props
|
|
3967
3984
|
}) {
|
|
3968
|
-
const close =
|
|
3969
|
-
const group =
|
|
3985
|
+
const close = React50.useContext(ContextMenuCloseContext);
|
|
3986
|
+
const group = React50.useContext(ContextMenuRadioGroupContext);
|
|
3970
3987
|
const checked = group?.value === value;
|
|
3971
3988
|
return /* @__PURE__ */ jsxs11(
|
|
3972
3989
|
"div",
|
|
@@ -3989,14 +4006,14 @@ function ContextMenuRadioItem({
|
|
|
3989
4006
|
},
|
|
3990
4007
|
...props,
|
|
3991
4008
|
children: [
|
|
3992
|
-
/* @__PURE__ */
|
|
4009
|
+
/* @__PURE__ */ jsx41("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: checked ? /* @__PURE__ */ jsx41("svg", { className: "size-2 fill-current", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx41("circle", { cx: "12", cy: "12", r: "10" }) }) : null }),
|
|
3993
4010
|
children
|
|
3994
4011
|
]
|
|
3995
4012
|
}
|
|
3996
4013
|
);
|
|
3997
4014
|
}
|
|
3998
4015
|
function ContextMenuLabel({ className, inset, ...props }) {
|
|
3999
|
-
return /* @__PURE__ */
|
|
4016
|
+
return /* @__PURE__ */ jsx41(
|
|
4000
4017
|
"div",
|
|
4001
4018
|
{
|
|
4002
4019
|
"data-slot": "context-menu-label",
|
|
@@ -4007,7 +4024,7 @@ function ContextMenuLabel({ className, inset, ...props }) {
|
|
|
4007
4024
|
);
|
|
4008
4025
|
}
|
|
4009
4026
|
function ContextMenuSeparator({ className, ...props }) {
|
|
4010
|
-
return /* @__PURE__ */
|
|
4027
|
+
return /* @__PURE__ */ jsx41(
|
|
4011
4028
|
"div",
|
|
4012
4029
|
{
|
|
4013
4030
|
"data-slot": "context-menu-separator",
|
|
@@ -4018,7 +4035,7 @@ function ContextMenuSeparator({ className, ...props }) {
|
|
|
4018
4035
|
);
|
|
4019
4036
|
}
|
|
4020
4037
|
function ContextMenuShortcut({ className, ...props }) {
|
|
4021
|
-
return /* @__PURE__ */
|
|
4038
|
+
return /* @__PURE__ */ jsx41(
|
|
4022
4039
|
"span",
|
|
4023
4040
|
{
|
|
4024
4041
|
"data-slot": "context-menu-shortcut",
|
|
@@ -4027,17 +4044,17 @@ function ContextMenuShortcut({ className, ...props }) {
|
|
|
4027
4044
|
}
|
|
4028
4045
|
);
|
|
4029
4046
|
}
|
|
4030
|
-
var ContextMenuSubContext =
|
|
4047
|
+
var ContextMenuSubContext = React50.createContext(null);
|
|
4031
4048
|
function ContextMenuSub({ open, defaultOpen = false, onOpenChange, children }) {
|
|
4032
4049
|
const [isOpen, setOpen] = useControllableState({
|
|
4033
4050
|
...open !== void 0 ? { value: open } : {},
|
|
4034
4051
|
defaultValue: defaultOpen,
|
|
4035
4052
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
4036
4053
|
});
|
|
4037
|
-
return /* @__PURE__ */
|
|
4054
|
+
return /* @__PURE__ */ jsx41(ContextMenuSubContext.Provider, { value: { open: isOpen, setOpen }, children: /* @__PURE__ */ jsx41("div", { "data-slot": "context-menu-sub", children }) });
|
|
4038
4055
|
}
|
|
4039
4056
|
function ContextMenuSubTrigger({ className, inset, children, onClick, ...props }) {
|
|
4040
|
-
const ctx =
|
|
4057
|
+
const ctx = React50.useContext(ContextMenuSubContext);
|
|
4041
4058
|
return /* @__PURE__ */ jsxs11(
|
|
4042
4059
|
"div",
|
|
4043
4060
|
{
|
|
@@ -4059,15 +4076,15 @@ function ContextMenuSubTrigger({ className, inset, children, onClick, ...props }
|
|
|
4059
4076
|
...props,
|
|
4060
4077
|
children: [
|
|
4061
4078
|
children,
|
|
4062
|
-
/* @__PURE__ */
|
|
4079
|
+
/* @__PURE__ */ jsx41("svg", { className: "ml-auto", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx41("path", { d: "m9 18 6-6-6-6" }) })
|
|
4063
4080
|
]
|
|
4064
4081
|
}
|
|
4065
4082
|
);
|
|
4066
4083
|
}
|
|
4067
4084
|
function ContextMenuSubContent({ className, children, ...props }) {
|
|
4068
|
-
const ctx =
|
|
4085
|
+
const ctx = React50.useContext(ContextMenuSubContext);
|
|
4069
4086
|
if (!ctx?.open) return null;
|
|
4070
|
-
return /* @__PURE__ */
|
|
4087
|
+
return /* @__PURE__ */ jsx41(
|
|
4071
4088
|
"div",
|
|
4072
4089
|
{
|
|
4073
4090
|
"data-slot": "context-menu-sub-content",
|
|
@@ -4084,19 +4101,19 @@ function ContextMenuSubContent({ className, children, ...props }) {
|
|
|
4084
4101
|
}
|
|
4085
4102
|
|
|
4086
4103
|
// src/components/menubar.tsx
|
|
4087
|
-
import * as
|
|
4088
|
-
import { jsx as
|
|
4104
|
+
import * as React51 from "react";
|
|
4105
|
+
import { jsx as jsx42, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4089
4106
|
var CONTENT = "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] overflow-hidden rounded-md border p-1 shadow-md";
|
|
4090
4107
|
var SUB_CONTENT = "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg";
|
|
4091
|
-
var MenubarMenuContext =
|
|
4108
|
+
var MenubarMenuContext = React51.createContext(null);
|
|
4092
4109
|
function useMenu() {
|
|
4093
|
-
const ctx =
|
|
4110
|
+
const ctx = React51.useContext(MenubarMenuContext);
|
|
4094
4111
|
if (!ctx) throw new Error("Menubar parts must be used within <MenubarMenu>");
|
|
4095
4112
|
return ctx;
|
|
4096
4113
|
}
|
|
4097
|
-
var MenubarRadioGroupContext =
|
|
4114
|
+
var MenubarRadioGroupContext = React51.createContext(null);
|
|
4098
4115
|
function Menubar({ className, ...props }) {
|
|
4099
|
-
return /* @__PURE__ */
|
|
4116
|
+
return /* @__PURE__ */ jsx42(
|
|
4100
4117
|
"div",
|
|
4101
4118
|
{
|
|
4102
4119
|
"data-slot": "menubar",
|
|
@@ -4115,12 +4132,12 @@ function MenubarMenu({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4115
4132
|
defaultValue: defaultOpen,
|
|
4116
4133
|
onChange: onOpenChange
|
|
4117
4134
|
});
|
|
4118
|
-
const triggerRef =
|
|
4119
|
-
return /* @__PURE__ */
|
|
4135
|
+
const triggerRef = React51.useRef(null);
|
|
4136
|
+
return /* @__PURE__ */ jsx42(MenubarMenuContext.Provider, { value: { open: isOpen, setOpen, triggerRef }, children: /* @__PURE__ */ jsx42("div", { "data-slot": "menubar-menu", className: "relative", children }) });
|
|
4120
4137
|
}
|
|
4121
4138
|
function MenubarTrigger({ className, onClick, ...props }) {
|
|
4122
4139
|
const { open, setOpen, triggerRef } = useMenu();
|
|
4123
|
-
return /* @__PURE__ */
|
|
4140
|
+
return /* @__PURE__ */ jsx42(
|
|
4124
4141
|
"button",
|
|
4125
4142
|
{
|
|
4126
4143
|
ref: triggerRef,
|
|
@@ -4159,10 +4176,10 @@ function MenubarContent({
|
|
|
4159
4176
|
onDismiss: () => setOpen(false),
|
|
4160
4177
|
exclude: [triggerRef]
|
|
4161
4178
|
});
|
|
4162
|
-
const items =
|
|
4179
|
+
const items = React51.Children.toArray(children);
|
|
4163
4180
|
const { onKeyDown } = useRovingFocus({ count: items.length, orientation: "vertical" });
|
|
4164
4181
|
if (!isPresent) return null;
|
|
4165
|
-
return /* @__PURE__ */
|
|
4182
|
+
return /* @__PURE__ */ jsx42(Portal, { children: /* @__PURE__ */ jsx42(
|
|
4166
4183
|
"div",
|
|
4167
4184
|
{
|
|
4168
4185
|
ref: mergeRefs(presenceRef, floatingRef, dismissRef),
|
|
@@ -4179,7 +4196,7 @@ function MenubarContent({
|
|
|
4179
4196
|
) });
|
|
4180
4197
|
}
|
|
4181
4198
|
function MenubarGroup({ className, ...props }) {
|
|
4182
|
-
return /* @__PURE__ */
|
|
4199
|
+
return /* @__PURE__ */ jsx42("div", { "data-slot": "menubar-group", role: "group", className, ...props });
|
|
4183
4200
|
}
|
|
4184
4201
|
function MenubarItem({
|
|
4185
4202
|
className,
|
|
@@ -4187,7 +4204,7 @@ function MenubarItem({
|
|
|
4187
4204
|
variant = "default",
|
|
4188
4205
|
...props
|
|
4189
4206
|
}) {
|
|
4190
|
-
return /* @__PURE__ */
|
|
4207
|
+
return /* @__PURE__ */ jsx42(
|
|
4191
4208
|
"div",
|
|
4192
4209
|
{
|
|
4193
4210
|
"data-slot": "menubar-item",
|
|
@@ -4222,7 +4239,7 @@ function MenubarCheckboxItem({
|
|
|
4222
4239
|
),
|
|
4223
4240
|
...props,
|
|
4224
4241
|
children: [
|
|
4225
|
-
/* @__PURE__ */
|
|
4242
|
+
/* @__PURE__ */ jsx42("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: checked && /* @__PURE__ */ jsx42(
|
|
4226
4243
|
"svg",
|
|
4227
4244
|
{
|
|
4228
4245
|
className: "size-4",
|
|
@@ -4232,7 +4249,7 @@ function MenubarCheckboxItem({
|
|
|
4232
4249
|
strokeWidth: "2",
|
|
4233
4250
|
strokeLinecap: "round",
|
|
4234
4251
|
strokeLinejoin: "round",
|
|
4235
|
-
children: /* @__PURE__ */
|
|
4252
|
+
children: /* @__PURE__ */ jsx42("path", { d: "M20 6 9 17l-5-5" })
|
|
4236
4253
|
}
|
|
4237
4254
|
) }),
|
|
4238
4255
|
children
|
|
@@ -4252,7 +4269,7 @@ function MenubarRadioGroup({
|
|
|
4252
4269
|
defaultValue,
|
|
4253
4270
|
onChange: onValueChange
|
|
4254
4271
|
});
|
|
4255
|
-
return /* @__PURE__ */
|
|
4272
|
+
return /* @__PURE__ */ jsx42(MenubarRadioGroupContext.Provider, { value: { value: current, onValueChange: setValue }, children: /* @__PURE__ */ jsx42("div", { "data-slot": "menubar-radio-group", role: "group", className, children }) });
|
|
4256
4273
|
}
|
|
4257
4274
|
function MenubarRadioItem({
|
|
4258
4275
|
className,
|
|
@@ -4260,7 +4277,7 @@ function MenubarRadioItem({
|
|
|
4260
4277
|
value,
|
|
4261
4278
|
...props
|
|
4262
4279
|
}) {
|
|
4263
|
-
const ctx =
|
|
4280
|
+
const ctx = React51.useContext(MenubarRadioGroupContext);
|
|
4264
4281
|
const checked = ctx?.value === value;
|
|
4265
4282
|
return /* @__PURE__ */ jsxs12(
|
|
4266
4283
|
"div",
|
|
@@ -4276,7 +4293,7 @@ function MenubarRadioItem({
|
|
|
4276
4293
|
onClick: () => ctx?.onValueChange(value),
|
|
4277
4294
|
...props,
|
|
4278
4295
|
children: [
|
|
4279
|
-
/* @__PURE__ */
|
|
4296
|
+
/* @__PURE__ */ jsx42("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: checked && /* @__PURE__ */ jsx42("svg", { className: "size-2 fill-current", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx42("circle", { cx: "12", cy: "12", r: "10" }) }) }),
|
|
4280
4297
|
children
|
|
4281
4298
|
]
|
|
4282
4299
|
}
|
|
@@ -4287,7 +4304,7 @@ function MenubarLabel({
|
|
|
4287
4304
|
inset,
|
|
4288
4305
|
...props
|
|
4289
4306
|
}) {
|
|
4290
|
-
return /* @__PURE__ */
|
|
4307
|
+
return /* @__PURE__ */ jsx42(
|
|
4291
4308
|
"div",
|
|
4292
4309
|
{
|
|
4293
4310
|
"data-slot": "menubar-label",
|
|
@@ -4298,7 +4315,7 @@ function MenubarLabel({
|
|
|
4298
4315
|
);
|
|
4299
4316
|
}
|
|
4300
4317
|
function MenubarSeparator({ className, ...props }) {
|
|
4301
|
-
return /* @__PURE__ */
|
|
4318
|
+
return /* @__PURE__ */ jsx42(
|
|
4302
4319
|
"div",
|
|
4303
4320
|
{
|
|
4304
4321
|
"data-slot": "menubar-separator",
|
|
@@ -4309,7 +4326,7 @@ function MenubarSeparator({ className, ...props }) {
|
|
|
4309
4326
|
);
|
|
4310
4327
|
}
|
|
4311
4328
|
function MenubarShortcut({ className, ...props }) {
|
|
4312
|
-
return /* @__PURE__ */
|
|
4329
|
+
return /* @__PURE__ */ jsx42(
|
|
4313
4330
|
"span",
|
|
4314
4331
|
{
|
|
4315
4332
|
"data-slot": "menubar-shortcut",
|
|
@@ -4318,9 +4335,9 @@ function MenubarShortcut({ className, ...props }) {
|
|
|
4318
4335
|
}
|
|
4319
4336
|
);
|
|
4320
4337
|
}
|
|
4321
|
-
var MenubarSubContext =
|
|
4338
|
+
var MenubarSubContext = React51.createContext(null);
|
|
4322
4339
|
function useSub() {
|
|
4323
|
-
const ctx =
|
|
4340
|
+
const ctx = React51.useContext(MenubarSubContext);
|
|
4324
4341
|
if (!ctx) throw new Error("MenubarSub parts must be used within <MenubarSub>");
|
|
4325
4342
|
return ctx;
|
|
4326
4343
|
}
|
|
@@ -4330,7 +4347,7 @@ function MenubarSub({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4330
4347
|
defaultValue: defaultOpen,
|
|
4331
4348
|
onChange: onOpenChange
|
|
4332
4349
|
});
|
|
4333
|
-
return /* @__PURE__ */
|
|
4350
|
+
return /* @__PURE__ */ jsx42(MenubarSubContext.Provider, { value: { open: isOpen, setOpen }, children: /* @__PURE__ */ jsx42("div", { "data-slot": "menubar-sub", className: "relative", children }) });
|
|
4334
4351
|
}
|
|
4335
4352
|
function MenubarSubTrigger({
|
|
4336
4353
|
className,
|
|
@@ -4359,7 +4376,7 @@ function MenubarSubTrigger({
|
|
|
4359
4376
|
...props,
|
|
4360
4377
|
children: [
|
|
4361
4378
|
children,
|
|
4362
|
-
/* @__PURE__ */
|
|
4379
|
+
/* @__PURE__ */ jsx42(
|
|
4363
4380
|
"svg",
|
|
4364
4381
|
{
|
|
4365
4382
|
className: "ml-auto h-4 w-4",
|
|
@@ -4369,7 +4386,7 @@ function MenubarSubTrigger({
|
|
|
4369
4386
|
strokeWidth: "2",
|
|
4370
4387
|
strokeLinecap: "round",
|
|
4371
4388
|
strokeLinejoin: "round",
|
|
4372
|
-
children: /* @__PURE__ */
|
|
4389
|
+
children: /* @__PURE__ */ jsx42("path", { d: "m9 18 6-6-6-6" })
|
|
4373
4390
|
}
|
|
4374
4391
|
)
|
|
4375
4392
|
]
|
|
@@ -4380,7 +4397,7 @@ function MenubarSubContent({ className, children, ...props }) {
|
|
|
4380
4397
|
const { open } = useSub();
|
|
4381
4398
|
const { isPresent, ref } = usePresence(open);
|
|
4382
4399
|
if (!isPresent) return null;
|
|
4383
|
-
return /* @__PURE__ */
|
|
4400
|
+
return /* @__PURE__ */ jsx42(
|
|
4384
4401
|
"div",
|
|
4385
4402
|
{
|
|
4386
4403
|
ref,
|
|
@@ -4395,14 +4412,14 @@ function MenubarSubContent({ className, children, ...props }) {
|
|
|
4395
4412
|
}
|
|
4396
4413
|
|
|
4397
4414
|
// src/components/navigation-menu.tsx
|
|
4398
|
-
import * as
|
|
4399
|
-
import { jsx as
|
|
4415
|
+
import * as React52 from "react";
|
|
4416
|
+
import { jsx as jsx43, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4400
4417
|
function navigationMenuTriggerStyle() {
|
|
4401
4418
|
return "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1";
|
|
4402
4419
|
}
|
|
4403
|
-
var NavigationMenuItemContext =
|
|
4420
|
+
var NavigationMenuItemContext = React52.createContext(null);
|
|
4404
4421
|
function useItem() {
|
|
4405
|
-
const ctx =
|
|
4422
|
+
const ctx = React52.useContext(NavigationMenuItemContext);
|
|
4406
4423
|
if (!ctx) throw new Error("NavigationMenu parts must be used within <NavigationMenuItem>");
|
|
4407
4424
|
return ctx;
|
|
4408
4425
|
}
|
|
@@ -4425,13 +4442,13 @@ function NavigationMenu({
|
|
|
4425
4442
|
...props,
|
|
4426
4443
|
children: [
|
|
4427
4444
|
children,
|
|
4428
|
-
viewport && /* @__PURE__ */
|
|
4445
|
+
viewport && /* @__PURE__ */ jsx43(NavigationMenuViewport, {})
|
|
4429
4446
|
]
|
|
4430
4447
|
}
|
|
4431
4448
|
);
|
|
4432
4449
|
}
|
|
4433
4450
|
function NavigationMenuList({ className, ...props }) {
|
|
4434
|
-
return /* @__PURE__ */
|
|
4451
|
+
return /* @__PURE__ */ jsx43(
|
|
4435
4452
|
"ul",
|
|
4436
4453
|
{
|
|
4437
4454
|
"data-slot": "navigation-menu-list",
|
|
@@ -4457,8 +4474,8 @@ function NavigationMenuItem({
|
|
|
4457
4474
|
defaultValue: defaultOpen,
|
|
4458
4475
|
onChange: onOpenChange
|
|
4459
4476
|
});
|
|
4460
|
-
const triggerRef =
|
|
4461
|
-
return /* @__PURE__ */
|
|
4477
|
+
const triggerRef = React52.useRef(null);
|
|
4478
|
+
return /* @__PURE__ */ jsx43(NavigationMenuItemContext.Provider, { value: { open: isOpen, setOpen, triggerRef }, children: /* @__PURE__ */ jsx43("li", { "data-slot": "navigation-menu-item", className: cn("relative", className), ...props, children }) });
|
|
4462
4479
|
}
|
|
4463
4480
|
function NavigationMenuTrigger({
|
|
4464
4481
|
className,
|
|
@@ -4483,7 +4500,7 @@ function NavigationMenuTrigger({
|
|
|
4483
4500
|
children: [
|
|
4484
4501
|
children,
|
|
4485
4502
|
" ",
|
|
4486
|
-
/* @__PURE__ */
|
|
4503
|
+
/* @__PURE__ */ jsx43(
|
|
4487
4504
|
"svg",
|
|
4488
4505
|
{
|
|
4489
4506
|
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
@@ -4494,7 +4511,7 @@ function NavigationMenuTrigger({
|
|
|
4494
4511
|
strokeLinecap: "round",
|
|
4495
4512
|
strokeLinejoin: "round",
|
|
4496
4513
|
"aria-hidden": "true",
|
|
4497
|
-
children: /* @__PURE__ */
|
|
4514
|
+
children: /* @__PURE__ */ jsx43("path", { d: "m6 9 6 6 6-6" })
|
|
4498
4515
|
}
|
|
4499
4516
|
)
|
|
4500
4517
|
]
|
|
@@ -4510,7 +4527,7 @@ function NavigationMenuContent({ className, children, ...props }) {
|
|
|
4510
4527
|
exclude: [triggerRef]
|
|
4511
4528
|
});
|
|
4512
4529
|
if (!isPresent) return null;
|
|
4513
|
-
return /* @__PURE__ */
|
|
4530
|
+
return /* @__PURE__ */ jsx43(
|
|
4514
4531
|
"div",
|
|
4515
4532
|
{
|
|
4516
4533
|
ref: mergeRefs(presenceRef, dismissRef),
|
|
@@ -4527,7 +4544,7 @@ function NavigationMenuContent({ className, children, ...props }) {
|
|
|
4527
4544
|
);
|
|
4528
4545
|
}
|
|
4529
4546
|
function NavigationMenuViewport({ className, ...props }) {
|
|
4530
|
-
return /* @__PURE__ */
|
|
4547
|
+
return /* @__PURE__ */ jsx43("div", { className: "absolute top-full left-0 isolate z-50 flex justify-center", children: /* @__PURE__ */ jsx43(
|
|
4531
4548
|
"div",
|
|
4532
4549
|
{
|
|
4533
4550
|
"data-slot": "navigation-menu-viewport",
|
|
@@ -4545,7 +4562,7 @@ function NavigationMenuLink({
|
|
|
4545
4562
|
...props
|
|
4546
4563
|
}) {
|
|
4547
4564
|
const Comp = asChild ? Slot : "a";
|
|
4548
|
-
return /* @__PURE__ */
|
|
4565
|
+
return /* @__PURE__ */ jsx43(
|
|
4549
4566
|
Comp,
|
|
4550
4567
|
{
|
|
4551
4568
|
"data-slot": "navigation-menu-link",
|
|
@@ -4558,7 +4575,7 @@ function NavigationMenuLink({
|
|
|
4558
4575
|
);
|
|
4559
4576
|
}
|
|
4560
4577
|
function NavigationMenuIndicator({ className, ...props }) {
|
|
4561
|
-
return /* @__PURE__ */
|
|
4578
|
+
return /* @__PURE__ */ jsx43(
|
|
4562
4579
|
"div",
|
|
4563
4580
|
{
|
|
4564
4581
|
"data-slot": "navigation-menu-indicator",
|
|
@@ -4567,17 +4584,17 @@ function NavigationMenuIndicator({ className, ...props }) {
|
|
|
4567
4584
|
className
|
|
4568
4585
|
),
|
|
4569
4586
|
...props,
|
|
4570
|
-
children: /* @__PURE__ */
|
|
4587
|
+
children: /* @__PURE__ */ jsx43("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" })
|
|
4571
4588
|
}
|
|
4572
4589
|
);
|
|
4573
4590
|
}
|
|
4574
4591
|
|
|
4575
4592
|
// src/components/dialog.tsx
|
|
4576
|
-
import * as
|
|
4577
|
-
import { Fragment as Fragment2, jsx as
|
|
4578
|
-
var DialogContext =
|
|
4593
|
+
import * as React53 from "react";
|
|
4594
|
+
import { Fragment as Fragment2, jsx as jsx44, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4595
|
+
var DialogContext = React53.createContext(null);
|
|
4579
4596
|
function useDialog() {
|
|
4580
|
-
const ctx =
|
|
4597
|
+
const ctx = React53.useContext(DialogContext);
|
|
4581
4598
|
if (!ctx) throw new Error("Dialog parts must be used within <Dialog>");
|
|
4582
4599
|
return ctx;
|
|
4583
4600
|
}
|
|
@@ -4587,13 +4604,13 @@ function Dialog({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4587
4604
|
defaultValue: defaultOpen,
|
|
4588
4605
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
4589
4606
|
});
|
|
4590
|
-
const triggerRef =
|
|
4591
|
-
return /* @__PURE__ */
|
|
4607
|
+
const triggerRef = React53.useRef(null);
|
|
4608
|
+
return /* @__PURE__ */ jsx44(DialogContext.Provider, { value: { open: isOpen, setOpen, triggerRef }, children });
|
|
4592
4609
|
}
|
|
4593
4610
|
function DialogTrigger({ asChild = false, onClick, ...props }) {
|
|
4594
4611
|
const { open, setOpen, triggerRef } = useDialog();
|
|
4595
4612
|
const Comp = asChild ? Slot : "button";
|
|
4596
|
-
return /* @__PURE__ */
|
|
4613
|
+
return /* @__PURE__ */ jsx44(
|
|
4597
4614
|
Comp,
|
|
4598
4615
|
{
|
|
4599
4616
|
"data-slot": "dialog-trigger",
|
|
@@ -4608,11 +4625,11 @@ function DialogTrigger({ asChild = false, onClick, ...props }) {
|
|
|
4608
4625
|
);
|
|
4609
4626
|
}
|
|
4610
4627
|
function DialogPortal({ children }) {
|
|
4611
|
-
return /* @__PURE__ */
|
|
4628
|
+
return /* @__PURE__ */ jsx44(Fragment2, { children });
|
|
4612
4629
|
}
|
|
4613
4630
|
function DialogOverlay({ className, ...props }) {
|
|
4614
4631
|
const { open, setOpen } = useDialog();
|
|
4615
|
-
return /* @__PURE__ */
|
|
4632
|
+
return /* @__PURE__ */ jsx44(
|
|
4616
4633
|
"div",
|
|
4617
4634
|
{
|
|
4618
4635
|
"data-slot": "dialog-overlay",
|
|
@@ -4626,7 +4643,7 @@ function DialogOverlay({ className, ...props }) {
|
|
|
4626
4643
|
}
|
|
4627
4644
|
);
|
|
4628
4645
|
}
|
|
4629
|
-
var XIcon = (props) => /* @__PURE__ */
|
|
4646
|
+
var XIcon = (props) => /* @__PURE__ */ jsx44(
|
|
4630
4647
|
"svg",
|
|
4631
4648
|
{
|
|
4632
4649
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4639,7 +4656,7 @@ var XIcon = (props) => /* @__PURE__ */ jsx43(
|
|
|
4639
4656
|
strokeLinecap: "round",
|
|
4640
4657
|
strokeLinejoin: "round",
|
|
4641
4658
|
...props,
|
|
4642
|
-
children: /* @__PURE__ */
|
|
4659
|
+
children: /* @__PURE__ */ jsx44("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
4643
4660
|
}
|
|
4644
4661
|
);
|
|
4645
4662
|
function DialogContent({
|
|
@@ -4656,7 +4673,7 @@ function DialogContent({
|
|
|
4656
4673
|
onDismiss: () => setOpen(false),
|
|
4657
4674
|
exclude: [triggerRef]
|
|
4658
4675
|
});
|
|
4659
|
-
|
|
4676
|
+
React53.useEffect(() => {
|
|
4660
4677
|
if (!open) return;
|
|
4661
4678
|
const prev = document.body.style.overflow;
|
|
4662
4679
|
document.body.style.overflow = "hidden";
|
|
@@ -4666,7 +4683,7 @@ function DialogContent({
|
|
|
4666
4683
|
}, [open]);
|
|
4667
4684
|
if (!isPresent) return null;
|
|
4668
4685
|
return /* @__PURE__ */ jsxs14(Portal, { children: [
|
|
4669
|
-
/* @__PURE__ */
|
|
4686
|
+
/* @__PURE__ */ jsx44(DialogOverlay, {}),
|
|
4670
4687
|
/* @__PURE__ */ jsxs14(
|
|
4671
4688
|
"div",
|
|
4672
4689
|
{
|
|
@@ -4690,8 +4707,8 @@ function DialogContent({
|
|
|
4690
4707
|
onClick: () => setOpen(false),
|
|
4691
4708
|
className: "ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
4692
4709
|
children: [
|
|
4693
|
-
/* @__PURE__ */
|
|
4694
|
-
/* @__PURE__ */
|
|
4710
|
+
/* @__PURE__ */ jsx44(XIcon, {}),
|
|
4711
|
+
/* @__PURE__ */ jsx44("span", { className: "sr-only", children: "Close" })
|
|
4695
4712
|
]
|
|
4696
4713
|
}
|
|
4697
4714
|
)
|
|
@@ -4703,7 +4720,7 @@ function DialogContent({
|
|
|
4703
4720
|
function DialogClose({ asChild = false, onClick, ...props }) {
|
|
4704
4721
|
const { setOpen } = useDialog();
|
|
4705
4722
|
const Comp = asChild ? Slot : "button";
|
|
4706
|
-
return /* @__PURE__ */
|
|
4723
|
+
return /* @__PURE__ */ jsx44(
|
|
4707
4724
|
Comp,
|
|
4708
4725
|
{
|
|
4709
4726
|
"data-slot": "dialog-close",
|
|
@@ -4716,7 +4733,7 @@ function DialogClose({ asChild = false, onClick, ...props }) {
|
|
|
4716
4733
|
);
|
|
4717
4734
|
}
|
|
4718
4735
|
function DialogHeader({ className, ...props }) {
|
|
4719
|
-
return /* @__PURE__ */
|
|
4736
|
+
return /* @__PURE__ */ jsx44(
|
|
4720
4737
|
"div",
|
|
4721
4738
|
{
|
|
4722
4739
|
"data-slot": "dialog-header",
|
|
@@ -4726,7 +4743,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
4726
4743
|
);
|
|
4727
4744
|
}
|
|
4728
4745
|
function DialogFooter({ className, ...props }) {
|
|
4729
|
-
return /* @__PURE__ */
|
|
4746
|
+
return /* @__PURE__ */ jsx44(
|
|
4730
4747
|
"div",
|
|
4731
4748
|
{
|
|
4732
4749
|
"data-slot": "dialog-footer",
|
|
@@ -4736,7 +4753,7 @@ function DialogFooter({ className, ...props }) {
|
|
|
4736
4753
|
);
|
|
4737
4754
|
}
|
|
4738
4755
|
function DialogTitle({ className, ...props }) {
|
|
4739
|
-
return /* @__PURE__ */
|
|
4756
|
+
return /* @__PURE__ */ jsx44(
|
|
4740
4757
|
"h2",
|
|
4741
4758
|
{
|
|
4742
4759
|
"data-slot": "dialog-title",
|
|
@@ -4746,7 +4763,7 @@ function DialogTitle({ className, ...props }) {
|
|
|
4746
4763
|
);
|
|
4747
4764
|
}
|
|
4748
4765
|
function DialogDescription({ className, ...props }) {
|
|
4749
|
-
return /* @__PURE__ */
|
|
4766
|
+
return /* @__PURE__ */ jsx44(
|
|
4750
4767
|
"p",
|
|
4751
4768
|
{
|
|
4752
4769
|
"data-slot": "dialog-description",
|
|
@@ -4757,11 +4774,11 @@ function DialogDescription({ className, ...props }) {
|
|
|
4757
4774
|
}
|
|
4758
4775
|
|
|
4759
4776
|
// src/components/alert-dialog.tsx
|
|
4760
|
-
import * as
|
|
4761
|
-
import { jsx as
|
|
4762
|
-
var AlertDialogContext =
|
|
4777
|
+
import * as React54 from "react";
|
|
4778
|
+
import { jsx as jsx45, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4779
|
+
var AlertDialogContext = React54.createContext(null);
|
|
4763
4780
|
function useAlertDialog() {
|
|
4764
|
-
const ctx =
|
|
4781
|
+
const ctx = React54.useContext(AlertDialogContext);
|
|
4765
4782
|
if (!ctx) throw new Error("AlertDialog parts must be used within <AlertDialog>");
|
|
4766
4783
|
return ctx;
|
|
4767
4784
|
}
|
|
@@ -4771,13 +4788,13 @@ function AlertDialog({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4771
4788
|
defaultValue: defaultOpen,
|
|
4772
4789
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
4773
4790
|
});
|
|
4774
|
-
const triggerRef =
|
|
4775
|
-
return /* @__PURE__ */
|
|
4791
|
+
const triggerRef = React54.useRef(null);
|
|
4792
|
+
return /* @__PURE__ */ jsx45(AlertDialogContext.Provider, { value: { open: isOpen, setOpen, triggerRef }, children });
|
|
4776
4793
|
}
|
|
4777
4794
|
function AlertDialogTrigger({ asChild = false, onClick, ...props }) {
|
|
4778
4795
|
const { open, setOpen, triggerRef } = useAlertDialog();
|
|
4779
4796
|
const Comp = asChild ? Slot : "button";
|
|
4780
|
-
return /* @__PURE__ */
|
|
4797
|
+
return /* @__PURE__ */ jsx45(
|
|
4781
4798
|
Comp,
|
|
4782
4799
|
{
|
|
4783
4800
|
"data-slot": "alert-dialog-trigger",
|
|
@@ -4793,7 +4810,7 @@ function AlertDialogTrigger({ asChild = false, onClick, ...props }) {
|
|
|
4793
4810
|
}
|
|
4794
4811
|
function AlertDialogOverlay({ className, ...props }) {
|
|
4795
4812
|
const { open, setOpen } = useAlertDialog();
|
|
4796
|
-
return /* @__PURE__ */
|
|
4813
|
+
return /* @__PURE__ */ jsx45(
|
|
4797
4814
|
"div",
|
|
4798
4815
|
{
|
|
4799
4816
|
"data-slot": "alert-dialog-overlay",
|
|
@@ -4818,8 +4835,8 @@ function AlertDialogContent({ className, children, ...props }) {
|
|
|
4818
4835
|
});
|
|
4819
4836
|
if (!isPresent) return null;
|
|
4820
4837
|
return /* @__PURE__ */ jsxs15(Portal, { children: [
|
|
4821
|
-
/* @__PURE__ */
|
|
4822
|
-
/* @__PURE__ */
|
|
4838
|
+
/* @__PURE__ */ jsx45(AlertDialogOverlay, {}),
|
|
4839
|
+
/* @__PURE__ */ jsx45(
|
|
4823
4840
|
"div",
|
|
4824
4841
|
{
|
|
4825
4842
|
"data-slot": "alert-dialog-content",
|
|
@@ -4838,7 +4855,7 @@ function AlertDialogContent({ className, children, ...props }) {
|
|
|
4838
4855
|
] });
|
|
4839
4856
|
}
|
|
4840
4857
|
function AlertDialogHeader({ className, ...props }) {
|
|
4841
|
-
return /* @__PURE__ */
|
|
4858
|
+
return /* @__PURE__ */ jsx45(
|
|
4842
4859
|
"div",
|
|
4843
4860
|
{
|
|
4844
4861
|
"data-slot": "alert-dialog-header",
|
|
@@ -4848,7 +4865,7 @@ function AlertDialogHeader({ className, ...props }) {
|
|
|
4848
4865
|
);
|
|
4849
4866
|
}
|
|
4850
4867
|
function AlertDialogFooter({ className, ...props }) {
|
|
4851
|
-
return /* @__PURE__ */
|
|
4868
|
+
return /* @__PURE__ */ jsx45(
|
|
4852
4869
|
"div",
|
|
4853
4870
|
{
|
|
4854
4871
|
"data-slot": "alert-dialog-footer",
|
|
@@ -4858,7 +4875,7 @@ function AlertDialogFooter({ className, ...props }) {
|
|
|
4858
4875
|
);
|
|
4859
4876
|
}
|
|
4860
4877
|
function AlertDialogTitle({ className, ...props }) {
|
|
4861
|
-
return /* @__PURE__ */
|
|
4878
|
+
return /* @__PURE__ */ jsx45(
|
|
4862
4879
|
"h2",
|
|
4863
4880
|
{
|
|
4864
4881
|
"data-slot": "alert-dialog-title",
|
|
@@ -4868,7 +4885,7 @@ function AlertDialogTitle({ className, ...props }) {
|
|
|
4868
4885
|
);
|
|
4869
4886
|
}
|
|
4870
4887
|
function AlertDialogDescription({ className, ...props }) {
|
|
4871
|
-
return /* @__PURE__ */
|
|
4888
|
+
return /* @__PURE__ */ jsx45(
|
|
4872
4889
|
"p",
|
|
4873
4890
|
{
|
|
4874
4891
|
"data-slot": "alert-dialog-description",
|
|
@@ -4879,7 +4896,7 @@ function AlertDialogDescription({ className, ...props }) {
|
|
|
4879
4896
|
}
|
|
4880
4897
|
function AlertDialogAction({ className, onClick, ...props }) {
|
|
4881
4898
|
const { setOpen } = useAlertDialog();
|
|
4882
|
-
return /* @__PURE__ */
|
|
4899
|
+
return /* @__PURE__ */ jsx45(
|
|
4883
4900
|
"button",
|
|
4884
4901
|
{
|
|
4885
4902
|
"data-slot": "alert-dialog-action",
|
|
@@ -4894,7 +4911,7 @@ function AlertDialogAction({ className, onClick, ...props }) {
|
|
|
4894
4911
|
}
|
|
4895
4912
|
function AlertDialogCancel({ className, onClick, ...props }) {
|
|
4896
4913
|
const { setOpen } = useAlertDialog();
|
|
4897
|
-
return /* @__PURE__ */
|
|
4914
|
+
return /* @__PURE__ */ jsx45(
|
|
4898
4915
|
"button",
|
|
4899
4916
|
{
|
|
4900
4917
|
"data-slot": "alert-dialog-cancel",
|
|
@@ -4909,11 +4926,11 @@ function AlertDialogCancel({ className, onClick, ...props }) {
|
|
|
4909
4926
|
}
|
|
4910
4927
|
|
|
4911
4928
|
// src/components/sheet.tsx
|
|
4912
|
-
import * as
|
|
4913
|
-
import { jsx as
|
|
4914
|
-
var SheetContext =
|
|
4929
|
+
import * as React55 from "react";
|
|
4930
|
+
import { jsx as jsx46, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4931
|
+
var SheetContext = React55.createContext(null);
|
|
4915
4932
|
function useSheet() {
|
|
4916
|
-
const ctx =
|
|
4933
|
+
const ctx = React55.useContext(SheetContext);
|
|
4917
4934
|
if (!ctx) throw new Error("Sheet parts must be used within <Sheet>");
|
|
4918
4935
|
return ctx;
|
|
4919
4936
|
}
|
|
@@ -4923,13 +4940,13 @@ function Sheet({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4923
4940
|
defaultValue: defaultOpen,
|
|
4924
4941
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
4925
4942
|
});
|
|
4926
|
-
const triggerRef =
|
|
4927
|
-
return /* @__PURE__ */
|
|
4943
|
+
const triggerRef = React55.useRef(null);
|
|
4944
|
+
return /* @__PURE__ */ jsx46(SheetContext.Provider, { value: { open: isOpen, setOpen, triggerRef }, children });
|
|
4928
4945
|
}
|
|
4929
4946
|
function SheetTrigger({ asChild = false, onClick, ...props }) {
|
|
4930
4947
|
const { open, setOpen, triggerRef } = useSheet();
|
|
4931
4948
|
const Comp = asChild ? Slot : "button";
|
|
4932
|
-
return /* @__PURE__ */
|
|
4949
|
+
return /* @__PURE__ */ jsx46(
|
|
4933
4950
|
Comp,
|
|
4934
4951
|
{
|
|
4935
4952
|
"data-slot": "sheet-trigger",
|
|
@@ -4945,7 +4962,7 @@ function SheetTrigger({ asChild = false, onClick, ...props }) {
|
|
|
4945
4962
|
}
|
|
4946
4963
|
function SheetOverlay({ className, ...props }) {
|
|
4947
4964
|
const { open, setOpen } = useSheet();
|
|
4948
|
-
return /* @__PURE__ */
|
|
4965
|
+
return /* @__PURE__ */ jsx46(
|
|
4949
4966
|
"div",
|
|
4950
4967
|
{
|
|
4951
4968
|
"data-slot": "sheet-overlay",
|
|
@@ -4965,7 +4982,7 @@ var sheetSideClasses = {
|
|
|
4965
4982
|
top: "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
4966
4983
|
bottom: "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t"
|
|
4967
4984
|
};
|
|
4968
|
-
var XIcon2 = (props) => /* @__PURE__ */
|
|
4985
|
+
var XIcon2 = (props) => /* @__PURE__ */ jsx46(
|
|
4969
4986
|
"svg",
|
|
4970
4987
|
{
|
|
4971
4988
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4978,7 +4995,7 @@ var XIcon2 = (props) => /* @__PURE__ */ jsx45(
|
|
|
4978
4995
|
strokeLinecap: "round",
|
|
4979
4996
|
strokeLinejoin: "round",
|
|
4980
4997
|
...props,
|
|
4981
|
-
children: /* @__PURE__ */
|
|
4998
|
+
children: /* @__PURE__ */ jsx46("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
4982
4999
|
}
|
|
4983
5000
|
);
|
|
4984
5001
|
function SheetContent({ className, children, side = "right", ...props }) {
|
|
@@ -4992,7 +5009,7 @@ function SheetContent({ className, children, side = "right", ...props }) {
|
|
|
4992
5009
|
});
|
|
4993
5010
|
if (!isPresent) return null;
|
|
4994
5011
|
return /* @__PURE__ */ jsxs16(Portal, { children: [
|
|
4995
|
-
/* @__PURE__ */
|
|
5012
|
+
/* @__PURE__ */ jsx46(SheetOverlay, {}),
|
|
4996
5013
|
/* @__PURE__ */ jsxs16(
|
|
4997
5014
|
"div",
|
|
4998
5015
|
{
|
|
@@ -5017,8 +5034,8 @@ function SheetContent({ className, children, side = "right", ...props }) {
|
|
|
5017
5034
|
onClick: () => setOpen(false),
|
|
5018
5035
|
className: "ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",
|
|
5019
5036
|
children: [
|
|
5020
|
-
/* @__PURE__ */
|
|
5021
|
-
/* @__PURE__ */
|
|
5037
|
+
/* @__PURE__ */ jsx46(XIcon2, { className: "size-4" }),
|
|
5038
|
+
/* @__PURE__ */ jsx46("span", { className: "sr-only", children: "Close" })
|
|
5022
5039
|
]
|
|
5023
5040
|
}
|
|
5024
5041
|
)
|
|
@@ -5030,7 +5047,7 @@ function SheetContent({ className, children, side = "right", ...props }) {
|
|
|
5030
5047
|
function SheetClose({ asChild = false, onClick, ...props }) {
|
|
5031
5048
|
const { setOpen } = useSheet();
|
|
5032
5049
|
const Comp = asChild ? Slot : "button";
|
|
5033
|
-
return /* @__PURE__ */
|
|
5050
|
+
return /* @__PURE__ */ jsx46(
|
|
5034
5051
|
Comp,
|
|
5035
5052
|
{
|
|
5036
5053
|
"data-slot": "sheet-close",
|
|
@@ -5043,7 +5060,7 @@ function SheetClose({ asChild = false, onClick, ...props }) {
|
|
|
5043
5060
|
);
|
|
5044
5061
|
}
|
|
5045
5062
|
function SheetHeader({ className, ...props }) {
|
|
5046
|
-
return /* @__PURE__ */
|
|
5063
|
+
return /* @__PURE__ */ jsx46(
|
|
5047
5064
|
"div",
|
|
5048
5065
|
{
|
|
5049
5066
|
"data-slot": "sheet-header",
|
|
@@ -5053,7 +5070,7 @@ function SheetHeader({ className, ...props }) {
|
|
|
5053
5070
|
);
|
|
5054
5071
|
}
|
|
5055
5072
|
function SheetFooter({ className, ...props }) {
|
|
5056
|
-
return /* @__PURE__ */
|
|
5073
|
+
return /* @__PURE__ */ jsx46(
|
|
5057
5074
|
"div",
|
|
5058
5075
|
{
|
|
5059
5076
|
"data-slot": "sheet-footer",
|
|
@@ -5063,7 +5080,7 @@ function SheetFooter({ className, ...props }) {
|
|
|
5063
5080
|
);
|
|
5064
5081
|
}
|
|
5065
5082
|
function SheetTitle({ className, ...props }) {
|
|
5066
|
-
return /* @__PURE__ */
|
|
5083
|
+
return /* @__PURE__ */ jsx46(
|
|
5067
5084
|
"h2",
|
|
5068
5085
|
{
|
|
5069
5086
|
"data-slot": "sheet-title",
|
|
@@ -5073,7 +5090,7 @@ function SheetTitle({ className, ...props }) {
|
|
|
5073
5090
|
);
|
|
5074
5091
|
}
|
|
5075
5092
|
function SheetDescription({ className, ...props }) {
|
|
5076
|
-
return /* @__PURE__ */
|
|
5093
|
+
return /* @__PURE__ */ jsx46(
|
|
5077
5094
|
"p",
|
|
5078
5095
|
{
|
|
5079
5096
|
"data-slot": "sheet-description",
|
|
@@ -5084,11 +5101,11 @@ function SheetDescription({ className, ...props }) {
|
|
|
5084
5101
|
}
|
|
5085
5102
|
|
|
5086
5103
|
// src/components/drawer.tsx
|
|
5087
|
-
import * as
|
|
5088
|
-
import { jsx as
|
|
5089
|
-
var DrawerContext =
|
|
5104
|
+
import * as React56 from "react";
|
|
5105
|
+
import { jsx as jsx47, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5106
|
+
var DrawerContext = React56.createContext(null);
|
|
5090
5107
|
function useDrawer() {
|
|
5091
|
-
const ctx =
|
|
5108
|
+
const ctx = React56.useContext(DrawerContext);
|
|
5092
5109
|
if (!ctx) throw new Error("Drawer parts must be used within <Drawer>");
|
|
5093
5110
|
return ctx;
|
|
5094
5111
|
}
|
|
@@ -5110,12 +5127,12 @@ function Drawer({
|
|
|
5110
5127
|
defaultValue: defaultOpen,
|
|
5111
5128
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
5112
5129
|
});
|
|
5113
|
-
return /* @__PURE__ */
|
|
5130
|
+
return /* @__PURE__ */ jsx47(DrawerContext.Provider, { value: { open: isOpen, setOpen, direction }, children: /* @__PURE__ */ jsx47("div", { "data-slot": "drawer", children }) });
|
|
5114
5131
|
}
|
|
5115
5132
|
function DrawerTrigger({ asChild = false, onClick, ...props }) {
|
|
5116
5133
|
const { setOpen } = useDrawer();
|
|
5117
5134
|
const Comp = asChild ? Slot : "button";
|
|
5118
|
-
return /* @__PURE__ */
|
|
5135
|
+
return /* @__PURE__ */ jsx47(
|
|
5119
5136
|
Comp,
|
|
5120
5137
|
{
|
|
5121
5138
|
"data-slot": "drawer-trigger",
|
|
@@ -5130,7 +5147,7 @@ function DrawerTrigger({ asChild = false, onClick, ...props }) {
|
|
|
5130
5147
|
function DrawerClose({ asChild = false, onClick, ...props }) {
|
|
5131
5148
|
const { setOpen } = useDrawer();
|
|
5132
5149
|
const Comp = asChild ? Slot : "button";
|
|
5133
|
-
return /* @__PURE__ */
|
|
5150
|
+
return /* @__PURE__ */ jsx47(
|
|
5134
5151
|
Comp,
|
|
5135
5152
|
{
|
|
5136
5153
|
"data-slot": "drawer-close",
|
|
@@ -5145,7 +5162,7 @@ function DrawerClose({ asChild = false, onClick, ...props }) {
|
|
|
5145
5162
|
function DrawerOverlay({ className, ...props }) {
|
|
5146
5163
|
const { open, setOpen } = useDrawer();
|
|
5147
5164
|
if (!open) return null;
|
|
5148
|
-
return /* @__PURE__ */
|
|
5165
|
+
return /* @__PURE__ */ jsx47(
|
|
5149
5166
|
"div",
|
|
5150
5167
|
{
|
|
5151
5168
|
"data-slot": "drawer-overlay",
|
|
@@ -5161,7 +5178,7 @@ function DrawerContent({ className, children, ...props }) {
|
|
|
5161
5178
|
const scopeRef = useFocusScope(open);
|
|
5162
5179
|
if (!open) return null;
|
|
5163
5180
|
return /* @__PURE__ */ jsxs17(Portal, { children: [
|
|
5164
|
-
/* @__PURE__ */
|
|
5181
|
+
/* @__PURE__ */ jsx47(
|
|
5165
5182
|
"div",
|
|
5166
5183
|
{
|
|
5167
5184
|
"data-slot": "drawer-overlay",
|
|
@@ -5188,7 +5205,7 @@ function DrawerContent({ className, children, ...props }) {
|
|
|
5188
5205
|
),
|
|
5189
5206
|
...props,
|
|
5190
5207
|
children: [
|
|
5191
|
-
direction === "bottom" ? /* @__PURE__ */
|
|
5208
|
+
direction === "bottom" ? /* @__PURE__ */ jsx47(
|
|
5192
5209
|
"div",
|
|
5193
5210
|
{
|
|
5194
5211
|
"data-slot": "drawer-handle",
|
|
@@ -5202,7 +5219,7 @@ function DrawerContent({ className, children, ...props }) {
|
|
|
5202
5219
|
] });
|
|
5203
5220
|
}
|
|
5204
5221
|
function DrawerHeader({ className, ...props }) {
|
|
5205
|
-
return /* @__PURE__ */
|
|
5222
|
+
return /* @__PURE__ */ jsx47(
|
|
5206
5223
|
"div",
|
|
5207
5224
|
{
|
|
5208
5225
|
"data-slot": "drawer-header",
|
|
@@ -5212,7 +5229,7 @@ function DrawerHeader({ className, ...props }) {
|
|
|
5212
5229
|
);
|
|
5213
5230
|
}
|
|
5214
5231
|
function DrawerFooter({ className, ...props }) {
|
|
5215
|
-
return /* @__PURE__ */
|
|
5232
|
+
return /* @__PURE__ */ jsx47(
|
|
5216
5233
|
"div",
|
|
5217
5234
|
{
|
|
5218
5235
|
"data-slot": "drawer-footer",
|
|
@@ -5222,7 +5239,7 @@ function DrawerFooter({ className, ...props }) {
|
|
|
5222
5239
|
);
|
|
5223
5240
|
}
|
|
5224
5241
|
function DrawerTitle({ className, ...props }) {
|
|
5225
|
-
return /* @__PURE__ */
|
|
5242
|
+
return /* @__PURE__ */ jsx47(
|
|
5226
5243
|
"div",
|
|
5227
5244
|
{
|
|
5228
5245
|
"data-slot": "drawer-title",
|
|
@@ -5232,7 +5249,7 @@ function DrawerTitle({ className, ...props }) {
|
|
|
5232
5249
|
);
|
|
5233
5250
|
}
|
|
5234
5251
|
function DrawerDescription({ className, ...props }) {
|
|
5235
|
-
return /* @__PURE__ */
|
|
5252
|
+
return /* @__PURE__ */ jsx47(
|
|
5236
5253
|
"div",
|
|
5237
5254
|
{
|
|
5238
5255
|
"data-slot": "drawer-description",
|
|
@@ -5243,11 +5260,11 @@ function DrawerDescription({ className, ...props }) {
|
|
|
5243
5260
|
}
|
|
5244
5261
|
|
|
5245
5262
|
// src/components/select.tsx
|
|
5246
|
-
import * as
|
|
5247
|
-
import { jsx as
|
|
5248
|
-
var SelectContext =
|
|
5263
|
+
import * as React57 from "react";
|
|
5264
|
+
import { jsx as jsx48, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5265
|
+
var SelectContext = React57.createContext(null);
|
|
5249
5266
|
function useSelect() {
|
|
5250
|
-
const ctx =
|
|
5267
|
+
const ctx = React57.useContext(SelectContext);
|
|
5251
5268
|
if (!ctx) throw new Error("Select parts must be used within <Select>");
|
|
5252
5269
|
return ctx;
|
|
5253
5270
|
}
|
|
@@ -5270,8 +5287,8 @@ function Select({
|
|
|
5270
5287
|
defaultValue: defaultOpen,
|
|
5271
5288
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
5272
5289
|
});
|
|
5273
|
-
const anchorRef =
|
|
5274
|
-
return /* @__PURE__ */
|
|
5290
|
+
const anchorRef = React57.useRef(null);
|
|
5291
|
+
return /* @__PURE__ */ jsx48(
|
|
5275
5292
|
SelectContext.Provider,
|
|
5276
5293
|
{
|
|
5277
5294
|
value: { value: currentValue, setValue, open: isOpen, setOpen, anchorRef },
|
|
@@ -5308,7 +5325,7 @@ function SelectTrigger({
|
|
|
5308
5325
|
...props,
|
|
5309
5326
|
children: [
|
|
5310
5327
|
children,
|
|
5311
|
-
/* @__PURE__ */
|
|
5328
|
+
/* @__PURE__ */ jsx48(
|
|
5312
5329
|
"svg",
|
|
5313
5330
|
{
|
|
5314
5331
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5322,7 +5339,7 @@ function SelectTrigger({
|
|
|
5322
5339
|
strokeLinejoin: "round",
|
|
5323
5340
|
className: "size-4 opacity-50",
|
|
5324
5341
|
"aria-hidden": "true",
|
|
5325
|
-
children: /* @__PURE__ */
|
|
5342
|
+
children: /* @__PURE__ */ jsx48("path", { d: "m6 9 6 6 6-6" })
|
|
5326
5343
|
}
|
|
5327
5344
|
)
|
|
5328
5345
|
]
|
|
@@ -5332,7 +5349,7 @@ function SelectTrigger({
|
|
|
5332
5349
|
function SelectValue({ className, placeholder, ...props }) {
|
|
5333
5350
|
const { value } = useSelect();
|
|
5334
5351
|
const isEmpty = value === "";
|
|
5335
|
-
return /* @__PURE__ */
|
|
5352
|
+
return /* @__PURE__ */ jsx48(
|
|
5336
5353
|
"span",
|
|
5337
5354
|
{
|
|
5338
5355
|
"data-slot": "select-value",
|
|
@@ -5365,13 +5382,13 @@ function SelectContent({
|
|
|
5365
5382
|
onDismiss: () => setOpen(false),
|
|
5366
5383
|
exclude: [anchorRef]
|
|
5367
5384
|
});
|
|
5368
|
-
const items =
|
|
5385
|
+
const items = React57.Children.toArray(children).filter(React57.isValidElement);
|
|
5369
5386
|
const { activeIndex, setActiveIndex, onKeyDown } = useRovingFocus({
|
|
5370
5387
|
count: items.length,
|
|
5371
5388
|
orientation: "vertical"
|
|
5372
5389
|
});
|
|
5373
5390
|
if (!isPresent) return null;
|
|
5374
|
-
return /* @__PURE__ */
|
|
5391
|
+
return /* @__PURE__ */ jsx48(Portal, { children: /* @__PURE__ */ jsx48(
|
|
5375
5392
|
"div",
|
|
5376
5393
|
{
|
|
5377
5394
|
role: "listbox",
|
|
@@ -5387,8 +5404,8 @@ function SelectContent({
|
|
|
5387
5404
|
className
|
|
5388
5405
|
),
|
|
5389
5406
|
...props,
|
|
5390
|
-
children: /* @__PURE__ */
|
|
5391
|
-
(child, index) =>
|
|
5407
|
+
children: /* @__PURE__ */ jsx48("div", { className: "p-1", children: items.map(
|
|
5408
|
+
(child, index) => React57.cloneElement(child, {
|
|
5392
5409
|
__index: index,
|
|
5393
5410
|
__active: index === activeIndex,
|
|
5394
5411
|
__setActive: setActiveIndex
|
|
@@ -5433,7 +5450,7 @@ function SelectItem({
|
|
|
5433
5450
|
),
|
|
5434
5451
|
...props,
|
|
5435
5452
|
children: [
|
|
5436
|
-
selected ? /* @__PURE__ */
|
|
5453
|
+
selected ? /* @__PURE__ */ jsx48("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx48(
|
|
5437
5454
|
"svg",
|
|
5438
5455
|
{
|
|
5439
5456
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5447,19 +5464,19 @@ function SelectItem({
|
|
|
5447
5464
|
strokeLinejoin: "round",
|
|
5448
5465
|
className: "size-4",
|
|
5449
5466
|
"aria-hidden": "true",
|
|
5450
|
-
children: /* @__PURE__ */
|
|
5467
|
+
children: /* @__PURE__ */ jsx48("path", { d: "M20 6 9 17l-5-5" })
|
|
5451
5468
|
}
|
|
5452
5469
|
) }) : null,
|
|
5453
|
-
/* @__PURE__ */
|
|
5470
|
+
/* @__PURE__ */ jsx48("span", { children })
|
|
5454
5471
|
]
|
|
5455
5472
|
}
|
|
5456
5473
|
);
|
|
5457
5474
|
}
|
|
5458
5475
|
function SelectGroup({ className, ...props }) {
|
|
5459
|
-
return /* @__PURE__ */
|
|
5476
|
+
return /* @__PURE__ */ jsx48("div", { role: "group", "data-slot": "select-group", className, ...props });
|
|
5460
5477
|
}
|
|
5461
5478
|
function SelectLabel({ className, ...props }) {
|
|
5462
|
-
return /* @__PURE__ */
|
|
5479
|
+
return /* @__PURE__ */ jsx48(
|
|
5463
5480
|
"div",
|
|
5464
5481
|
{
|
|
5465
5482
|
"data-slot": "select-label",
|
|
@@ -5469,7 +5486,7 @@ function SelectLabel({ className, ...props }) {
|
|
|
5469
5486
|
);
|
|
5470
5487
|
}
|
|
5471
5488
|
function SelectSeparator({ className, ...props }) {
|
|
5472
|
-
return /* @__PURE__ */
|
|
5489
|
+
return /* @__PURE__ */ jsx48(
|
|
5473
5490
|
"div",
|
|
5474
5491
|
{
|
|
5475
5492
|
"data-slot": "select-separator",
|
|
@@ -5480,11 +5497,11 @@ function SelectSeparator({ className, ...props }) {
|
|
|
5480
5497
|
}
|
|
5481
5498
|
|
|
5482
5499
|
// src/components/command.tsx
|
|
5483
|
-
import * as
|
|
5484
|
-
import { jsx as
|
|
5485
|
-
var CommandContext =
|
|
5500
|
+
import * as React58 from "react";
|
|
5501
|
+
import { jsx as jsx49, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5502
|
+
var CommandContext = React58.createContext(null);
|
|
5486
5503
|
function useCommand() {
|
|
5487
|
-
const ctx =
|
|
5504
|
+
const ctx = React58.useContext(CommandContext);
|
|
5488
5505
|
if (!ctx) throw new Error("Command parts must be used within <Command>");
|
|
5489
5506
|
return ctx;
|
|
5490
5507
|
}
|
|
@@ -5501,7 +5518,7 @@ function Command({
|
|
|
5501
5518
|
defaultValue: defaultSearch,
|
|
5502
5519
|
...onSearchChange ? { onChange: onSearchChange } : {}
|
|
5503
5520
|
});
|
|
5504
|
-
return /* @__PURE__ */
|
|
5521
|
+
return /* @__PURE__ */ jsx49(CommandContext.Provider, { value: { search: currentSearch, setSearch }, children: /* @__PURE__ */ jsx49(
|
|
5505
5522
|
"div",
|
|
5506
5523
|
{
|
|
5507
5524
|
"data-slot": "command",
|
|
@@ -5529,7 +5546,7 @@ function CommandDialog({
|
|
|
5529
5546
|
const scopeRef = useFocusScope(isOpen);
|
|
5530
5547
|
if (!isOpen) return null;
|
|
5531
5548
|
return /* @__PURE__ */ jsxs19(Portal, { children: [
|
|
5532
|
-
/* @__PURE__ */
|
|
5549
|
+
/* @__PURE__ */ jsx49(
|
|
5533
5550
|
"div",
|
|
5534
5551
|
{
|
|
5535
5552
|
"data-slot": "command-overlay",
|
|
@@ -5537,7 +5554,7 @@ function CommandDialog({
|
|
|
5537
5554
|
onClick: () => setOpen(false)
|
|
5538
5555
|
}
|
|
5539
5556
|
),
|
|
5540
|
-
/* @__PURE__ */
|
|
5557
|
+
/* @__PURE__ */ jsx49(
|
|
5541
5558
|
"div",
|
|
5542
5559
|
{
|
|
5543
5560
|
role: "dialog",
|
|
@@ -5551,7 +5568,7 @@ function CommandDialog({
|
|
|
5551
5568
|
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border p-0 shadow-lg",
|
|
5552
5569
|
className
|
|
5553
5570
|
),
|
|
5554
|
-
children: /* @__PURE__ */
|
|
5571
|
+
children: /* @__PURE__ */ jsx49(Command, { className: "[&_[data-slot=command-input-wrapper]]:h-12 [&_[data-slot=command-input]]:h-12", children })
|
|
5555
5572
|
}
|
|
5556
5573
|
)
|
|
5557
5574
|
] });
|
|
@@ -5577,12 +5594,12 @@ function CommandInput({
|
|
|
5577
5594
|
className: "size-4 shrink-0 opacity-50",
|
|
5578
5595
|
"aria-hidden": "true",
|
|
5579
5596
|
children: [
|
|
5580
|
-
/* @__PURE__ */
|
|
5581
|
-
/* @__PURE__ */
|
|
5597
|
+
/* @__PURE__ */ jsx49("circle", { cx: "11", cy: "11", r: "8" }),
|
|
5598
|
+
/* @__PURE__ */ jsx49("path", { d: "m21 21-4.3-4.3" })
|
|
5582
5599
|
]
|
|
5583
5600
|
}
|
|
5584
5601
|
),
|
|
5585
|
-
/* @__PURE__ */
|
|
5602
|
+
/* @__PURE__ */ jsx49(
|
|
5586
5603
|
"input",
|
|
5587
5604
|
{
|
|
5588
5605
|
type: "text",
|
|
@@ -5600,7 +5617,7 @@ function CommandInput({
|
|
|
5600
5617
|
] });
|
|
5601
5618
|
}
|
|
5602
5619
|
function CommandList({ className, ...props }) {
|
|
5603
|
-
return /* @__PURE__ */
|
|
5620
|
+
return /* @__PURE__ */ jsx49(
|
|
5604
5621
|
"div",
|
|
5605
5622
|
{
|
|
5606
5623
|
role: "listbox",
|
|
@@ -5614,7 +5631,7 @@ function CommandEmpty({ className, children, ...props }) {
|
|
|
5614
5631
|
const { search } = useCommand();
|
|
5615
5632
|
const hasQuery = search.trim() !== "";
|
|
5616
5633
|
if (!hasQuery) return null;
|
|
5617
|
-
return /* @__PURE__ */
|
|
5634
|
+
return /* @__PURE__ */ jsx49(
|
|
5618
5635
|
"div",
|
|
5619
5636
|
{
|
|
5620
5637
|
"data-slot": "command-empty",
|
|
@@ -5636,7 +5653,7 @@ function CommandGroup({ className, heading, children, ...props }) {
|
|
|
5636
5653
|
),
|
|
5637
5654
|
...props,
|
|
5638
5655
|
children: [
|
|
5639
|
-
heading ? /* @__PURE__ */
|
|
5656
|
+
heading ? /* @__PURE__ */ jsx49("div", { "data-slot": "command-group-heading", children: heading }) : null,
|
|
5640
5657
|
children
|
|
5641
5658
|
]
|
|
5642
5659
|
}
|
|
@@ -5653,7 +5670,7 @@ function CommandItem({
|
|
|
5653
5670
|
const { search } = useCommand();
|
|
5654
5671
|
const query = search.toLowerCase();
|
|
5655
5672
|
if (query !== "" && !value.toLowerCase().includes(query)) return null;
|
|
5656
|
-
return /* @__PURE__ */
|
|
5673
|
+
return /* @__PURE__ */ jsx49(
|
|
5657
5674
|
"div",
|
|
5658
5675
|
{
|
|
5659
5676
|
role: "option",
|
|
@@ -5674,7 +5691,7 @@ function CommandItem({
|
|
|
5674
5691
|
);
|
|
5675
5692
|
}
|
|
5676
5693
|
function CommandSeparator({ className, ...props }) {
|
|
5677
|
-
return /* @__PURE__ */
|
|
5694
|
+
return /* @__PURE__ */ jsx49(
|
|
5678
5695
|
"div",
|
|
5679
5696
|
{
|
|
5680
5697
|
"data-slot": "command-separator",
|
|
@@ -5684,7 +5701,7 @@ function CommandSeparator({ className, ...props }) {
|
|
|
5684
5701
|
);
|
|
5685
5702
|
}
|
|
5686
5703
|
function CommandShortcut({ className, ...props }) {
|
|
5687
|
-
return /* @__PURE__ */
|
|
5704
|
+
return /* @__PURE__ */ jsx49(
|
|
5688
5705
|
"span",
|
|
5689
5706
|
{
|
|
5690
5707
|
"data-slot": "command-shortcut",
|
|
@@ -5695,11 +5712,11 @@ function CommandShortcut({ className, ...props }) {
|
|
|
5695
5712
|
}
|
|
5696
5713
|
|
|
5697
5714
|
// src/components/chart.tsx
|
|
5698
|
-
import * as
|
|
5699
|
-
import { Fragment as Fragment3, jsx as
|
|
5700
|
-
var ChartContext =
|
|
5715
|
+
import * as React59 from "react";
|
|
5716
|
+
import { Fragment as Fragment3, jsx as jsx50, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5717
|
+
var ChartContext = React59.createContext(null);
|
|
5701
5718
|
function useChart() {
|
|
5702
|
-
const context =
|
|
5719
|
+
const context = React59.useContext(ChartContext);
|
|
5703
5720
|
if (!context) {
|
|
5704
5721
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
5705
5722
|
}
|
|
@@ -5712,9 +5729,9 @@ function ChartContainer({
|
|
|
5712
5729
|
config,
|
|
5713
5730
|
...props
|
|
5714
5731
|
}) {
|
|
5715
|
-
const uniqueId =
|
|
5732
|
+
const uniqueId = React59.useId();
|
|
5716
5733
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
5717
|
-
return /* @__PURE__ */
|
|
5734
|
+
return /* @__PURE__ */ jsx50(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs20(
|
|
5718
5735
|
"div",
|
|
5719
5736
|
{
|
|
5720
5737
|
"data-slot": "chart",
|
|
@@ -5725,7 +5742,7 @@ function ChartContainer({
|
|
|
5725
5742
|
),
|
|
5726
5743
|
...props,
|
|
5727
5744
|
children: [
|
|
5728
|
-
/* @__PURE__ */
|
|
5745
|
+
/* @__PURE__ */ jsx50(ChartStyle, { id: chartId, config }),
|
|
5729
5746
|
children
|
|
5730
5747
|
]
|
|
5731
5748
|
}
|
|
@@ -5736,7 +5753,7 @@ var ChartStyle = ({ id, config }) => {
|
|
|
5736
5753
|
if (!colorConfig.length) {
|
|
5737
5754
|
return null;
|
|
5738
5755
|
}
|
|
5739
|
-
return /* @__PURE__ */
|
|
5756
|
+
return /* @__PURE__ */ jsx50(
|
|
5740
5757
|
"style",
|
|
5741
5758
|
{
|
|
5742
5759
|
dangerouslySetInnerHTML: {
|
|
@@ -5747,7 +5764,7 @@ ${colorConfig.map(([key, itemConfig]) => ` --color-${key}: ${itemConfig.color};
|
|
|
5747
5764
|
}
|
|
5748
5765
|
);
|
|
5749
5766
|
};
|
|
5750
|
-
var ChartTooltip = ({ children }) => /* @__PURE__ */
|
|
5767
|
+
var ChartTooltip = ({ children }) => /* @__PURE__ */ jsx50(Fragment3, { children });
|
|
5751
5768
|
function ChartTooltipContent({
|
|
5752
5769
|
className,
|
|
5753
5770
|
items = [],
|
|
@@ -5769,15 +5786,15 @@ function ChartTooltipContent({
|
|
|
5769
5786
|
className
|
|
5770
5787
|
),
|
|
5771
5788
|
children: [
|
|
5772
|
-
!hideLabel && label ? /* @__PURE__ */
|
|
5773
|
-
/* @__PURE__ */
|
|
5789
|
+
!hideLabel && label ? /* @__PURE__ */ jsx50("div", { className: cn("font-medium", labelClassName), children: label }) : null,
|
|
5790
|
+
/* @__PURE__ */ jsx50("div", { className: "grid gap-1.5", children: items.map((item, index) => /* @__PURE__ */ jsxs20(
|
|
5774
5791
|
"div",
|
|
5775
5792
|
{
|
|
5776
5793
|
className: cn(
|
|
5777
5794
|
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 items-center"
|
|
5778
5795
|
),
|
|
5779
5796
|
children: [
|
|
5780
|
-
!hideIndicator && /* @__PURE__ */
|
|
5797
|
+
!hideIndicator && /* @__PURE__ */ jsx50(
|
|
5781
5798
|
"div",
|
|
5782
5799
|
{
|
|
5783
5800
|
className: "shrink-0 rounded-[2px] h-2.5 w-2.5",
|
|
@@ -5788,8 +5805,8 @@ function ChartTooltipContent({
|
|
|
5788
5805
|
}
|
|
5789
5806
|
),
|
|
5790
5807
|
/* @__PURE__ */ jsxs20("div", { className: "flex flex-1 justify-between leading-none items-center", children: [
|
|
5791
|
-
/* @__PURE__ */
|
|
5792
|
-
item.value !== void 0 && /* @__PURE__ */
|
|
5808
|
+
/* @__PURE__ */ jsx50("span", { className: "text-muted-foreground", children: item.label }),
|
|
5809
|
+
item.value !== void 0 && /* @__PURE__ */ jsx50("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value })
|
|
5793
5810
|
] })
|
|
5794
5811
|
]
|
|
5795
5812
|
},
|
|
@@ -5799,7 +5816,7 @@ function ChartTooltipContent({
|
|
|
5799
5816
|
}
|
|
5800
5817
|
);
|
|
5801
5818
|
}
|
|
5802
|
-
var ChartLegend = ({ children }) => /* @__PURE__ */
|
|
5819
|
+
var ChartLegend = ({ children }) => /* @__PURE__ */ jsx50(Fragment3, { children });
|
|
5803
5820
|
function ChartLegendContent({
|
|
5804
5821
|
className,
|
|
5805
5822
|
hideIcon = false,
|
|
@@ -5813,7 +5830,7 @@ function ChartLegendContent({
|
|
|
5813
5830
|
if (!rows.length) {
|
|
5814
5831
|
return null;
|
|
5815
5832
|
}
|
|
5816
|
-
return /* @__PURE__ */
|
|
5833
|
+
return /* @__PURE__ */ jsx50(
|
|
5817
5834
|
"div",
|
|
5818
5835
|
{
|
|
5819
5836
|
"data-slot": "chart-legend",
|
|
@@ -5825,7 +5842,7 @@ function ChartLegendContent({
|
|
|
5825
5842
|
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
|
|
5826
5843
|
),
|
|
5827
5844
|
children: [
|
|
5828
|
-
!hideIcon && /* @__PURE__ */
|
|
5845
|
+
!hideIcon && /* @__PURE__ */ jsx50(
|
|
5829
5846
|
"div",
|
|
5830
5847
|
{
|
|
5831
5848
|
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
@@ -5842,8 +5859,8 @@ function ChartLegendContent({
|
|
|
5842
5859
|
}
|
|
5843
5860
|
|
|
5844
5861
|
// src/components/calendar.tsx
|
|
5845
|
-
import * as
|
|
5846
|
-
import { jsx as
|
|
5862
|
+
import * as React60 from "react";
|
|
5863
|
+
import { jsx as jsx51, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5847
5864
|
var MONTHS = [
|
|
5848
5865
|
"January",
|
|
5849
5866
|
"February",
|
|
@@ -5862,7 +5879,7 @@ var WEEKDAYS = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
|
|
|
5862
5879
|
var CHEVRON_LEFT = "m15 18-6-6 6-6";
|
|
5863
5880
|
var CHEVRON_RIGHT = "m9 18 6-6-6-6";
|
|
5864
5881
|
function Chevron({ d }) {
|
|
5865
|
-
return /* @__PURE__ */
|
|
5882
|
+
return /* @__PURE__ */ jsx51(
|
|
5866
5883
|
"svg",
|
|
5867
5884
|
{
|
|
5868
5885
|
className: "size-4",
|
|
@@ -5876,7 +5893,7 @@ function Chevron({ d }) {
|
|
|
5876
5893
|
strokeLinecap: "round",
|
|
5877
5894
|
strokeLinejoin: "round",
|
|
5878
5895
|
"aria-hidden": true,
|
|
5879
|
-
children: /* @__PURE__ */
|
|
5896
|
+
children: /* @__PURE__ */ jsx51("path", { d })
|
|
5880
5897
|
}
|
|
5881
5898
|
);
|
|
5882
5899
|
}
|
|
@@ -5898,7 +5915,7 @@ function Calendar({
|
|
|
5898
5915
|
today = /* @__PURE__ */ new Date(),
|
|
5899
5916
|
className
|
|
5900
5917
|
}) {
|
|
5901
|
-
const [internal, setInternal] =
|
|
5918
|
+
const [internal, setInternal] = React60.useState(
|
|
5902
5919
|
() => startOfMonth(defaultMonth ?? /* @__PURE__ */ new Date())
|
|
5903
5920
|
);
|
|
5904
5921
|
const view = month ? startOfMonth(month) : internal;
|
|
@@ -5931,30 +5948,30 @@ function Calendar({
|
|
|
5931
5948
|
className: cn("bg-background p-3 w-fit", className),
|
|
5932
5949
|
children: [
|
|
5933
5950
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between gap-1 w-full px-1", children: [
|
|
5934
|
-
/* @__PURE__ */
|
|
5951
|
+
/* @__PURE__ */ jsx51(
|
|
5935
5952
|
"button",
|
|
5936
5953
|
{
|
|
5937
5954
|
type: "button",
|
|
5938
5955
|
className: navClass,
|
|
5939
5956
|
"aria-label": "Previous month",
|
|
5940
5957
|
onClick: () => go(-1),
|
|
5941
|
-
children: /* @__PURE__ */
|
|
5958
|
+
children: /* @__PURE__ */ jsx51(Chevron, { d: CHEVRON_LEFT })
|
|
5942
5959
|
}
|
|
5943
5960
|
),
|
|
5944
|
-
/* @__PURE__ */
|
|
5945
|
-
/* @__PURE__ */
|
|
5961
|
+
/* @__PURE__ */ jsx51("div", { className: "text-sm font-medium select-none", children: caption }),
|
|
5962
|
+
/* @__PURE__ */ jsx51(
|
|
5946
5963
|
"button",
|
|
5947
5964
|
{
|
|
5948
5965
|
type: "button",
|
|
5949
5966
|
className: navClass,
|
|
5950
5967
|
"aria-label": "Next month",
|
|
5951
5968
|
onClick: () => go(1),
|
|
5952
|
-
children: /* @__PURE__ */
|
|
5969
|
+
children: /* @__PURE__ */ jsx51(Chevron, { d: CHEVRON_RIGHT })
|
|
5953
5970
|
}
|
|
5954
5971
|
)
|
|
5955
5972
|
] }),
|
|
5956
5973
|
/* @__PURE__ */ jsxs21("table", { className: "w-full border-collapse mt-4", role: "grid", children: [
|
|
5957
|
-
/* @__PURE__ */
|
|
5974
|
+
/* @__PURE__ */ jsx51("thead", { children: /* @__PURE__ */ jsx51("tr", { className: "flex", children: WEEKDAYS.map((wd) => /* @__PURE__ */ jsx51(
|
|
5958
5975
|
"th",
|
|
5959
5976
|
{
|
|
5960
5977
|
scope: "col",
|
|
@@ -5963,9 +5980,9 @@ function Calendar({
|
|
|
5963
5980
|
},
|
|
5964
5981
|
wd
|
|
5965
5982
|
)) }) }),
|
|
5966
|
-
/* @__PURE__ */
|
|
5983
|
+
/* @__PURE__ */ jsx51("tbody", { children: weeks.map((week, wi) => /* @__PURE__ */ jsx51("tr", { className: "flex w-full mt-2", children: week.map((cell, ci) => {
|
|
5967
5984
|
if (cell === null) {
|
|
5968
|
-
return /* @__PURE__ */
|
|
5985
|
+
return /* @__PURE__ */ jsx51(
|
|
5969
5986
|
"td",
|
|
5970
5987
|
{
|
|
5971
5988
|
className: "relative w-full h-full p-0 aspect-square select-none"
|
|
@@ -5976,13 +5993,13 @@ function Calendar({
|
|
|
5976
5993
|
const date = new Date(year, monthIndex, cell);
|
|
5977
5994
|
const isSelected = sameDay(selected, date);
|
|
5978
5995
|
const isToday = sameDay(today, date);
|
|
5979
|
-
return /* @__PURE__ */
|
|
5996
|
+
return /* @__PURE__ */ jsx51(
|
|
5980
5997
|
"td",
|
|
5981
5998
|
{
|
|
5982
5999
|
role: "gridcell",
|
|
5983
6000
|
"aria-selected": isSelected,
|
|
5984
6001
|
className: "relative w-full h-full p-0 text-center aspect-square select-none",
|
|
5985
|
-
children: /* @__PURE__ */
|
|
6002
|
+
children: /* @__PURE__ */ jsx51(
|
|
5986
6003
|
"button",
|
|
5987
6004
|
{
|
|
5988
6005
|
type: "button",
|
|
@@ -6012,9 +6029,12 @@ function Calendar({
|
|
|
6012
6029
|
}
|
|
6013
6030
|
|
|
6014
6031
|
// src/components/sonner.tsx
|
|
6015
|
-
import * as
|
|
6016
|
-
import { jsx as
|
|
6032
|
+
import * as React61 from "react";
|
|
6033
|
+
import { jsx as jsx52, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6017
6034
|
var DEFAULT_DURATION = 4e3;
|
|
6035
|
+
var SWIPE_THRESHOLD = 45;
|
|
6036
|
+
var SWIPE_VELOCITY = 0.11;
|
|
6037
|
+
var SWIPE_FLING_MS = 200;
|
|
6018
6038
|
var store = /* @__PURE__ */ (() => {
|
|
6019
6039
|
let toasts = [];
|
|
6020
6040
|
let id = 0;
|
|
@@ -6028,13 +6048,20 @@ var store = /* @__PURE__ */ (() => {
|
|
|
6028
6048
|
message,
|
|
6029
6049
|
description: opts.description,
|
|
6030
6050
|
duration: opts.duration ?? DEFAULT_DURATION,
|
|
6031
|
-
variant: opts.variant ?? "default"
|
|
6051
|
+
variant: opts.variant ?? "default",
|
|
6052
|
+
state: "open"
|
|
6032
6053
|
};
|
|
6033
6054
|
toasts = [...toasts, next];
|
|
6034
6055
|
emit();
|
|
6035
6056
|
return next.id;
|
|
6036
6057
|
};
|
|
6037
6058
|
const dismiss = (toastId) => {
|
|
6059
|
+
toasts = toasts.map(
|
|
6060
|
+
(t) => t.id === toastId ? { ...t, state: "closing" } : t
|
|
6061
|
+
);
|
|
6062
|
+
emit();
|
|
6063
|
+
};
|
|
6064
|
+
const remove = (toastId) => {
|
|
6038
6065
|
toasts = toasts.filter((t) => t.id !== toastId);
|
|
6039
6066
|
emit();
|
|
6040
6067
|
};
|
|
@@ -6045,7 +6072,7 @@ var store = /* @__PURE__ */ (() => {
|
|
|
6045
6072
|
listeners.delete(listener);
|
|
6046
6073
|
};
|
|
6047
6074
|
};
|
|
6048
|
-
return { add, dismiss, subscribe };
|
|
6075
|
+
return { add, dismiss, remove, subscribe };
|
|
6049
6076
|
})();
|
|
6050
6077
|
var toast = Object.assign(
|
|
6051
6078
|
(message, opts) => store.add(message, opts),
|
|
@@ -6065,36 +6092,149 @@ var toastVariantClasses = {
|
|
|
6065
6092
|
warning: "bg-popover text-popover-foreground border-border"
|
|
6066
6093
|
};
|
|
6067
6094
|
var positionClasses = {
|
|
6068
|
-
"top-left": "top-
|
|
6069
|
-
"top-center": "top-
|
|
6070
|
-
"top-right": "top-
|
|
6071
|
-
"bottom-left": "bottom-
|
|
6072
|
-
"bottom-center": "bottom-
|
|
6073
|
-
"bottom-right": "bottom-
|
|
6095
|
+
"top-left": "top-4 left-4",
|
|
6096
|
+
"top-center": "top-4 left-1/2 -translate-x-1/2",
|
|
6097
|
+
"top-right": "top-4 right-4",
|
|
6098
|
+
"bottom-left": "bottom-4 left-4",
|
|
6099
|
+
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2",
|
|
6100
|
+
"bottom-right": "bottom-4 right-4"
|
|
6074
6101
|
};
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6102
|
+
var VISIBLE_TOASTS = 3;
|
|
6103
|
+
var GAP = 14;
|
|
6104
|
+
function ToastItem({
|
|
6105
|
+
toast: t,
|
|
6106
|
+
index,
|
|
6107
|
+
total,
|
|
6108
|
+
offset,
|
|
6109
|
+
paused,
|
|
6110
|
+
reportHeight,
|
|
6111
|
+
removeHeight
|
|
6112
|
+
}) {
|
|
6113
|
+
const ref = React61.useRef(null);
|
|
6114
|
+
const [height, setHeight] = React61.useState(0);
|
|
6115
|
+
const remainingRef = React61.useRef(t.duration);
|
|
6116
|
+
const startedRef = React61.useRef(0);
|
|
6117
|
+
const flingRef = React61.useRef(
|
|
6118
|
+
void 0
|
|
6119
|
+
);
|
|
6120
|
+
const dragRef = React61.useRef(
|
|
6121
|
+
null
|
|
6122
|
+
);
|
|
6123
|
+
React61.useLayoutEffect(() => {
|
|
6124
|
+
const el = ref.current;
|
|
6125
|
+
if (!el) return;
|
|
6126
|
+
el.style.height = "auto";
|
|
6127
|
+
const h = el.getBoundingClientRect().height;
|
|
6128
|
+
el.style.height = "";
|
|
6129
|
+
if (h) {
|
|
6130
|
+
setHeight(h);
|
|
6131
|
+
reportHeight(t.id, h);
|
|
6132
|
+
}
|
|
6133
|
+
}, [t.id, t.message, t.description, reportHeight]);
|
|
6134
|
+
React61.useEffect(() => () => removeHeight(t.id), [t.id, removeHeight]);
|
|
6135
|
+
React61.useEffect(() => {
|
|
6136
|
+
if (t.duration === Infinity || t.state === "closing" || paused) return;
|
|
6137
|
+
startedRef.current = Date.now();
|
|
6138
|
+
const id = setTimeout(() => store.dismiss(t.id), remainingRef.current);
|
|
6139
|
+
return () => {
|
|
6140
|
+
clearTimeout(id);
|
|
6141
|
+
remainingRef.current = Math.max(
|
|
6142
|
+
0,
|
|
6143
|
+
remainingRef.current - (Date.now() - startedRef.current)
|
|
6144
|
+
);
|
|
6145
|
+
};
|
|
6146
|
+
}, [paused, t.id, t.duration, t.state]);
|
|
6147
|
+
React61.useEffect(
|
|
6148
|
+
() => () => {
|
|
6149
|
+
if (flingRef.current) clearTimeout(flingRef.current);
|
|
6150
|
+
},
|
|
6151
|
+
[]
|
|
6152
|
+
);
|
|
6153
|
+
const onTransitionEnd = (e) => {
|
|
6154
|
+
if (t.state === "closing" && e.propertyName === "transform") {
|
|
6155
|
+
store.remove(t.id);
|
|
6156
|
+
}
|
|
6157
|
+
};
|
|
6158
|
+
const onPointerDown = (e) => {
|
|
6159
|
+
const el = ref.current;
|
|
6160
|
+
if (!el || e.button > 0 || t.state === "closing") return;
|
|
6161
|
+
if (e.target.closest('[data-slot="toast-close"]')) return;
|
|
6162
|
+
dragRef.current = { x: e.clientX, time: e.timeStamp, dx: 0 };
|
|
6163
|
+
el.setAttribute("data-swiping", "true");
|
|
6164
|
+
try {
|
|
6165
|
+
el.setPointerCapture?.(e.pointerId);
|
|
6166
|
+
} catch {
|
|
6167
|
+
}
|
|
6168
|
+
};
|
|
6169
|
+
const onPointerMove = (e) => {
|
|
6170
|
+
const drag = dragRef.current;
|
|
6171
|
+
const el = ref.current;
|
|
6172
|
+
if (!drag || !el) return;
|
|
6173
|
+
const dx = e.clientX - drag.x;
|
|
6174
|
+
drag.dx = dx;
|
|
6175
|
+
const dist = el.offsetWidth || 256;
|
|
6176
|
+
el.style.setProperty("--swipe-x", `${dx}px`);
|
|
6177
|
+
el.style.opacity = `${Math.max(0, 1 - Math.abs(dx) / dist)}`;
|
|
6178
|
+
};
|
|
6179
|
+
const onPointerEnd = (e) => {
|
|
6180
|
+
const drag = dragRef.current;
|
|
6181
|
+
const el = ref.current;
|
|
6182
|
+
if (!drag || !el) return;
|
|
6183
|
+
dragRef.current = null;
|
|
6184
|
+
el.removeAttribute("data-swiping");
|
|
6185
|
+
const dt = e.timeStamp - drag.time;
|
|
6186
|
+
const velocity = dt > 0 ? Math.abs(drag.dx) / dt : 0;
|
|
6187
|
+
if (drag.dx !== 0 && (Math.abs(drag.dx) >= SWIPE_THRESHOLD || velocity > SWIPE_VELOCITY)) {
|
|
6188
|
+
el.style.setProperty("--swipe-x", `${drag.dx > 0 ? 150 : -150}%`);
|
|
6189
|
+
el.style.opacity = "0";
|
|
6190
|
+
const remove = () => store.remove(t.id);
|
|
6191
|
+
el.addEventListener("transitionend", remove, { once: true });
|
|
6192
|
+
flingRef.current = setTimeout(remove, SWIPE_FLING_MS + 50);
|
|
6193
|
+
} else {
|
|
6194
|
+
el.style.setProperty("--swipe-x", "0px");
|
|
6195
|
+
el.style.opacity = "1";
|
|
6196
|
+
el.addEventListener(
|
|
6197
|
+
"transitionend",
|
|
6198
|
+
() => {
|
|
6199
|
+
el.style.removeProperty("--swipe-x");
|
|
6200
|
+
el.style.opacity = "";
|
|
6201
|
+
},
|
|
6202
|
+
{ once: true }
|
|
6203
|
+
);
|
|
6204
|
+
}
|
|
6205
|
+
};
|
|
6081
6206
|
return /* @__PURE__ */ jsxs22(
|
|
6082
6207
|
"li",
|
|
6083
6208
|
{
|
|
6209
|
+
ref,
|
|
6084
6210
|
role: "status",
|
|
6085
6211
|
"aria-live": "polite",
|
|
6086
6212
|
"data-slot": "toast",
|
|
6087
6213
|
"data-variant": t.variant,
|
|
6214
|
+
"data-state": t.state === "closing" ? "closed" : "open",
|
|
6215
|
+
"data-front": index === 0,
|
|
6216
|
+
"data-visible": index < VISIBLE_TOASTS,
|
|
6217
|
+
onTransitionEnd,
|
|
6218
|
+
onPointerDown,
|
|
6219
|
+
onPointerMove,
|
|
6220
|
+
onPointerUp: onPointerEnd,
|
|
6221
|
+
onPointerCancel: onPointerEnd,
|
|
6222
|
+
style: {
|
|
6223
|
+
"--index": index,
|
|
6224
|
+
"--z-index": total - index,
|
|
6225
|
+
"--offset": `${offset}px`,
|
|
6226
|
+
"--initial-height": `${height}px`
|
|
6227
|
+
},
|
|
6088
6228
|
className: cn(
|
|
6089
|
-
"pointer-events-auto flex w-full items-start gap-3 rounded-md border p-4 text-sm shadow-lg",
|
|
6229
|
+
"pointer-events-auto flex w-full touch-pan-y items-start gap-3 rounded-md border p-4 text-sm shadow-lg select-none",
|
|
6090
6230
|
toastVariantClasses[t.variant]
|
|
6091
6231
|
),
|
|
6092
6232
|
children: [
|
|
6093
6233
|
/* @__PURE__ */ jsxs22("div", { className: "flex-1 space-y-1", children: [
|
|
6094
|
-
/* @__PURE__ */
|
|
6095
|
-
t.description ? /* @__PURE__ */
|
|
6234
|
+
/* @__PURE__ */ jsx52("div", { className: "font-medium", children: t.message }),
|
|
6235
|
+
t.description ? /* @__PURE__ */ jsx52("div", { className: "text-muted-foreground text-sm", children: t.description }) : null
|
|
6096
6236
|
] }),
|
|
6097
|
-
/* @__PURE__ */
|
|
6237
|
+
/* @__PURE__ */ jsx52(
|
|
6098
6238
|
"button",
|
|
6099
6239
|
{
|
|
6100
6240
|
type: "button",
|
|
@@ -6102,7 +6242,7 @@ function ToastItem({ toast: t }) {
|
|
|
6102
6242
|
"data-slot": "toast-close",
|
|
6103
6243
|
onClick: () => store.dismiss(t.id),
|
|
6104
6244
|
className: "text-foreground/50 hover:text-foreground shrink-0 transition-colors",
|
|
6105
|
-
children: /* @__PURE__ */
|
|
6245
|
+
children: /* @__PURE__ */ jsx52(
|
|
6106
6246
|
"svg",
|
|
6107
6247
|
{
|
|
6108
6248
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6115,7 +6255,7 @@ function ToastItem({ toast: t }) {
|
|
|
6115
6255
|
strokeLinecap: "round",
|
|
6116
6256
|
strokeLinejoin: "round",
|
|
6117
6257
|
"aria-hidden": "true",
|
|
6118
|
-
children: /* @__PURE__ */
|
|
6258
|
+
children: /* @__PURE__ */ jsx52("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
6119
6259
|
}
|
|
6120
6260
|
)
|
|
6121
6261
|
}
|
|
@@ -6129,41 +6269,97 @@ function Toaster({
|
|
|
6129
6269
|
className,
|
|
6130
6270
|
...props
|
|
6131
6271
|
}) {
|
|
6132
|
-
const [toasts, setToasts] =
|
|
6133
|
-
|
|
6134
|
-
|
|
6272
|
+
const [toasts, setToasts] = React61.useState([]);
|
|
6273
|
+
const [heights, setHeights] = React61.useState(/* @__PURE__ */ new Map());
|
|
6274
|
+
const [paused, setPaused] = React61.useState(false);
|
|
6275
|
+
React61.useEffect(() => store.subscribe(setToasts), []);
|
|
6276
|
+
const onEnter = () => setPaused(true);
|
|
6277
|
+
const onLeave = (e) => {
|
|
6278
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
6279
|
+
setPaused(false);
|
|
6280
|
+
}
|
|
6281
|
+
};
|
|
6282
|
+
const reportHeight = React61.useCallback((id, h) => {
|
|
6283
|
+
setHeights((prev) => {
|
|
6284
|
+
if (prev.get(id) === h) return prev;
|
|
6285
|
+
const next = new Map(prev);
|
|
6286
|
+
next.set(id, h);
|
|
6287
|
+
return next;
|
|
6288
|
+
});
|
|
6289
|
+
}, []);
|
|
6290
|
+
const removeHeight = React61.useCallback((id) => {
|
|
6291
|
+
setHeights((prev) => {
|
|
6292
|
+
if (!prev.has(id)) return prev;
|
|
6293
|
+
const next = new Map(prev);
|
|
6294
|
+
next.delete(id);
|
|
6295
|
+
return next;
|
|
6296
|
+
});
|
|
6297
|
+
}, []);
|
|
6298
|
+
const yPosition = position.startsWith("top") ? "top" : "bottom";
|
|
6299
|
+
const ordered = [...toasts].reverse();
|
|
6300
|
+
const known = [...heights.values()];
|
|
6301
|
+
const frontHeight = ordered[0] ? heights.get(ordered[0].id) ?? (known.length ? Math.max(...known) : 0) : 0;
|
|
6302
|
+
let sum = 0;
|
|
6303
|
+
const offsets = ordered.map((t, i) => {
|
|
6304
|
+
const o = sum + i * GAP;
|
|
6305
|
+
sum += heights.get(t.id) ?? 0;
|
|
6306
|
+
return o;
|
|
6307
|
+
});
|
|
6308
|
+
return /* @__PURE__ */ jsx52(
|
|
6135
6309
|
"ol",
|
|
6136
6310
|
{
|
|
6137
6311
|
"data-slot": "toaster",
|
|
6138
6312
|
"data-position": position,
|
|
6313
|
+
"data-y-position": yPosition,
|
|
6314
|
+
"data-stack": "",
|
|
6315
|
+
style: {
|
|
6316
|
+
"--front-height": `${frontHeight}px`,
|
|
6317
|
+
"--gap": `${GAP}px`
|
|
6318
|
+
},
|
|
6139
6319
|
className: cn(
|
|
6140
|
-
"pointer-events-none fixed z-100
|
|
6320
|
+
"pointer-events-none fixed z-100 w-[calc(100%-2rem)] max-w-sm",
|
|
6141
6321
|
positionClasses[position],
|
|
6142
6322
|
className
|
|
6143
6323
|
),
|
|
6144
6324
|
...props,
|
|
6145
|
-
|
|
6325
|
+
onPointerOver: onEnter,
|
|
6326
|
+
onPointerOut: onLeave,
|
|
6327
|
+
onFocus: onEnter,
|
|
6328
|
+
onBlur: onLeave,
|
|
6329
|
+
children: ordered.map((t, i) => /* @__PURE__ */ jsx52(
|
|
6330
|
+
ToastItem,
|
|
6331
|
+
{
|
|
6332
|
+
toast: t,
|
|
6333
|
+
index: i,
|
|
6334
|
+
total: ordered.length,
|
|
6335
|
+
offset: offsets[i],
|
|
6336
|
+
paused,
|
|
6337
|
+
reportHeight,
|
|
6338
|
+
removeHeight
|
|
6339
|
+
},
|
|
6340
|
+
t.id
|
|
6341
|
+
))
|
|
6146
6342
|
}
|
|
6147
6343
|
);
|
|
6148
6344
|
}
|
|
6149
6345
|
|
|
6150
6346
|
// src/components/form.tsx
|
|
6151
|
-
import * as
|
|
6152
|
-
import { jsx as
|
|
6153
|
-
var FormItemContext =
|
|
6347
|
+
import * as React62 from "react";
|
|
6348
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
6349
|
+
var FormItemContext = React62.createContext(null);
|
|
6154
6350
|
function useFormItem() {
|
|
6155
|
-
const ctx =
|
|
6351
|
+
const ctx = React62.useContext(FormItemContext);
|
|
6156
6352
|
if (!ctx) {
|
|
6157
6353
|
throw new Error("Form parts must be used within <FormItem>");
|
|
6158
6354
|
}
|
|
6159
6355
|
return ctx;
|
|
6160
6356
|
}
|
|
6161
6357
|
function Form({ ...props }) {
|
|
6162
|
-
return /* @__PURE__ */
|
|
6358
|
+
return /* @__PURE__ */ jsx53("form", { "data-slot": "form", ...props });
|
|
6163
6359
|
}
|
|
6164
6360
|
function FormItem({ className, ...props }) {
|
|
6165
|
-
const id =
|
|
6166
|
-
const value =
|
|
6361
|
+
const id = React62.useId();
|
|
6362
|
+
const value = React62.useMemo(
|
|
6167
6363
|
() => ({
|
|
6168
6364
|
id,
|
|
6169
6365
|
formItemId: `${id}-form-item`,
|
|
@@ -6172,7 +6368,7 @@ function FormItem({ className, ...props }) {
|
|
|
6172
6368
|
}),
|
|
6173
6369
|
[id]
|
|
6174
6370
|
);
|
|
6175
|
-
return /* @__PURE__ */
|
|
6371
|
+
return /* @__PURE__ */ jsx53(FormItemContext.Provider, { value, children: /* @__PURE__ */ jsx53("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) });
|
|
6176
6372
|
}
|
|
6177
6373
|
function FormLabel({
|
|
6178
6374
|
className,
|
|
@@ -6180,7 +6376,7 @@ function FormLabel({
|
|
|
6180
6376
|
...props
|
|
6181
6377
|
}) {
|
|
6182
6378
|
const { formItemId } = useFormItem();
|
|
6183
|
-
return /* @__PURE__ */
|
|
6379
|
+
return /* @__PURE__ */ jsx53(
|
|
6184
6380
|
Label,
|
|
6185
6381
|
{
|
|
6186
6382
|
"data-slot": "form-label",
|
|
@@ -6196,7 +6392,7 @@ function FormControl({
|
|
|
6196
6392
|
...props
|
|
6197
6393
|
}) {
|
|
6198
6394
|
const { formItemId, formDescriptionId, formMessageId } = useFormItem();
|
|
6199
|
-
return /* @__PURE__ */
|
|
6395
|
+
return /* @__PURE__ */ jsx53(
|
|
6200
6396
|
Slot,
|
|
6201
6397
|
{
|
|
6202
6398
|
"data-slot": "form-control",
|
|
@@ -6209,7 +6405,7 @@ function FormControl({
|
|
|
6209
6405
|
}
|
|
6210
6406
|
function FormDescription({ className, ...props }) {
|
|
6211
6407
|
const { formDescriptionId } = useFormItem();
|
|
6212
|
-
return /* @__PURE__ */
|
|
6408
|
+
return /* @__PURE__ */ jsx53(
|
|
6213
6409
|
"p",
|
|
6214
6410
|
{
|
|
6215
6411
|
"data-slot": "form-description",
|
|
@@ -6224,7 +6420,7 @@ function FormMessage({ className, children, ...props }) {
|
|
|
6224
6420
|
if (!children) {
|
|
6225
6421
|
return null;
|
|
6226
6422
|
}
|
|
6227
|
-
return /* @__PURE__ */
|
|
6423
|
+
return /* @__PURE__ */ jsx53(
|
|
6228
6424
|
"p",
|
|
6229
6425
|
{
|
|
6230
6426
|
"data-slot": "form-message",
|
|
@@ -6237,14 +6433,14 @@ function FormMessage({ className, children, ...props }) {
|
|
|
6237
6433
|
}
|
|
6238
6434
|
|
|
6239
6435
|
// src/components/resizable.tsx
|
|
6240
|
-
import * as
|
|
6241
|
-
import { jsx as
|
|
6436
|
+
import * as React63 from "react";
|
|
6437
|
+
import { jsx as jsx54, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6242
6438
|
var GROUP_BASE = "flex h-full w-full data-[panel-group-direction=vertical]:flex-col";
|
|
6243
6439
|
var HANDLE_BASE = "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90";
|
|
6244
6440
|
var GRIP_BASE = "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border";
|
|
6245
|
-
var ResizableContext =
|
|
6441
|
+
var ResizableContext = React63.createContext(null);
|
|
6246
6442
|
function useResizable() {
|
|
6247
|
-
const ctx =
|
|
6443
|
+
const ctx = React63.useContext(ResizableContext);
|
|
6248
6444
|
if (!ctx)
|
|
6249
6445
|
throw new Error("Resizable parts must be used within a ResizablePanelGroup");
|
|
6250
6446
|
return ctx;
|
|
@@ -6267,9 +6463,9 @@ function ResizablePanelGroup({
|
|
|
6267
6463
|
children,
|
|
6268
6464
|
...props
|
|
6269
6465
|
}) {
|
|
6270
|
-
const [sizes, setSizes] =
|
|
6271
|
-
const groupRef =
|
|
6272
|
-
const register =
|
|
6466
|
+
const [sizes, setSizes] = React63.useState([]);
|
|
6467
|
+
const groupRef = React63.useRef(null);
|
|
6468
|
+
const register = React63.useCallback((index, defaultSize) => {
|
|
6273
6469
|
setSizes((prev) => {
|
|
6274
6470
|
if (prev[index] !== void 0) return prev;
|
|
6275
6471
|
const next = prev.slice();
|
|
@@ -6278,14 +6474,14 @@ function ResizablePanelGroup({
|
|
|
6278
6474
|
return next;
|
|
6279
6475
|
});
|
|
6280
6476
|
}, []);
|
|
6281
|
-
|
|
6477
|
+
React63.useEffect(() => {
|
|
6282
6478
|
if (sizes.length) onLayout?.(sizes);
|
|
6283
6479
|
}, [sizes, onLayout]);
|
|
6284
|
-
const value =
|
|
6480
|
+
const value = React63.useMemo(
|
|
6285
6481
|
() => ({ sizes, setSizes, register, direction, keyboardStep, groupRef }),
|
|
6286
6482
|
[sizes, register, direction, keyboardStep]
|
|
6287
6483
|
);
|
|
6288
|
-
return /* @__PURE__ */
|
|
6484
|
+
return /* @__PURE__ */ jsx54(ResizableContext.Provider, { value, children: /* @__PURE__ */ jsx54(
|
|
6289
6485
|
"div",
|
|
6290
6486
|
{
|
|
6291
6487
|
ref: groupRef,
|
|
@@ -6306,11 +6502,11 @@ function ResizablePanel({
|
|
|
6306
6502
|
...props
|
|
6307
6503
|
}) {
|
|
6308
6504
|
const { sizes, register } = useResizable();
|
|
6309
|
-
|
|
6505
|
+
React63.useEffect(() => {
|
|
6310
6506
|
register(index, defaultSize);
|
|
6311
6507
|
}, [register, index, defaultSize]);
|
|
6312
6508
|
const basis = sizes[index] ?? defaultSize;
|
|
6313
|
-
return /* @__PURE__ */
|
|
6509
|
+
return /* @__PURE__ */ jsx54(
|
|
6314
6510
|
"div",
|
|
6315
6511
|
{
|
|
6316
6512
|
"data-slot": "resizable-panel",
|
|
@@ -6329,12 +6525,12 @@ function ResizableHandle({
|
|
|
6329
6525
|
...props
|
|
6330
6526
|
}) {
|
|
6331
6527
|
const { setSizes, direction, keyboardStep, groupRef } = useResizable();
|
|
6332
|
-
const draggingRef =
|
|
6333
|
-
const resize =
|
|
6528
|
+
const draggingRef = React63.useRef(false);
|
|
6529
|
+
const resize = React63.useCallback(
|
|
6334
6530
|
(delta) => setSizes((prev) => redistribute(prev, index, delta)),
|
|
6335
6531
|
[setSizes, index]
|
|
6336
6532
|
);
|
|
6337
|
-
const onPointerMove =
|
|
6533
|
+
const onPointerMove = React63.useCallback(
|
|
6338
6534
|
(event) => {
|
|
6339
6535
|
if (!draggingRef.current) return;
|
|
6340
6536
|
const rect = groupRef.current?.getBoundingClientRect();
|
|
@@ -6346,7 +6542,7 @@ function ResizableHandle({
|
|
|
6346
6542
|
},
|
|
6347
6543
|
[direction, resize, groupRef]
|
|
6348
6544
|
);
|
|
6349
|
-
const onPointerUp =
|
|
6545
|
+
const onPointerUp = React63.useCallback(() => {
|
|
6350
6546
|
draggingRef.current = false;
|
|
6351
6547
|
window.removeEventListener("pointermove", onPointerMove);
|
|
6352
6548
|
window.removeEventListener("pointerup", onPointerUp);
|
|
@@ -6357,7 +6553,7 @@ function ResizableHandle({
|
|
|
6357
6553
|
window.addEventListener("pointermove", onPointerMove);
|
|
6358
6554
|
window.addEventListener("pointerup", onPointerUp);
|
|
6359
6555
|
};
|
|
6360
|
-
|
|
6556
|
+
React63.useEffect(() => () => onPointerUp(), [onPointerUp]);
|
|
6361
6557
|
const onKeyDown = (event) => {
|
|
6362
6558
|
let delta;
|
|
6363
6559
|
switch (event.key) {
|
|
@@ -6390,7 +6586,7 @@ function ResizableHandle({
|
|
|
6390
6586
|
onKeyDown,
|
|
6391
6587
|
...props,
|
|
6392
6588
|
children: [
|
|
6393
|
-
withHandle && /* @__PURE__ */
|
|
6589
|
+
withHandle && /* @__PURE__ */ jsx54("div", { className: GRIP_BASE, children: /* @__PURE__ */ jsxs23(
|
|
6394
6590
|
"svg",
|
|
6395
6591
|
{
|
|
6396
6592
|
className: "size-2.5",
|
|
@@ -6405,12 +6601,12 @@ function ResizableHandle({
|
|
|
6405
6601
|
strokeLinejoin: "round",
|
|
6406
6602
|
"aria-hidden": "true",
|
|
6407
6603
|
children: [
|
|
6408
|
-
/* @__PURE__ */
|
|
6409
|
-
/* @__PURE__ */
|
|
6410
|
-
/* @__PURE__ */
|
|
6411
|
-
/* @__PURE__ */
|
|
6412
|
-
/* @__PURE__ */
|
|
6413
|
-
/* @__PURE__ */
|
|
6604
|
+
/* @__PURE__ */ jsx54("circle", { cx: "9", cy: "12", r: "1" }),
|
|
6605
|
+
/* @__PURE__ */ jsx54("circle", { cx: "9", cy: "5", r: "1" }),
|
|
6606
|
+
/* @__PURE__ */ jsx54("circle", { cx: "9", cy: "19", r: "1" }),
|
|
6607
|
+
/* @__PURE__ */ jsx54("circle", { cx: "15", cy: "12", r: "1" }),
|
|
6608
|
+
/* @__PURE__ */ jsx54("circle", { cx: "15", cy: "5", r: "1" }),
|
|
6609
|
+
/* @__PURE__ */ jsx54("circle", { cx: "15", cy: "19", r: "1" })
|
|
6414
6610
|
]
|
|
6415
6611
|
}
|
|
6416
6612
|
) }),
|
|
@@ -6485,6 +6681,7 @@ export {
|
|
|
6485
6681
|
CommandList,
|
|
6486
6682
|
CommandSeparator,
|
|
6487
6683
|
CommandShortcut,
|
|
6684
|
+
Container,
|
|
6488
6685
|
ContextMenu,
|
|
6489
6686
|
ContextMenuCheckboxItem,
|
|
6490
6687
|
ContextMenuContent,
|