@rock.star/ui 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +7 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.d.ts +43 -0
- package/dist/index.js +8551 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/index.d.ts +12 -4
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/styles.css +240 -0
- package/dist/ui/index.d.ts +99 -10
- package/dist/ui/index.js +1097 -423
- package/dist/ui/index.js.map +1 -1
- package/dist/utils-Cbsgs0XP.d.ts +5 -0
- package/package.json +8 -3
package/dist/ui/index.js
CHANGED
|
@@ -698,6 +698,9 @@ function Apple() {
|
|
|
698
698
|
return /* @__PURE__ */ jsx7("main", { className: "m-auto flex grow items-center justify-center", children: /* @__PURE__ */ jsx7(AnimatePresence, { mode: "wait", children: demos[index] }) });
|
|
699
699
|
}
|
|
700
700
|
|
|
701
|
+
// src/ui/ariakit.tsx
|
|
702
|
+
import * as Ariakit from "@ariakit/react";
|
|
703
|
+
|
|
701
704
|
// src/ui/autocomplete.tsx
|
|
702
705
|
import { Autocomplete as AutocompletePrimitive } from "@base-ui/react/autocomplete";
|
|
703
706
|
import { ChevronsExpandVertical, Xmark } from "@gravity-ui/icons";
|
|
@@ -1529,15 +1532,13 @@ function ButtonGroupSeparator({
|
|
|
1529
1532
|
}
|
|
1530
1533
|
|
|
1531
1534
|
// src/ui/card.tsx
|
|
1535
|
+
import * as React2 from "react";
|
|
1532
1536
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1533
|
-
|
|
1534
|
-
className,
|
|
1535
|
-
size = "default",
|
|
1536
|
-
...props
|
|
1537
|
-
}) {
|
|
1537
|
+
var Card = React2.forwardRef(function Card2({ className, size = "default", ...props }, ref) {
|
|
1538
1538
|
return /* @__PURE__ */ jsx15(
|
|
1539
1539
|
"div",
|
|
1540
1540
|
{
|
|
1541
|
+
ref,
|
|
1541
1542
|
"data-slot": "card",
|
|
1542
1543
|
"data-size": size,
|
|
1543
1544
|
className: cn(
|
|
@@ -1547,7 +1548,7 @@ function Card({
|
|
|
1547
1548
|
...props
|
|
1548
1549
|
}
|
|
1549
1550
|
);
|
|
1550
|
-
}
|
|
1551
|
+
});
|
|
1551
1552
|
function CardHeader({ className, ...props }) {
|
|
1552
1553
|
return /* @__PURE__ */ jsx15(
|
|
1553
1554
|
"div",
|
|
@@ -1624,11 +1625,11 @@ function CardFooter({ className, ...props }) {
|
|
|
1624
1625
|
// src/ui/carousel.tsx
|
|
1625
1626
|
import useEmblaCarousel from "embla-carousel-react";
|
|
1626
1627
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
1627
|
-
import * as
|
|
1628
|
+
import * as React3 from "react";
|
|
1628
1629
|
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1629
|
-
var CarouselContext =
|
|
1630
|
+
var CarouselContext = React3.createContext(null);
|
|
1630
1631
|
function useCarousel() {
|
|
1631
|
-
const context =
|
|
1632
|
+
const context = React3.useContext(CarouselContext);
|
|
1632
1633
|
if (!context) {
|
|
1633
1634
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
1634
1635
|
}
|
|
@@ -1650,20 +1651,20 @@ function Carousel({
|
|
|
1650
1651
|
},
|
|
1651
1652
|
plugins
|
|
1652
1653
|
);
|
|
1653
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1654
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1655
|
-
const onSelect =
|
|
1654
|
+
const [canScrollPrev, setCanScrollPrev] = React3.useState(false);
|
|
1655
|
+
const [canScrollNext, setCanScrollNext] = React3.useState(false);
|
|
1656
|
+
const onSelect = React3.useCallback((api2) => {
|
|
1656
1657
|
if (!api2) return;
|
|
1657
1658
|
setCanScrollPrev(api2.canScrollPrev());
|
|
1658
1659
|
setCanScrollNext(api2.canScrollNext());
|
|
1659
1660
|
}, []);
|
|
1660
|
-
const scrollPrev =
|
|
1661
|
+
const scrollPrev = React3.useCallback(() => {
|
|
1661
1662
|
api?.scrollPrev();
|
|
1662
1663
|
}, [api]);
|
|
1663
|
-
const scrollNext =
|
|
1664
|
+
const scrollNext = React3.useCallback(() => {
|
|
1664
1665
|
api?.scrollNext();
|
|
1665
1666
|
}, [api]);
|
|
1666
|
-
const handleKeyDown =
|
|
1667
|
+
const handleKeyDown = React3.useCallback(
|
|
1667
1668
|
(event) => {
|
|
1668
1669
|
if (event.key === "ArrowLeft") {
|
|
1669
1670
|
event.preventDefault();
|
|
@@ -1675,11 +1676,11 @@ function Carousel({
|
|
|
1675
1676
|
},
|
|
1676
1677
|
[scrollPrev, scrollNext]
|
|
1677
1678
|
);
|
|
1678
|
-
|
|
1679
|
+
React3.useEffect(() => {
|
|
1679
1680
|
if (!api || !setApi) return;
|
|
1680
1681
|
setApi(api);
|
|
1681
1682
|
}, [api, setApi]);
|
|
1682
|
-
|
|
1683
|
+
React3.useEffect(() => {
|
|
1683
1684
|
if (!api) return;
|
|
1684
1685
|
api.on("reInit", onSelect);
|
|
1685
1686
|
api.on("select", onSelect);
|
|
@@ -1814,14 +1815,14 @@ function CarouselNext({
|
|
|
1814
1815
|
}
|
|
1815
1816
|
|
|
1816
1817
|
// src/ui/chart.tsx
|
|
1817
|
-
import * as
|
|
1818
|
+
import * as React4 from "react";
|
|
1818
1819
|
import * as RechartsPrimitive from "recharts";
|
|
1819
1820
|
import { Fragment, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1820
1821
|
var THEMES = { light: "", dark: ".dark" };
|
|
1821
1822
|
var INITIAL_DIMENSION = { width: 320, height: 200 };
|
|
1822
|
-
var ChartContext =
|
|
1823
|
+
var ChartContext = React4.createContext(null);
|
|
1823
1824
|
function useChart() {
|
|
1824
|
-
const context =
|
|
1825
|
+
const context = React4.useContext(ChartContext);
|
|
1825
1826
|
if (!context) {
|
|
1826
1827
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
1827
1828
|
}
|
|
@@ -1835,7 +1836,7 @@ function ChartContainer({
|
|
|
1835
1836
|
initialDimension = INITIAL_DIMENSION,
|
|
1836
1837
|
...props
|
|
1837
1838
|
}) {
|
|
1838
|
-
const uniqueId =
|
|
1839
|
+
const uniqueId = React4.useId();
|
|
1839
1840
|
const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
|
|
1840
1841
|
return /* @__PURE__ */ jsx17(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs9(
|
|
1841
1842
|
"div",
|
|
@@ -1902,7 +1903,7 @@ function ChartTooltipContent({
|
|
|
1902
1903
|
labelKey
|
|
1903
1904
|
}) {
|
|
1904
1905
|
const { config } = useChart();
|
|
1905
|
-
const tooltipLabel =
|
|
1906
|
+
const tooltipLabel = React4.useMemo(() => {
|
|
1906
1907
|
if (hideLabel || !payload?.length) {
|
|
1907
1908
|
return null;
|
|
1908
1909
|
}
|
|
@@ -2056,18 +2057,43 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
2056
2057
|
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
2057
2058
|
}
|
|
2058
2059
|
|
|
2060
|
+
// src/ui/checkbox.tsx
|
|
2061
|
+
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
|
|
2062
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2063
|
+
function Checkbox({ className, children, ...props }) {
|
|
2064
|
+
return /* @__PURE__ */ jsx18(
|
|
2065
|
+
CheckboxPrimitive.Root,
|
|
2066
|
+
{
|
|
2067
|
+
"data-slot": "checkbox",
|
|
2068
|
+
className: cn(
|
|
2069
|
+
"peer inline-flex size-5 shrink-0 items-center justify-center rounded border border-border bg-background text-primary outline-none transition-[background-color,border-color,box-shadow,opacity] duration-150 ease-out focus-visible:ring-2 focus-visible:ring-ring/50 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-disabled:cursor-not-allowed data-disabled:opacity-50 motion-reduce:transition-none",
|
|
2070
|
+
className
|
|
2071
|
+
),
|
|
2072
|
+
...props,
|
|
2073
|
+
children: /* @__PURE__ */ jsx18(
|
|
2074
|
+
CheckboxPrimitive.Indicator,
|
|
2075
|
+
{
|
|
2076
|
+
"data-slot": "checkbox-indicator",
|
|
2077
|
+
className: "flex items-center justify-center",
|
|
2078
|
+
children
|
|
2079
|
+
}
|
|
2080
|
+
)
|
|
2081
|
+
}
|
|
2082
|
+
);
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2059
2085
|
// src/ui/combobox.tsx
|
|
2060
2086
|
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
2061
|
-
import * as
|
|
2087
|
+
import * as React5 from "react";
|
|
2062
2088
|
import { Check, ChevronDown as ChevronDown2, Xmark as Xmark2 } from "@gravity-ui/icons";
|
|
2063
2089
|
|
|
2064
2090
|
// src/ui/input-group.tsx
|
|
2065
2091
|
import { cva as cva5 } from "class-variance-authority";
|
|
2066
2092
|
|
|
2067
2093
|
// src/ui/textarea.tsx
|
|
2068
|
-
import { jsx as
|
|
2094
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2069
2095
|
function Textarea({ className, ...props }) {
|
|
2070
|
-
return /* @__PURE__ */
|
|
2096
|
+
return /* @__PURE__ */ jsx19(
|
|
2071
2097
|
"textarea",
|
|
2072
2098
|
{
|
|
2073
2099
|
"data-slot": "textarea",
|
|
@@ -2081,9 +2107,9 @@ function Textarea({ className, ...props }) {
|
|
|
2081
2107
|
}
|
|
2082
2108
|
|
|
2083
2109
|
// src/ui/input-group.tsx
|
|
2084
|
-
import { jsx as
|
|
2110
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2085
2111
|
function InputGroup({ className, ...props }) {
|
|
2086
|
-
return /* @__PURE__ */
|
|
2112
|
+
return /* @__PURE__ */ jsx20(
|
|
2087
2113
|
"div",
|
|
2088
2114
|
{
|
|
2089
2115
|
"data-slot": "input-group",
|
|
@@ -2118,7 +2144,7 @@ function InputGroupAddon({
|
|
|
2118
2144
|
focusInput = true,
|
|
2119
2145
|
...props
|
|
2120
2146
|
}) {
|
|
2121
|
-
return /* @__PURE__ */
|
|
2147
|
+
return /* @__PURE__ */ jsx20(
|
|
2122
2148
|
"div",
|
|
2123
2149
|
{
|
|
2124
2150
|
role: "group",
|
|
@@ -2162,7 +2188,7 @@ function InputGroupButton({
|
|
|
2162
2188
|
size = "xs",
|
|
2163
2189
|
...props
|
|
2164
2190
|
}) {
|
|
2165
|
-
return /* @__PURE__ */
|
|
2191
|
+
return /* @__PURE__ */ jsx20(
|
|
2166
2192
|
Button,
|
|
2167
2193
|
{
|
|
2168
2194
|
type,
|
|
@@ -2174,7 +2200,7 @@ function InputGroupButton({
|
|
|
2174
2200
|
);
|
|
2175
2201
|
}
|
|
2176
2202
|
function InputGroupText({ className, ...props }) {
|
|
2177
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ jsx20(
|
|
2178
2204
|
"span",
|
|
2179
2205
|
{
|
|
2180
2206
|
className: cn(
|
|
@@ -2189,7 +2215,7 @@ function InputGroupInput({
|
|
|
2189
2215
|
className,
|
|
2190
2216
|
...props
|
|
2191
2217
|
}) {
|
|
2192
|
-
return /* @__PURE__ */
|
|
2218
|
+
return /* @__PURE__ */ jsx20(
|
|
2193
2219
|
Input,
|
|
2194
2220
|
{
|
|
2195
2221
|
"data-slot": "input-group-control",
|
|
@@ -2205,7 +2231,7 @@ function InputGroupTextarea({
|
|
|
2205
2231
|
className,
|
|
2206
2232
|
...props
|
|
2207
2233
|
}) {
|
|
2208
|
-
return /* @__PURE__ */
|
|
2234
|
+
return /* @__PURE__ */ jsx20(
|
|
2209
2235
|
Textarea,
|
|
2210
2236
|
{
|
|
2211
2237
|
"data-slot": "input-group-control",
|
|
@@ -2219,10 +2245,10 @@ function InputGroupTextarea({
|
|
|
2219
2245
|
}
|
|
2220
2246
|
|
|
2221
2247
|
// src/ui/combobox.tsx
|
|
2222
|
-
import { jsx as
|
|
2248
|
+
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2223
2249
|
var Combobox = ComboboxPrimitive.Root;
|
|
2224
2250
|
function ComboboxValue({ ...props }) {
|
|
2225
|
-
return /* @__PURE__ */
|
|
2251
|
+
return /* @__PURE__ */ jsx21(ComboboxPrimitive.Value, { "data-slot": "combobox-value", ...props });
|
|
2226
2252
|
}
|
|
2227
2253
|
function ComboboxTrigger({
|
|
2228
2254
|
className,
|
|
@@ -2237,20 +2263,20 @@ function ComboboxTrigger({
|
|
|
2237
2263
|
...props,
|
|
2238
2264
|
children: [
|
|
2239
2265
|
children,
|
|
2240
|
-
/* @__PURE__ */
|
|
2266
|
+
/* @__PURE__ */ jsx21(ChevronDown2, { className: "pointer-events-none size-4 text-muted-foreground" })
|
|
2241
2267
|
]
|
|
2242
2268
|
}
|
|
2243
2269
|
);
|
|
2244
2270
|
}
|
|
2245
2271
|
function ComboboxClear({ className, ...props }) {
|
|
2246
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ jsx21(
|
|
2247
2273
|
ComboboxPrimitive.Clear,
|
|
2248
2274
|
{
|
|
2249
2275
|
"data-slot": "combobox-clear",
|
|
2250
|
-
render: /* @__PURE__ */
|
|
2276
|
+
render: /* @__PURE__ */ jsx21(InputGroupButton, { variant: "ghost", size: "icon-xs" }),
|
|
2251
2277
|
className: cn(className),
|
|
2252
2278
|
...props,
|
|
2253
|
-
children: /* @__PURE__ */
|
|
2279
|
+
children: /* @__PURE__ */ jsx21(Xmark2, { className: "pointer-events-none" })
|
|
2254
2280
|
}
|
|
2255
2281
|
);
|
|
2256
2282
|
}
|
|
@@ -2265,29 +2291,29 @@ function ComboboxInput({
|
|
|
2265
2291
|
...props
|
|
2266
2292
|
}) {
|
|
2267
2293
|
return /* @__PURE__ */ jsxs10(InputGroup, { className: cn("w-auto", className), children: [
|
|
2268
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ jsx21(
|
|
2269
2295
|
ComboboxPrimitive.Input,
|
|
2270
2296
|
{
|
|
2271
|
-
render: /* @__PURE__ */
|
|
2297
|
+
render: /* @__PURE__ */ jsx21(InputGroupInput, { disabled }),
|
|
2272
2298
|
...props
|
|
2273
2299
|
}
|
|
2274
2300
|
),
|
|
2275
|
-
startContent && /* @__PURE__ */
|
|
2301
|
+
startContent && /* @__PURE__ */ jsx21(InputGroupAddon, { align: "inline-start", children: startContent }),
|
|
2276
2302
|
/* @__PURE__ */ jsxs10(InputGroupAddon, { align: "inline-end", className: "pr-0", children: [
|
|
2277
|
-
showTrigger && /* @__PURE__ */
|
|
2303
|
+
showTrigger && /* @__PURE__ */ jsx21(
|
|
2278
2304
|
InputGroupButton,
|
|
2279
2305
|
{
|
|
2280
2306
|
size: "icon-xs",
|
|
2281
2307
|
variant: "ghost",
|
|
2282
|
-
render: /* @__PURE__ */
|
|
2308
|
+
render: /* @__PURE__ */ jsx21(ComboboxTrigger, {}),
|
|
2283
2309
|
"data-slot": "input-group-button",
|
|
2284
2310
|
className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
|
|
2285
2311
|
disabled
|
|
2286
2312
|
}
|
|
2287
2313
|
),
|
|
2288
|
-
showClear && /* @__PURE__ */
|
|
2314
|
+
showClear && /* @__PURE__ */ jsx21(ComboboxClear, { disabled })
|
|
2289
2315
|
] }),
|
|
2290
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsx21(InputGroupAddon, { align: "inline-end", children: endContent }),
|
|
2291
2317
|
children
|
|
2292
2318
|
] });
|
|
2293
2319
|
}
|
|
@@ -2300,7 +2326,7 @@ function ComboboxContent({
|
|
|
2300
2326
|
anchor,
|
|
2301
2327
|
...props
|
|
2302
2328
|
}) {
|
|
2303
|
-
return /* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ jsx21(ComboboxPrimitive.Portal, { children: /* @__PURE__ */ jsx21(
|
|
2304
2330
|
ComboboxPrimitive.Positioner,
|
|
2305
2331
|
{
|
|
2306
2332
|
side,
|
|
@@ -2309,7 +2335,7 @@ function ComboboxContent({
|
|
|
2309
2335
|
alignOffset,
|
|
2310
2336
|
anchor,
|
|
2311
2337
|
className: "isolate z-50",
|
|
2312
|
-
children: /* @__PURE__ */
|
|
2338
|
+
children: /* @__PURE__ */ jsx21(
|
|
2313
2339
|
ComboboxPrimitive.Popup,
|
|
2314
2340
|
{
|
|
2315
2341
|
"data-slot": "combobox-content",
|
|
@@ -2325,7 +2351,7 @@ function ComboboxContent({
|
|
|
2325
2351
|
) });
|
|
2326
2352
|
}
|
|
2327
2353
|
function ComboboxList({ className, ...props }) {
|
|
2328
|
-
return /* @__PURE__ */
|
|
2354
|
+
return /* @__PURE__ */ jsx21(
|
|
2329
2355
|
ComboboxPrimitive.List,
|
|
2330
2356
|
{
|
|
2331
2357
|
"data-slot": "combobox-list",
|
|
@@ -2353,11 +2379,11 @@ function ComboboxItem({
|
|
|
2353
2379
|
...props,
|
|
2354
2380
|
children: [
|
|
2355
2381
|
children,
|
|
2356
|
-
/* @__PURE__ */
|
|
2382
|
+
/* @__PURE__ */ jsx21(
|
|
2357
2383
|
ComboboxPrimitive.ItemIndicator,
|
|
2358
2384
|
{
|
|
2359
|
-
render: /* @__PURE__ */
|
|
2360
|
-
children: /* @__PURE__ */
|
|
2385
|
+
render: /* @__PURE__ */ jsx21("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
2386
|
+
children: /* @__PURE__ */ jsx21(Check, { className: "pointer-events-none" })
|
|
2361
2387
|
}
|
|
2362
2388
|
)
|
|
2363
2389
|
]
|
|
@@ -2365,7 +2391,7 @@ function ComboboxItem({
|
|
|
2365
2391
|
);
|
|
2366
2392
|
}
|
|
2367
2393
|
function ComboboxGroup({ className, ...props }) {
|
|
2368
|
-
return /* @__PURE__ */
|
|
2394
|
+
return /* @__PURE__ */ jsx21(
|
|
2369
2395
|
ComboboxPrimitive.Group,
|
|
2370
2396
|
{
|
|
2371
2397
|
"data-slot": "combobox-group",
|
|
@@ -2378,7 +2404,7 @@ function ComboboxLabel({
|
|
|
2378
2404
|
className,
|
|
2379
2405
|
...props
|
|
2380
2406
|
}) {
|
|
2381
|
-
return /* @__PURE__ */
|
|
2407
|
+
return /* @__PURE__ */ jsx21(
|
|
2382
2408
|
ComboboxPrimitive.GroupLabel,
|
|
2383
2409
|
{
|
|
2384
2410
|
"data-slot": "combobox-label",
|
|
@@ -2388,10 +2414,10 @@ function ComboboxLabel({
|
|
|
2388
2414
|
);
|
|
2389
2415
|
}
|
|
2390
2416
|
function ComboboxCollection({ ...props }) {
|
|
2391
|
-
return /* @__PURE__ */
|
|
2417
|
+
return /* @__PURE__ */ jsx21(ComboboxPrimitive.Collection, { "data-slot": "combobox-collection", ...props });
|
|
2392
2418
|
}
|
|
2393
2419
|
function ComboboxEmpty({ className, ...props }) {
|
|
2394
|
-
return /* @__PURE__ */
|
|
2420
|
+
return /* @__PURE__ */ jsx21(
|
|
2395
2421
|
ComboboxPrimitive.Empty,
|
|
2396
2422
|
{
|
|
2397
2423
|
"data-slot": "combobox-empty",
|
|
@@ -2407,7 +2433,7 @@ function ComboboxSeparator({
|
|
|
2407
2433
|
className,
|
|
2408
2434
|
...props
|
|
2409
2435
|
}) {
|
|
2410
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ jsx21(
|
|
2411
2437
|
ComboboxPrimitive.Separator,
|
|
2412
2438
|
{
|
|
2413
2439
|
"data-slot": "combobox-separator",
|
|
@@ -2420,7 +2446,7 @@ function ComboboxChips({
|
|
|
2420
2446
|
className,
|
|
2421
2447
|
...props
|
|
2422
2448
|
}) {
|
|
2423
|
-
return /* @__PURE__ */
|
|
2449
|
+
return /* @__PURE__ */ jsx21(
|
|
2424
2450
|
ComboboxPrimitive.Chips,
|
|
2425
2451
|
{
|
|
2426
2452
|
"data-slot": "combobox-chips",
|
|
@@ -2449,13 +2475,13 @@ function ComboboxChip({
|
|
|
2449
2475
|
...props,
|
|
2450
2476
|
children: [
|
|
2451
2477
|
children,
|
|
2452
|
-
showRemove && /* @__PURE__ */
|
|
2478
|
+
showRemove && /* @__PURE__ */ jsx21(
|
|
2453
2479
|
ComboboxPrimitive.ChipRemove,
|
|
2454
2480
|
{
|
|
2455
|
-
render: /* @__PURE__ */
|
|
2481
|
+
render: /* @__PURE__ */ jsx21(Button, { variant: "ghost", size: "icon-xs" }),
|
|
2456
2482
|
className: "-ml-1 opacity-50 hover:opacity-100",
|
|
2457
2483
|
"data-slot": "combobox-chip-remove",
|
|
2458
|
-
children: /* @__PURE__ */
|
|
2484
|
+
children: /* @__PURE__ */ jsx21(Xmark2, { className: "pointer-events-none" })
|
|
2459
2485
|
}
|
|
2460
2486
|
)
|
|
2461
2487
|
]
|
|
@@ -2466,7 +2492,7 @@ function ComboboxChipsInput({
|
|
|
2466
2492
|
className,
|
|
2467
2493
|
...props
|
|
2468
2494
|
}) {
|
|
2469
|
-
return /* @__PURE__ */
|
|
2495
|
+
return /* @__PURE__ */ jsx21(
|
|
2470
2496
|
ComboboxPrimitive.Input,
|
|
2471
2497
|
{
|
|
2472
2498
|
"data-slot": "combobox-chip-input",
|
|
@@ -2476,7 +2502,7 @@ function ComboboxChipsInput({
|
|
|
2476
2502
|
);
|
|
2477
2503
|
}
|
|
2478
2504
|
function useComboboxAnchor() {
|
|
2479
|
-
return
|
|
2505
|
+
return React5.useRef(null);
|
|
2480
2506
|
}
|
|
2481
2507
|
|
|
2482
2508
|
// src/ui/command.tsx
|
|
@@ -2486,24 +2512,24 @@ import { Magnifier } from "@gravity-ui/icons";
|
|
|
2486
2512
|
// src/ui/dialog.tsx
|
|
2487
2513
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
2488
2514
|
import { Xmark as Xmark3 } from "@gravity-ui/icons";
|
|
2489
|
-
import { jsx as
|
|
2515
|
+
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2490
2516
|
function Dialog({ ...props }) {
|
|
2491
|
-
return /* @__PURE__ */
|
|
2517
|
+
return /* @__PURE__ */ jsx22(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
2492
2518
|
}
|
|
2493
2519
|
function DialogTrigger({ ...props }) {
|
|
2494
|
-
return /* @__PURE__ */
|
|
2520
|
+
return /* @__PURE__ */ jsx22(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
2495
2521
|
}
|
|
2496
2522
|
function DialogPortal({ ...props }) {
|
|
2497
|
-
return /* @__PURE__ */
|
|
2523
|
+
return /* @__PURE__ */ jsx22(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
2498
2524
|
}
|
|
2499
2525
|
function DialogClose({ ...props }) {
|
|
2500
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ jsx22(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
2501
2527
|
}
|
|
2502
2528
|
function DialogOverlay({
|
|
2503
2529
|
className,
|
|
2504
2530
|
...props
|
|
2505
2531
|
}) {
|
|
2506
|
-
return /* @__PURE__ */
|
|
2532
|
+
return /* @__PURE__ */ jsx22(
|
|
2507
2533
|
DialogPrimitive.Backdrop,
|
|
2508
2534
|
{
|
|
2509
2535
|
"data-slot": "dialog-overlay",
|
|
@@ -2522,7 +2548,7 @@ function DialogContent({
|
|
|
2522
2548
|
...props
|
|
2523
2549
|
}) {
|
|
2524
2550
|
return /* @__PURE__ */ jsxs11(DialogPortal, { children: [
|
|
2525
|
-
/* @__PURE__ */
|
|
2551
|
+
/* @__PURE__ */ jsx22(DialogOverlay, {}),
|
|
2526
2552
|
/* @__PURE__ */ jsxs11(
|
|
2527
2553
|
DialogPrimitive.Popup,
|
|
2528
2554
|
{
|
|
@@ -2538,7 +2564,7 @@ function DialogContent({
|
|
|
2538
2564
|
DialogPrimitive.Close,
|
|
2539
2565
|
{
|
|
2540
2566
|
"data-slot": "dialog-close",
|
|
2541
|
-
render: /* @__PURE__ */
|
|
2567
|
+
render: /* @__PURE__ */ jsx22(
|
|
2542
2568
|
Button,
|
|
2543
2569
|
{
|
|
2544
2570
|
variant: "ghost",
|
|
@@ -2547,8 +2573,8 @@ function DialogContent({
|
|
|
2547
2573
|
}
|
|
2548
2574
|
),
|
|
2549
2575
|
children: [
|
|
2550
|
-
/* @__PURE__ */
|
|
2551
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ jsx22(Xmark3, {}),
|
|
2577
|
+
/* @__PURE__ */ jsx22("span", { className: "sr-only", children: "Close" })
|
|
2552
2578
|
]
|
|
2553
2579
|
}
|
|
2554
2580
|
)
|
|
@@ -2558,7 +2584,7 @@ function DialogContent({
|
|
|
2558
2584
|
] });
|
|
2559
2585
|
}
|
|
2560
2586
|
function DialogHeader({ className, ...props }) {
|
|
2561
|
-
return /* @__PURE__ */
|
|
2587
|
+
return /* @__PURE__ */ jsx22(
|
|
2562
2588
|
"div",
|
|
2563
2589
|
{
|
|
2564
2590
|
"data-slot": "dialog-header",
|
|
@@ -2584,13 +2610,13 @@ function DialogFooter({
|
|
|
2584
2610
|
...props,
|
|
2585
2611
|
children: [
|
|
2586
2612
|
children,
|
|
2587
|
-
showCloseButton && /* @__PURE__ */
|
|
2613
|
+
showCloseButton && /* @__PURE__ */ jsx22(DialogPrimitive.Close, { render: /* @__PURE__ */ jsx22(Button, { variant: "outline" }), children: "Close" })
|
|
2588
2614
|
]
|
|
2589
2615
|
}
|
|
2590
2616
|
);
|
|
2591
2617
|
}
|
|
2592
2618
|
function DialogTitle({ className, ...props }) {
|
|
2593
|
-
return /* @__PURE__ */
|
|
2619
|
+
return /* @__PURE__ */ jsx22(
|
|
2594
2620
|
DialogPrimitive.Title,
|
|
2595
2621
|
{
|
|
2596
2622
|
"data-slot": "dialog-title",
|
|
@@ -2603,7 +2629,7 @@ function DialogDescription({
|
|
|
2603
2629
|
className,
|
|
2604
2630
|
...props
|
|
2605
2631
|
}) {
|
|
2606
|
-
return /* @__PURE__ */
|
|
2632
|
+
return /* @__PURE__ */ jsx22(
|
|
2607
2633
|
DialogPrimitive.Description,
|
|
2608
2634
|
{
|
|
2609
2635
|
"data-slot": "dialog-description",
|
|
@@ -2617,12 +2643,12 @@ function DialogDescription({
|
|
|
2617
2643
|
}
|
|
2618
2644
|
|
|
2619
2645
|
// src/ui/command.tsx
|
|
2620
|
-
import { jsx as
|
|
2646
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2621
2647
|
function Command({
|
|
2622
2648
|
className,
|
|
2623
2649
|
...props
|
|
2624
2650
|
}) {
|
|
2625
|
-
return /* @__PURE__ */
|
|
2651
|
+
return /* @__PURE__ */ jsx23(
|
|
2626
2652
|
CommandPrimitive,
|
|
2627
2653
|
{
|
|
2628
2654
|
"data-slot": "command",
|
|
@@ -2644,10 +2670,10 @@ function CommandDialog({
|
|
|
2644
2670
|
}) {
|
|
2645
2671
|
return /* @__PURE__ */ jsxs12(Dialog, { ...props, children: [
|
|
2646
2672
|
/* @__PURE__ */ jsxs12(DialogHeader, { className: "sr-only", children: [
|
|
2647
|
-
/* @__PURE__ */
|
|
2648
|
-
/* @__PURE__ */
|
|
2673
|
+
/* @__PURE__ */ jsx23(DialogTitle, { children: title }),
|
|
2674
|
+
/* @__PURE__ */ jsx23(DialogDescription, { children: description })
|
|
2649
2675
|
] }),
|
|
2650
|
-
/* @__PURE__ */
|
|
2676
|
+
/* @__PURE__ */ jsx23(
|
|
2651
2677
|
DialogContent,
|
|
2652
2678
|
{
|
|
2653
2679
|
className: cn(
|
|
@@ -2676,17 +2702,18 @@ function CommandInput({
|
|
|
2676
2702
|
className
|
|
2677
2703
|
),
|
|
2678
2704
|
children: [
|
|
2679
|
-
startContent ? /* @__PURE__ */
|
|
2680
|
-
/* @__PURE__ */
|
|
2681
|
-
/* @__PURE__ */
|
|
2705
|
+
startContent ? /* @__PURE__ */ jsx23(InputGroupAddon, { align: "inline-start", focusInput: false, children: startContent }) : null,
|
|
2706
|
+
/* @__PURE__ */ jsx23(InputGroupAddon, { focusInput: focusAddon, children: /* @__PURE__ */ jsx23(Magnifier, {}) }),
|
|
2707
|
+
/* @__PURE__ */ jsx23(
|
|
2682
2708
|
CommandPrimitive.Input,
|
|
2683
2709
|
{
|
|
2710
|
+
"data-no-ring": true,
|
|
2684
2711
|
"data-slot": "command-input",
|
|
2685
2712
|
className: "w-full outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
2686
2713
|
...props
|
|
2687
2714
|
}
|
|
2688
2715
|
),
|
|
2689
|
-
endContent ? /* @__PURE__ */
|
|
2716
|
+
endContent ? /* @__PURE__ */ jsx23(InputGroupAddon, { align: "inline-end", focusInput: false, children: endContent }) : null
|
|
2690
2717
|
]
|
|
2691
2718
|
}
|
|
2692
2719
|
);
|
|
@@ -2695,7 +2722,7 @@ function CommandList({
|
|
|
2695
2722
|
className,
|
|
2696
2723
|
...props
|
|
2697
2724
|
}) {
|
|
2698
|
-
return /* @__PURE__ */
|
|
2725
|
+
return /* @__PURE__ */ jsx23(
|
|
2699
2726
|
CommandPrimitive.List,
|
|
2700
2727
|
{
|
|
2701
2728
|
"data-slot": "command-list",
|
|
@@ -2711,7 +2738,7 @@ function CommandEmpty({
|
|
|
2711
2738
|
className,
|
|
2712
2739
|
...props
|
|
2713
2740
|
}) {
|
|
2714
|
-
return /* @__PURE__ */
|
|
2741
|
+
return /* @__PURE__ */ jsx23(
|
|
2715
2742
|
CommandPrimitive.Empty,
|
|
2716
2743
|
{
|
|
2717
2744
|
"data-slot": "command-empty",
|
|
@@ -2724,7 +2751,7 @@ function CommandGroup({
|
|
|
2724
2751
|
className,
|
|
2725
2752
|
...props
|
|
2726
2753
|
}) {
|
|
2727
|
-
return /* @__PURE__ */
|
|
2754
|
+
return /* @__PURE__ */ jsx23(
|
|
2728
2755
|
CommandPrimitive.Group,
|
|
2729
2756
|
{
|
|
2730
2757
|
"data-slot": "command-group",
|
|
@@ -2740,7 +2767,7 @@ function CommandSeparator({
|
|
|
2740
2767
|
className,
|
|
2741
2768
|
...props
|
|
2742
2769
|
}) {
|
|
2743
|
-
return /* @__PURE__ */
|
|
2770
|
+
return /* @__PURE__ */ jsx23(
|
|
2744
2771
|
CommandPrimitive.Separator,
|
|
2745
2772
|
{
|
|
2746
2773
|
"data-slot": "command-separator",
|
|
@@ -2754,7 +2781,7 @@ function CommandItem({
|
|
|
2754
2781
|
children,
|
|
2755
2782
|
...props
|
|
2756
2783
|
}) {
|
|
2757
|
-
return /* @__PURE__ */
|
|
2784
|
+
return /* @__PURE__ */ jsx23(
|
|
2758
2785
|
CommandPrimitive.Item,
|
|
2759
2786
|
{
|
|
2760
2787
|
"data-slot": "command-item",
|
|
@@ -2771,7 +2798,7 @@ function CommandShortcut({
|
|
|
2771
2798
|
className,
|
|
2772
2799
|
...props
|
|
2773
2800
|
}) {
|
|
2774
|
-
return /* @__PURE__ */
|
|
2801
|
+
return /* @__PURE__ */ jsx23(
|
|
2775
2802
|
"span",
|
|
2776
2803
|
{
|
|
2777
2804
|
"data-slot": "command-shortcut",
|
|
@@ -2785,17 +2812,17 @@ function CommandShortcut({
|
|
|
2785
2812
|
}
|
|
2786
2813
|
|
|
2787
2814
|
// src/ui/dashed.tsx
|
|
2788
|
-
import * as
|
|
2789
|
-
import { jsx as
|
|
2815
|
+
import * as React6 from "react";
|
|
2816
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2790
2817
|
function DashedSeparator({
|
|
2791
2818
|
className,
|
|
2792
2819
|
dashWidth = 12,
|
|
2793
2820
|
minimumGap = 8,
|
|
2794
2821
|
thickness = 1
|
|
2795
2822
|
}) {
|
|
2796
|
-
const containerRef =
|
|
2797
|
-
const [dashCount, setDashCount] =
|
|
2798
|
-
|
|
2823
|
+
const containerRef = React6.useRef(null);
|
|
2824
|
+
const [dashCount, setDashCount] = React6.useState(0);
|
|
2825
|
+
React6.useEffect(() => {
|
|
2799
2826
|
const element = containerRef.current;
|
|
2800
2827
|
if (!element) return;
|
|
2801
2828
|
const updateDashCount = () => {
|
|
@@ -2811,7 +2838,7 @@ function DashedSeparator({
|
|
|
2811
2838
|
observer.observe(element);
|
|
2812
2839
|
return () => observer.disconnect();
|
|
2813
2840
|
}, [dashWidth, minimumGap]);
|
|
2814
|
-
return /* @__PURE__ */
|
|
2841
|
+
return /* @__PURE__ */ jsx24(
|
|
2815
2842
|
"div",
|
|
2816
2843
|
{
|
|
2817
2844
|
ref: containerRef,
|
|
@@ -2821,7 +2848,7 @@ function DashedSeparator({
|
|
|
2821
2848
|
className
|
|
2822
2849
|
),
|
|
2823
2850
|
style: { height: thickness },
|
|
2824
|
-
children: Array.from({ length: dashCount }).map((_, index) => /* @__PURE__ */
|
|
2851
|
+
children: Array.from({ length: dashCount }).map((_, index) => /* @__PURE__ */ jsx24(
|
|
2825
2852
|
"span",
|
|
2826
2853
|
{
|
|
2827
2854
|
className: "shrink-0 bg-current",
|
|
@@ -2838,8 +2865,8 @@ function DashedSeparator({
|
|
|
2838
2865
|
|
|
2839
2866
|
// src/ui/dock.tsx
|
|
2840
2867
|
import { motion as motion4 } from "motion/react";
|
|
2841
|
-
import * as
|
|
2842
|
-
import { jsx as
|
|
2868
|
+
import * as React7 from "react";
|
|
2869
|
+
import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2843
2870
|
var floatingAnimation = {
|
|
2844
2871
|
initial: { y: 0 },
|
|
2845
2872
|
animate: {
|
|
@@ -2851,7 +2878,7 @@ var floatingAnimation = {
|
|
|
2851
2878
|
}
|
|
2852
2879
|
}
|
|
2853
2880
|
};
|
|
2854
|
-
var DockIconButton =
|
|
2881
|
+
var DockIconButton = React7.forwardRef(
|
|
2855
2882
|
({ icon: Icon, label, onClick, className }, ref) => {
|
|
2856
2883
|
return /* @__PURE__ */ jsxs13(
|
|
2857
2884
|
motion4.button,
|
|
@@ -2866,8 +2893,8 @@ var DockIconButton = React6.forwardRef(
|
|
|
2866
2893
|
className
|
|
2867
2894
|
),
|
|
2868
2895
|
children: [
|
|
2869
|
-
/* @__PURE__ */
|
|
2870
|
-
/* @__PURE__ */
|
|
2896
|
+
/* @__PURE__ */ jsx25(Icon, { className: "h-5 w-5 text-foreground" }),
|
|
2897
|
+
/* @__PURE__ */ jsx25(
|
|
2871
2898
|
"span",
|
|
2872
2899
|
{
|
|
2873
2900
|
className: cn(
|
|
@@ -2886,9 +2913,9 @@ var DockIconButton = React6.forwardRef(
|
|
|
2886
2913
|
}
|
|
2887
2914
|
);
|
|
2888
2915
|
DockIconButton.displayName = "DockIconButton";
|
|
2889
|
-
var Dock =
|
|
2916
|
+
var Dock = React7.forwardRef(
|
|
2890
2917
|
({ items, className }, ref) => {
|
|
2891
|
-
return /* @__PURE__ */
|
|
2918
|
+
return /* @__PURE__ */ jsx25(
|
|
2892
2919
|
"div",
|
|
2893
2920
|
{
|
|
2894
2921
|
ref,
|
|
@@ -2896,7 +2923,7 @@ var Dock = React6.forwardRef(
|
|
|
2896
2923
|
"flex h-64 w-full items-center justify-center p-2",
|
|
2897
2924
|
className
|
|
2898
2925
|
),
|
|
2899
|
-
children: /* @__PURE__ */
|
|
2926
|
+
children: /* @__PURE__ */ jsx25("div", { className: "relative flex h-64 w-full max-w-4xl items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsx25(
|
|
2900
2927
|
motion4.div,
|
|
2901
2928
|
{
|
|
2902
2929
|
initial: "initial",
|
|
@@ -2908,7 +2935,7 @@ var Dock = React6.forwardRef(
|
|
|
2908
2935
|
"border-border bg-background/90",
|
|
2909
2936
|
"transition-shadow duration-300 hover:shadow-xl"
|
|
2910
2937
|
),
|
|
2911
|
-
children: items.map((item) => /* @__PURE__ */
|
|
2938
|
+
children: items.map((item) => /* @__PURE__ */ jsx25(DockIconButton, { ...item }, item.label))
|
|
2912
2939
|
}
|
|
2913
2940
|
) })
|
|
2914
2941
|
}
|
|
@@ -2919,11 +2946,11 @@ Dock.displayName = "Dock";
|
|
|
2919
2946
|
|
|
2920
2947
|
// src/ui/drawer.tsx
|
|
2921
2948
|
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
2922
|
-
import * as
|
|
2923
|
-
import { jsx as
|
|
2924
|
-
var DrawerContext =
|
|
2949
|
+
import * as React8 from "react";
|
|
2950
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2951
|
+
var DrawerContext = React8.createContext(null);
|
|
2925
2952
|
function useDrawer() {
|
|
2926
|
-
const context =
|
|
2953
|
+
const context = React8.useContext(DrawerContext);
|
|
2927
2954
|
if (!context) {
|
|
2928
2955
|
throw new Error("useDrawer must be used within a Drawer.");
|
|
2929
2956
|
}
|
|
@@ -2938,7 +2965,7 @@ function Drawer({
|
|
|
2938
2965
|
}) {
|
|
2939
2966
|
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
2940
2967
|
const resolvedShowSwipeHandle = showSwipeHandle ?? (swipeDirection === "down" || swipeDirection === "up");
|
|
2941
|
-
const contextValue =
|
|
2968
|
+
const contextValue = React8.useMemo(
|
|
2942
2969
|
() => ({
|
|
2943
2970
|
hasSnapPoints,
|
|
2944
2971
|
modal,
|
|
@@ -2947,7 +2974,7 @@ function Drawer({
|
|
|
2947
2974
|
}),
|
|
2948
2975
|
[hasSnapPoints, modal, resolvedShowSwipeHandle, swipeDirection]
|
|
2949
2976
|
);
|
|
2950
|
-
return /* @__PURE__ */
|
|
2977
|
+
return /* @__PURE__ */ jsx26(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx26(
|
|
2951
2978
|
DrawerPrimitive.Root,
|
|
2952
2979
|
{
|
|
2953
2980
|
"data-slot": "drawer",
|
|
@@ -2959,19 +2986,19 @@ function Drawer({
|
|
|
2959
2986
|
) });
|
|
2960
2987
|
}
|
|
2961
2988
|
function DrawerTrigger({ ...props }) {
|
|
2962
|
-
return /* @__PURE__ */
|
|
2989
|
+
return /* @__PURE__ */ jsx26(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
2963
2990
|
}
|
|
2964
2991
|
function DrawerPortal({ ...props }) {
|
|
2965
|
-
return /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ jsx26(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
|
|
2966
2993
|
}
|
|
2967
2994
|
function DrawerClose({ ...props }) {
|
|
2968
|
-
return /* @__PURE__ */
|
|
2995
|
+
return /* @__PURE__ */ jsx26(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
|
|
2969
2996
|
}
|
|
2970
2997
|
function DrawerOverlay({
|
|
2971
2998
|
className,
|
|
2972
2999
|
...props
|
|
2973
3000
|
}) {
|
|
2974
|
-
return /* @__PURE__ */
|
|
3001
|
+
return /* @__PURE__ */ jsx26(
|
|
2975
3002
|
DrawerPrimitive.Backdrop,
|
|
2976
3003
|
{
|
|
2977
3004
|
"data-slot": "drawer-overlay",
|
|
@@ -2987,7 +3014,7 @@ function DrawerSwipeHandle({
|
|
|
2987
3014
|
className,
|
|
2988
3015
|
...props
|
|
2989
3016
|
}) {
|
|
2990
|
-
return /* @__PURE__ */
|
|
3017
|
+
return /* @__PURE__ */ jsx26(
|
|
2991
3018
|
"div",
|
|
2992
3019
|
{
|
|
2993
3020
|
"data-slot": "drawer-swipe-handle",
|
|
@@ -3008,8 +3035,8 @@ function DrawerContent({
|
|
|
3008
3035
|
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();
|
|
3009
3036
|
const swipeAxis = swipeDirection === "down" || swipeDirection === "up" ? "y" : "x";
|
|
3010
3037
|
return /* @__PURE__ */ jsxs14(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
3011
|
-
modal === true && /* @__PURE__ */
|
|
3012
|
-
/* @__PURE__ */
|
|
3038
|
+
modal === true && /* @__PURE__ */ jsx26(DrawerOverlay, { "data-snap-points": hasSnapPoints ? "" : void 0 }),
|
|
3039
|
+
/* @__PURE__ */ jsx26(
|
|
3013
3040
|
DrawerPrimitive.Viewport,
|
|
3014
3041
|
{
|
|
3015
3042
|
"data-slot": "drawer-viewport",
|
|
@@ -3023,7 +3050,7 @@ function DrawerContent({
|
|
|
3023
3050
|
"data-snap-points": hasSnapPoints ? "" : void 0,
|
|
3024
3051
|
className: cn(
|
|
3025
3052
|
// Base.
|
|
3026
|
-
"group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col rounded-4xl border bg-card text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [--drawer-bleed-background:transparent] [--drawer-inset:--spacing(2)] [interpolate-size:allow-keywords] dark:border-border",
|
|
3053
|
+
"group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col rounded-4xl border bg-card text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [--drawer-bleed-background:transparent] [--drawer-inset:--spacing(2)] [interpolate-size:allow-keywords] max-md:pb-(--app-safe-bottom) md:pb-0 dark:border-border",
|
|
3027
3054
|
// Nested.
|
|
3028
3055
|
"data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
|
|
3029
3056
|
// Bleed.
|
|
@@ -3050,8 +3077,8 @@ function DrawerContent({
|
|
|
3050
3077
|
),
|
|
3051
3078
|
...props,
|
|
3052
3079
|
children: [
|
|
3053
|
-
showSwipeHandle && /* @__PURE__ */
|
|
3054
|
-
/* @__PURE__ */
|
|
3080
|
+
showSwipeHandle && /* @__PURE__ */ jsx26(DrawerSwipeHandle, {}),
|
|
3081
|
+
/* @__PURE__ */ jsx26(
|
|
3055
3082
|
DrawerPrimitive.Content,
|
|
3056
3083
|
{
|
|
3057
3084
|
"data-slot": "drawer-content",
|
|
@@ -3069,7 +3096,7 @@ function DrawerContent({
|
|
|
3069
3096
|
] });
|
|
3070
3097
|
}
|
|
3071
3098
|
function DrawerHeader({ className, ...props }) {
|
|
3072
|
-
return /* @__PURE__ */
|
|
3099
|
+
return /* @__PURE__ */ jsx26(
|
|
3073
3100
|
"div",
|
|
3074
3101
|
{
|
|
3075
3102
|
"data-slot": "drawer-header",
|
|
@@ -3082,7 +3109,7 @@ function DrawerHeader({ className, ...props }) {
|
|
|
3082
3109
|
);
|
|
3083
3110
|
}
|
|
3084
3111
|
function DrawerFooter({ className, ...props }) {
|
|
3085
|
-
return /* @__PURE__ */
|
|
3112
|
+
return /* @__PURE__ */ jsx26(
|
|
3086
3113
|
"div",
|
|
3087
3114
|
{
|
|
3088
3115
|
"data-slot": "drawer-footer",
|
|
@@ -3092,7 +3119,7 @@ function DrawerFooter({ className, ...props }) {
|
|
|
3092
3119
|
);
|
|
3093
3120
|
}
|
|
3094
3121
|
function DrawerTitle({ className, ...props }) {
|
|
3095
|
-
return /* @__PURE__ */
|
|
3122
|
+
return /* @__PURE__ */ jsx26(
|
|
3096
3123
|
DrawerPrimitive.Title,
|
|
3097
3124
|
{
|
|
3098
3125
|
"data-slot": "drawer-title",
|
|
@@ -3108,7 +3135,7 @@ function DrawerDescription({
|
|
|
3108
3135
|
className,
|
|
3109
3136
|
...props
|
|
3110
3137
|
}) {
|
|
3111
|
-
return /* @__PURE__ */
|
|
3138
|
+
return /* @__PURE__ */ jsx26(
|
|
3112
3139
|
DrawerPrimitive.Description,
|
|
3113
3140
|
{
|
|
3114
3141
|
"data-slot": "drawer-description",
|
|
@@ -3121,15 +3148,15 @@ function DrawerDescription({
|
|
|
3121
3148
|
// src/ui/dropdown-menu.tsx
|
|
3122
3149
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
3123
3150
|
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
3124
|
-
import { jsx as
|
|
3151
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3125
3152
|
function DropdownMenu({ ...props }) {
|
|
3126
|
-
return /* @__PURE__ */
|
|
3153
|
+
return /* @__PURE__ */ jsx27(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
3127
3154
|
}
|
|
3128
3155
|
function DropdownMenuPortal({ ...props }) {
|
|
3129
|
-
return /* @__PURE__ */
|
|
3156
|
+
return /* @__PURE__ */ jsx27(MenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
3130
3157
|
}
|
|
3131
3158
|
function DropdownMenuTrigger({ ...props }) {
|
|
3132
|
-
return /* @__PURE__ */
|
|
3159
|
+
return /* @__PURE__ */ jsx27(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
3133
3160
|
}
|
|
3134
3161
|
function DropdownMenuContent({
|
|
3135
3162
|
align = "start",
|
|
@@ -3139,7 +3166,7 @@ function DropdownMenuContent({
|
|
|
3139
3166
|
className,
|
|
3140
3167
|
...props
|
|
3141
3168
|
}) {
|
|
3142
|
-
return /* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ jsx27(MenuPrimitive.Portal, { children: /* @__PURE__ */ jsx27(
|
|
3143
3170
|
MenuPrimitive.Positioner,
|
|
3144
3171
|
{
|
|
3145
3172
|
className: "isolate z-50 outline-none",
|
|
@@ -3147,7 +3174,7 @@ function DropdownMenuContent({
|
|
|
3147
3174
|
alignOffset,
|
|
3148
3175
|
side,
|
|
3149
3176
|
sideOffset,
|
|
3150
|
-
children: /* @__PURE__ */
|
|
3177
|
+
children: /* @__PURE__ */ jsx27(
|
|
3151
3178
|
MenuPrimitive.Popup,
|
|
3152
3179
|
{
|
|
3153
3180
|
"data-slot": "dropdown-menu-content",
|
|
@@ -3162,14 +3189,14 @@ function DropdownMenuContent({
|
|
|
3162
3189
|
) });
|
|
3163
3190
|
}
|
|
3164
3191
|
function DropdownMenuGroup({ ...props }) {
|
|
3165
|
-
return /* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ jsx27(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
3166
3193
|
}
|
|
3167
3194
|
function DropdownMenuLabel({
|
|
3168
3195
|
className,
|
|
3169
3196
|
inset,
|
|
3170
3197
|
...props
|
|
3171
3198
|
}) {
|
|
3172
|
-
return /* @__PURE__ */
|
|
3199
|
+
return /* @__PURE__ */ jsx27(
|
|
3173
3200
|
MenuPrimitive.GroupLabel,
|
|
3174
3201
|
{
|
|
3175
3202
|
"data-slot": "dropdown-menu-label",
|
|
@@ -3188,7 +3215,7 @@ function DropdownMenuItem({
|
|
|
3188
3215
|
variant = "default",
|
|
3189
3216
|
...props
|
|
3190
3217
|
}) {
|
|
3191
|
-
return /* @__PURE__ */
|
|
3218
|
+
return /* @__PURE__ */ jsx27(
|
|
3192
3219
|
MenuPrimitive.Item,
|
|
3193
3220
|
{
|
|
3194
3221
|
"data-slot": "dropdown-menu-item",
|
|
@@ -3203,7 +3230,7 @@ function DropdownMenuItem({
|
|
|
3203
3230
|
);
|
|
3204
3231
|
}
|
|
3205
3232
|
function DropdownMenuSub({ ...props }) {
|
|
3206
|
-
return /* @__PURE__ */
|
|
3233
|
+
return /* @__PURE__ */ jsx27(MenuPrimitive.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...props });
|
|
3207
3234
|
}
|
|
3208
3235
|
function DropdownMenuSubTrigger({
|
|
3209
3236
|
className,
|
|
@@ -3223,7 +3250,7 @@ function DropdownMenuSubTrigger({
|
|
|
3223
3250
|
...props,
|
|
3224
3251
|
children: [
|
|
3225
3252
|
children,
|
|
3226
|
-
/* @__PURE__ */
|
|
3253
|
+
/* @__PURE__ */ jsx27(ChevronRightIcon, { className: "ml-auto" })
|
|
3227
3254
|
]
|
|
3228
3255
|
}
|
|
3229
3256
|
);
|
|
@@ -3236,7 +3263,7 @@ function DropdownMenuSubContent({
|
|
|
3236
3263
|
className,
|
|
3237
3264
|
...props
|
|
3238
3265
|
}) {
|
|
3239
|
-
return /* @__PURE__ */
|
|
3266
|
+
return /* @__PURE__ */ jsx27(
|
|
3240
3267
|
DropdownMenuContent,
|
|
3241
3268
|
{
|
|
3242
3269
|
"data-slot": "dropdown-menu-sub-content",
|
|
@@ -3271,12 +3298,12 @@ function DropdownMenuCheckboxItem({
|
|
|
3271
3298
|
checked,
|
|
3272
3299
|
...props,
|
|
3273
3300
|
children: [
|
|
3274
|
-
/* @__PURE__ */
|
|
3301
|
+
/* @__PURE__ */ jsx27(
|
|
3275
3302
|
"span",
|
|
3276
3303
|
{
|
|
3277
3304
|
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
3278
3305
|
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
3279
|
-
children: /* @__PURE__ */
|
|
3306
|
+
children: /* @__PURE__ */ jsx27(MenuPrimitive.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx27(CheckIcon, {}) })
|
|
3280
3307
|
}
|
|
3281
3308
|
),
|
|
3282
3309
|
children
|
|
@@ -3285,7 +3312,7 @@ function DropdownMenuCheckboxItem({
|
|
|
3285
3312
|
);
|
|
3286
3313
|
}
|
|
3287
3314
|
function DropdownMenuRadioGroup({ ...props }) {
|
|
3288
|
-
return /* @__PURE__ */
|
|
3315
|
+
return /* @__PURE__ */ jsx27(
|
|
3289
3316
|
MenuPrimitive.RadioGroup,
|
|
3290
3317
|
{
|
|
3291
3318
|
"data-slot": "dropdown-menu-radio-group",
|
|
@@ -3310,12 +3337,12 @@ function DropdownMenuRadioItem({
|
|
|
3310
3337
|
),
|
|
3311
3338
|
...props,
|
|
3312
3339
|
children: [
|
|
3313
|
-
/* @__PURE__ */
|
|
3340
|
+
/* @__PURE__ */ jsx27(
|
|
3314
3341
|
"span",
|
|
3315
3342
|
{
|
|
3316
3343
|
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
3317
3344
|
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
3318
|
-
children: /* @__PURE__ */
|
|
3345
|
+
children: /* @__PURE__ */ jsx27(MenuPrimitive.RadioItemIndicator, { children: /* @__PURE__ */ jsx27(CheckIcon, {}) })
|
|
3319
3346
|
}
|
|
3320
3347
|
),
|
|
3321
3348
|
children
|
|
@@ -3327,7 +3354,7 @@ function DropdownMenuSeparator({
|
|
|
3327
3354
|
className,
|
|
3328
3355
|
...props
|
|
3329
3356
|
}) {
|
|
3330
|
-
return /* @__PURE__ */
|
|
3357
|
+
return /* @__PURE__ */ jsx27(
|
|
3331
3358
|
MenuPrimitive.Separator,
|
|
3332
3359
|
{
|
|
3333
3360
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -3340,7 +3367,7 @@ function DropdownMenuShortcut({
|
|
|
3340
3367
|
className,
|
|
3341
3368
|
...props
|
|
3342
3369
|
}) {
|
|
3343
|
-
return /* @__PURE__ */
|
|
3370
|
+
return /* @__PURE__ */ jsx27(
|
|
3344
3371
|
"span",
|
|
3345
3372
|
{
|
|
3346
3373
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -3355,9 +3382,9 @@ function DropdownMenuShortcut({
|
|
|
3355
3382
|
|
|
3356
3383
|
// src/ui/empty.tsx
|
|
3357
3384
|
import { cva as cva6 } from "class-variance-authority";
|
|
3358
|
-
import { jsx as
|
|
3385
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3359
3386
|
function Empty({ className, ...props }) {
|
|
3360
|
-
return /* @__PURE__ */
|
|
3387
|
+
return /* @__PURE__ */ jsx28(
|
|
3361
3388
|
"div",
|
|
3362
3389
|
{
|
|
3363
3390
|
"data-slot": "empty",
|
|
@@ -3370,7 +3397,7 @@ function Empty({ className, ...props }) {
|
|
|
3370
3397
|
);
|
|
3371
3398
|
}
|
|
3372
3399
|
function EmptyHeader({ className, ...props }) {
|
|
3373
|
-
return /* @__PURE__ */
|
|
3400
|
+
return /* @__PURE__ */ jsx28(
|
|
3374
3401
|
"div",
|
|
3375
3402
|
{
|
|
3376
3403
|
"data-slot": "empty-header",
|
|
@@ -3398,7 +3425,7 @@ function EmptyMedia({
|
|
|
3398
3425
|
variant = "default",
|
|
3399
3426
|
...props
|
|
3400
3427
|
}) {
|
|
3401
|
-
return /* @__PURE__ */
|
|
3428
|
+
return /* @__PURE__ */ jsx28(
|
|
3402
3429
|
"div",
|
|
3403
3430
|
{
|
|
3404
3431
|
"data-slot": "empty-icon",
|
|
@@ -3409,7 +3436,7 @@ function EmptyMedia({
|
|
|
3409
3436
|
);
|
|
3410
3437
|
}
|
|
3411
3438
|
function EmptyTitle({ className, ...props }) {
|
|
3412
|
-
return /* @__PURE__ */
|
|
3439
|
+
return /* @__PURE__ */ jsx28(
|
|
3413
3440
|
"div",
|
|
3414
3441
|
{
|
|
3415
3442
|
"data-slot": "empty-title",
|
|
@@ -3419,7 +3446,7 @@ function EmptyTitle({ className, ...props }) {
|
|
|
3419
3446
|
);
|
|
3420
3447
|
}
|
|
3421
3448
|
function EmptyDescription({ className, ...props }) {
|
|
3422
|
-
return /* @__PURE__ */
|
|
3449
|
+
return /* @__PURE__ */ jsx28(
|
|
3423
3450
|
"div",
|
|
3424
3451
|
{
|
|
3425
3452
|
"data-slot": "empty-description",
|
|
@@ -3432,7 +3459,7 @@ function EmptyDescription({ className, ...props }) {
|
|
|
3432
3459
|
);
|
|
3433
3460
|
}
|
|
3434
3461
|
function EmptyContent({ className, ...props }) {
|
|
3435
|
-
return /* @__PURE__ */
|
|
3462
|
+
return /* @__PURE__ */ jsx28(
|
|
3436
3463
|
"div",
|
|
3437
3464
|
{
|
|
3438
3465
|
"data-slot": "empty-content",
|
|
@@ -3742,9 +3769,9 @@ import { cva as cva7 } from "class-variance-authority";
|
|
|
3742
3769
|
import { useMemo as useMemo3 } from "react";
|
|
3743
3770
|
|
|
3744
3771
|
// src/ui/label.tsx
|
|
3745
|
-
import { jsx as
|
|
3772
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3746
3773
|
function Label({ className, ...props }) {
|
|
3747
|
-
return /* @__PURE__ */
|
|
3774
|
+
return /* @__PURE__ */ jsx29(
|
|
3748
3775
|
"label",
|
|
3749
3776
|
{
|
|
3750
3777
|
"data-slot": "label",
|
|
@@ -3758,9 +3785,9 @@ function Label({ className, ...props }) {
|
|
|
3758
3785
|
}
|
|
3759
3786
|
|
|
3760
3787
|
// src/ui/field.tsx
|
|
3761
|
-
import { jsx as
|
|
3788
|
+
import { jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3762
3789
|
function FieldSet({ className, ...props }) {
|
|
3763
|
-
return /* @__PURE__ */
|
|
3790
|
+
return /* @__PURE__ */ jsx30(
|
|
3764
3791
|
"fieldset",
|
|
3765
3792
|
{
|
|
3766
3793
|
"data-slot": "field-set",
|
|
@@ -3777,7 +3804,7 @@ function FieldLegend({
|
|
|
3777
3804
|
variant = "legend",
|
|
3778
3805
|
...props
|
|
3779
3806
|
}) {
|
|
3780
|
-
return /* @__PURE__ */
|
|
3807
|
+
return /* @__PURE__ */ jsx30(
|
|
3781
3808
|
"legend",
|
|
3782
3809
|
{
|
|
3783
3810
|
"data-slot": "field-legend",
|
|
@@ -3791,7 +3818,7 @@ function FieldLegend({
|
|
|
3791
3818
|
);
|
|
3792
3819
|
}
|
|
3793
3820
|
function FieldGroup({ className, ...props }) {
|
|
3794
|
-
return /* @__PURE__ */
|
|
3821
|
+
return /* @__PURE__ */ jsx30(
|
|
3795
3822
|
"div",
|
|
3796
3823
|
{
|
|
3797
3824
|
"data-slot": "field-group",
|
|
@@ -3823,7 +3850,7 @@ function Field({
|
|
|
3823
3850
|
orientation = "vertical",
|
|
3824
3851
|
...props
|
|
3825
3852
|
}) {
|
|
3826
|
-
return /* @__PURE__ */
|
|
3853
|
+
return /* @__PURE__ */ jsx30(
|
|
3827
3854
|
"div",
|
|
3828
3855
|
{
|
|
3829
3856
|
role: "group",
|
|
@@ -3835,7 +3862,7 @@ function Field({
|
|
|
3835
3862
|
);
|
|
3836
3863
|
}
|
|
3837
3864
|
function FieldContent({ className, ...props }) {
|
|
3838
|
-
return /* @__PURE__ */
|
|
3865
|
+
return /* @__PURE__ */ jsx30(
|
|
3839
3866
|
"div",
|
|
3840
3867
|
{
|
|
3841
3868
|
"data-slot": "field-content",
|
|
@@ -3851,7 +3878,7 @@ function FieldLabel({
|
|
|
3851
3878
|
className,
|
|
3852
3879
|
...props
|
|
3853
3880
|
}) {
|
|
3854
|
-
return /* @__PURE__ */
|
|
3881
|
+
return /* @__PURE__ */ jsx30(
|
|
3855
3882
|
Label,
|
|
3856
3883
|
{
|
|
3857
3884
|
"data-slot": "field-label",
|
|
@@ -3865,7 +3892,7 @@ function FieldLabel({
|
|
|
3865
3892
|
);
|
|
3866
3893
|
}
|
|
3867
3894
|
function FieldTitle({ className, ...props }) {
|
|
3868
|
-
return /* @__PURE__ */
|
|
3895
|
+
return /* @__PURE__ */ jsx30(
|
|
3869
3896
|
"div",
|
|
3870
3897
|
{
|
|
3871
3898
|
"data-slot": "field-label",
|
|
@@ -3878,7 +3905,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
3878
3905
|
);
|
|
3879
3906
|
}
|
|
3880
3907
|
function FieldDescription({ className, ...props }) {
|
|
3881
|
-
return /* @__PURE__ */
|
|
3908
|
+
return /* @__PURE__ */ jsx30(
|
|
3882
3909
|
"p",
|
|
3883
3910
|
{
|
|
3884
3911
|
"data-slot": "field-description",
|
|
@@ -3908,8 +3935,8 @@ function FieldSeparator({
|
|
|
3908
3935
|
),
|
|
3909
3936
|
...props,
|
|
3910
3937
|
children: [
|
|
3911
|
-
/* @__PURE__ */
|
|
3912
|
-
children && /* @__PURE__ */
|
|
3938
|
+
/* @__PURE__ */ jsx30(Separator, { className: "absolute inset-0 top-1/2" }),
|
|
3939
|
+
children && /* @__PURE__ */ jsx30(
|
|
3913
3940
|
"span",
|
|
3914
3941
|
{
|
|
3915
3942
|
className: "relative mx-auto block w-fit px-2 text-muted-foreground",
|
|
@@ -3940,14 +3967,14 @@ function FieldError({
|
|
|
3940
3967
|
if (uniqueErrors?.length == 1) {
|
|
3941
3968
|
return uniqueErrors[0]?.message;
|
|
3942
3969
|
}
|
|
3943
|
-
return /* @__PURE__ */
|
|
3944
|
-
(error, index) => error?.message && /* @__PURE__ */
|
|
3970
|
+
return /* @__PURE__ */ jsx30("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
|
|
3971
|
+
(error, index) => error?.message && /* @__PURE__ */ jsx30("li", { children: error.message }, index)
|
|
3945
3972
|
) });
|
|
3946
3973
|
}, [children, errors]);
|
|
3947
3974
|
if (!content) {
|
|
3948
3975
|
return null;
|
|
3949
3976
|
}
|
|
3950
|
-
return /* @__PURE__ */
|
|
3977
|
+
return /* @__PURE__ */ jsx30(
|
|
3951
3978
|
"div",
|
|
3952
3979
|
{
|
|
3953
3980
|
role: "alert",
|
|
@@ -3962,7 +3989,7 @@ function FieldError({
|
|
|
3962
3989
|
// src/ui/image.tsx
|
|
3963
3990
|
import NextImage from "next/image";
|
|
3964
3991
|
import { useCallback as useCallback2, useState as useState4 } from "react";
|
|
3965
|
-
import { jsx as
|
|
3992
|
+
import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3966
3993
|
function srcValue(src) {
|
|
3967
3994
|
if (!src) return null;
|
|
3968
3995
|
if (typeof src === "string") return src;
|
|
@@ -3982,7 +4009,7 @@ function Image({
|
|
|
3982
4009
|
onLoad,
|
|
3983
4010
|
onError,
|
|
3984
4011
|
children,
|
|
3985
|
-
fallback = /* @__PURE__ */
|
|
4012
|
+
fallback = /* @__PURE__ */ jsx31(JellyMini, { mood: "curious", className: "size-full p-4" }),
|
|
3986
4013
|
...props
|
|
3987
4014
|
}) {
|
|
3988
4015
|
const currentSrc = srcValue(src);
|
|
@@ -4003,8 +4030,8 @@ function Image({
|
|
|
4003
4030
|
setFailedSrc(currentSrc);
|
|
4004
4031
|
}, [currentSrc]);
|
|
4005
4032
|
return /* @__PURE__ */ jsxs17("section", { className: cn("relative block overflow-hidden", wrapper), children: [
|
|
4006
|
-
showSkeleton && !loaded && !failed && hasSource && /* @__PURE__ */
|
|
4007
|
-
hasSource && !failed ? /* @__PURE__ */
|
|
4033
|
+
showSkeleton && !loaded && !failed && hasSource && /* @__PURE__ */ jsx31(Skeleton, { className: "absolute inset-0 size-full" }),
|
|
4034
|
+
hasSource && !failed ? /* @__PURE__ */ jsx31(
|
|
4008
4035
|
NextImage,
|
|
4009
4036
|
{
|
|
4010
4037
|
...props,
|
|
@@ -4034,16 +4061,16 @@ function Image({
|
|
|
4034
4061
|
}
|
|
4035
4062
|
|
|
4036
4063
|
// src/ui/input-otp.tsx
|
|
4037
|
-
import * as
|
|
4064
|
+
import * as React9 from "react";
|
|
4038
4065
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
4039
4066
|
import { MinusIcon } from "lucide-react";
|
|
4040
|
-
import { jsx as
|
|
4067
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4041
4068
|
function InputOTP({
|
|
4042
4069
|
className,
|
|
4043
4070
|
containerClassName,
|
|
4044
4071
|
...props
|
|
4045
4072
|
}) {
|
|
4046
|
-
return /* @__PURE__ */
|
|
4073
|
+
return /* @__PURE__ */ jsx32(
|
|
4047
4074
|
OTPInput,
|
|
4048
4075
|
{
|
|
4049
4076
|
"data-slot": "input-otp",
|
|
@@ -4058,7 +4085,7 @@ function InputOTP({
|
|
|
4058
4085
|
);
|
|
4059
4086
|
}
|
|
4060
4087
|
function InputOTPGroup({ className, ...props }) {
|
|
4061
|
-
return /* @__PURE__ */
|
|
4088
|
+
return /* @__PURE__ */ jsx32(
|
|
4062
4089
|
"div",
|
|
4063
4090
|
{
|
|
4064
4091
|
"data-slot": "input-otp-group",
|
|
@@ -4075,7 +4102,7 @@ function InputOTPSlot({
|
|
|
4075
4102
|
className,
|
|
4076
4103
|
...props
|
|
4077
4104
|
}) {
|
|
4078
|
-
const inputOTPContext =
|
|
4105
|
+
const inputOTPContext = React9.useContext(OTPInputContext);
|
|
4079
4106
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
4080
4107
|
return /* @__PURE__ */ jsxs18(
|
|
4081
4108
|
"div",
|
|
@@ -4089,20 +4116,20 @@ function InputOTPSlot({
|
|
|
4089
4116
|
...props,
|
|
4090
4117
|
children: [
|
|
4091
4118
|
char,
|
|
4092
|
-
hasFakeCaret && /* @__PURE__ */
|
|
4119
|
+
hasFakeCaret && /* @__PURE__ */ jsx32("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx32("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) })
|
|
4093
4120
|
]
|
|
4094
4121
|
}
|
|
4095
4122
|
);
|
|
4096
4123
|
}
|
|
4097
4124
|
function InputOTPSeparator({ ...props }) {
|
|
4098
|
-
return /* @__PURE__ */
|
|
4125
|
+
return /* @__PURE__ */ jsx32(
|
|
4099
4126
|
"div",
|
|
4100
4127
|
{
|
|
4101
4128
|
"data-slot": "input-otp-separator",
|
|
4102
4129
|
className: "flex items-center [&_svg:not([class*='size-'])]:size-4",
|
|
4103
4130
|
role: "separator",
|
|
4104
4131
|
...props,
|
|
4105
|
-
children: /* @__PURE__ */
|
|
4132
|
+
children: /* @__PURE__ */ jsx32(MinusIcon, {})
|
|
4106
4133
|
}
|
|
4107
4134
|
);
|
|
4108
4135
|
}
|
|
@@ -4111,9 +4138,9 @@ function InputOTPSeparator({ ...props }) {
|
|
|
4111
4138
|
import { mergeProps as mergeProps4 } from "@base-ui/react/merge-props";
|
|
4112
4139
|
import { useRender as useRender4 } from "@base-ui/react/use-render";
|
|
4113
4140
|
import { cva as cva8 } from "class-variance-authority";
|
|
4114
|
-
import { jsx as
|
|
4141
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
4115
4142
|
function ItemGroup({ className, ...props }) {
|
|
4116
|
-
return /* @__PURE__ */
|
|
4143
|
+
return /* @__PURE__ */ jsx33(
|
|
4117
4144
|
"div",
|
|
4118
4145
|
{
|
|
4119
4146
|
role: "list",
|
|
@@ -4130,7 +4157,7 @@ function ItemSeparator({
|
|
|
4130
4157
|
className,
|
|
4131
4158
|
...props
|
|
4132
4159
|
}) {
|
|
4133
|
-
return /* @__PURE__ */
|
|
4160
|
+
return /* @__PURE__ */ jsx33(
|
|
4134
4161
|
Separator,
|
|
4135
4162
|
{
|
|
4136
4163
|
"data-slot": "item-separator",
|
|
@@ -4204,7 +4231,7 @@ function ItemMedia({
|
|
|
4204
4231
|
variant = "default",
|
|
4205
4232
|
...props
|
|
4206
4233
|
}) {
|
|
4207
|
-
return /* @__PURE__ */
|
|
4234
|
+
return /* @__PURE__ */ jsx33(
|
|
4208
4235
|
"div",
|
|
4209
4236
|
{
|
|
4210
4237
|
"data-slot": "item-media",
|
|
@@ -4215,7 +4242,7 @@ function ItemMedia({
|
|
|
4215
4242
|
);
|
|
4216
4243
|
}
|
|
4217
4244
|
function ItemContent({ className, ...props }) {
|
|
4218
|
-
return /* @__PURE__ */
|
|
4245
|
+
return /* @__PURE__ */ jsx33(
|
|
4219
4246
|
"div",
|
|
4220
4247
|
{
|
|
4221
4248
|
"data-slot": "item-content",
|
|
@@ -4228,7 +4255,7 @@ function ItemContent({ className, ...props }) {
|
|
|
4228
4255
|
);
|
|
4229
4256
|
}
|
|
4230
4257
|
function ItemTitle({ className, ...props }) {
|
|
4231
|
-
return /* @__PURE__ */
|
|
4258
|
+
return /* @__PURE__ */ jsx33(
|
|
4232
4259
|
"div",
|
|
4233
4260
|
{
|
|
4234
4261
|
"data-slot": "item-title",
|
|
@@ -4241,7 +4268,7 @@ function ItemTitle({ className, ...props }) {
|
|
|
4241
4268
|
);
|
|
4242
4269
|
}
|
|
4243
4270
|
function ItemDescription({ className, ...props }) {
|
|
4244
|
-
return /* @__PURE__ */
|
|
4271
|
+
return /* @__PURE__ */ jsx33(
|
|
4245
4272
|
"p",
|
|
4246
4273
|
{
|
|
4247
4274
|
"data-slot": "item-description",
|
|
@@ -4254,7 +4281,7 @@ function ItemDescription({ className, ...props }) {
|
|
|
4254
4281
|
);
|
|
4255
4282
|
}
|
|
4256
4283
|
function ItemActions({ className, ...props }) {
|
|
4257
|
-
return /* @__PURE__ */
|
|
4284
|
+
return /* @__PURE__ */ jsx33(
|
|
4258
4285
|
"div",
|
|
4259
4286
|
{
|
|
4260
4287
|
"data-slot": "item-actions",
|
|
@@ -4264,7 +4291,7 @@ function ItemActions({ className, ...props }) {
|
|
|
4264
4291
|
);
|
|
4265
4292
|
}
|
|
4266
4293
|
function ItemHeader({ className, ...props }) {
|
|
4267
|
-
return /* @__PURE__ */
|
|
4294
|
+
return /* @__PURE__ */ jsx33(
|
|
4268
4295
|
"div",
|
|
4269
4296
|
{
|
|
4270
4297
|
"data-slot": "item-header",
|
|
@@ -4277,7 +4304,7 @@ function ItemHeader({ className, ...props }) {
|
|
|
4277
4304
|
);
|
|
4278
4305
|
}
|
|
4279
4306
|
function ItemFooter({ className, ...props }) {
|
|
4280
|
-
return /* @__PURE__ */
|
|
4307
|
+
return /* @__PURE__ */ jsx33(
|
|
4281
4308
|
"div",
|
|
4282
4309
|
{
|
|
4283
4310
|
"data-slot": "item-footer",
|
|
@@ -4302,16 +4329,18 @@ function useMounted() {
|
|
|
4302
4329
|
|
|
4303
4330
|
// src/ui/jelly.tsx
|
|
4304
4331
|
import {
|
|
4332
|
+
BlobSpeech,
|
|
4305
4333
|
JellyBlobMascot
|
|
4306
4334
|
} from "feral-blob";
|
|
4307
|
-
import "
|
|
4335
|
+
import * as React10 from "react";
|
|
4308
4336
|
import {
|
|
4309
|
-
BlobSpeech,
|
|
4310
|
-
JellyBlobMascot as JellyBlobMascot2
|
|
4337
|
+
BlobSpeech as BlobSpeech2,
|
|
4338
|
+
JellyBlobMascot as JellyBlobMascot2,
|
|
4339
|
+
JellyBlobMascotDemo
|
|
4311
4340
|
} from "feral-blob";
|
|
4312
|
-
import { jsx as
|
|
4341
|
+
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4313
4342
|
function JellyBlob({ ...props }) {
|
|
4314
|
-
return /* @__PURE__ */
|
|
4343
|
+
return /* @__PURE__ */ jsx34("span", { className: "inline-block", children: /* @__PURE__ */ jsx34(
|
|
4315
4344
|
JellyBlobMascot,
|
|
4316
4345
|
{
|
|
4317
4346
|
...props,
|
|
@@ -4336,10 +4365,12 @@ var MOOD_GAZE = {
|
|
|
4336
4365
|
};
|
|
4337
4366
|
function JellyMini({
|
|
4338
4367
|
mood = "neutral",
|
|
4339
|
-
|
|
4368
|
+
gaze,
|
|
4369
|
+
className,
|
|
4370
|
+
...props
|
|
4340
4371
|
}) {
|
|
4341
4372
|
const { mounted } = useMounted();
|
|
4342
|
-
return /* @__PURE__ */
|
|
4373
|
+
return /* @__PURE__ */ jsx34(
|
|
4343
4374
|
"span",
|
|
4344
4375
|
{
|
|
4345
4376
|
"aria-hidden": "true",
|
|
@@ -4347,22 +4378,159 @@ function JellyMini({
|
|
|
4347
4378
|
"inline-flex size-5 shrink-0 items-center justify-center select-none",
|
|
4348
4379
|
className
|
|
4349
4380
|
),
|
|
4350
|
-
children: mounted ? /* @__PURE__ */
|
|
4381
|
+
children: mounted ? /* @__PURE__ */ jsx34(
|
|
4351
4382
|
JellyBlobMascot,
|
|
4352
4383
|
{
|
|
4384
|
+
...props,
|
|
4353
4385
|
mood,
|
|
4354
|
-
gaze: MOOD_GAZE[mood],
|
|
4386
|
+
gaze: gaze ?? MOOD_GAZE[mood],
|
|
4355
4387
|
className: "h-auto w-full"
|
|
4356
4388
|
}
|
|
4357
4389
|
) : null
|
|
4358
4390
|
}
|
|
4359
4391
|
);
|
|
4360
4392
|
}
|
|
4393
|
+
var JellyMascotContext = React10.createContext(null);
|
|
4394
|
+
function useJellyMood() {
|
|
4395
|
+
const state = React10.useContext(JellyMascotContext);
|
|
4396
|
+
return React10.useCallback(
|
|
4397
|
+
(mood) => {
|
|
4398
|
+
if (!mood || !state) return {};
|
|
4399
|
+
return {
|
|
4400
|
+
onPointerEnter: () => state.setPreview(mood),
|
|
4401
|
+
onFocus: () => state.setPreview(mood),
|
|
4402
|
+
onPointerLeave: () => state.setPreview(null),
|
|
4403
|
+
onBlur: () => state.setPreview(null)
|
|
4404
|
+
};
|
|
4405
|
+
},
|
|
4406
|
+
[state]
|
|
4407
|
+
);
|
|
4408
|
+
}
|
|
4409
|
+
function withPreviewHandlers(preview, props) {
|
|
4410
|
+
const handlers = preview(props.mood);
|
|
4411
|
+
return {
|
|
4412
|
+
onPointerEnter: props.onPointerEnter ?? handlers.onPointerEnter,
|
|
4413
|
+
onPointerLeave: props.onPointerLeave ?? handlers.onPointerLeave,
|
|
4414
|
+
onFocus: props.onFocus ?? handlers.onFocus,
|
|
4415
|
+
onBlur: props.onBlur ?? handlers.onBlur
|
|
4416
|
+
};
|
|
4417
|
+
}
|
|
4418
|
+
function JellyAction({
|
|
4419
|
+
mood,
|
|
4420
|
+
...props
|
|
4421
|
+
}) {
|
|
4422
|
+
const preview = useJellyMood();
|
|
4423
|
+
return /* @__PURE__ */ jsx34(Button, { ...props, ...withPreviewHandlers(preview, { ...props, mood }) });
|
|
4424
|
+
}
|
|
4425
|
+
function JellyLink({
|
|
4426
|
+
mood,
|
|
4427
|
+
...props
|
|
4428
|
+
}) {
|
|
4429
|
+
const preview = useJellyMood();
|
|
4430
|
+
return /* @__PURE__ */ jsx34("a", { ...props, ...withPreviewHandlers(preview, { ...props, mood }) });
|
|
4431
|
+
}
|
|
4432
|
+
function JellyMascotProvider({
|
|
4433
|
+
mood = "neutral",
|
|
4434
|
+
speech,
|
|
4435
|
+
children,
|
|
4436
|
+
...blobProps
|
|
4437
|
+
}) {
|
|
4438
|
+
const { mounted } = useMounted();
|
|
4439
|
+
const [previewMood, setPreviewMood] = React10.useState(
|
|
4440
|
+
null
|
|
4441
|
+
);
|
|
4442
|
+
const activeMood = previewMood ?? mood;
|
|
4443
|
+
const value = {
|
|
4444
|
+
mood: activeMood,
|
|
4445
|
+
speech,
|
|
4446
|
+
nod: blobProps.nod ?? false,
|
|
4447
|
+
gaze: blobProps.gaze ?? MOOD_GAZE[activeMood],
|
|
4448
|
+
mounted,
|
|
4449
|
+
blobProps,
|
|
4450
|
+
setPreview: setPreviewMood
|
|
4451
|
+
};
|
|
4452
|
+
return /* @__PURE__ */ jsx34(JellyMascotContext.Provider, { value, children });
|
|
4453
|
+
}
|
|
4454
|
+
var SIZE_WRAPPER = {
|
|
4455
|
+
sm: "w-20",
|
|
4456
|
+
md: "w-28",
|
|
4457
|
+
lg: "w-48",
|
|
4458
|
+
auto: "w-auto"
|
|
4459
|
+
};
|
|
4460
|
+
function JellyMascotFace({
|
|
4461
|
+
size = "md",
|
|
4462
|
+
className
|
|
4463
|
+
}) {
|
|
4464
|
+
const mascot = React10.useContext(JellyMascotContext);
|
|
4465
|
+
if (!mascot) return null;
|
|
4466
|
+
return /* @__PURE__ */ jsxs19(
|
|
4467
|
+
"div",
|
|
4468
|
+
{
|
|
4469
|
+
"aria-hidden": "true",
|
|
4470
|
+
className: cn(
|
|
4471
|
+
"flex flex-col items-center select-none",
|
|
4472
|
+
SIZE_WRAPPER[size],
|
|
4473
|
+
className
|
|
4474
|
+
),
|
|
4475
|
+
children: [
|
|
4476
|
+
mascot.speech ? /* @__PURE__ */ jsx34(
|
|
4477
|
+
BlobSpeech,
|
|
4478
|
+
{
|
|
4479
|
+
mood: mascot.mood,
|
|
4480
|
+
messages: { [mascot.mood]: mascot.speech }
|
|
4481
|
+
}
|
|
4482
|
+
) : null,
|
|
4483
|
+
mascot.mounted ? /* @__PURE__ */ jsx34(
|
|
4484
|
+
JellyBlobMascot,
|
|
4485
|
+
{
|
|
4486
|
+
...mascot.blobProps,
|
|
4487
|
+
mood: mascot.mood,
|
|
4488
|
+
gaze: mascot.gaze,
|
|
4489
|
+
nod: mascot.nod,
|
|
4490
|
+
className: "h-auto w-full"
|
|
4491
|
+
}
|
|
4492
|
+
) : null
|
|
4493
|
+
]
|
|
4494
|
+
}
|
|
4495
|
+
);
|
|
4496
|
+
}
|
|
4497
|
+
function JellyMascot({
|
|
4498
|
+
size = "md",
|
|
4499
|
+
className,
|
|
4500
|
+
...config
|
|
4501
|
+
}) {
|
|
4502
|
+
const existing = React10.useContext(JellyMascotContext);
|
|
4503
|
+
if (existing) return /* @__PURE__ */ jsx34(JellyMascotFace, { size, className });
|
|
4504
|
+
return /* @__PURE__ */ jsx34(JellyMascotProvider, { ...config, children: /* @__PURE__ */ jsx34(JellyMascotFace, { size, className }) });
|
|
4505
|
+
}
|
|
4506
|
+
function JellyGroup({
|
|
4507
|
+
children,
|
|
4508
|
+
...config
|
|
4509
|
+
}) {
|
|
4510
|
+
return /* @__PURE__ */ jsx34(JellyMascotProvider, { ...config, children });
|
|
4511
|
+
}
|
|
4512
|
+
function JellyEmpty({
|
|
4513
|
+
title,
|
|
4514
|
+
description,
|
|
4515
|
+
actions,
|
|
4516
|
+
size = "lg",
|
|
4517
|
+
className,
|
|
4518
|
+
...config
|
|
4519
|
+
}) {
|
|
4520
|
+
return /* @__PURE__ */ jsx34(JellyMascotProvider, { ...config, children: /* @__PURE__ */ jsxs19(Empty, { className: cn("gap-4", className), children: [
|
|
4521
|
+
/* @__PURE__ */ jsxs19(EmptyHeader, { className: "gap-2", children: [
|
|
4522
|
+
/* @__PURE__ */ jsx34(JellyMascotFace, { size }),
|
|
4523
|
+
title ? /* @__PURE__ */ jsx34(EmptyTitle, { className: "text-base font-semibold sm:text-lg", children: title }) : null,
|
|
4524
|
+
description ? /* @__PURE__ */ jsx34(EmptyDescription, { className: "max-w-sm", children: description }) : null
|
|
4525
|
+
] }),
|
|
4526
|
+
actions ? /* @__PURE__ */ jsx34(EmptyContent, { children: actions }) : null
|
|
4527
|
+
] }) });
|
|
4528
|
+
}
|
|
4361
4529
|
|
|
4362
4530
|
// src/ui/kbd.tsx
|
|
4363
|
-
import { jsx as
|
|
4531
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4364
4532
|
function Kbd({ className, ...props }) {
|
|
4365
|
-
return /* @__PURE__ */
|
|
4533
|
+
return /* @__PURE__ */ jsx35(
|
|
4366
4534
|
"kbd",
|
|
4367
4535
|
{
|
|
4368
4536
|
"data-slot": "kbd",
|
|
@@ -4375,7 +4543,7 @@ function Kbd({ className, ...props }) {
|
|
|
4375
4543
|
);
|
|
4376
4544
|
}
|
|
4377
4545
|
function KbdGroup({ className, ...props }) {
|
|
4378
|
-
return /* @__PURE__ */
|
|
4546
|
+
return /* @__PURE__ */ jsx35(
|
|
4379
4547
|
"kbd",
|
|
4380
4548
|
{
|
|
4381
4549
|
"data-slot": "kbd-group",
|
|
@@ -4386,9 +4554,9 @@ function KbdGroup({ className, ...props }) {
|
|
|
4386
4554
|
}
|
|
4387
4555
|
|
|
4388
4556
|
// src/ui/message.tsx
|
|
4389
|
-
import { jsx as
|
|
4557
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
4390
4558
|
function MessageGroup({ className, ...props }) {
|
|
4391
|
-
return /* @__PURE__ */
|
|
4559
|
+
return /* @__PURE__ */ jsx36(
|
|
4392
4560
|
"div",
|
|
4393
4561
|
{
|
|
4394
4562
|
"data-slot": "message-group",
|
|
@@ -4402,7 +4570,7 @@ function Message({
|
|
|
4402
4570
|
align = "start",
|
|
4403
4571
|
...props
|
|
4404
4572
|
}) {
|
|
4405
|
-
return /* @__PURE__ */
|
|
4573
|
+
return /* @__PURE__ */ jsx36(
|
|
4406
4574
|
"div",
|
|
4407
4575
|
{
|
|
4408
4576
|
"data-slot": "message",
|
|
@@ -4416,7 +4584,7 @@ function Message({
|
|
|
4416
4584
|
);
|
|
4417
4585
|
}
|
|
4418
4586
|
function MessageAvatar({ className, ...props }) {
|
|
4419
|
-
return /* @__PURE__ */
|
|
4587
|
+
return /* @__PURE__ */ jsx36(
|
|
4420
4588
|
"div",
|
|
4421
4589
|
{
|
|
4422
4590
|
"data-slot": "message-avatar",
|
|
@@ -4429,7 +4597,7 @@ function MessageAvatar({ className, ...props }) {
|
|
|
4429
4597
|
);
|
|
4430
4598
|
}
|
|
4431
4599
|
function MessageContent({ className, ...props }) {
|
|
4432
|
-
return /* @__PURE__ */
|
|
4600
|
+
return /* @__PURE__ */ jsx36(
|
|
4433
4601
|
"div",
|
|
4434
4602
|
{
|
|
4435
4603
|
"data-slot": "message-content",
|
|
@@ -4442,7 +4610,7 @@ function MessageContent({ className, ...props }) {
|
|
|
4442
4610
|
);
|
|
4443
4611
|
}
|
|
4444
4612
|
function MessageHeader({ className, ...props }) {
|
|
4445
|
-
return /* @__PURE__ */
|
|
4613
|
+
return /* @__PURE__ */ jsx36(
|
|
4446
4614
|
"div",
|
|
4447
4615
|
{
|
|
4448
4616
|
"data-slot": "message-header",
|
|
@@ -4455,7 +4623,7 @@ function MessageHeader({ className, ...props }) {
|
|
|
4455
4623
|
);
|
|
4456
4624
|
}
|
|
4457
4625
|
function MessageFooter({ className, ...props }) {
|
|
4458
|
-
return /* @__PURE__ */
|
|
4626
|
+
return /* @__PURE__ */ jsx36(
|
|
4459
4627
|
"div",
|
|
4460
4628
|
{
|
|
4461
4629
|
"data-slot": "message-footer",
|
|
@@ -4476,15 +4644,15 @@ import {
|
|
|
4476
4644
|
useMessageScrollerVisibility
|
|
4477
4645
|
} from "@shadcn/react/message-scroller";
|
|
4478
4646
|
import { ArrowDownIcon } from "lucide-react";
|
|
4479
|
-
import { Fragment as Fragment2, jsx as
|
|
4647
|
+
import { Fragment as Fragment2, jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4480
4648
|
function MessageScrollerProvider(props) {
|
|
4481
|
-
return /* @__PURE__ */
|
|
4649
|
+
return /* @__PURE__ */ jsx37(MessageScrollerPrimitive.Provider, { ...props });
|
|
4482
4650
|
}
|
|
4483
4651
|
function MessageScroller({
|
|
4484
4652
|
className,
|
|
4485
4653
|
...props
|
|
4486
4654
|
}) {
|
|
4487
|
-
return /* @__PURE__ */
|
|
4655
|
+
return /* @__PURE__ */ jsx37(
|
|
4488
4656
|
MessageScrollerPrimitive.Root,
|
|
4489
4657
|
{
|
|
4490
4658
|
"data-slot": "message-scroller",
|
|
@@ -4500,7 +4668,7 @@ function MessageScrollerViewport({
|
|
|
4500
4668
|
className,
|
|
4501
4669
|
...props
|
|
4502
4670
|
}) {
|
|
4503
|
-
return /* @__PURE__ */
|
|
4671
|
+
return /* @__PURE__ */ jsx37(
|
|
4504
4672
|
MessageScrollerPrimitive.Viewport,
|
|
4505
4673
|
{
|
|
4506
4674
|
"data-slot": "message-scroller-viewport",
|
|
@@ -4516,7 +4684,7 @@ function MessageScrollerContent({
|
|
|
4516
4684
|
className,
|
|
4517
4685
|
...props
|
|
4518
4686
|
}) {
|
|
4519
|
-
return /* @__PURE__ */
|
|
4687
|
+
return /* @__PURE__ */ jsx37(
|
|
4520
4688
|
MessageScrollerPrimitive.Content,
|
|
4521
4689
|
{
|
|
4522
4690
|
"data-slot": "message-scroller-content",
|
|
@@ -4530,7 +4698,7 @@ function MessageScrollerItem({
|
|
|
4530
4698
|
scrollAnchor = false,
|
|
4531
4699
|
...props
|
|
4532
4700
|
}) {
|
|
4533
|
-
return /* @__PURE__ */
|
|
4701
|
+
return /* @__PURE__ */ jsx37(
|
|
4534
4702
|
MessageScrollerPrimitive.Item,
|
|
4535
4703
|
{
|
|
4536
4704
|
"data-slot": "message-scroller-item",
|
|
@@ -4552,7 +4720,7 @@ function MessageScrollerButton({
|
|
|
4552
4720
|
size = "icon-sm",
|
|
4553
4721
|
...props
|
|
4554
4722
|
}) {
|
|
4555
|
-
return /* @__PURE__ */
|
|
4723
|
+
return /* @__PURE__ */ jsx37(
|
|
4556
4724
|
MessageScrollerPrimitive.Button,
|
|
4557
4725
|
{
|
|
4558
4726
|
"data-slot": "message-scroller-button",
|
|
@@ -4564,11 +4732,11 @@ function MessageScrollerButton({
|
|
|
4564
4732
|
"data-[active=true]:ease-out-quint absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",
|
|
4565
4733
|
className
|
|
4566
4734
|
),
|
|
4567
|
-
render: render ?? /* @__PURE__ */
|
|
4735
|
+
render: render ?? /* @__PURE__ */ jsx37(Button, { variant, size }),
|
|
4568
4736
|
...props,
|
|
4569
|
-
children: children ?? /* @__PURE__ */
|
|
4570
|
-
/* @__PURE__ */
|
|
4571
|
-
/* @__PURE__ */
|
|
4737
|
+
children: children ?? /* @__PURE__ */ jsxs20(Fragment2, { children: [
|
|
4738
|
+
/* @__PURE__ */ jsx37(ArrowDownIcon, {}),
|
|
4739
|
+
/* @__PURE__ */ jsx37("span", { className: "sr-only", children: direction === "end" ? "Scroll to end" : "Scroll to start" })
|
|
4572
4740
|
] })
|
|
4573
4741
|
}
|
|
4574
4742
|
);
|
|
@@ -4582,9 +4750,9 @@ import {
|
|
|
4582
4750
|
motion as motion5,
|
|
4583
4751
|
useReducedMotion
|
|
4584
4752
|
} from "motion/react";
|
|
4585
|
-
import { Fragment as Fragment3, useEffect as useEffect5, useId as useId2, useRef as useRef3, useState as
|
|
4753
|
+
import { Fragment as Fragment3, useEffect as useEffect5, useId as useId2, useRef as useRef3, useState as useState7 } from "react";
|
|
4586
4754
|
import { twMerge as twMerge2 } from "tailwind-merge";
|
|
4587
|
-
import { jsx as
|
|
4755
|
+
import { jsx as jsx38, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4588
4756
|
var EASE_OUT = [0.16, 1, 0.3, 1];
|
|
4589
4757
|
var EASE_IN_OUT = [0.77, 0, 0.175, 1];
|
|
4590
4758
|
var EASE_DRAWER = [0.32, 0.72, 0, 1];
|
|
@@ -4618,7 +4786,7 @@ var SPRING_MOUSE = {
|
|
|
4618
4786
|
damping: 15,
|
|
4619
4787
|
mass: 0.3
|
|
4620
4788
|
};
|
|
4621
|
-
function
|
|
4789
|
+
function otpCn(...inputs) {
|
|
4622
4790
|
return twMerge2(clsx2(inputs));
|
|
4623
4791
|
}
|
|
4624
4792
|
function OTPInput2({
|
|
@@ -4644,11 +4812,11 @@ function OTPInput2({
|
|
|
4644
4812
|
const inputRef = useRef3(null);
|
|
4645
4813
|
const slotsRef = useRef3(null);
|
|
4646
4814
|
const controlled = controlledValue !== void 0;
|
|
4647
|
-
const [slots, setSlots] =
|
|
4815
|
+
const [slots, setSlots] = useState7(
|
|
4648
4816
|
() => toSlots(controlled ? controlledValue : defaultValue, length)
|
|
4649
4817
|
);
|
|
4650
|
-
const [focused, setFocused] =
|
|
4651
|
-
const [active, setActive] =
|
|
4818
|
+
const [focused, setFocused] = useState7(false);
|
|
4819
|
+
const [active, setActive] = useState7(0);
|
|
4652
4820
|
const joined = slots.join("");
|
|
4653
4821
|
const joinedRef = useRef3(joined);
|
|
4654
4822
|
joinedRef.current = joined;
|
|
@@ -4752,8 +4920,8 @@ function OTPInput2({
|
|
|
4752
4920
|
const showSuccess = status === "success";
|
|
4753
4921
|
const activeIndex = focused ? active : -1;
|
|
4754
4922
|
const message = showSuccess ? successMessage : status === "error" ? errorMessage : hint;
|
|
4755
|
-
return /* @__PURE__ */
|
|
4756
|
-
label ? /* @__PURE__ */
|
|
4923
|
+
return /* @__PURE__ */ jsxs21("div", { className: otpCn("inline-flex flex-col gap-2", className), children: [
|
|
4924
|
+
label ? /* @__PURE__ */ jsx38(
|
|
4757
4925
|
"label",
|
|
4758
4926
|
{
|
|
4759
4927
|
htmlFor: `${uid}-input`,
|
|
@@ -4761,7 +4929,7 @@ function OTPInput2({
|
|
|
4761
4929
|
children: label
|
|
4762
4930
|
}
|
|
4763
4931
|
) : null,
|
|
4764
|
-
/* @__PURE__ */
|
|
4932
|
+
/* @__PURE__ */ jsxs21(
|
|
4765
4933
|
"div",
|
|
4766
4934
|
{
|
|
4767
4935
|
className: "relative inline-flex w-max",
|
|
@@ -4774,7 +4942,7 @@ function OTPInput2({
|
|
|
4774
4942
|
inputRef.current?.focus();
|
|
4775
4943
|
},
|
|
4776
4944
|
children: [
|
|
4777
|
-
/* @__PURE__ */
|
|
4945
|
+
/* @__PURE__ */ jsx38(
|
|
4778
4946
|
"input",
|
|
4779
4947
|
{
|
|
4780
4948
|
ref: inputRef,
|
|
@@ -4801,24 +4969,24 @@ function OTPInput2({
|
|
|
4801
4969
|
className: "absolute inset-0 z-20 h-full w-full cursor-text bg-transparent text-transparent caret-transparent opacity-0 outline-none disabled:cursor-not-allowed"
|
|
4802
4970
|
}
|
|
4803
4971
|
),
|
|
4804
|
-
/* @__PURE__ */
|
|
4972
|
+
/* @__PURE__ */ jsx38("div", { ref: slotsRef, className: "flex items-center gap-3", children: Array.from({ length }, (_, i) => {
|
|
4805
4973
|
const char = slots[i] ?? "";
|
|
4806
4974
|
const isActive = i === activeIndex;
|
|
4807
|
-
return /* @__PURE__ */
|
|
4808
|
-
/* @__PURE__ */
|
|
4975
|
+
return /* @__PURE__ */ jsxs21(Fragment3, { children: [
|
|
4976
|
+
/* @__PURE__ */ jsxs21(
|
|
4809
4977
|
"div",
|
|
4810
4978
|
{
|
|
4811
4979
|
"data-otp-slot": true,
|
|
4812
4980
|
"data-active": isActive,
|
|
4813
4981
|
"data-filled": char !== "",
|
|
4814
|
-
className:
|
|
4982
|
+
className: otpCn(
|
|
4815
4983
|
"relative grid size-11 place-items-center overflow-hidden rounded-xl border bg-card text-xl font-semibold tabular-nums transition-colors duration-200",
|
|
4816
4984
|
showSuccess ? "border-emerald-500/60 text-foreground" : status === "error" ? "border-destructive/60 text-foreground" : char ? "border-border-strong text-foreground" : "border-border text-muted-foreground",
|
|
4817
4985
|
isActive && !showSuccess && status !== "error" && "border-brand border-2 ring-0",
|
|
4818
4986
|
disabled && "opacity-50"
|
|
4819
4987
|
),
|
|
4820
4988
|
children: [
|
|
4821
|
-
isActive && !showSuccess ? /* @__PURE__ */
|
|
4989
|
+
isActive && !showSuccess ? /* @__PURE__ */ jsx38(
|
|
4822
4990
|
motion5.span,
|
|
4823
4991
|
{
|
|
4824
4992
|
"aria-hidden": true,
|
|
@@ -4828,13 +4996,13 @@ function OTPInput2({
|
|
|
4828
4996
|
repeat: Number.POSITIVE_INFINITY,
|
|
4829
4997
|
ease: "linear"
|
|
4830
4998
|
},
|
|
4831
|
-
className:
|
|
4999
|
+
className: otpCn(
|
|
4832
5000
|
"bg-brand pointer-events-none absolute top-1/2 h-6 w-px -translate-y-1/2",
|
|
4833
5001
|
char ? "right-3" : "left-1/2 -translate-x-1/2"
|
|
4834
5002
|
)
|
|
4835
5003
|
}
|
|
4836
5004
|
) : null,
|
|
4837
|
-
/* @__PURE__ */
|
|
5005
|
+
/* @__PURE__ */ jsx38(AnimatePresence2, { initial: false, children: char ? /* @__PURE__ */ jsx38(
|
|
4838
5006
|
motion5.span,
|
|
4839
5007
|
{
|
|
4840
5008
|
initial: reduce ? {
|
|
@@ -4872,10 +5040,10 @@ function OTPInput2({
|
|
|
4872
5040
|
]
|
|
4873
5041
|
}
|
|
4874
5042
|
),
|
|
4875
|
-
i === 2 ? /* @__PURE__ */
|
|
5043
|
+
i === 2 ? /* @__PURE__ */ jsx38("span", { "aria-hidden": "true", className: "h-0.5 w-4 bg-primary" }) : null
|
|
4876
5044
|
] }, `${uid}-${i}`);
|
|
4877
5045
|
}) }),
|
|
4878
|
-
/* @__PURE__ */
|
|
5046
|
+
/* @__PURE__ */ jsx38(AnimatePresence2, { children: showSuccess ? /* @__PURE__ */ jsx38(
|
|
4879
5047
|
motion5.span,
|
|
4880
5048
|
{
|
|
4881
5049
|
initial: reduce ? {
|
|
@@ -4905,7 +5073,7 @@ function OTPInput2({
|
|
|
4905
5073
|
},
|
|
4906
5074
|
className: "pointer-events-none absolute top-1/2 -right-7 -translate-y-1/2 text-emerald-500",
|
|
4907
5075
|
"aria-hidden": true,
|
|
4908
|
-
children: /* @__PURE__ */
|
|
5076
|
+
children: /* @__PURE__ */ jsxs21(
|
|
4909
5077
|
"svg",
|
|
4910
5078
|
{
|
|
4911
5079
|
width: "20",
|
|
@@ -4917,8 +5085,8 @@ function OTPInput2({
|
|
|
4917
5085
|
strokeLinecap: "round",
|
|
4918
5086
|
strokeLinejoin: "round",
|
|
4919
5087
|
children: [
|
|
4920
|
-
/* @__PURE__ */
|
|
4921
|
-
/* @__PURE__ */
|
|
5088
|
+
/* @__PURE__ */ jsx38("title", { children: "Verified" }),
|
|
5089
|
+
/* @__PURE__ */ jsx38(
|
|
4922
5090
|
motion5.path,
|
|
4923
5091
|
{
|
|
4924
5092
|
d: "M5 13l4 4L19 7",
|
|
@@ -4947,11 +5115,11 @@ function OTPInput2({
|
|
|
4947
5115
|
]
|
|
4948
5116
|
}
|
|
4949
5117
|
),
|
|
4950
|
-
message ? /* @__PURE__ */
|
|
5118
|
+
message ? /* @__PURE__ */ jsx38(
|
|
4951
5119
|
"p",
|
|
4952
5120
|
{
|
|
4953
5121
|
"aria-live": "polite",
|
|
4954
|
-
className:
|
|
5122
|
+
className: otpCn(
|
|
4955
5123
|
"text-sm",
|
|
4956
5124
|
showSuccess ? "text-emerald-500" : status === "error" ? "text-destructive" : "text-muted-foreground"
|
|
4957
5125
|
),
|
|
@@ -4970,12 +5138,12 @@ function toSlots(raw, length) {
|
|
|
4970
5138
|
|
|
4971
5139
|
// src/ui/popover.tsx
|
|
4972
5140
|
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
4973
|
-
import { jsx as
|
|
5141
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
4974
5142
|
function Popover({ ...props }) {
|
|
4975
|
-
return /* @__PURE__ */
|
|
5143
|
+
return /* @__PURE__ */ jsx39(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
4976
5144
|
}
|
|
4977
5145
|
function PopoverTrigger({ ...props }) {
|
|
4978
|
-
return /* @__PURE__ */
|
|
5146
|
+
return /* @__PURE__ */ jsx39(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
4979
5147
|
}
|
|
4980
5148
|
function PopoverContent({
|
|
4981
5149
|
className,
|
|
@@ -4985,7 +5153,7 @@ function PopoverContent({
|
|
|
4985
5153
|
sideOffset = 4,
|
|
4986
5154
|
...props
|
|
4987
5155
|
}) {
|
|
4988
|
-
return /* @__PURE__ */
|
|
5156
|
+
return /* @__PURE__ */ jsx39(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx39(
|
|
4989
5157
|
PopoverPrimitive.Positioner,
|
|
4990
5158
|
{
|
|
4991
5159
|
align,
|
|
@@ -4993,7 +5161,7 @@ function PopoverContent({
|
|
|
4993
5161
|
side,
|
|
4994
5162
|
sideOffset,
|
|
4995
5163
|
className: "isolate z-50",
|
|
4996
|
-
children: /* @__PURE__ */
|
|
5164
|
+
children: /* @__PURE__ */ jsx39(
|
|
4997
5165
|
PopoverPrimitive.Popup,
|
|
4998
5166
|
{
|
|
4999
5167
|
"data-slot": "popover-content",
|
|
@@ -5008,7 +5176,7 @@ function PopoverContent({
|
|
|
5008
5176
|
) });
|
|
5009
5177
|
}
|
|
5010
5178
|
function PopoverHeader({ className, ...props }) {
|
|
5011
|
-
return /* @__PURE__ */
|
|
5179
|
+
return /* @__PURE__ */ jsx39(
|
|
5012
5180
|
"div",
|
|
5013
5181
|
{
|
|
5014
5182
|
"data-slot": "popover-header",
|
|
@@ -5018,7 +5186,7 @@ function PopoverHeader({ className, ...props }) {
|
|
|
5018
5186
|
);
|
|
5019
5187
|
}
|
|
5020
5188
|
function PopoverTitle({ className, ...props }) {
|
|
5021
|
-
return /* @__PURE__ */
|
|
5189
|
+
return /* @__PURE__ */ jsx39(
|
|
5022
5190
|
PopoverPrimitive.Title,
|
|
5023
5191
|
{
|
|
5024
5192
|
"data-slot": "popover-title",
|
|
@@ -5031,7 +5199,7 @@ function PopoverDescription({
|
|
|
5031
5199
|
className,
|
|
5032
5200
|
...props
|
|
5033
5201
|
}) {
|
|
5034
|
-
return /* @__PURE__ */
|
|
5202
|
+
return /* @__PURE__ */ jsx39(
|
|
5035
5203
|
PopoverPrimitive.Description,
|
|
5036
5204
|
{
|
|
5037
5205
|
"data-slot": "popover-description",
|
|
@@ -5044,14 +5212,12 @@ function PopoverDescription({
|
|
|
5044
5212
|
// src/ui/quantity.tsx
|
|
5045
5213
|
import { NumberField } from "@base-ui/react/number-field";
|
|
5046
5214
|
import { Minus, Plus } from "@gravity-ui/icons";
|
|
5047
|
-
import * as
|
|
5048
|
-
import { jsx as
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
return /* @__PURE__ */ jsx39(NumberField.Root, { id, ...props, className: "flex flex-col items-start", children: /* @__PURE__ */ jsxs21(NumberField.Group, { className: "flex h-8 gap-1", children: [
|
|
5054
|
-
/* @__PURE__ */ jsx39(
|
|
5215
|
+
import * as React11 from "react";
|
|
5216
|
+
import { jsx as jsx40, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5217
|
+
var QuantityInput = React11.forwardRef(function QuantityInput2({ ...props }, ref) {
|
|
5218
|
+
const id = React11.useId();
|
|
5219
|
+
return /* @__PURE__ */ jsx40(NumberField.Root, { id, ...props, className: "flex flex-col items-start", children: /* @__PURE__ */ jsxs22(NumberField.Group, { className: "flex h-8 gap-1", children: [
|
|
5220
|
+
/* @__PURE__ */ jsx40(
|
|
5055
5221
|
NumberField.Decrement,
|
|
5056
5222
|
{
|
|
5057
5223
|
className: buttonVariants({
|
|
@@ -5059,17 +5225,18 @@ function QuantityInput({
|
|
|
5059
5225
|
size: "icon-sm",
|
|
5060
5226
|
className: "rounded-full! border-border!"
|
|
5061
5227
|
}),
|
|
5062
|
-
children: /* @__PURE__ */
|
|
5228
|
+
children: /* @__PURE__ */ jsx40(Minus, {})
|
|
5063
5229
|
}
|
|
5064
5230
|
),
|
|
5065
|
-
/* @__PURE__ */
|
|
5231
|
+
/* @__PURE__ */ jsx40(
|
|
5066
5232
|
NumberField.Input,
|
|
5067
5233
|
{
|
|
5234
|
+
ref,
|
|
5068
5235
|
className: "h-7 w-16 rounded-md border px-1 text-center",
|
|
5069
5236
|
"data-no-ring": true
|
|
5070
5237
|
}
|
|
5071
5238
|
),
|
|
5072
|
-
/* @__PURE__ */
|
|
5239
|
+
/* @__PURE__ */ jsx40(
|
|
5073
5240
|
NumberField.Increment,
|
|
5074
5241
|
{
|
|
5075
5242
|
className: buttonVariants({
|
|
@@ -5077,18 +5244,18 @@ function QuantityInput({
|
|
|
5077
5244
|
size: "icon-sm",
|
|
5078
5245
|
className: "rounded-full! border-border!"
|
|
5079
5246
|
}),
|
|
5080
|
-
children: /* @__PURE__ */
|
|
5247
|
+
children: /* @__PURE__ */ jsx40(Plus, {})
|
|
5081
5248
|
}
|
|
5082
5249
|
)
|
|
5083
5250
|
] }) });
|
|
5084
|
-
}
|
|
5251
|
+
});
|
|
5085
5252
|
|
|
5086
5253
|
// src/ui/radio-group.tsx
|
|
5087
5254
|
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
5088
5255
|
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
5089
|
-
import { jsx as
|
|
5256
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
5090
5257
|
function RadioGroup({ className, ...props }) {
|
|
5091
|
-
return /* @__PURE__ */
|
|
5258
|
+
return /* @__PURE__ */ jsx41(
|
|
5092
5259
|
RadioGroupPrimitive,
|
|
5093
5260
|
{
|
|
5094
5261
|
"data-slot": "radio-group",
|
|
@@ -5098,7 +5265,7 @@ function RadioGroup({ className, ...props }) {
|
|
|
5098
5265
|
);
|
|
5099
5266
|
}
|
|
5100
5267
|
function RadioGroupItem({ className, ...props }) {
|
|
5101
|
-
return /* @__PURE__ */
|
|
5268
|
+
return /* @__PURE__ */ jsx41(
|
|
5102
5269
|
RadioPrimitive.Root,
|
|
5103
5270
|
{
|
|
5104
5271
|
"data-slot": "radio-group-item",
|
|
@@ -5107,12 +5274,12 @@ function RadioGroupItem({ className, ...props }) {
|
|
|
5107
5274
|
className
|
|
5108
5275
|
),
|
|
5109
5276
|
...props,
|
|
5110
|
-
children: /* @__PURE__ */
|
|
5277
|
+
children: /* @__PURE__ */ jsx41(
|
|
5111
5278
|
RadioPrimitive.Indicator,
|
|
5112
5279
|
{
|
|
5113
5280
|
"data-slot": "radio-group-indicator",
|
|
5114
5281
|
className: "flex size-4 items-center justify-center",
|
|
5115
|
-
children: /* @__PURE__ */
|
|
5282
|
+
children: /* @__PURE__ */ jsx41("span", { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" })
|
|
5116
5283
|
}
|
|
5117
5284
|
)
|
|
5118
5285
|
}
|
|
@@ -5123,24 +5290,24 @@ function RadioGroupItem({ className, ...props }) {
|
|
|
5123
5290
|
import { useRender as useRender5 } from "@base-ui/react/use-render";
|
|
5124
5291
|
import { cva as cva9 } from "class-variance-authority";
|
|
5125
5292
|
import {
|
|
5126
|
-
createContext as
|
|
5127
|
-
useCallback as
|
|
5128
|
-
useContext as
|
|
5293
|
+
createContext as createContext5,
|
|
5294
|
+
useCallback as useCallback4,
|
|
5295
|
+
useContext as useContext6,
|
|
5129
5296
|
useEffect as useEffect6,
|
|
5130
5297
|
useId as useId4,
|
|
5131
5298
|
useMemo as useMemo4,
|
|
5132
5299
|
useRef as useRef4,
|
|
5133
|
-
useState as
|
|
5300
|
+
useState as useState8
|
|
5134
5301
|
} from "react";
|
|
5135
5302
|
|
|
5136
5303
|
// src/ui/tooltip.tsx
|
|
5137
5304
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
5138
|
-
import { jsx as
|
|
5305
|
+
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5139
5306
|
function TooltipProvider({
|
|
5140
5307
|
delay = 0,
|
|
5141
5308
|
...props
|
|
5142
5309
|
}) {
|
|
5143
|
-
return /* @__PURE__ */
|
|
5310
|
+
return /* @__PURE__ */ jsx42(
|
|
5144
5311
|
TooltipPrimitive.Provider,
|
|
5145
5312
|
{
|
|
5146
5313
|
"data-slot": "tooltip-provider",
|
|
@@ -5150,10 +5317,10 @@ function TooltipProvider({
|
|
|
5150
5317
|
);
|
|
5151
5318
|
}
|
|
5152
5319
|
function Tooltip2({ ...props }) {
|
|
5153
|
-
return /* @__PURE__ */
|
|
5320
|
+
return /* @__PURE__ */ jsx42(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
5154
5321
|
}
|
|
5155
5322
|
function TooltipTrigger({ ...props }) {
|
|
5156
|
-
return /* @__PURE__ */
|
|
5323
|
+
return /* @__PURE__ */ jsx42(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
5157
5324
|
}
|
|
5158
5325
|
function TooltipContent({
|
|
5159
5326
|
className,
|
|
@@ -5164,7 +5331,7 @@ function TooltipContent({
|
|
|
5164
5331
|
children,
|
|
5165
5332
|
...props
|
|
5166
5333
|
}) {
|
|
5167
|
-
return /* @__PURE__ */
|
|
5334
|
+
return /* @__PURE__ */ jsx42(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx42(
|
|
5168
5335
|
TooltipPrimitive.Positioner,
|
|
5169
5336
|
{
|
|
5170
5337
|
align,
|
|
@@ -5172,7 +5339,7 @@ function TooltipContent({
|
|
|
5172
5339
|
side,
|
|
5173
5340
|
sideOffset,
|
|
5174
5341
|
className: "isolate z-50",
|
|
5175
|
-
children: /* @__PURE__ */
|
|
5342
|
+
children: /* @__PURE__ */ jsxs23(
|
|
5176
5343
|
TooltipPrimitive.Popup,
|
|
5177
5344
|
{
|
|
5178
5345
|
"data-slot": "tooltip-content",
|
|
@@ -5183,7 +5350,7 @@ function TooltipContent({
|
|
|
5183
5350
|
...props,
|
|
5184
5351
|
children: [
|
|
5185
5352
|
children,
|
|
5186
|
-
/* @__PURE__ */
|
|
5353
|
+
/* @__PURE__ */ jsx42(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })
|
|
5187
5354
|
]
|
|
5188
5355
|
}
|
|
5189
5356
|
)
|
|
@@ -5193,7 +5360,7 @@ function TooltipContent({
|
|
|
5193
5360
|
|
|
5194
5361
|
// src/ui/reui/filters.tsx
|
|
5195
5362
|
import { AlertCircleIcon, CheckIcon as CheckIcon2, PlusIcon, XIcon } from "lucide-react";
|
|
5196
|
-
import { Fragment as Fragment4, jsx as
|
|
5363
|
+
import { Fragment as Fragment4, jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5197
5364
|
var DEFAULT_I18N = {
|
|
5198
5365
|
// UI Labels
|
|
5199
5366
|
addFilter: "Filter",
|
|
@@ -5264,7 +5431,7 @@ var DEFAULT_I18N = {
|
|
|
5264
5431
|
invalid: "Invalid input format"
|
|
5265
5432
|
}
|
|
5266
5433
|
};
|
|
5267
|
-
var FilterContext =
|
|
5434
|
+
var FilterContext = createContext5({
|
|
5268
5435
|
variant: "default",
|
|
5269
5436
|
size: "default",
|
|
5270
5437
|
radius: "default",
|
|
@@ -5274,7 +5441,7 @@ var FilterContext = createContext4({
|
|
|
5274
5441
|
trigger: void 0,
|
|
5275
5442
|
allowMultiple: true
|
|
5276
5443
|
});
|
|
5277
|
-
var useFilterContext = () =>
|
|
5444
|
+
var useFilterContext = () => useContext6(FilterContext);
|
|
5278
5445
|
var filtersContainerVariants = cva9("flex flex-wrap items-center", {
|
|
5279
5446
|
variants: {
|
|
5280
5447
|
variant: {
|
|
@@ -5300,8 +5467,8 @@ function FilterInput({
|
|
|
5300
5467
|
...props
|
|
5301
5468
|
}) {
|
|
5302
5469
|
const context = useFilterContext();
|
|
5303
|
-
const [isValid, setIsValid] =
|
|
5304
|
-
const [validationMessage, setValidationMessage] =
|
|
5470
|
+
const [isValid, setIsValid] = useState8(true);
|
|
5471
|
+
const [validationMessage, setValidationMessage] = useState8("");
|
|
5305
5472
|
const inputRef = useRef4(null);
|
|
5306
5473
|
useEffect6(() => {
|
|
5307
5474
|
if (props.autoFocus) {
|
|
@@ -5359,7 +5526,7 @@ function FilterInput({
|
|
|
5359
5526
|
}
|
|
5360
5527
|
onKeyDown?.(e);
|
|
5361
5528
|
};
|
|
5362
|
-
return /* @__PURE__ */
|
|
5529
|
+
return /* @__PURE__ */ jsxs24(
|
|
5363
5530
|
InputGroup,
|
|
5364
5531
|
{
|
|
5365
5532
|
className: cn(
|
|
@@ -5377,8 +5544,8 @@ function FilterInput({
|
|
|
5377
5544
|
className
|
|
5378
5545
|
),
|
|
5379
5546
|
children: [
|
|
5380
|
-
field?.prefix && /* @__PURE__ */
|
|
5381
|
-
/* @__PURE__ */
|
|
5547
|
+
field?.prefix && /* @__PURE__ */ jsx43(InputGroupAddon, { children: /* @__PURE__ */ jsx43(InputGroupText, { children: field.prefix }) }),
|
|
5548
|
+
/* @__PURE__ */ jsx43(
|
|
5382
5549
|
InputGroupInput,
|
|
5383
5550
|
{
|
|
5384
5551
|
ref: inputRef,
|
|
@@ -5393,22 +5560,22 @@ function FilterInput({
|
|
|
5393
5560
|
...props
|
|
5394
5561
|
}
|
|
5395
5562
|
),
|
|
5396
|
-
!isValid && validationMessage && /* @__PURE__ */
|
|
5397
|
-
/* @__PURE__ */
|
|
5398
|
-
/* @__PURE__ */
|
|
5563
|
+
!isValid && validationMessage && /* @__PURE__ */ jsx43(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsxs24(Tooltip2, { children: [
|
|
5564
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { render: /* @__PURE__ */ jsx43(InputGroupButton, { size: "icon-xs" }), children: /* @__PURE__ */ jsx43(AlertCircleIcon, { className: "size-3.5 text-destructive" }) }),
|
|
5565
|
+
/* @__PURE__ */ jsx43(TooltipContent, { children: /* @__PURE__ */ jsx43("p", { className: "text-sm", children: validationMessage }) })
|
|
5399
5566
|
] }) }),
|
|
5400
|
-
field?.suffix && /* @__PURE__ */
|
|
5567
|
+
field?.suffix && /* @__PURE__ */ jsx43(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx43(InputGroupText, { children: field.suffix }) })
|
|
5401
5568
|
]
|
|
5402
5569
|
}
|
|
5403
5570
|
);
|
|
5404
5571
|
}
|
|
5405
5572
|
function FilterRemoveButton({
|
|
5406
5573
|
className,
|
|
5407
|
-
icon = /* @__PURE__ */
|
|
5574
|
+
icon = /* @__PURE__ */ jsx43(XIcon, {}),
|
|
5408
5575
|
...props
|
|
5409
5576
|
}) {
|
|
5410
5577
|
const context = useFilterContext();
|
|
5411
|
-
return /* @__PURE__ */
|
|
5578
|
+
return /* @__PURE__ */ jsx43(
|
|
5412
5579
|
Button,
|
|
5413
5580
|
{
|
|
5414
5581
|
variant: "outline",
|
|
@@ -5466,8 +5633,8 @@ function useFieldOptions(field, searchInput, enabled) {
|
|
|
5466
5633
|
cache.set(opt.value, opt);
|
|
5467
5634
|
}
|
|
5468
5635
|
}
|
|
5469
|
-
const [state, setState] =
|
|
5470
|
-
const [debouncedQuery, setDebouncedQuery] =
|
|
5636
|
+
const [state, setState] = useState8(() => ({ options: field.options ?? [], loading: false, error: false }));
|
|
5637
|
+
const [debouncedQuery, setDebouncedQuery] = useState8(searchInput);
|
|
5471
5638
|
useEffect6(() => {
|
|
5472
5639
|
if (!isAsync) return;
|
|
5473
5640
|
const timer = setTimeout(() => setDebouncedQuery(searchInput), 250);
|
|
@@ -5496,7 +5663,7 @@ function useFieldOptions(field, searchInput, enabled) {
|
|
|
5496
5663
|
cancelled = true;
|
|
5497
5664
|
};
|
|
5498
5665
|
}, [isAsync, enabled, debouncedQuery]);
|
|
5499
|
-
const resolveSelected =
|
|
5666
|
+
const resolveSelected = useCallback4(
|
|
5500
5667
|
(values) => {
|
|
5501
5668
|
const cache = getFieldOptionCache(field);
|
|
5502
5669
|
return values.map(
|
|
@@ -5579,11 +5746,11 @@ function FilterOperatorDropdown({
|
|
|
5579
5746
|
[field, values, context.i18n]
|
|
5580
5747
|
);
|
|
5581
5748
|
const operatorLabel = operators.find((op) => op.value === operator)?.label || context.i18n.helpers.formatOperator(operator);
|
|
5582
|
-
return /* @__PURE__ */
|
|
5583
|
-
/* @__PURE__ */
|
|
5749
|
+
return /* @__PURE__ */ jsxs24(DropdownMenu, { children: [
|
|
5750
|
+
/* @__PURE__ */ jsx43(
|
|
5584
5751
|
DropdownMenuTrigger,
|
|
5585
5752
|
{
|
|
5586
|
-
render: /* @__PURE__ */
|
|
5753
|
+
render: /* @__PURE__ */ jsx43(
|
|
5587
5754
|
Button,
|
|
5588
5755
|
{
|
|
5589
5756
|
variant: "outline",
|
|
@@ -5594,7 +5761,7 @@ function FilterOperatorDropdown({
|
|
|
5594
5761
|
)
|
|
5595
5762
|
}
|
|
5596
5763
|
),
|
|
5597
|
-
/* @__PURE__ */
|
|
5764
|
+
/* @__PURE__ */ jsx43(DropdownMenuContent, { align: "start", className: "w-fit min-w-fit", children: operators.map((op) => /* @__PURE__ */ jsxs24(
|
|
5598
5765
|
DropdownMenuItem,
|
|
5599
5766
|
{
|
|
5600
5767
|
onClick: () => onChange(op.value),
|
|
@@ -5602,8 +5769,8 @@ function FilterOperatorDropdown({
|
|
|
5602
5769
|
"flex items-center justify-between data-highlighted:bg-accent data-highlighted:text-accent-foreground"
|
|
5603
5770
|
),
|
|
5604
5771
|
children: [
|
|
5605
|
-
/* @__PURE__ */
|
|
5606
|
-
/* @__PURE__ */
|
|
5772
|
+
/* @__PURE__ */ jsx43("span", { children: op.label }),
|
|
5773
|
+
/* @__PURE__ */ jsx43(
|
|
5607
5774
|
CheckIcon2,
|
|
5608
5775
|
{
|
|
5609
5776
|
className: cn(
|
|
@@ -5625,9 +5792,9 @@ function SelectOptionsPopover({
|
|
|
5625
5792
|
onClose,
|
|
5626
5793
|
inline = false
|
|
5627
5794
|
}) {
|
|
5628
|
-
const [open, setOpen] =
|
|
5629
|
-
const [searchInput, setSearchInput] =
|
|
5630
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
5795
|
+
const [open, setOpen] = useState8(false);
|
|
5796
|
+
const [searchInput, setSearchInput] = useState8("");
|
|
5797
|
+
const [highlightedIndex, setHighlightedIndex] = useState8(-1);
|
|
5631
5798
|
const inputRef = useRef4(null);
|
|
5632
5799
|
const context = useFilterContext();
|
|
5633
5800
|
const baseId = useId4();
|
|
@@ -5687,7 +5854,7 @@ function SelectOptionsPopover({
|
|
|
5687
5854
|
const isSelected = effectiveValues.includes(option.value);
|
|
5688
5855
|
const isHighlighted = highlightedIndex === overallIndex;
|
|
5689
5856
|
const itemId = `${baseId}-item-${overallIndex}`;
|
|
5690
|
-
return /* @__PURE__ */
|
|
5857
|
+
return /* @__PURE__ */ jsxs24(
|
|
5691
5858
|
DropdownMenuCheckboxItem,
|
|
5692
5859
|
{
|
|
5693
5860
|
id: itemId,
|
|
@@ -5706,15 +5873,15 @@ function SelectOptionsPopover({
|
|
|
5706
5873
|
onCheckedChange: () => toggleOption(option),
|
|
5707
5874
|
children: [
|
|
5708
5875
|
option.icon && option.icon,
|
|
5709
|
-
/* @__PURE__ */
|
|
5876
|
+
/* @__PURE__ */ jsx43("span", { className: "truncate", children: option.label })
|
|
5710
5877
|
]
|
|
5711
5878
|
},
|
|
5712
5879
|
String(option.value)
|
|
5713
5880
|
);
|
|
5714
5881
|
};
|
|
5715
|
-
const renderMenuContent = () => /* @__PURE__ */
|
|
5716
|
-
field.searchable !== false && /* @__PURE__ */
|
|
5717
|
-
/* @__PURE__ */
|
|
5882
|
+
const renderMenuContent = () => /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
5883
|
+
field.searchable !== false && /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
5884
|
+
/* @__PURE__ */ jsx43(
|
|
5718
5885
|
Input,
|
|
5719
5886
|
{
|
|
5720
5887
|
ref: inputRef,
|
|
@@ -5775,24 +5942,24 @@ function SelectOptionsPopover({
|
|
|
5775
5942
|
}
|
|
5776
5943
|
}
|
|
5777
5944
|
),
|
|
5778
|
-
/* @__PURE__ */
|
|
5945
|
+
/* @__PURE__ */ jsx43(DropdownMenuSeparator, {})
|
|
5779
5946
|
] }),
|
|
5780
|
-
/* @__PURE__ */
|
|
5947
|
+
/* @__PURE__ */ jsx43("div", { className: "relative flex max-h-full", children: /* @__PURE__ */ jsx43(
|
|
5781
5948
|
"div",
|
|
5782
5949
|
{
|
|
5783
5950
|
className: "flex max-h-[min(var(--available-height),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain",
|
|
5784
5951
|
role: "listbox",
|
|
5785
5952
|
id: `${baseId}-listbox`,
|
|
5786
|
-
children: isAsync && loading && allFilteredOptions.length === 0 ? /* @__PURE__ */
|
|
5953
|
+
children: isAsync && loading && allFilteredOptions.length === 0 ? /* @__PURE__ */ jsx43("div", { className: "py-2 text-center text-sm text-muted-foreground", children: context.i18n.loadingOptions ?? DEFAULT_I18N.loadingOptions }) : isAsync && error ? /* @__PURE__ */ jsx43("div", { className: "py-2 text-center text-sm text-muted-foreground", children: context.i18n.errorLoadingOptions ?? DEFAULT_I18N.errorLoadingOptions }) : allFilteredOptions.length === 0 ? /* @__PURE__ */ jsx43("div", { className: "py-2 text-center text-sm text-muted-foreground", children: context.i18n.noResultsFound }) : field.renderOptionList ? field.renderOptionList({
|
|
5787
5954
|
options: allFilteredOptions,
|
|
5788
5955
|
highlightedIndex,
|
|
5789
5956
|
renderOption: renderOptionItem
|
|
5790
|
-
}) : /* @__PURE__ */
|
|
5791
|
-
filteredSelectedOptions.length > 0 && /* @__PURE__ */
|
|
5957
|
+
}) : /* @__PURE__ */ jsxs24(ScrollArea, { className: "size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain", children: [
|
|
5958
|
+
filteredSelectedOptions.length > 0 && /* @__PURE__ */ jsx43(DropdownMenuGroup, { className: "px-1", children: filteredSelectedOptions.map(
|
|
5792
5959
|
(option, index) => renderOptionItem(option, index)
|
|
5793
5960
|
) }),
|
|
5794
|
-
filteredSelectedOptions.length > 0 && filteredUnselectedOptions.length > 0 && /* @__PURE__ */
|
|
5795
|
-
filteredUnselectedOptions.length > 0 && /* @__PURE__ */
|
|
5961
|
+
filteredSelectedOptions.length > 0 && filteredUnselectedOptions.length > 0 && /* @__PURE__ */ jsx43(DropdownMenuSeparator, { className: "mx-0" }),
|
|
5962
|
+
filteredUnselectedOptions.length > 0 && /* @__PURE__ */ jsx43(DropdownMenuGroup, { className: "px-1", children: filteredUnselectedOptions.map(
|
|
5796
5963
|
(option, index) => renderOptionItem(
|
|
5797
5964
|
option,
|
|
5798
5965
|
index + filteredSelectedOptions.length
|
|
@@ -5803,9 +5970,9 @@ function SelectOptionsPopover({
|
|
|
5803
5970
|
) })
|
|
5804
5971
|
] });
|
|
5805
5972
|
if (inline) {
|
|
5806
|
-
return /* @__PURE__ */
|
|
5973
|
+
return /* @__PURE__ */ jsx43("div", { className: "w-full", children: renderMenuContent() });
|
|
5807
5974
|
}
|
|
5808
|
-
return /* @__PURE__ */
|
|
5975
|
+
return /* @__PURE__ */ jsxs24(
|
|
5809
5976
|
DropdownMenu,
|
|
5810
5977
|
{
|
|
5811
5978
|
open,
|
|
@@ -5816,19 +5983,19 @@ function SelectOptionsPopover({
|
|
|
5816
5983
|
}
|
|
5817
5984
|
},
|
|
5818
5985
|
children: [
|
|
5819
|
-
/* @__PURE__ */
|
|
5986
|
+
/* @__PURE__ */ jsx43(
|
|
5820
5987
|
DropdownMenuTrigger,
|
|
5821
5988
|
{
|
|
5822
|
-
render: /* @__PURE__ */
|
|
5989
|
+
render: /* @__PURE__ */ jsx43(Button, { variant: "outline", size: context.size, children: /* @__PURE__ */ jsx43("div", { className: "flex items-center gap-1.5", children: field.customValueRenderer ? field.customValueRenderer(
|
|
5823
5990
|
values,
|
|
5824
5991
|
isAsync ? resolveSelected(values) : field.options || []
|
|
5825
|
-
) : /* @__PURE__ */
|
|
5826
|
-
selectedOptions.length > 0 && /* @__PURE__ */
|
|
5992
|
+
) : /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
5993
|
+
selectedOptions.length > 0 && /* @__PURE__ */ jsx43("div", { className: "flex items-center -space-x-1.5", children: selectedOptions.slice(0, 3).map((option) => /* @__PURE__ */ jsx43("div", { children: option.icon }, String(option.value))) }),
|
|
5827
5994
|
selectedOptions.length === 1 ? selectedOptions[0].label : selectedOptions.length > 1 ? `${selectedOptions.length} ${context.i18n.selectedCount}` : context.i18n.select
|
|
5828
5995
|
] }) }) })
|
|
5829
5996
|
}
|
|
5830
5997
|
),
|
|
5831
|
-
/* @__PURE__ */
|
|
5998
|
+
/* @__PURE__ */ jsx43(
|
|
5832
5999
|
DropdownMenuContent,
|
|
5833
6000
|
{
|
|
5834
6001
|
align: "start",
|
|
@@ -5851,10 +6018,10 @@ function FilterValueSelector({
|
|
|
5851
6018
|
return null;
|
|
5852
6019
|
}
|
|
5853
6020
|
if (field.customRenderer) {
|
|
5854
|
-
return /* @__PURE__ */
|
|
6021
|
+
return /* @__PURE__ */ jsx43(ButtonGroupText, { className: "bg-background text-start whitespace-nowrap outline-hidden hover:bg-accent aria-expanded:bg-accent dark:bg-input/30", children: field.customRenderer({ field, values, onChange, operator }) });
|
|
5855
6022
|
}
|
|
5856
6023
|
if (field.type === "text") {
|
|
5857
|
-
return /* @__PURE__ */
|
|
6024
|
+
return /* @__PURE__ */ jsx43(
|
|
5858
6025
|
FilterInput,
|
|
5859
6026
|
{
|
|
5860
6027
|
type: "text",
|
|
@@ -5869,9 +6036,9 @@ function FilterValueSelector({
|
|
|
5869
6036
|
);
|
|
5870
6037
|
}
|
|
5871
6038
|
if (field.type === "select" || field.type === "multiselect") {
|
|
5872
|
-
return /* @__PURE__ */
|
|
6039
|
+
return /* @__PURE__ */ jsx43(SelectOptionsPopover, { field, values, onChange });
|
|
5873
6040
|
}
|
|
5874
|
-
return /* @__PURE__ */
|
|
6041
|
+
return /* @__PURE__ */ jsx43(SelectOptionsPopover, { field, values, onChange });
|
|
5875
6042
|
}
|
|
5876
6043
|
var FiltersContent = ({
|
|
5877
6044
|
filters,
|
|
@@ -5880,7 +6047,7 @@ var FiltersContent = ({
|
|
|
5880
6047
|
}) => {
|
|
5881
6048
|
const context = useFilterContext();
|
|
5882
6049
|
const fieldsMap = useMemo4(() => getFieldsMap(fields), [fields]);
|
|
5883
|
-
const updateFilter =
|
|
6050
|
+
const updateFilter = useCallback4(
|
|
5884
6051
|
(filterId, updates) => {
|
|
5885
6052
|
onChange(
|
|
5886
6053
|
filters.map((filter) => {
|
|
@@ -5897,13 +6064,13 @@ var FiltersContent = ({
|
|
|
5897
6064
|
},
|
|
5898
6065
|
[filters, onChange]
|
|
5899
6066
|
);
|
|
5900
|
-
const removeFilter =
|
|
6067
|
+
const removeFilter = useCallback4(
|
|
5901
6068
|
(filterId) => {
|
|
5902
6069
|
onChange(filters.filter((filter) => filter.id !== filterId));
|
|
5903
6070
|
},
|
|
5904
6071
|
[filters, onChange]
|
|
5905
6072
|
);
|
|
5906
|
-
return /* @__PURE__ */
|
|
6073
|
+
return /* @__PURE__ */ jsx43(
|
|
5907
6074
|
"div",
|
|
5908
6075
|
{
|
|
5909
6076
|
className: cn(
|
|
@@ -5916,16 +6083,16 @@ var FiltersContent = ({
|
|
|
5916
6083
|
children: filters.map((filter) => {
|
|
5917
6084
|
const field = fieldsMap[filter.field];
|
|
5918
6085
|
if (!field) return null;
|
|
5919
|
-
return /* @__PURE__ */
|
|
6086
|
+
return /* @__PURE__ */ jsxs24(
|
|
5920
6087
|
ButtonGroup,
|
|
5921
6088
|
{
|
|
5922
6089
|
className: "",
|
|
5923
6090
|
children: [
|
|
5924
|
-
/* @__PURE__ */
|
|
6091
|
+
/* @__PURE__ */ jsxs24(ButtonGroupText, { children: [
|
|
5925
6092
|
field.icon && field.icon,
|
|
5926
6093
|
field.label
|
|
5927
6094
|
] }),
|
|
5928
|
-
/* @__PURE__ */
|
|
6095
|
+
/* @__PURE__ */ jsx43(
|
|
5929
6096
|
FilterOperatorDropdown,
|
|
5930
6097
|
{
|
|
5931
6098
|
field,
|
|
@@ -5934,7 +6101,7 @@ var FiltersContent = ({
|
|
|
5934
6101
|
onChange: (operator) => updateFilter(filter.id, { operator })
|
|
5935
6102
|
}
|
|
5936
6103
|
),
|
|
5937
|
-
/* @__PURE__ */
|
|
6104
|
+
/* @__PURE__ */ jsx43(
|
|
5938
6105
|
FilterValueSelector,
|
|
5939
6106
|
{
|
|
5940
6107
|
field,
|
|
@@ -5944,7 +6111,7 @@ var FiltersContent = ({
|
|
|
5944
6111
|
autoFocus: false
|
|
5945
6112
|
}
|
|
5946
6113
|
),
|
|
5947
|
-
/* @__PURE__ */
|
|
6114
|
+
/* @__PURE__ */ jsx43(FilterRemoveButton, { onClick: () => removeFilter(filter.id) })
|
|
5948
6115
|
]
|
|
5949
6116
|
},
|
|
5950
6117
|
filter.id
|
|
@@ -5964,8 +6131,8 @@ function FilterSubmenuContent({
|
|
|
5964
6131
|
onBack,
|
|
5965
6132
|
onClose
|
|
5966
6133
|
}) {
|
|
5967
|
-
const [searchInput, setSearchInput] =
|
|
5968
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
6134
|
+
const [searchInput, setSearchInput] = useState8("");
|
|
6135
|
+
const [highlightedIndex, setHighlightedIndex] = useState8(-1);
|
|
5969
6136
|
const inputRef = useRef4(null);
|
|
5970
6137
|
const baseId = useId4();
|
|
5971
6138
|
const {
|
|
@@ -6022,7 +6189,7 @@ function FilterSubmenuContent({
|
|
|
6022
6189
|
const isSelected = currentValues.includes(option.value);
|
|
6023
6190
|
const isHighlighted = highlightedIndex === index;
|
|
6024
6191
|
const itemId = `${baseId}-item-${index}`;
|
|
6025
|
-
return /* @__PURE__ */
|
|
6192
|
+
return /* @__PURE__ */ jsxs24(
|
|
6026
6193
|
DropdownMenuCheckboxItem,
|
|
6027
6194
|
{
|
|
6028
6195
|
id: itemId,
|
|
@@ -6041,7 +6208,7 @@ function FilterSubmenuContent({
|
|
|
6041
6208
|
onCheckedChange: () => onToggle(option.value, isSelected),
|
|
6042
6209
|
children: [
|
|
6043
6210
|
option.icon && option.icon,
|
|
6044
|
-
/* @__PURE__ */
|
|
6211
|
+
/* @__PURE__ */ jsx43("span", { className: "truncate", children: option.label })
|
|
6045
6212
|
]
|
|
6046
6213
|
},
|
|
6047
6214
|
String(option.value)
|
|
@@ -6052,9 +6219,9 @@ function FilterSubmenuContent({
|
|
|
6052
6219
|
setHighlightedIndex(0);
|
|
6053
6220
|
}
|
|
6054
6221
|
}, [isActive, filteredOptions.length]);
|
|
6055
|
-
return /* @__PURE__ */
|
|
6056
|
-
field.searchable !== false && /* @__PURE__ */
|
|
6057
|
-
/* @__PURE__ */
|
|
6222
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col", onMouseEnter: onActive, children: [
|
|
6223
|
+
field.searchable !== false && /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
6224
|
+
/* @__PURE__ */ jsx43(
|
|
6058
6225
|
Input,
|
|
6059
6226
|
{
|
|
6060
6227
|
ref: inputRef,
|
|
@@ -6117,9 +6284,9 @@ function FilterSubmenuContent({
|
|
|
6117
6284
|
}
|
|
6118
6285
|
}
|
|
6119
6286
|
),
|
|
6120
|
-
/* @__PURE__ */
|
|
6287
|
+
/* @__PURE__ */ jsx43(DropdownMenuSeparator, {})
|
|
6121
6288
|
] }),
|
|
6122
|
-
/* @__PURE__ */
|
|
6289
|
+
/* @__PURE__ */ jsx43("div", { className: "relative flex max-h-full", children: /* @__PURE__ */ jsx43(
|
|
6123
6290
|
"div",
|
|
6124
6291
|
{
|
|
6125
6292
|
className: "flex max-h-[min(var(--available-height),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain outline-hidden",
|
|
@@ -6164,11 +6331,11 @@ function FilterSubmenuContent({
|
|
|
6164
6331
|
e.stopPropagation();
|
|
6165
6332
|
}
|
|
6166
6333
|
},
|
|
6167
|
-
children: isAsync && loading && filteredOptions.length === 0 ? /* @__PURE__ */
|
|
6334
|
+
children: isAsync && loading && filteredOptions.length === 0 ? /* @__PURE__ */ jsx43("div", { className: "py-2 text-center text-sm text-muted-foreground", children: i18n.loadingOptions ?? DEFAULT_I18N.loadingOptions }) : isAsync && error ? /* @__PURE__ */ jsx43("div", { className: "py-2 text-center text-sm text-muted-foreground", children: i18n.errorLoadingOptions ?? DEFAULT_I18N.errorLoadingOptions }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsx43("div", { className: "py-2 text-center text-sm text-muted-foreground", children: i18n.noResultsFound }) : field.renderOptionList ? field.renderOptionList({
|
|
6168
6335
|
options: filteredOptions,
|
|
6169
6336
|
highlightedIndex,
|
|
6170
6337
|
renderOption: renderOptionItem
|
|
6171
|
-
}) : /* @__PURE__ */
|
|
6338
|
+
}) : /* @__PURE__ */ jsx43(ScrollArea, { className: "size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain", children: /* @__PURE__ */ jsx43(DropdownMenuGroup, { children: filteredOptions.map(
|
|
6172
6339
|
(option, index) => renderOptionItem(option, index)
|
|
6173
6340
|
) }) })
|
|
6174
6341
|
}
|
|
@@ -6192,12 +6359,12 @@ function Filters({
|
|
|
6192
6359
|
shortcutKey = "f",
|
|
6193
6360
|
shortcutLabel = "F"
|
|
6194
6361
|
}) {
|
|
6195
|
-
const [addFilterOpen, setAddFilterOpen] =
|
|
6196
|
-
const [menuSearchInput, setMenuSearchInput] =
|
|
6197
|
-
const [activeMenu, setActiveMenu] =
|
|
6198
|
-
const [openSubMenu, setOpenSubMenu] =
|
|
6199
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
6200
|
-
const [lastAddedFilterId, setLastAddedFilterId] =
|
|
6362
|
+
const [addFilterOpen, setAddFilterOpen] = useState8(false);
|
|
6363
|
+
const [menuSearchInput, setMenuSearchInput] = useState8("");
|
|
6364
|
+
const [activeMenu, setActiveMenu] = useState8("root");
|
|
6365
|
+
const [openSubMenu, setOpenSubMenu] = useState8(null);
|
|
6366
|
+
const [highlightedIndex, setHighlightedIndex] = useState8(-1);
|
|
6367
|
+
const [lastAddedFilterId, setLastAddedFilterId] = useState8(
|
|
6201
6368
|
null
|
|
6202
6369
|
);
|
|
6203
6370
|
const rootInputRef = useRef4(null);
|
|
@@ -6234,7 +6401,7 @@ function Filters({
|
|
|
6234
6401
|
setOpenSubMenu(null);
|
|
6235
6402
|
}
|
|
6236
6403
|
}, [addFilterOpen]);
|
|
6237
|
-
const [sessionFilterIds, setSessionFilterIds] =
|
|
6404
|
+
const [sessionFilterIds, setSessionFilterIds] = useState8({});
|
|
6238
6405
|
useEffect6(() => {
|
|
6239
6406
|
if (lastAddedFilterId) {
|
|
6240
6407
|
const timer = setTimeout(() => {
|
|
@@ -6254,7 +6421,7 @@ function Filters({
|
|
|
6254
6421
|
[i18n]
|
|
6255
6422
|
);
|
|
6256
6423
|
const fieldsMap = useMemo4(() => getFieldsMap(fields), [fields]);
|
|
6257
|
-
const updateFilter =
|
|
6424
|
+
const updateFilter = useCallback4(
|
|
6258
6425
|
(filterId, updates) => {
|
|
6259
6426
|
onChange(
|
|
6260
6427
|
filters.map((filter) => {
|
|
@@ -6271,13 +6438,13 @@ function Filters({
|
|
|
6271
6438
|
},
|
|
6272
6439
|
[filters, onChange]
|
|
6273
6440
|
);
|
|
6274
|
-
const removeFilter =
|
|
6441
|
+
const removeFilter = useCallback4(
|
|
6275
6442
|
(filterId) => {
|
|
6276
6443
|
onChange(filters.filter((filter) => filter.id !== filterId));
|
|
6277
6444
|
},
|
|
6278
6445
|
[filters, onChange]
|
|
6279
6446
|
);
|
|
6280
|
-
const addFilter =
|
|
6447
|
+
const addFilter = useCallback4(
|
|
6281
6448
|
(fieldKey) => {
|
|
6282
6449
|
const field = fieldsMap[fieldKey];
|
|
6283
6450
|
if (field && field.key) {
|
|
@@ -6315,8 +6482,8 @@ function Filters({
|
|
|
6315
6482
|
}
|
|
6316
6483
|
}, [addFilterOpen, filteredFields.length]);
|
|
6317
6484
|
const triggerButton = useRender5({
|
|
6318
|
-
render: trigger ?? /* @__PURE__ */
|
|
6319
|
-
/* @__PURE__ */
|
|
6485
|
+
render: trigger ?? /* @__PURE__ */ jsxs24(Button, { variant: "outline", children: [
|
|
6486
|
+
/* @__PURE__ */ jsx43(PlusIcon, {}),
|
|
6320
6487
|
mergedI18n.addFilter
|
|
6321
6488
|
] }),
|
|
6322
6489
|
defaultTagName: "button"
|
|
@@ -6333,12 +6500,12 @@ function Filters({
|
|
|
6333
6500
|
}),
|
|
6334
6501
|
[variant, size, radius, mergedI18n, className, trigger, allowMultiple]
|
|
6335
6502
|
);
|
|
6336
|
-
return /* @__PURE__ */
|
|
6503
|
+
return /* @__PURE__ */ jsx43(FilterContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs24(
|
|
6337
6504
|
"div",
|
|
6338
6505
|
{
|
|
6339
6506
|
className: cn(filtersContainerVariants({ variant, size }), className),
|
|
6340
6507
|
children: [
|
|
6341
|
-
selectableFields.length > 0 && /* @__PURE__ */
|
|
6508
|
+
selectableFields.length > 0 && /* @__PURE__ */ jsxs24(
|
|
6342
6509
|
DropdownMenu,
|
|
6343
6510
|
{
|
|
6344
6511
|
open: addFilterOpen,
|
|
@@ -6352,16 +6519,16 @@ function Filters({
|
|
|
6352
6519
|
}
|
|
6353
6520
|
},
|
|
6354
6521
|
children: [
|
|
6355
|
-
/* @__PURE__ */
|
|
6356
|
-
/* @__PURE__ */
|
|
6522
|
+
/* @__PURE__ */ jsx43(DropdownMenuTrigger, { render: triggerButton }),
|
|
6523
|
+
/* @__PURE__ */ jsxs24(
|
|
6357
6524
|
DropdownMenuContent,
|
|
6358
6525
|
{
|
|
6359
6526
|
className: cn("w-55", menuPopupClassName),
|
|
6360
6527
|
align: "start",
|
|
6361
6528
|
children: [
|
|
6362
|
-
showSearchInput && /* @__PURE__ */
|
|
6363
|
-
/* @__PURE__ */
|
|
6364
|
-
/* @__PURE__ */
|
|
6529
|
+
showSearchInput && /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
6530
|
+
/* @__PURE__ */ jsxs24("div", { className: "relative", children: [
|
|
6531
|
+
/* @__PURE__ */ jsx43(
|
|
6365
6532
|
Input,
|
|
6366
6533
|
{
|
|
6367
6534
|
ref: rootInputRef,
|
|
@@ -6433,20 +6600,20 @@ function Filters({
|
|
|
6433
6600
|
}
|
|
6434
6601
|
}
|
|
6435
6602
|
),
|
|
6436
|
-
enableShortcut && shortcutLabel && /* @__PURE__ */
|
|
6603
|
+
enableShortcut && shortcutLabel && /* @__PURE__ */ jsx43(Kbd, { className: "absolute top-1/2 right-2 -translate-y-1/2 border bg-background", children: shortcutLabel })
|
|
6437
6604
|
] }),
|
|
6438
|
-
/* @__PURE__ */
|
|
6605
|
+
/* @__PURE__ */ jsx43(DropdownMenuSeparator, {})
|
|
6439
6606
|
] }),
|
|
6440
|
-
/* @__PURE__ */
|
|
6607
|
+
/* @__PURE__ */ jsx43("div", { className: "relative flex max-h-full", children: /* @__PURE__ */ jsx43(
|
|
6441
6608
|
"div",
|
|
6442
6609
|
{
|
|
6443
6610
|
className: "flex max-h-[min(var(--available-height),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain",
|
|
6444
6611
|
role: "listbox",
|
|
6445
6612
|
id: `${rootId}-listbox`,
|
|
6446
6613
|
onMouseEnter: () => setActiveMenu("root"),
|
|
6447
|
-
children: /* @__PURE__ */
|
|
6614
|
+
children: /* @__PURE__ */ jsx43(ScrollArea, { className: "**:data-[slot=scroll-area-scrollbar]:m-0", children: (() => {
|
|
6448
6615
|
if (filteredFields.length === 0) {
|
|
6449
|
-
return /* @__PURE__ */
|
|
6616
|
+
return /* @__PURE__ */ jsx43("div", { className: "py-2 text-center text-sm text-muted-foreground", children: mergedI18n.noFieldsFound });
|
|
6450
6617
|
}
|
|
6451
6618
|
return filteredFields.map((field, index) => {
|
|
6452
6619
|
const isHighlighted = highlightedIndex === index;
|
|
@@ -6458,7 +6625,7 @@ function Filters({
|
|
|
6458
6625
|
const sessionFilterId = sessionFilterIds[fieldKey];
|
|
6459
6626
|
const sessionFilter = sessionFilterId ? filters.find((f) => f.id === sessionFilterId) : null;
|
|
6460
6627
|
const currentValues = sessionFilter?.values || [];
|
|
6461
|
-
return /* @__PURE__ */
|
|
6628
|
+
return /* @__PURE__ */ jsxs24(
|
|
6462
6629
|
DropdownMenuSub,
|
|
6463
6630
|
{
|
|
6464
6631
|
open: openSubMenu === fieldKey,
|
|
@@ -6473,7 +6640,7 @@ function Filters({
|
|
|
6473
6640
|
}
|
|
6474
6641
|
},
|
|
6475
6642
|
children: [
|
|
6476
|
-
/* @__PURE__ */
|
|
6643
|
+
/* @__PURE__ */ jsxs24(
|
|
6477
6644
|
DropdownMenuSubTrigger,
|
|
6478
6645
|
{
|
|
6479
6646
|
id: itemId,
|
|
@@ -6487,16 +6654,16 @@ function Filters({
|
|
|
6487
6654
|
className: "data-highlighted:bg-accent data-highlighted:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground",
|
|
6488
6655
|
children: [
|
|
6489
6656
|
field.icon,
|
|
6490
|
-
/* @__PURE__ */
|
|
6657
|
+
/* @__PURE__ */ jsx43("span", { children: field.label })
|
|
6491
6658
|
]
|
|
6492
6659
|
}
|
|
6493
6660
|
),
|
|
6494
|
-
/* @__PURE__ */
|
|
6661
|
+
/* @__PURE__ */ jsx43(
|
|
6495
6662
|
DropdownMenuSubContent,
|
|
6496
6663
|
{
|
|
6497
6664
|
className: "w-50",
|
|
6498
6665
|
side: "right",
|
|
6499
|
-
children: /* @__PURE__ */
|
|
6666
|
+
children: /* @__PURE__ */ jsx43(
|
|
6500
6667
|
FilterSubmenuContent,
|
|
6501
6668
|
{
|
|
6502
6669
|
field,
|
|
@@ -6569,7 +6736,7 @@ function Filters({
|
|
|
6569
6736
|
fieldKey
|
|
6570
6737
|
);
|
|
6571
6738
|
}
|
|
6572
|
-
return /* @__PURE__ */
|
|
6739
|
+
return /* @__PURE__ */ jsxs24(
|
|
6573
6740
|
DropdownMenuItem,
|
|
6574
6741
|
{
|
|
6575
6742
|
id: itemId,
|
|
@@ -6581,7 +6748,7 @@ function Filters({
|
|
|
6581
6748
|
className: "data-highlighted:bg-accent data-highlighted:text-accent-foreground",
|
|
6582
6749
|
children: [
|
|
6583
6750
|
field.icon,
|
|
6584
|
-
/* @__PURE__ */
|
|
6751
|
+
/* @__PURE__ */ jsx43("span", { children: field.label })
|
|
6585
6752
|
]
|
|
6586
6753
|
},
|
|
6587
6754
|
field.key
|
|
@@ -6599,16 +6766,16 @@ function Filters({
|
|
|
6599
6766
|
filters.map((filter) => {
|
|
6600
6767
|
const field = fieldsMap[filter.field];
|
|
6601
6768
|
if (!field) return null;
|
|
6602
|
-
return /* @__PURE__ */
|
|
6769
|
+
return /* @__PURE__ */ jsxs24(
|
|
6603
6770
|
ButtonGroup,
|
|
6604
6771
|
{
|
|
6605
6772
|
className: "",
|
|
6606
6773
|
children: [
|
|
6607
|
-
/* @__PURE__ */
|
|
6774
|
+
/* @__PURE__ */ jsxs24(ButtonGroupText, { className: "bg-background dark:bg-input/30", children: [
|
|
6608
6775
|
field.icon && field.icon,
|
|
6609
6776
|
field.label
|
|
6610
6777
|
] }),
|
|
6611
|
-
/* @__PURE__ */
|
|
6778
|
+
/* @__PURE__ */ jsx43(
|
|
6612
6779
|
FilterOperatorDropdown,
|
|
6613
6780
|
{
|
|
6614
6781
|
field,
|
|
@@ -6617,7 +6784,7 @@ function Filters({
|
|
|
6617
6784
|
onChange: (operator) => updateFilter(filter.id, { operator })
|
|
6618
6785
|
}
|
|
6619
6786
|
),
|
|
6620
|
-
/* @__PURE__ */
|
|
6787
|
+
/* @__PURE__ */ jsx43(
|
|
6621
6788
|
FilterValueSelector,
|
|
6622
6789
|
{
|
|
6623
6790
|
field,
|
|
@@ -6627,7 +6794,7 @@ function Filters({
|
|
|
6627
6794
|
autoFocus: filter.id === lastAddedFilterId
|
|
6628
6795
|
}
|
|
6629
6796
|
),
|
|
6630
|
-
/* @__PURE__ */
|
|
6797
|
+
/* @__PURE__ */ jsx43(FilterRemoveButton, { onClick: () => removeFilter(filter.id) })
|
|
6631
6798
|
]
|
|
6632
6799
|
},
|
|
6633
6800
|
filter.id
|
|
@@ -6653,10 +6820,10 @@ var createFilterGroup = (id, label, fields, initialFilters = []) => ({
|
|
|
6653
6820
|
// src/ui/select.tsx
|
|
6654
6821
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
6655
6822
|
import { Check as Check2, ChevronDown as ChevronDown3, ChevronUp as ChevronUp2 } from "@gravity-ui/icons";
|
|
6656
|
-
import { jsx as
|
|
6823
|
+
import { jsx as jsx44, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6657
6824
|
var Select = SelectPrimitive.Root;
|
|
6658
6825
|
function SelectGroup({ className, ...props }) {
|
|
6659
|
-
return /* @__PURE__ */
|
|
6826
|
+
return /* @__PURE__ */ jsx44(
|
|
6660
6827
|
SelectPrimitive.Group,
|
|
6661
6828
|
{
|
|
6662
6829
|
"data-slot": "select-group",
|
|
@@ -6666,7 +6833,7 @@ function SelectGroup({ className, ...props }) {
|
|
|
6666
6833
|
);
|
|
6667
6834
|
}
|
|
6668
6835
|
function SelectValue({ className, ...props }) {
|
|
6669
|
-
return /* @__PURE__ */
|
|
6836
|
+
return /* @__PURE__ */ jsx44(
|
|
6670
6837
|
SelectPrimitive.Value,
|
|
6671
6838
|
{
|
|
6672
6839
|
"data-slot": "select-value",
|
|
@@ -6681,7 +6848,7 @@ function SelectTrigger({
|
|
|
6681
6848
|
children,
|
|
6682
6849
|
...props
|
|
6683
6850
|
}) {
|
|
6684
|
-
return /* @__PURE__ */
|
|
6851
|
+
return /* @__PURE__ */ jsxs25(
|
|
6685
6852
|
SelectPrimitive.Trigger,
|
|
6686
6853
|
{
|
|
6687
6854
|
"data-slot": "select-trigger",
|
|
@@ -6693,10 +6860,10 @@ function SelectTrigger({
|
|
|
6693
6860
|
...props,
|
|
6694
6861
|
children: [
|
|
6695
6862
|
children,
|
|
6696
|
-
/* @__PURE__ */
|
|
6863
|
+
/* @__PURE__ */ jsx44(
|
|
6697
6864
|
SelectPrimitive.Icon,
|
|
6698
6865
|
{
|
|
6699
|
-
render: /* @__PURE__ */
|
|
6866
|
+
render: /* @__PURE__ */ jsx44(ChevronDown3, { className: "pointer-events-none size-4 text-muted-foreground" })
|
|
6700
6867
|
}
|
|
6701
6868
|
)
|
|
6702
6869
|
]
|
|
@@ -6713,7 +6880,7 @@ function SelectContent({
|
|
|
6713
6880
|
alignItemWithTrigger = true,
|
|
6714
6881
|
...props
|
|
6715
6882
|
}) {
|
|
6716
|
-
return /* @__PURE__ */
|
|
6883
|
+
return /* @__PURE__ */ jsx44(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx44(
|
|
6717
6884
|
SelectPrimitive.Positioner,
|
|
6718
6885
|
{
|
|
6719
6886
|
side,
|
|
@@ -6722,7 +6889,7 @@ function SelectContent({
|
|
|
6722
6889
|
alignOffset,
|
|
6723
6890
|
alignItemWithTrigger,
|
|
6724
6891
|
className: "isolate z-50",
|
|
6725
|
-
children: /* @__PURE__ */
|
|
6892
|
+
children: /* @__PURE__ */ jsxs25(
|
|
6726
6893
|
SelectPrimitive.Popup,
|
|
6727
6894
|
{
|
|
6728
6895
|
"data-slot": "select-content",
|
|
@@ -6733,9 +6900,9 @@ function SelectContent({
|
|
|
6733
6900
|
),
|
|
6734
6901
|
...props,
|
|
6735
6902
|
children: [
|
|
6736
|
-
/* @__PURE__ */
|
|
6737
|
-
/* @__PURE__ */
|
|
6738
|
-
/* @__PURE__ */
|
|
6903
|
+
/* @__PURE__ */ jsx44(SelectScrollUpButton, {}),
|
|
6904
|
+
/* @__PURE__ */ jsx44(SelectPrimitive.List, { className: "p-1", children }),
|
|
6905
|
+
/* @__PURE__ */ jsx44(SelectScrollDownButton, {})
|
|
6739
6906
|
]
|
|
6740
6907
|
}
|
|
6741
6908
|
)
|
|
@@ -6746,7 +6913,7 @@ function SelectLabel({
|
|
|
6746
6913
|
className,
|
|
6747
6914
|
...props
|
|
6748
6915
|
}) {
|
|
6749
|
-
return /* @__PURE__ */
|
|
6916
|
+
return /* @__PURE__ */ jsx44(
|
|
6750
6917
|
SelectPrimitive.GroupLabel,
|
|
6751
6918
|
{
|
|
6752
6919
|
"data-slot": "select-label",
|
|
@@ -6760,7 +6927,7 @@ function SelectItem({
|
|
|
6760
6927
|
children,
|
|
6761
6928
|
...props
|
|
6762
6929
|
}) {
|
|
6763
|
-
return /* @__PURE__ */
|
|
6930
|
+
return /* @__PURE__ */ jsxs25(
|
|
6764
6931
|
SelectPrimitive.Item,
|
|
6765
6932
|
{
|
|
6766
6933
|
"data-slot": "select-item",
|
|
@@ -6770,12 +6937,12 @@ function SelectItem({
|
|
|
6770
6937
|
),
|
|
6771
6938
|
...props,
|
|
6772
6939
|
children: [
|
|
6773
|
-
/* @__PURE__ */
|
|
6774
|
-
/* @__PURE__ */
|
|
6940
|
+
/* @__PURE__ */ jsx44(SelectPrimitive.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children }),
|
|
6941
|
+
/* @__PURE__ */ jsx44(
|
|
6775
6942
|
SelectPrimitive.ItemIndicator,
|
|
6776
6943
|
{
|
|
6777
|
-
render: /* @__PURE__ */
|
|
6778
|
-
children: /* @__PURE__ */
|
|
6944
|
+
render: /* @__PURE__ */ jsx44("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
6945
|
+
children: /* @__PURE__ */ jsx44(Check2, { className: "pointer-events-none" })
|
|
6779
6946
|
}
|
|
6780
6947
|
)
|
|
6781
6948
|
]
|
|
@@ -6786,7 +6953,7 @@ function SelectSeparator({
|
|
|
6786
6953
|
className,
|
|
6787
6954
|
...props
|
|
6788
6955
|
}) {
|
|
6789
|
-
return /* @__PURE__ */
|
|
6956
|
+
return /* @__PURE__ */ jsx44(
|
|
6790
6957
|
SelectPrimitive.Separator,
|
|
6791
6958
|
{
|
|
6792
6959
|
"data-slot": "select-separator",
|
|
@@ -6799,7 +6966,7 @@ function SelectScrollUpButton({
|
|
|
6799
6966
|
className,
|
|
6800
6967
|
...props
|
|
6801
6968
|
}) {
|
|
6802
|
-
return /* @__PURE__ */
|
|
6969
|
+
return /* @__PURE__ */ jsx44(
|
|
6803
6970
|
SelectPrimitive.ScrollUpArrow,
|
|
6804
6971
|
{
|
|
6805
6972
|
"data-slot": "select-scroll-up-button",
|
|
@@ -6808,7 +6975,7 @@ function SelectScrollUpButton({
|
|
|
6808
6975
|
className
|
|
6809
6976
|
),
|
|
6810
6977
|
...props,
|
|
6811
|
-
children: /* @__PURE__ */
|
|
6978
|
+
children: /* @__PURE__ */ jsx44(ChevronUp2, {})
|
|
6812
6979
|
}
|
|
6813
6980
|
);
|
|
6814
6981
|
}
|
|
@@ -6816,7 +6983,7 @@ function SelectScrollDownButton({
|
|
|
6816
6983
|
className,
|
|
6817
6984
|
...props
|
|
6818
6985
|
}) {
|
|
6819
|
-
return /* @__PURE__ */
|
|
6986
|
+
return /* @__PURE__ */ jsx44(
|
|
6820
6987
|
SelectPrimitive.ScrollDownArrow,
|
|
6821
6988
|
{
|
|
6822
6989
|
"data-slot": "select-scroll-down-button",
|
|
@@ -6825,17 +6992,17 @@ function SelectScrollDownButton({
|
|
|
6825
6992
|
className
|
|
6826
6993
|
),
|
|
6827
6994
|
...props,
|
|
6828
|
-
children: /* @__PURE__ */
|
|
6995
|
+
children: /* @__PURE__ */ jsx44(ChevronDown3, {})
|
|
6829
6996
|
}
|
|
6830
6997
|
);
|
|
6831
6998
|
}
|
|
6832
6999
|
|
|
6833
7000
|
// src/ui/skeleton.tsx
|
|
6834
7001
|
import {
|
|
6835
|
-
forwardRef as
|
|
7002
|
+
forwardRef as forwardRef4,
|
|
6836
7003
|
useLayoutEffect
|
|
6837
7004
|
} from "react";
|
|
6838
|
-
import { jsx as
|
|
7005
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
6839
7006
|
var componentThemeClassName = "[--ic-background:#ffffff] [--ic-foreground:#111111] [--ic-primary:#111111] [--ic-secondary:#646b75] [--ic-surface-border:#e9edf2] [--ic-border:#e3e7ec] [--ic-card:#ffffff] [--ic-card-foreground:#111111] [--ic-muted:#f5f7fa] [--ic-muted-foreground:#6d7480] [--ic-accent:#f3f5f8] [--color-accent:var(--ic-accent)] [--color-accent-foreground:var(--ic-accent-foreground)] [--ic-accent-foreground:#111111] [--ic-input:#e3e7ec] [--ic-ring:rgba(17,17,17,0.16)] [--ic-destructive:#dc2626] [--ic-paper:#fcfcfd] [--ic-popover-foreground:#111111] [--ic-brand:#0ea5e9] [--ic-brand-soft:#bae6fd] [--ic-shadow-soft:0_18px_38px_-24px_rgba(15,23,42,0.35)] [--ic-chart-1:oklch(0.52_0.19_254)] [--ic-chart-2:oklch(0.74_0.11_232)] [--ic-chart-3:oklch(0.42_0.16_262)] [--ic-chart-4:oklch(0.84_0.07_228)] [--ic-chart-5:oklch(0.62_0.14_240)] [--color-background:var(--ic-background)] [--color-foreground:var(--ic-foreground)] [--color-primary:var(--ic-primary)] [--color-secondary:var(--ic-secondary)] [--color-border:var(--ic-border)] [--color-card:var(--ic-card)] [--color-card-foreground:var(--ic-card-foreground)] [--color-muted:var(--ic-muted)] [--color-muted-foreground:var(--ic-muted-foreground)] [--color-accent:var(--ic-accent)] [--color-accent-foreground:var(--ic-accent-foreground)] [--color-input:var(--ic-input)] [--color-ring:var(--ic-ring)] [--color-destructive:var(--ic-destructive)] [--color-paper:var(--ic-paper)] [--color-popover-foreground:var(--ic-popover-foreground)] [--color-brand:var(--ic-brand)] [--color-brand-soft:var(--ic-brand-soft)] [--color-chart-1:var(--ic-chart-1)] [--color-chart-2:var(--ic-chart-2)] [--color-chart-3:var(--ic-chart-3)] [--color-chart-4:var(--ic-chart-4)] [--color-chart-5:var(--ic-chart-5)] dark:[--ic-background:#111111] dark:[--ic-foreground:#f6f3ec] dark:[--ic-primary:#f6f3ec] dark:[--ic-secondary:#cbc6bb] dark:[--ic-surface-border:#2a2a25] dark:[--ic-border:#2b2a25] dark:[--ic-card:#111111] dark:[--ic-card-foreground:#f6f3ec] dark:[--ic-muted:#171716] dark:[--ic-muted-foreground:#9a958a] dark:[--ic-accent:#1a1a18] [--color-accent:var(--ic-accent)] [--color-accent-foreground:var(--ic-accent-foreground)] dark:[--ic-accent-foreground:#f6f3ec] dark:[--ic-input:#2b2a25] dark:[--ic-ring:rgba(246,243,236,0.18)] dark:[--ic-destructive:#f87171] dark:[--ic-paper:#171716] dark:[--ic-popover-foreground:#f6f3ec] dark:[--ic-brand:#38bdf8] dark:[--ic-brand-soft:#0c4a6e] dark:[--ic-shadow-soft:0_20px_44px_-28px_rgba(0,0,0,0.6)] dark:[--ic-chart-1:oklch(0.68_0.17_250)] dark:[--ic-chart-2:oklch(0.82_0.09_225)] dark:[--ic-chart-3:oklch(0.58_0.15_260)] dark:[--ic-chart-4:oklch(0.75_0.12_235)] dark:[--ic-chart-5:oklch(0.88_0.06_220)]";
|
|
6840
7007
|
var STYLE_ID = "iconiq-skeleton-styles";
|
|
6841
7008
|
var SKELETON_CSS = `
|
|
@@ -6933,7 +7100,7 @@ function resolveSkeletonA11yProps({
|
|
|
6933
7100
|
role: "status"
|
|
6934
7101
|
};
|
|
6935
7102
|
}
|
|
6936
|
-
var Skeleton =
|
|
7103
|
+
var Skeleton = forwardRef4(function Skeleton2({
|
|
6937
7104
|
animate: animate2 = true,
|
|
6938
7105
|
className,
|
|
6939
7106
|
decorative = true,
|
|
@@ -6956,7 +7123,7 @@ var Skeleton = forwardRef2(function Skeleton2({
|
|
|
6956
7123
|
...style,
|
|
6957
7124
|
"--iconiq-skeleton-duration": `${variantDuration}s`
|
|
6958
7125
|
} : style;
|
|
6959
|
-
return /* @__PURE__ */
|
|
7126
|
+
return /* @__PURE__ */ jsx45(
|
|
6960
7127
|
"div",
|
|
6961
7128
|
{
|
|
6962
7129
|
className: cn(
|
|
@@ -6970,7 +7137,7 @@ var Skeleton = forwardRef2(function Skeleton2({
|
|
|
6970
7137
|
style: animatedStyle,
|
|
6971
7138
|
...resolveSkeletonA11yProps({ animate: animate2, decorative, label }),
|
|
6972
7139
|
...props,
|
|
6973
|
-
children: showShimmer ? /* @__PURE__ */
|
|
7140
|
+
children: showShimmer ? /* @__PURE__ */ jsx45(
|
|
6974
7141
|
"span",
|
|
6975
7142
|
{
|
|
6976
7143
|
"aria-hidden": "true",
|
|
@@ -6985,7 +7152,7 @@ function SkeletonAvatar({
|
|
|
6985
7152
|
className,
|
|
6986
7153
|
...props
|
|
6987
7154
|
}) {
|
|
6988
|
-
return /* @__PURE__ */
|
|
7155
|
+
return /* @__PURE__ */ jsx45(
|
|
6989
7156
|
Skeleton,
|
|
6990
7157
|
{
|
|
6991
7158
|
className: cn("size-10", className),
|
|
@@ -6996,13 +7163,13 @@ function SkeletonAvatar({
|
|
|
6996
7163
|
);
|
|
6997
7164
|
}
|
|
6998
7165
|
function SkeletonText({ className, ...props }) {
|
|
6999
|
-
return /* @__PURE__ */
|
|
7166
|
+
return /* @__PURE__ */ jsx45(Skeleton, { className: cn("h-3", className), decorative: true, ...props });
|
|
7000
7167
|
}
|
|
7001
7168
|
function SkeletonButton({
|
|
7002
7169
|
className,
|
|
7003
7170
|
...props
|
|
7004
7171
|
}) {
|
|
7005
|
-
return /* @__PURE__ */
|
|
7172
|
+
return /* @__PURE__ */ jsx45(
|
|
7006
7173
|
Skeleton,
|
|
7007
7174
|
{
|
|
7008
7175
|
className: cn("h-9 w-24", className),
|
|
@@ -7017,11 +7184,11 @@ var ShimmerSkeleton = Skeleton;
|
|
|
7017
7184
|
// src/ui/sonner.tsx
|
|
7018
7185
|
import { GooeyToaster } from "goey-toast";
|
|
7019
7186
|
import { useTheme } from "next-themes";
|
|
7020
|
-
import { jsx as
|
|
7187
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
7021
7188
|
var Toaster = ({ closeButton = "top-left", ...props }) => {
|
|
7022
7189
|
const { theme = "system" } = useTheme();
|
|
7023
7190
|
const toasterTheme = theme === "dark" ? "dark" : "light";
|
|
7024
|
-
return /* @__PURE__ */
|
|
7191
|
+
return /* @__PURE__ */ jsx46(
|
|
7025
7192
|
GooeyToaster,
|
|
7026
7193
|
{
|
|
7027
7194
|
theme: toasterTheme,
|
|
@@ -7032,15 +7199,509 @@ var Toaster = ({ closeButton = "top-left", ...props }) => {
|
|
|
7032
7199
|
);
|
|
7033
7200
|
};
|
|
7034
7201
|
|
|
7202
|
+
// src/ui/sortable.tsx
|
|
7203
|
+
import { mergeProps as mergeProps5 } from "@base-ui/react/merge-props";
|
|
7204
|
+
import { useRender as useRender6 } from "@base-ui/react/use-render";
|
|
7205
|
+
import {
|
|
7206
|
+
closestCenter,
|
|
7207
|
+
closestCorners,
|
|
7208
|
+
defaultDropAnimationSideEffects,
|
|
7209
|
+
DndContext,
|
|
7210
|
+
DragOverlay,
|
|
7211
|
+
KeyboardSensor,
|
|
7212
|
+
MouseSensor,
|
|
7213
|
+
TouchSensor,
|
|
7214
|
+
useSensor,
|
|
7215
|
+
useSensors
|
|
7216
|
+
} from "@dnd-kit/core";
|
|
7217
|
+
import {
|
|
7218
|
+
restrictToHorizontalAxis,
|
|
7219
|
+
restrictToParentElement,
|
|
7220
|
+
restrictToVerticalAxis
|
|
7221
|
+
} from "@dnd-kit/modifiers";
|
|
7222
|
+
import {
|
|
7223
|
+
arrayMove,
|
|
7224
|
+
horizontalListSortingStrategy,
|
|
7225
|
+
SortableContext,
|
|
7226
|
+
sortableKeyboardCoordinates,
|
|
7227
|
+
useSortable,
|
|
7228
|
+
verticalListSortingStrategy
|
|
7229
|
+
} from "@dnd-kit/sortable";
|
|
7230
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
7231
|
+
import * as React14 from "react";
|
|
7232
|
+
import * as ReactDOM from "react-dom";
|
|
7233
|
+
|
|
7234
|
+
// src/lib/compose-refs.ts
|
|
7235
|
+
import * as React12 from "react";
|
|
7236
|
+
function setRef(ref, value) {
|
|
7237
|
+
if (typeof ref === "function") {
|
|
7238
|
+
return ref(value);
|
|
7239
|
+
}
|
|
7240
|
+
if (ref !== null && ref !== void 0) {
|
|
7241
|
+
ref.current = value;
|
|
7242
|
+
}
|
|
7243
|
+
}
|
|
7244
|
+
function composeRefs(...refs) {
|
|
7245
|
+
return (node) => {
|
|
7246
|
+
let hasCleanup = false;
|
|
7247
|
+
const cleanups = refs.map((ref) => {
|
|
7248
|
+
const cleanup = setRef(ref, node);
|
|
7249
|
+
if (!hasCleanup && typeof cleanup === "function") {
|
|
7250
|
+
hasCleanup = true;
|
|
7251
|
+
}
|
|
7252
|
+
return cleanup;
|
|
7253
|
+
});
|
|
7254
|
+
if (hasCleanup) {
|
|
7255
|
+
return () => {
|
|
7256
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
7257
|
+
const cleanup = cleanups[i];
|
|
7258
|
+
if (typeof cleanup === "function") {
|
|
7259
|
+
cleanup();
|
|
7260
|
+
} else {
|
|
7261
|
+
setRef(refs[i], null);
|
|
7262
|
+
}
|
|
7263
|
+
}
|
|
7264
|
+
};
|
|
7265
|
+
}
|
|
7266
|
+
};
|
|
7267
|
+
}
|
|
7268
|
+
function useComposedRefs(...refs) {
|
|
7269
|
+
return React12.useCallback(composeRefs(...refs), refs);
|
|
7270
|
+
}
|
|
7271
|
+
|
|
7272
|
+
// src/hooks/use-isomorphic-layout-effect.ts
|
|
7273
|
+
import * as React13 from "react";
|
|
7274
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React13.useLayoutEffect : React13.useEffect;
|
|
7275
|
+
|
|
7276
|
+
// src/ui/sortable.tsx
|
|
7277
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
7278
|
+
var orientationConfig = {
|
|
7279
|
+
vertical: {
|
|
7280
|
+
modifiers: [restrictToVerticalAxis, restrictToParentElement],
|
|
7281
|
+
strategy: verticalListSortingStrategy,
|
|
7282
|
+
collisionDetection: closestCenter
|
|
7283
|
+
},
|
|
7284
|
+
horizontal: {
|
|
7285
|
+
modifiers: [restrictToHorizontalAxis, restrictToParentElement],
|
|
7286
|
+
strategy: horizontalListSortingStrategy,
|
|
7287
|
+
collisionDetection: closestCenter
|
|
7288
|
+
},
|
|
7289
|
+
mixed: {
|
|
7290
|
+
modifiers: [restrictToParentElement],
|
|
7291
|
+
strategy: void 0,
|
|
7292
|
+
collisionDetection: closestCorners
|
|
7293
|
+
}
|
|
7294
|
+
};
|
|
7295
|
+
var ROOT_NAME = "Sortable";
|
|
7296
|
+
var CONTENT_NAME = "SortableContent";
|
|
7297
|
+
var ITEM_NAME = "SortableItem";
|
|
7298
|
+
var ITEM_HANDLE_NAME = "SortableItemHandle";
|
|
7299
|
+
var OVERLAY_NAME = "SortableOverlay";
|
|
7300
|
+
var SortableRootContext = React14.createContext(null);
|
|
7301
|
+
function useSortableContext(consumerName) {
|
|
7302
|
+
const context = React14.useContext(SortableRootContext);
|
|
7303
|
+
if (!context) {
|
|
7304
|
+
throw new Error(`\`${consumerName}\` must be used within \`${ROOT_NAME}\``);
|
|
7305
|
+
}
|
|
7306
|
+
return context;
|
|
7307
|
+
}
|
|
7308
|
+
function Sortable(props) {
|
|
7309
|
+
const {
|
|
7310
|
+
value,
|
|
7311
|
+
onValueChange,
|
|
7312
|
+
collisionDetection,
|
|
7313
|
+
modifiers,
|
|
7314
|
+
strategy,
|
|
7315
|
+
onMove,
|
|
7316
|
+
orientation = "vertical",
|
|
7317
|
+
flatCursor = false,
|
|
7318
|
+
getItemValue: getItemValueProp,
|
|
7319
|
+
accessibility,
|
|
7320
|
+
...sortableProps
|
|
7321
|
+
} = props;
|
|
7322
|
+
const id = React14.useId();
|
|
7323
|
+
const [activeId, setActiveId] = React14.useState(null);
|
|
7324
|
+
const sensors = useSensors(
|
|
7325
|
+
useSensor(MouseSensor),
|
|
7326
|
+
useSensor(TouchSensor),
|
|
7327
|
+
useSensor(KeyboardSensor, {
|
|
7328
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
7329
|
+
})
|
|
7330
|
+
);
|
|
7331
|
+
const config = React14.useMemo(
|
|
7332
|
+
() => orientationConfig[orientation],
|
|
7333
|
+
[orientation]
|
|
7334
|
+
);
|
|
7335
|
+
const getItemValue = React14.useCallback(
|
|
7336
|
+
(item) => {
|
|
7337
|
+
if (typeof item === "object" && !getItemValueProp) {
|
|
7338
|
+
throw new Error(
|
|
7339
|
+
"`getItemValue` is required when using array of objects"
|
|
7340
|
+
);
|
|
7341
|
+
}
|
|
7342
|
+
return getItemValueProp ? getItemValueProp(item) : item;
|
|
7343
|
+
},
|
|
7344
|
+
[getItemValueProp]
|
|
7345
|
+
);
|
|
7346
|
+
const items = React14.useMemo(() => {
|
|
7347
|
+
return value.map((item) => getItemValue(item));
|
|
7348
|
+
}, [value, getItemValue]);
|
|
7349
|
+
const onDragStart = React14.useCallback(
|
|
7350
|
+
(event) => {
|
|
7351
|
+
sortableProps.onDragStart?.(event);
|
|
7352
|
+
if (event.activatorEvent.defaultPrevented) return;
|
|
7353
|
+
setActiveId(event.active.id);
|
|
7354
|
+
},
|
|
7355
|
+
[sortableProps.onDragStart]
|
|
7356
|
+
);
|
|
7357
|
+
const onDragEnd = React14.useCallback(
|
|
7358
|
+
(event) => {
|
|
7359
|
+
sortableProps.onDragEnd?.(event);
|
|
7360
|
+
if (event.activatorEvent.defaultPrevented) return;
|
|
7361
|
+
const { active, over } = event;
|
|
7362
|
+
if (over && active.id !== over?.id) {
|
|
7363
|
+
const activeIndex = value.findIndex(
|
|
7364
|
+
(item) => getItemValue(item) === active.id
|
|
7365
|
+
);
|
|
7366
|
+
const overIndex = value.findIndex(
|
|
7367
|
+
(item) => getItemValue(item) === over.id
|
|
7368
|
+
);
|
|
7369
|
+
if (onMove) {
|
|
7370
|
+
onMove({ ...event, activeIndex, overIndex });
|
|
7371
|
+
} else {
|
|
7372
|
+
onValueChange?.(arrayMove(value, activeIndex, overIndex));
|
|
7373
|
+
}
|
|
7374
|
+
}
|
|
7375
|
+
setActiveId(null);
|
|
7376
|
+
},
|
|
7377
|
+
[value, onValueChange, onMove, getItemValue, sortableProps.onDragEnd]
|
|
7378
|
+
);
|
|
7379
|
+
const onDragCancel = React14.useCallback(
|
|
7380
|
+
(event) => {
|
|
7381
|
+
sortableProps.onDragCancel?.(event);
|
|
7382
|
+
if (event.activatorEvent.defaultPrevented) return;
|
|
7383
|
+
setActiveId(null);
|
|
7384
|
+
},
|
|
7385
|
+
[sortableProps.onDragCancel]
|
|
7386
|
+
);
|
|
7387
|
+
const announcements = React14.useMemo(
|
|
7388
|
+
() => ({
|
|
7389
|
+
onDragStart({ active }) {
|
|
7390
|
+
const activeValue = active.id.toString();
|
|
7391
|
+
return `Grabbed sortable item "${activeValue}". Current position is ${active.data.current?.sortable.index + 1} of ${value.length}. Use arrow keys to move, space to drop.`;
|
|
7392
|
+
},
|
|
7393
|
+
onDragOver({ active, over }) {
|
|
7394
|
+
if (over) {
|
|
7395
|
+
const overIndex = over.data.current?.sortable.index ?? 0;
|
|
7396
|
+
const activeIndex = active.data.current?.sortable.index ?? 0;
|
|
7397
|
+
const moveDirection = overIndex > activeIndex ? "down" : "up";
|
|
7398
|
+
const activeValue = active.id.toString();
|
|
7399
|
+
return `Sortable item "${activeValue}" moved ${moveDirection} to position ${overIndex + 1} of ${value.length}.`;
|
|
7400
|
+
}
|
|
7401
|
+
return "Sortable item is no longer over a droppable area. Press escape to cancel.";
|
|
7402
|
+
},
|
|
7403
|
+
onDragEnd({ active, over }) {
|
|
7404
|
+
const activeValue = active.id.toString();
|
|
7405
|
+
if (over) {
|
|
7406
|
+
const overIndex = over.data.current?.sortable.index ?? 0;
|
|
7407
|
+
return `Sortable item "${activeValue}" dropped at position ${overIndex + 1} of ${value.length}.`;
|
|
7408
|
+
}
|
|
7409
|
+
return `Sortable item "${activeValue}" dropped. No changes were made.`;
|
|
7410
|
+
},
|
|
7411
|
+
onDragCancel({ active }) {
|
|
7412
|
+
const activeIndex = active.data.current?.sortable.index ?? 0;
|
|
7413
|
+
const activeValue = active.id.toString();
|
|
7414
|
+
return `Sorting cancelled. Sortable item "${activeValue}" returned to position ${activeIndex + 1} of ${value.length}.`;
|
|
7415
|
+
},
|
|
7416
|
+
onDragMove({ active, over }) {
|
|
7417
|
+
if (over) {
|
|
7418
|
+
const overIndex = over.data.current?.sortable.index ?? 0;
|
|
7419
|
+
const activeIndex = active.data.current?.sortable.index ?? 0;
|
|
7420
|
+
const moveDirection = overIndex > activeIndex ? "down" : "up";
|
|
7421
|
+
const activeValue = active.id.toString();
|
|
7422
|
+
return `Sortable item "${activeValue}" is moving ${moveDirection} to position ${overIndex + 1} of ${value.length}.`;
|
|
7423
|
+
}
|
|
7424
|
+
return "Sortable item is no longer over a droppable area. Press escape to cancel.";
|
|
7425
|
+
}
|
|
7426
|
+
}),
|
|
7427
|
+
[value]
|
|
7428
|
+
);
|
|
7429
|
+
const screenReaderInstructions = React14.useMemo(
|
|
7430
|
+
() => ({
|
|
7431
|
+
draggable: `
|
|
7432
|
+
To pick up a sortable item, press space or enter.
|
|
7433
|
+
While dragging, use the ${orientation === "vertical" ? "up and down" : orientation === "horizontal" ? "left and right" : "arrow"} keys to move the item.
|
|
7434
|
+
Press space or enter again to drop the item in its new position, or press escape to cancel.
|
|
7435
|
+
`
|
|
7436
|
+
}),
|
|
7437
|
+
[orientation]
|
|
7438
|
+
);
|
|
7439
|
+
const contextValue = React14.useMemo(
|
|
7440
|
+
() => ({
|
|
7441
|
+
id,
|
|
7442
|
+
items,
|
|
7443
|
+
modifiers: modifiers ?? config.modifiers,
|
|
7444
|
+
strategy: strategy ?? config.strategy,
|
|
7445
|
+
activeId,
|
|
7446
|
+
setActiveId,
|
|
7447
|
+
getItemValue,
|
|
7448
|
+
flatCursor
|
|
7449
|
+
}),
|
|
7450
|
+
[
|
|
7451
|
+
id,
|
|
7452
|
+
items,
|
|
7453
|
+
modifiers,
|
|
7454
|
+
strategy,
|
|
7455
|
+
config.modifiers,
|
|
7456
|
+
config.strategy,
|
|
7457
|
+
activeId,
|
|
7458
|
+
getItemValue,
|
|
7459
|
+
flatCursor
|
|
7460
|
+
]
|
|
7461
|
+
);
|
|
7462
|
+
return /* @__PURE__ */ jsx47(
|
|
7463
|
+
SortableRootContext.Provider,
|
|
7464
|
+
{
|
|
7465
|
+
value: contextValue,
|
|
7466
|
+
children: /* @__PURE__ */ jsx47(
|
|
7467
|
+
DndContext,
|
|
7468
|
+
{
|
|
7469
|
+
collisionDetection: collisionDetection ?? config.collisionDetection,
|
|
7470
|
+
modifiers: modifiers ?? config.modifiers,
|
|
7471
|
+
sensors,
|
|
7472
|
+
...sortableProps,
|
|
7473
|
+
id,
|
|
7474
|
+
onDragStart,
|
|
7475
|
+
onDragEnd,
|
|
7476
|
+
onDragCancel,
|
|
7477
|
+
accessibility: {
|
|
7478
|
+
announcements,
|
|
7479
|
+
screenReaderInstructions,
|
|
7480
|
+
...accessibility
|
|
7481
|
+
}
|
|
7482
|
+
}
|
|
7483
|
+
)
|
|
7484
|
+
}
|
|
7485
|
+
);
|
|
7486
|
+
}
|
|
7487
|
+
var SortableContentContext = React14.createContext(false);
|
|
7488
|
+
function SortableContent(props) {
|
|
7489
|
+
const {
|
|
7490
|
+
strategy: strategyProp,
|
|
7491
|
+
withoutSlot,
|
|
7492
|
+
children,
|
|
7493
|
+
className,
|
|
7494
|
+
render,
|
|
7495
|
+
ref,
|
|
7496
|
+
...contentProps
|
|
7497
|
+
} = props;
|
|
7498
|
+
const context = useSortableContext(CONTENT_NAME);
|
|
7499
|
+
const element = useRender6({
|
|
7500
|
+
defaultTagName: "div",
|
|
7501
|
+
props: mergeProps5(
|
|
7502
|
+
{
|
|
7503
|
+
ref,
|
|
7504
|
+
className,
|
|
7505
|
+
children
|
|
7506
|
+
},
|
|
7507
|
+
contentProps
|
|
7508
|
+
),
|
|
7509
|
+
render,
|
|
7510
|
+
state: {
|
|
7511
|
+
slot: "sortable-content"
|
|
7512
|
+
},
|
|
7513
|
+
enabled: !withoutSlot
|
|
7514
|
+
});
|
|
7515
|
+
return /* @__PURE__ */ jsx47(SortableContentContext.Provider, { value: true, children: /* @__PURE__ */ jsx47(
|
|
7516
|
+
SortableContext,
|
|
7517
|
+
{
|
|
7518
|
+
items: context.items,
|
|
7519
|
+
strategy: strategyProp ?? context.strategy,
|
|
7520
|
+
children: withoutSlot ? children : element
|
|
7521
|
+
}
|
|
7522
|
+
) });
|
|
7523
|
+
}
|
|
7524
|
+
var SortableItemContext = React14.createContext(null);
|
|
7525
|
+
function useSortableItemContext(consumerName) {
|
|
7526
|
+
const context = React14.useContext(SortableItemContext);
|
|
7527
|
+
if (!context) {
|
|
7528
|
+
throw new Error(`\`${consumerName}\` must be used within \`${ITEM_NAME}\``);
|
|
7529
|
+
}
|
|
7530
|
+
return context;
|
|
7531
|
+
}
|
|
7532
|
+
function SortableItem(props) {
|
|
7533
|
+
const {
|
|
7534
|
+
value,
|
|
7535
|
+
style,
|
|
7536
|
+
asHandle,
|
|
7537
|
+
disabled,
|
|
7538
|
+
className,
|
|
7539
|
+
render,
|
|
7540
|
+
ref,
|
|
7541
|
+
...itemProps
|
|
7542
|
+
} = props;
|
|
7543
|
+
const inSortableContent = React14.useContext(SortableContentContext);
|
|
7544
|
+
const inSortableOverlay = React14.useContext(SortableOverlayContext);
|
|
7545
|
+
if (!inSortableContent && !inSortableOverlay) {
|
|
7546
|
+
throw new Error(
|
|
7547
|
+
`\`${ITEM_NAME}\` must be used within \`${CONTENT_NAME}\` or \`${OVERLAY_NAME}\``
|
|
7548
|
+
);
|
|
7549
|
+
}
|
|
7550
|
+
if (value === "") {
|
|
7551
|
+
throw new Error(`\`${ITEM_NAME}\` value cannot be an empty string`);
|
|
7552
|
+
}
|
|
7553
|
+
const context = useSortableContext(ITEM_NAME);
|
|
7554
|
+
const id = React14.useId();
|
|
7555
|
+
const {
|
|
7556
|
+
attributes,
|
|
7557
|
+
listeners,
|
|
7558
|
+
setNodeRef,
|
|
7559
|
+
setActivatorNodeRef,
|
|
7560
|
+
transform,
|
|
7561
|
+
transition,
|
|
7562
|
+
isDragging
|
|
7563
|
+
} = useSortable({ id: value, disabled });
|
|
7564
|
+
const onNodeRefChange = React14.useCallback(
|
|
7565
|
+
(node) => {
|
|
7566
|
+
if (disabled) return;
|
|
7567
|
+
setNodeRef(node);
|
|
7568
|
+
if (asHandle) setActivatorNodeRef(node);
|
|
7569
|
+
},
|
|
7570
|
+
[disabled, asHandle, setNodeRef, setActivatorNodeRef]
|
|
7571
|
+
);
|
|
7572
|
+
const composedRef = useComposedRefs(ref, onNodeRefChange);
|
|
7573
|
+
const composedStyle = React14.useMemo(() => {
|
|
7574
|
+
return {
|
|
7575
|
+
transform: CSS.Translate.toString(transform),
|
|
7576
|
+
transition,
|
|
7577
|
+
...style
|
|
7578
|
+
};
|
|
7579
|
+
}, [transform, transition, style]);
|
|
7580
|
+
const itemContext = React14.useMemo(
|
|
7581
|
+
() => ({
|
|
7582
|
+
id,
|
|
7583
|
+
attributes,
|
|
7584
|
+
listeners,
|
|
7585
|
+
setActivatorNodeRef,
|
|
7586
|
+
isDragging,
|
|
7587
|
+
disabled
|
|
7588
|
+
}),
|
|
7589
|
+
[id, attributes, listeners, setActivatorNodeRef, isDragging, disabled]
|
|
7590
|
+
);
|
|
7591
|
+
const handleProps = asHandle && !disabled ? { ...attributes, ...listeners } : void 0;
|
|
7592
|
+
const element = useRender6({
|
|
7593
|
+
defaultTagName: "div",
|
|
7594
|
+
props: mergeProps5(
|
|
7595
|
+
{
|
|
7596
|
+
id,
|
|
7597
|
+
ref: composedRef,
|
|
7598
|
+
style: composedStyle,
|
|
7599
|
+
className: cn(
|
|
7600
|
+
"focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden",
|
|
7601
|
+
{
|
|
7602
|
+
"touch-none select-none": asHandle,
|
|
7603
|
+
"cursor-default": context.flatCursor,
|
|
7604
|
+
"data-dragging:cursor-grabbing": !context.flatCursor,
|
|
7605
|
+
"cursor-grab": !isDragging && asHandle && !context.flatCursor,
|
|
7606
|
+
"opacity-50": isDragging,
|
|
7607
|
+
"pointer-events-none opacity-50": disabled
|
|
7608
|
+
},
|
|
7609
|
+
className
|
|
7610
|
+
)
|
|
7611
|
+
},
|
|
7612
|
+
itemProps,
|
|
7613
|
+
handleProps
|
|
7614
|
+
),
|
|
7615
|
+
render,
|
|
7616
|
+
state: {
|
|
7617
|
+
slot: "sortable-item",
|
|
7618
|
+
...disabled && { disabled: "" },
|
|
7619
|
+
...isDragging && { dragging: "" }
|
|
7620
|
+
}
|
|
7621
|
+
});
|
|
7622
|
+
return /* @__PURE__ */ jsx47(SortableItemContext.Provider, { value: itemContext, children: element });
|
|
7623
|
+
}
|
|
7624
|
+
function SortableItemHandle(props) {
|
|
7625
|
+
const { disabled, className, render, ref, ...itemHandleProps } = props;
|
|
7626
|
+
const context = useSortableContext(ITEM_HANDLE_NAME);
|
|
7627
|
+
const itemContext = useSortableItemContext(ITEM_HANDLE_NAME);
|
|
7628
|
+
const isDisabled = disabled ?? itemContext.disabled;
|
|
7629
|
+
const { setActivatorNodeRef } = itemContext;
|
|
7630
|
+
const onActivatorNodeRef = React14.useCallback(
|
|
7631
|
+
(node) => {
|
|
7632
|
+
if (isDisabled) return;
|
|
7633
|
+
setActivatorNodeRef(node);
|
|
7634
|
+
},
|
|
7635
|
+
[isDisabled, setActivatorNodeRef]
|
|
7636
|
+
);
|
|
7637
|
+
const composedRef = useComposedRefs(ref, onActivatorNodeRef);
|
|
7638
|
+
const handleProps = isDisabled ? void 0 : { ...itemContext.attributes, ...itemContext.listeners };
|
|
7639
|
+
return useRender6({
|
|
7640
|
+
defaultTagName: "button",
|
|
7641
|
+
props: mergeProps5(
|
|
7642
|
+
{
|
|
7643
|
+
type: "button",
|
|
7644
|
+
"aria-controls": itemContext.id,
|
|
7645
|
+
ref: composedRef,
|
|
7646
|
+
disabled: isDisabled,
|
|
7647
|
+
className: cn(
|
|
7648
|
+
"select-none disabled:pointer-events-none disabled:opacity-50",
|
|
7649
|
+
context.flatCursor ? "cursor-default" : "cursor-grab data-dragging:cursor-grabbing",
|
|
7650
|
+
className
|
|
7651
|
+
)
|
|
7652
|
+
},
|
|
7653
|
+
itemHandleProps,
|
|
7654
|
+
handleProps
|
|
7655
|
+
),
|
|
7656
|
+
render,
|
|
7657
|
+
state: {
|
|
7658
|
+
slot: "sortable-item-handle",
|
|
7659
|
+
...isDisabled && { disabled: "" },
|
|
7660
|
+
...itemContext.isDragging && { dragging: "" }
|
|
7661
|
+
}
|
|
7662
|
+
});
|
|
7663
|
+
}
|
|
7664
|
+
var SortableOverlayContext = React14.createContext(false);
|
|
7665
|
+
var dropAnimation = {
|
|
7666
|
+
sideEffects: defaultDropAnimationSideEffects({
|
|
7667
|
+
styles: {
|
|
7668
|
+
active: {
|
|
7669
|
+
opacity: "0.4"
|
|
7670
|
+
}
|
|
7671
|
+
}
|
|
7672
|
+
})
|
|
7673
|
+
};
|
|
7674
|
+
function SortableOverlay(props) {
|
|
7675
|
+
const { container: containerProp, children, ...overlayProps } = props;
|
|
7676
|
+
const context = useSortableContext(OVERLAY_NAME);
|
|
7677
|
+
const [mounted, setMounted] = React14.useState(false);
|
|
7678
|
+
useIsomorphicLayoutEffect(() => setMounted(true), []);
|
|
7679
|
+
const container = containerProp ?? (mounted ? globalThis.document?.body : null);
|
|
7680
|
+
if (!container) return null;
|
|
7681
|
+
return ReactDOM.createPortal(
|
|
7682
|
+
/* @__PURE__ */ jsx47(
|
|
7683
|
+
DragOverlay,
|
|
7684
|
+
{
|
|
7685
|
+
dropAnimation,
|
|
7686
|
+
modifiers: context.modifiers,
|
|
7687
|
+
className: cn(!context.flatCursor && "cursor-grabbing"),
|
|
7688
|
+
...overlayProps,
|
|
7689
|
+
children: /* @__PURE__ */ jsx47(SortableOverlayContext.Provider, { value: true, children: context.activeId ? typeof children === "function" ? children({ value: context.activeId }) : children : null })
|
|
7690
|
+
}
|
|
7691
|
+
),
|
|
7692
|
+
container
|
|
7693
|
+
);
|
|
7694
|
+
}
|
|
7695
|
+
|
|
7035
7696
|
// src/ui/switch.tsx
|
|
7036
7697
|
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
7037
|
-
import { jsx as
|
|
7698
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
7038
7699
|
function Switch({
|
|
7039
7700
|
className,
|
|
7040
7701
|
size = "default",
|
|
7041
7702
|
...props
|
|
7042
7703
|
}) {
|
|
7043
|
-
return /* @__PURE__ */
|
|
7704
|
+
return /* @__PURE__ */ jsx48(
|
|
7044
7705
|
SwitchPrimitive.Root,
|
|
7045
7706
|
{
|
|
7046
7707
|
"data-slot": "switch",
|
|
@@ -7050,7 +7711,7 @@ function Switch({
|
|
|
7050
7711
|
className
|
|
7051
7712
|
),
|
|
7052
7713
|
...props,
|
|
7053
|
-
children: /* @__PURE__ */
|
|
7714
|
+
children: /* @__PURE__ */ jsx48(
|
|
7054
7715
|
SwitchPrimitive.Thumb,
|
|
7055
7716
|
{
|
|
7056
7717
|
"data-slot": "switch-thumb",
|
|
@@ -7078,6 +7739,7 @@ export {
|
|
|
7078
7739
|
AlertDialogTitle,
|
|
7079
7740
|
AlertDialogTrigger,
|
|
7080
7741
|
Apple,
|
|
7742
|
+
Ariakit,
|
|
7081
7743
|
Autocomplete,
|
|
7082
7744
|
AutocompleteClear,
|
|
7083
7745
|
AutocompleteCollection,
|
|
@@ -7101,7 +7763,7 @@ export {
|
|
|
7101
7763
|
AvatarGroupCount,
|
|
7102
7764
|
AvatarImage,
|
|
7103
7765
|
Badge,
|
|
7104
|
-
BlobSpeech,
|
|
7766
|
+
BlobSpeech2 as BlobSpeech,
|
|
7105
7767
|
BlogCardAnimation,
|
|
7106
7768
|
Bottom,
|
|
7107
7769
|
Bubble,
|
|
@@ -7130,6 +7792,7 @@ export {
|
|
|
7130
7792
|
ChartStyle,
|
|
7131
7793
|
ChartTooltip,
|
|
7132
7794
|
ChartTooltipContent,
|
|
7795
|
+
Checkbox,
|
|
7133
7796
|
Combobox,
|
|
7134
7797
|
ComboboxChip,
|
|
7135
7798
|
ComboboxChips,
|
|
@@ -7239,8 +7902,14 @@ export {
|
|
|
7239
7902
|
ItemMedia,
|
|
7240
7903
|
ItemSeparator,
|
|
7241
7904
|
ItemTitle,
|
|
7905
|
+
JellyAction,
|
|
7242
7906
|
JellyBlob,
|
|
7243
7907
|
JellyBlobMascot2 as JellyBlobMascot,
|
|
7908
|
+
JellyBlobMascotDemo,
|
|
7909
|
+
JellyEmpty,
|
|
7910
|
+
JellyGroup,
|
|
7911
|
+
JellyLink,
|
|
7912
|
+
JellyMascot,
|
|
7244
7913
|
JellyMini,
|
|
7245
7914
|
Kbd,
|
|
7246
7915
|
KbdGroup,
|
|
@@ -7292,6 +7961,11 @@ export {
|
|
|
7292
7961
|
SkeletonAvatar,
|
|
7293
7962
|
SkeletonButton,
|
|
7294
7963
|
SkeletonText,
|
|
7964
|
+
Sortable,
|
|
7965
|
+
SortableContent,
|
|
7966
|
+
SortableItem,
|
|
7967
|
+
SortableItemHandle,
|
|
7968
|
+
SortableOverlay,
|
|
7295
7969
|
Switch,
|
|
7296
7970
|
Textarea,
|
|
7297
7971
|
Toaster,
|
|
@@ -7304,7 +7978,6 @@ export {
|
|
|
7304
7978
|
badgeVariants,
|
|
7305
7979
|
buttonGroupVariants,
|
|
7306
7980
|
buttonVariants,
|
|
7307
|
-
cn2 as cn,
|
|
7308
7981
|
createFilter,
|
|
7309
7982
|
createFilterGroup,
|
|
7310
7983
|
fromLeftChildren,
|
|
@@ -7329,6 +8002,7 @@ export {
|
|
|
7329
8002
|
useAutocompleteFilter,
|
|
7330
8003
|
useCarousel,
|
|
7331
8004
|
useComboboxAnchor,
|
|
8005
|
+
useJellyMood,
|
|
7332
8006
|
useMessageScroller,
|
|
7333
8007
|
useMessageScrollerScrollable,
|
|
7334
8008
|
useMessageScrollerVisibility
|