@evinvest/uikit 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +15 -9
- package/dist/index.js +449 -458
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/tokens.css +20 -1
package/dist/index.js
CHANGED
|
@@ -226,34 +226,7 @@ function useFocusScope(enabled) {
|
|
|
226
226
|
import * as React7 from "react";
|
|
227
227
|
function usePresence(present) {
|
|
228
228
|
const ref = React7.useRef(null);
|
|
229
|
-
|
|
230
|
-
React7.useEffect(() => {
|
|
231
|
-
const node = ref.current;
|
|
232
|
-
if (present) {
|
|
233
|
-
setIsPresent(true);
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
if (!node) {
|
|
237
|
-
setIsPresent(false);
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
const styles = getComputedStyle(node);
|
|
241
|
-
const hasAnim = styles.animationName && styles.animationName !== "none" || parseFloat(styles.transitionDuration) > 0;
|
|
242
|
-
if (!hasAnim) {
|
|
243
|
-
setIsPresent(false);
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
function done() {
|
|
247
|
-
setIsPresent(false);
|
|
248
|
-
}
|
|
249
|
-
node.addEventListener("animationend", done);
|
|
250
|
-
node.addEventListener("transitionend", done);
|
|
251
|
-
return () => {
|
|
252
|
-
node.removeEventListener("animationend", done);
|
|
253
|
-
node.removeEventListener("transitionend", done);
|
|
254
|
-
};
|
|
255
|
-
}, [present]);
|
|
256
|
-
return { isPresent: present || isPresent, ref };
|
|
229
|
+
return { isPresent: present, ref };
|
|
257
230
|
}
|
|
258
231
|
|
|
259
232
|
// src/primitives/use-roving-focus.ts
|
|
@@ -1917,12 +1890,29 @@ function CollapsibleContent({
|
|
|
1917
1890
|
return /* @__PURE__ */ jsx24("div", { "data-slot": "collapsible-content", "data-state": "open", ...props, children });
|
|
1918
1891
|
}
|
|
1919
1892
|
|
|
1920
|
-
// src/components/
|
|
1921
|
-
import
|
|
1893
|
+
// src/components/container.tsx
|
|
1894
|
+
import "react";
|
|
1922
1895
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1923
|
-
|
|
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);
|
|
1924
1914
|
function useTabs() {
|
|
1925
|
-
const ctx =
|
|
1915
|
+
const ctx = React35.useContext(TabsContext);
|
|
1926
1916
|
if (!ctx) throw new Error("Tabs parts must be used within <Tabs>");
|
|
1927
1917
|
return ctx;
|
|
1928
1918
|
}
|
|
@@ -1940,7 +1930,7 @@ function Tabs({
|
|
|
1940
1930
|
defaultValue,
|
|
1941
1931
|
...onValueChange ? { onChange: onValueChange } : {}
|
|
1942
1932
|
});
|
|
1943
|
-
return /* @__PURE__ */
|
|
1933
|
+
return /* @__PURE__ */ jsx26(TabsContext.Provider, { value: { value: active, setValue, orientation }, children: /* @__PURE__ */ jsx26(
|
|
1944
1934
|
"div",
|
|
1945
1935
|
{
|
|
1946
1936
|
"data-slot": "tabs",
|
|
@@ -1958,12 +1948,12 @@ function TabsList({
|
|
|
1958
1948
|
...props
|
|
1959
1949
|
}) {
|
|
1960
1950
|
const { orientation } = useTabs();
|
|
1961
|
-
const items =
|
|
1951
|
+
const items = React35.Children.toArray(children);
|
|
1962
1952
|
const { activeIndex, setActiveIndex, onKeyDown: rovingKeyDown } = useRovingFocus({
|
|
1963
1953
|
count: items.length,
|
|
1964
1954
|
orientation: orientation === "vertical" ? "vertical" : "horizontal"
|
|
1965
1955
|
});
|
|
1966
|
-
return /* @__PURE__ */
|
|
1956
|
+
return /* @__PURE__ */ jsx26(
|
|
1967
1957
|
"div",
|
|
1968
1958
|
{
|
|
1969
1959
|
role: "tablist",
|
|
@@ -1979,7 +1969,7 @@ function TabsList({
|
|
|
1979
1969
|
},
|
|
1980
1970
|
...props,
|
|
1981
1971
|
children: items.map(
|
|
1982
|
-
(child, index) =>
|
|
1972
|
+
(child, index) => React35.isValidElement(child) ? React35.cloneElement(child, {
|
|
1983
1973
|
__index: index,
|
|
1984
1974
|
__isFocusItem: index === activeIndex,
|
|
1985
1975
|
__onFocusItem: () => setActiveIndex(index)
|
|
@@ -1999,7 +1989,7 @@ function TabsTrigger({
|
|
|
1999
1989
|
}) {
|
|
2000
1990
|
const { value: active, setValue } = useTabs();
|
|
2001
1991
|
const selected = active === value;
|
|
2002
|
-
return /* @__PURE__ */
|
|
1992
|
+
return /* @__PURE__ */ jsx26(
|
|
2003
1993
|
"button",
|
|
2004
1994
|
{
|
|
2005
1995
|
type: "button",
|
|
@@ -2033,7 +2023,7 @@ function TabsContent({
|
|
|
2033
2023
|
}) {
|
|
2034
2024
|
const { value: active } = useTabs();
|
|
2035
2025
|
if (active !== value) return null;
|
|
2036
|
-
return /* @__PURE__ */
|
|
2026
|
+
return /* @__PURE__ */ jsx26(
|
|
2037
2027
|
"div",
|
|
2038
2028
|
{
|
|
2039
2029
|
role: "tabpanel",
|
|
@@ -2048,7 +2038,7 @@ function TabsContent({
|
|
|
2048
2038
|
|
|
2049
2039
|
// src/components/toggle.tsx
|
|
2050
2040
|
import "react";
|
|
2051
|
-
import { jsx as
|
|
2041
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2052
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";
|
|
2053
2043
|
var toggleVariantClasses = {
|
|
2054
2044
|
default: "bg-transparent",
|
|
@@ -2081,7 +2071,7 @@ function Toggle({
|
|
|
2081
2071
|
defaultValue: defaultPressed,
|
|
2082
2072
|
...onPressedChange ? { onChange: onPressedChange } : {}
|
|
2083
2073
|
});
|
|
2084
|
-
return /* @__PURE__ */
|
|
2074
|
+
return /* @__PURE__ */ jsx27(
|
|
2085
2075
|
"button",
|
|
2086
2076
|
{
|
|
2087
2077
|
type: "button",
|
|
@@ -2099,9 +2089,9 @@ function Toggle({
|
|
|
2099
2089
|
}
|
|
2100
2090
|
|
|
2101
2091
|
// src/components/toggle-group.tsx
|
|
2102
|
-
import * as
|
|
2103
|
-
import { jsx as
|
|
2104
|
-
var ToggleGroupContext =
|
|
2092
|
+
import * as React37 from "react";
|
|
2093
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2094
|
+
var ToggleGroupContext = React37.createContext({
|
|
2105
2095
|
variant: "default",
|
|
2106
2096
|
size: "default",
|
|
2107
2097
|
value: [],
|
|
@@ -2128,7 +2118,7 @@ function ToggleGroup({
|
|
|
2128
2118
|
defaultValue: toArray(defaultValue),
|
|
2129
2119
|
onChange: (next) => onValueChange?.(type === "single" ? next[0] ?? "" : next)
|
|
2130
2120
|
});
|
|
2131
|
-
const toggle =
|
|
2121
|
+
const toggle = React37.useCallback(
|
|
2132
2122
|
(itemValue) => {
|
|
2133
2123
|
if (type === "single") {
|
|
2134
2124
|
setSelected(selected.includes(itemValue) ? [] : [itemValue]);
|
|
@@ -2140,7 +2130,7 @@ function ToggleGroup({
|
|
|
2140
2130
|
},
|
|
2141
2131
|
[type, selected, setSelected]
|
|
2142
2132
|
);
|
|
2143
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ jsx28(
|
|
2144
2134
|
"div",
|
|
2145
2135
|
{
|
|
2146
2136
|
"data-slot": "toggle-group",
|
|
@@ -2151,7 +2141,7 @@ function ToggleGroup({
|
|
|
2151
2141
|
className
|
|
2152
2142
|
),
|
|
2153
2143
|
...props,
|
|
2154
|
-
children: /* @__PURE__ */
|
|
2144
|
+
children: /* @__PURE__ */ jsx28(ToggleGroupContext.Provider, { value: { variant, size, value: selected, toggle }, children })
|
|
2155
2145
|
}
|
|
2156
2146
|
);
|
|
2157
2147
|
}
|
|
@@ -2164,11 +2154,11 @@ function ToggleGroupItem({
|
|
|
2164
2154
|
onClick,
|
|
2165
2155
|
...props
|
|
2166
2156
|
}) {
|
|
2167
|
-
const context =
|
|
2157
|
+
const context = React37.useContext(ToggleGroupContext);
|
|
2168
2158
|
const resolvedVariant = context.variant || variant || "default";
|
|
2169
2159
|
const resolvedSize = context.size || size || "default";
|
|
2170
2160
|
const on = context.value.includes(value);
|
|
2171
|
-
return /* @__PURE__ */
|
|
2161
|
+
return /* @__PURE__ */ jsx28(
|
|
2172
2162
|
"button",
|
|
2173
2163
|
{
|
|
2174
2164
|
type: "button",
|
|
@@ -2194,7 +2184,7 @@ function ToggleGroupItem({
|
|
|
2194
2184
|
|
|
2195
2185
|
// src/components/switch.tsx
|
|
2196
2186
|
import "react";
|
|
2197
|
-
import { jsx as
|
|
2187
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2198
2188
|
function Switch({
|
|
2199
2189
|
className,
|
|
2200
2190
|
checked,
|
|
@@ -2210,7 +2200,7 @@ function Switch({
|
|
|
2210
2200
|
...onCheckedChange ? { onChange: onCheckedChange } : {}
|
|
2211
2201
|
});
|
|
2212
2202
|
const state = on ? "checked" : "unchecked";
|
|
2213
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ jsx29(
|
|
2214
2204
|
"button",
|
|
2215
2205
|
{
|
|
2216
2206
|
type: "button",
|
|
@@ -2228,7 +2218,7 @@ function Switch({
|
|
|
2228
2218
|
setOn(!on);
|
|
2229
2219
|
},
|
|
2230
2220
|
...props,
|
|
2231
|
-
children: /* @__PURE__ */
|
|
2221
|
+
children: /* @__PURE__ */ jsx29(
|
|
2232
2222
|
"span",
|
|
2233
2223
|
{
|
|
2234
2224
|
"data-slot": "switch-thumb",
|
|
@@ -2242,7 +2232,7 @@ function Switch({
|
|
|
2242
2232
|
|
|
2243
2233
|
// src/components/checkbox.tsx
|
|
2244
2234
|
import "react";
|
|
2245
|
-
import { jsx as
|
|
2235
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2246
2236
|
function Checkbox({
|
|
2247
2237
|
className,
|
|
2248
2238
|
checked,
|
|
@@ -2258,7 +2248,7 @@ function Checkbox({
|
|
|
2258
2248
|
...onCheckedChange ? { onChange: onCheckedChange } : {}
|
|
2259
2249
|
});
|
|
2260
2250
|
const state = on ? "checked" : "unchecked";
|
|
2261
|
-
return /* @__PURE__ */
|
|
2251
|
+
return /* @__PURE__ */ jsx30(
|
|
2262
2252
|
"button",
|
|
2263
2253
|
{
|
|
2264
2254
|
type: "button",
|
|
@@ -2276,12 +2266,12 @@ function Checkbox({
|
|
|
2276
2266
|
setOn(!on);
|
|
2277
2267
|
},
|
|
2278
2268
|
...props,
|
|
2279
|
-
children: on && /* @__PURE__ */
|
|
2269
|
+
children: on && /* @__PURE__ */ jsx30(
|
|
2280
2270
|
"span",
|
|
2281
2271
|
{
|
|
2282
2272
|
"data-slot": "checkbox-indicator",
|
|
2283
2273
|
className: "flex items-center justify-center text-current transition-none",
|
|
2284
|
-
children: /* @__PURE__ */
|
|
2274
|
+
children: /* @__PURE__ */ jsx30(
|
|
2285
2275
|
"svg",
|
|
2286
2276
|
{
|
|
2287
2277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2293,7 +2283,7 @@ function Checkbox({
|
|
|
2293
2283
|
strokeLinejoin: "round",
|
|
2294
2284
|
className: "size-3.5",
|
|
2295
2285
|
"aria-hidden": "true",
|
|
2296
|
-
children: /* @__PURE__ */
|
|
2286
|
+
children: /* @__PURE__ */ jsx30("path", { d: "M20 6 9 17l-5-5" })
|
|
2297
2287
|
}
|
|
2298
2288
|
)
|
|
2299
2289
|
}
|
|
@@ -2303,11 +2293,11 @@ function Checkbox({
|
|
|
2303
2293
|
}
|
|
2304
2294
|
|
|
2305
2295
|
// src/components/radio-group.tsx
|
|
2306
|
-
import * as
|
|
2307
|
-
import { jsx as
|
|
2296
|
+
import * as React40 from "react";
|
|
2297
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2308
2298
|
var ROOT_BASE = "grid gap-3";
|
|
2309
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";
|
|
2310
|
-
var RadioGroupContext =
|
|
2300
|
+
var RadioGroupContext = React40.createContext(
|
|
2311
2301
|
null
|
|
2312
2302
|
);
|
|
2313
2303
|
function RadioGroup({
|
|
@@ -2324,10 +2314,10 @@ function RadioGroup({
|
|
|
2324
2314
|
defaultValue,
|
|
2325
2315
|
...onValueChange ? { onChange: onValueChange } : {}
|
|
2326
2316
|
});
|
|
2327
|
-
const itemsRef =
|
|
2328
|
-
const [count, setCount] =
|
|
2317
|
+
const itemsRef = React40.useRef([]);
|
|
2318
|
+
const [count, setCount] = React40.useState(0);
|
|
2329
2319
|
const { activeIndex, setActiveIndex, onKeyDown: rovingKeyDown } = useRovingFocus({ count, orientation: "vertical", loop: true });
|
|
2330
|
-
const register =
|
|
2320
|
+
const register = React40.useCallback((el) => {
|
|
2331
2321
|
const list = itemsRef.current;
|
|
2332
2322
|
let index = list.indexOf(el);
|
|
2333
2323
|
if (index === -1) {
|
|
@@ -2337,11 +2327,11 @@ function RadioGroup({
|
|
|
2337
2327
|
}
|
|
2338
2328
|
return index;
|
|
2339
2329
|
}, []);
|
|
2340
|
-
const ctx =
|
|
2330
|
+
const ctx = React40.useMemo(
|
|
2341
2331
|
() => ({ value: current, setValue: setCurrent, register, activeIndex, setActiveIndex }),
|
|
2342
2332
|
[current, setCurrent, register, activeIndex, setActiveIndex]
|
|
2343
2333
|
);
|
|
2344
|
-
return /* @__PURE__ */
|
|
2334
|
+
return /* @__PURE__ */ jsx31(RadioGroupContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx31(
|
|
2345
2335
|
"div",
|
|
2346
2336
|
{
|
|
2347
2337
|
"data-slot": "radio-group",
|
|
@@ -2363,14 +2353,14 @@ function RadioGroupItem({
|
|
|
2363
2353
|
onClick,
|
|
2364
2354
|
...props
|
|
2365
2355
|
}) {
|
|
2366
|
-
const ctx =
|
|
2356
|
+
const ctx = React40.useContext(RadioGroupContext);
|
|
2367
2357
|
if (!ctx) throw new Error("RadioGroupItem must be used within a RadioGroup");
|
|
2368
|
-
const indexRef =
|
|
2358
|
+
const indexRef = React40.useRef(-1);
|
|
2369
2359
|
const checked = ctx.value === value;
|
|
2370
|
-
|
|
2360
|
+
React40.useEffect(() => {
|
|
2371
2361
|
if (checked) ctx.setActiveIndex(indexRef.current);
|
|
2372
2362
|
}, [checked]);
|
|
2373
|
-
return /* @__PURE__ */
|
|
2363
|
+
return /* @__PURE__ */ jsx31(
|
|
2374
2364
|
"button",
|
|
2375
2365
|
{
|
|
2376
2366
|
ref: (el) => {
|
|
@@ -2389,18 +2379,18 @@ function RadioGroupItem({
|
|
|
2389
2379
|
ctx.setValue(value);
|
|
2390
2380
|
},
|
|
2391
2381
|
...props,
|
|
2392
|
-
children: checked ? /* @__PURE__ */
|
|
2382
|
+
children: checked ? /* @__PURE__ */ jsx31(
|
|
2393
2383
|
"span",
|
|
2394
2384
|
{
|
|
2395
2385
|
"data-slot": "radio-group-indicator",
|
|
2396
2386
|
className: "relative flex items-center justify-center",
|
|
2397
|
-
children: /* @__PURE__ */
|
|
2387
|
+
children: /* @__PURE__ */ jsx31(
|
|
2398
2388
|
"svg",
|
|
2399
2389
|
{
|
|
2400
2390
|
className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2",
|
|
2401
2391
|
viewBox: "0 0 24 24",
|
|
2402
2392
|
"aria-hidden": "true",
|
|
2403
|
-
children: /* @__PURE__ */
|
|
2393
|
+
children: /* @__PURE__ */ jsx31("circle", { cx: "12", cy: "12", r: "10" })
|
|
2404
2394
|
}
|
|
2405
2395
|
)
|
|
2406
2396
|
}
|
|
@@ -2410,8 +2400,8 @@ function RadioGroupItem({
|
|
|
2410
2400
|
}
|
|
2411
2401
|
|
|
2412
2402
|
// src/components/slider.tsx
|
|
2413
|
-
import * as
|
|
2414
|
-
import { jsx as
|
|
2403
|
+
import * as React41 from "react";
|
|
2404
|
+
import { jsx as jsx32, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2415
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";
|
|
2416
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";
|
|
2417
2407
|
var RANGE_BASE = "bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full";
|
|
@@ -2442,9 +2432,9 @@ function Slider({
|
|
|
2442
2432
|
const current = clampStep(raw, min, max, step);
|
|
2443
2433
|
const span = Math.max(max - min, Number.EPSILON);
|
|
2444
2434
|
const percent = Math.min(100, Math.max(0, (current - min) / span * 100));
|
|
2445
|
-
const trackRef =
|
|
2446
|
-
const draggingRef =
|
|
2447
|
-
const valueFromPointer =
|
|
2435
|
+
const trackRef = React41.useRef(null);
|
|
2436
|
+
const draggingRef = React41.useRef(false);
|
|
2437
|
+
const valueFromPointer = React41.useCallback(
|
|
2448
2438
|
(clientX, clientY) => {
|
|
2449
2439
|
const rect = trackRef.current?.getBoundingClientRect();
|
|
2450
2440
|
if (!rect) return current;
|
|
@@ -2501,18 +2491,18 @@ function Slider({
|
|
|
2501
2491
|
"data-disabled": disabled || void 0,
|
|
2502
2492
|
className: cn(ROOT_BASE2, className),
|
|
2503
2493
|
...props,
|
|
2494
|
+
onPointerDown,
|
|
2495
|
+
onPointerMove,
|
|
2496
|
+
onPointerUp,
|
|
2504
2497
|
children: [
|
|
2505
|
-
/* @__PURE__ */
|
|
2498
|
+
/* @__PURE__ */ jsx32(
|
|
2506
2499
|
"span",
|
|
2507
2500
|
{
|
|
2508
2501
|
ref: trackRef,
|
|
2509
2502
|
"data-slot": "slider-track",
|
|
2510
2503
|
"data-orientation": orientation,
|
|
2511
2504
|
className: TRACK_BASE,
|
|
2512
|
-
|
|
2513
|
-
onPointerMove,
|
|
2514
|
-
onPointerUp,
|
|
2515
|
-
children: /* @__PURE__ */ jsx31(
|
|
2505
|
+
children: /* @__PURE__ */ jsx32(
|
|
2516
2506
|
"span",
|
|
2517
2507
|
{
|
|
2518
2508
|
"data-slot": "slider-range",
|
|
@@ -2523,7 +2513,7 @@ function Slider({
|
|
|
2523
2513
|
)
|
|
2524
2514
|
}
|
|
2525
2515
|
),
|
|
2526
|
-
/* @__PURE__ */
|
|
2516
|
+
/* @__PURE__ */ jsx32(
|
|
2527
2517
|
"span",
|
|
2528
2518
|
{
|
|
2529
2519
|
"data-slot": "slider-thumb",
|
|
@@ -2547,14 +2537,14 @@ function Slider({
|
|
|
2547
2537
|
|
|
2548
2538
|
// src/components/scroll-area.tsx
|
|
2549
2539
|
import "react";
|
|
2550
|
-
import { jsx as
|
|
2540
|
+
import { jsx as jsx33, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2551
2541
|
function ScrollArea({
|
|
2552
2542
|
className,
|
|
2553
2543
|
children,
|
|
2554
2544
|
...props
|
|
2555
2545
|
}) {
|
|
2556
2546
|
return /* @__PURE__ */ jsxs6("div", { "data-slot": "scroll-area", className: cn("relative", className), ...props, children: [
|
|
2557
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ jsx33(
|
|
2558
2548
|
"div",
|
|
2559
2549
|
{
|
|
2560
2550
|
"data-slot": "scroll-area-viewport",
|
|
@@ -2562,7 +2552,7 @@ function ScrollArea({
|
|
|
2562
2552
|
children
|
|
2563
2553
|
}
|
|
2564
2554
|
),
|
|
2565
|
-
/* @__PURE__ */
|
|
2555
|
+
/* @__PURE__ */ jsx33(ScrollBar, {})
|
|
2566
2556
|
] });
|
|
2567
2557
|
}
|
|
2568
2558
|
function ScrollBar({
|
|
@@ -2570,7 +2560,7 @@ function ScrollBar({
|
|
|
2570
2560
|
orientation = "vertical",
|
|
2571
2561
|
...props
|
|
2572
2562
|
}) {
|
|
2573
|
-
return /* @__PURE__ */
|
|
2563
|
+
return /* @__PURE__ */ jsx33(
|
|
2574
2564
|
"div",
|
|
2575
2565
|
{
|
|
2576
2566
|
"data-slot": "scroll-area-scrollbar",
|
|
@@ -2582,7 +2572,7 @@ function ScrollBar({
|
|
|
2582
2572
|
className
|
|
2583
2573
|
),
|
|
2584
2574
|
...props,
|
|
2585
|
-
children: /* @__PURE__ */
|
|
2575
|
+
children: /* @__PURE__ */ jsx33(
|
|
2586
2576
|
"div",
|
|
2587
2577
|
{
|
|
2588
2578
|
"data-slot": "scroll-area-thumb",
|
|
@@ -2594,13 +2584,13 @@ function ScrollBar({
|
|
|
2594
2584
|
}
|
|
2595
2585
|
|
|
2596
2586
|
// src/components/sidebar.tsx
|
|
2597
|
-
import * as
|
|
2598
|
-
import { jsx as
|
|
2587
|
+
import * as React43 from "react";
|
|
2588
|
+
import { jsx as jsx34, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2599
2589
|
var SIDEBAR_WIDTH = "16rem";
|
|
2600
2590
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
2601
|
-
var SidebarContext =
|
|
2591
|
+
var SidebarContext = React43.createContext(null);
|
|
2602
2592
|
function useSidebar() {
|
|
2603
|
-
const ctx =
|
|
2593
|
+
const ctx = React43.useContext(SidebarContext);
|
|
2604
2594
|
if (!ctx) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
2605
2595
|
return ctx;
|
|
2606
2596
|
}
|
|
@@ -2618,16 +2608,16 @@ function SidebarProvider({
|
|
|
2618
2608
|
defaultValue: defaultOpen,
|
|
2619
2609
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
2620
2610
|
});
|
|
2621
|
-
const toggleSidebar =
|
|
2611
|
+
const toggleSidebar = React43.useCallback(
|
|
2622
2612
|
() => setOpen(!open),
|
|
2623
2613
|
[open, setOpen]
|
|
2624
2614
|
);
|
|
2625
2615
|
const state = open ? "expanded" : "collapsed";
|
|
2626
|
-
const contextValue =
|
|
2616
|
+
const contextValue = React43.useMemo(
|
|
2627
2617
|
() => ({ state, open, setOpen, toggleSidebar }),
|
|
2628
2618
|
[state, open, setOpen, toggleSidebar]
|
|
2629
2619
|
);
|
|
2630
|
-
return /* @__PURE__ */
|
|
2620
|
+
return /* @__PURE__ */ jsx34(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx34(
|
|
2631
2621
|
"div",
|
|
2632
2622
|
{
|
|
2633
2623
|
"data-slot": "sidebar-wrapper",
|
|
@@ -2655,7 +2645,7 @@ function Sidebar({
|
|
|
2655
2645
|
}) {
|
|
2656
2646
|
const { state } = useSidebar();
|
|
2657
2647
|
if (collapsible === "none") {
|
|
2658
|
-
return /* @__PURE__ */
|
|
2648
|
+
return /* @__PURE__ */ jsx34(
|
|
2659
2649
|
"div",
|
|
2660
2650
|
{
|
|
2661
2651
|
"data-slot": "sidebar",
|
|
@@ -2668,7 +2658,7 @@ function Sidebar({
|
|
|
2668
2658
|
}
|
|
2669
2659
|
);
|
|
2670
2660
|
}
|
|
2671
|
-
return /* @__PURE__ */
|
|
2661
|
+
return /* @__PURE__ */ jsx34(
|
|
2672
2662
|
"div",
|
|
2673
2663
|
{
|
|
2674
2664
|
className: "group peer text-sidebar-foreground hidden md:block",
|
|
@@ -2677,7 +2667,7 @@ function Sidebar({
|
|
|
2677
2667
|
"data-variant": variant,
|
|
2678
2668
|
"data-side": side,
|
|
2679
2669
|
"data-slot": "sidebar",
|
|
2680
|
-
children: /* @__PURE__ */
|
|
2670
|
+
children: /* @__PURE__ */ jsx34(
|
|
2681
2671
|
"div",
|
|
2682
2672
|
{
|
|
2683
2673
|
"data-slot": "sidebar-inner",
|
|
@@ -2717,7 +2707,7 @@ function SidebarTrigger({
|
|
|
2717
2707
|
...props,
|
|
2718
2708
|
children: [
|
|
2719
2709
|
children,
|
|
2720
|
-
/* @__PURE__ */
|
|
2710
|
+
/* @__PURE__ */ jsx34("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
2721
2711
|
]
|
|
2722
2712
|
}
|
|
2723
2713
|
);
|
|
@@ -2727,7 +2717,7 @@ function SidebarRail({
|
|
|
2727
2717
|
...props
|
|
2728
2718
|
}) {
|
|
2729
2719
|
const { toggleSidebar } = useSidebar();
|
|
2730
|
-
return /* @__PURE__ */
|
|
2720
|
+
return /* @__PURE__ */ jsx34(
|
|
2731
2721
|
"button",
|
|
2732
2722
|
{
|
|
2733
2723
|
type: "button",
|
|
@@ -2746,7 +2736,7 @@ function SidebarRail({
|
|
|
2746
2736
|
);
|
|
2747
2737
|
}
|
|
2748
2738
|
function SidebarInset({ className, ...props }) {
|
|
2749
|
-
return /* @__PURE__ */
|
|
2739
|
+
return /* @__PURE__ */ jsx34(
|
|
2750
2740
|
"main",
|
|
2751
2741
|
{
|
|
2752
2742
|
"data-slot": "sidebar-inset",
|
|
@@ -2760,7 +2750,7 @@ function SidebarInset({ className, ...props }) {
|
|
|
2760
2750
|
);
|
|
2761
2751
|
}
|
|
2762
2752
|
function SidebarHeader({ className, ...props }) {
|
|
2763
|
-
return /* @__PURE__ */
|
|
2753
|
+
return /* @__PURE__ */ jsx34(
|
|
2764
2754
|
"div",
|
|
2765
2755
|
{
|
|
2766
2756
|
"data-slot": "sidebar-header",
|
|
@@ -2771,7 +2761,7 @@ function SidebarHeader({ className, ...props }) {
|
|
|
2771
2761
|
);
|
|
2772
2762
|
}
|
|
2773
2763
|
function SidebarFooter({ className, ...props }) {
|
|
2774
|
-
return /* @__PURE__ */
|
|
2764
|
+
return /* @__PURE__ */ jsx34(
|
|
2775
2765
|
"div",
|
|
2776
2766
|
{
|
|
2777
2767
|
"data-slot": "sidebar-footer",
|
|
@@ -2785,7 +2775,7 @@ function SidebarSeparator({
|
|
|
2785
2775
|
className,
|
|
2786
2776
|
...props
|
|
2787
2777
|
}) {
|
|
2788
|
-
return /* @__PURE__ */
|
|
2778
|
+
return /* @__PURE__ */ jsx34(
|
|
2789
2779
|
"div",
|
|
2790
2780
|
{
|
|
2791
2781
|
"data-slot": "sidebar-separator",
|
|
@@ -2797,7 +2787,7 @@ function SidebarSeparator({
|
|
|
2797
2787
|
);
|
|
2798
2788
|
}
|
|
2799
2789
|
function SidebarContent({ className, ...props }) {
|
|
2800
|
-
return /* @__PURE__ */
|
|
2790
|
+
return /* @__PURE__ */ jsx34(
|
|
2801
2791
|
"div",
|
|
2802
2792
|
{
|
|
2803
2793
|
"data-slot": "sidebar-content",
|
|
@@ -2811,7 +2801,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
2811
2801
|
);
|
|
2812
2802
|
}
|
|
2813
2803
|
function SidebarGroup({ className, ...props }) {
|
|
2814
|
-
return /* @__PURE__ */
|
|
2804
|
+
return /* @__PURE__ */ jsx34(
|
|
2815
2805
|
"div",
|
|
2816
2806
|
{
|
|
2817
2807
|
"data-slot": "sidebar-group",
|
|
@@ -2827,7 +2817,7 @@ function SidebarGroupLabel({
|
|
|
2827
2817
|
...props
|
|
2828
2818
|
}) {
|
|
2829
2819
|
const Comp = asChild ? Slot : "div";
|
|
2830
|
-
return /* @__PURE__ */
|
|
2820
|
+
return /* @__PURE__ */ jsx34(
|
|
2831
2821
|
Comp,
|
|
2832
2822
|
{
|
|
2833
2823
|
"data-slot": "sidebar-group-label",
|
|
@@ -2845,7 +2835,7 @@ function SidebarGroupContent({
|
|
|
2845
2835
|
className,
|
|
2846
2836
|
...props
|
|
2847
2837
|
}) {
|
|
2848
|
-
return /* @__PURE__ */
|
|
2838
|
+
return /* @__PURE__ */ jsx34(
|
|
2849
2839
|
"div",
|
|
2850
2840
|
{
|
|
2851
2841
|
"data-slot": "sidebar-group-content",
|
|
@@ -2856,7 +2846,7 @@ function SidebarGroupContent({
|
|
|
2856
2846
|
);
|
|
2857
2847
|
}
|
|
2858
2848
|
function SidebarMenu({ className, ...props }) {
|
|
2859
|
-
return /* @__PURE__ */
|
|
2849
|
+
return /* @__PURE__ */ jsx34(
|
|
2860
2850
|
"ul",
|
|
2861
2851
|
{
|
|
2862
2852
|
"data-slot": "sidebar-menu",
|
|
@@ -2867,7 +2857,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
2867
2857
|
);
|
|
2868
2858
|
}
|
|
2869
2859
|
function SidebarMenuItem({ className, ...props }) {
|
|
2870
|
-
return /* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ jsx34(
|
|
2871
2861
|
"li",
|
|
2872
2862
|
{
|
|
2873
2863
|
"data-slot": "sidebar-menu-item",
|
|
@@ -2896,7 +2886,7 @@ function SidebarMenuButton({
|
|
|
2896
2886
|
...props
|
|
2897
2887
|
}) {
|
|
2898
2888
|
const Comp = asChild ? Slot : "button";
|
|
2899
|
-
return /* @__PURE__ */
|
|
2889
|
+
return /* @__PURE__ */ jsx34(
|
|
2900
2890
|
Comp,
|
|
2901
2891
|
{
|
|
2902
2892
|
"data-slot": "sidebar-menu-button",
|
|
@@ -2915,11 +2905,11 @@ function SidebarMenuButton({
|
|
|
2915
2905
|
}
|
|
2916
2906
|
|
|
2917
2907
|
// src/components/carousel.tsx
|
|
2918
|
-
import * as
|
|
2919
|
-
import { jsx as
|
|
2920
|
-
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);
|
|
2921
2911
|
function useCarousel() {
|
|
2922
|
-
const context =
|
|
2912
|
+
const context = React44.useContext(CarouselContext);
|
|
2923
2913
|
if (!context) {
|
|
2924
2914
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
2925
2915
|
}
|
|
@@ -2940,13 +2930,13 @@ function Carousel({
|
|
|
2940
2930
|
defaultValue: defaultIndex,
|
|
2941
2931
|
onChange: onIndexChange
|
|
2942
2932
|
});
|
|
2943
|
-
const [count, setCount] =
|
|
2933
|
+
const [count, setCount] = React44.useState(0);
|
|
2944
2934
|
const canScrollPrev = index > 0;
|
|
2945
2935
|
const canScrollNext = index < count - 1;
|
|
2946
|
-
const scrollPrev =
|
|
2936
|
+
const scrollPrev = React44.useCallback(() => {
|
|
2947
2937
|
if (index > 0) setIndex(index - 1);
|
|
2948
2938
|
}, [index, setIndex]);
|
|
2949
|
-
const scrollNext =
|
|
2939
|
+
const scrollNext = React44.useCallback(() => {
|
|
2950
2940
|
if (index < count - 1) setIndex(index + 1);
|
|
2951
2941
|
}, [index, count, setIndex]);
|
|
2952
2942
|
const handleKeyDown = (event) => {
|
|
@@ -2959,7 +2949,7 @@ function Carousel({
|
|
|
2959
2949
|
}
|
|
2960
2950
|
onKeyDown?.(event);
|
|
2961
2951
|
};
|
|
2962
|
-
return /* @__PURE__ */
|
|
2952
|
+
return /* @__PURE__ */ jsx35(
|
|
2963
2953
|
CarouselContext.Provider,
|
|
2964
2954
|
{
|
|
2965
2955
|
value: {
|
|
@@ -2972,7 +2962,7 @@ function Carousel({
|
|
|
2972
2962
|
canScrollPrev,
|
|
2973
2963
|
canScrollNext
|
|
2974
2964
|
},
|
|
2975
|
-
children: /* @__PURE__ */
|
|
2965
|
+
children: /* @__PURE__ */ jsx35(
|
|
2976
2966
|
"div",
|
|
2977
2967
|
{
|
|
2978
2968
|
onKeyDownCapture: handleKeyDown,
|
|
@@ -2994,12 +2984,12 @@ function CarouselContent({
|
|
|
2994
2984
|
...props
|
|
2995
2985
|
}) {
|
|
2996
2986
|
const { orientation, index, setCount } = useCarousel();
|
|
2997
|
-
const childCount =
|
|
2998
|
-
|
|
2987
|
+
const childCount = React44.Children.count(children);
|
|
2988
|
+
React44.useEffect(() => {
|
|
2999
2989
|
setCount(childCount);
|
|
3000
2990
|
}, [childCount, setCount]);
|
|
3001
2991
|
const transform = orientation === "horizontal" ? `translate3d(-${index * 100}%, 0, 0)` : `translate3d(0, -${index * 100}%, 0)`;
|
|
3002
|
-
return /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ jsx35("div", { className: "overflow-hidden", "data-slot": "carousel-content", children: /* @__PURE__ */ jsx35(
|
|
3003
2993
|
"div",
|
|
3004
2994
|
{
|
|
3005
2995
|
className: cn(
|
|
@@ -3018,7 +3008,7 @@ function CarouselItem({
|
|
|
3018
3008
|
...props
|
|
3019
3009
|
}) {
|
|
3020
3010
|
const { orientation } = useCarousel();
|
|
3021
|
-
return /* @__PURE__ */
|
|
3011
|
+
return /* @__PURE__ */ jsx35(
|
|
3022
3012
|
"div",
|
|
3023
3013
|
{
|
|
3024
3014
|
role: "group",
|
|
@@ -3055,7 +3045,7 @@ function CarouselPrevious({
|
|
|
3055
3045
|
onClick: scrollPrev,
|
|
3056
3046
|
...props,
|
|
3057
3047
|
children: [
|
|
3058
|
-
/* @__PURE__ */
|
|
3048
|
+
/* @__PURE__ */ jsx35(
|
|
3059
3049
|
"svg",
|
|
3060
3050
|
{
|
|
3061
3051
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3066,10 +3056,10 @@ function CarouselPrevious({
|
|
|
3066
3056
|
strokeLinecap: "round",
|
|
3067
3057
|
strokeLinejoin: "round",
|
|
3068
3058
|
"aria-hidden": "true",
|
|
3069
|
-
children: /* @__PURE__ */
|
|
3059
|
+
children: /* @__PURE__ */ jsx35("path", { d: "m15 18-6-6 6-6" })
|
|
3070
3060
|
}
|
|
3071
3061
|
),
|
|
3072
|
-
/* @__PURE__ */
|
|
3062
|
+
/* @__PURE__ */ jsx35("span", { className: "sr-only", children: "Previous slide" })
|
|
3073
3063
|
]
|
|
3074
3064
|
}
|
|
3075
3065
|
);
|
|
@@ -3096,7 +3086,7 @@ function CarouselNext({
|
|
|
3096
3086
|
onClick: scrollNext,
|
|
3097
3087
|
...props,
|
|
3098
3088
|
children: [
|
|
3099
|
-
/* @__PURE__ */
|
|
3089
|
+
/* @__PURE__ */ jsx35(
|
|
3100
3090
|
"svg",
|
|
3101
3091
|
{
|
|
3102
3092
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3107,21 +3097,21 @@ function CarouselNext({
|
|
|
3107
3097
|
strokeLinecap: "round",
|
|
3108
3098
|
strokeLinejoin: "round",
|
|
3109
3099
|
"aria-hidden": "true",
|
|
3110
|
-
children: /* @__PURE__ */
|
|
3100
|
+
children: /* @__PURE__ */ jsx35("path", { d: "m9 18 6-6-6-6" })
|
|
3111
3101
|
}
|
|
3112
3102
|
),
|
|
3113
|
-
/* @__PURE__ */
|
|
3103
|
+
/* @__PURE__ */ jsx35("span", { className: "sr-only", children: "Next slide" })
|
|
3114
3104
|
]
|
|
3115
3105
|
}
|
|
3116
3106
|
);
|
|
3117
3107
|
}
|
|
3118
3108
|
|
|
3119
3109
|
// src/components/input-otp.tsx
|
|
3120
|
-
import * as
|
|
3121
|
-
import { jsx as
|
|
3122
|
-
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);
|
|
3123
3113
|
function useInputOTP() {
|
|
3124
|
-
const context =
|
|
3114
|
+
const context = React45.useContext(InputOTPContext);
|
|
3125
3115
|
if (!context) {
|
|
3126
3116
|
throw new Error("InputOTP slots must be used within an <InputOTP />");
|
|
3127
3117
|
}
|
|
@@ -3143,9 +3133,9 @@ function InputOTP({
|
|
|
3143
3133
|
defaultValue,
|
|
3144
3134
|
onChange
|
|
3145
3135
|
});
|
|
3146
|
-
const [focused, setFocused] =
|
|
3136
|
+
const [focused, setFocused] = React45.useState(false);
|
|
3147
3137
|
const activeIndex = focused ? Math.min(value.length, maxLength - 1) : -1;
|
|
3148
|
-
return /* @__PURE__ */
|
|
3138
|
+
return /* @__PURE__ */ jsx36(InputOTPContext.Provider, { value: { value, maxLength, activeIndex }, children: /* @__PURE__ */ jsxs9(
|
|
3149
3139
|
"div",
|
|
3150
3140
|
{
|
|
3151
3141
|
"data-slot": "input-otp",
|
|
@@ -3155,7 +3145,7 @@ function InputOTP({
|
|
|
3155
3145
|
),
|
|
3156
3146
|
children: [
|
|
3157
3147
|
children,
|
|
3158
|
-
/* @__PURE__ */
|
|
3148
|
+
/* @__PURE__ */ jsx36(
|
|
3159
3149
|
"input",
|
|
3160
3150
|
{
|
|
3161
3151
|
inputMode: "numeric",
|
|
@@ -3181,7 +3171,7 @@ function InputOTPGroup({
|
|
|
3181
3171
|
className,
|
|
3182
3172
|
...props
|
|
3183
3173
|
}) {
|
|
3184
|
-
return /* @__PURE__ */
|
|
3174
|
+
return /* @__PURE__ */ jsx36(
|
|
3185
3175
|
"div",
|
|
3186
3176
|
{
|
|
3187
3177
|
"data-slot": "input-otp-group",
|
|
@@ -3207,13 +3197,13 @@ function InputOTPSlot({ index, className, ...props }) {
|
|
|
3207
3197
|
...props,
|
|
3208
3198
|
children: [
|
|
3209
3199
|
char,
|
|
3210
|
-
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" }) })
|
|
3211
3201
|
]
|
|
3212
3202
|
}
|
|
3213
3203
|
);
|
|
3214
3204
|
}
|
|
3215
3205
|
function InputOTPSeparator({ ...props }) {
|
|
3216
|
-
return /* @__PURE__ */
|
|
3206
|
+
return /* @__PURE__ */ jsx36("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx36(
|
|
3217
3207
|
"svg",
|
|
3218
3208
|
{
|
|
3219
3209
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3224,22 +3214,22 @@ function InputOTPSeparator({ ...props }) {
|
|
|
3224
3214
|
strokeLinecap: "round",
|
|
3225
3215
|
strokeLinejoin: "round",
|
|
3226
3216
|
"aria-hidden": "true",
|
|
3227
|
-
children: /* @__PURE__ */
|
|
3217
|
+
children: /* @__PURE__ */ jsx36("path", { d: "M5 12h14" })
|
|
3228
3218
|
}
|
|
3229
3219
|
) });
|
|
3230
3220
|
}
|
|
3231
3221
|
|
|
3232
3222
|
// src/components/tooltip.tsx
|
|
3233
|
-
import * as
|
|
3234
|
-
import { Fragment, jsx as
|
|
3235
|
-
var TooltipContext =
|
|
3223
|
+
import * as React46 from "react";
|
|
3224
|
+
import { Fragment, jsx as jsx37 } from "react/jsx-runtime";
|
|
3225
|
+
var TooltipContext = React46.createContext(null);
|
|
3236
3226
|
function useTooltip() {
|
|
3237
|
-
const ctx =
|
|
3227
|
+
const ctx = React46.useContext(TooltipContext);
|
|
3238
3228
|
if (!ctx) throw new Error("Tooltip parts must be used within <Tooltip>");
|
|
3239
3229
|
return ctx;
|
|
3240
3230
|
}
|
|
3241
3231
|
function TooltipProvider({ children }) {
|
|
3242
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ jsx37(Fragment, { children });
|
|
3243
3233
|
}
|
|
3244
3234
|
function Tooltip({ open, defaultOpen = false, onOpenChange, children }) {
|
|
3245
3235
|
const [isOpen, setOpen] = useControllableState({
|
|
@@ -3247,8 +3237,8 @@ function Tooltip({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3247
3237
|
defaultValue: defaultOpen,
|
|
3248
3238
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3249
3239
|
});
|
|
3250
|
-
const anchorRef =
|
|
3251
|
-
return /* @__PURE__ */
|
|
3240
|
+
const anchorRef = React46.useRef(null);
|
|
3241
|
+
return /* @__PURE__ */ jsx37(TooltipProvider, { children: /* @__PURE__ */ jsx37(TooltipContext.Provider, { value: { open: isOpen, setOpen, anchorRef }, children }) });
|
|
3252
3242
|
}
|
|
3253
3243
|
function TooltipTrigger({
|
|
3254
3244
|
asChild = false,
|
|
@@ -3260,7 +3250,7 @@ function TooltipTrigger({
|
|
|
3260
3250
|
}) {
|
|
3261
3251
|
const { setOpen, anchorRef } = useTooltip();
|
|
3262
3252
|
const Comp = asChild ? Slot : "button";
|
|
3263
|
-
return /* @__PURE__ */
|
|
3253
|
+
return /* @__PURE__ */ jsx37(
|
|
3264
3254
|
Comp,
|
|
3265
3255
|
{
|
|
3266
3256
|
"data-slot": "tooltip-trigger",
|
|
@@ -3301,7 +3291,7 @@ function TooltipContent({
|
|
|
3301
3291
|
offset: sideOffset
|
|
3302
3292
|
});
|
|
3303
3293
|
if (!isPresent) return null;
|
|
3304
|
-
return /* @__PURE__ */
|
|
3294
|
+
return /* @__PURE__ */ jsx37(Portal, { children: /* @__PURE__ */ jsx37(
|
|
3305
3295
|
"div",
|
|
3306
3296
|
{
|
|
3307
3297
|
"data-slot": "tooltip-content",
|
|
@@ -3321,11 +3311,11 @@ function TooltipContent({
|
|
|
3321
3311
|
}
|
|
3322
3312
|
|
|
3323
3313
|
// src/components/popover.tsx
|
|
3324
|
-
import * as
|
|
3325
|
-
import { jsx as
|
|
3326
|
-
var PopoverContext =
|
|
3314
|
+
import * as React47 from "react";
|
|
3315
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3316
|
+
var PopoverContext = React47.createContext(null);
|
|
3327
3317
|
function usePopover() {
|
|
3328
|
-
const ctx =
|
|
3318
|
+
const ctx = React47.useContext(PopoverContext);
|
|
3329
3319
|
if (!ctx) throw new Error("Popover parts must be used within <Popover>");
|
|
3330
3320
|
return ctx;
|
|
3331
3321
|
}
|
|
@@ -3335,13 +3325,13 @@ function Popover({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3335
3325
|
defaultValue: defaultOpen,
|
|
3336
3326
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3337
3327
|
});
|
|
3338
|
-
const anchorRef =
|
|
3339
|
-
return /* @__PURE__ */
|
|
3328
|
+
const anchorRef = React47.useRef(null);
|
|
3329
|
+
return /* @__PURE__ */ jsx38(PopoverContext.Provider, { value: { open: isOpen, setOpen, anchorRef }, children });
|
|
3340
3330
|
}
|
|
3341
3331
|
function PopoverTrigger({ asChild = false, onClick, ...props }) {
|
|
3342
3332
|
const { open, setOpen, anchorRef } = usePopover();
|
|
3343
3333
|
const Comp = asChild ? Slot : "button";
|
|
3344
|
-
return /* @__PURE__ */
|
|
3334
|
+
return /* @__PURE__ */ jsx38(
|
|
3345
3335
|
Comp,
|
|
3346
3336
|
{
|
|
3347
3337
|
"data-slot": "popover-trigger",
|
|
@@ -3358,7 +3348,7 @@ function PopoverTrigger({ asChild = false, onClick, ...props }) {
|
|
|
3358
3348
|
function PopoverAnchor({ asChild = false, ...props }) {
|
|
3359
3349
|
const { anchorRef } = usePopover();
|
|
3360
3350
|
const Comp = asChild ? Slot : "div";
|
|
3361
|
-
return /* @__PURE__ */
|
|
3351
|
+
return /* @__PURE__ */ jsx38(
|
|
3362
3352
|
Comp,
|
|
3363
3353
|
{
|
|
3364
3354
|
"data-slot": "popover-anchor",
|
|
@@ -3390,7 +3380,7 @@ function PopoverContent({
|
|
|
3390
3380
|
exclude: [anchorRef]
|
|
3391
3381
|
});
|
|
3392
3382
|
if (!isPresent) return null;
|
|
3393
|
-
return /* @__PURE__ */
|
|
3383
|
+
return /* @__PURE__ */ jsx38(Portal, { children: /* @__PURE__ */ jsx38(
|
|
3394
3384
|
"div",
|
|
3395
3385
|
{
|
|
3396
3386
|
"data-slot": "popover-content",
|
|
@@ -3410,11 +3400,11 @@ function PopoverContent({
|
|
|
3410
3400
|
}
|
|
3411
3401
|
|
|
3412
3402
|
// src/components/hover-card.tsx
|
|
3413
|
-
import * as
|
|
3414
|
-
import { jsx as
|
|
3415
|
-
var HoverCardContext =
|
|
3403
|
+
import * as React48 from "react";
|
|
3404
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3405
|
+
var HoverCardContext = React48.createContext(null);
|
|
3416
3406
|
function useHoverCard() {
|
|
3417
|
-
const ctx =
|
|
3407
|
+
const ctx = React48.useContext(HoverCardContext);
|
|
3418
3408
|
if (!ctx) throw new Error("HoverCard parts must be used within <HoverCard>");
|
|
3419
3409
|
return ctx;
|
|
3420
3410
|
}
|
|
@@ -3424,8 +3414,8 @@ function HoverCard({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3424
3414
|
defaultValue: defaultOpen,
|
|
3425
3415
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3426
3416
|
});
|
|
3427
|
-
const anchorRef =
|
|
3428
|
-
return /* @__PURE__ */
|
|
3417
|
+
const anchorRef = React48.useRef(null);
|
|
3418
|
+
return /* @__PURE__ */ jsx39(HoverCardContext.Provider, { value: { open: isOpen, setOpen, anchorRef }, children });
|
|
3429
3419
|
}
|
|
3430
3420
|
function HoverCardTrigger({
|
|
3431
3421
|
asChild = false,
|
|
@@ -3435,7 +3425,7 @@ function HoverCardTrigger({
|
|
|
3435
3425
|
}) {
|
|
3436
3426
|
const { setOpen, anchorRef } = useHoverCard();
|
|
3437
3427
|
const Comp = asChild ? Slot : "a";
|
|
3438
|
-
return /* @__PURE__ */
|
|
3428
|
+
return /* @__PURE__ */ jsx39(
|
|
3439
3429
|
Comp,
|
|
3440
3430
|
{
|
|
3441
3431
|
"data-slot": "hover-card-trigger",
|
|
@@ -3470,7 +3460,7 @@ function HoverCardContent({
|
|
|
3470
3460
|
offset: sideOffset
|
|
3471
3461
|
});
|
|
3472
3462
|
if (!isPresent) return null;
|
|
3473
|
-
return /* @__PURE__ */
|
|
3463
|
+
return /* @__PURE__ */ jsx39(Portal, { children: /* @__PURE__ */ jsx39(
|
|
3474
3464
|
"div",
|
|
3475
3465
|
{
|
|
3476
3466
|
"data-slot": "hover-card-content",
|
|
@@ -3490,13 +3480,13 @@ function HoverCardContent({
|
|
|
3490
3480
|
}
|
|
3491
3481
|
|
|
3492
3482
|
// src/components/dropdown-menu.tsx
|
|
3493
|
-
import * as
|
|
3494
|
-
import { jsx as
|
|
3495
|
-
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(
|
|
3496
3486
|
null
|
|
3497
3487
|
);
|
|
3498
3488
|
function useDropdownMenu() {
|
|
3499
|
-
const ctx =
|
|
3489
|
+
const ctx = React49.useContext(DropdownMenuContext);
|
|
3500
3490
|
if (!ctx) throw new Error("DropdownMenu parts must be used within <DropdownMenu>");
|
|
3501
3491
|
return ctx;
|
|
3502
3492
|
}
|
|
@@ -3506,16 +3496,16 @@ function DropdownMenu({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3506
3496
|
defaultValue: defaultOpen,
|
|
3507
3497
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3508
3498
|
});
|
|
3509
|
-
const anchorRef =
|
|
3510
|
-
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 }) });
|
|
3511
3501
|
}
|
|
3512
3502
|
function DropdownMenuPortal({ children }) {
|
|
3513
|
-
return /* @__PURE__ */
|
|
3503
|
+
return /* @__PURE__ */ jsx40(Portal, { children });
|
|
3514
3504
|
}
|
|
3515
3505
|
function DropdownMenuTrigger({ asChild = false, onClick, ...props }) {
|
|
3516
3506
|
const { open, setOpen, anchorRef } = useDropdownMenu();
|
|
3517
3507
|
const Comp = asChild ? Slot : "button";
|
|
3518
|
-
return /* @__PURE__ */
|
|
3508
|
+
return /* @__PURE__ */ jsx40(
|
|
3519
3509
|
Comp,
|
|
3520
3510
|
{
|
|
3521
3511
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -3551,7 +3541,7 @@ function DropdownMenuContent({
|
|
|
3551
3541
|
onDismiss: () => setOpen(false),
|
|
3552
3542
|
exclude: [anchorRef]
|
|
3553
3543
|
});
|
|
3554
|
-
const contentRef =
|
|
3544
|
+
const contentRef = React49.useRef(null);
|
|
3555
3545
|
const items = () => Array.from(
|
|
3556
3546
|
contentRef.current?.querySelectorAll("[role^='menuitem']") ?? []
|
|
3557
3547
|
).filter((el) => el.getAttribute("data-disabled") === null);
|
|
@@ -3560,13 +3550,13 @@ function DropdownMenuContent({
|
|
|
3560
3550
|
orientation: "vertical",
|
|
3561
3551
|
loop: true
|
|
3562
3552
|
});
|
|
3563
|
-
|
|
3553
|
+
React49.useEffect(() => {
|
|
3564
3554
|
if (!open) return;
|
|
3565
3555
|
items()[activeIndex]?.focus();
|
|
3566
3556
|
}, [open, activeIndex]);
|
|
3567
|
-
const close =
|
|
3557
|
+
const close = React49.useCallback(() => setOpen(false), [setOpen]);
|
|
3568
3558
|
if (!isPresent) return null;
|
|
3569
|
-
return /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsx40(Portal, { children: /* @__PURE__ */ jsx40(DropdownMenuCloseContext.Provider, { value: close, children: /* @__PURE__ */ jsx40(
|
|
3570
3560
|
"div",
|
|
3571
3561
|
{
|
|
3572
3562
|
"data-slot": "dropdown-menu-content",
|
|
@@ -3589,10 +3579,10 @@ function DropdownMenuContent({
|
|
|
3589
3579
|
}
|
|
3590
3580
|
) }) });
|
|
3591
3581
|
}
|
|
3592
|
-
var DropdownMenuCloseContext =
|
|
3582
|
+
var DropdownMenuCloseContext = React49.createContext(() => {
|
|
3593
3583
|
});
|
|
3594
3584
|
function DropdownMenuGroup({ className, ...props }) {
|
|
3595
|
-
return /* @__PURE__ */
|
|
3585
|
+
return /* @__PURE__ */ jsx40("div", { "data-slot": "dropdown-menu-group", role: "group", className, ...props });
|
|
3596
3586
|
}
|
|
3597
3587
|
function DropdownMenuItem({
|
|
3598
3588
|
className,
|
|
@@ -3603,8 +3593,8 @@ function DropdownMenuItem({
|
|
|
3603
3593
|
onKeyDown,
|
|
3604
3594
|
...props
|
|
3605
3595
|
}) {
|
|
3606
|
-
const close =
|
|
3607
|
-
return /* @__PURE__ */
|
|
3596
|
+
const close = React49.useContext(DropdownMenuCloseContext);
|
|
3597
|
+
return /* @__PURE__ */ jsx40(
|
|
3608
3598
|
"div",
|
|
3609
3599
|
{
|
|
3610
3600
|
"data-slot": "dropdown-menu-item",
|
|
@@ -3641,7 +3631,7 @@ function DropdownMenuCheckboxItem({
|
|
|
3641
3631
|
onClick,
|
|
3642
3632
|
...props
|
|
3643
3633
|
}) {
|
|
3644
|
-
const close =
|
|
3634
|
+
const close = React49.useContext(DropdownMenuCloseContext);
|
|
3645
3635
|
return /* @__PURE__ */ jsxs10(
|
|
3646
3636
|
"div",
|
|
3647
3637
|
{
|
|
@@ -3662,13 +3652,13 @@ function DropdownMenuCheckboxItem({
|
|
|
3662
3652
|
},
|
|
3663
3653
|
...props,
|
|
3664
3654
|
children: [
|
|
3665
|
-
/* @__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 }),
|
|
3666
3656
|
children
|
|
3667
3657
|
]
|
|
3668
3658
|
}
|
|
3669
3659
|
);
|
|
3670
3660
|
}
|
|
3671
|
-
var DropdownMenuRadioGroupContext =
|
|
3661
|
+
var DropdownMenuRadioGroupContext = React49.createContext(null);
|
|
3672
3662
|
function DropdownMenuRadioGroup({
|
|
3673
3663
|
className,
|
|
3674
3664
|
value,
|
|
@@ -3676,11 +3666,11 @@ function DropdownMenuRadioGroup({
|
|
|
3676
3666
|
children,
|
|
3677
3667
|
...props
|
|
3678
3668
|
}) {
|
|
3679
|
-
const ctx =
|
|
3669
|
+
const ctx = React49.useMemo(
|
|
3680
3670
|
() => ({ value, setValue: (next) => onValueChange?.(next) }),
|
|
3681
3671
|
[value, onValueChange]
|
|
3682
3672
|
);
|
|
3683
|
-
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 }) });
|
|
3684
3674
|
}
|
|
3685
3675
|
function DropdownMenuRadioItem({
|
|
3686
3676
|
className,
|
|
@@ -3690,8 +3680,8 @@ function DropdownMenuRadioItem({
|
|
|
3690
3680
|
onClick,
|
|
3691
3681
|
...props
|
|
3692
3682
|
}) {
|
|
3693
|
-
const close =
|
|
3694
|
-
const group =
|
|
3683
|
+
const close = React49.useContext(DropdownMenuCloseContext);
|
|
3684
|
+
const group = React49.useContext(DropdownMenuRadioGroupContext);
|
|
3695
3685
|
const checked = group?.value === value;
|
|
3696
3686
|
return /* @__PURE__ */ jsxs10(
|
|
3697
3687
|
"div",
|
|
@@ -3714,14 +3704,14 @@ function DropdownMenuRadioItem({
|
|
|
3714
3704
|
},
|
|
3715
3705
|
...props,
|
|
3716
3706
|
children: [
|
|
3717
|
-
/* @__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 }),
|
|
3718
3708
|
children
|
|
3719
3709
|
]
|
|
3720
3710
|
}
|
|
3721
3711
|
);
|
|
3722
3712
|
}
|
|
3723
3713
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
3724
|
-
return /* @__PURE__ */
|
|
3714
|
+
return /* @__PURE__ */ jsx40(
|
|
3725
3715
|
"div",
|
|
3726
3716
|
{
|
|
3727
3717
|
"data-slot": "dropdown-menu-label",
|
|
@@ -3732,7 +3722,7 @@ function DropdownMenuLabel({ className, inset, ...props }) {
|
|
|
3732
3722
|
);
|
|
3733
3723
|
}
|
|
3734
3724
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
3735
|
-
return /* @__PURE__ */
|
|
3725
|
+
return /* @__PURE__ */ jsx40(
|
|
3736
3726
|
"div",
|
|
3737
3727
|
{
|
|
3738
3728
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -3743,7 +3733,7 @@ function DropdownMenuSeparator({ className, ...props }) {
|
|
|
3743
3733
|
);
|
|
3744
3734
|
}
|
|
3745
3735
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
3746
|
-
return /* @__PURE__ */
|
|
3736
|
+
return /* @__PURE__ */ jsx40(
|
|
3747
3737
|
"span",
|
|
3748
3738
|
{
|
|
3749
3739
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -3752,17 +3742,17 @@ function DropdownMenuShortcut({ className, ...props }) {
|
|
|
3752
3742
|
}
|
|
3753
3743
|
);
|
|
3754
3744
|
}
|
|
3755
|
-
var DropdownMenuSubContext =
|
|
3745
|
+
var DropdownMenuSubContext = React49.createContext(null);
|
|
3756
3746
|
function DropdownMenuSub({ open, defaultOpen = false, onOpenChange, children }) {
|
|
3757
3747
|
const [isOpen, setOpen] = useControllableState({
|
|
3758
3748
|
...open !== void 0 ? { value: open } : {},
|
|
3759
3749
|
defaultValue: defaultOpen,
|
|
3760
3750
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3761
3751
|
});
|
|
3762
|
-
return /* @__PURE__ */
|
|
3752
|
+
return /* @__PURE__ */ jsx40(DropdownMenuSubContext.Provider, { value: { open: isOpen, setOpen }, children: /* @__PURE__ */ jsx40("div", { "data-slot": "dropdown-menu-sub", children }) });
|
|
3763
3753
|
}
|
|
3764
3754
|
function DropdownMenuSubTrigger({ className, inset, children, onClick, ...props }) {
|
|
3765
|
-
const ctx =
|
|
3755
|
+
const ctx = React49.useContext(DropdownMenuSubContext);
|
|
3766
3756
|
return /* @__PURE__ */ jsxs10(
|
|
3767
3757
|
"div",
|
|
3768
3758
|
{
|
|
@@ -3784,15 +3774,15 @@ function DropdownMenuSubTrigger({ className, inset, children, onClick, ...props
|
|
|
3784
3774
|
...props,
|
|
3785
3775
|
children: [
|
|
3786
3776
|
children,
|
|
3787
|
-
/* @__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" }) })
|
|
3788
3778
|
]
|
|
3789
3779
|
}
|
|
3790
3780
|
);
|
|
3791
3781
|
}
|
|
3792
3782
|
function DropdownMenuSubContent({ className, children, ...props }) {
|
|
3793
|
-
const ctx =
|
|
3783
|
+
const ctx = React49.useContext(DropdownMenuSubContext);
|
|
3794
3784
|
if (!ctx?.open) return null;
|
|
3795
|
-
return /* @__PURE__ */
|
|
3785
|
+
return /* @__PURE__ */ jsx40(
|
|
3796
3786
|
"div",
|
|
3797
3787
|
{
|
|
3798
3788
|
"data-slot": "dropdown-menu-sub-content",
|
|
@@ -3809,11 +3799,11 @@ function DropdownMenuSubContent({ className, children, ...props }) {
|
|
|
3809
3799
|
}
|
|
3810
3800
|
|
|
3811
3801
|
// src/components/context-menu.tsx
|
|
3812
|
-
import * as
|
|
3813
|
-
import { jsx as
|
|
3814
|
-
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);
|
|
3815
3805
|
function useContextMenu() {
|
|
3816
|
-
const ctx =
|
|
3806
|
+
const ctx = React50.useContext(ContextMenuContext);
|
|
3817
3807
|
if (!ctx) throw new Error("ContextMenu parts must be used within <ContextMenu>");
|
|
3818
3808
|
return ctx;
|
|
3819
3809
|
}
|
|
@@ -3823,16 +3813,16 @@ function ContextMenu({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
3823
3813
|
defaultValue: defaultOpen,
|
|
3824
3814
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
3825
3815
|
});
|
|
3826
|
-
const [point, setPoint] =
|
|
3827
|
-
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 }) });
|
|
3828
3818
|
}
|
|
3829
3819
|
function ContextMenuPortal({ children }) {
|
|
3830
|
-
return /* @__PURE__ */
|
|
3820
|
+
return /* @__PURE__ */ jsx41(Portal, { children });
|
|
3831
3821
|
}
|
|
3832
3822
|
function ContextMenuTrigger({ asChild = false, onContextMenu, ...props }) {
|
|
3833
3823
|
const { setOpen, setPoint } = useContextMenu();
|
|
3834
3824
|
const Comp = asChild ? Slot : "div";
|
|
3835
|
-
return /* @__PURE__ */
|
|
3825
|
+
return /* @__PURE__ */ jsx41(
|
|
3836
3826
|
Comp,
|
|
3837
3827
|
{
|
|
3838
3828
|
"data-slot": "context-menu-trigger",
|
|
@@ -3847,9 +3837,9 @@ function ContextMenuTrigger({ asChild = false, onContextMenu, ...props }) {
|
|
|
3847
3837
|
);
|
|
3848
3838
|
}
|
|
3849
3839
|
function ContextMenuGroup({ className, ...props }) {
|
|
3850
|
-
return /* @__PURE__ */
|
|
3840
|
+
return /* @__PURE__ */ jsx41("div", { "data-slot": "context-menu-group", role: "group", className, ...props });
|
|
3851
3841
|
}
|
|
3852
|
-
var ContextMenuCloseContext =
|
|
3842
|
+
var ContextMenuCloseContext = React50.createContext(() => {
|
|
3853
3843
|
});
|
|
3854
3844
|
function ContextMenuContent({ className, children, ...props }) {
|
|
3855
3845
|
const { open, setOpen, point } = useContextMenu();
|
|
@@ -3858,7 +3848,7 @@ function ContextMenuContent({ className, children, ...props }) {
|
|
|
3858
3848
|
enabled: open,
|
|
3859
3849
|
onDismiss: () => setOpen(false)
|
|
3860
3850
|
});
|
|
3861
|
-
const contentRef =
|
|
3851
|
+
const contentRef = React50.useRef(null);
|
|
3862
3852
|
const items = () => Array.from(
|
|
3863
3853
|
contentRef.current?.querySelectorAll("[role^='menuitem']") ?? []
|
|
3864
3854
|
).filter((el) => el.getAttribute("data-disabled") === null);
|
|
@@ -3867,13 +3857,13 @@ function ContextMenuContent({ className, children, ...props }) {
|
|
|
3867
3857
|
orientation: "vertical",
|
|
3868
3858
|
loop: true
|
|
3869
3859
|
});
|
|
3870
|
-
|
|
3860
|
+
React50.useEffect(() => {
|
|
3871
3861
|
if (!open) return;
|
|
3872
3862
|
items()[activeIndex]?.focus();
|
|
3873
3863
|
}, [open, activeIndex]);
|
|
3874
|
-
const close =
|
|
3864
|
+
const close = React50.useCallback(() => setOpen(false), [setOpen]);
|
|
3875
3865
|
if (!isPresent) return null;
|
|
3876
|
-
return /* @__PURE__ */
|
|
3866
|
+
return /* @__PURE__ */ jsx41(Portal, { children: /* @__PURE__ */ jsx41(ContextMenuCloseContext.Provider, { value: close, children: /* @__PURE__ */ jsx41(
|
|
3877
3867
|
"div",
|
|
3878
3868
|
{
|
|
3879
3869
|
"data-slot": "context-menu-content",
|
|
@@ -3905,8 +3895,8 @@ function ContextMenuItem({
|
|
|
3905
3895
|
onKeyDown,
|
|
3906
3896
|
...props
|
|
3907
3897
|
}) {
|
|
3908
|
-
const close =
|
|
3909
|
-
return /* @__PURE__ */
|
|
3898
|
+
const close = React50.useContext(ContextMenuCloseContext);
|
|
3899
|
+
return /* @__PURE__ */ jsx41(
|
|
3910
3900
|
"div",
|
|
3911
3901
|
{
|
|
3912
3902
|
"data-slot": "context-menu-item",
|
|
@@ -3943,7 +3933,7 @@ function ContextMenuCheckboxItem({
|
|
|
3943
3933
|
onClick,
|
|
3944
3934
|
...props
|
|
3945
3935
|
}) {
|
|
3946
|
-
const close =
|
|
3936
|
+
const close = React50.useContext(ContextMenuCloseContext);
|
|
3947
3937
|
return /* @__PURE__ */ jsxs11(
|
|
3948
3938
|
"div",
|
|
3949
3939
|
{
|
|
@@ -3964,13 +3954,13 @@ function ContextMenuCheckboxItem({
|
|
|
3964
3954
|
},
|
|
3965
3955
|
...props,
|
|
3966
3956
|
children: [
|
|
3967
|
-
/* @__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 }),
|
|
3968
3958
|
children
|
|
3969
3959
|
]
|
|
3970
3960
|
}
|
|
3971
3961
|
);
|
|
3972
3962
|
}
|
|
3973
|
-
var ContextMenuRadioGroupContext =
|
|
3963
|
+
var ContextMenuRadioGroupContext = React50.createContext(null);
|
|
3974
3964
|
function ContextMenuRadioGroup({
|
|
3975
3965
|
className,
|
|
3976
3966
|
value,
|
|
@@ -3978,11 +3968,11 @@ function ContextMenuRadioGroup({
|
|
|
3978
3968
|
children,
|
|
3979
3969
|
...props
|
|
3980
3970
|
}) {
|
|
3981
|
-
const ctx =
|
|
3971
|
+
const ctx = React50.useMemo(
|
|
3982
3972
|
() => ({ value, setValue: (next) => onValueChange?.(next) }),
|
|
3983
3973
|
[value, onValueChange]
|
|
3984
3974
|
);
|
|
3985
|
-
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 }) });
|
|
3986
3976
|
}
|
|
3987
3977
|
function ContextMenuRadioItem({
|
|
3988
3978
|
className,
|
|
@@ -3992,8 +3982,8 @@ function ContextMenuRadioItem({
|
|
|
3992
3982
|
onClick,
|
|
3993
3983
|
...props
|
|
3994
3984
|
}) {
|
|
3995
|
-
const close =
|
|
3996
|
-
const group =
|
|
3985
|
+
const close = React50.useContext(ContextMenuCloseContext);
|
|
3986
|
+
const group = React50.useContext(ContextMenuRadioGroupContext);
|
|
3997
3987
|
const checked = group?.value === value;
|
|
3998
3988
|
return /* @__PURE__ */ jsxs11(
|
|
3999
3989
|
"div",
|
|
@@ -4016,14 +4006,14 @@ function ContextMenuRadioItem({
|
|
|
4016
4006
|
},
|
|
4017
4007
|
...props,
|
|
4018
4008
|
children: [
|
|
4019
|
-
/* @__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 }),
|
|
4020
4010
|
children
|
|
4021
4011
|
]
|
|
4022
4012
|
}
|
|
4023
4013
|
);
|
|
4024
4014
|
}
|
|
4025
4015
|
function ContextMenuLabel({ className, inset, ...props }) {
|
|
4026
|
-
return /* @__PURE__ */
|
|
4016
|
+
return /* @__PURE__ */ jsx41(
|
|
4027
4017
|
"div",
|
|
4028
4018
|
{
|
|
4029
4019
|
"data-slot": "context-menu-label",
|
|
@@ -4034,7 +4024,7 @@ function ContextMenuLabel({ className, inset, ...props }) {
|
|
|
4034
4024
|
);
|
|
4035
4025
|
}
|
|
4036
4026
|
function ContextMenuSeparator({ className, ...props }) {
|
|
4037
|
-
return /* @__PURE__ */
|
|
4027
|
+
return /* @__PURE__ */ jsx41(
|
|
4038
4028
|
"div",
|
|
4039
4029
|
{
|
|
4040
4030
|
"data-slot": "context-menu-separator",
|
|
@@ -4045,7 +4035,7 @@ function ContextMenuSeparator({ className, ...props }) {
|
|
|
4045
4035
|
);
|
|
4046
4036
|
}
|
|
4047
4037
|
function ContextMenuShortcut({ className, ...props }) {
|
|
4048
|
-
return /* @__PURE__ */
|
|
4038
|
+
return /* @__PURE__ */ jsx41(
|
|
4049
4039
|
"span",
|
|
4050
4040
|
{
|
|
4051
4041
|
"data-slot": "context-menu-shortcut",
|
|
@@ -4054,17 +4044,17 @@ function ContextMenuShortcut({ className, ...props }) {
|
|
|
4054
4044
|
}
|
|
4055
4045
|
);
|
|
4056
4046
|
}
|
|
4057
|
-
var ContextMenuSubContext =
|
|
4047
|
+
var ContextMenuSubContext = React50.createContext(null);
|
|
4058
4048
|
function ContextMenuSub({ open, defaultOpen = false, onOpenChange, children }) {
|
|
4059
4049
|
const [isOpen, setOpen] = useControllableState({
|
|
4060
4050
|
...open !== void 0 ? { value: open } : {},
|
|
4061
4051
|
defaultValue: defaultOpen,
|
|
4062
4052
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
4063
4053
|
});
|
|
4064
|
-
return /* @__PURE__ */
|
|
4054
|
+
return /* @__PURE__ */ jsx41(ContextMenuSubContext.Provider, { value: { open: isOpen, setOpen }, children: /* @__PURE__ */ jsx41("div", { "data-slot": "context-menu-sub", children }) });
|
|
4065
4055
|
}
|
|
4066
4056
|
function ContextMenuSubTrigger({ className, inset, children, onClick, ...props }) {
|
|
4067
|
-
const ctx =
|
|
4057
|
+
const ctx = React50.useContext(ContextMenuSubContext);
|
|
4068
4058
|
return /* @__PURE__ */ jsxs11(
|
|
4069
4059
|
"div",
|
|
4070
4060
|
{
|
|
@@ -4086,15 +4076,15 @@ function ContextMenuSubTrigger({ className, inset, children, onClick, ...props }
|
|
|
4086
4076
|
...props,
|
|
4087
4077
|
children: [
|
|
4088
4078
|
children,
|
|
4089
|
-
/* @__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" }) })
|
|
4090
4080
|
]
|
|
4091
4081
|
}
|
|
4092
4082
|
);
|
|
4093
4083
|
}
|
|
4094
4084
|
function ContextMenuSubContent({ className, children, ...props }) {
|
|
4095
|
-
const ctx =
|
|
4085
|
+
const ctx = React50.useContext(ContextMenuSubContext);
|
|
4096
4086
|
if (!ctx?.open) return null;
|
|
4097
|
-
return /* @__PURE__ */
|
|
4087
|
+
return /* @__PURE__ */ jsx41(
|
|
4098
4088
|
"div",
|
|
4099
4089
|
{
|
|
4100
4090
|
"data-slot": "context-menu-sub-content",
|
|
@@ -4111,19 +4101,19 @@ function ContextMenuSubContent({ className, children, ...props }) {
|
|
|
4111
4101
|
}
|
|
4112
4102
|
|
|
4113
4103
|
// src/components/menubar.tsx
|
|
4114
|
-
import * as
|
|
4115
|
-
import { jsx as
|
|
4104
|
+
import * as React51 from "react";
|
|
4105
|
+
import { jsx as jsx42, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4116
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";
|
|
4117
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";
|
|
4118
|
-
var MenubarMenuContext =
|
|
4108
|
+
var MenubarMenuContext = React51.createContext(null);
|
|
4119
4109
|
function useMenu() {
|
|
4120
|
-
const ctx =
|
|
4110
|
+
const ctx = React51.useContext(MenubarMenuContext);
|
|
4121
4111
|
if (!ctx) throw new Error("Menubar parts must be used within <MenubarMenu>");
|
|
4122
4112
|
return ctx;
|
|
4123
4113
|
}
|
|
4124
|
-
var MenubarRadioGroupContext =
|
|
4114
|
+
var MenubarRadioGroupContext = React51.createContext(null);
|
|
4125
4115
|
function Menubar({ className, ...props }) {
|
|
4126
|
-
return /* @__PURE__ */
|
|
4116
|
+
return /* @__PURE__ */ jsx42(
|
|
4127
4117
|
"div",
|
|
4128
4118
|
{
|
|
4129
4119
|
"data-slot": "menubar",
|
|
@@ -4142,12 +4132,12 @@ function MenubarMenu({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4142
4132
|
defaultValue: defaultOpen,
|
|
4143
4133
|
onChange: onOpenChange
|
|
4144
4134
|
});
|
|
4145
|
-
const triggerRef =
|
|
4146
|
-
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 }) });
|
|
4147
4137
|
}
|
|
4148
4138
|
function MenubarTrigger({ className, onClick, ...props }) {
|
|
4149
4139
|
const { open, setOpen, triggerRef } = useMenu();
|
|
4150
|
-
return /* @__PURE__ */
|
|
4140
|
+
return /* @__PURE__ */ jsx42(
|
|
4151
4141
|
"button",
|
|
4152
4142
|
{
|
|
4153
4143
|
ref: triggerRef,
|
|
@@ -4186,10 +4176,10 @@ function MenubarContent({
|
|
|
4186
4176
|
onDismiss: () => setOpen(false),
|
|
4187
4177
|
exclude: [triggerRef]
|
|
4188
4178
|
});
|
|
4189
|
-
const items =
|
|
4179
|
+
const items = React51.Children.toArray(children);
|
|
4190
4180
|
const { onKeyDown } = useRovingFocus({ count: items.length, orientation: "vertical" });
|
|
4191
4181
|
if (!isPresent) return null;
|
|
4192
|
-
return /* @__PURE__ */
|
|
4182
|
+
return /* @__PURE__ */ jsx42(Portal, { children: /* @__PURE__ */ jsx42(
|
|
4193
4183
|
"div",
|
|
4194
4184
|
{
|
|
4195
4185
|
ref: mergeRefs(presenceRef, floatingRef, dismissRef),
|
|
@@ -4206,7 +4196,7 @@ function MenubarContent({
|
|
|
4206
4196
|
) });
|
|
4207
4197
|
}
|
|
4208
4198
|
function MenubarGroup({ className, ...props }) {
|
|
4209
|
-
return /* @__PURE__ */
|
|
4199
|
+
return /* @__PURE__ */ jsx42("div", { "data-slot": "menubar-group", role: "group", className, ...props });
|
|
4210
4200
|
}
|
|
4211
4201
|
function MenubarItem({
|
|
4212
4202
|
className,
|
|
@@ -4214,7 +4204,7 @@ function MenubarItem({
|
|
|
4214
4204
|
variant = "default",
|
|
4215
4205
|
...props
|
|
4216
4206
|
}) {
|
|
4217
|
-
return /* @__PURE__ */
|
|
4207
|
+
return /* @__PURE__ */ jsx42(
|
|
4218
4208
|
"div",
|
|
4219
4209
|
{
|
|
4220
4210
|
"data-slot": "menubar-item",
|
|
@@ -4249,7 +4239,7 @@ function MenubarCheckboxItem({
|
|
|
4249
4239
|
),
|
|
4250
4240
|
...props,
|
|
4251
4241
|
children: [
|
|
4252
|
-
/* @__PURE__ */
|
|
4242
|
+
/* @__PURE__ */ jsx42("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: checked && /* @__PURE__ */ jsx42(
|
|
4253
4243
|
"svg",
|
|
4254
4244
|
{
|
|
4255
4245
|
className: "size-4",
|
|
@@ -4259,7 +4249,7 @@ function MenubarCheckboxItem({
|
|
|
4259
4249
|
strokeWidth: "2",
|
|
4260
4250
|
strokeLinecap: "round",
|
|
4261
4251
|
strokeLinejoin: "round",
|
|
4262
|
-
children: /* @__PURE__ */
|
|
4252
|
+
children: /* @__PURE__ */ jsx42("path", { d: "M20 6 9 17l-5-5" })
|
|
4263
4253
|
}
|
|
4264
4254
|
) }),
|
|
4265
4255
|
children
|
|
@@ -4279,7 +4269,7 @@ function MenubarRadioGroup({
|
|
|
4279
4269
|
defaultValue,
|
|
4280
4270
|
onChange: onValueChange
|
|
4281
4271
|
});
|
|
4282
|
-
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 }) });
|
|
4283
4273
|
}
|
|
4284
4274
|
function MenubarRadioItem({
|
|
4285
4275
|
className,
|
|
@@ -4287,7 +4277,7 @@ function MenubarRadioItem({
|
|
|
4287
4277
|
value,
|
|
4288
4278
|
...props
|
|
4289
4279
|
}) {
|
|
4290
|
-
const ctx =
|
|
4280
|
+
const ctx = React51.useContext(MenubarRadioGroupContext);
|
|
4291
4281
|
const checked = ctx?.value === value;
|
|
4292
4282
|
return /* @__PURE__ */ jsxs12(
|
|
4293
4283
|
"div",
|
|
@@ -4303,7 +4293,7 @@ function MenubarRadioItem({
|
|
|
4303
4293
|
onClick: () => ctx?.onValueChange(value),
|
|
4304
4294
|
...props,
|
|
4305
4295
|
children: [
|
|
4306
|
-
/* @__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" }) }) }),
|
|
4307
4297
|
children
|
|
4308
4298
|
]
|
|
4309
4299
|
}
|
|
@@ -4314,7 +4304,7 @@ function MenubarLabel({
|
|
|
4314
4304
|
inset,
|
|
4315
4305
|
...props
|
|
4316
4306
|
}) {
|
|
4317
|
-
return /* @__PURE__ */
|
|
4307
|
+
return /* @__PURE__ */ jsx42(
|
|
4318
4308
|
"div",
|
|
4319
4309
|
{
|
|
4320
4310
|
"data-slot": "menubar-label",
|
|
@@ -4325,7 +4315,7 @@ function MenubarLabel({
|
|
|
4325
4315
|
);
|
|
4326
4316
|
}
|
|
4327
4317
|
function MenubarSeparator({ className, ...props }) {
|
|
4328
|
-
return /* @__PURE__ */
|
|
4318
|
+
return /* @__PURE__ */ jsx42(
|
|
4329
4319
|
"div",
|
|
4330
4320
|
{
|
|
4331
4321
|
"data-slot": "menubar-separator",
|
|
@@ -4336,7 +4326,7 @@ function MenubarSeparator({ className, ...props }) {
|
|
|
4336
4326
|
);
|
|
4337
4327
|
}
|
|
4338
4328
|
function MenubarShortcut({ className, ...props }) {
|
|
4339
|
-
return /* @__PURE__ */
|
|
4329
|
+
return /* @__PURE__ */ jsx42(
|
|
4340
4330
|
"span",
|
|
4341
4331
|
{
|
|
4342
4332
|
"data-slot": "menubar-shortcut",
|
|
@@ -4345,9 +4335,9 @@ function MenubarShortcut({ className, ...props }) {
|
|
|
4345
4335
|
}
|
|
4346
4336
|
);
|
|
4347
4337
|
}
|
|
4348
|
-
var MenubarSubContext =
|
|
4338
|
+
var MenubarSubContext = React51.createContext(null);
|
|
4349
4339
|
function useSub() {
|
|
4350
|
-
const ctx =
|
|
4340
|
+
const ctx = React51.useContext(MenubarSubContext);
|
|
4351
4341
|
if (!ctx) throw new Error("MenubarSub parts must be used within <MenubarSub>");
|
|
4352
4342
|
return ctx;
|
|
4353
4343
|
}
|
|
@@ -4357,7 +4347,7 @@ function MenubarSub({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4357
4347
|
defaultValue: defaultOpen,
|
|
4358
4348
|
onChange: onOpenChange
|
|
4359
4349
|
});
|
|
4360
|
-
return /* @__PURE__ */
|
|
4350
|
+
return /* @__PURE__ */ jsx42(MenubarSubContext.Provider, { value: { open: isOpen, setOpen }, children: /* @__PURE__ */ jsx42("div", { "data-slot": "menubar-sub", className: "relative", children }) });
|
|
4361
4351
|
}
|
|
4362
4352
|
function MenubarSubTrigger({
|
|
4363
4353
|
className,
|
|
@@ -4386,7 +4376,7 @@ function MenubarSubTrigger({
|
|
|
4386
4376
|
...props,
|
|
4387
4377
|
children: [
|
|
4388
4378
|
children,
|
|
4389
|
-
/* @__PURE__ */
|
|
4379
|
+
/* @__PURE__ */ jsx42(
|
|
4390
4380
|
"svg",
|
|
4391
4381
|
{
|
|
4392
4382
|
className: "ml-auto h-4 w-4",
|
|
@@ -4396,7 +4386,7 @@ function MenubarSubTrigger({
|
|
|
4396
4386
|
strokeWidth: "2",
|
|
4397
4387
|
strokeLinecap: "round",
|
|
4398
4388
|
strokeLinejoin: "round",
|
|
4399
|
-
children: /* @__PURE__ */
|
|
4389
|
+
children: /* @__PURE__ */ jsx42("path", { d: "m9 18 6-6-6-6" })
|
|
4400
4390
|
}
|
|
4401
4391
|
)
|
|
4402
4392
|
]
|
|
@@ -4407,7 +4397,7 @@ function MenubarSubContent({ className, children, ...props }) {
|
|
|
4407
4397
|
const { open } = useSub();
|
|
4408
4398
|
const { isPresent, ref } = usePresence(open);
|
|
4409
4399
|
if (!isPresent) return null;
|
|
4410
|
-
return /* @__PURE__ */
|
|
4400
|
+
return /* @__PURE__ */ jsx42(
|
|
4411
4401
|
"div",
|
|
4412
4402
|
{
|
|
4413
4403
|
ref,
|
|
@@ -4422,14 +4412,14 @@ function MenubarSubContent({ className, children, ...props }) {
|
|
|
4422
4412
|
}
|
|
4423
4413
|
|
|
4424
4414
|
// src/components/navigation-menu.tsx
|
|
4425
|
-
import * as
|
|
4426
|
-
import { jsx as
|
|
4415
|
+
import * as React52 from "react";
|
|
4416
|
+
import { jsx as jsx43, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4427
4417
|
function navigationMenuTriggerStyle() {
|
|
4428
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";
|
|
4429
4419
|
}
|
|
4430
|
-
var NavigationMenuItemContext =
|
|
4420
|
+
var NavigationMenuItemContext = React52.createContext(null);
|
|
4431
4421
|
function useItem() {
|
|
4432
|
-
const ctx =
|
|
4422
|
+
const ctx = React52.useContext(NavigationMenuItemContext);
|
|
4433
4423
|
if (!ctx) throw new Error("NavigationMenu parts must be used within <NavigationMenuItem>");
|
|
4434
4424
|
return ctx;
|
|
4435
4425
|
}
|
|
@@ -4452,13 +4442,13 @@ function NavigationMenu({
|
|
|
4452
4442
|
...props,
|
|
4453
4443
|
children: [
|
|
4454
4444
|
children,
|
|
4455
|
-
viewport && /* @__PURE__ */
|
|
4445
|
+
viewport && /* @__PURE__ */ jsx43(NavigationMenuViewport, {})
|
|
4456
4446
|
]
|
|
4457
4447
|
}
|
|
4458
4448
|
);
|
|
4459
4449
|
}
|
|
4460
4450
|
function NavigationMenuList({ className, ...props }) {
|
|
4461
|
-
return /* @__PURE__ */
|
|
4451
|
+
return /* @__PURE__ */ jsx43(
|
|
4462
4452
|
"ul",
|
|
4463
4453
|
{
|
|
4464
4454
|
"data-slot": "navigation-menu-list",
|
|
@@ -4484,8 +4474,8 @@ function NavigationMenuItem({
|
|
|
4484
4474
|
defaultValue: defaultOpen,
|
|
4485
4475
|
onChange: onOpenChange
|
|
4486
4476
|
});
|
|
4487
|
-
const triggerRef =
|
|
4488
|
-
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 }) });
|
|
4489
4479
|
}
|
|
4490
4480
|
function NavigationMenuTrigger({
|
|
4491
4481
|
className,
|
|
@@ -4510,7 +4500,7 @@ function NavigationMenuTrigger({
|
|
|
4510
4500
|
children: [
|
|
4511
4501
|
children,
|
|
4512
4502
|
" ",
|
|
4513
|
-
/* @__PURE__ */
|
|
4503
|
+
/* @__PURE__ */ jsx43(
|
|
4514
4504
|
"svg",
|
|
4515
4505
|
{
|
|
4516
4506
|
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
@@ -4521,7 +4511,7 @@ function NavigationMenuTrigger({
|
|
|
4521
4511
|
strokeLinecap: "round",
|
|
4522
4512
|
strokeLinejoin: "round",
|
|
4523
4513
|
"aria-hidden": "true",
|
|
4524
|
-
children: /* @__PURE__ */
|
|
4514
|
+
children: /* @__PURE__ */ jsx43("path", { d: "m6 9 6 6 6-6" })
|
|
4525
4515
|
}
|
|
4526
4516
|
)
|
|
4527
4517
|
]
|
|
@@ -4537,7 +4527,7 @@ function NavigationMenuContent({ className, children, ...props }) {
|
|
|
4537
4527
|
exclude: [triggerRef]
|
|
4538
4528
|
});
|
|
4539
4529
|
if (!isPresent) return null;
|
|
4540
|
-
return /* @__PURE__ */
|
|
4530
|
+
return /* @__PURE__ */ jsx43(
|
|
4541
4531
|
"div",
|
|
4542
4532
|
{
|
|
4543
4533
|
ref: mergeRefs(presenceRef, dismissRef),
|
|
@@ -4554,7 +4544,7 @@ function NavigationMenuContent({ className, children, ...props }) {
|
|
|
4554
4544
|
);
|
|
4555
4545
|
}
|
|
4556
4546
|
function NavigationMenuViewport({ className, ...props }) {
|
|
4557
|
-
return /* @__PURE__ */
|
|
4547
|
+
return /* @__PURE__ */ jsx43("div", { className: "absolute top-full left-0 isolate z-50 flex justify-center", children: /* @__PURE__ */ jsx43(
|
|
4558
4548
|
"div",
|
|
4559
4549
|
{
|
|
4560
4550
|
"data-slot": "navigation-menu-viewport",
|
|
@@ -4572,7 +4562,7 @@ function NavigationMenuLink({
|
|
|
4572
4562
|
...props
|
|
4573
4563
|
}) {
|
|
4574
4564
|
const Comp = asChild ? Slot : "a";
|
|
4575
|
-
return /* @__PURE__ */
|
|
4565
|
+
return /* @__PURE__ */ jsx43(
|
|
4576
4566
|
Comp,
|
|
4577
4567
|
{
|
|
4578
4568
|
"data-slot": "navigation-menu-link",
|
|
@@ -4585,7 +4575,7 @@ function NavigationMenuLink({
|
|
|
4585
4575
|
);
|
|
4586
4576
|
}
|
|
4587
4577
|
function NavigationMenuIndicator({ className, ...props }) {
|
|
4588
|
-
return /* @__PURE__ */
|
|
4578
|
+
return /* @__PURE__ */ jsx43(
|
|
4589
4579
|
"div",
|
|
4590
4580
|
{
|
|
4591
4581
|
"data-slot": "navigation-menu-indicator",
|
|
@@ -4594,17 +4584,17 @@ function NavigationMenuIndicator({ className, ...props }) {
|
|
|
4594
4584
|
className
|
|
4595
4585
|
),
|
|
4596
4586
|
...props,
|
|
4597
|
-
children: /* @__PURE__ */
|
|
4587
|
+
children: /* @__PURE__ */ jsx43("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" })
|
|
4598
4588
|
}
|
|
4599
4589
|
);
|
|
4600
4590
|
}
|
|
4601
4591
|
|
|
4602
4592
|
// src/components/dialog.tsx
|
|
4603
|
-
import * as
|
|
4604
|
-
import { Fragment as Fragment2, jsx as
|
|
4605
|
-
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);
|
|
4606
4596
|
function useDialog() {
|
|
4607
|
-
const ctx =
|
|
4597
|
+
const ctx = React53.useContext(DialogContext);
|
|
4608
4598
|
if (!ctx) throw new Error("Dialog parts must be used within <Dialog>");
|
|
4609
4599
|
return ctx;
|
|
4610
4600
|
}
|
|
@@ -4614,13 +4604,13 @@ function Dialog({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4614
4604
|
defaultValue: defaultOpen,
|
|
4615
4605
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
4616
4606
|
});
|
|
4617
|
-
const triggerRef =
|
|
4618
|
-
return /* @__PURE__ */
|
|
4607
|
+
const triggerRef = React53.useRef(null);
|
|
4608
|
+
return /* @__PURE__ */ jsx44(DialogContext.Provider, { value: { open: isOpen, setOpen, triggerRef }, children });
|
|
4619
4609
|
}
|
|
4620
4610
|
function DialogTrigger({ asChild = false, onClick, ...props }) {
|
|
4621
4611
|
const { open, setOpen, triggerRef } = useDialog();
|
|
4622
4612
|
const Comp = asChild ? Slot : "button";
|
|
4623
|
-
return /* @__PURE__ */
|
|
4613
|
+
return /* @__PURE__ */ jsx44(
|
|
4624
4614
|
Comp,
|
|
4625
4615
|
{
|
|
4626
4616
|
"data-slot": "dialog-trigger",
|
|
@@ -4635,11 +4625,11 @@ function DialogTrigger({ asChild = false, onClick, ...props }) {
|
|
|
4635
4625
|
);
|
|
4636
4626
|
}
|
|
4637
4627
|
function DialogPortal({ children }) {
|
|
4638
|
-
return /* @__PURE__ */
|
|
4628
|
+
return /* @__PURE__ */ jsx44(Fragment2, { children });
|
|
4639
4629
|
}
|
|
4640
4630
|
function DialogOverlay({ className, ...props }) {
|
|
4641
4631
|
const { open, setOpen } = useDialog();
|
|
4642
|
-
return /* @__PURE__ */
|
|
4632
|
+
return /* @__PURE__ */ jsx44(
|
|
4643
4633
|
"div",
|
|
4644
4634
|
{
|
|
4645
4635
|
"data-slot": "dialog-overlay",
|
|
@@ -4653,7 +4643,7 @@ function DialogOverlay({ className, ...props }) {
|
|
|
4653
4643
|
}
|
|
4654
4644
|
);
|
|
4655
4645
|
}
|
|
4656
|
-
var XIcon = (props) => /* @__PURE__ */
|
|
4646
|
+
var XIcon = (props) => /* @__PURE__ */ jsx44(
|
|
4657
4647
|
"svg",
|
|
4658
4648
|
{
|
|
4659
4649
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4666,7 +4656,7 @@ var XIcon = (props) => /* @__PURE__ */ jsx43(
|
|
|
4666
4656
|
strokeLinecap: "round",
|
|
4667
4657
|
strokeLinejoin: "round",
|
|
4668
4658
|
...props,
|
|
4669
|
-
children: /* @__PURE__ */
|
|
4659
|
+
children: /* @__PURE__ */ jsx44("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
4670
4660
|
}
|
|
4671
4661
|
);
|
|
4672
4662
|
function DialogContent({
|
|
@@ -4683,7 +4673,7 @@ function DialogContent({
|
|
|
4683
4673
|
onDismiss: () => setOpen(false),
|
|
4684
4674
|
exclude: [triggerRef]
|
|
4685
4675
|
});
|
|
4686
|
-
|
|
4676
|
+
React53.useEffect(() => {
|
|
4687
4677
|
if (!open) return;
|
|
4688
4678
|
const prev = document.body.style.overflow;
|
|
4689
4679
|
document.body.style.overflow = "hidden";
|
|
@@ -4693,7 +4683,7 @@ function DialogContent({
|
|
|
4693
4683
|
}, [open]);
|
|
4694
4684
|
if (!isPresent) return null;
|
|
4695
4685
|
return /* @__PURE__ */ jsxs14(Portal, { children: [
|
|
4696
|
-
/* @__PURE__ */
|
|
4686
|
+
/* @__PURE__ */ jsx44(DialogOverlay, {}),
|
|
4697
4687
|
/* @__PURE__ */ jsxs14(
|
|
4698
4688
|
"div",
|
|
4699
4689
|
{
|
|
@@ -4717,8 +4707,8 @@ function DialogContent({
|
|
|
4717
4707
|
onClick: () => setOpen(false),
|
|
4718
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",
|
|
4719
4709
|
children: [
|
|
4720
|
-
/* @__PURE__ */
|
|
4721
|
-
/* @__PURE__ */
|
|
4710
|
+
/* @__PURE__ */ jsx44(XIcon, {}),
|
|
4711
|
+
/* @__PURE__ */ jsx44("span", { className: "sr-only", children: "Close" })
|
|
4722
4712
|
]
|
|
4723
4713
|
}
|
|
4724
4714
|
)
|
|
@@ -4730,7 +4720,7 @@ function DialogContent({
|
|
|
4730
4720
|
function DialogClose({ asChild = false, onClick, ...props }) {
|
|
4731
4721
|
const { setOpen } = useDialog();
|
|
4732
4722
|
const Comp = asChild ? Slot : "button";
|
|
4733
|
-
return /* @__PURE__ */
|
|
4723
|
+
return /* @__PURE__ */ jsx44(
|
|
4734
4724
|
Comp,
|
|
4735
4725
|
{
|
|
4736
4726
|
"data-slot": "dialog-close",
|
|
@@ -4743,7 +4733,7 @@ function DialogClose({ asChild = false, onClick, ...props }) {
|
|
|
4743
4733
|
);
|
|
4744
4734
|
}
|
|
4745
4735
|
function DialogHeader({ className, ...props }) {
|
|
4746
|
-
return /* @__PURE__ */
|
|
4736
|
+
return /* @__PURE__ */ jsx44(
|
|
4747
4737
|
"div",
|
|
4748
4738
|
{
|
|
4749
4739
|
"data-slot": "dialog-header",
|
|
@@ -4753,7 +4743,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
4753
4743
|
);
|
|
4754
4744
|
}
|
|
4755
4745
|
function DialogFooter({ className, ...props }) {
|
|
4756
|
-
return /* @__PURE__ */
|
|
4746
|
+
return /* @__PURE__ */ jsx44(
|
|
4757
4747
|
"div",
|
|
4758
4748
|
{
|
|
4759
4749
|
"data-slot": "dialog-footer",
|
|
@@ -4763,7 +4753,7 @@ function DialogFooter({ className, ...props }) {
|
|
|
4763
4753
|
);
|
|
4764
4754
|
}
|
|
4765
4755
|
function DialogTitle({ className, ...props }) {
|
|
4766
|
-
return /* @__PURE__ */
|
|
4756
|
+
return /* @__PURE__ */ jsx44(
|
|
4767
4757
|
"h2",
|
|
4768
4758
|
{
|
|
4769
4759
|
"data-slot": "dialog-title",
|
|
@@ -4773,7 +4763,7 @@ function DialogTitle({ className, ...props }) {
|
|
|
4773
4763
|
);
|
|
4774
4764
|
}
|
|
4775
4765
|
function DialogDescription({ className, ...props }) {
|
|
4776
|
-
return /* @__PURE__ */
|
|
4766
|
+
return /* @__PURE__ */ jsx44(
|
|
4777
4767
|
"p",
|
|
4778
4768
|
{
|
|
4779
4769
|
"data-slot": "dialog-description",
|
|
@@ -4784,11 +4774,11 @@ function DialogDescription({ className, ...props }) {
|
|
|
4784
4774
|
}
|
|
4785
4775
|
|
|
4786
4776
|
// src/components/alert-dialog.tsx
|
|
4787
|
-
import * as
|
|
4788
|
-
import { jsx as
|
|
4789
|
-
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);
|
|
4790
4780
|
function useAlertDialog() {
|
|
4791
|
-
const ctx =
|
|
4781
|
+
const ctx = React54.useContext(AlertDialogContext);
|
|
4792
4782
|
if (!ctx) throw new Error("AlertDialog parts must be used within <AlertDialog>");
|
|
4793
4783
|
return ctx;
|
|
4794
4784
|
}
|
|
@@ -4798,13 +4788,13 @@ function AlertDialog({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4798
4788
|
defaultValue: defaultOpen,
|
|
4799
4789
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
4800
4790
|
});
|
|
4801
|
-
const triggerRef =
|
|
4802
|
-
return /* @__PURE__ */
|
|
4791
|
+
const triggerRef = React54.useRef(null);
|
|
4792
|
+
return /* @__PURE__ */ jsx45(AlertDialogContext.Provider, { value: { open: isOpen, setOpen, triggerRef }, children });
|
|
4803
4793
|
}
|
|
4804
4794
|
function AlertDialogTrigger({ asChild = false, onClick, ...props }) {
|
|
4805
4795
|
const { open, setOpen, triggerRef } = useAlertDialog();
|
|
4806
4796
|
const Comp = asChild ? Slot : "button";
|
|
4807
|
-
return /* @__PURE__ */
|
|
4797
|
+
return /* @__PURE__ */ jsx45(
|
|
4808
4798
|
Comp,
|
|
4809
4799
|
{
|
|
4810
4800
|
"data-slot": "alert-dialog-trigger",
|
|
@@ -4820,7 +4810,7 @@ function AlertDialogTrigger({ asChild = false, onClick, ...props }) {
|
|
|
4820
4810
|
}
|
|
4821
4811
|
function AlertDialogOverlay({ className, ...props }) {
|
|
4822
4812
|
const { open, setOpen } = useAlertDialog();
|
|
4823
|
-
return /* @__PURE__ */
|
|
4813
|
+
return /* @__PURE__ */ jsx45(
|
|
4824
4814
|
"div",
|
|
4825
4815
|
{
|
|
4826
4816
|
"data-slot": "alert-dialog-overlay",
|
|
@@ -4845,8 +4835,8 @@ function AlertDialogContent({ className, children, ...props }) {
|
|
|
4845
4835
|
});
|
|
4846
4836
|
if (!isPresent) return null;
|
|
4847
4837
|
return /* @__PURE__ */ jsxs15(Portal, { children: [
|
|
4848
|
-
/* @__PURE__ */
|
|
4849
|
-
/* @__PURE__ */
|
|
4838
|
+
/* @__PURE__ */ jsx45(AlertDialogOverlay, {}),
|
|
4839
|
+
/* @__PURE__ */ jsx45(
|
|
4850
4840
|
"div",
|
|
4851
4841
|
{
|
|
4852
4842
|
"data-slot": "alert-dialog-content",
|
|
@@ -4865,7 +4855,7 @@ function AlertDialogContent({ className, children, ...props }) {
|
|
|
4865
4855
|
] });
|
|
4866
4856
|
}
|
|
4867
4857
|
function AlertDialogHeader({ className, ...props }) {
|
|
4868
|
-
return /* @__PURE__ */
|
|
4858
|
+
return /* @__PURE__ */ jsx45(
|
|
4869
4859
|
"div",
|
|
4870
4860
|
{
|
|
4871
4861
|
"data-slot": "alert-dialog-header",
|
|
@@ -4875,7 +4865,7 @@ function AlertDialogHeader({ className, ...props }) {
|
|
|
4875
4865
|
);
|
|
4876
4866
|
}
|
|
4877
4867
|
function AlertDialogFooter({ className, ...props }) {
|
|
4878
|
-
return /* @__PURE__ */
|
|
4868
|
+
return /* @__PURE__ */ jsx45(
|
|
4879
4869
|
"div",
|
|
4880
4870
|
{
|
|
4881
4871
|
"data-slot": "alert-dialog-footer",
|
|
@@ -4885,7 +4875,7 @@ function AlertDialogFooter({ className, ...props }) {
|
|
|
4885
4875
|
);
|
|
4886
4876
|
}
|
|
4887
4877
|
function AlertDialogTitle({ className, ...props }) {
|
|
4888
|
-
return /* @__PURE__ */
|
|
4878
|
+
return /* @__PURE__ */ jsx45(
|
|
4889
4879
|
"h2",
|
|
4890
4880
|
{
|
|
4891
4881
|
"data-slot": "alert-dialog-title",
|
|
@@ -4895,7 +4885,7 @@ function AlertDialogTitle({ className, ...props }) {
|
|
|
4895
4885
|
);
|
|
4896
4886
|
}
|
|
4897
4887
|
function AlertDialogDescription({ className, ...props }) {
|
|
4898
|
-
return /* @__PURE__ */
|
|
4888
|
+
return /* @__PURE__ */ jsx45(
|
|
4899
4889
|
"p",
|
|
4900
4890
|
{
|
|
4901
4891
|
"data-slot": "alert-dialog-description",
|
|
@@ -4906,7 +4896,7 @@ function AlertDialogDescription({ className, ...props }) {
|
|
|
4906
4896
|
}
|
|
4907
4897
|
function AlertDialogAction({ className, onClick, ...props }) {
|
|
4908
4898
|
const { setOpen } = useAlertDialog();
|
|
4909
|
-
return /* @__PURE__ */
|
|
4899
|
+
return /* @__PURE__ */ jsx45(
|
|
4910
4900
|
"button",
|
|
4911
4901
|
{
|
|
4912
4902
|
"data-slot": "alert-dialog-action",
|
|
@@ -4921,7 +4911,7 @@ function AlertDialogAction({ className, onClick, ...props }) {
|
|
|
4921
4911
|
}
|
|
4922
4912
|
function AlertDialogCancel({ className, onClick, ...props }) {
|
|
4923
4913
|
const { setOpen } = useAlertDialog();
|
|
4924
|
-
return /* @__PURE__ */
|
|
4914
|
+
return /* @__PURE__ */ jsx45(
|
|
4925
4915
|
"button",
|
|
4926
4916
|
{
|
|
4927
4917
|
"data-slot": "alert-dialog-cancel",
|
|
@@ -4936,11 +4926,11 @@ function AlertDialogCancel({ className, onClick, ...props }) {
|
|
|
4936
4926
|
}
|
|
4937
4927
|
|
|
4938
4928
|
// src/components/sheet.tsx
|
|
4939
|
-
import * as
|
|
4940
|
-
import { jsx as
|
|
4941
|
-
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);
|
|
4942
4932
|
function useSheet() {
|
|
4943
|
-
const ctx =
|
|
4933
|
+
const ctx = React55.useContext(SheetContext);
|
|
4944
4934
|
if (!ctx) throw new Error("Sheet parts must be used within <Sheet>");
|
|
4945
4935
|
return ctx;
|
|
4946
4936
|
}
|
|
@@ -4950,13 +4940,13 @@ function Sheet({ open, defaultOpen = false, onOpenChange, children }) {
|
|
|
4950
4940
|
defaultValue: defaultOpen,
|
|
4951
4941
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
4952
4942
|
});
|
|
4953
|
-
const triggerRef =
|
|
4954
|
-
return /* @__PURE__ */
|
|
4943
|
+
const triggerRef = React55.useRef(null);
|
|
4944
|
+
return /* @__PURE__ */ jsx46(SheetContext.Provider, { value: { open: isOpen, setOpen, triggerRef }, children });
|
|
4955
4945
|
}
|
|
4956
4946
|
function SheetTrigger({ asChild = false, onClick, ...props }) {
|
|
4957
4947
|
const { open, setOpen, triggerRef } = useSheet();
|
|
4958
4948
|
const Comp = asChild ? Slot : "button";
|
|
4959
|
-
return /* @__PURE__ */
|
|
4949
|
+
return /* @__PURE__ */ jsx46(
|
|
4960
4950
|
Comp,
|
|
4961
4951
|
{
|
|
4962
4952
|
"data-slot": "sheet-trigger",
|
|
@@ -4972,7 +4962,7 @@ function SheetTrigger({ asChild = false, onClick, ...props }) {
|
|
|
4972
4962
|
}
|
|
4973
4963
|
function SheetOverlay({ className, ...props }) {
|
|
4974
4964
|
const { open, setOpen } = useSheet();
|
|
4975
|
-
return /* @__PURE__ */
|
|
4965
|
+
return /* @__PURE__ */ jsx46(
|
|
4976
4966
|
"div",
|
|
4977
4967
|
{
|
|
4978
4968
|
"data-slot": "sheet-overlay",
|
|
@@ -4992,7 +4982,7 @@ var sheetSideClasses = {
|
|
|
4992
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",
|
|
4993
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"
|
|
4994
4984
|
};
|
|
4995
|
-
var XIcon2 = (props) => /* @__PURE__ */
|
|
4985
|
+
var XIcon2 = (props) => /* @__PURE__ */ jsx46(
|
|
4996
4986
|
"svg",
|
|
4997
4987
|
{
|
|
4998
4988
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5005,7 +4995,7 @@ var XIcon2 = (props) => /* @__PURE__ */ jsx45(
|
|
|
5005
4995
|
strokeLinecap: "round",
|
|
5006
4996
|
strokeLinejoin: "round",
|
|
5007
4997
|
...props,
|
|
5008
|
-
children: /* @__PURE__ */
|
|
4998
|
+
children: /* @__PURE__ */ jsx46("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
5009
4999
|
}
|
|
5010
5000
|
);
|
|
5011
5001
|
function SheetContent({ className, children, side = "right", ...props }) {
|
|
@@ -5019,7 +5009,7 @@ function SheetContent({ className, children, side = "right", ...props }) {
|
|
|
5019
5009
|
});
|
|
5020
5010
|
if (!isPresent) return null;
|
|
5021
5011
|
return /* @__PURE__ */ jsxs16(Portal, { children: [
|
|
5022
|
-
/* @__PURE__ */
|
|
5012
|
+
/* @__PURE__ */ jsx46(SheetOverlay, {}),
|
|
5023
5013
|
/* @__PURE__ */ jsxs16(
|
|
5024
5014
|
"div",
|
|
5025
5015
|
{
|
|
@@ -5044,8 +5034,8 @@ function SheetContent({ className, children, side = "right", ...props }) {
|
|
|
5044
5034
|
onClick: () => setOpen(false),
|
|
5045
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",
|
|
5046
5036
|
children: [
|
|
5047
|
-
/* @__PURE__ */
|
|
5048
|
-
/* @__PURE__ */
|
|
5037
|
+
/* @__PURE__ */ jsx46(XIcon2, { className: "size-4" }),
|
|
5038
|
+
/* @__PURE__ */ jsx46("span", { className: "sr-only", children: "Close" })
|
|
5049
5039
|
]
|
|
5050
5040
|
}
|
|
5051
5041
|
)
|
|
@@ -5057,7 +5047,7 @@ function SheetContent({ className, children, side = "right", ...props }) {
|
|
|
5057
5047
|
function SheetClose({ asChild = false, onClick, ...props }) {
|
|
5058
5048
|
const { setOpen } = useSheet();
|
|
5059
5049
|
const Comp = asChild ? Slot : "button";
|
|
5060
|
-
return /* @__PURE__ */
|
|
5050
|
+
return /* @__PURE__ */ jsx46(
|
|
5061
5051
|
Comp,
|
|
5062
5052
|
{
|
|
5063
5053
|
"data-slot": "sheet-close",
|
|
@@ -5070,7 +5060,7 @@ function SheetClose({ asChild = false, onClick, ...props }) {
|
|
|
5070
5060
|
);
|
|
5071
5061
|
}
|
|
5072
5062
|
function SheetHeader({ className, ...props }) {
|
|
5073
|
-
return /* @__PURE__ */
|
|
5063
|
+
return /* @__PURE__ */ jsx46(
|
|
5074
5064
|
"div",
|
|
5075
5065
|
{
|
|
5076
5066
|
"data-slot": "sheet-header",
|
|
@@ -5080,7 +5070,7 @@ function SheetHeader({ className, ...props }) {
|
|
|
5080
5070
|
);
|
|
5081
5071
|
}
|
|
5082
5072
|
function SheetFooter({ className, ...props }) {
|
|
5083
|
-
return /* @__PURE__ */
|
|
5073
|
+
return /* @__PURE__ */ jsx46(
|
|
5084
5074
|
"div",
|
|
5085
5075
|
{
|
|
5086
5076
|
"data-slot": "sheet-footer",
|
|
@@ -5090,7 +5080,7 @@ function SheetFooter({ className, ...props }) {
|
|
|
5090
5080
|
);
|
|
5091
5081
|
}
|
|
5092
5082
|
function SheetTitle({ className, ...props }) {
|
|
5093
|
-
return /* @__PURE__ */
|
|
5083
|
+
return /* @__PURE__ */ jsx46(
|
|
5094
5084
|
"h2",
|
|
5095
5085
|
{
|
|
5096
5086
|
"data-slot": "sheet-title",
|
|
@@ -5100,7 +5090,7 @@ function SheetTitle({ className, ...props }) {
|
|
|
5100
5090
|
);
|
|
5101
5091
|
}
|
|
5102
5092
|
function SheetDescription({ className, ...props }) {
|
|
5103
|
-
return /* @__PURE__ */
|
|
5093
|
+
return /* @__PURE__ */ jsx46(
|
|
5104
5094
|
"p",
|
|
5105
5095
|
{
|
|
5106
5096
|
"data-slot": "sheet-description",
|
|
@@ -5111,11 +5101,11 @@ function SheetDescription({ className, ...props }) {
|
|
|
5111
5101
|
}
|
|
5112
5102
|
|
|
5113
5103
|
// src/components/drawer.tsx
|
|
5114
|
-
import * as
|
|
5115
|
-
import { jsx as
|
|
5116
|
-
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);
|
|
5117
5107
|
function useDrawer() {
|
|
5118
|
-
const ctx =
|
|
5108
|
+
const ctx = React56.useContext(DrawerContext);
|
|
5119
5109
|
if (!ctx) throw new Error("Drawer parts must be used within <Drawer>");
|
|
5120
5110
|
return ctx;
|
|
5121
5111
|
}
|
|
@@ -5137,12 +5127,12 @@ function Drawer({
|
|
|
5137
5127
|
defaultValue: defaultOpen,
|
|
5138
5128
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
5139
5129
|
});
|
|
5140
|
-
return /* @__PURE__ */
|
|
5130
|
+
return /* @__PURE__ */ jsx47(DrawerContext.Provider, { value: { open: isOpen, setOpen, direction }, children: /* @__PURE__ */ jsx47("div", { "data-slot": "drawer", children }) });
|
|
5141
5131
|
}
|
|
5142
5132
|
function DrawerTrigger({ asChild = false, onClick, ...props }) {
|
|
5143
5133
|
const { setOpen } = useDrawer();
|
|
5144
5134
|
const Comp = asChild ? Slot : "button";
|
|
5145
|
-
return /* @__PURE__ */
|
|
5135
|
+
return /* @__PURE__ */ jsx47(
|
|
5146
5136
|
Comp,
|
|
5147
5137
|
{
|
|
5148
5138
|
"data-slot": "drawer-trigger",
|
|
@@ -5157,7 +5147,7 @@ function DrawerTrigger({ asChild = false, onClick, ...props }) {
|
|
|
5157
5147
|
function DrawerClose({ asChild = false, onClick, ...props }) {
|
|
5158
5148
|
const { setOpen } = useDrawer();
|
|
5159
5149
|
const Comp = asChild ? Slot : "button";
|
|
5160
|
-
return /* @__PURE__ */
|
|
5150
|
+
return /* @__PURE__ */ jsx47(
|
|
5161
5151
|
Comp,
|
|
5162
5152
|
{
|
|
5163
5153
|
"data-slot": "drawer-close",
|
|
@@ -5172,7 +5162,7 @@ function DrawerClose({ asChild = false, onClick, ...props }) {
|
|
|
5172
5162
|
function DrawerOverlay({ className, ...props }) {
|
|
5173
5163
|
const { open, setOpen } = useDrawer();
|
|
5174
5164
|
if (!open) return null;
|
|
5175
|
-
return /* @__PURE__ */
|
|
5165
|
+
return /* @__PURE__ */ jsx47(
|
|
5176
5166
|
"div",
|
|
5177
5167
|
{
|
|
5178
5168
|
"data-slot": "drawer-overlay",
|
|
@@ -5188,7 +5178,7 @@ function DrawerContent({ className, children, ...props }) {
|
|
|
5188
5178
|
const scopeRef = useFocusScope(open);
|
|
5189
5179
|
if (!open) return null;
|
|
5190
5180
|
return /* @__PURE__ */ jsxs17(Portal, { children: [
|
|
5191
|
-
/* @__PURE__ */
|
|
5181
|
+
/* @__PURE__ */ jsx47(
|
|
5192
5182
|
"div",
|
|
5193
5183
|
{
|
|
5194
5184
|
"data-slot": "drawer-overlay",
|
|
@@ -5215,7 +5205,7 @@ function DrawerContent({ className, children, ...props }) {
|
|
|
5215
5205
|
),
|
|
5216
5206
|
...props,
|
|
5217
5207
|
children: [
|
|
5218
|
-
direction === "bottom" ? /* @__PURE__ */
|
|
5208
|
+
direction === "bottom" ? /* @__PURE__ */ jsx47(
|
|
5219
5209
|
"div",
|
|
5220
5210
|
{
|
|
5221
5211
|
"data-slot": "drawer-handle",
|
|
@@ -5229,7 +5219,7 @@ function DrawerContent({ className, children, ...props }) {
|
|
|
5229
5219
|
] });
|
|
5230
5220
|
}
|
|
5231
5221
|
function DrawerHeader({ className, ...props }) {
|
|
5232
|
-
return /* @__PURE__ */
|
|
5222
|
+
return /* @__PURE__ */ jsx47(
|
|
5233
5223
|
"div",
|
|
5234
5224
|
{
|
|
5235
5225
|
"data-slot": "drawer-header",
|
|
@@ -5239,7 +5229,7 @@ function DrawerHeader({ className, ...props }) {
|
|
|
5239
5229
|
);
|
|
5240
5230
|
}
|
|
5241
5231
|
function DrawerFooter({ className, ...props }) {
|
|
5242
|
-
return /* @__PURE__ */
|
|
5232
|
+
return /* @__PURE__ */ jsx47(
|
|
5243
5233
|
"div",
|
|
5244
5234
|
{
|
|
5245
5235
|
"data-slot": "drawer-footer",
|
|
@@ -5249,7 +5239,7 @@ function DrawerFooter({ className, ...props }) {
|
|
|
5249
5239
|
);
|
|
5250
5240
|
}
|
|
5251
5241
|
function DrawerTitle({ className, ...props }) {
|
|
5252
|
-
return /* @__PURE__ */
|
|
5242
|
+
return /* @__PURE__ */ jsx47(
|
|
5253
5243
|
"div",
|
|
5254
5244
|
{
|
|
5255
5245
|
"data-slot": "drawer-title",
|
|
@@ -5259,7 +5249,7 @@ function DrawerTitle({ className, ...props }) {
|
|
|
5259
5249
|
);
|
|
5260
5250
|
}
|
|
5261
5251
|
function DrawerDescription({ className, ...props }) {
|
|
5262
|
-
return /* @__PURE__ */
|
|
5252
|
+
return /* @__PURE__ */ jsx47(
|
|
5263
5253
|
"div",
|
|
5264
5254
|
{
|
|
5265
5255
|
"data-slot": "drawer-description",
|
|
@@ -5270,11 +5260,11 @@ function DrawerDescription({ className, ...props }) {
|
|
|
5270
5260
|
}
|
|
5271
5261
|
|
|
5272
5262
|
// src/components/select.tsx
|
|
5273
|
-
import * as
|
|
5274
|
-
import { jsx as
|
|
5275
|
-
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);
|
|
5276
5266
|
function useSelect() {
|
|
5277
|
-
const ctx =
|
|
5267
|
+
const ctx = React57.useContext(SelectContext);
|
|
5278
5268
|
if (!ctx) throw new Error("Select parts must be used within <Select>");
|
|
5279
5269
|
return ctx;
|
|
5280
5270
|
}
|
|
@@ -5297,8 +5287,8 @@ function Select({
|
|
|
5297
5287
|
defaultValue: defaultOpen,
|
|
5298
5288
|
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
5299
5289
|
});
|
|
5300
|
-
const anchorRef =
|
|
5301
|
-
return /* @__PURE__ */
|
|
5290
|
+
const anchorRef = React57.useRef(null);
|
|
5291
|
+
return /* @__PURE__ */ jsx48(
|
|
5302
5292
|
SelectContext.Provider,
|
|
5303
5293
|
{
|
|
5304
5294
|
value: { value: currentValue, setValue, open: isOpen, setOpen, anchorRef },
|
|
@@ -5335,7 +5325,7 @@ function SelectTrigger({
|
|
|
5335
5325
|
...props,
|
|
5336
5326
|
children: [
|
|
5337
5327
|
children,
|
|
5338
|
-
/* @__PURE__ */
|
|
5328
|
+
/* @__PURE__ */ jsx48(
|
|
5339
5329
|
"svg",
|
|
5340
5330
|
{
|
|
5341
5331
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5349,7 +5339,7 @@ function SelectTrigger({
|
|
|
5349
5339
|
strokeLinejoin: "round",
|
|
5350
5340
|
className: "size-4 opacity-50",
|
|
5351
5341
|
"aria-hidden": "true",
|
|
5352
|
-
children: /* @__PURE__ */
|
|
5342
|
+
children: /* @__PURE__ */ jsx48("path", { d: "m6 9 6 6 6-6" })
|
|
5353
5343
|
}
|
|
5354
5344
|
)
|
|
5355
5345
|
]
|
|
@@ -5359,7 +5349,7 @@ function SelectTrigger({
|
|
|
5359
5349
|
function SelectValue({ className, placeholder, ...props }) {
|
|
5360
5350
|
const { value } = useSelect();
|
|
5361
5351
|
const isEmpty = value === "";
|
|
5362
|
-
return /* @__PURE__ */
|
|
5352
|
+
return /* @__PURE__ */ jsx48(
|
|
5363
5353
|
"span",
|
|
5364
5354
|
{
|
|
5365
5355
|
"data-slot": "select-value",
|
|
@@ -5392,13 +5382,13 @@ function SelectContent({
|
|
|
5392
5382
|
onDismiss: () => setOpen(false),
|
|
5393
5383
|
exclude: [anchorRef]
|
|
5394
5384
|
});
|
|
5395
|
-
const items =
|
|
5385
|
+
const items = React57.Children.toArray(children).filter(React57.isValidElement);
|
|
5396
5386
|
const { activeIndex, setActiveIndex, onKeyDown } = useRovingFocus({
|
|
5397
5387
|
count: items.length,
|
|
5398
5388
|
orientation: "vertical"
|
|
5399
5389
|
});
|
|
5400
5390
|
if (!isPresent) return null;
|
|
5401
|
-
return /* @__PURE__ */
|
|
5391
|
+
return /* @__PURE__ */ jsx48(Portal, { children: /* @__PURE__ */ jsx48(
|
|
5402
5392
|
"div",
|
|
5403
5393
|
{
|
|
5404
5394
|
role: "listbox",
|
|
@@ -5414,8 +5404,8 @@ function SelectContent({
|
|
|
5414
5404
|
className
|
|
5415
5405
|
),
|
|
5416
5406
|
...props,
|
|
5417
|
-
children: /* @__PURE__ */
|
|
5418
|
-
(child, index) =>
|
|
5407
|
+
children: /* @__PURE__ */ jsx48("div", { className: "p-1", children: items.map(
|
|
5408
|
+
(child, index) => React57.cloneElement(child, {
|
|
5419
5409
|
__index: index,
|
|
5420
5410
|
__active: index === activeIndex,
|
|
5421
5411
|
__setActive: setActiveIndex
|
|
@@ -5460,7 +5450,7 @@ function SelectItem({
|
|
|
5460
5450
|
),
|
|
5461
5451
|
...props,
|
|
5462
5452
|
children: [
|
|
5463
|
-
selected ? /* @__PURE__ */
|
|
5453
|
+
selected ? /* @__PURE__ */ jsx48("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx48(
|
|
5464
5454
|
"svg",
|
|
5465
5455
|
{
|
|
5466
5456
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5474,19 +5464,19 @@ function SelectItem({
|
|
|
5474
5464
|
strokeLinejoin: "round",
|
|
5475
5465
|
className: "size-4",
|
|
5476
5466
|
"aria-hidden": "true",
|
|
5477
|
-
children: /* @__PURE__ */
|
|
5467
|
+
children: /* @__PURE__ */ jsx48("path", { d: "M20 6 9 17l-5-5" })
|
|
5478
5468
|
}
|
|
5479
5469
|
) }) : null,
|
|
5480
|
-
/* @__PURE__ */
|
|
5470
|
+
/* @__PURE__ */ jsx48("span", { children })
|
|
5481
5471
|
]
|
|
5482
5472
|
}
|
|
5483
5473
|
);
|
|
5484
5474
|
}
|
|
5485
5475
|
function SelectGroup({ className, ...props }) {
|
|
5486
|
-
return /* @__PURE__ */
|
|
5476
|
+
return /* @__PURE__ */ jsx48("div", { role: "group", "data-slot": "select-group", className, ...props });
|
|
5487
5477
|
}
|
|
5488
5478
|
function SelectLabel({ className, ...props }) {
|
|
5489
|
-
return /* @__PURE__ */
|
|
5479
|
+
return /* @__PURE__ */ jsx48(
|
|
5490
5480
|
"div",
|
|
5491
5481
|
{
|
|
5492
5482
|
"data-slot": "select-label",
|
|
@@ -5496,7 +5486,7 @@ function SelectLabel({ className, ...props }) {
|
|
|
5496
5486
|
);
|
|
5497
5487
|
}
|
|
5498
5488
|
function SelectSeparator({ className, ...props }) {
|
|
5499
|
-
return /* @__PURE__ */
|
|
5489
|
+
return /* @__PURE__ */ jsx48(
|
|
5500
5490
|
"div",
|
|
5501
5491
|
{
|
|
5502
5492
|
"data-slot": "select-separator",
|
|
@@ -5507,11 +5497,11 @@ function SelectSeparator({ className, ...props }) {
|
|
|
5507
5497
|
}
|
|
5508
5498
|
|
|
5509
5499
|
// src/components/command.tsx
|
|
5510
|
-
import * as
|
|
5511
|
-
import { jsx as
|
|
5512
|
-
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);
|
|
5513
5503
|
function useCommand() {
|
|
5514
|
-
const ctx =
|
|
5504
|
+
const ctx = React58.useContext(CommandContext);
|
|
5515
5505
|
if (!ctx) throw new Error("Command parts must be used within <Command>");
|
|
5516
5506
|
return ctx;
|
|
5517
5507
|
}
|
|
@@ -5528,7 +5518,7 @@ function Command({
|
|
|
5528
5518
|
defaultValue: defaultSearch,
|
|
5529
5519
|
...onSearchChange ? { onChange: onSearchChange } : {}
|
|
5530
5520
|
});
|
|
5531
|
-
return /* @__PURE__ */
|
|
5521
|
+
return /* @__PURE__ */ jsx49(CommandContext.Provider, { value: { search: currentSearch, setSearch }, children: /* @__PURE__ */ jsx49(
|
|
5532
5522
|
"div",
|
|
5533
5523
|
{
|
|
5534
5524
|
"data-slot": "command",
|
|
@@ -5556,7 +5546,7 @@ function CommandDialog({
|
|
|
5556
5546
|
const scopeRef = useFocusScope(isOpen);
|
|
5557
5547
|
if (!isOpen) return null;
|
|
5558
5548
|
return /* @__PURE__ */ jsxs19(Portal, { children: [
|
|
5559
|
-
/* @__PURE__ */
|
|
5549
|
+
/* @__PURE__ */ jsx49(
|
|
5560
5550
|
"div",
|
|
5561
5551
|
{
|
|
5562
5552
|
"data-slot": "command-overlay",
|
|
@@ -5564,7 +5554,7 @@ function CommandDialog({
|
|
|
5564
5554
|
onClick: () => setOpen(false)
|
|
5565
5555
|
}
|
|
5566
5556
|
),
|
|
5567
|
-
/* @__PURE__ */
|
|
5557
|
+
/* @__PURE__ */ jsx49(
|
|
5568
5558
|
"div",
|
|
5569
5559
|
{
|
|
5570
5560
|
role: "dialog",
|
|
@@ -5578,7 +5568,7 @@ function CommandDialog({
|
|
|
5578
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",
|
|
5579
5569
|
className
|
|
5580
5570
|
),
|
|
5581
|
-
children: /* @__PURE__ */
|
|
5571
|
+
children: /* @__PURE__ */ jsx49(Command, { className: "[&_[data-slot=command-input-wrapper]]:h-12 [&_[data-slot=command-input]]:h-12", children })
|
|
5582
5572
|
}
|
|
5583
5573
|
)
|
|
5584
5574
|
] });
|
|
@@ -5604,12 +5594,12 @@ function CommandInput({
|
|
|
5604
5594
|
className: "size-4 shrink-0 opacity-50",
|
|
5605
5595
|
"aria-hidden": "true",
|
|
5606
5596
|
children: [
|
|
5607
|
-
/* @__PURE__ */
|
|
5608
|
-
/* @__PURE__ */
|
|
5597
|
+
/* @__PURE__ */ jsx49("circle", { cx: "11", cy: "11", r: "8" }),
|
|
5598
|
+
/* @__PURE__ */ jsx49("path", { d: "m21 21-4.3-4.3" })
|
|
5609
5599
|
]
|
|
5610
5600
|
}
|
|
5611
5601
|
),
|
|
5612
|
-
/* @__PURE__ */
|
|
5602
|
+
/* @__PURE__ */ jsx49(
|
|
5613
5603
|
"input",
|
|
5614
5604
|
{
|
|
5615
5605
|
type: "text",
|
|
@@ -5627,7 +5617,7 @@ function CommandInput({
|
|
|
5627
5617
|
] });
|
|
5628
5618
|
}
|
|
5629
5619
|
function CommandList({ className, ...props }) {
|
|
5630
|
-
return /* @__PURE__ */
|
|
5620
|
+
return /* @__PURE__ */ jsx49(
|
|
5631
5621
|
"div",
|
|
5632
5622
|
{
|
|
5633
5623
|
role: "listbox",
|
|
@@ -5641,7 +5631,7 @@ function CommandEmpty({ className, children, ...props }) {
|
|
|
5641
5631
|
const { search } = useCommand();
|
|
5642
5632
|
const hasQuery = search.trim() !== "";
|
|
5643
5633
|
if (!hasQuery) return null;
|
|
5644
|
-
return /* @__PURE__ */
|
|
5634
|
+
return /* @__PURE__ */ jsx49(
|
|
5645
5635
|
"div",
|
|
5646
5636
|
{
|
|
5647
5637
|
"data-slot": "command-empty",
|
|
@@ -5663,7 +5653,7 @@ function CommandGroup({ className, heading, children, ...props }) {
|
|
|
5663
5653
|
),
|
|
5664
5654
|
...props,
|
|
5665
5655
|
children: [
|
|
5666
|
-
heading ? /* @__PURE__ */
|
|
5656
|
+
heading ? /* @__PURE__ */ jsx49("div", { "data-slot": "command-group-heading", children: heading }) : null,
|
|
5667
5657
|
children
|
|
5668
5658
|
]
|
|
5669
5659
|
}
|
|
@@ -5680,7 +5670,7 @@ function CommandItem({
|
|
|
5680
5670
|
const { search } = useCommand();
|
|
5681
5671
|
const query = search.toLowerCase();
|
|
5682
5672
|
if (query !== "" && !value.toLowerCase().includes(query)) return null;
|
|
5683
|
-
return /* @__PURE__ */
|
|
5673
|
+
return /* @__PURE__ */ jsx49(
|
|
5684
5674
|
"div",
|
|
5685
5675
|
{
|
|
5686
5676
|
role: "option",
|
|
@@ -5701,7 +5691,7 @@ function CommandItem({
|
|
|
5701
5691
|
);
|
|
5702
5692
|
}
|
|
5703
5693
|
function CommandSeparator({ className, ...props }) {
|
|
5704
|
-
return /* @__PURE__ */
|
|
5694
|
+
return /* @__PURE__ */ jsx49(
|
|
5705
5695
|
"div",
|
|
5706
5696
|
{
|
|
5707
5697
|
"data-slot": "command-separator",
|
|
@@ -5711,7 +5701,7 @@ function CommandSeparator({ className, ...props }) {
|
|
|
5711
5701
|
);
|
|
5712
5702
|
}
|
|
5713
5703
|
function CommandShortcut({ className, ...props }) {
|
|
5714
|
-
return /* @__PURE__ */
|
|
5704
|
+
return /* @__PURE__ */ jsx49(
|
|
5715
5705
|
"span",
|
|
5716
5706
|
{
|
|
5717
5707
|
"data-slot": "command-shortcut",
|
|
@@ -5722,11 +5712,11 @@ function CommandShortcut({ className, ...props }) {
|
|
|
5722
5712
|
}
|
|
5723
5713
|
|
|
5724
5714
|
// src/components/chart.tsx
|
|
5725
|
-
import * as
|
|
5726
|
-
import { Fragment as Fragment3, jsx as
|
|
5727
|
-
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);
|
|
5728
5718
|
function useChart() {
|
|
5729
|
-
const context =
|
|
5719
|
+
const context = React59.useContext(ChartContext);
|
|
5730
5720
|
if (!context) {
|
|
5731
5721
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
5732
5722
|
}
|
|
@@ -5739,9 +5729,9 @@ function ChartContainer({
|
|
|
5739
5729
|
config,
|
|
5740
5730
|
...props
|
|
5741
5731
|
}) {
|
|
5742
|
-
const uniqueId =
|
|
5732
|
+
const uniqueId = React59.useId();
|
|
5743
5733
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
5744
|
-
return /* @__PURE__ */
|
|
5734
|
+
return /* @__PURE__ */ jsx50(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs20(
|
|
5745
5735
|
"div",
|
|
5746
5736
|
{
|
|
5747
5737
|
"data-slot": "chart",
|
|
@@ -5752,7 +5742,7 @@ function ChartContainer({
|
|
|
5752
5742
|
),
|
|
5753
5743
|
...props,
|
|
5754
5744
|
children: [
|
|
5755
|
-
/* @__PURE__ */
|
|
5745
|
+
/* @__PURE__ */ jsx50(ChartStyle, { id: chartId, config }),
|
|
5756
5746
|
children
|
|
5757
5747
|
]
|
|
5758
5748
|
}
|
|
@@ -5763,7 +5753,7 @@ var ChartStyle = ({ id, config }) => {
|
|
|
5763
5753
|
if (!colorConfig.length) {
|
|
5764
5754
|
return null;
|
|
5765
5755
|
}
|
|
5766
|
-
return /* @__PURE__ */
|
|
5756
|
+
return /* @__PURE__ */ jsx50(
|
|
5767
5757
|
"style",
|
|
5768
5758
|
{
|
|
5769
5759
|
dangerouslySetInnerHTML: {
|
|
@@ -5774,7 +5764,7 @@ ${colorConfig.map(([key, itemConfig]) => ` --color-${key}: ${itemConfig.color};
|
|
|
5774
5764
|
}
|
|
5775
5765
|
);
|
|
5776
5766
|
};
|
|
5777
|
-
var ChartTooltip = ({ children }) => /* @__PURE__ */
|
|
5767
|
+
var ChartTooltip = ({ children }) => /* @__PURE__ */ jsx50(Fragment3, { children });
|
|
5778
5768
|
function ChartTooltipContent({
|
|
5779
5769
|
className,
|
|
5780
5770
|
items = [],
|
|
@@ -5796,15 +5786,15 @@ function ChartTooltipContent({
|
|
|
5796
5786
|
className
|
|
5797
5787
|
),
|
|
5798
5788
|
children: [
|
|
5799
|
-
!hideLabel && label ? /* @__PURE__ */
|
|
5800
|
-
/* @__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(
|
|
5801
5791
|
"div",
|
|
5802
5792
|
{
|
|
5803
5793
|
className: cn(
|
|
5804
5794
|
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 items-center"
|
|
5805
5795
|
),
|
|
5806
5796
|
children: [
|
|
5807
|
-
!hideIndicator && /* @__PURE__ */
|
|
5797
|
+
!hideIndicator && /* @__PURE__ */ jsx50(
|
|
5808
5798
|
"div",
|
|
5809
5799
|
{
|
|
5810
5800
|
className: "shrink-0 rounded-[2px] h-2.5 w-2.5",
|
|
@@ -5815,8 +5805,8 @@ function ChartTooltipContent({
|
|
|
5815
5805
|
}
|
|
5816
5806
|
),
|
|
5817
5807
|
/* @__PURE__ */ jsxs20("div", { className: "flex flex-1 justify-between leading-none items-center", children: [
|
|
5818
|
-
/* @__PURE__ */
|
|
5819
|
-
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 })
|
|
5820
5810
|
] })
|
|
5821
5811
|
]
|
|
5822
5812
|
},
|
|
@@ -5826,7 +5816,7 @@ function ChartTooltipContent({
|
|
|
5826
5816
|
}
|
|
5827
5817
|
);
|
|
5828
5818
|
}
|
|
5829
|
-
var ChartLegend = ({ children }) => /* @__PURE__ */
|
|
5819
|
+
var ChartLegend = ({ children }) => /* @__PURE__ */ jsx50(Fragment3, { children });
|
|
5830
5820
|
function ChartLegendContent({
|
|
5831
5821
|
className,
|
|
5832
5822
|
hideIcon = false,
|
|
@@ -5840,7 +5830,7 @@ function ChartLegendContent({
|
|
|
5840
5830
|
if (!rows.length) {
|
|
5841
5831
|
return null;
|
|
5842
5832
|
}
|
|
5843
|
-
return /* @__PURE__ */
|
|
5833
|
+
return /* @__PURE__ */ jsx50(
|
|
5844
5834
|
"div",
|
|
5845
5835
|
{
|
|
5846
5836
|
"data-slot": "chart-legend",
|
|
@@ -5852,7 +5842,7 @@ function ChartLegendContent({
|
|
|
5852
5842
|
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
|
|
5853
5843
|
),
|
|
5854
5844
|
children: [
|
|
5855
|
-
!hideIcon && /* @__PURE__ */
|
|
5845
|
+
!hideIcon && /* @__PURE__ */ jsx50(
|
|
5856
5846
|
"div",
|
|
5857
5847
|
{
|
|
5858
5848
|
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
@@ -5869,8 +5859,8 @@ function ChartLegendContent({
|
|
|
5869
5859
|
}
|
|
5870
5860
|
|
|
5871
5861
|
// src/components/calendar.tsx
|
|
5872
|
-
import * as
|
|
5873
|
-
import { jsx as
|
|
5862
|
+
import * as React60 from "react";
|
|
5863
|
+
import { jsx as jsx51, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5874
5864
|
var MONTHS = [
|
|
5875
5865
|
"January",
|
|
5876
5866
|
"February",
|
|
@@ -5889,7 +5879,7 @@ var WEEKDAYS = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
|
|
|
5889
5879
|
var CHEVRON_LEFT = "m15 18-6-6 6-6";
|
|
5890
5880
|
var CHEVRON_RIGHT = "m9 18 6-6-6-6";
|
|
5891
5881
|
function Chevron({ d }) {
|
|
5892
|
-
return /* @__PURE__ */
|
|
5882
|
+
return /* @__PURE__ */ jsx51(
|
|
5893
5883
|
"svg",
|
|
5894
5884
|
{
|
|
5895
5885
|
className: "size-4",
|
|
@@ -5903,7 +5893,7 @@ function Chevron({ d }) {
|
|
|
5903
5893
|
strokeLinecap: "round",
|
|
5904
5894
|
strokeLinejoin: "round",
|
|
5905
5895
|
"aria-hidden": true,
|
|
5906
|
-
children: /* @__PURE__ */
|
|
5896
|
+
children: /* @__PURE__ */ jsx51("path", { d })
|
|
5907
5897
|
}
|
|
5908
5898
|
);
|
|
5909
5899
|
}
|
|
@@ -5925,7 +5915,7 @@ function Calendar({
|
|
|
5925
5915
|
today = /* @__PURE__ */ new Date(),
|
|
5926
5916
|
className
|
|
5927
5917
|
}) {
|
|
5928
|
-
const [internal, setInternal] =
|
|
5918
|
+
const [internal, setInternal] = React60.useState(
|
|
5929
5919
|
() => startOfMonth(defaultMonth ?? /* @__PURE__ */ new Date())
|
|
5930
5920
|
);
|
|
5931
5921
|
const view = month ? startOfMonth(month) : internal;
|
|
@@ -5958,30 +5948,30 @@ function Calendar({
|
|
|
5958
5948
|
className: cn("bg-background p-3 w-fit", className),
|
|
5959
5949
|
children: [
|
|
5960
5950
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between gap-1 w-full px-1", children: [
|
|
5961
|
-
/* @__PURE__ */
|
|
5951
|
+
/* @__PURE__ */ jsx51(
|
|
5962
5952
|
"button",
|
|
5963
5953
|
{
|
|
5964
5954
|
type: "button",
|
|
5965
5955
|
className: navClass,
|
|
5966
5956
|
"aria-label": "Previous month",
|
|
5967
5957
|
onClick: () => go(-1),
|
|
5968
|
-
children: /* @__PURE__ */
|
|
5958
|
+
children: /* @__PURE__ */ jsx51(Chevron, { d: CHEVRON_LEFT })
|
|
5969
5959
|
}
|
|
5970
5960
|
),
|
|
5971
|
-
/* @__PURE__ */
|
|
5972
|
-
/* @__PURE__ */
|
|
5961
|
+
/* @__PURE__ */ jsx51("div", { className: "text-sm font-medium select-none", children: caption }),
|
|
5962
|
+
/* @__PURE__ */ jsx51(
|
|
5973
5963
|
"button",
|
|
5974
5964
|
{
|
|
5975
5965
|
type: "button",
|
|
5976
5966
|
className: navClass,
|
|
5977
5967
|
"aria-label": "Next month",
|
|
5978
5968
|
onClick: () => go(1),
|
|
5979
|
-
children: /* @__PURE__ */
|
|
5969
|
+
children: /* @__PURE__ */ jsx51(Chevron, { d: CHEVRON_RIGHT })
|
|
5980
5970
|
}
|
|
5981
5971
|
)
|
|
5982
5972
|
] }),
|
|
5983
5973
|
/* @__PURE__ */ jsxs21("table", { className: "w-full border-collapse mt-4", role: "grid", children: [
|
|
5984
|
-
/* @__PURE__ */
|
|
5974
|
+
/* @__PURE__ */ jsx51("thead", { children: /* @__PURE__ */ jsx51("tr", { className: "flex", children: WEEKDAYS.map((wd) => /* @__PURE__ */ jsx51(
|
|
5985
5975
|
"th",
|
|
5986
5976
|
{
|
|
5987
5977
|
scope: "col",
|
|
@@ -5990,9 +5980,9 @@ function Calendar({
|
|
|
5990
5980
|
},
|
|
5991
5981
|
wd
|
|
5992
5982
|
)) }) }),
|
|
5993
|
-
/* @__PURE__ */
|
|
5983
|
+
/* @__PURE__ */ jsx51("tbody", { children: weeks.map((week, wi) => /* @__PURE__ */ jsx51("tr", { className: "flex w-full mt-2", children: week.map((cell, ci) => {
|
|
5994
5984
|
if (cell === null) {
|
|
5995
|
-
return /* @__PURE__ */
|
|
5985
|
+
return /* @__PURE__ */ jsx51(
|
|
5996
5986
|
"td",
|
|
5997
5987
|
{
|
|
5998
5988
|
className: "relative w-full h-full p-0 aspect-square select-none"
|
|
@@ -6003,13 +5993,13 @@ function Calendar({
|
|
|
6003
5993
|
const date = new Date(year, monthIndex, cell);
|
|
6004
5994
|
const isSelected = sameDay(selected, date);
|
|
6005
5995
|
const isToday = sameDay(today, date);
|
|
6006
|
-
return /* @__PURE__ */
|
|
5996
|
+
return /* @__PURE__ */ jsx51(
|
|
6007
5997
|
"td",
|
|
6008
5998
|
{
|
|
6009
5999
|
role: "gridcell",
|
|
6010
6000
|
"aria-selected": isSelected,
|
|
6011
6001
|
className: "relative w-full h-full p-0 text-center aspect-square select-none",
|
|
6012
|
-
children: /* @__PURE__ */
|
|
6002
|
+
children: /* @__PURE__ */ jsx51(
|
|
6013
6003
|
"button",
|
|
6014
6004
|
{
|
|
6015
6005
|
type: "button",
|
|
@@ -6039,8 +6029,8 @@ function Calendar({
|
|
|
6039
6029
|
}
|
|
6040
6030
|
|
|
6041
6031
|
// src/components/sonner.tsx
|
|
6042
|
-
import * as
|
|
6043
|
-
import { jsx as
|
|
6032
|
+
import * as React61 from "react";
|
|
6033
|
+
import { jsx as jsx52, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6044
6034
|
var DEFAULT_DURATION = 4e3;
|
|
6045
6035
|
var store = /* @__PURE__ */ (() => {
|
|
6046
6036
|
let toasts = [];
|
|
@@ -6100,7 +6090,7 @@ var positionClasses = {
|
|
|
6100
6090
|
"bottom-right": "bottom-0 right-0 items-end"
|
|
6101
6091
|
};
|
|
6102
6092
|
function ToastItem({ toast: t }) {
|
|
6103
|
-
|
|
6093
|
+
React61.useEffect(() => {
|
|
6104
6094
|
if (t.duration === Infinity) return;
|
|
6105
6095
|
const timer = setTimeout(() => store.dismiss(t.id), t.duration);
|
|
6106
6096
|
return () => clearTimeout(timer);
|
|
@@ -6118,10 +6108,10 @@ function ToastItem({ toast: t }) {
|
|
|
6118
6108
|
),
|
|
6119
6109
|
children: [
|
|
6120
6110
|
/* @__PURE__ */ jsxs22("div", { className: "flex-1 space-y-1", children: [
|
|
6121
|
-
/* @__PURE__ */
|
|
6122
|
-
t.description ? /* @__PURE__ */
|
|
6111
|
+
/* @__PURE__ */ jsx52("div", { className: "font-medium", children: t.message }),
|
|
6112
|
+
t.description ? /* @__PURE__ */ jsx52("div", { className: "text-muted-foreground text-sm", children: t.description }) : null
|
|
6123
6113
|
] }),
|
|
6124
|
-
/* @__PURE__ */
|
|
6114
|
+
/* @__PURE__ */ jsx52(
|
|
6125
6115
|
"button",
|
|
6126
6116
|
{
|
|
6127
6117
|
type: "button",
|
|
@@ -6129,7 +6119,7 @@ function ToastItem({ toast: t }) {
|
|
|
6129
6119
|
"data-slot": "toast-close",
|
|
6130
6120
|
onClick: () => store.dismiss(t.id),
|
|
6131
6121
|
className: "text-foreground/50 hover:text-foreground shrink-0 transition-colors",
|
|
6132
|
-
children: /* @__PURE__ */
|
|
6122
|
+
children: /* @__PURE__ */ jsx52(
|
|
6133
6123
|
"svg",
|
|
6134
6124
|
{
|
|
6135
6125
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6142,7 +6132,7 @@ function ToastItem({ toast: t }) {
|
|
|
6142
6132
|
strokeLinecap: "round",
|
|
6143
6133
|
strokeLinejoin: "round",
|
|
6144
6134
|
"aria-hidden": "true",
|
|
6145
|
-
children: /* @__PURE__ */
|
|
6135
|
+
children: /* @__PURE__ */ jsx52("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
6146
6136
|
}
|
|
6147
6137
|
)
|
|
6148
6138
|
}
|
|
@@ -6156,9 +6146,9 @@ function Toaster({
|
|
|
6156
6146
|
className,
|
|
6157
6147
|
...props
|
|
6158
6148
|
}) {
|
|
6159
|
-
const [toasts, setToasts] =
|
|
6160
|
-
|
|
6161
|
-
return /* @__PURE__ */
|
|
6149
|
+
const [toasts, setToasts] = React61.useState([]);
|
|
6150
|
+
React61.useEffect(() => store.subscribe(setToasts), []);
|
|
6151
|
+
return /* @__PURE__ */ jsx52(
|
|
6162
6152
|
"ol",
|
|
6163
6153
|
{
|
|
6164
6154
|
"data-slot": "toaster",
|
|
@@ -6169,28 +6159,28 @@ function Toaster({
|
|
|
6169
6159
|
className
|
|
6170
6160
|
),
|
|
6171
6161
|
...props,
|
|
6172
|
-
children: toasts.map((t) => /* @__PURE__ */
|
|
6162
|
+
children: toasts.map((t) => /* @__PURE__ */ jsx52(ToastItem, { toast: t }, t.id))
|
|
6173
6163
|
}
|
|
6174
6164
|
);
|
|
6175
6165
|
}
|
|
6176
6166
|
|
|
6177
6167
|
// src/components/form.tsx
|
|
6178
|
-
import * as
|
|
6179
|
-
import { jsx as
|
|
6180
|
-
var FormItemContext =
|
|
6168
|
+
import * as React62 from "react";
|
|
6169
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
6170
|
+
var FormItemContext = React62.createContext(null);
|
|
6181
6171
|
function useFormItem() {
|
|
6182
|
-
const ctx =
|
|
6172
|
+
const ctx = React62.useContext(FormItemContext);
|
|
6183
6173
|
if (!ctx) {
|
|
6184
6174
|
throw new Error("Form parts must be used within <FormItem>");
|
|
6185
6175
|
}
|
|
6186
6176
|
return ctx;
|
|
6187
6177
|
}
|
|
6188
6178
|
function Form({ ...props }) {
|
|
6189
|
-
return /* @__PURE__ */
|
|
6179
|
+
return /* @__PURE__ */ jsx53("form", { "data-slot": "form", ...props });
|
|
6190
6180
|
}
|
|
6191
6181
|
function FormItem({ className, ...props }) {
|
|
6192
|
-
const id =
|
|
6193
|
-
const value =
|
|
6182
|
+
const id = React62.useId();
|
|
6183
|
+
const value = React62.useMemo(
|
|
6194
6184
|
() => ({
|
|
6195
6185
|
id,
|
|
6196
6186
|
formItemId: `${id}-form-item`,
|
|
@@ -6199,7 +6189,7 @@ function FormItem({ className, ...props }) {
|
|
|
6199
6189
|
}),
|
|
6200
6190
|
[id]
|
|
6201
6191
|
);
|
|
6202
|
-
return /* @__PURE__ */
|
|
6192
|
+
return /* @__PURE__ */ jsx53(FormItemContext.Provider, { value, children: /* @__PURE__ */ jsx53("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) });
|
|
6203
6193
|
}
|
|
6204
6194
|
function FormLabel({
|
|
6205
6195
|
className,
|
|
@@ -6207,7 +6197,7 @@ function FormLabel({
|
|
|
6207
6197
|
...props
|
|
6208
6198
|
}) {
|
|
6209
6199
|
const { formItemId } = useFormItem();
|
|
6210
|
-
return /* @__PURE__ */
|
|
6200
|
+
return /* @__PURE__ */ jsx53(
|
|
6211
6201
|
Label,
|
|
6212
6202
|
{
|
|
6213
6203
|
"data-slot": "form-label",
|
|
@@ -6223,7 +6213,7 @@ function FormControl({
|
|
|
6223
6213
|
...props
|
|
6224
6214
|
}) {
|
|
6225
6215
|
const { formItemId, formDescriptionId, formMessageId } = useFormItem();
|
|
6226
|
-
return /* @__PURE__ */
|
|
6216
|
+
return /* @__PURE__ */ jsx53(
|
|
6227
6217
|
Slot,
|
|
6228
6218
|
{
|
|
6229
6219
|
"data-slot": "form-control",
|
|
@@ -6236,7 +6226,7 @@ function FormControl({
|
|
|
6236
6226
|
}
|
|
6237
6227
|
function FormDescription({ className, ...props }) {
|
|
6238
6228
|
const { formDescriptionId } = useFormItem();
|
|
6239
|
-
return /* @__PURE__ */
|
|
6229
|
+
return /* @__PURE__ */ jsx53(
|
|
6240
6230
|
"p",
|
|
6241
6231
|
{
|
|
6242
6232
|
"data-slot": "form-description",
|
|
@@ -6251,7 +6241,7 @@ function FormMessage({ className, children, ...props }) {
|
|
|
6251
6241
|
if (!children) {
|
|
6252
6242
|
return null;
|
|
6253
6243
|
}
|
|
6254
|
-
return /* @__PURE__ */
|
|
6244
|
+
return /* @__PURE__ */ jsx53(
|
|
6255
6245
|
"p",
|
|
6256
6246
|
{
|
|
6257
6247
|
"data-slot": "form-message",
|
|
@@ -6264,14 +6254,14 @@ function FormMessage({ className, children, ...props }) {
|
|
|
6264
6254
|
}
|
|
6265
6255
|
|
|
6266
6256
|
// src/components/resizable.tsx
|
|
6267
|
-
import * as
|
|
6268
|
-
import { jsx as
|
|
6257
|
+
import * as React63 from "react";
|
|
6258
|
+
import { jsx as jsx54, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6269
6259
|
var GROUP_BASE = "flex h-full w-full data-[panel-group-direction=vertical]:flex-col";
|
|
6270
6260
|
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";
|
|
6271
6261
|
var GRIP_BASE = "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border";
|
|
6272
|
-
var ResizableContext =
|
|
6262
|
+
var ResizableContext = React63.createContext(null);
|
|
6273
6263
|
function useResizable() {
|
|
6274
|
-
const ctx =
|
|
6264
|
+
const ctx = React63.useContext(ResizableContext);
|
|
6275
6265
|
if (!ctx)
|
|
6276
6266
|
throw new Error("Resizable parts must be used within a ResizablePanelGroup");
|
|
6277
6267
|
return ctx;
|
|
@@ -6294,9 +6284,9 @@ function ResizablePanelGroup({
|
|
|
6294
6284
|
children,
|
|
6295
6285
|
...props
|
|
6296
6286
|
}) {
|
|
6297
|
-
const [sizes, setSizes] =
|
|
6298
|
-
const groupRef =
|
|
6299
|
-
const register =
|
|
6287
|
+
const [sizes, setSizes] = React63.useState([]);
|
|
6288
|
+
const groupRef = React63.useRef(null);
|
|
6289
|
+
const register = React63.useCallback((index, defaultSize) => {
|
|
6300
6290
|
setSizes((prev) => {
|
|
6301
6291
|
if (prev[index] !== void 0) return prev;
|
|
6302
6292
|
const next = prev.slice();
|
|
@@ -6305,14 +6295,14 @@ function ResizablePanelGroup({
|
|
|
6305
6295
|
return next;
|
|
6306
6296
|
});
|
|
6307
6297
|
}, []);
|
|
6308
|
-
|
|
6298
|
+
React63.useEffect(() => {
|
|
6309
6299
|
if (sizes.length) onLayout?.(sizes);
|
|
6310
6300
|
}, [sizes, onLayout]);
|
|
6311
|
-
const value =
|
|
6301
|
+
const value = React63.useMemo(
|
|
6312
6302
|
() => ({ sizes, setSizes, register, direction, keyboardStep, groupRef }),
|
|
6313
6303
|
[sizes, register, direction, keyboardStep]
|
|
6314
6304
|
);
|
|
6315
|
-
return /* @__PURE__ */
|
|
6305
|
+
return /* @__PURE__ */ jsx54(ResizableContext.Provider, { value, children: /* @__PURE__ */ jsx54(
|
|
6316
6306
|
"div",
|
|
6317
6307
|
{
|
|
6318
6308
|
ref: groupRef,
|
|
@@ -6333,11 +6323,11 @@ function ResizablePanel({
|
|
|
6333
6323
|
...props
|
|
6334
6324
|
}) {
|
|
6335
6325
|
const { sizes, register } = useResizable();
|
|
6336
|
-
|
|
6326
|
+
React63.useEffect(() => {
|
|
6337
6327
|
register(index, defaultSize);
|
|
6338
6328
|
}, [register, index, defaultSize]);
|
|
6339
6329
|
const basis = sizes[index] ?? defaultSize;
|
|
6340
|
-
return /* @__PURE__ */
|
|
6330
|
+
return /* @__PURE__ */ jsx54(
|
|
6341
6331
|
"div",
|
|
6342
6332
|
{
|
|
6343
6333
|
"data-slot": "resizable-panel",
|
|
@@ -6356,12 +6346,12 @@ function ResizableHandle({
|
|
|
6356
6346
|
...props
|
|
6357
6347
|
}) {
|
|
6358
6348
|
const { setSizes, direction, keyboardStep, groupRef } = useResizable();
|
|
6359
|
-
const draggingRef =
|
|
6360
|
-
const resize =
|
|
6349
|
+
const draggingRef = React63.useRef(false);
|
|
6350
|
+
const resize = React63.useCallback(
|
|
6361
6351
|
(delta) => setSizes((prev) => redistribute(prev, index, delta)),
|
|
6362
6352
|
[setSizes, index]
|
|
6363
6353
|
);
|
|
6364
|
-
const onPointerMove =
|
|
6354
|
+
const onPointerMove = React63.useCallback(
|
|
6365
6355
|
(event) => {
|
|
6366
6356
|
if (!draggingRef.current) return;
|
|
6367
6357
|
const rect = groupRef.current?.getBoundingClientRect();
|
|
@@ -6373,7 +6363,7 @@ function ResizableHandle({
|
|
|
6373
6363
|
},
|
|
6374
6364
|
[direction, resize, groupRef]
|
|
6375
6365
|
);
|
|
6376
|
-
const onPointerUp =
|
|
6366
|
+
const onPointerUp = React63.useCallback(() => {
|
|
6377
6367
|
draggingRef.current = false;
|
|
6378
6368
|
window.removeEventListener("pointermove", onPointerMove);
|
|
6379
6369
|
window.removeEventListener("pointerup", onPointerUp);
|
|
@@ -6384,7 +6374,7 @@ function ResizableHandle({
|
|
|
6384
6374
|
window.addEventListener("pointermove", onPointerMove);
|
|
6385
6375
|
window.addEventListener("pointerup", onPointerUp);
|
|
6386
6376
|
};
|
|
6387
|
-
|
|
6377
|
+
React63.useEffect(() => () => onPointerUp(), [onPointerUp]);
|
|
6388
6378
|
const onKeyDown = (event) => {
|
|
6389
6379
|
let delta;
|
|
6390
6380
|
switch (event.key) {
|
|
@@ -6417,7 +6407,7 @@ function ResizableHandle({
|
|
|
6417
6407
|
onKeyDown,
|
|
6418
6408
|
...props,
|
|
6419
6409
|
children: [
|
|
6420
|
-
withHandle && /* @__PURE__ */
|
|
6410
|
+
withHandle && /* @__PURE__ */ jsx54("div", { className: GRIP_BASE, children: /* @__PURE__ */ jsxs23(
|
|
6421
6411
|
"svg",
|
|
6422
6412
|
{
|
|
6423
6413
|
className: "size-2.5",
|
|
@@ -6432,12 +6422,12 @@ function ResizableHandle({
|
|
|
6432
6422
|
strokeLinejoin: "round",
|
|
6433
6423
|
"aria-hidden": "true",
|
|
6434
6424
|
children: [
|
|
6435
|
-
/* @__PURE__ */
|
|
6436
|
-
/* @__PURE__ */
|
|
6437
|
-
/* @__PURE__ */
|
|
6438
|
-
/* @__PURE__ */
|
|
6439
|
-
/* @__PURE__ */
|
|
6440
|
-
/* @__PURE__ */
|
|
6425
|
+
/* @__PURE__ */ jsx54("circle", { cx: "9", cy: "12", r: "1" }),
|
|
6426
|
+
/* @__PURE__ */ jsx54("circle", { cx: "9", cy: "5", r: "1" }),
|
|
6427
|
+
/* @__PURE__ */ jsx54("circle", { cx: "9", cy: "19", r: "1" }),
|
|
6428
|
+
/* @__PURE__ */ jsx54("circle", { cx: "15", cy: "12", r: "1" }),
|
|
6429
|
+
/* @__PURE__ */ jsx54("circle", { cx: "15", cy: "5", r: "1" }),
|
|
6430
|
+
/* @__PURE__ */ jsx54("circle", { cx: "15", cy: "19", r: "1" })
|
|
6441
6431
|
]
|
|
6442
6432
|
}
|
|
6443
6433
|
) }),
|
|
@@ -6512,6 +6502,7 @@ export {
|
|
|
6512
6502
|
CommandList,
|
|
6513
6503
|
CommandSeparator,
|
|
6514
6504
|
CommandShortcut,
|
|
6505
|
+
Container,
|
|
6515
6506
|
ContextMenu,
|
|
6516
6507
|
ContextMenuCheckboxItem,
|
|
6517
6508
|
ContextMenuContent,
|