@gomeniucivan/ui 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +751 -569
- package/dist/index.js +690 -511
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React59 from 'react';
|
|
2
|
+
import React59__default, { createContext, useContext, useLayoutEffect, useState, useCallback, useEffect, useMemo, useSyncExternalStore, useRef } from 'react';
|
|
3
3
|
import { CheckIcon, Loader2, X, CircleIcon, ChevronDownIcon, ChevronRight, MoreHorizontal, ChevronLeftIcon, ChevronRightIcon, ArrowLeft, ArrowRight, XIcon, SearchIcon, ChevronsLeft, ChevronLeft, ChevronsRight, Calendar as Calendar$1, MinusIcon, MoreHorizontalIcon, GripVerticalIcon, ChevronUpIcon, PanelLeftIcon, Clock, Settings2, Search, RotateCcw, ChevronsUpDown, ArrowUp, ArrowDown, GripVertical } from 'lucide-react';
|
|
4
4
|
import { jsxs as jsxs$1, jsx as jsx$1, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -12,7 +12,6 @@ import useEmblaCarousel from 'embla-carousel-react';
|
|
|
12
12
|
import * as RechartsPrimitive from 'recharts';
|
|
13
13
|
import { Command as Command$1 } from 'cmdk';
|
|
14
14
|
import { addDays, addYears, addMonths, startOfDay, startOfWeek, startOfYear, startOfMonth, endOfYear, isSameDay, isSameYear, isSameMonth, isBefore, isAfter, format, getDaysInMonth, setMonth, setYear, setDate, parse as parse$1 } from 'date-fns';
|
|
15
|
-
import '@gomeniucivan/ui/style.css';
|
|
16
15
|
import { toast, Toaster as Toaster$1 } from 'sonner';
|
|
17
16
|
export { toast } from 'sonner';
|
|
18
17
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
@@ -354,6 +353,143 @@ function useStore(store, selector) {
|
|
|
354
353
|
|
|
355
354
|
// src/lib/constants.ts
|
|
356
355
|
var FIELD_HEIGHT_MOBILE_CLASS = "h-10 md:h-9";
|
|
356
|
+
|
|
357
|
+
// src/lib/virtual-keyboard.ts
|
|
358
|
+
var KEYBOARD_HEIGHT_THRESHOLD = 80;
|
|
359
|
+
var KEYBOARD_DETECTION_TIMEOUT = 600;
|
|
360
|
+
var isVirtualKeyboardLikelyDevice = false;
|
|
361
|
+
var hasAttemptedVirtualKeyboardDetection = false;
|
|
362
|
+
var pendingKeyboardDetection = null;
|
|
363
|
+
var isReducedMotionPreferred = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
364
|
+
var scrollElementIntoView = (element) => {
|
|
365
|
+
if (!element || typeof element.scrollIntoView !== "function") {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const prefersReducedMotion = isReducedMotionPreferred();
|
|
369
|
+
const scroll = () => element.scrollIntoView({
|
|
370
|
+
behavior: prefersReducedMotion ? "auto" : "smooth",
|
|
371
|
+
block: "center",
|
|
372
|
+
inline: "nearest"
|
|
373
|
+
});
|
|
374
|
+
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
375
|
+
window.requestAnimationFrame(scroll);
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
scroll();
|
|
379
|
+
};
|
|
380
|
+
var getKeyboardOverlap = (viewport) => {
|
|
381
|
+
const windowHeight = typeof window !== "undefined" ? window.innerHeight : 0;
|
|
382
|
+
const overlap = windowHeight - viewport.height - viewport.offsetTop;
|
|
383
|
+
return Math.max(0, overlap);
|
|
384
|
+
};
|
|
385
|
+
var detectVirtualKeyboardDevice = () => {
|
|
386
|
+
if (isVirtualKeyboardLikelyDevice) {
|
|
387
|
+
return Promise.resolve(true);
|
|
388
|
+
}
|
|
389
|
+
if (hasAttemptedVirtualKeyboardDetection) {
|
|
390
|
+
return Promise.resolve(false);
|
|
391
|
+
}
|
|
392
|
+
if (typeof window === "undefined") {
|
|
393
|
+
hasAttemptedVirtualKeyboardDetection = true;
|
|
394
|
+
return Promise.resolve(false);
|
|
395
|
+
}
|
|
396
|
+
const viewport = window.visualViewport;
|
|
397
|
+
if (!viewport) {
|
|
398
|
+
hasAttemptedVirtualKeyboardDetection = true;
|
|
399
|
+
return Promise.resolve(false);
|
|
400
|
+
}
|
|
401
|
+
if (pendingKeyboardDetection) {
|
|
402
|
+
return pendingKeyboardDetection;
|
|
403
|
+
}
|
|
404
|
+
pendingKeyboardDetection = new Promise((resolve) => {
|
|
405
|
+
let resolved = false;
|
|
406
|
+
let timeoutId;
|
|
407
|
+
const finalize = (value) => {
|
|
408
|
+
if (resolved) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
resolved = true;
|
|
412
|
+
viewport.removeEventListener("resize", handleViewportChange);
|
|
413
|
+
viewport.removeEventListener("scroll", handleViewportChange);
|
|
414
|
+
if (typeof timeoutId === "number") {
|
|
415
|
+
window.clearTimeout(timeoutId);
|
|
416
|
+
}
|
|
417
|
+
if (value) {
|
|
418
|
+
isVirtualKeyboardLikelyDevice = true;
|
|
419
|
+
} else {
|
|
420
|
+
hasAttemptedVirtualKeyboardDetection = true;
|
|
421
|
+
}
|
|
422
|
+
resolve(value);
|
|
423
|
+
};
|
|
424
|
+
const handleViewportChange = () => {
|
|
425
|
+
const overlap = getKeyboardOverlap(viewport);
|
|
426
|
+
if (overlap > KEYBOARD_HEIGHT_THRESHOLD) {
|
|
427
|
+
finalize(true);
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
timeoutId = window.setTimeout(() => finalize(false), KEYBOARD_DETECTION_TIMEOUT);
|
|
431
|
+
handleViewportChange();
|
|
432
|
+
if (!resolved) {
|
|
433
|
+
viewport.addEventListener("resize", handleViewportChange, { passive: true });
|
|
434
|
+
viewport.addEventListener("scroll", handleViewportChange, { passive: true });
|
|
435
|
+
}
|
|
436
|
+
}).finally(() => {
|
|
437
|
+
pendingKeyboardDetection = null;
|
|
438
|
+
});
|
|
439
|
+
return pendingKeyboardDetection;
|
|
440
|
+
};
|
|
441
|
+
var isElementFullyVisibleWithinViewport = (element) => {
|
|
442
|
+
if (typeof window === "undefined") {
|
|
443
|
+
return true;
|
|
444
|
+
}
|
|
445
|
+
const rect = element.getBoundingClientRect();
|
|
446
|
+
const viewport = window.visualViewport;
|
|
447
|
+
if (!viewport) {
|
|
448
|
+
const viewportHeight = window.innerHeight || 0;
|
|
449
|
+
return rect.top >= 0 && rect.bottom <= viewportHeight;
|
|
450
|
+
}
|
|
451
|
+
const viewportTop = viewport.offsetTop;
|
|
452
|
+
const viewportBottom = viewportTop + viewport.height;
|
|
453
|
+
return rect.top >= viewportTop && rect.bottom <= viewportBottom;
|
|
454
|
+
};
|
|
455
|
+
var maybeScrollElementIntoView = (element) => {
|
|
456
|
+
if (!element) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
detectVirtualKeyboardDevice().then((keyboardDevice) => {
|
|
460
|
+
if (!keyboardDevice) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
if (typeof document !== "undefined" && document.activeElement !== element) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
if (!element.isConnected) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
if (isElementFullyVisibleWithinViewport(element)) {
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
const triggerScroll = () => scrollElementIntoView(element);
|
|
473
|
+
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
474
|
+
window.requestAnimationFrame(triggerScroll);
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
triggerScroll();
|
|
478
|
+
});
|
|
479
|
+
};
|
|
480
|
+
var __virtualKeyboardTesting = {
|
|
481
|
+
get isVirtualKeyboardLikelyDevice() {
|
|
482
|
+
return isVirtualKeyboardLikelyDevice;
|
|
483
|
+
},
|
|
484
|
+
get hasAttemptedVirtualKeyboardDetection() {
|
|
485
|
+
return hasAttemptedVirtualKeyboardDetection;
|
|
486
|
+
},
|
|
487
|
+
reset() {
|
|
488
|
+
isVirtualKeyboardLikelyDevice = false;
|
|
489
|
+
hasAttemptedVirtualKeyboardDetection = false;
|
|
490
|
+
pendingKeyboardDetection = null;
|
|
491
|
+
}
|
|
492
|
+
};
|
|
357
493
|
function useDataTableInstance({
|
|
358
494
|
data,
|
|
359
495
|
columns,
|
|
@@ -362,11 +498,11 @@ function useDataTableInstance({
|
|
|
362
498
|
defaultPageSize,
|
|
363
499
|
getRowId
|
|
364
500
|
}) {
|
|
365
|
-
const [rowSelection, setRowSelection] =
|
|
366
|
-
const [columnVisibility, setColumnVisibility] =
|
|
367
|
-
const [columnFilters, setColumnFilters] =
|
|
368
|
-
const [sorting, setSorting] =
|
|
369
|
-
const [pagination, setPagination] =
|
|
501
|
+
const [rowSelection, setRowSelection] = React59.useState({});
|
|
502
|
+
const [columnVisibility, setColumnVisibility] = React59.useState({});
|
|
503
|
+
const [columnFilters, setColumnFilters] = React59.useState([]);
|
|
504
|
+
const [sorting, setSorting] = React59.useState([]);
|
|
505
|
+
const [pagination, setPagination] = React59.useState({
|
|
370
506
|
pageIndex: defaultPageIndex != null ? defaultPageIndex : 0,
|
|
371
507
|
pageSize: defaultPageSize != null ? defaultPageSize : 10
|
|
372
508
|
});
|
|
@@ -533,7 +669,7 @@ var buttonVariants = cva(
|
|
|
533
669
|
}
|
|
534
670
|
}
|
|
535
671
|
);
|
|
536
|
-
var Button =
|
|
672
|
+
var Button = React59.forwardRef(
|
|
537
673
|
({
|
|
538
674
|
className,
|
|
539
675
|
variant,
|
|
@@ -1034,8 +1170,8 @@ function CalendarDayButton({
|
|
|
1034
1170
|
...props
|
|
1035
1171
|
}) {
|
|
1036
1172
|
const defaultClassNames = getDefaultClassNames();
|
|
1037
|
-
const ref =
|
|
1038
|
-
|
|
1173
|
+
const ref = React59.useRef(null);
|
|
1174
|
+
React59.useEffect(() => {
|
|
1039
1175
|
var _a2;
|
|
1040
1176
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
1041
1177
|
}, [modifiers.focused]);
|
|
@@ -1140,9 +1276,9 @@ function CardFooter({ className, ...props }) {
|
|
|
1140
1276
|
}
|
|
1141
1277
|
);
|
|
1142
1278
|
}
|
|
1143
|
-
var CarouselContext =
|
|
1279
|
+
var CarouselContext = React59.createContext(null);
|
|
1144
1280
|
function useCarousel() {
|
|
1145
|
-
const context =
|
|
1281
|
+
const context = React59.useContext(CarouselContext);
|
|
1146
1282
|
if (!context) {
|
|
1147
1283
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
1148
1284
|
}
|
|
@@ -1164,20 +1300,20 @@ function Carousel({
|
|
|
1164
1300
|
},
|
|
1165
1301
|
plugins
|
|
1166
1302
|
);
|
|
1167
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1168
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1169
|
-
const onSelect =
|
|
1303
|
+
const [canScrollPrev, setCanScrollPrev] = React59.useState(false);
|
|
1304
|
+
const [canScrollNext, setCanScrollNext] = React59.useState(false);
|
|
1305
|
+
const onSelect = React59.useCallback((api2) => {
|
|
1170
1306
|
if (!api2) return;
|
|
1171
1307
|
setCanScrollPrev(api2.canScrollPrev());
|
|
1172
1308
|
setCanScrollNext(api2.canScrollNext());
|
|
1173
1309
|
}, []);
|
|
1174
|
-
const scrollPrev =
|
|
1310
|
+
const scrollPrev = React59.useCallback(() => {
|
|
1175
1311
|
api == null ? void 0 : api.scrollPrev();
|
|
1176
1312
|
}, [api]);
|
|
1177
|
-
const scrollNext =
|
|
1313
|
+
const scrollNext = React59.useCallback(() => {
|
|
1178
1314
|
api == null ? void 0 : api.scrollNext();
|
|
1179
1315
|
}, [api]);
|
|
1180
|
-
const handleKeyDown =
|
|
1316
|
+
const handleKeyDown = React59.useCallback(
|
|
1181
1317
|
(event) => {
|
|
1182
1318
|
if (event.key === "ArrowLeft") {
|
|
1183
1319
|
event.preventDefault();
|
|
@@ -1189,11 +1325,11 @@ function Carousel({
|
|
|
1189
1325
|
},
|
|
1190
1326
|
[scrollPrev, scrollNext]
|
|
1191
1327
|
);
|
|
1192
|
-
|
|
1328
|
+
React59.useEffect(() => {
|
|
1193
1329
|
if (!api || !setApi) return;
|
|
1194
1330
|
setApi(api);
|
|
1195
1331
|
}, [api, setApi]);
|
|
1196
|
-
|
|
1332
|
+
React59.useEffect(() => {
|
|
1197
1333
|
if (!api) return;
|
|
1198
1334
|
onSelect(api);
|
|
1199
1335
|
api.on("reInit", onSelect);
|
|
@@ -1326,9 +1462,9 @@ function CarouselNext({
|
|
|
1326
1462
|
);
|
|
1327
1463
|
}
|
|
1328
1464
|
var THEMES = { light: "", dark: ".dark" };
|
|
1329
|
-
var ChartContext =
|
|
1465
|
+
var ChartContext = React59.createContext(null);
|
|
1330
1466
|
function useChart() {
|
|
1331
|
-
const context =
|
|
1467
|
+
const context = React59.useContext(ChartContext);
|
|
1332
1468
|
if (!context) {
|
|
1333
1469
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
1334
1470
|
}
|
|
@@ -1341,7 +1477,7 @@ function ChartContainer({
|
|
|
1341
1477
|
config,
|
|
1342
1478
|
...props
|
|
1343
1479
|
}) {
|
|
1344
|
-
const uniqueId =
|
|
1480
|
+
const uniqueId = React59.useId();
|
|
1345
1481
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
1346
1482
|
return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
|
|
1347
1483
|
"div",
|
|
@@ -1403,7 +1539,7 @@ function ChartTooltipContent({
|
|
|
1403
1539
|
labelKey
|
|
1404
1540
|
}) {
|
|
1405
1541
|
const { config } = useChart();
|
|
1406
|
-
const tooltipLabel =
|
|
1542
|
+
const tooltipLabel = React59.useMemo(() => {
|
|
1407
1543
|
var _a2;
|
|
1408
1544
|
if (hideLabel || !(payload == null ? void 0 : payload.length)) {
|
|
1409
1545
|
return null;
|
|
@@ -1557,7 +1693,7 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
1557
1693
|
}
|
|
1558
1694
|
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
1559
1695
|
}
|
|
1560
|
-
var Checkbox =
|
|
1696
|
+
var Checkbox = React59.forwardRef(function Checkbox2({ className, ...props }, ref) {
|
|
1561
1697
|
return /* @__PURE__ */ jsx(
|
|
1562
1698
|
Checkbox$1.Root,
|
|
1563
1699
|
{
|
|
@@ -2431,8 +2567,8 @@ function getIsMobile() {
|
|
|
2431
2567
|
return widthMatch || uaMatch || userAgentDataMobile;
|
|
2432
2568
|
}
|
|
2433
2569
|
function useIsMobile() {
|
|
2434
|
-
const [isMobile, setIsMobile] =
|
|
2435
|
-
|
|
2570
|
+
const [isMobile, setIsMobile] = React59.useState(() => getIsMobile());
|
|
2571
|
+
React59.useEffect(() => {
|
|
2436
2572
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
2437
2573
|
const onChange = () => {
|
|
2438
2574
|
setIsMobile(getIsMobile());
|
|
@@ -3278,8 +3414,8 @@ var initializeMonitoring = (options) => {
|
|
|
3278
3414
|
};
|
|
3279
3415
|
var getMonitor = () => getMonitoringInstance().api;
|
|
3280
3416
|
var useMonitor = (options) => {
|
|
3281
|
-
const optionsRef =
|
|
3282
|
-
|
|
3417
|
+
const optionsRef = React59.useRef();
|
|
3418
|
+
React59.useEffect(() => {
|
|
3283
3419
|
if (!options) {
|
|
3284
3420
|
return;
|
|
3285
3421
|
}
|
|
@@ -3291,7 +3427,7 @@ var useMonitor = (options) => {
|
|
|
3291
3427
|
initializeMonitoring(options);
|
|
3292
3428
|
}
|
|
3293
3429
|
}, [options]);
|
|
3294
|
-
return
|
|
3430
|
+
return React59.useMemo(() => getMonitor(), []);
|
|
3295
3431
|
};
|
|
3296
3432
|
function showSonner(message, type = "info", options) {
|
|
3297
3433
|
const { title, description, duration = 4e3, action } = options || {};
|
|
@@ -3571,7 +3707,7 @@ var ThemeProvider = ({
|
|
|
3571
3707
|
const horizontallyVisible = rect.left >= 0 && rect.right <= viewWidth;
|
|
3572
3708
|
return verticallyVisible && horizontallyVisible;
|
|
3573
3709
|
};
|
|
3574
|
-
const
|
|
3710
|
+
const scrollElementIntoView2 = (element) => {
|
|
3575
3711
|
window.setTimeout(() => {
|
|
3576
3712
|
if (!isElementInViewport(element)) {
|
|
3577
3713
|
element.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" });
|
|
@@ -3596,7 +3732,7 @@ var ThemeProvider = ({
|
|
|
3596
3732
|
if (!element) {
|
|
3597
3733
|
return;
|
|
3598
3734
|
}
|
|
3599
|
-
|
|
3735
|
+
scrollElementIntoView2(element);
|
|
3600
3736
|
};
|
|
3601
3737
|
const handlePointerDown = (event) => {
|
|
3602
3738
|
if (event.pointerType && event.pointerType !== "touch" && event.pointerType !== "pen") {
|
|
@@ -3606,7 +3742,7 @@ var ThemeProvider = ({
|
|
|
3606
3742
|
if (!element) {
|
|
3607
3743
|
return;
|
|
3608
3744
|
}
|
|
3609
|
-
|
|
3745
|
+
scrollElementIntoView2(element);
|
|
3610
3746
|
};
|
|
3611
3747
|
document.addEventListener("focusin", handleFocus, true);
|
|
3612
3748
|
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
@@ -3686,26 +3822,9 @@ var useThemeExtras = () => {
|
|
|
3686
3822
|
const { extras } = useTheme();
|
|
3687
3823
|
return extras;
|
|
3688
3824
|
};
|
|
3689
|
-
var
|
|
3690
|
-
var scrollInputIntoView = (element) => {
|
|
3691
|
-
if (!element || typeof element.scrollIntoView !== "function") {
|
|
3692
|
-
return;
|
|
3693
|
-
}
|
|
3694
|
-
const prefersReducedMotion = isReducedMotionPreferred();
|
|
3695
|
-
const scroll = () => element.scrollIntoView({
|
|
3696
|
-
behavior: prefersReducedMotion ? "auto" : "smooth",
|
|
3697
|
-
block: "center",
|
|
3698
|
-
inline: "nearest"
|
|
3699
|
-
});
|
|
3700
|
-
if (typeof window !== "undefined" && typeof window.requestAnimationFrame === "function") {
|
|
3701
|
-
window.requestAnimationFrame(scroll);
|
|
3702
|
-
return;
|
|
3703
|
-
}
|
|
3704
|
-
scroll();
|
|
3705
|
-
};
|
|
3706
|
-
var Input = React58.forwardRef(
|
|
3825
|
+
var Input = React59.forwardRef(
|
|
3707
3826
|
({ className, type, onFocus, ...props }, forwardedRef) => {
|
|
3708
|
-
const setRefs =
|
|
3827
|
+
const setRefs = React59.useCallback(
|
|
3709
3828
|
(node) => {
|
|
3710
3829
|
if (typeof forwardedRef === "function") {
|
|
3711
3830
|
forwardedRef(node);
|
|
@@ -3715,13 +3834,13 @@ var Input = React58.forwardRef(
|
|
|
3715
3834
|
},
|
|
3716
3835
|
[forwardedRef]
|
|
3717
3836
|
);
|
|
3718
|
-
const handleFocus =
|
|
3837
|
+
const handleFocus = React59.useCallback(
|
|
3719
3838
|
(event) => {
|
|
3720
3839
|
onFocus == null ? void 0 : onFocus(event);
|
|
3721
3840
|
if (event.defaultPrevented) {
|
|
3722
3841
|
return;
|
|
3723
3842
|
}
|
|
3724
|
-
|
|
3843
|
+
maybeScrollElementIntoView(event.currentTarget);
|
|
3725
3844
|
},
|
|
3726
3845
|
[onFocus]
|
|
3727
3846
|
);
|
|
@@ -3786,7 +3905,7 @@ var toNumericValue = (value, decimals) => {
|
|
|
3786
3905
|
}
|
|
3787
3906
|
return parsed;
|
|
3788
3907
|
};
|
|
3789
|
-
var InputNumeric =
|
|
3908
|
+
var InputNumeric = React59.forwardRef(
|
|
3790
3909
|
({
|
|
3791
3910
|
value,
|
|
3792
3911
|
defaultValue,
|
|
@@ -3802,8 +3921,8 @@ var InputNumeric = React58.forwardRef(
|
|
|
3802
3921
|
pattern,
|
|
3803
3922
|
...rest
|
|
3804
3923
|
}, ref) => {
|
|
3805
|
-
const patternMatcher =
|
|
3806
|
-
const initialValue =
|
|
3924
|
+
const patternMatcher = React59.useMemo(() => createPattern(decimals), [decimals]);
|
|
3925
|
+
const initialValue = React59.useMemo(() => {
|
|
3807
3926
|
var _a2;
|
|
3808
3927
|
const source = (_a2 = value != null ? value : defaultValue) != null ? _a2 : null;
|
|
3809
3928
|
if (source === null) {
|
|
@@ -3811,16 +3930,16 @@ var InputNumeric = React58.forwardRef(
|
|
|
3811
3930
|
}
|
|
3812
3931
|
return toNumberString(source, decimals);
|
|
3813
3932
|
}, [value, defaultValue, decimals]);
|
|
3814
|
-
const [rawValue, setRawValue] =
|
|
3815
|
-
const [isFocused, setIsFocused] =
|
|
3816
|
-
|
|
3933
|
+
const [rawValue, setRawValue] = React59.useState(initialValue);
|
|
3934
|
+
const [isFocused, setIsFocused] = React59.useState(false);
|
|
3935
|
+
React59.useEffect(() => {
|
|
3817
3936
|
if (value === void 0) {
|
|
3818
3937
|
return;
|
|
3819
3938
|
}
|
|
3820
3939
|
const nextRawValue = value === null ? "" : toNumberString(value, decimals);
|
|
3821
3940
|
setRawValue((previous) => previous === nextRawValue ? previous : nextRawValue);
|
|
3822
3941
|
}, [value, decimals]);
|
|
3823
|
-
const clampValue =
|
|
3942
|
+
const clampValue = React59.useCallback(
|
|
3824
3943
|
(numericValue) => {
|
|
3825
3944
|
if (numericValue === null) {
|
|
3826
3945
|
return null;
|
|
@@ -3865,7 +3984,7 @@ var InputNumeric = React58.forwardRef(
|
|
|
3865
3984
|
}
|
|
3866
3985
|
onBlur == null ? void 0 : onBlur(event);
|
|
3867
3986
|
};
|
|
3868
|
-
const displayValue =
|
|
3987
|
+
const displayValue = React59.useMemo(() => {
|
|
3869
3988
|
if (isFocused) {
|
|
3870
3989
|
return rawValue;
|
|
3871
3990
|
}
|
|
@@ -3915,7 +4034,7 @@ var formatWithMask = (rawValue, mask, placeholderChar) => {
|
|
|
3915
4034
|
}
|
|
3916
4035
|
return result;
|
|
3917
4036
|
};
|
|
3918
|
-
var InputMask =
|
|
4037
|
+
var InputMask = React59.forwardRef(
|
|
3919
4038
|
({
|
|
3920
4039
|
mask,
|
|
3921
4040
|
placeholderChar = DEFAULT_PLACEHOLDER_CHAR,
|
|
@@ -3927,11 +4046,11 @@ var InputMask = React58.forwardRef(
|
|
|
3927
4046
|
}, ref) => {
|
|
3928
4047
|
var _a2;
|
|
3929
4048
|
const normalizedPlaceholder = (_a2 = placeholderChar[0]) != null ? _a2 : DEFAULT_PLACEHOLDER_CHAR;
|
|
3930
|
-
const placeholderCount =
|
|
4049
|
+
const placeholderCount = React59.useMemo(
|
|
3931
4050
|
() => countPlaceholders(mask, normalizedPlaceholder),
|
|
3932
4051
|
[mask, normalizedPlaceholder]
|
|
3933
4052
|
);
|
|
3934
|
-
const normalizeRawValue =
|
|
4053
|
+
const normalizeRawValue = React59.useCallback(
|
|
3935
4054
|
(source) => {
|
|
3936
4055
|
if (!source) {
|
|
3937
4056
|
return "";
|
|
@@ -3944,20 +4063,20 @@ var InputMask = React58.forwardRef(
|
|
|
3944
4063
|
},
|
|
3945
4064
|
[placeholderCount]
|
|
3946
4065
|
);
|
|
3947
|
-
const [rawValue, setRawValue] =
|
|
4066
|
+
const [rawValue, setRawValue] = React59.useState(
|
|
3948
4067
|
() => {
|
|
3949
4068
|
var _a3;
|
|
3950
4069
|
return normalizeRawValue((_a3 = value != null ? value : defaultValue) != null ? _a3 : "");
|
|
3951
4070
|
}
|
|
3952
4071
|
);
|
|
3953
|
-
|
|
4072
|
+
React59.useEffect(() => {
|
|
3954
4073
|
if (value === void 0) {
|
|
3955
4074
|
return;
|
|
3956
4075
|
}
|
|
3957
4076
|
const next = normalizeRawValue(value);
|
|
3958
4077
|
setRawValue((previous) => previous === next ? previous : next);
|
|
3959
4078
|
}, [value, normalizeRawValue]);
|
|
3960
|
-
|
|
4079
|
+
React59.useEffect(() => {
|
|
3961
4080
|
if (value !== void 0) {
|
|
3962
4081
|
return;
|
|
3963
4082
|
}
|
|
@@ -3970,7 +4089,7 @@ var InputMask = React58.forwardRef(
|
|
|
3970
4089
|
}
|
|
3971
4090
|
onChange == null ? void 0 : onChange(incoming);
|
|
3972
4091
|
};
|
|
3973
|
-
const formattedValue =
|
|
4092
|
+
const formattedValue = React59.useMemo(
|
|
3974
4093
|
() => formatWithMask(rawValue, mask, normalizedPlaceholder),
|
|
3975
4094
|
[mask, normalizedPlaceholder, rawValue]
|
|
3976
4095
|
);
|
|
@@ -4245,9 +4364,9 @@ var MobileWheelColumn = ({
|
|
|
4245
4364
|
onValueChange,
|
|
4246
4365
|
open
|
|
4247
4366
|
}) => {
|
|
4248
|
-
const listRef =
|
|
4249
|
-
const scrollTimeoutRef =
|
|
4250
|
-
const extendedOptions =
|
|
4367
|
+
const listRef = React59.useRef(null);
|
|
4368
|
+
const scrollTimeoutRef = React59.useRef(null);
|
|
4369
|
+
const extendedOptions = React59.useMemo(() => {
|
|
4251
4370
|
if (options.length === 0) {
|
|
4252
4371
|
return [];
|
|
4253
4372
|
}
|
|
@@ -4259,7 +4378,7 @@ var MobileWheelColumn = ({
|
|
|
4259
4378
|
}
|
|
4260
4379
|
return repeated;
|
|
4261
4380
|
}, [options]);
|
|
4262
|
-
const alignToValue =
|
|
4381
|
+
const alignToValue = React59.useCallback(
|
|
4263
4382
|
(value, behavior = "auto") => {
|
|
4264
4383
|
if (!listRef.current || options.length === 0 || extendedOptions.length === 0) {
|
|
4265
4384
|
return;
|
|
@@ -4273,13 +4392,13 @@ var MobileWheelColumn = ({
|
|
|
4273
4392
|
},
|
|
4274
4393
|
[extendedOptions.length, options]
|
|
4275
4394
|
);
|
|
4276
|
-
|
|
4395
|
+
React59.useLayoutEffect(() => {
|
|
4277
4396
|
if (!open) {
|
|
4278
4397
|
return;
|
|
4279
4398
|
}
|
|
4280
4399
|
alignToValue(selectedValue);
|
|
4281
4400
|
}, [alignToValue, open, options, selectedValue]);
|
|
4282
|
-
|
|
4401
|
+
React59.useEffect(
|
|
4283
4402
|
() => () => {
|
|
4284
4403
|
if (scrollTimeoutRef.current !== null) {
|
|
4285
4404
|
clearTimeout(scrollTimeoutRef.current);
|
|
@@ -4287,7 +4406,7 @@ var MobileWheelColumn = ({
|
|
|
4287
4406
|
},
|
|
4288
4407
|
[]
|
|
4289
4408
|
);
|
|
4290
|
-
const handleScroll2 =
|
|
4409
|
+
const handleScroll2 = React59.useCallback(
|
|
4291
4410
|
(event) => {
|
|
4292
4411
|
if (extendedOptions.length === 0 || options.length === 0) {
|
|
4293
4412
|
return;
|
|
@@ -4401,14 +4520,14 @@ var getDefaultLocale = (locale) => {
|
|
|
4401
4520
|
};
|
|
4402
4521
|
};
|
|
4403
4522
|
var useLatest = (value) => {
|
|
4404
|
-
const ref =
|
|
4405
|
-
|
|
4523
|
+
const ref = React59.useRef(value);
|
|
4524
|
+
React59.useEffect(() => {
|
|
4406
4525
|
ref.current = value;
|
|
4407
4526
|
}, [value]);
|
|
4408
4527
|
return ref;
|
|
4409
4528
|
};
|
|
4410
4529
|
var DEFAULT_PRIMARY_COLOR = "hsl(var(--primary))";
|
|
4411
|
-
var DatePicker =
|
|
4530
|
+
var DatePicker = React59.forwardRef((props, ref) => {
|
|
4412
4531
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
4413
4532
|
const {
|
|
4414
4533
|
value: valueProp,
|
|
@@ -4451,17 +4570,17 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4451
4570
|
const { isNative } = useTheme();
|
|
4452
4571
|
const isMobile = useIsMobile();
|
|
4453
4572
|
const shouldUseDrawer = isNative || isMobile;
|
|
4454
|
-
const [associatedLabel, setAssociatedLabel] =
|
|
4455
|
-
const locale =
|
|
4573
|
+
const [associatedLabel, setAssociatedLabel] = React59.useState(null);
|
|
4574
|
+
const locale = React59.useMemo(() => getDefaultLocale(localeProp), [localeProp]);
|
|
4456
4575
|
const onChangeRef = useLatest(onChange);
|
|
4457
4576
|
const onOpenChangeRef = useLatest(onOpenChange);
|
|
4458
4577
|
const formatRef = useLatest(format);
|
|
4459
4578
|
const isValueControlled = valueProp !== void 0;
|
|
4460
|
-
const [internalValue, setInternalValue] =
|
|
4579
|
+
const [internalValue, setInternalValue] = React59.useState(defaultValue);
|
|
4461
4580
|
const selectedValue = (_a2 = isValueControlled ? valueProp : internalValue) != null ? _a2 : null;
|
|
4462
|
-
const initialPanelMode =
|
|
4463
|
-
const [panelMode, setPanelMode] =
|
|
4464
|
-
const commitValue =
|
|
4581
|
+
const initialPanelMode = React59.useMemo(() => getPanelModeFromProps(mode, picker), [mode, picker]);
|
|
4582
|
+
const [panelMode, setPanelMode] = React59.useState(initialPanelMode);
|
|
4583
|
+
const commitValue = React59.useCallback(
|
|
4465
4584
|
(next) => {
|
|
4466
4585
|
var _a3;
|
|
4467
4586
|
if (!isValueControlled) {
|
|
@@ -4471,18 +4590,18 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4471
4590
|
},
|
|
4472
4591
|
[formatRef, isValueControlled, onChangeRef]
|
|
4473
4592
|
);
|
|
4474
|
-
const [draftValue, setDraftValue] =
|
|
4475
|
-
|
|
4593
|
+
const [draftValue, setDraftValue] = React59.useState(selectedValue);
|
|
4594
|
+
React59.useEffect(() => {
|
|
4476
4595
|
setDraftValue(selectedValue);
|
|
4477
4596
|
}, [selectedValue]);
|
|
4478
|
-
const [viewDate, setViewDate] =
|
|
4597
|
+
const [viewDate, setViewDate] = React59.useState(() => {
|
|
4479
4598
|
const base = selectedValue != null ? selectedValue : dayjs();
|
|
4480
4599
|
return clampToRange(base, minDate, maxDate);
|
|
4481
4600
|
});
|
|
4482
4601
|
const isOpenControlled = openProp !== void 0;
|
|
4483
|
-
const [internalOpen, setInternalOpen] =
|
|
4602
|
+
const [internalOpen, setInternalOpen] = React59.useState(Boolean(defaultOpen));
|
|
4484
4603
|
const open = isOpenControlled ? Boolean(openProp) : internalOpen;
|
|
4485
|
-
const setOpenState =
|
|
4604
|
+
const setOpenState = React59.useCallback(
|
|
4486
4605
|
(next) => {
|
|
4487
4606
|
var _a3;
|
|
4488
4607
|
if (!isOpenControlled) {
|
|
@@ -4493,25 +4612,25 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4493
4612
|
[isOpenControlled, onOpenChangeRef]
|
|
4494
4613
|
);
|
|
4495
4614
|
const activeValue = needConfirm ? draftValue : selectedValue;
|
|
4496
|
-
|
|
4615
|
+
React59.useEffect(() => {
|
|
4497
4616
|
if (open) {
|
|
4498
4617
|
setPanelMode(initialPanelMode);
|
|
4499
4618
|
setViewDate((prev) => clampToRange(activeValue != null ? activeValue : prev, minDate, maxDate));
|
|
4500
4619
|
}
|
|
4501
4620
|
}, [activeValue, initialPanelMode, maxDate, minDate, open]);
|
|
4502
|
-
const [inputValue, setInputValue] =
|
|
4503
|
-
const isTypingRef =
|
|
4504
|
-
|
|
4621
|
+
const [inputValue, setInputValue] = React59.useState(() => formatDateValue(activeValue, formatRef.current));
|
|
4622
|
+
const isTypingRef = React59.useRef(false);
|
|
4623
|
+
React59.useEffect(() => {
|
|
4505
4624
|
if (!isTypingRef.current) {
|
|
4506
4625
|
setInputValue(formatDateValue(activeValue, formatRef.current));
|
|
4507
4626
|
}
|
|
4508
4627
|
}, [activeValue, formatRef]);
|
|
4509
|
-
const primaryColorStyle =
|
|
4628
|
+
const primaryColorStyle = React59.useMemo(
|
|
4510
4629
|
() => ({ "--date-primary-color": DEFAULT_PRIMARY_COLOR }),
|
|
4511
4630
|
[]
|
|
4512
4631
|
);
|
|
4513
|
-
const inputRef =
|
|
4514
|
-
const handleOpenChange =
|
|
4632
|
+
const inputRef = React59.useRef(null);
|
|
4633
|
+
const handleOpenChange = React59.useCallback(
|
|
4515
4634
|
(nextOpen) => {
|
|
4516
4635
|
if (disabled) {
|
|
4517
4636
|
return;
|
|
@@ -4524,11 +4643,11 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4524
4643
|
},
|
|
4525
4644
|
[activeValue, disabled, initialPanelMode, maxDate, minDate, setOpenState]
|
|
4526
4645
|
);
|
|
4527
|
-
const parseInputValue =
|
|
4646
|
+
const parseInputValue = React59.useCallback(
|
|
4528
4647
|
(text) => parseDateValue(text, formatRef.current),
|
|
4529
4648
|
[formatRef]
|
|
4530
4649
|
);
|
|
4531
|
-
const isDateDisabled =
|
|
4650
|
+
const isDateDisabled = React59.useCallback(
|
|
4532
4651
|
(date, currentMode) => {
|
|
4533
4652
|
if (!isWithinRange(date, minDate, maxDate, currentMode)) {
|
|
4534
4653
|
return true;
|
|
@@ -4540,11 +4659,11 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
4540
4659
|
},
|
|
4541
4660
|
[disabledDate, maxDate, minDate]
|
|
4542
4661
|
);
|
|
4543
|
-
const formatForDisplay =
|
|
4662
|
+
const formatForDisplay = React59.useCallback(
|
|
4544
4663
|
(value) => formatDateValue(value, formatRef.current),
|
|
4545
4664
|
[formatRef]
|
|
4546
4665
|
);
|
|
4547
|
-
const handleDateSelect =
|
|
4666
|
+
const handleDateSelect = React59.useCallback(
|
|
4548
4667
|
(date) => {
|
|
4549
4668
|
if (isDateDisabled(date, "date")) {
|
|
4550
4669
|
return;
|
|
@@ -5018,7 +5137,7 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5018
5137
|
] })
|
|
5019
5138
|
] });
|
|
5020
5139
|
const panelNode = panelRender ? panelRender(renderedPanel) : renderedPanel;
|
|
5021
|
-
|
|
5140
|
+
React59.useEffect(() => {
|
|
5022
5141
|
if (!autoFocus) {
|
|
5023
5142
|
return;
|
|
5024
5143
|
}
|
|
@@ -5032,7 +5151,7 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5032
5151
|
focusInput();
|
|
5033
5152
|
}
|
|
5034
5153
|
}, [autoFocus]);
|
|
5035
|
-
|
|
5154
|
+
React59.useImperativeHandle(ref, () => inputRef.current);
|
|
5036
5155
|
const shouldShowPointer = !disabled && (inputReadOnly || shouldUseDrawer);
|
|
5037
5156
|
const triggerNode = /* @__PURE__ */ jsxs(
|
|
5038
5157
|
"div",
|
|
@@ -5099,17 +5218,17 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5099
5218
|
]
|
|
5100
5219
|
}
|
|
5101
5220
|
);
|
|
5102
|
-
const mobileBaseValue =
|
|
5221
|
+
const mobileBaseValue = React59.useMemo(() => {
|
|
5103
5222
|
var _a3, _b2;
|
|
5104
5223
|
const base = (_b2 = needConfirm ? (_a3 = draftValue != null ? draftValue : selectedValue) != null ? _a3 : viewDate : activeValue != null ? activeValue : viewDate) != null ? _b2 : dayjs();
|
|
5105
5224
|
return base.clone();
|
|
5106
5225
|
}, [activeValue, draftValue, needConfirm, selectedValue, viewDate]);
|
|
5107
|
-
const monthOptions =
|
|
5226
|
+
const monthOptions = React59.useMemo(
|
|
5108
5227
|
() => locale.months.map((month, index2) => ({ label: month, value: index2 })),
|
|
5109
5228
|
[locale.months]
|
|
5110
5229
|
);
|
|
5111
5230
|
const daysInMonth = mobileBaseValue.daysInMonth();
|
|
5112
|
-
const dayOptions =
|
|
5231
|
+
const dayOptions = React59.useMemo(
|
|
5113
5232
|
() => Array.from({ length: daysInMonth }, (_, index2) => ({
|
|
5114
5233
|
label: String(index2 + 1).padStart(2, "0"),
|
|
5115
5234
|
value: index2 + 1
|
|
@@ -5121,14 +5240,14 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5121
5240
|
const maxYear = (_e = maxDate == null ? void 0 : maxDate.year()) != null ? _e : currentYear + 100;
|
|
5122
5241
|
const startYear = Math.min(minYear, maxYear);
|
|
5123
5242
|
const endYear = Math.max(minYear, maxYear);
|
|
5124
|
-
const yearOptions =
|
|
5243
|
+
const yearOptions = React59.useMemo(
|
|
5125
5244
|
() => Array.from({ length: endYear - startYear + 1 }, (_, index2) => {
|
|
5126
5245
|
const year = startYear + index2;
|
|
5127
5246
|
return { label: String(year), value: year };
|
|
5128
5247
|
}),
|
|
5129
5248
|
[endYear, startYear]
|
|
5130
5249
|
);
|
|
5131
|
-
const handlePartChange =
|
|
5250
|
+
const handlePartChange = React59.useCallback(
|
|
5132
5251
|
(part, value) => {
|
|
5133
5252
|
var _a3, _b2;
|
|
5134
5253
|
const base = (_b2 = needConfirm ? (_a3 = draftValue != null ? draftValue : selectedValue) != null ? _a3 : viewDate : selectedValue != null ? selectedValue : viewDate) != null ? _b2 : dayjs();
|
|
@@ -5162,13 +5281,13 @@ var DatePicker = React58.forwardRef((props, ref) => {
|
|
|
5162
5281
|
[commitValue, draftValue, formatForDisplay, isDateDisabled, maxDate, minDate, needConfirm, selectedValue, setViewDate, viewDate]
|
|
5163
5282
|
);
|
|
5164
5283
|
const mobileLabelFallback = (_g = (_f = typeof inputRest["aria-label"] === "string" ? inputRest["aria-label"] : void 0) != null ? _f : placeholder) != null ? _g : locale.placeholder;
|
|
5165
|
-
const handleDrawerOpenChange =
|
|
5284
|
+
const handleDrawerOpenChange = React59.useCallback(
|
|
5166
5285
|
(nextOpen) => {
|
|
5167
5286
|
handleOpenChange(nextOpen);
|
|
5168
5287
|
},
|
|
5169
5288
|
[handleOpenChange]
|
|
5170
5289
|
);
|
|
5171
|
-
|
|
5290
|
+
React59.useEffect(() => {
|
|
5172
5291
|
var _a3, _b2;
|
|
5173
5292
|
if (!shouldUseDrawer || !open || !id) {
|
|
5174
5293
|
return;
|
|
@@ -5677,7 +5796,7 @@ var gapClasses = {
|
|
|
5677
5796
|
middle: gapScale.md,
|
|
5678
5797
|
large: gapScale.lg
|
|
5679
5798
|
};
|
|
5680
|
-
var Flex =
|
|
5799
|
+
var Flex = React59.forwardRef(
|
|
5681
5800
|
({
|
|
5682
5801
|
direction,
|
|
5683
5802
|
vertical,
|
|
@@ -5782,7 +5901,7 @@ function InputOTPSlot({
|
|
|
5782
5901
|
...props
|
|
5783
5902
|
}) {
|
|
5784
5903
|
var _a2;
|
|
5785
|
-
const inputOTPContext =
|
|
5904
|
+
const inputOTPContext = React59.useContext(OTPInputContext);
|
|
5786
5905
|
const { char, hasFakeCaret, isActive } = (_a2 = inputOTPContext == null ? void 0 : inputOTPContext.slots[index2]) != null ? _a2 : {};
|
|
5787
5906
|
return /* @__PURE__ */ jsxs(
|
|
5788
5907
|
"div",
|
|
@@ -6138,7 +6257,7 @@ var mobileFooterVariants = Object.keys(
|
|
|
6138
6257
|
);
|
|
6139
6258
|
var noop = () => {
|
|
6140
6259
|
};
|
|
6141
|
-
var MobileFooter =
|
|
6260
|
+
var MobileFooter = React59.forwardRef(
|
|
6142
6261
|
({
|
|
6143
6262
|
items,
|
|
6144
6263
|
value,
|
|
@@ -6149,7 +6268,7 @@ var MobileFooter = React58.forwardRef(
|
|
|
6149
6268
|
forceLabels = false,
|
|
6150
6269
|
...props
|
|
6151
6270
|
}, ref) => {
|
|
6152
|
-
const [internalValue, setInternalValue] =
|
|
6271
|
+
const [internalValue, setInternalValue] = React59.useState(() => {
|
|
6153
6272
|
var _a2, _b;
|
|
6154
6273
|
if (value !== void 0) {
|
|
6155
6274
|
return value;
|
|
@@ -6161,7 +6280,7 @@ var MobileFooter = React58.forwardRef(
|
|
|
6161
6280
|
});
|
|
6162
6281
|
const isControlled = value !== void 0;
|
|
6163
6282
|
const selectedValue = isControlled ? value : internalValue;
|
|
6164
|
-
|
|
6283
|
+
React59.useEffect(() => {
|
|
6165
6284
|
var _a2;
|
|
6166
6285
|
if (!items.length) {
|
|
6167
6286
|
return;
|
|
@@ -6178,7 +6297,7 @@ var MobileFooter = React58.forwardRef(
|
|
|
6178
6297
|
onChange(fallback);
|
|
6179
6298
|
}
|
|
6180
6299
|
}, [items, selectedValue, isControlled, onChange]);
|
|
6181
|
-
const handleSelect =
|
|
6300
|
+
const handleSelect = React59.useCallback(
|
|
6182
6301
|
(nextValue) => {
|
|
6183
6302
|
if (nextValue === selectedValue) {
|
|
6184
6303
|
return;
|
|
@@ -6198,7 +6317,7 @@ var MobileFooter = React58.forwardRef(
|
|
|
6198
6317
|
0
|
|
6199
6318
|
);
|
|
6200
6319
|
const cellPercentage = 100 / items.length;
|
|
6201
|
-
const floatingIndicatorStyle =
|
|
6320
|
+
const floatingIndicatorStyle = React59.useMemo(() => {
|
|
6202
6321
|
const size4 = 72;
|
|
6203
6322
|
const offset4 = cellPercentage / 2;
|
|
6204
6323
|
return {
|
|
@@ -6207,18 +6326,18 @@ var MobileFooter = React58.forwardRef(
|
|
|
6207
6326
|
left: `calc(${cellPercentage}% * ${activeIndex} + ${offset4}% - ${size4 / 2}px)`
|
|
6208
6327
|
};
|
|
6209
6328
|
}, [activeIndex, cellPercentage]);
|
|
6210
|
-
const pillIndicatorStyle =
|
|
6329
|
+
const pillIndicatorStyle = React59.useMemo(() => ({
|
|
6211
6330
|
width: `calc((100% / ${items.length}) - 0.75rem)`,
|
|
6212
6331
|
left: `calc((100% / ${items.length}) * ${activeIndex} + 0.375rem)`
|
|
6213
6332
|
}), [activeIndex, items.length]);
|
|
6214
|
-
const minimalIndicatorStyle =
|
|
6333
|
+
const minimalIndicatorStyle = React59.useMemo(
|
|
6215
6334
|
() => ({
|
|
6216
6335
|
width: `calc((100% / ${items.length}) * 0.6)`,
|
|
6217
6336
|
left: `calc((100% / ${items.length}) * ${activeIndex} + (100% / ${items.length}) * 0.2)`
|
|
6218
6337
|
}),
|
|
6219
6338
|
[activeIndex, items.length]
|
|
6220
6339
|
);
|
|
6221
|
-
const curvedIndicatorStyle =
|
|
6340
|
+
const curvedIndicatorStyle = React59.useMemo(() => {
|
|
6222
6341
|
const size4 = 64;
|
|
6223
6342
|
const offset4 = cellPercentage / 2;
|
|
6224
6343
|
return {
|
|
@@ -6547,7 +6666,7 @@ var renderBadge = (badge, active = false) => {
|
|
|
6547
6666
|
}
|
|
6548
6667
|
);
|
|
6549
6668
|
};
|
|
6550
|
-
var MobileHeader =
|
|
6669
|
+
var MobileHeader = React59.forwardRef(
|
|
6551
6670
|
({
|
|
6552
6671
|
title,
|
|
6553
6672
|
subtitle,
|
|
@@ -6570,12 +6689,12 @@ var MobileHeader = React58.forwardRef(
|
|
|
6570
6689
|
children,
|
|
6571
6690
|
...props
|
|
6572
6691
|
}, ref) => {
|
|
6573
|
-
const [internalSearchValue, setInternalSearchValue] =
|
|
6692
|
+
const [internalSearchValue, setInternalSearchValue] = React59.useState(
|
|
6574
6693
|
() => defaultSearchValue != null ? defaultSearchValue : ""
|
|
6575
6694
|
);
|
|
6576
6695
|
const isSearchControlled = searchValue !== void 0;
|
|
6577
6696
|
const resolvedSearchValue = isSearchControlled ? searchValue : internalSearchValue;
|
|
6578
|
-
const handleSearchChange =
|
|
6697
|
+
const handleSearchChange = React59.useCallback(
|
|
6579
6698
|
(event) => {
|
|
6580
6699
|
const nextValue = event.target.value;
|
|
6581
6700
|
if (!isSearchControlled) {
|
|
@@ -6808,26 +6927,26 @@ function composeRefs(...refs) {
|
|
|
6808
6927
|
};
|
|
6809
6928
|
}
|
|
6810
6929
|
function useComposedRefs(...refs) {
|
|
6811
|
-
return
|
|
6930
|
+
return React59.useCallback(composeRefs(...refs), refs);
|
|
6812
6931
|
}
|
|
6813
6932
|
// @__NO_SIDE_EFFECTS__
|
|
6814
6933
|
function createSlot(ownerName) {
|
|
6815
6934
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
6816
|
-
const Slot22 =
|
|
6935
|
+
const Slot22 = React59.forwardRef((props, forwardedRef) => {
|
|
6817
6936
|
const { children, ...slotProps } = props;
|
|
6818
|
-
const childrenArray =
|
|
6937
|
+
const childrenArray = React59.Children.toArray(children);
|
|
6819
6938
|
const slottable = childrenArray.find(isSlottable);
|
|
6820
6939
|
if (slottable) {
|
|
6821
6940
|
const newElement = slottable.props.children;
|
|
6822
6941
|
const newChildren = childrenArray.map((child) => {
|
|
6823
6942
|
if (child === slottable) {
|
|
6824
|
-
if (
|
|
6825
|
-
return
|
|
6943
|
+
if (React59.Children.count(newElement) > 1) return React59.Children.only(null);
|
|
6944
|
+
return React59.isValidElement(newElement) ? newElement.props.children : null;
|
|
6826
6945
|
} else {
|
|
6827
6946
|
return child;
|
|
6828
6947
|
}
|
|
6829
6948
|
});
|
|
6830
|
-
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
6949
|
+
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children: React59.isValidElement(newElement) ? React59.cloneElement(newElement, void 0, newChildren) : null });
|
|
6831
6950
|
}
|
|
6832
6951
|
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
6833
6952
|
});
|
|
@@ -6837,24 +6956,24 @@ function createSlot(ownerName) {
|
|
|
6837
6956
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
6838
6957
|
// @__NO_SIDE_EFFECTS__
|
|
6839
6958
|
function createSlotClone(ownerName) {
|
|
6840
|
-
const SlotClone =
|
|
6959
|
+
const SlotClone = React59.forwardRef((props, forwardedRef) => {
|
|
6841
6960
|
const { children, ...slotProps } = props;
|
|
6842
|
-
if (
|
|
6961
|
+
if (React59.isValidElement(children)) {
|
|
6843
6962
|
const childrenRef = getElementRef(children);
|
|
6844
6963
|
const props2 = mergeProps(slotProps, children.props);
|
|
6845
|
-
if (children.type !==
|
|
6964
|
+
if (children.type !== React59.Fragment) {
|
|
6846
6965
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
6847
6966
|
}
|
|
6848
|
-
return
|
|
6967
|
+
return React59.cloneElement(children, props2);
|
|
6849
6968
|
}
|
|
6850
|
-
return
|
|
6969
|
+
return React59.Children.count(children) > 1 ? React59.Children.only(null) : null;
|
|
6851
6970
|
});
|
|
6852
6971
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
6853
6972
|
return SlotClone;
|
|
6854
6973
|
}
|
|
6855
6974
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
6856
6975
|
function isSlottable(child) {
|
|
6857
|
-
return
|
|
6976
|
+
return React59.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
6858
6977
|
}
|
|
6859
6978
|
function mergeProps(slotProps, childProps) {
|
|
6860
6979
|
const overrideProps = { ...childProps };
|
|
@@ -6898,7 +7017,7 @@ function getElementRef(element) {
|
|
|
6898
7017
|
// src/components/provider/safe-area.tsx
|
|
6899
7018
|
var defaultEdges = ["top", "right", "bottom", "left"];
|
|
6900
7019
|
var resolveInset = (edges, edge) => edges.includes(edge) ? `env(safe-area-inset-${edge})` : void 0;
|
|
6901
|
-
var SafeArea =
|
|
7020
|
+
var SafeArea = React59.forwardRef(
|
|
6902
7021
|
({
|
|
6903
7022
|
edges = defaultEdges,
|
|
6904
7023
|
asChild,
|
|
@@ -6937,21 +7056,21 @@ var MobileLayoutInner = ({
|
|
|
6937
7056
|
}) => {
|
|
6938
7057
|
var _a2, _b, _c, _d, _e;
|
|
6939
7058
|
const { header: headerState, navigateBack, canGoBack } = useMobileHeader();
|
|
6940
|
-
const headerEdges =
|
|
7059
|
+
const headerEdges = React59.useMemo(() => {
|
|
6941
7060
|
const edges = [];
|
|
6942
7061
|
if (safeArea.top) edges.push("top");
|
|
6943
7062
|
if (safeArea.left) edges.push("left");
|
|
6944
7063
|
if (safeArea.right) edges.push("right");
|
|
6945
7064
|
return edges;
|
|
6946
7065
|
}, [safeArea.top, safeArea.left, safeArea.right]);
|
|
6947
|
-
const footerEdges =
|
|
7066
|
+
const footerEdges = React59.useMemo(() => {
|
|
6948
7067
|
const edges = [];
|
|
6949
7068
|
if (safeArea.bottom) edges.push("bottom");
|
|
6950
7069
|
if (safeArea.left) edges.push("left");
|
|
6951
7070
|
if (safeArea.right) edges.push("right");
|
|
6952
7071
|
return edges;
|
|
6953
7072
|
}, [safeArea.bottom, safeArea.left, safeArea.right]);
|
|
6954
|
-
const handleBack =
|
|
7073
|
+
const handleBack = React59.useCallback(() => {
|
|
6955
7074
|
if (canGoBack) {
|
|
6956
7075
|
navigateBack();
|
|
6957
7076
|
return;
|
|
@@ -6961,7 +7080,7 @@ var MobileLayoutInner = ({
|
|
|
6961
7080
|
}
|
|
6962
7081
|
}, [canGoBack, navigateBack]);
|
|
6963
7082
|
const showBackButton = (_a2 = headerState.back) != null ? _a2 : canGoBack;
|
|
6964
|
-
const resolvedLeadingAction =
|
|
7083
|
+
const resolvedLeadingAction = React59.useMemo(() => {
|
|
6965
7084
|
if (showBackButton) {
|
|
6966
7085
|
return {
|
|
6967
7086
|
value: "mobile-header-back",
|
|
@@ -6982,7 +7101,7 @@ var MobileLayoutInner = ({
|
|
|
6982
7101
|
const headerVariant = (_d = (_c = (_b = headerState.variant) != null ? _b : variant) != null ? _c : type) != null ? _d : "hero";
|
|
6983
7102
|
const { show: showFooter = true, activeKey, onChange: footerOnChange, ...footerProps } = footer;
|
|
6984
7103
|
const footerValue = (_e = footerProps.value) != null ? _e : activeKey;
|
|
6985
|
-
const handleFooterSelect =
|
|
7104
|
+
const handleFooterSelect = React59.useCallback(
|
|
6986
7105
|
(value) => {
|
|
6987
7106
|
footerOnChange == null ? void 0 : footerOnChange(value);
|
|
6988
7107
|
},
|
|
@@ -7444,11 +7563,11 @@ function ScrollBar({
|
|
|
7444
7563
|
}
|
|
7445
7564
|
);
|
|
7446
7565
|
}
|
|
7447
|
-
var NativeSelectContext =
|
|
7566
|
+
var NativeSelectContext = React59.createContext(
|
|
7448
7567
|
void 0
|
|
7449
7568
|
);
|
|
7450
7569
|
function useNativeSelectContext() {
|
|
7451
|
-
const context =
|
|
7570
|
+
const context = React59.useContext(NativeSelectContext);
|
|
7452
7571
|
if (!context) {
|
|
7453
7572
|
throw new Error("useNativeSelectContext must be used within a Select component");
|
|
7454
7573
|
}
|
|
@@ -7464,16 +7583,16 @@ function SelectRoot({
|
|
|
7464
7583
|
const { isNative } = useTheme();
|
|
7465
7584
|
const isMobile = useIsMobile();
|
|
7466
7585
|
const shouldUseDrawer = isNative || isMobile;
|
|
7467
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
7586
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React59.useState(defaultOpen != null ? defaultOpen : false);
|
|
7468
7587
|
const open = openProp != null ? openProp : uncontrolledOpen;
|
|
7469
|
-
const setOpen =
|
|
7588
|
+
const setOpen = React59.useCallback(
|
|
7470
7589
|
(nextOpen) => {
|
|
7471
7590
|
if (openProp === void 0) setUncontrolledOpen(nextOpen);
|
|
7472
7591
|
onOpenChange == null ? void 0 : onOpenChange(nextOpen);
|
|
7473
7592
|
},
|
|
7474
7593
|
[openProp, onOpenChange]
|
|
7475
7594
|
);
|
|
7476
|
-
const contextValue =
|
|
7595
|
+
const contextValue = React59.useMemo(
|
|
7477
7596
|
() => ({
|
|
7478
7597
|
isNative: shouldUseDrawer,
|
|
7479
7598
|
open,
|
|
@@ -7567,7 +7686,7 @@ function SelectItem({
|
|
|
7567
7686
|
...props
|
|
7568
7687
|
}) {
|
|
7569
7688
|
const nativeContext = useNativeSelectContext();
|
|
7570
|
-
const handleSelect =
|
|
7689
|
+
const handleSelect = React59.useCallback(
|
|
7571
7690
|
(event) => {
|
|
7572
7691
|
onSelect == null ? void 0 : onSelect(event);
|
|
7573
7692
|
if (nativeContext.isNative && nativeContext.closeOnSelect && !event.defaultPrevented) {
|
|
@@ -7665,7 +7784,7 @@ function Select({
|
|
|
7665
7784
|
}
|
|
7666
7785
|
var noop3 = () => {
|
|
7667
7786
|
};
|
|
7668
|
-
var MultiSelectContext =
|
|
7787
|
+
var MultiSelectContext = React59.createContext({
|
|
7669
7788
|
isNative: false,
|
|
7670
7789
|
selectedValues: [],
|
|
7671
7790
|
setSelectedValues: noop3,
|
|
@@ -7675,7 +7794,7 @@ var MultiSelectContext = React58.createContext({
|
|
|
7675
7794
|
setOpen: noop3
|
|
7676
7795
|
});
|
|
7677
7796
|
function useMultiSelectContext() {
|
|
7678
|
-
return
|
|
7797
|
+
return React59.useContext(MultiSelectContext);
|
|
7679
7798
|
}
|
|
7680
7799
|
function MultiSelect({
|
|
7681
7800
|
value,
|
|
@@ -7689,23 +7808,23 @@ function MultiSelect({
|
|
|
7689
7808
|
const { isNative } = useTheme();
|
|
7690
7809
|
const isMobile = useIsMobile();
|
|
7691
7810
|
const shouldUseDrawer = isNative || isMobile;
|
|
7692
|
-
const [internalValue, setInternalValue] =
|
|
7693
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
7811
|
+
const [internalValue, setInternalValue] = React59.useState(defaultValue);
|
|
7812
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React59.useState(
|
|
7694
7813
|
defaultOpen != null ? defaultOpen : false
|
|
7695
7814
|
);
|
|
7696
|
-
|
|
7815
|
+
React59.useEffect(() => {
|
|
7697
7816
|
if (value !== void 0) {
|
|
7698
7817
|
setInternalValue(value);
|
|
7699
7818
|
}
|
|
7700
7819
|
}, [value]);
|
|
7701
|
-
|
|
7820
|
+
React59.useEffect(() => {
|
|
7702
7821
|
if (openProp !== void 0) {
|
|
7703
7822
|
setUncontrolledOpen(openProp);
|
|
7704
7823
|
}
|
|
7705
7824
|
}, [openProp]);
|
|
7706
7825
|
const selectedValues = value != null ? value : internalValue;
|
|
7707
7826
|
const open = openProp != null ? openProp : uncontrolledOpen;
|
|
7708
|
-
const setSelectedValues =
|
|
7827
|
+
const setSelectedValues = React59.useCallback(
|
|
7709
7828
|
(next) => {
|
|
7710
7829
|
const resolved = typeof next === "function" ? next(selectedValues) : next;
|
|
7711
7830
|
if (value === void 0) {
|
|
@@ -7715,7 +7834,7 @@ function MultiSelect({
|
|
|
7715
7834
|
},
|
|
7716
7835
|
[onValueChange, selectedValues, value]
|
|
7717
7836
|
);
|
|
7718
|
-
const toggleValue =
|
|
7837
|
+
const toggleValue = React59.useCallback(
|
|
7719
7838
|
(item) => {
|
|
7720
7839
|
setSelectedValues((prev) => {
|
|
7721
7840
|
if (prev.includes(item)) {
|
|
@@ -7726,11 +7845,11 @@ function MultiSelect({
|
|
|
7726
7845
|
},
|
|
7727
7846
|
[setSelectedValues]
|
|
7728
7847
|
);
|
|
7729
|
-
const isSelected =
|
|
7848
|
+
const isSelected = React59.useCallback(
|
|
7730
7849
|
(item) => selectedValues.includes(item),
|
|
7731
7850
|
[selectedValues]
|
|
7732
7851
|
);
|
|
7733
|
-
const setOpen =
|
|
7852
|
+
const setOpen = React59.useCallback(
|
|
7734
7853
|
(nextOpen) => {
|
|
7735
7854
|
if (openProp === void 0) {
|
|
7736
7855
|
setUncontrolledOpen(nextOpen);
|
|
@@ -7739,7 +7858,7 @@ function MultiSelect({
|
|
|
7739
7858
|
},
|
|
7740
7859
|
[onOpenChange, openProp]
|
|
7741
7860
|
);
|
|
7742
|
-
const contextValue =
|
|
7861
|
+
const contextValue = React59.useMemo(
|
|
7743
7862
|
() => ({
|
|
7744
7863
|
isNative: shouldUseDrawer,
|
|
7745
7864
|
selectedValues,
|
|
@@ -7770,7 +7889,7 @@ function MultiSelectTrigger({
|
|
|
7770
7889
|
...props
|
|
7771
7890
|
}) {
|
|
7772
7891
|
const context = useMultiSelectContext();
|
|
7773
|
-
const handleClick =
|
|
7892
|
+
const handleClick = React59.useCallback(
|
|
7774
7893
|
(event) => {
|
|
7775
7894
|
onClick == null ? void 0 : onClick(event);
|
|
7776
7895
|
if (context.isNative && !disabled) {
|
|
@@ -7813,7 +7932,7 @@ function MultiSelectValue({
|
|
|
7813
7932
|
formatValue
|
|
7814
7933
|
}) {
|
|
7815
7934
|
const { selectedValues, isNative } = useMultiSelectContext();
|
|
7816
|
-
const content =
|
|
7935
|
+
const content = React59.useMemo(() => {
|
|
7817
7936
|
if (formatValue) {
|
|
7818
7937
|
return formatValue(selectedValues);
|
|
7819
7938
|
}
|
|
@@ -8060,7 +8179,7 @@ function SheetDescription({
|
|
|
8060
8179
|
}
|
|
8061
8180
|
var skeletonBaseClass = "relative isolate overflow-hidden rounded-md bg-muted text-transparent";
|
|
8062
8181
|
var skeletonShimmerClass = "after:absolute after:inset-0 after:-translate-x-full after:animate-[shimmer_1.6s_linear_infinite] after:bg-gradient-to-r after:from-transparent after:via-foreground/10 after:to-transparent after:content-['']";
|
|
8063
|
-
var SkeletonRoot =
|
|
8182
|
+
var SkeletonRoot = React59.forwardRef(
|
|
8064
8183
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8065
8184
|
"div",
|
|
8066
8185
|
{
|
|
@@ -8072,7 +8191,7 @@ var SkeletonRoot = React58.forwardRef(
|
|
|
8072
8191
|
)
|
|
8073
8192
|
);
|
|
8074
8193
|
SkeletonRoot.displayName = "Skeleton";
|
|
8075
|
-
var SkeletonButton =
|
|
8194
|
+
var SkeletonButton = React59.forwardRef(
|
|
8076
8195
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8077
8196
|
SkeletonRoot,
|
|
8078
8197
|
{
|
|
@@ -8083,7 +8202,7 @@ var SkeletonButton = React58.forwardRef(
|
|
|
8083
8202
|
)
|
|
8084
8203
|
);
|
|
8085
8204
|
SkeletonButton.displayName = "Skeleton.Button";
|
|
8086
|
-
var SkeletonInput =
|
|
8205
|
+
var SkeletonInput = React59.forwardRef(
|
|
8087
8206
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8088
8207
|
SkeletonRoot,
|
|
8089
8208
|
{
|
|
@@ -8152,9 +8271,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
8152
8271
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
8153
8272
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
8154
8273
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
8155
|
-
var SidebarContext =
|
|
8274
|
+
var SidebarContext = React59.createContext(null);
|
|
8156
8275
|
function useSidebar() {
|
|
8157
|
-
const context =
|
|
8276
|
+
const context = React59.useContext(SidebarContext);
|
|
8158
8277
|
if (!context) {
|
|
8159
8278
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
8160
8279
|
}
|
|
@@ -8170,10 +8289,10 @@ function SidebarProvider({
|
|
|
8170
8289
|
...props
|
|
8171
8290
|
}) {
|
|
8172
8291
|
const isMobile = useIsMobile();
|
|
8173
|
-
const [openMobile, setOpenMobile] =
|
|
8174
|
-
const [_open, _setOpen] =
|
|
8292
|
+
const [openMobile, setOpenMobile] = React59.useState(false);
|
|
8293
|
+
const [_open, _setOpen] = React59.useState(defaultOpen);
|
|
8175
8294
|
const open = openProp != null ? openProp : _open;
|
|
8176
|
-
const setOpen =
|
|
8295
|
+
const setOpen = React59.useCallback(
|
|
8177
8296
|
(value) => {
|
|
8178
8297
|
const openState = typeof value === "function" ? value(open) : value;
|
|
8179
8298
|
if (setOpenProp) {
|
|
@@ -8185,10 +8304,10 @@ function SidebarProvider({
|
|
|
8185
8304
|
},
|
|
8186
8305
|
[setOpenProp, open]
|
|
8187
8306
|
);
|
|
8188
|
-
const toggleSidebar =
|
|
8307
|
+
const toggleSidebar = React59.useCallback(() => {
|
|
8189
8308
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
8190
8309
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
8191
|
-
|
|
8310
|
+
React59.useEffect(() => {
|
|
8192
8311
|
const handleKeyDown = (event) => {
|
|
8193
8312
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
8194
8313
|
event.preventDefault();
|
|
@@ -8199,7 +8318,7 @@ function SidebarProvider({
|
|
|
8199
8318
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
8200
8319
|
}, [toggleSidebar]);
|
|
8201
8320
|
const state = open ? "expanded" : "collapsed";
|
|
8202
|
-
const contextValue =
|
|
8321
|
+
const contextValue = React59.useMemo(
|
|
8203
8322
|
() => ({
|
|
8204
8323
|
state,
|
|
8205
8324
|
open,
|
|
@@ -8581,7 +8700,7 @@ function SidebarMenuButton({
|
|
|
8581
8700
|
}) {
|
|
8582
8701
|
const Comp = asChild ? Slot$1.Slot : "button";
|
|
8583
8702
|
const { isMobile, setOpenMobile, state } = useSidebar();
|
|
8584
|
-
const handleClick =
|
|
8703
|
+
const handleClick = React59.useCallback(
|
|
8585
8704
|
(event) => {
|
|
8586
8705
|
if (onClick) {
|
|
8587
8706
|
onClick(event);
|
|
@@ -8679,7 +8798,7 @@ function SidebarMenuSkeleton({
|
|
|
8679
8798
|
showIcon = false,
|
|
8680
8799
|
...props
|
|
8681
8800
|
}) {
|
|
8682
|
-
const width =
|
|
8801
|
+
const width = React59.useMemo(() => {
|
|
8683
8802
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
8684
8803
|
}, []);
|
|
8685
8804
|
return /* @__PURE__ */ jsxs(
|
|
@@ -8750,7 +8869,7 @@ function SidebarMenuSubButton({
|
|
|
8750
8869
|
}) {
|
|
8751
8870
|
const Comp = asChild ? Slot$1.Slot : "a";
|
|
8752
8871
|
const { isMobile, setOpenMobile } = useSidebar();
|
|
8753
|
-
const handleClick =
|
|
8872
|
+
const handleClick = React59.useCallback(
|
|
8754
8873
|
(event) => {
|
|
8755
8874
|
if (onClick) {
|
|
8756
8875
|
onClick(event);
|
|
@@ -8789,7 +8908,7 @@ function Slider({
|
|
|
8789
8908
|
max: max2 = 100,
|
|
8790
8909
|
...props
|
|
8791
8910
|
}) {
|
|
8792
|
-
const _values =
|
|
8911
|
+
const _values = React59.useMemo(
|
|
8793
8912
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min2, max2],
|
|
8794
8913
|
[value, defaultValue, min2, max2]
|
|
8795
8914
|
);
|
|
@@ -8861,7 +8980,7 @@ function Switch({
|
|
|
8861
8980
|
{
|
|
8862
8981
|
"data-slot": "switch",
|
|
8863
8982
|
className: cn(
|
|
8864
|
-
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-primary focus-visible:ring-primary/40 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
8983
|
+
"peer cursor-pointer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-primary focus-visible:ring-primary/40 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
8865
8984
|
className
|
|
8866
8985
|
),
|
|
8867
8986
|
...props,
|
|
@@ -8981,17 +9100,17 @@ function TableCaption({
|
|
|
8981
9100
|
}
|
|
8982
9101
|
);
|
|
8983
9102
|
}
|
|
8984
|
-
var TabsContext =
|
|
9103
|
+
var TabsContext = React59.createContext(null);
|
|
8985
9104
|
var useTabsContext = (component) => {
|
|
8986
|
-
const context =
|
|
9105
|
+
const context = React59.useContext(TabsContext);
|
|
8987
9106
|
if (!context) {
|
|
8988
9107
|
throw new Error(`${component} must be used within <Tabs>`);
|
|
8989
9108
|
}
|
|
8990
9109
|
return context;
|
|
8991
9110
|
};
|
|
8992
|
-
var TabsVariantContext =
|
|
9111
|
+
var TabsVariantContext = React59.createContext("default");
|
|
8993
9112
|
var useTabsVariant = (variant) => {
|
|
8994
|
-
const contextVariant =
|
|
9113
|
+
const contextVariant = React59.useContext(TabsVariantContext);
|
|
8995
9114
|
return variant != null ? variant : contextVariant;
|
|
8996
9115
|
};
|
|
8997
9116
|
var tabsListVariants = {
|
|
@@ -9034,7 +9153,7 @@ var mergeRefs = (...refs) => (node) => {
|
|
|
9034
9153
|
}
|
|
9035
9154
|
});
|
|
9036
9155
|
};
|
|
9037
|
-
var Tabs =
|
|
9156
|
+
var Tabs = React59.forwardRef(
|
|
9038
9157
|
({
|
|
9039
9158
|
className,
|
|
9040
9159
|
children,
|
|
@@ -9046,14 +9165,14 @@ var Tabs = React58.forwardRef(
|
|
|
9046
9165
|
...props
|
|
9047
9166
|
}, ref) => {
|
|
9048
9167
|
var _a2;
|
|
9049
|
-
const id =
|
|
9168
|
+
const id = React59.useId();
|
|
9050
9169
|
const isControlled = valueProp !== void 0;
|
|
9051
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
9170
|
+
const [uncontrolledValue, setUncontrolledValue] = React59.useState(
|
|
9052
9171
|
() => defaultValue != null ? defaultValue : null
|
|
9053
9172
|
);
|
|
9054
9173
|
const value = (_a2 = isControlled ? valueProp : uncontrolledValue) != null ? _a2 : null;
|
|
9055
|
-
const triggersRef =
|
|
9056
|
-
const setValue =
|
|
9174
|
+
const triggersRef = React59.useRef(/* @__PURE__ */ new Map());
|
|
9175
|
+
const setValue = React59.useCallback(
|
|
9057
9176
|
(nextValue) => {
|
|
9058
9177
|
if (!isControlled) {
|
|
9059
9178
|
setUncontrolledValue(nextValue);
|
|
@@ -9062,7 +9181,7 @@ var Tabs = React58.forwardRef(
|
|
|
9062
9181
|
},
|
|
9063
9182
|
[isControlled, onValueChange]
|
|
9064
9183
|
);
|
|
9065
|
-
const registerTrigger =
|
|
9184
|
+
const registerTrigger = React59.useCallback(
|
|
9066
9185
|
(triggerValue, node) => {
|
|
9067
9186
|
if (node) {
|
|
9068
9187
|
const wasEmpty = triggersRef.current.size === 0;
|
|
@@ -9076,7 +9195,7 @@ var Tabs = React58.forwardRef(
|
|
|
9076
9195
|
},
|
|
9077
9196
|
[defaultValue, isControlled, setUncontrolledValue, value]
|
|
9078
9197
|
);
|
|
9079
|
-
const getTriggerNode =
|
|
9198
|
+
const getTriggerNode = React59.useCallback(
|
|
9080
9199
|
(triggerValue) => {
|
|
9081
9200
|
var _a3;
|
|
9082
9201
|
if (!triggerValue) {
|
|
@@ -9086,7 +9205,7 @@ var Tabs = React58.forwardRef(
|
|
|
9086
9205
|
},
|
|
9087
9206
|
[]
|
|
9088
9207
|
);
|
|
9089
|
-
const focusTriggerByIndex =
|
|
9208
|
+
const focusTriggerByIndex = React59.useCallback(
|
|
9090
9209
|
(index2) => {
|
|
9091
9210
|
const values = Array.from(triggersRef.current.keys());
|
|
9092
9211
|
if (!values.length) {
|
|
@@ -9102,7 +9221,7 @@ var Tabs = React58.forwardRef(
|
|
|
9102
9221
|
},
|
|
9103
9222
|
[activationMode, setValue]
|
|
9104
9223
|
);
|
|
9105
|
-
const focusNextTrigger =
|
|
9224
|
+
const focusNextTrigger = React59.useCallback(
|
|
9106
9225
|
(currentValue, direction) => {
|
|
9107
9226
|
const values = Array.from(triggersRef.current.keys());
|
|
9108
9227
|
const currentIndex = values.indexOf(currentValue);
|
|
@@ -9113,7 +9232,7 @@ var Tabs = React58.forwardRef(
|
|
|
9113
9232
|
},
|
|
9114
9233
|
[focusTriggerByIndex]
|
|
9115
9234
|
);
|
|
9116
|
-
const focusEdgeTrigger =
|
|
9235
|
+
const focusEdgeTrigger = React59.useCallback(
|
|
9117
9236
|
(edge) => {
|
|
9118
9237
|
const values = Array.from(triggersRef.current.keys());
|
|
9119
9238
|
if (!values.length) {
|
|
@@ -9123,16 +9242,16 @@ var Tabs = React58.forwardRef(
|
|
|
9123
9242
|
},
|
|
9124
9243
|
[focusTriggerByIndex]
|
|
9125
9244
|
);
|
|
9126
|
-
const [orientation, setOrientationState] =
|
|
9127
|
-
const setOrientation =
|
|
9245
|
+
const [orientation, setOrientationState] = React59.useState("horizontal");
|
|
9246
|
+
const setOrientation = React59.useCallback((nextOrientation) => {
|
|
9128
9247
|
setOrientationState(nextOrientation);
|
|
9129
9248
|
}, []);
|
|
9130
|
-
|
|
9249
|
+
React59.useEffect(() => {
|
|
9131
9250
|
if (!isControlled && value == null && defaultValue) {
|
|
9132
9251
|
setUncontrolledValue(defaultValue);
|
|
9133
9252
|
}
|
|
9134
9253
|
}, [defaultValue, isControlled, setUncontrolledValue, value]);
|
|
9135
|
-
const contextValue =
|
|
9254
|
+
const contextValue = React59.useMemo(
|
|
9136
9255
|
() => ({
|
|
9137
9256
|
id,
|
|
9138
9257
|
value,
|
|
@@ -9161,15 +9280,15 @@ var Tabs = React58.forwardRef(
|
|
|
9161
9280
|
}
|
|
9162
9281
|
);
|
|
9163
9282
|
Tabs.displayName = "Tabs";
|
|
9164
|
-
var TabsList =
|
|
9283
|
+
var TabsList = React59.forwardRef(
|
|
9165
9284
|
({ className, variant, orientation = "horizontal", ...props }, ref) => {
|
|
9166
9285
|
const { value: activeValue, setOrientation, getTriggerNode } = useTabsContext("TabsList");
|
|
9167
9286
|
const activeVariant = useTabsVariant(variant);
|
|
9168
9287
|
const highlightClass = tabsListHighlightVariants[activeVariant];
|
|
9169
|
-
const localRef =
|
|
9170
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
9288
|
+
const localRef = React59.useRef(null);
|
|
9289
|
+
const [indicatorStyle, setIndicatorStyle] = React59.useState(null);
|
|
9171
9290
|
const highlightEnabled = highlightableVariants.has(activeVariant);
|
|
9172
|
-
const updateIndicator =
|
|
9291
|
+
const updateIndicator = React59.useCallback(() => {
|
|
9173
9292
|
if (!highlightEnabled) {
|
|
9174
9293
|
setIndicatorStyle(null);
|
|
9175
9294
|
return;
|
|
@@ -9205,13 +9324,13 @@ var TabsList = React58.forwardRef(
|
|
|
9205
9324
|
transform: `translate3d(${offsetLeft}px, ${offsetTop}px, 0)`
|
|
9206
9325
|
});
|
|
9207
9326
|
}, [activeValue, getTriggerNode, highlightEnabled]);
|
|
9208
|
-
|
|
9327
|
+
React59.useEffect(() => {
|
|
9209
9328
|
setOrientation(orientation);
|
|
9210
9329
|
}, [orientation, setOrientation]);
|
|
9211
|
-
|
|
9330
|
+
React59.useLayoutEffect(() => {
|
|
9212
9331
|
updateIndicator();
|
|
9213
9332
|
}, [updateIndicator]);
|
|
9214
|
-
|
|
9333
|
+
React59.useEffect(() => {
|
|
9215
9334
|
if (!highlightEnabled || typeof ResizeObserver === "undefined") {
|
|
9216
9335
|
return;
|
|
9217
9336
|
}
|
|
@@ -9231,7 +9350,7 @@ var TabsList = React58.forwardRef(
|
|
|
9231
9350
|
observer.disconnect();
|
|
9232
9351
|
};
|
|
9233
9352
|
}, [activeValue, getTriggerNode, highlightEnabled, updateIndicator]);
|
|
9234
|
-
|
|
9353
|
+
React59.useEffect(() => {
|
|
9235
9354
|
if (!highlightEnabled || typeof MutationObserver === "undefined") {
|
|
9236
9355
|
return;
|
|
9237
9356
|
}
|
|
@@ -9247,7 +9366,7 @@ var TabsList = React58.forwardRef(
|
|
|
9247
9366
|
observer.disconnect();
|
|
9248
9367
|
};
|
|
9249
9368
|
}, [highlightEnabled, updateIndicator]);
|
|
9250
|
-
|
|
9369
|
+
React59.useEffect(() => {
|
|
9251
9370
|
if (!highlightEnabled) {
|
|
9252
9371
|
return;
|
|
9253
9372
|
}
|
|
@@ -9287,7 +9406,7 @@ var TabsList = React58.forwardRef(
|
|
|
9287
9406
|
}
|
|
9288
9407
|
);
|
|
9289
9408
|
TabsList.displayName = "TabsList";
|
|
9290
|
-
var TabsTrigger =
|
|
9409
|
+
var TabsTrigger = React59.forwardRef(
|
|
9291
9410
|
({ className, variant, value, disabled, onClick, onKeyDown, ...props }, forwardedRef) => {
|
|
9292
9411
|
const {
|
|
9293
9412
|
id,
|
|
@@ -9299,11 +9418,11 @@ var TabsTrigger = React58.forwardRef(
|
|
|
9299
9418
|
orientation
|
|
9300
9419
|
} = useTabsContext("TabsTrigger");
|
|
9301
9420
|
const activeVariant = useTabsVariant(variant);
|
|
9302
|
-
const localRef =
|
|
9421
|
+
const localRef = React59.useRef(null);
|
|
9303
9422
|
const isActive = activeValue === value;
|
|
9304
9423
|
const triggerId = `${id}-trigger-${value}`;
|
|
9305
9424
|
const contentId = `${id}-content-${value}`;
|
|
9306
|
-
|
|
9425
|
+
React59.useEffect(() => {
|
|
9307
9426
|
registerTrigger(value, localRef.current);
|
|
9308
9427
|
return () => registerTrigger(value, null);
|
|
9309
9428
|
}, [registerTrigger, value]);
|
|
@@ -9378,7 +9497,7 @@ var TabsTrigger = React58.forwardRef(
|
|
|
9378
9497
|
}
|
|
9379
9498
|
);
|
|
9380
9499
|
TabsTrigger.displayName = "TabsTrigger";
|
|
9381
|
-
var TabsContent =
|
|
9500
|
+
var TabsContent = React59.forwardRef(
|
|
9382
9501
|
({ className, variant, value, ...props }, ref) => {
|
|
9383
9502
|
const { id, value: activeValue } = useTabsContext("TabsContent");
|
|
9384
9503
|
const activeVariant = useTabsVariant(variant);
|
|
@@ -9405,21 +9524,44 @@ var TabsContent = React58.forwardRef(
|
|
|
9405
9524
|
}
|
|
9406
9525
|
);
|
|
9407
9526
|
TabsContent.displayName = "TabsContent";
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9527
|
+
var Textarea = React59.forwardRef(
|
|
9528
|
+
({ className, onFocus, ...props }, forwardedRef) => {
|
|
9529
|
+
const setRefs = React59.useCallback(
|
|
9530
|
+
(node) => {
|
|
9531
|
+
if (typeof forwardedRef === "function") {
|
|
9532
|
+
forwardedRef(node);
|
|
9533
|
+
} else if (forwardedRef) {
|
|
9534
|
+
forwardedRef.current = node;
|
|
9535
|
+
}
|
|
9536
|
+
},
|
|
9537
|
+
[forwardedRef]
|
|
9538
|
+
);
|
|
9539
|
+
const handleFocus = React59.useCallback(
|
|
9540
|
+
(event) => {
|
|
9541
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
9542
|
+
if (event.defaultPrevented) {
|
|
9543
|
+
return;
|
|
9544
|
+
}
|
|
9545
|
+
maybeScrollElementIntoView(event.currentTarget);
|
|
9546
|
+
},
|
|
9547
|
+
[onFocus]
|
|
9548
|
+
);
|
|
9549
|
+
return /* @__PURE__ */ jsx(
|
|
9550
|
+
"textarea",
|
|
9551
|
+
{
|
|
9552
|
+
ref: setRefs,
|
|
9553
|
+
"data-slot": "textarea",
|
|
9554
|
+
onFocus: handleFocus,
|
|
9555
|
+
className: cn(
|
|
9556
|
+
"border-input placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-primary/40 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
9557
|
+
className
|
|
9558
|
+
),
|
|
9559
|
+
...props
|
|
9560
|
+
}
|
|
9561
|
+
);
|
|
9562
|
+
}
|
|
9563
|
+
);
|
|
9564
|
+
Textarea.displayName = "Textarea";
|
|
9423
9565
|
var toggleVariants = cva(
|
|
9424
9566
|
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-primary focus-visible:ring-primary/40 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
9425
9567
|
{
|
|
@@ -9455,7 +9597,7 @@ function Toggle({
|
|
|
9455
9597
|
}
|
|
9456
9598
|
);
|
|
9457
9599
|
}
|
|
9458
|
-
var ToggleGroupContext =
|
|
9600
|
+
var ToggleGroupContext = React59.createContext({
|
|
9459
9601
|
size: "default",
|
|
9460
9602
|
variant: "default"
|
|
9461
9603
|
});
|
|
@@ -9488,7 +9630,7 @@ function ToggleGroupItem({
|
|
|
9488
9630
|
size: size4,
|
|
9489
9631
|
...props
|
|
9490
9632
|
}) {
|
|
9491
|
-
const context =
|
|
9633
|
+
const context = React59.useContext(ToggleGroupContext);
|
|
9492
9634
|
return /* @__PURE__ */ jsx(
|
|
9493
9635
|
ToggleGroup$1.Item,
|
|
9494
9636
|
{
|
|
@@ -9632,9 +9774,9 @@ function MobileWheelColumn2({
|
|
|
9632
9774
|
onValueChange,
|
|
9633
9775
|
open
|
|
9634
9776
|
}) {
|
|
9635
|
-
const listRef =
|
|
9636
|
-
const scrollTimeoutRef =
|
|
9637
|
-
const extendedOptions =
|
|
9777
|
+
const listRef = React59.useRef(null);
|
|
9778
|
+
const scrollTimeoutRef = React59.useRef(null);
|
|
9779
|
+
const extendedOptions = React59.useMemo(() => {
|
|
9638
9780
|
if (options.length === 0) {
|
|
9639
9781
|
return [];
|
|
9640
9782
|
}
|
|
@@ -9646,7 +9788,7 @@ function MobileWheelColumn2({
|
|
|
9646
9788
|
}
|
|
9647
9789
|
return repeated;
|
|
9648
9790
|
}, [options]);
|
|
9649
|
-
const alignToValue =
|
|
9791
|
+
const alignToValue = React59.useCallback(
|
|
9650
9792
|
(value, behavior = "auto") => {
|
|
9651
9793
|
if (!listRef.current || options.length === 0 || extendedOptions.length === 0) {
|
|
9652
9794
|
return;
|
|
@@ -9660,18 +9802,18 @@ function MobileWheelColumn2({
|
|
|
9660
9802
|
},
|
|
9661
9803
|
[extendedOptions.length, options]
|
|
9662
9804
|
);
|
|
9663
|
-
|
|
9805
|
+
React59.useLayoutEffect(() => {
|
|
9664
9806
|
if (!open) {
|
|
9665
9807
|
return;
|
|
9666
9808
|
}
|
|
9667
9809
|
alignToValue(selectedValue);
|
|
9668
9810
|
}, [alignToValue, open, options, selectedValue]);
|
|
9669
|
-
|
|
9811
|
+
React59.useEffect(() => () => {
|
|
9670
9812
|
if (scrollTimeoutRef.current !== null) {
|
|
9671
9813
|
clearTimeout(scrollTimeoutRef.current);
|
|
9672
9814
|
}
|
|
9673
9815
|
}, []);
|
|
9674
|
-
const handleScroll2 =
|
|
9816
|
+
const handleScroll2 = React59.useCallback(
|
|
9675
9817
|
(event) => {
|
|
9676
9818
|
if (extendedOptions.length === 0 || options.length === 0) {
|
|
9677
9819
|
return;
|
|
@@ -9760,7 +9902,7 @@ var MeridiemColumn = ({ value, onChange }) => /* @__PURE__ */ jsxs("div", { clas
|
|
|
9760
9902
|
);
|
|
9761
9903
|
}) })
|
|
9762
9904
|
] });
|
|
9763
|
-
var TimePicker =
|
|
9905
|
+
var TimePicker = React59.forwardRef((props, ref) => {
|
|
9764
9906
|
var _a2, _b, _c, _d;
|
|
9765
9907
|
const {
|
|
9766
9908
|
value: valueProp,
|
|
@@ -9802,21 +9944,21 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9802
9944
|
const isMobile = useIsMobile();
|
|
9803
9945
|
const shouldUseDrawer = isNative || isMobile;
|
|
9804
9946
|
const isControlled = valueProp !== void 0;
|
|
9805
|
-
const [internalValue, setInternalValue] =
|
|
9947
|
+
const [internalValue, setInternalValue] = React59.useState(defaultValue);
|
|
9806
9948
|
const currentValue = (_a2 = isControlled ? valueProp : internalValue) != null ? _a2 : null;
|
|
9807
|
-
const parsedValue =
|
|
9808
|
-
const resolvedMeridiem =
|
|
9949
|
+
const parsedValue = React59.useMemo(() => parseTimeString(currentValue), [currentValue]);
|
|
9950
|
+
const resolvedMeridiem = React59.useMemo(
|
|
9809
9951
|
() => {
|
|
9810
9952
|
var _a3;
|
|
9811
9953
|
return ((_a3 = parsedValue == null ? void 0 : parsedValue.hour) != null ? _a3 : 0) >= 12 ? "PM" : "AM";
|
|
9812
9954
|
},
|
|
9813
9955
|
[parsedValue == null ? void 0 : parsedValue.hour]
|
|
9814
9956
|
);
|
|
9815
|
-
const [meridiem, setMeridiem] =
|
|
9816
|
-
|
|
9957
|
+
const [meridiem, setMeridiem] = React59.useState(resolvedMeridiem);
|
|
9958
|
+
React59.useEffect(() => {
|
|
9817
9959
|
setMeridiem(resolvedMeridiem);
|
|
9818
9960
|
}, [resolvedMeridiem]);
|
|
9819
|
-
const inferredShowSeconds =
|
|
9961
|
+
const inferredShowSeconds = React59.useMemo(() => {
|
|
9820
9962
|
if (typeof showSecondsProp === "boolean") {
|
|
9821
9963
|
return showSecondsProp;
|
|
9822
9964
|
}
|
|
@@ -9825,12 +9967,12 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9825
9967
|
}
|
|
9826
9968
|
return Boolean(currentValue && currentValue.split(":").length === 3);
|
|
9827
9969
|
}, [currentValue, format, showSecondsProp]);
|
|
9828
|
-
const defaultFormat =
|
|
9970
|
+
const defaultFormat = React59.useMemo(
|
|
9829
9971
|
() => use12Hours ? inferredShowSeconds ? "hh:mm:ss A" : "hh:mm A" : inferredShowSeconds ? "HH:mm:ss" : "HH:mm",
|
|
9830
9972
|
[inferredShowSeconds, use12Hours]
|
|
9831
9973
|
);
|
|
9832
9974
|
const resolvedFormat = typeof format === "string" ? format : defaultFormat;
|
|
9833
|
-
const formatValue =
|
|
9975
|
+
const formatValue = React59.useCallback(
|
|
9834
9976
|
(value) => {
|
|
9835
9977
|
if (!value) {
|
|
9836
9978
|
return "";
|
|
@@ -9842,21 +9984,21 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9842
9984
|
},
|
|
9843
9985
|
[format, resolvedFormat]
|
|
9844
9986
|
);
|
|
9845
|
-
const [inputValue, setInputValue] =
|
|
9846
|
-
|
|
9987
|
+
const [inputValue, setInputValue] = React59.useState(() => formatValue(parsedValue));
|
|
9988
|
+
React59.useEffect(() => {
|
|
9847
9989
|
setInputValue(formatValue(parsedValue));
|
|
9848
9990
|
}, [formatValue, parsedValue]);
|
|
9849
9991
|
const allowClearConfig = typeof allowClear === "object" && allowClear !== null && !Array.isArray(allowClear) ? allowClear : void 0;
|
|
9850
9992
|
const clearIcon = (_b = allowClearConfig == null ? void 0 : allowClearConfig.clearIcon) != null ? _b : /* @__PURE__ */ jsx(X, { className: "h-4 w-4", strokeWidth: 2 });
|
|
9851
9993
|
const showClear = Boolean(allowClear) && !disabled && Boolean(currentValue);
|
|
9852
|
-
const primaryColorStyle =
|
|
9994
|
+
const primaryColorStyle = React59.useMemo(
|
|
9853
9995
|
() => ({ "--date-primary-color": DEFAULT_PRIMARY_COLOR2 }),
|
|
9854
9996
|
[]
|
|
9855
9997
|
);
|
|
9856
9998
|
const isOpenControlled = openProp !== void 0;
|
|
9857
|
-
const [internalOpen, setInternalOpen] =
|
|
9999
|
+
const [internalOpen, setInternalOpen] = React59.useState(Boolean(defaultOpen));
|
|
9858
10000
|
const open = isOpenControlled ? Boolean(openProp) : internalOpen;
|
|
9859
|
-
const handleOpenChange =
|
|
10001
|
+
const handleOpenChange = React59.useCallback(
|
|
9860
10002
|
(nextOpen) => {
|
|
9861
10003
|
if (disabled) {
|
|
9862
10004
|
return;
|
|
@@ -9868,7 +10010,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9868
10010
|
},
|
|
9869
10011
|
[disabled, isOpenControlled, onOpenChange]
|
|
9870
10012
|
);
|
|
9871
|
-
const commitValue =
|
|
10013
|
+
const commitValue = React59.useCallback(
|
|
9872
10014
|
(next) => {
|
|
9873
10015
|
if (!next) {
|
|
9874
10016
|
if (!isControlled) {
|
|
@@ -9892,7 +10034,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9892
10034
|
const safeHourStep = Math.max(1, Math.floor(hourStep));
|
|
9893
10035
|
const safeMinuteStep = Math.max(1, Math.floor(minuteStep));
|
|
9894
10036
|
const safeSecondStep = Math.max(1, Math.floor(secondStep));
|
|
9895
|
-
const hourOptions =
|
|
10037
|
+
const hourOptions = React59.useMemo(() => {
|
|
9896
10038
|
if (use12Hours) {
|
|
9897
10039
|
const values = [];
|
|
9898
10040
|
for (let hour = 1; hour <= 12; hour += safeHourStep) {
|
|
@@ -9910,14 +10052,14 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9910
10052
|
}
|
|
9911
10053
|
return result;
|
|
9912
10054
|
}, [safeHourStep, use12Hours]);
|
|
9913
|
-
const minuteOptions =
|
|
10055
|
+
const minuteOptions = React59.useMemo(() => {
|
|
9914
10056
|
const result = [];
|
|
9915
10057
|
for (let minute = 0; minute < 60; minute += safeMinuteStep) {
|
|
9916
10058
|
result.push({ label: pad(minute), value: minute });
|
|
9917
10059
|
}
|
|
9918
10060
|
return result;
|
|
9919
10061
|
}, [safeMinuteStep]);
|
|
9920
|
-
const secondOptions =
|
|
10062
|
+
const secondOptions = React59.useMemo(() => {
|
|
9921
10063
|
if (!inferredShowSeconds) {
|
|
9922
10064
|
return [];
|
|
9923
10065
|
}
|
|
@@ -9927,7 +10069,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9927
10069
|
}
|
|
9928
10070
|
return result;
|
|
9929
10071
|
}, [inferredShowSeconds, safeSecondStep]);
|
|
9930
|
-
const resolvedHourValue =
|
|
10072
|
+
const resolvedHourValue = React59.useMemo(() => {
|
|
9931
10073
|
if (!parsedValue) {
|
|
9932
10074
|
return use12Hours ? 12 : 0;
|
|
9933
10075
|
}
|
|
@@ -9935,7 +10077,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9935
10077
|
}, [parsedValue, use12Hours]);
|
|
9936
10078
|
const resolvedMinuteValue = (_c = parsedValue == null ? void 0 : parsedValue.minute) != null ? _c : 0;
|
|
9937
10079
|
const resolvedSecondValue = (_d = parsedValue == null ? void 0 : parsedValue.second) != null ? _d : 0;
|
|
9938
|
-
const handleHourSelect =
|
|
10080
|
+
const handleHourSelect = React59.useCallback(
|
|
9939
10081
|
(value) => {
|
|
9940
10082
|
if (use12Hours) {
|
|
9941
10083
|
const hour24 = convert12To24(value, meridiem);
|
|
@@ -9946,19 +10088,19 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9946
10088
|
},
|
|
9947
10089
|
[baseValue, commitValue, meridiem, use12Hours]
|
|
9948
10090
|
);
|
|
9949
|
-
const handleMinuteSelect =
|
|
10091
|
+
const handleMinuteSelect = React59.useCallback(
|
|
9950
10092
|
(value) => {
|
|
9951
10093
|
commitValue({ ...baseValue, minute: value });
|
|
9952
10094
|
},
|
|
9953
10095
|
[baseValue, commitValue]
|
|
9954
10096
|
);
|
|
9955
|
-
const handleSecondSelect =
|
|
10097
|
+
const handleSecondSelect = React59.useCallback(
|
|
9956
10098
|
(value) => {
|
|
9957
10099
|
commitValue({ ...baseValue, second: value });
|
|
9958
10100
|
},
|
|
9959
10101
|
[baseValue, commitValue]
|
|
9960
10102
|
);
|
|
9961
|
-
const handleMeridiemChange =
|
|
10103
|
+
const handleMeridiemChange = React59.useCallback(
|
|
9962
10104
|
(nextMeridiem) => {
|
|
9963
10105
|
setMeridiem(nextMeridiem);
|
|
9964
10106
|
const current = parsedValue != null ? parsedValue : baseValue;
|
|
@@ -9973,7 +10115,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
9973
10115
|
},
|
|
9974
10116
|
[baseValue, commitValue, parsedValue]
|
|
9975
10117
|
);
|
|
9976
|
-
const handleInputChange =
|
|
10118
|
+
const handleInputChange = React59.useCallback(
|
|
9977
10119
|
(event) => {
|
|
9978
10120
|
const nextValue = event.target.value;
|
|
9979
10121
|
setInputValue(nextValue);
|
|
@@ -10081,7 +10223,7 @@ var TimePicker = React58.forwardRef((props, ref) => {
|
|
|
10081
10223
|
]
|
|
10082
10224
|
}
|
|
10083
10225
|
);
|
|
10084
|
-
const periodWheelOptions =
|
|
10226
|
+
const periodWheelOptions = React59.useMemo(
|
|
10085
10227
|
() => [
|
|
10086
10228
|
{ label: "AM", value: "AM" },
|
|
10087
10229
|
{ label: "PM", value: "PM" }
|
|
@@ -10252,7 +10394,7 @@ function DataTable({
|
|
|
10252
10394
|
var _a2;
|
|
10253
10395
|
const rowModel = (_a2 = virtualizedRows == null ? void 0 : virtualizedRows.rows) != null ? _a2 : table.getRowModel().rows;
|
|
10254
10396
|
const dataIds = dndEnabled ? rowModel.map((row) => Number(row.id)) : [];
|
|
10255
|
-
const sortableId =
|
|
10397
|
+
const sortableId = React59.useId();
|
|
10256
10398
|
const sensors = useSensors(useSensor(MouseSensor, {}), useSensor(TouchSensor, {}), useSensor(KeyboardSensor, {}));
|
|
10257
10399
|
function handleDragEnd(event) {
|
|
10258
10400
|
const { active, over } = event;
|
|
@@ -10454,21 +10596,21 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
10454
10596
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
10455
10597
|
let defaultContexts = [];
|
|
10456
10598
|
function createContext32(rootComponentName, defaultContext) {
|
|
10457
|
-
const BaseContext =
|
|
10599
|
+
const BaseContext = React59.createContext(defaultContext);
|
|
10458
10600
|
const index2 = defaultContexts.length;
|
|
10459
10601
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
10460
10602
|
const Provider = (props) => {
|
|
10461
10603
|
var _a2;
|
|
10462
10604
|
const { scope, children, ...context } = props;
|
|
10463
10605
|
const Context = ((_a2 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a2[index2]) || BaseContext;
|
|
10464
|
-
const value =
|
|
10606
|
+
const value = React59.useMemo(() => context, Object.values(context));
|
|
10465
10607
|
return /* @__PURE__ */ jsx$1(Context.Provider, { value, children });
|
|
10466
10608
|
};
|
|
10467
10609
|
Provider.displayName = rootComponentName + "Provider";
|
|
10468
10610
|
function useContext22(consumerName, scope) {
|
|
10469
10611
|
var _a2;
|
|
10470
10612
|
const Context = ((_a2 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a2[index2]) || BaseContext;
|
|
10471
|
-
const context =
|
|
10613
|
+
const context = React59.useContext(Context);
|
|
10472
10614
|
if (context) return context;
|
|
10473
10615
|
if (defaultContext !== void 0) return defaultContext;
|
|
10474
10616
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -10477,11 +10619,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
10477
10619
|
}
|
|
10478
10620
|
const createScope = () => {
|
|
10479
10621
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
10480
|
-
return
|
|
10622
|
+
return React59.createContext(defaultContext);
|
|
10481
10623
|
});
|
|
10482
10624
|
return function useScope(scope) {
|
|
10483
10625
|
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
10484
|
-
return
|
|
10626
|
+
return React59.useMemo(
|
|
10485
10627
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
10486
10628
|
[scope, contexts]
|
|
10487
10629
|
);
|
|
@@ -10504,15 +10646,15 @@ function composeContextScopes(...scopes) {
|
|
|
10504
10646
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
10505
10647
|
return { ...nextScopes2, ...currentScope };
|
|
10506
10648
|
}, {});
|
|
10507
|
-
return
|
|
10649
|
+
return React59.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
10508
10650
|
};
|
|
10509
10651
|
};
|
|
10510
10652
|
createScope.scopeName = baseScope.scopeName;
|
|
10511
10653
|
return createScope;
|
|
10512
10654
|
}
|
|
10513
|
-
var useLayoutEffect22 = (globalThis == null ? void 0 : globalThis.document) ?
|
|
10655
|
+
var useLayoutEffect22 = (globalThis == null ? void 0 : globalThis.document) ? React59.useLayoutEffect : () => {
|
|
10514
10656
|
};
|
|
10515
|
-
var useInsertionEffect =
|
|
10657
|
+
var useInsertionEffect = React59[" useInsertionEffect ".trim().toString()] || useLayoutEffect22;
|
|
10516
10658
|
function useControllableState({
|
|
10517
10659
|
prop,
|
|
10518
10660
|
defaultProp,
|
|
@@ -10527,8 +10669,8 @@ function useControllableState({
|
|
|
10527
10669
|
const isControlled = prop !== void 0;
|
|
10528
10670
|
const value = isControlled ? prop : uncontrolledProp;
|
|
10529
10671
|
{
|
|
10530
|
-
const isControlledRef =
|
|
10531
|
-
|
|
10672
|
+
const isControlledRef = React59.useRef(prop !== void 0);
|
|
10673
|
+
React59.useEffect(() => {
|
|
10532
10674
|
const wasControlled = isControlledRef.current;
|
|
10533
10675
|
if (wasControlled !== isControlled) {
|
|
10534
10676
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -10540,7 +10682,7 @@ function useControllableState({
|
|
|
10540
10682
|
isControlledRef.current = isControlled;
|
|
10541
10683
|
}, [isControlled, caller]);
|
|
10542
10684
|
}
|
|
10543
|
-
const setValue =
|
|
10685
|
+
const setValue = React59.useCallback(
|
|
10544
10686
|
(nextValue) => {
|
|
10545
10687
|
var _a2;
|
|
10546
10688
|
if (isControlled) {
|
|
@@ -10560,13 +10702,13 @@ function useUncontrolledState({
|
|
|
10560
10702
|
defaultProp,
|
|
10561
10703
|
onChange
|
|
10562
10704
|
}) {
|
|
10563
|
-
const [value, setValue] =
|
|
10564
|
-
const prevValueRef =
|
|
10565
|
-
const onChangeRef =
|
|
10705
|
+
const [value, setValue] = React59.useState(defaultProp);
|
|
10706
|
+
const prevValueRef = React59.useRef(value);
|
|
10707
|
+
const onChangeRef = React59.useRef(onChange);
|
|
10566
10708
|
useInsertionEffect(() => {
|
|
10567
10709
|
onChangeRef.current = onChange;
|
|
10568
10710
|
}, [onChange]);
|
|
10569
|
-
|
|
10711
|
+
React59.useEffect(() => {
|
|
10570
10712
|
var _a2;
|
|
10571
10713
|
if (prevValueRef.current !== value) {
|
|
10572
10714
|
(_a2 = onChangeRef.current) == null ? void 0 : _a2.call(onChangeRef, value);
|
|
@@ -10599,7 +10741,7 @@ var NODES = [
|
|
|
10599
10741
|
];
|
|
10600
10742
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
10601
10743
|
const Slot3 = createSlot(`Primitive.${node}`);
|
|
10602
|
-
const Node2 =
|
|
10744
|
+
const Node2 = React59.forwardRef((props, forwardedRef) => {
|
|
10603
10745
|
const { asChild, ...primitiveProps } = props;
|
|
10604
10746
|
const Comp = asChild ? Slot3 : node;
|
|
10605
10747
|
if (typeof window !== "undefined") {
|
|
@@ -10622,14 +10764,14 @@ function createCollection(name) {
|
|
|
10622
10764
|
);
|
|
10623
10765
|
const CollectionProvider = (props) => {
|
|
10624
10766
|
const { scope, children } = props;
|
|
10625
|
-
const ref =
|
|
10626
|
-
const itemMap =
|
|
10767
|
+
const ref = React59__default.useRef(null);
|
|
10768
|
+
const itemMap = React59__default.useRef(/* @__PURE__ */ new Map()).current;
|
|
10627
10769
|
return /* @__PURE__ */ jsx$1(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
10628
10770
|
};
|
|
10629
10771
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
10630
10772
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
10631
10773
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
10632
|
-
const CollectionSlot =
|
|
10774
|
+
const CollectionSlot = React59__default.forwardRef(
|
|
10633
10775
|
(props, forwardedRef) => {
|
|
10634
10776
|
const { scope, children } = props;
|
|
10635
10777
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -10641,13 +10783,13 @@ function createCollection(name) {
|
|
|
10641
10783
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
10642
10784
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
10643
10785
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
10644
|
-
const CollectionItemSlot =
|
|
10786
|
+
const CollectionItemSlot = React59__default.forwardRef(
|
|
10645
10787
|
(props, forwardedRef) => {
|
|
10646
10788
|
const { scope, children, ...itemData } = props;
|
|
10647
|
-
const ref =
|
|
10789
|
+
const ref = React59__default.useRef(null);
|
|
10648
10790
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10649
10791
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
10650
|
-
|
|
10792
|
+
React59__default.useEffect(() => {
|
|
10651
10793
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
10652
10794
|
return () => void context.itemMap.delete(ref);
|
|
10653
10795
|
});
|
|
@@ -10657,7 +10799,7 @@ function createCollection(name) {
|
|
|
10657
10799
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
10658
10800
|
function useCollection3(scope) {
|
|
10659
10801
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
10660
|
-
const getItems =
|
|
10802
|
+
const getItems = React59__default.useCallback(() => {
|
|
10661
10803
|
const collectionNode = context.collectionRef.current;
|
|
10662
10804
|
if (!collectionNode) return [];
|
|
10663
10805
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -10675,24 +10817,24 @@ function createCollection(name) {
|
|
|
10675
10817
|
createCollectionScope3
|
|
10676
10818
|
];
|
|
10677
10819
|
}
|
|
10678
|
-
var DirectionContext =
|
|
10820
|
+
var DirectionContext = React59.createContext(void 0);
|
|
10679
10821
|
function useDirection(localDir) {
|
|
10680
|
-
const globalDir =
|
|
10822
|
+
const globalDir = React59.useContext(DirectionContext);
|
|
10681
10823
|
return localDir || globalDir || "ltr";
|
|
10682
10824
|
}
|
|
10683
10825
|
function useCallbackRef(callback) {
|
|
10684
|
-
const callbackRef =
|
|
10685
|
-
|
|
10826
|
+
const callbackRef = React59.useRef(callback);
|
|
10827
|
+
React59.useEffect(() => {
|
|
10686
10828
|
callbackRef.current = callback;
|
|
10687
10829
|
});
|
|
10688
|
-
return
|
|
10830
|
+
return React59.useMemo(() => (...args) => {
|
|
10689
10831
|
var _a2;
|
|
10690
10832
|
return (_a2 = callbackRef.current) == null ? void 0 : _a2.call(callbackRef, ...args);
|
|
10691
10833
|
}, []);
|
|
10692
10834
|
}
|
|
10693
10835
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
10694
10836
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
10695
|
-
|
|
10837
|
+
React59.useEffect(() => {
|
|
10696
10838
|
const handleKeyDown = (event) => {
|
|
10697
10839
|
if (event.key === "Escape") {
|
|
10698
10840
|
onEscapeKeyDown(event);
|
|
@@ -10707,12 +10849,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
10707
10849
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
10708
10850
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
10709
10851
|
var originalBodyPointerEvents;
|
|
10710
|
-
var DismissableLayerContext =
|
|
10852
|
+
var DismissableLayerContext = React59.createContext({
|
|
10711
10853
|
layers: /* @__PURE__ */ new Set(),
|
|
10712
10854
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
10713
10855
|
branches: /* @__PURE__ */ new Set()
|
|
10714
10856
|
});
|
|
10715
|
-
var DismissableLayer =
|
|
10857
|
+
var DismissableLayer = React59.forwardRef(
|
|
10716
10858
|
(props, forwardedRef) => {
|
|
10717
10859
|
var _a2;
|
|
10718
10860
|
const {
|
|
@@ -10724,10 +10866,10 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10724
10866
|
onDismiss,
|
|
10725
10867
|
...layerProps
|
|
10726
10868
|
} = props;
|
|
10727
|
-
const context =
|
|
10728
|
-
const [node, setNode] =
|
|
10869
|
+
const context = React59.useContext(DismissableLayerContext);
|
|
10870
|
+
const [node, setNode] = React59.useState(null);
|
|
10729
10871
|
const ownerDocument = (_a2 = node == null ? void 0 : node.ownerDocument) != null ? _a2 : globalThis == null ? void 0 : globalThis.document;
|
|
10730
|
-
const [, force] =
|
|
10872
|
+
const [, force] = React59.useState({});
|
|
10731
10873
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
10732
10874
|
const layers = Array.from(context.layers);
|
|
10733
10875
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -10760,7 +10902,7 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10760
10902
|
onDismiss();
|
|
10761
10903
|
}
|
|
10762
10904
|
}, ownerDocument);
|
|
10763
|
-
|
|
10905
|
+
React59.useEffect(() => {
|
|
10764
10906
|
if (!node) return;
|
|
10765
10907
|
if (disableOutsidePointerEvents) {
|
|
10766
10908
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -10777,7 +10919,7 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10777
10919
|
}
|
|
10778
10920
|
};
|
|
10779
10921
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
10780
|
-
|
|
10922
|
+
React59.useEffect(() => {
|
|
10781
10923
|
return () => {
|
|
10782
10924
|
if (!node) return;
|
|
10783
10925
|
context.layers.delete(node);
|
|
@@ -10785,7 +10927,7 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10785
10927
|
dispatchUpdate();
|
|
10786
10928
|
};
|
|
10787
10929
|
}, [node, context]);
|
|
10788
|
-
|
|
10930
|
+
React59.useEffect(() => {
|
|
10789
10931
|
const handleUpdate = () => force({});
|
|
10790
10932
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
10791
10933
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -10811,11 +10953,11 @@ var DismissableLayer = React58.forwardRef(
|
|
|
10811
10953
|
);
|
|
10812
10954
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
10813
10955
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
10814
|
-
var DismissableLayerBranch =
|
|
10815
|
-
const context =
|
|
10816
|
-
const ref =
|
|
10956
|
+
var DismissableLayerBranch = React59.forwardRef((props, forwardedRef) => {
|
|
10957
|
+
const context = React59.useContext(DismissableLayerContext);
|
|
10958
|
+
const ref = React59.useRef(null);
|
|
10817
10959
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10818
|
-
|
|
10960
|
+
React59.useEffect(() => {
|
|
10819
10961
|
const node = ref.current;
|
|
10820
10962
|
if (node) {
|
|
10821
10963
|
context.branches.add(node);
|
|
@@ -10829,10 +10971,10 @@ var DismissableLayerBranch = React58.forwardRef((props, forwardedRef) => {
|
|
|
10829
10971
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
10830
10972
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
10831
10973
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
10832
|
-
const isPointerInsideReactTreeRef =
|
|
10833
|
-
const handleClickRef =
|
|
10974
|
+
const isPointerInsideReactTreeRef = React59.useRef(false);
|
|
10975
|
+
const handleClickRef = React59.useRef(() => {
|
|
10834
10976
|
});
|
|
10835
|
-
|
|
10977
|
+
React59.useEffect(() => {
|
|
10836
10978
|
const handlePointerDown = (event) => {
|
|
10837
10979
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
10838
10980
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -10872,8 +11014,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis
|
|
|
10872
11014
|
}
|
|
10873
11015
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
10874
11016
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
10875
|
-
const isFocusInsideReactTreeRef =
|
|
10876
|
-
|
|
11017
|
+
const isFocusInsideReactTreeRef = React59.useRef(false);
|
|
11018
|
+
React59.useEffect(() => {
|
|
10877
11019
|
const handleFocus = (event) => {
|
|
10878
11020
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
10879
11021
|
const eventDetail = { originalEvent: event };
|
|
@@ -10906,7 +11048,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
10906
11048
|
}
|
|
10907
11049
|
var count = 0;
|
|
10908
11050
|
function useFocusGuards() {
|
|
10909
|
-
|
|
11051
|
+
React59.useEffect(() => {
|
|
10910
11052
|
var _a2, _b;
|
|
10911
11053
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
10912
11054
|
document.body.insertAdjacentElement("afterbegin", (_a2 = edgeGuards[0]) != null ? _a2 : createFocusGuard());
|
|
@@ -10934,7 +11076,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
|
10934
11076
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
10935
11077
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
10936
11078
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
10937
|
-
var FocusScope =
|
|
11079
|
+
var FocusScope = React59.forwardRef((props, forwardedRef) => {
|
|
10938
11080
|
const {
|
|
10939
11081
|
loop = false,
|
|
10940
11082
|
trapped = false,
|
|
@@ -10942,12 +11084,12 @@ var FocusScope = React58.forwardRef((props, forwardedRef) => {
|
|
|
10942
11084
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
10943
11085
|
...scopeProps
|
|
10944
11086
|
} = props;
|
|
10945
|
-
const [container, setContainer] =
|
|
11087
|
+
const [container, setContainer] = React59.useState(null);
|
|
10946
11088
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
10947
11089
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
10948
|
-
const lastFocusedElementRef =
|
|
11090
|
+
const lastFocusedElementRef = React59.useRef(null);
|
|
10949
11091
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
10950
|
-
const focusScope =
|
|
11092
|
+
const focusScope = React59.useRef({
|
|
10951
11093
|
paused: false,
|
|
10952
11094
|
pause() {
|
|
10953
11095
|
this.paused = true;
|
|
@@ -10956,7 +11098,7 @@ var FocusScope = React58.forwardRef((props, forwardedRef) => {
|
|
|
10956
11098
|
this.paused = false;
|
|
10957
11099
|
}
|
|
10958
11100
|
}).current;
|
|
10959
|
-
|
|
11101
|
+
React59.useEffect(() => {
|
|
10960
11102
|
if (trapped) {
|
|
10961
11103
|
let handleFocusIn2 = function(event) {
|
|
10962
11104
|
if (focusScope.paused || !container) return;
|
|
@@ -10991,7 +11133,7 @@ var FocusScope = React58.forwardRef((props, forwardedRef) => {
|
|
|
10991
11133
|
};
|
|
10992
11134
|
}
|
|
10993
11135
|
}, [trapped, container, focusScope.paused]);
|
|
10994
|
-
|
|
11136
|
+
React59.useEffect(() => {
|
|
10995
11137
|
if (container) {
|
|
10996
11138
|
focusScopesStack.add(focusScope);
|
|
10997
11139
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -11022,7 +11164,7 @@ var FocusScope = React58.forwardRef((props, forwardedRef) => {
|
|
|
11022
11164
|
};
|
|
11023
11165
|
}
|
|
11024
11166
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
11025
|
-
const handleKeyDown =
|
|
11167
|
+
const handleKeyDown = React59.useCallback(
|
|
11026
11168
|
(event) => {
|
|
11027
11169
|
if (!loop && !trapped) return;
|
|
11028
11170
|
if (focusScope.paused) return;
|
|
@@ -11130,10 +11272,10 @@ function arrayRemove(array, item) {
|
|
|
11130
11272
|
function removeLinks(items) {
|
|
11131
11273
|
return items.filter((item) => item.tagName !== "A");
|
|
11132
11274
|
}
|
|
11133
|
-
var useReactId =
|
|
11275
|
+
var useReactId = React59[" useId ".trim().toString()] || (() => void 0);
|
|
11134
11276
|
var count2 = 0;
|
|
11135
11277
|
function useId4(deterministicId) {
|
|
11136
|
-
const [id, setId] =
|
|
11278
|
+
const [id, setId] = React59.useState(useReactId());
|
|
11137
11279
|
useLayoutEffect22(() => {
|
|
11138
11280
|
setId((reactId) => reactId != null ? reactId : String(count2++));
|
|
11139
11281
|
}, [deterministicId]);
|
|
@@ -12808,7 +12950,7 @@ function roundByDPR(element, value) {
|
|
|
12808
12950
|
return Math.round(value * dpr) / dpr;
|
|
12809
12951
|
}
|
|
12810
12952
|
function useLatestRef(value) {
|
|
12811
|
-
const ref =
|
|
12953
|
+
const ref = React59.useRef(value);
|
|
12812
12954
|
index(() => {
|
|
12813
12955
|
ref.current = value;
|
|
12814
12956
|
});
|
|
@@ -12831,7 +12973,7 @@ function useFloating(options) {
|
|
|
12831
12973
|
whileElementsMounted,
|
|
12832
12974
|
open
|
|
12833
12975
|
} = options;
|
|
12834
|
-
const [data, setData] =
|
|
12976
|
+
const [data, setData] = React59.useState({
|
|
12835
12977
|
x: 0,
|
|
12836
12978
|
y: 0,
|
|
12837
12979
|
strategy,
|
|
@@ -12839,19 +12981,19 @@ function useFloating(options) {
|
|
|
12839
12981
|
middlewareData: {},
|
|
12840
12982
|
isPositioned: false
|
|
12841
12983
|
});
|
|
12842
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
12984
|
+
const [latestMiddleware, setLatestMiddleware] = React59.useState(middleware);
|
|
12843
12985
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
12844
12986
|
setLatestMiddleware(middleware);
|
|
12845
12987
|
}
|
|
12846
|
-
const [_reference, _setReference] =
|
|
12847
|
-
const [_floating, _setFloating] =
|
|
12848
|
-
const setReference =
|
|
12988
|
+
const [_reference, _setReference] = React59.useState(null);
|
|
12989
|
+
const [_floating, _setFloating] = React59.useState(null);
|
|
12990
|
+
const setReference = React59.useCallback((node) => {
|
|
12849
12991
|
if (node !== referenceRef.current) {
|
|
12850
12992
|
referenceRef.current = node;
|
|
12851
12993
|
_setReference(node);
|
|
12852
12994
|
}
|
|
12853
12995
|
}, []);
|
|
12854
|
-
const setFloating =
|
|
12996
|
+
const setFloating = React59.useCallback((node) => {
|
|
12855
12997
|
if (node !== floatingRef.current) {
|
|
12856
12998
|
floatingRef.current = node;
|
|
12857
12999
|
_setFloating(node);
|
|
@@ -12859,14 +13001,14 @@ function useFloating(options) {
|
|
|
12859
13001
|
}, []);
|
|
12860
13002
|
const referenceEl = externalReference || _reference;
|
|
12861
13003
|
const floatingEl = externalFloating || _floating;
|
|
12862
|
-
const referenceRef =
|
|
12863
|
-
const floatingRef =
|
|
12864
|
-
const dataRef =
|
|
13004
|
+
const referenceRef = React59.useRef(null);
|
|
13005
|
+
const floatingRef = React59.useRef(null);
|
|
13006
|
+
const dataRef = React59.useRef(data);
|
|
12865
13007
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
12866
13008
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
12867
13009
|
const platformRef = useLatestRef(platform2);
|
|
12868
13010
|
const openRef = useLatestRef(open);
|
|
12869
|
-
const update =
|
|
13011
|
+
const update = React59.useCallback(() => {
|
|
12870
13012
|
if (!referenceRef.current || !floatingRef.current) {
|
|
12871
13013
|
return;
|
|
12872
13014
|
}
|
|
@@ -12904,7 +13046,7 @@ function useFloating(options) {
|
|
|
12904
13046
|
}));
|
|
12905
13047
|
}
|
|
12906
13048
|
}, [open]);
|
|
12907
|
-
const isMountedRef =
|
|
13049
|
+
const isMountedRef = React59.useRef(false);
|
|
12908
13050
|
index(() => {
|
|
12909
13051
|
isMountedRef.current = true;
|
|
12910
13052
|
return () => {
|
|
@@ -12921,17 +13063,17 @@ function useFloating(options) {
|
|
|
12921
13063
|
update();
|
|
12922
13064
|
}
|
|
12923
13065
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
12924
|
-
const refs =
|
|
13066
|
+
const refs = React59.useMemo(() => ({
|
|
12925
13067
|
reference: referenceRef,
|
|
12926
13068
|
floating: floatingRef,
|
|
12927
13069
|
setReference,
|
|
12928
13070
|
setFloating
|
|
12929
13071
|
}), [setReference, setFloating]);
|
|
12930
|
-
const elements =
|
|
13072
|
+
const elements = React59.useMemo(() => ({
|
|
12931
13073
|
reference: referenceEl,
|
|
12932
13074
|
floating: floatingEl
|
|
12933
13075
|
}), [referenceEl, floatingEl]);
|
|
12934
|
-
const floatingStyles =
|
|
13076
|
+
const floatingStyles = React59.useMemo(() => {
|
|
12935
13077
|
const initialStyles = {
|
|
12936
13078
|
position: strategy,
|
|
12937
13079
|
left: 0,
|
|
@@ -12957,7 +13099,7 @@ function useFloating(options) {
|
|
|
12957
13099
|
top: y
|
|
12958
13100
|
};
|
|
12959
13101
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
12960
|
-
return
|
|
13102
|
+
return React59.useMemo(() => ({
|
|
12961
13103
|
...data,
|
|
12962
13104
|
update,
|
|
12963
13105
|
refs,
|
|
@@ -13025,7 +13167,7 @@ var arrow3 = (options, deps) => ({
|
|
|
13025
13167
|
options: [options, deps]
|
|
13026
13168
|
});
|
|
13027
13169
|
var NAME = "Arrow";
|
|
13028
|
-
var Arrow =
|
|
13170
|
+
var Arrow = React59.forwardRef((props, forwardedRef) => {
|
|
13029
13171
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
13030
13172
|
return /* @__PURE__ */ jsx$1(
|
|
13031
13173
|
Primitive.svg,
|
|
@@ -13043,7 +13185,7 @@ var Arrow = React58.forwardRef((props, forwardedRef) => {
|
|
|
13043
13185
|
Arrow.displayName = NAME;
|
|
13044
13186
|
var Root = Arrow;
|
|
13045
13187
|
function useSize(element) {
|
|
13046
|
-
const [size4, setSize] =
|
|
13188
|
+
const [size4, setSize] = React59.useState(void 0);
|
|
13047
13189
|
useLayoutEffect22(() => {
|
|
13048
13190
|
if (element) {
|
|
13049
13191
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -13080,14 +13222,14 @@ var POPPER_NAME = "Popper";
|
|
|
13080
13222
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
13081
13223
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
13082
13224
|
var ANCHOR_NAME = "PopperAnchor";
|
|
13083
|
-
var PopperAnchor =
|
|
13225
|
+
var PopperAnchor = React59.forwardRef(
|
|
13084
13226
|
(props, forwardedRef) => {
|
|
13085
13227
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
13086
13228
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
13087
|
-
const ref =
|
|
13229
|
+
const ref = React59.useRef(null);
|
|
13088
13230
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
13089
|
-
const anchorRef =
|
|
13090
|
-
|
|
13231
|
+
const anchorRef = React59.useRef(null);
|
|
13232
|
+
React59.useEffect(() => {
|
|
13091
13233
|
const previousAnchor = anchorRef.current;
|
|
13092
13234
|
anchorRef.current = (virtualRef == null ? void 0 : virtualRef.current) || ref.current;
|
|
13093
13235
|
if (previousAnchor !== anchorRef.current) {
|
|
@@ -13100,7 +13242,7 @@ var PopperAnchor = React58.forwardRef(
|
|
|
13100
13242
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
13101
13243
|
var CONTENT_NAME = "PopperContent";
|
|
13102
13244
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
13103
|
-
var PopperContent =
|
|
13245
|
+
var PopperContent = React59.forwardRef(
|
|
13104
13246
|
(props, forwardedRef) => {
|
|
13105
13247
|
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
13106
13248
|
const {
|
|
@@ -13120,9 +13262,9 @@ var PopperContent = React58.forwardRef(
|
|
|
13120
13262
|
...contentProps
|
|
13121
13263
|
} = props;
|
|
13122
13264
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
13123
|
-
const [content, setContent] =
|
|
13265
|
+
const [content, setContent] = React59.useState(null);
|
|
13124
13266
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
13125
|
-
const [arrow4, setArrow] =
|
|
13267
|
+
const [arrow4, setArrow] = React59.useState(null);
|
|
13126
13268
|
const arrowSize = useSize(arrow4);
|
|
13127
13269
|
const arrowWidth = (_a2 = arrowSize == null ? void 0 : arrowSize.width) != null ? _a2 : 0;
|
|
13128
13270
|
const arrowHeight = (_b = arrowSize == null ? void 0 : arrowSize.height) != null ? _b : 0;
|
|
@@ -13184,7 +13326,7 @@ var PopperContent = React58.forwardRef(
|
|
|
13184
13326
|
const arrowX = (_c = middlewareData.arrow) == null ? void 0 : _c.x;
|
|
13185
13327
|
const arrowY = (_d = middlewareData.arrow) == null ? void 0 : _d.y;
|
|
13186
13328
|
const cannotCenterArrow = ((_e = middlewareData.arrow) == null ? void 0 : _e.centerOffset) !== 0;
|
|
13187
|
-
const [contentZIndex, setContentZIndex] =
|
|
13329
|
+
const [contentZIndex, setContentZIndex] = React59.useState();
|
|
13188
13330
|
useLayoutEffect22(() => {
|
|
13189
13331
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
13190
13332
|
}, [content]);
|
|
@@ -13250,7 +13392,7 @@ var OPPOSITE_SIDE = {
|
|
|
13250
13392
|
bottom: "top",
|
|
13251
13393
|
left: "right"
|
|
13252
13394
|
};
|
|
13253
|
-
var PopperArrow =
|
|
13395
|
+
var PopperArrow = React59.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
13254
13396
|
const { __scopePopper, ...arrowProps } = props;
|
|
13255
13397
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
13256
13398
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -13341,17 +13483,17 @@ var Anchor = PopperAnchor;
|
|
|
13341
13483
|
var Content = PopperContent;
|
|
13342
13484
|
var Arrow2 = PopperArrow;
|
|
13343
13485
|
var PORTAL_NAME = "Portal";
|
|
13344
|
-
var Portal =
|
|
13486
|
+
var Portal = React59.forwardRef((props, forwardedRef) => {
|
|
13345
13487
|
var _a2;
|
|
13346
13488
|
const { container: containerProp, ...portalProps } = props;
|
|
13347
|
-
const [mounted, setMounted] =
|
|
13489
|
+
const [mounted, setMounted] = React59.useState(false);
|
|
13348
13490
|
useLayoutEffect22(() => setMounted(true), []);
|
|
13349
13491
|
const container = containerProp || mounted && ((_a2 = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a2.body);
|
|
13350
13492
|
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx$1(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
13351
13493
|
});
|
|
13352
13494
|
Portal.displayName = PORTAL_NAME;
|
|
13353
13495
|
function useStateMachine(initialState, machine) {
|
|
13354
|
-
return
|
|
13496
|
+
return React59.useReducer((state, event) => {
|
|
13355
13497
|
const nextState = machine[state][event];
|
|
13356
13498
|
return nextState != null ? nextState : state;
|
|
13357
13499
|
}, initialState);
|
|
@@ -13359,17 +13501,17 @@ function useStateMachine(initialState, machine) {
|
|
|
13359
13501
|
var Presence = (props) => {
|
|
13360
13502
|
const { present, children } = props;
|
|
13361
13503
|
const presence = usePresence(present);
|
|
13362
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
|
13504
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React59.Children.only(children);
|
|
13363
13505
|
const ref = useComposedRefs(presence.ref, getElementRef2(child));
|
|
13364
13506
|
const forceMount = typeof children === "function";
|
|
13365
|
-
return forceMount || presence.isPresent ?
|
|
13507
|
+
return forceMount || presence.isPresent ? React59.cloneElement(child, { ref }) : null;
|
|
13366
13508
|
};
|
|
13367
13509
|
Presence.displayName = "Presence";
|
|
13368
13510
|
function usePresence(present) {
|
|
13369
|
-
const [node, setNode] =
|
|
13370
|
-
const stylesRef =
|
|
13371
|
-
const prevPresentRef =
|
|
13372
|
-
const prevAnimationNameRef =
|
|
13511
|
+
const [node, setNode] = React59.useState();
|
|
13512
|
+
const stylesRef = React59.useRef(null);
|
|
13513
|
+
const prevPresentRef = React59.useRef(present);
|
|
13514
|
+
const prevAnimationNameRef = React59.useRef("none");
|
|
13373
13515
|
const initialState = present ? "mounted" : "unmounted";
|
|
13374
13516
|
const [state, send] = useStateMachine(initialState, {
|
|
13375
13517
|
mounted: {
|
|
@@ -13384,7 +13526,7 @@ function usePresence(present) {
|
|
|
13384
13526
|
MOUNT: "mounted"
|
|
13385
13527
|
}
|
|
13386
13528
|
});
|
|
13387
|
-
|
|
13529
|
+
React59.useEffect(() => {
|
|
13388
13530
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
13389
13531
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
13390
13532
|
}, [state]);
|
|
@@ -13451,7 +13593,7 @@ function usePresence(present) {
|
|
|
13451
13593
|
}, [node, send]);
|
|
13452
13594
|
return {
|
|
13453
13595
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
13454
|
-
ref:
|
|
13596
|
+
ref: React59.useCallback((node2) => {
|
|
13455
13597
|
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
13456
13598
|
setNode(node2);
|
|
13457
13599
|
}, [])
|
|
@@ -13483,13 +13625,13 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
13483
13625
|
[createCollectionScope]
|
|
13484
13626
|
);
|
|
13485
13627
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
13486
|
-
var RovingFocusGroup =
|
|
13628
|
+
var RovingFocusGroup = React59.forwardRef(
|
|
13487
13629
|
(props, forwardedRef) => {
|
|
13488
13630
|
return /* @__PURE__ */ jsx$1(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx$1(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx$1(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
13489
13631
|
}
|
|
13490
13632
|
);
|
|
13491
13633
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
13492
|
-
var RovingFocusGroupImpl =
|
|
13634
|
+
var RovingFocusGroupImpl = React59.forwardRef((props, forwardedRef) => {
|
|
13493
13635
|
const {
|
|
13494
13636
|
__scopeRovingFocusGroup,
|
|
13495
13637
|
orientation,
|
|
@@ -13502,7 +13644,7 @@ var RovingFocusGroupImpl = React58.forwardRef((props, forwardedRef) => {
|
|
|
13502
13644
|
preventScrollOnEntryFocus = false,
|
|
13503
13645
|
...groupProps
|
|
13504
13646
|
} = props;
|
|
13505
|
-
const ref =
|
|
13647
|
+
const ref = React59.useRef(null);
|
|
13506
13648
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
13507
13649
|
const direction = useDirection(dir);
|
|
13508
13650
|
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
@@ -13511,12 +13653,12 @@ var RovingFocusGroupImpl = React58.forwardRef((props, forwardedRef) => {
|
|
|
13511
13653
|
onChange: onCurrentTabStopIdChange,
|
|
13512
13654
|
caller: GROUP_NAME
|
|
13513
13655
|
});
|
|
13514
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
13656
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React59.useState(false);
|
|
13515
13657
|
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
13516
13658
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
13517
|
-
const isClickFocusRef =
|
|
13518
|
-
const [focusableItemsCount, setFocusableItemsCount] =
|
|
13519
|
-
|
|
13659
|
+
const isClickFocusRef = React59.useRef(false);
|
|
13660
|
+
const [focusableItemsCount, setFocusableItemsCount] = React59.useState(0);
|
|
13661
|
+
React59.useEffect(() => {
|
|
13520
13662
|
const node = ref.current;
|
|
13521
13663
|
if (node) {
|
|
13522
13664
|
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
@@ -13531,16 +13673,16 @@ var RovingFocusGroupImpl = React58.forwardRef((props, forwardedRef) => {
|
|
|
13531
13673
|
dir: direction,
|
|
13532
13674
|
loop,
|
|
13533
13675
|
currentTabStopId,
|
|
13534
|
-
onItemFocus:
|
|
13676
|
+
onItemFocus: React59.useCallback(
|
|
13535
13677
|
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
13536
13678
|
[setCurrentTabStopId]
|
|
13537
13679
|
),
|
|
13538
|
-
onItemShiftTab:
|
|
13539
|
-
onFocusableItemAdd:
|
|
13680
|
+
onItemShiftTab: React59.useCallback(() => setIsTabbingBackOut(true), []),
|
|
13681
|
+
onFocusableItemAdd: React59.useCallback(
|
|
13540
13682
|
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
13541
13683
|
[]
|
|
13542
13684
|
),
|
|
13543
|
-
onFocusableItemRemove:
|
|
13685
|
+
onFocusableItemRemove: React59.useCallback(
|
|
13544
13686
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
13545
13687
|
[]
|
|
13546
13688
|
),
|
|
@@ -13580,7 +13722,7 @@ var RovingFocusGroupImpl = React58.forwardRef((props, forwardedRef) => {
|
|
|
13580
13722
|
);
|
|
13581
13723
|
});
|
|
13582
13724
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
13583
|
-
var RovingFocusGroupItem =
|
|
13725
|
+
var RovingFocusGroupItem = React59.forwardRef(
|
|
13584
13726
|
(props, forwardedRef) => {
|
|
13585
13727
|
const {
|
|
13586
13728
|
__scopeRovingFocusGroup,
|
|
@@ -13596,7 +13738,7 @@ var RovingFocusGroupItem = React58.forwardRef(
|
|
|
13596
13738
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
13597
13739
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
13598
13740
|
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
13599
|
-
|
|
13741
|
+
React59.useEffect(() => {
|
|
13600
13742
|
if (focusable) {
|
|
13601
13743
|
onFocusableItemAdd();
|
|
13602
13744
|
return () => onFocusableItemRemove();
|
|
@@ -13877,7 +14019,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
13877
14019
|
ref.callback = callback;
|
|
13878
14020
|
return ref.facade;
|
|
13879
14021
|
}
|
|
13880
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
14022
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React59.useLayoutEffect : React59.useEffect;
|
|
13881
14023
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
13882
14024
|
function useMergeRefs(refs, defaultValue) {
|
|
13883
14025
|
var callbackRef = useCallbackRef2(null, function(newValue) {
|
|
@@ -14001,7 +14143,7 @@ var SideCar = function(_a2) {
|
|
|
14001
14143
|
if (!Target) {
|
|
14002
14144
|
throw new Error("Sidecar medium not found");
|
|
14003
14145
|
}
|
|
14004
|
-
return
|
|
14146
|
+
return React59.createElement(Target, __assign({}, rest));
|
|
14005
14147
|
};
|
|
14006
14148
|
SideCar.isSideCarExport = true;
|
|
14007
14149
|
function exportSidecar(medium, exported) {
|
|
@@ -14016,9 +14158,9 @@ var effectCar = createSidecarMedium();
|
|
|
14016
14158
|
var nothing = function() {
|
|
14017
14159
|
return;
|
|
14018
14160
|
};
|
|
14019
|
-
var RemoveScroll =
|
|
14020
|
-
var ref =
|
|
14021
|
-
var _a2 =
|
|
14161
|
+
var RemoveScroll = React59.forwardRef(function(props, parentRef) {
|
|
14162
|
+
var ref = React59.useRef(null);
|
|
14163
|
+
var _a2 = React59.useState({
|
|
14022
14164
|
onScrollCapture: nothing,
|
|
14023
14165
|
onWheelCapture: nothing,
|
|
14024
14166
|
onTouchMoveCapture: nothing
|
|
@@ -14027,11 +14169,11 @@ var RemoveScroll = React58.forwardRef(function(props, parentRef) {
|
|
|
14027
14169
|
var SideCar2 = sideCar;
|
|
14028
14170
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
14029
14171
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
14030
|
-
return
|
|
14031
|
-
|
|
14172
|
+
return React59.createElement(
|
|
14173
|
+
React59.Fragment,
|
|
14032
14174
|
null,
|
|
14033
|
-
enabled &&
|
|
14034
|
-
forwardProps ?
|
|
14175
|
+
enabled && React59.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
14176
|
+
forwardProps ? React59.cloneElement(React59.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React59.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
14035
14177
|
);
|
|
14036
14178
|
});
|
|
14037
14179
|
RemoveScroll.defaultProps = {
|
|
@@ -14100,7 +14242,7 @@ var stylesheetSingleton = function() {
|
|
|
14100
14242
|
var styleHookSingleton = function() {
|
|
14101
14243
|
var sheet = stylesheetSingleton();
|
|
14102
14244
|
return function(styles, isDynamic) {
|
|
14103
|
-
|
|
14245
|
+
React59.useEffect(function() {
|
|
14104
14246
|
sheet.add(styles);
|
|
14105
14247
|
return function() {
|
|
14106
14248
|
sheet.remove();
|
|
@@ -14174,7 +14316,7 @@ var getCurrentUseCounter = function() {
|
|
|
14174
14316
|
return isFinite(counter) ? counter : 0;
|
|
14175
14317
|
};
|
|
14176
14318
|
var useLockAttribute = function() {
|
|
14177
|
-
|
|
14319
|
+
React59.useEffect(function() {
|
|
14178
14320
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
14179
14321
|
return function() {
|
|
14180
14322
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -14189,10 +14331,10 @@ var useLockAttribute = function() {
|
|
|
14189
14331
|
var RemoveScrollBar = function(_a2) {
|
|
14190
14332
|
var noRelative = _a2.noRelative, noImportant = _a2.noImportant, _b = _a2.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
14191
14333
|
useLockAttribute();
|
|
14192
|
-
var gap =
|
|
14334
|
+
var gap = React59.useMemo(function() {
|
|
14193
14335
|
return getGapWidth(gapMode);
|
|
14194
14336
|
}, [gapMode]);
|
|
14195
|
-
return
|
|
14337
|
+
return React59.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
14196
14338
|
};
|
|
14197
14339
|
|
|
14198
14340
|
// node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
@@ -14333,16 +14475,16 @@ var generateStyle = function(id) {
|
|
|
14333
14475
|
var idCounter = 0;
|
|
14334
14476
|
var lockStack = [];
|
|
14335
14477
|
function RemoveScrollSideCar(props) {
|
|
14336
|
-
var shouldPreventQueue =
|
|
14337
|
-
var touchStartRef =
|
|
14338
|
-
var activeAxis =
|
|
14339
|
-
var id =
|
|
14340
|
-
var Style2 =
|
|
14341
|
-
var lastProps =
|
|
14342
|
-
|
|
14478
|
+
var shouldPreventQueue = React59.useRef([]);
|
|
14479
|
+
var touchStartRef = React59.useRef([0, 0]);
|
|
14480
|
+
var activeAxis = React59.useRef();
|
|
14481
|
+
var id = React59.useState(idCounter++)[0];
|
|
14482
|
+
var Style2 = React59.useState(styleSingleton)[0];
|
|
14483
|
+
var lastProps = React59.useRef(props);
|
|
14484
|
+
React59.useEffect(function() {
|
|
14343
14485
|
lastProps.current = props;
|
|
14344
14486
|
}, [props]);
|
|
14345
|
-
|
|
14487
|
+
React59.useEffect(function() {
|
|
14346
14488
|
if (props.inert) {
|
|
14347
14489
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
14348
14490
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef)).filter(Boolean);
|
|
@@ -14358,7 +14500,7 @@ function RemoveScrollSideCar(props) {
|
|
|
14358
14500
|
}
|
|
14359
14501
|
return;
|
|
14360
14502
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
14361
|
-
var shouldCancelEvent =
|
|
14503
|
+
var shouldCancelEvent = React59.useCallback(function(event, parent) {
|
|
14362
14504
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
14363
14505
|
return !lastProps.current.allowPinchZoom;
|
|
14364
14506
|
}
|
|
@@ -14394,7 +14536,7 @@ function RemoveScrollSideCar(props) {
|
|
|
14394
14536
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
14395
14537
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
14396
14538
|
}, []);
|
|
14397
|
-
var shouldPrevent =
|
|
14539
|
+
var shouldPrevent = React59.useCallback(function(_event) {
|
|
14398
14540
|
var event = _event;
|
|
14399
14541
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
14400
14542
|
return;
|
|
@@ -14421,7 +14563,7 @@ function RemoveScrollSideCar(props) {
|
|
|
14421
14563
|
}
|
|
14422
14564
|
}
|
|
14423
14565
|
}, []);
|
|
14424
|
-
var shouldCancel =
|
|
14566
|
+
var shouldCancel = React59.useCallback(function(name, delta, target, should) {
|
|
14425
14567
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
14426
14568
|
shouldPreventQueue.current.push(event);
|
|
14427
14569
|
setTimeout(function() {
|
|
@@ -14430,17 +14572,17 @@ function RemoveScrollSideCar(props) {
|
|
|
14430
14572
|
});
|
|
14431
14573
|
}, 1);
|
|
14432
14574
|
}, []);
|
|
14433
|
-
var scrollTouchStart =
|
|
14575
|
+
var scrollTouchStart = React59.useCallback(function(event) {
|
|
14434
14576
|
touchStartRef.current = getTouchXY(event);
|
|
14435
14577
|
activeAxis.current = void 0;
|
|
14436
14578
|
}, []);
|
|
14437
|
-
var scrollWheel =
|
|
14579
|
+
var scrollWheel = React59.useCallback(function(event) {
|
|
14438
14580
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
14439
14581
|
}, []);
|
|
14440
|
-
var scrollTouchMove =
|
|
14582
|
+
var scrollTouchMove = React59.useCallback(function(event) {
|
|
14441
14583
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
14442
14584
|
}, []);
|
|
14443
|
-
|
|
14585
|
+
React59.useEffect(function() {
|
|
14444
14586
|
lockStack.push(Style2);
|
|
14445
14587
|
props.setCallbacks({
|
|
14446
14588
|
onScrollCapture: scrollWheel,
|
|
@@ -14460,11 +14602,11 @@ function RemoveScrollSideCar(props) {
|
|
|
14460
14602
|
};
|
|
14461
14603
|
}, []);
|
|
14462
14604
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
14463
|
-
return
|
|
14464
|
-
|
|
14605
|
+
return React59.createElement(
|
|
14606
|
+
React59.Fragment,
|
|
14465
14607
|
null,
|
|
14466
|
-
inert ?
|
|
14467
|
-
removeScrollBar ?
|
|
14608
|
+
inert ? React59.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
14609
|
+
removeScrollBar ? React59.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
14468
14610
|
);
|
|
14469
14611
|
}
|
|
14470
14612
|
function getOutermostShadowParent(node) {
|
|
@@ -14483,8 +14625,8 @@ function getOutermostShadowParent(node) {
|
|
|
14483
14625
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
14484
14626
|
|
|
14485
14627
|
// node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
14486
|
-
var ReactRemoveScroll =
|
|
14487
|
-
return
|
|
14628
|
+
var ReactRemoveScroll = React59.forwardRef(function(props, ref) {
|
|
14629
|
+
return React59.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
14488
14630
|
});
|
|
14489
14631
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
14490
14632
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -14512,7 +14654,7 @@ var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
|
14512
14654
|
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
|
|
14513
14655
|
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
14514
14656
|
var ANCHOR_NAME2 = "MenuAnchor";
|
|
14515
|
-
var MenuAnchor =
|
|
14657
|
+
var MenuAnchor = React59.forwardRef(
|
|
14516
14658
|
(props, forwardedRef) => {
|
|
14517
14659
|
const { __scopeMenu, ...anchorProps } = props;
|
|
14518
14660
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -14526,7 +14668,7 @@ var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME2, {
|
|
|
14526
14668
|
});
|
|
14527
14669
|
var CONTENT_NAME2 = "MenuContent";
|
|
14528
14670
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
|
|
14529
|
-
var MenuContent =
|
|
14671
|
+
var MenuContent = React59.forwardRef(
|
|
14530
14672
|
(props, forwardedRef) => {
|
|
14531
14673
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
14532
14674
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -14535,12 +14677,12 @@ var MenuContent = React58.forwardRef(
|
|
|
14535
14677
|
return /* @__PURE__ */ jsx$1(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx$1(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx$1(Collection2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx$1(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx$1(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
14536
14678
|
}
|
|
14537
14679
|
);
|
|
14538
|
-
var MenuRootContentModal =
|
|
14680
|
+
var MenuRootContentModal = React59.forwardRef(
|
|
14539
14681
|
(props, forwardedRef) => {
|
|
14540
14682
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
14541
|
-
const ref =
|
|
14683
|
+
const ref = React59.useRef(null);
|
|
14542
14684
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14543
|
-
|
|
14685
|
+
React59.useEffect(() => {
|
|
14544
14686
|
const content = ref.current;
|
|
14545
14687
|
if (content) return hideOthers(content);
|
|
14546
14688
|
}, []);
|
|
@@ -14562,7 +14704,7 @@ var MenuRootContentModal = React58.forwardRef(
|
|
|
14562
14704
|
);
|
|
14563
14705
|
}
|
|
14564
14706
|
);
|
|
14565
|
-
var MenuRootContentNonModal =
|
|
14707
|
+
var MenuRootContentNonModal = React59.forwardRef((props, forwardedRef) => {
|
|
14566
14708
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
14567
14709
|
return /* @__PURE__ */ jsx$1(
|
|
14568
14710
|
MenuContentImpl,
|
|
@@ -14577,7 +14719,7 @@ var MenuRootContentNonModal = React58.forwardRef((props, forwardedRef) => {
|
|
|
14577
14719
|
);
|
|
14578
14720
|
});
|
|
14579
14721
|
var Slot2 = createSlot("MenuContent.ScrollLock");
|
|
14580
|
-
var MenuContentImpl =
|
|
14722
|
+
var MenuContentImpl = React59.forwardRef(
|
|
14581
14723
|
(props, forwardedRef) => {
|
|
14582
14724
|
const {
|
|
14583
14725
|
__scopeMenu,
|
|
@@ -14600,16 +14742,16 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14600
14742
|
const popperScope = usePopperScope(__scopeMenu);
|
|
14601
14743
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
14602
14744
|
const getItems = useCollection2(__scopeMenu);
|
|
14603
|
-
const [currentItemId, setCurrentItemId] =
|
|
14604
|
-
const contentRef =
|
|
14745
|
+
const [currentItemId, setCurrentItemId] = React59.useState(null);
|
|
14746
|
+
const contentRef = React59.useRef(null);
|
|
14605
14747
|
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
14606
|
-
const timerRef =
|
|
14607
|
-
const searchRef =
|
|
14608
|
-
const pointerGraceTimerRef =
|
|
14609
|
-
const pointerGraceIntentRef =
|
|
14610
|
-
const pointerDirRef =
|
|
14611
|
-
const lastPointerXRef =
|
|
14612
|
-
const ScrollLockWrapper = disableOutsideScroll ? Combination_default :
|
|
14748
|
+
const timerRef = React59.useRef(0);
|
|
14749
|
+
const searchRef = React59.useRef("");
|
|
14750
|
+
const pointerGraceTimerRef = React59.useRef(0);
|
|
14751
|
+
const pointerGraceIntentRef = React59.useRef(null);
|
|
14752
|
+
const pointerDirRef = React59.useRef("right");
|
|
14753
|
+
const lastPointerXRef = React59.useRef(0);
|
|
14754
|
+
const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React59.Fragment;
|
|
14613
14755
|
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot2, allowPinchZoom: true } : void 0;
|
|
14614
14756
|
const handleTypeaheadSearch = (key) => {
|
|
14615
14757
|
var _a2, _b;
|
|
@@ -14629,11 +14771,11 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14629
14771
|
setTimeout(() => newItem.focus());
|
|
14630
14772
|
}
|
|
14631
14773
|
};
|
|
14632
|
-
|
|
14774
|
+
React59.useEffect(() => {
|
|
14633
14775
|
return () => window.clearTimeout(timerRef.current);
|
|
14634
14776
|
}, []);
|
|
14635
14777
|
useFocusGuards();
|
|
14636
|
-
const isPointerMovingToSubmenu =
|
|
14778
|
+
const isPointerMovingToSubmenu = React59.useCallback((event) => {
|
|
14637
14779
|
var _a2, _b;
|
|
14638
14780
|
const isMovingTowards = pointerDirRef.current === ((_a2 = pointerGraceIntentRef.current) == null ? void 0 : _a2.side);
|
|
14639
14781
|
return isMovingTowards && isPointerInGraceArea(event, (_b = pointerGraceIntentRef.current) == null ? void 0 : _b.area);
|
|
@@ -14643,13 +14785,13 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14643
14785
|
{
|
|
14644
14786
|
scope: __scopeMenu,
|
|
14645
14787
|
searchRef,
|
|
14646
|
-
onItemEnter:
|
|
14788
|
+
onItemEnter: React59.useCallback(
|
|
14647
14789
|
(event) => {
|
|
14648
14790
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
14649
14791
|
},
|
|
14650
14792
|
[isPointerMovingToSubmenu]
|
|
14651
14793
|
),
|
|
14652
|
-
onItemLeave:
|
|
14794
|
+
onItemLeave: React59.useCallback(
|
|
14653
14795
|
(event) => {
|
|
14654
14796
|
var _a2;
|
|
14655
14797
|
if (isPointerMovingToSubmenu(event)) return;
|
|
@@ -14658,14 +14800,14 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14658
14800
|
},
|
|
14659
14801
|
[isPointerMovingToSubmenu]
|
|
14660
14802
|
),
|
|
14661
|
-
onTriggerLeave:
|
|
14803
|
+
onTriggerLeave: React59.useCallback(
|
|
14662
14804
|
(event) => {
|
|
14663
14805
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
14664
14806
|
},
|
|
14665
14807
|
[isPointerMovingToSubmenu]
|
|
14666
14808
|
),
|
|
14667
14809
|
pointerGraceTimerRef,
|
|
14668
|
-
onPointerGraceIntentChange:
|
|
14810
|
+
onPointerGraceIntentChange: React59.useCallback((intent) => {
|
|
14669
14811
|
pointerGraceIntentRef.current = intent;
|
|
14670
14812
|
}, []),
|
|
14671
14813
|
children: /* @__PURE__ */ jsx$1(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx$1(
|
|
@@ -14765,7 +14907,7 @@ var MenuContentImpl = React58.forwardRef(
|
|
|
14765
14907
|
);
|
|
14766
14908
|
MenuContent.displayName = CONTENT_NAME2;
|
|
14767
14909
|
var GROUP_NAME2 = "MenuGroup";
|
|
14768
|
-
var MenuGroup =
|
|
14910
|
+
var MenuGroup = React59.forwardRef(
|
|
14769
14911
|
(props, forwardedRef) => {
|
|
14770
14912
|
const { __scopeMenu, ...groupProps } = props;
|
|
14771
14913
|
return /* @__PURE__ */ jsx$1(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
@@ -14773,7 +14915,7 @@ var MenuGroup = React58.forwardRef(
|
|
|
14773
14915
|
);
|
|
14774
14916
|
MenuGroup.displayName = GROUP_NAME2;
|
|
14775
14917
|
var LABEL_NAME = "MenuLabel";
|
|
14776
|
-
var MenuLabel =
|
|
14918
|
+
var MenuLabel = React59.forwardRef(
|
|
14777
14919
|
(props, forwardedRef) => {
|
|
14778
14920
|
const { __scopeMenu, ...labelProps } = props;
|
|
14779
14921
|
return /* @__PURE__ */ jsx$1(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
@@ -14782,14 +14924,14 @@ var MenuLabel = React58.forwardRef(
|
|
|
14782
14924
|
MenuLabel.displayName = LABEL_NAME;
|
|
14783
14925
|
var ITEM_NAME2 = "MenuItem";
|
|
14784
14926
|
var ITEM_SELECT = "menu.itemSelect";
|
|
14785
|
-
var MenuItem =
|
|
14927
|
+
var MenuItem = React59.forwardRef(
|
|
14786
14928
|
(props, forwardedRef) => {
|
|
14787
14929
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
14788
|
-
const ref =
|
|
14930
|
+
const ref = React59.useRef(null);
|
|
14789
14931
|
const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
|
|
14790
14932
|
const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
|
|
14791
14933
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14792
|
-
const isPointerDownRef =
|
|
14934
|
+
const isPointerDownRef = React59.useRef(false);
|
|
14793
14935
|
const handleSelect = () => {
|
|
14794
14936
|
const menuItem = ref.current;
|
|
14795
14937
|
if (!disabled && menuItem) {
|
|
@@ -14832,16 +14974,16 @@ var MenuItem = React58.forwardRef(
|
|
|
14832
14974
|
}
|
|
14833
14975
|
);
|
|
14834
14976
|
MenuItem.displayName = ITEM_NAME2;
|
|
14835
|
-
var MenuItemImpl =
|
|
14977
|
+
var MenuItemImpl = React59.forwardRef(
|
|
14836
14978
|
(props, forwardedRef) => {
|
|
14837
14979
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
14838
14980
|
const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
|
|
14839
14981
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
14840
|
-
const ref =
|
|
14982
|
+
const ref = React59.useRef(null);
|
|
14841
14983
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14842
|
-
const [isFocused, setIsFocused] =
|
|
14843
|
-
const [textContent, setTextContent] =
|
|
14844
|
-
|
|
14984
|
+
const [isFocused, setIsFocused] = React59.useState(false);
|
|
14985
|
+
const [textContent, setTextContent] = React59.useState("");
|
|
14986
|
+
React59.useEffect(() => {
|
|
14845
14987
|
var _a2;
|
|
14846
14988
|
const menuItem = ref.current;
|
|
14847
14989
|
if (menuItem) {
|
|
@@ -14890,7 +15032,7 @@ var MenuItemImpl = React58.forwardRef(
|
|
|
14890
15032
|
}
|
|
14891
15033
|
);
|
|
14892
15034
|
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
14893
|
-
var MenuCheckboxItem =
|
|
15035
|
+
var MenuCheckboxItem = React59.forwardRef(
|
|
14894
15036
|
(props, forwardedRef) => {
|
|
14895
15037
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
14896
15038
|
return /* @__PURE__ */ jsx$1(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx$1(
|
|
@@ -14917,7 +15059,7 @@ var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
|
14917
15059
|
{ value: void 0, onValueChange: () => {
|
|
14918
15060
|
} }
|
|
14919
15061
|
);
|
|
14920
|
-
var MenuRadioGroup =
|
|
15062
|
+
var MenuRadioGroup = React59.forwardRef(
|
|
14921
15063
|
(props, forwardedRef) => {
|
|
14922
15064
|
const { value, onValueChange, ...groupProps } = props;
|
|
14923
15065
|
const handleValueChange = useCallbackRef(onValueChange);
|
|
@@ -14926,7 +15068,7 @@ var MenuRadioGroup = React58.forwardRef(
|
|
|
14926
15068
|
);
|
|
14927
15069
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
14928
15070
|
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
14929
|
-
var MenuRadioItem =
|
|
15071
|
+
var MenuRadioItem = React59.forwardRef(
|
|
14930
15072
|
(props, forwardedRef) => {
|
|
14931
15073
|
const { value, ...radioItemProps } = props;
|
|
14932
15074
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
@@ -14957,7 +15099,7 @@ var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
|
|
|
14957
15099
|
ITEM_INDICATOR_NAME,
|
|
14958
15100
|
{ checked: false }
|
|
14959
15101
|
);
|
|
14960
|
-
var MenuItemIndicator =
|
|
15102
|
+
var MenuItemIndicator = React59.forwardRef(
|
|
14961
15103
|
(props, forwardedRef) => {
|
|
14962
15104
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
14963
15105
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
@@ -14979,7 +15121,7 @@ var MenuItemIndicator = React58.forwardRef(
|
|
|
14979
15121
|
);
|
|
14980
15122
|
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
14981
15123
|
var SEPARATOR_NAME = "MenuSeparator";
|
|
14982
|
-
var MenuSeparator =
|
|
15124
|
+
var MenuSeparator = React59.forwardRef(
|
|
14983
15125
|
(props, forwardedRef) => {
|
|
14984
15126
|
const { __scopeMenu, ...separatorProps } = props;
|
|
14985
15127
|
return /* @__PURE__ */ jsx$1(
|
|
@@ -14995,7 +15137,7 @@ var MenuSeparator = React58.forwardRef(
|
|
|
14995
15137
|
);
|
|
14996
15138
|
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
14997
15139
|
var ARROW_NAME2 = "MenuArrow";
|
|
14998
|
-
var MenuArrow =
|
|
15140
|
+
var MenuArrow = React59.forwardRef(
|
|
14999
15141
|
(props, forwardedRef) => {
|
|
15000
15142
|
const { __scopeMenu, ...arrowProps } = props;
|
|
15001
15143
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -15006,21 +15148,21 @@ MenuArrow.displayName = ARROW_NAME2;
|
|
|
15006
15148
|
var SUB_NAME = "MenuSub";
|
|
15007
15149
|
var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
|
|
15008
15150
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
15009
|
-
var MenuSubTrigger =
|
|
15151
|
+
var MenuSubTrigger = React59.forwardRef(
|
|
15010
15152
|
(props, forwardedRef) => {
|
|
15011
15153
|
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15012
15154
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15013
15155
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15014
15156
|
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
15015
|
-
const openTimerRef =
|
|
15157
|
+
const openTimerRef = React59.useRef(null);
|
|
15016
15158
|
const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
15017
15159
|
const scope = { __scopeMenu: props.__scopeMenu };
|
|
15018
|
-
const clearOpenTimer =
|
|
15160
|
+
const clearOpenTimer = React59.useCallback(() => {
|
|
15019
15161
|
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
15020
15162
|
openTimerRef.current = null;
|
|
15021
15163
|
}, []);
|
|
15022
|
-
|
|
15023
|
-
|
|
15164
|
+
React59.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
15165
|
+
React59.useEffect(() => {
|
|
15024
15166
|
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
15025
15167
|
return () => {
|
|
15026
15168
|
window.clearTimeout(pointerGraceTimer);
|
|
@@ -15110,14 +15252,14 @@ var MenuSubTrigger = React58.forwardRef(
|
|
|
15110
15252
|
);
|
|
15111
15253
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
15112
15254
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
15113
|
-
var MenuSubContent =
|
|
15255
|
+
var MenuSubContent = React59.forwardRef(
|
|
15114
15256
|
(props, forwardedRef) => {
|
|
15115
15257
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
15116
15258
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
15117
15259
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
15118
15260
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
15119
15261
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
15120
|
-
const ref =
|
|
15262
|
+
const ref = React59.useRef(null);
|
|
15121
15263
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
15122
15264
|
return /* @__PURE__ */ jsx$1(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx$1(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx$1(Collection2.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx$1(
|
|
15123
15265
|
MenuContentImpl,
|
|
@@ -15235,7 +15377,7 @@ var [createDropdownMenuContext] = createContextScope(
|
|
|
15235
15377
|
var useMenuScope = createMenuScope();
|
|
15236
15378
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
15237
15379
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
15238
|
-
var DropdownMenuTrigger2 =
|
|
15380
|
+
var DropdownMenuTrigger2 = React59.forwardRef(
|
|
15239
15381
|
(props, forwardedRef) => {
|
|
15240
15382
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
15241
15383
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
@@ -15271,12 +15413,12 @@ var DropdownMenuTrigger2 = React58.forwardRef(
|
|
|
15271
15413
|
);
|
|
15272
15414
|
DropdownMenuTrigger2.displayName = TRIGGER_NAME;
|
|
15273
15415
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
15274
|
-
var DropdownMenuContent2 =
|
|
15416
|
+
var DropdownMenuContent2 = React59.forwardRef(
|
|
15275
15417
|
(props, forwardedRef) => {
|
|
15276
15418
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
15277
15419
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
15278
15420
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15279
|
-
const hasInteractedOutsideRef =
|
|
15421
|
+
const hasInteractedOutsideRef = React59.useRef(false);
|
|
15280
15422
|
return /* @__PURE__ */ jsx$1(
|
|
15281
15423
|
Content2,
|
|
15282
15424
|
{
|
|
@@ -15314,7 +15456,7 @@ var DropdownMenuContent2 = React58.forwardRef(
|
|
|
15314
15456
|
);
|
|
15315
15457
|
DropdownMenuContent2.displayName = CONTENT_NAME3;
|
|
15316
15458
|
var GROUP_NAME3 = "DropdownMenuGroup";
|
|
15317
|
-
var DropdownMenuGroup2 =
|
|
15459
|
+
var DropdownMenuGroup2 = React59.forwardRef(
|
|
15318
15460
|
(props, forwardedRef) => {
|
|
15319
15461
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
15320
15462
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15323,7 +15465,7 @@ var DropdownMenuGroup2 = React58.forwardRef(
|
|
|
15323
15465
|
);
|
|
15324
15466
|
DropdownMenuGroup2.displayName = GROUP_NAME3;
|
|
15325
15467
|
var LABEL_NAME2 = "DropdownMenuLabel";
|
|
15326
|
-
var DropdownMenuLabel2 =
|
|
15468
|
+
var DropdownMenuLabel2 = React59.forwardRef(
|
|
15327
15469
|
(props, forwardedRef) => {
|
|
15328
15470
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
15329
15471
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15332,7 +15474,7 @@ var DropdownMenuLabel2 = React58.forwardRef(
|
|
|
15332
15474
|
);
|
|
15333
15475
|
DropdownMenuLabel2.displayName = LABEL_NAME2;
|
|
15334
15476
|
var ITEM_NAME3 = "DropdownMenuItem";
|
|
15335
|
-
var DropdownMenuItem2 =
|
|
15477
|
+
var DropdownMenuItem2 = React59.forwardRef(
|
|
15336
15478
|
(props, forwardedRef) => {
|
|
15337
15479
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
15338
15480
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15341,42 +15483,42 @@ var DropdownMenuItem2 = React58.forwardRef(
|
|
|
15341
15483
|
);
|
|
15342
15484
|
DropdownMenuItem2.displayName = ITEM_NAME3;
|
|
15343
15485
|
var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
15344
|
-
var DropdownMenuCheckboxItem2 =
|
|
15486
|
+
var DropdownMenuCheckboxItem2 = React59.forwardRef((props, forwardedRef) => {
|
|
15345
15487
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
15346
15488
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15347
15489
|
return /* @__PURE__ */ jsx$1(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
15348
15490
|
});
|
|
15349
15491
|
DropdownMenuCheckboxItem2.displayName = CHECKBOX_ITEM_NAME2;
|
|
15350
15492
|
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
15351
|
-
var DropdownMenuRadioGroup2 =
|
|
15493
|
+
var DropdownMenuRadioGroup2 = React59.forwardRef((props, forwardedRef) => {
|
|
15352
15494
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
15353
15495
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15354
15496
|
return /* @__PURE__ */ jsx$1(RadioGroup2, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
15355
15497
|
});
|
|
15356
15498
|
DropdownMenuRadioGroup2.displayName = RADIO_GROUP_NAME2;
|
|
15357
15499
|
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
15358
|
-
var DropdownMenuRadioItem2 =
|
|
15500
|
+
var DropdownMenuRadioItem2 = React59.forwardRef((props, forwardedRef) => {
|
|
15359
15501
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
15360
15502
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15361
15503
|
return /* @__PURE__ */ jsx$1(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
15362
15504
|
});
|
|
15363
15505
|
DropdownMenuRadioItem2.displayName = RADIO_ITEM_NAME2;
|
|
15364
15506
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
15365
|
-
var DropdownMenuItemIndicator =
|
|
15507
|
+
var DropdownMenuItemIndicator = React59.forwardRef((props, forwardedRef) => {
|
|
15366
15508
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
15367
15509
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15368
15510
|
return /* @__PURE__ */ jsx$1(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
15369
15511
|
});
|
|
15370
15512
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
15371
15513
|
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
15372
|
-
var DropdownMenuSeparator2 =
|
|
15514
|
+
var DropdownMenuSeparator2 = React59.forwardRef((props, forwardedRef) => {
|
|
15373
15515
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
15374
15516
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15375
15517
|
return /* @__PURE__ */ jsx$1(Separator2, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
15376
15518
|
});
|
|
15377
15519
|
DropdownMenuSeparator2.displayName = SEPARATOR_NAME2;
|
|
15378
15520
|
var ARROW_NAME3 = "DropdownMenuArrow";
|
|
15379
|
-
var DropdownMenuArrow =
|
|
15521
|
+
var DropdownMenuArrow = React59.forwardRef(
|
|
15380
15522
|
(props, forwardedRef) => {
|
|
15381
15523
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
15382
15524
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -15385,14 +15527,14 @@ var DropdownMenuArrow = React58.forwardRef(
|
|
|
15385
15527
|
);
|
|
15386
15528
|
DropdownMenuArrow.displayName = ARROW_NAME3;
|
|
15387
15529
|
var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
|
|
15388
|
-
var DropdownMenuSubTrigger2 =
|
|
15530
|
+
var DropdownMenuSubTrigger2 = React59.forwardRef((props, forwardedRef) => {
|
|
15389
15531
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
15390
15532
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15391
15533
|
return /* @__PURE__ */ jsx$1(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
15392
15534
|
});
|
|
15393
15535
|
DropdownMenuSubTrigger2.displayName = SUB_TRIGGER_NAME2;
|
|
15394
15536
|
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
15395
|
-
var DropdownMenuSubContent2 =
|
|
15537
|
+
var DropdownMenuSubContent2 = React59.forwardRef((props, forwardedRef) => {
|
|
15396
15538
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
15397
15539
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
15398
15540
|
return /* @__PURE__ */ jsx$1(
|
|
@@ -15618,27 +15760,27 @@ function DataGrid({
|
|
|
15618
15760
|
loading: loadingProp
|
|
15619
15761
|
}) {
|
|
15620
15762
|
var _a2, _b, _c;
|
|
15621
|
-
const normalizedRead =
|
|
15622
|
-
const initialBind =
|
|
15763
|
+
const normalizedRead = React59.useMemo(() => normalizeReadConfig(data.read), [data.read]);
|
|
15764
|
+
const initialBind = React59.useMemo(() => {
|
|
15623
15765
|
var _a3;
|
|
15624
15766
|
return (_a3 = data.bind) != null ? _a3 : [];
|
|
15625
15767
|
}, [data.bind]);
|
|
15626
15768
|
const resolvedPageSize = (_a2 = pageSize == null ? void 0 : pageSize.count) != null ? _a2 : defaultPageSize;
|
|
15627
15769
|
const pageSizeOptions = (_b = pageSize == null ? void 0 : pageSize.options) != null ? _b : [10, 20, 30, 40, 50];
|
|
15628
15770
|
const showPageSizeControl = (_c = pageSize == null ? void 0 : pageSize.visible) != null ? _c : true;
|
|
15629
|
-
const [rows, setRows] =
|
|
15630
|
-
const [isFetching, setIsFetching] =
|
|
15631
|
-
const [error, setError] =
|
|
15632
|
-
const scrollRef =
|
|
15633
|
-
const [scrollOffset, setScrollOffset] =
|
|
15634
|
-
const [viewportHeight, setViewportHeight] =
|
|
15635
|
-
const abortControllerRef =
|
|
15636
|
-
const [filterValue, setFilterValue] =
|
|
15637
|
-
const baseColumnDefs =
|
|
15771
|
+
const [rows, setRows] = React59.useState(() => initialBind);
|
|
15772
|
+
const [isFetching, setIsFetching] = React59.useState(false);
|
|
15773
|
+
const [error, setError] = React59.useState(null);
|
|
15774
|
+
const scrollRef = React59.useRef(null);
|
|
15775
|
+
const [scrollOffset, setScrollOffset] = React59.useState(0);
|
|
15776
|
+
const [viewportHeight, setViewportHeight] = React59.useState(height);
|
|
15777
|
+
const abortControllerRef = React59.useRef(null);
|
|
15778
|
+
const [filterValue, setFilterValue] = React59.useState("");
|
|
15779
|
+
const baseColumnDefs = React59.useMemo(
|
|
15638
15780
|
() => createColumnDefs(columns, sortable),
|
|
15639
15781
|
[columns, sortable]
|
|
15640
15782
|
);
|
|
15641
|
-
const columnDefs =
|
|
15783
|
+
const columnDefs = React59.useMemo(() => {
|
|
15642
15784
|
if (!selectable) {
|
|
15643
15785
|
return baseColumnDefs;
|
|
15644
15786
|
}
|
|
@@ -15672,8 +15814,8 @@ function DataGrid({
|
|
|
15672
15814
|
};
|
|
15673
15815
|
return [selectionColumn, ...baseColumnDefs];
|
|
15674
15816
|
}, [baseColumnDefs, selectable]);
|
|
15675
|
-
const filterableColumns =
|
|
15676
|
-
const filteredRows =
|
|
15817
|
+
const filterableColumns = React59.useMemo(() => columns.filter((column) => Boolean(column.item)), [columns]);
|
|
15818
|
+
const filteredRows = React59.useMemo(() => {
|
|
15677
15819
|
if (!filterable || !filterValue.trim()) {
|
|
15678
15820
|
return rows;
|
|
15679
15821
|
}
|
|
@@ -15695,26 +15837,26 @@ function DataGrid({
|
|
|
15695
15837
|
defaultPageSize: pagination ? resolvedPageSize : filteredRows.length || 10,
|
|
15696
15838
|
getRowId: (_row, index2) => index2.toString()
|
|
15697
15839
|
});
|
|
15698
|
-
|
|
15840
|
+
React59.useEffect(() => {
|
|
15699
15841
|
if (!pagination) {
|
|
15700
15842
|
table.setPageIndex(0);
|
|
15701
15843
|
table.setPageSize(filteredRows.length || 1);
|
|
15702
15844
|
}
|
|
15703
15845
|
}, [pagination, filteredRows.length, table]);
|
|
15704
|
-
|
|
15846
|
+
React59.useEffect(() => {
|
|
15705
15847
|
if (pagination) {
|
|
15706
15848
|
table.setPageSize(resolvedPageSize);
|
|
15707
15849
|
}
|
|
15708
15850
|
}, [pagination, resolvedPageSize, table]);
|
|
15709
|
-
|
|
15851
|
+
React59.useEffect(() => {
|
|
15710
15852
|
setRows(initialBind);
|
|
15711
15853
|
}, [initialBind]);
|
|
15712
|
-
|
|
15854
|
+
React59.useEffect(() => {
|
|
15713
15855
|
if (!filterable) {
|
|
15714
15856
|
setFilterValue("");
|
|
15715
15857
|
}
|
|
15716
15858
|
}, [filterable]);
|
|
15717
|
-
const fetchData =
|
|
15859
|
+
const fetchData = React59.useCallback(async () => {
|
|
15718
15860
|
var _a3, _b2;
|
|
15719
15861
|
if (!normalizedRead) {
|
|
15720
15862
|
return;
|
|
@@ -15760,7 +15902,7 @@ function DataGrid({
|
|
|
15760
15902
|
setIsFetching(false);
|
|
15761
15903
|
}
|
|
15762
15904
|
}, [normalizedRead, onDataChange]);
|
|
15763
|
-
|
|
15905
|
+
React59.useEffect(() => {
|
|
15764
15906
|
if (normalizedRead) {
|
|
15765
15907
|
fetchData().catch(() => {
|
|
15766
15908
|
});
|
|
@@ -15770,7 +15912,7 @@ function DataGrid({
|
|
|
15770
15912
|
(_a3 = abortControllerRef.current) == null ? void 0 : _a3.abort();
|
|
15771
15913
|
};
|
|
15772
15914
|
}, [normalizedRead, fetchData]);
|
|
15773
|
-
|
|
15915
|
+
React59.useEffect(() => {
|
|
15774
15916
|
if (!scrollRef.current) {
|
|
15775
15917
|
return;
|
|
15776
15918
|
}
|
|
@@ -15792,7 +15934,7 @@ function DataGrid({
|
|
|
15792
15934
|
const rowCount = tableRows.length;
|
|
15793
15935
|
const selectedCount = table.getFilteredSelectedRowModel().rows.length;
|
|
15794
15936
|
const totalFilteredCount = table.getFilteredRowModel().rows.length;
|
|
15795
|
-
|
|
15937
|
+
React59.useEffect(() => {
|
|
15796
15938
|
if (scrollRef.current) {
|
|
15797
15939
|
scrollRef.current.scrollTop = 0;
|
|
15798
15940
|
}
|
|
@@ -15804,7 +15946,7 @@ function DataGrid({
|
|
|
15804
15946
|
tableRows.length,
|
|
15805
15947
|
Math.ceil((scrollOffset + viewportHeight) / rowHeight) + overscan
|
|
15806
15948
|
);
|
|
15807
|
-
const virtualRows =
|
|
15949
|
+
const virtualRows = React59.useMemo(() => {
|
|
15808
15950
|
if (!tableRows.length) {
|
|
15809
15951
|
return null;
|
|
15810
15952
|
}
|
|
@@ -15887,7 +16029,7 @@ function DataGrid({
|
|
|
15887
16029
|
] });
|
|
15888
16030
|
}
|
|
15889
16031
|
DataGrid.displayName = "DataGrid";
|
|
15890
|
-
var FormBlock =
|
|
16032
|
+
var FormBlock = React59.forwardRef(
|
|
15891
16033
|
({ className, ...props }, ref) => {
|
|
15892
16034
|
return /* @__PURE__ */ jsx(
|
|
15893
16035
|
"div",
|
|
@@ -15900,7 +16042,7 @@ var FormBlock = React58.forwardRef(
|
|
|
15900
16042
|
}
|
|
15901
16043
|
);
|
|
15902
16044
|
FormBlock.displayName = "FormBlock";
|
|
15903
|
-
var FormError =
|
|
16045
|
+
var FormError = React59.forwardRef(
|
|
15904
16046
|
({ message, children, className, ...props }, ref) => {
|
|
15905
16047
|
if (!message && !children) {
|
|
15906
16048
|
return null;
|
|
@@ -15928,7 +16070,7 @@ var resolveFormLike2 = (form) => {
|
|
|
15928
16070
|
}
|
|
15929
16071
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
15930
16072
|
};
|
|
15931
|
-
var FormInput =
|
|
16073
|
+
var FormInput = React59.forwardRef(
|
|
15932
16074
|
({
|
|
15933
16075
|
label,
|
|
15934
16076
|
name,
|
|
@@ -16046,7 +16188,7 @@ var resolveFormLike3 = (form) => {
|
|
|
16046
16188
|
}
|
|
16047
16189
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16048
16190
|
};
|
|
16049
|
-
var FormInputMask =
|
|
16191
|
+
var FormInputMask = React59.forwardRef(
|
|
16050
16192
|
({
|
|
16051
16193
|
label,
|
|
16052
16194
|
name,
|
|
@@ -16161,7 +16303,7 @@ var resolveFormLike4 = (form) => {
|
|
|
16161
16303
|
}
|
|
16162
16304
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16163
16305
|
};
|
|
16164
|
-
var FormInputNumeric =
|
|
16306
|
+
var FormInputNumeric = React59.forwardRef(
|
|
16165
16307
|
({
|
|
16166
16308
|
label,
|
|
16167
16309
|
name,
|
|
@@ -16348,18 +16490,18 @@ function FormSelect({
|
|
|
16348
16490
|
title: multiContentPropTitle,
|
|
16349
16491
|
...restMultiContentProps
|
|
16350
16492
|
} = multiSelectContentProps;
|
|
16351
|
-
const [internalSingleValue, setInternalSingleValue] =
|
|
16493
|
+
const [internalSingleValue, setInternalSingleValue] = React59.useState(
|
|
16352
16494
|
typeof defaultValue === "string" ? defaultValue : ""
|
|
16353
16495
|
);
|
|
16354
|
-
const [internalMultiValue, setInternalMultiValue] =
|
|
16496
|
+
const [internalMultiValue, setInternalMultiValue] = React59.useState(
|
|
16355
16497
|
Array.isArray(defaultValue) ? defaultValue : []
|
|
16356
16498
|
);
|
|
16357
|
-
|
|
16499
|
+
React59.useEffect(() => {
|
|
16358
16500
|
if (typeof defaultValue === "string" && selectPropValue === void 0 && formValue === void 0 && value === void 0) {
|
|
16359
16501
|
setInternalSingleValue(defaultValue);
|
|
16360
16502
|
}
|
|
16361
16503
|
}, [defaultValue, formValue, selectPropValue, value]);
|
|
16362
|
-
|
|
16504
|
+
React59.useEffect(() => {
|
|
16363
16505
|
if (Array.isArray(defaultValue) && multiSelectPropValue === void 0 && !Array.isArray(formValue) && !Array.isArray(value)) {
|
|
16364
16506
|
setInternalMultiValue(defaultValue);
|
|
16365
16507
|
}
|
|
@@ -16367,7 +16509,7 @@ function FormSelect({
|
|
|
16367
16509
|
const finalSingleValue = typeof selectPropValue === "string" ? selectPropValue : typeof formValue === "string" ? formValue : typeof value === "string" ? value : internalSingleValue;
|
|
16368
16510
|
const finalMultiValue = Array.isArray(multiSelectPropValue) ? multiSelectPropValue : Array.isArray(formValue) ? formValue : Array.isArray(value) ? value : internalMultiValue;
|
|
16369
16511
|
const resolvedError = (_a2 = formTouched ? formError : void 0) != null ? _a2 : error;
|
|
16370
|
-
const handleFormChange =
|
|
16512
|
+
const handleFormChange = React59.useCallback(
|
|
16371
16513
|
(nextValue) => {
|
|
16372
16514
|
if (Array.isArray(nextValue)) {
|
|
16373
16515
|
formSetFieldValue == null ? void 0 : formSetFieldValue(name, nextValue);
|
|
@@ -16389,7 +16531,7 @@ function FormSelect({
|
|
|
16389
16531
|
},
|
|
16390
16532
|
[formHandleChange, formSetFieldValue, name]
|
|
16391
16533
|
);
|
|
16392
|
-
const handleSingleChange =
|
|
16534
|
+
const handleSingleChange = React59.useCallback(
|
|
16393
16535
|
(nextValue) => {
|
|
16394
16536
|
if (selectPropValue === void 0 && formValue === void 0 && value === void 0) {
|
|
16395
16537
|
setInternalSingleValue(nextValue);
|
|
@@ -16413,7 +16555,7 @@ function FormSelect({
|
|
|
16413
16555
|
name
|
|
16414
16556
|
]
|
|
16415
16557
|
);
|
|
16416
|
-
const handleMultiChange =
|
|
16558
|
+
const handleMultiChange = React59.useCallback(
|
|
16417
16559
|
(nextValue) => {
|
|
16418
16560
|
if (multiSelectPropValue === void 0 && !Array.isArray(formValue) && !Array.isArray(value)) {
|
|
16419
16561
|
setInternalMultiValue(nextValue);
|
|
@@ -16437,7 +16579,7 @@ function FormSelect({
|
|
|
16437
16579
|
name
|
|
16438
16580
|
]
|
|
16439
16581
|
);
|
|
16440
|
-
const handleBlur =
|
|
16582
|
+
const handleBlur = React59.useCallback(
|
|
16441
16583
|
(event) => {
|
|
16442
16584
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
16443
16585
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -16448,7 +16590,7 @@ function FormSelect({
|
|
|
16448
16590
|
},
|
|
16449
16591
|
[formHandleBlur, formSetFieldTouched, name, onBlur, triggerPropOnBlur]
|
|
16450
16592
|
);
|
|
16451
|
-
const handleMultiBlur =
|
|
16593
|
+
const handleMultiBlur = React59.useCallback(
|
|
16452
16594
|
(event) => {
|
|
16453
16595
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
16454
16596
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -16461,7 +16603,7 @@ function FormSelect({
|
|
|
16461
16603
|
);
|
|
16462
16604
|
const finalSingleDefaultValue = selectPropDefaultValue != null ? selectPropDefaultValue : typeof defaultValue === "string" ? defaultValue : void 0;
|
|
16463
16605
|
const finalMultiDefaultValue = multiSelectPropDefaultValue != null ? multiSelectPropDefaultValue : Array.isArray(defaultValue) ? defaultValue : void 0;
|
|
16464
|
-
const [mobileDrawerOpen, setMobileDrawerOpen] =
|
|
16606
|
+
const [mobileDrawerOpen, setMobileDrawerOpen] = React59.useState(false);
|
|
16465
16607
|
const MobileSelectTrigger = ({ isMulti: isMulti2 = false }) => {
|
|
16466
16608
|
var _a3;
|
|
16467
16609
|
const displayValue = isMulti2 ? finalMultiValue.length > 0 ? `${finalMultiValue.length} selected` : placeholder : ((_a3 = options.find((opt) => opt.value === finalSingleValue)) == null ? void 0 : _a3.label) || placeholder;
|
|
@@ -16625,7 +16767,7 @@ var resolveFormLike6 = (form) => {
|
|
|
16625
16767
|
}
|
|
16626
16768
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16627
16769
|
};
|
|
16628
|
-
var FormTextarea =
|
|
16770
|
+
var FormTextarea = React59.forwardRef(
|
|
16629
16771
|
({
|
|
16630
16772
|
label,
|
|
16631
16773
|
name,
|
|
@@ -16739,7 +16881,7 @@ var resolveFormLike7 = (form) => {
|
|
|
16739
16881
|
}
|
|
16740
16882
|
return (_a2 = form.form) != null ? _a2 : form;
|
|
16741
16883
|
};
|
|
16742
|
-
var FormRadioGroup =
|
|
16884
|
+
var FormRadioGroup = React59.forwardRef(
|
|
16743
16885
|
({
|
|
16744
16886
|
label,
|
|
16745
16887
|
description,
|
|
@@ -16778,7 +16920,7 @@ var FormRadioGroup = React58.forwardRef(
|
|
|
16778
16920
|
} = radioGroupProps;
|
|
16779
16921
|
const computedValue = (_b = value != null ? value : radioGroupValue !== void 0 ? radioGroupValue : void 0) != null ? _b : formValue !== void 0 && formValue !== null ? String(formValue) : void 0;
|
|
16780
16922
|
const resolvedDefaultValue = computedValue === void 0 ? defaultValue != null ? defaultValue : radioGroupDefaultValue : void 0;
|
|
16781
|
-
const handleChange =
|
|
16923
|
+
const handleChange = React59.useCallback(
|
|
16782
16924
|
(nextValue) => {
|
|
16783
16925
|
var _a3;
|
|
16784
16926
|
(_a3 = resolvedForm == null ? void 0 : resolvedForm.setFieldValue) == null ? void 0 : _a3.call(resolvedForm, name, nextValue);
|
|
@@ -16787,7 +16929,7 @@ var FormRadioGroup = React58.forwardRef(
|
|
|
16787
16929
|
},
|
|
16788
16930
|
[resolvedForm, name, onChange, radioGroupOnValueChange]
|
|
16789
16931
|
);
|
|
16790
|
-
const handleBlur =
|
|
16932
|
+
const handleBlur = React59.useCallback(
|
|
16791
16933
|
(event) => {
|
|
16792
16934
|
var _a3, _b2;
|
|
16793
16935
|
(_a3 = resolvedForm == null ? void 0 : resolvedForm.setFieldTouched) == null ? void 0 : _a3.call(resolvedForm, name, true);
|
|
@@ -16911,10 +17053,10 @@ function FormDatePicker({
|
|
|
16911
17053
|
status: datePickerPropStatus,
|
|
16912
17054
|
...restDatePickerProps
|
|
16913
17055
|
} = datePickerProps;
|
|
16914
|
-
const [internalValue, setInternalValue] =
|
|
17056
|
+
const [internalValue, setInternalValue] = React59.useState(
|
|
16915
17057
|
(_a2 = datePickerPropDefaultValue != null ? datePickerPropDefaultValue : defaultValue) != null ? _a2 : null
|
|
16916
17058
|
);
|
|
16917
|
-
|
|
17059
|
+
React59.useEffect(() => {
|
|
16918
17060
|
var _a3;
|
|
16919
17061
|
if (datePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
16920
17062
|
setInternalValue((_a3 = datePickerPropDefaultValue != null ? datePickerPropDefaultValue : defaultValue) != null ? _a3 : null);
|
|
@@ -16925,7 +17067,7 @@ function FormDatePicker({
|
|
|
16925
17067
|
const finalStatus = datePickerPropStatus != null ? datePickerPropStatus : resolvedError ? "error" : void 0;
|
|
16926
17068
|
const finalPlaceholder = datePickerPropPlaceholder != null ? datePickerPropPlaceholder : placeholder;
|
|
16927
17069
|
const { children: labelChildren, ...restLabelProps } = labelProps;
|
|
16928
|
-
const handleValueChange =
|
|
17070
|
+
const handleValueChange = React59.useCallback(
|
|
16929
17071
|
(nextValue, dateString) => {
|
|
16930
17072
|
if (datePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
16931
17073
|
setInternalValue(nextValue != null ? nextValue : null);
|
|
@@ -16957,7 +17099,7 @@ function FormDatePicker({
|
|
|
16957
17099
|
value
|
|
16958
17100
|
]
|
|
16959
17101
|
);
|
|
16960
|
-
const handleBlur =
|
|
17102
|
+
const handleBlur = React59.useCallback(
|
|
16961
17103
|
(event) => {
|
|
16962
17104
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
16963
17105
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -17066,10 +17208,10 @@ function FormTimePicker({
|
|
|
17066
17208
|
status: timePickerPropStatus,
|
|
17067
17209
|
...restTimePickerProps
|
|
17068
17210
|
} = timePickerProps;
|
|
17069
|
-
const [internalValue, setInternalValue] =
|
|
17211
|
+
const [internalValue, setInternalValue] = React59.useState(
|
|
17070
17212
|
(_a2 = timePickerPropDefaultValue != null ? timePickerPropDefaultValue : defaultValue) != null ? _a2 : null
|
|
17071
17213
|
);
|
|
17072
|
-
|
|
17214
|
+
React59.useEffect(() => {
|
|
17073
17215
|
var _a3;
|
|
17074
17216
|
if (timePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
17075
17217
|
setInternalValue((_a3 = timePickerPropDefaultValue != null ? timePickerPropDefaultValue : defaultValue) != null ? _a3 : null);
|
|
@@ -17080,7 +17222,7 @@ function FormTimePicker({
|
|
|
17080
17222
|
const finalStatus = timePickerPropStatus != null ? timePickerPropStatus : resolvedError ? "error" : void 0;
|
|
17081
17223
|
const finalPlaceholder = timePickerPropPlaceholder != null ? timePickerPropPlaceholder : placeholder;
|
|
17082
17224
|
const { children: labelChildren, ...restLabelProps } = labelProps;
|
|
17083
|
-
const handleValueChange =
|
|
17225
|
+
const handleValueChange = React59.useCallback(
|
|
17084
17226
|
(nextValue, formatted) => {
|
|
17085
17227
|
if (timePickerPropValue === void 0 && value === void 0 && formValue === void 0) {
|
|
17086
17228
|
setInternalValue(nextValue != null ? nextValue : null);
|
|
@@ -17112,7 +17254,7 @@ function FormTimePicker({
|
|
|
17112
17254
|
value
|
|
17113
17255
|
]
|
|
17114
17256
|
);
|
|
17115
|
-
const handleBlur =
|
|
17257
|
+
const handleBlur = React59.useCallback(
|
|
17116
17258
|
(event) => {
|
|
17117
17259
|
formSetFieldTouched == null ? void 0 : formSetFieldTouched(name, true);
|
|
17118
17260
|
formHandleBlur == null ? void 0 : formHandleBlur({
|
|
@@ -17188,10 +17330,12 @@ var FormSwitch = ({
|
|
|
17188
17330
|
rules
|
|
17189
17331
|
}) => {
|
|
17190
17332
|
var _a2;
|
|
17191
|
-
const fallbackId =
|
|
17333
|
+
const fallbackId = React59.useId();
|
|
17192
17334
|
const {
|
|
17193
17335
|
id: providedId,
|
|
17194
17336
|
onCheckedChange: switchOnCheckedChange,
|
|
17337
|
+
className: switchClassName,
|
|
17338
|
+
disabled: switchDisabled,
|
|
17195
17339
|
"aria-describedby": ariaDescribedBy,
|
|
17196
17340
|
"aria-labelledby": ariaLabelledBy,
|
|
17197
17341
|
...restSwitchProps
|
|
@@ -17210,6 +17354,27 @@ var FormSwitch = ({
|
|
|
17210
17354
|
const messageId = resolvedError ? `${switchId}-error` : void 0;
|
|
17211
17355
|
const combinedAriaDescribedBy = [ariaDescribedBy, descriptionId, messageId].filter(Boolean).join(" ").trim() || void 0;
|
|
17212
17356
|
const computedAriaLabelledBy = label ? [ariaLabelledBy, `${switchId}-label`].filter(Boolean).join(" ").trim() || void 0 : ariaLabelledBy;
|
|
17357
|
+
const handleLabelClick = React59.useCallback(
|
|
17358
|
+
(event) => {
|
|
17359
|
+
if (switchDisabled) {
|
|
17360
|
+
return;
|
|
17361
|
+
}
|
|
17362
|
+
const switchElement = document.getElementById(switchId);
|
|
17363
|
+
if (!switchElement) {
|
|
17364
|
+
return;
|
|
17365
|
+
}
|
|
17366
|
+
event.preventDefault();
|
|
17367
|
+
if (typeof switchElement.focus === "function") {
|
|
17368
|
+
try {
|
|
17369
|
+
switchElement.focus({ preventScroll: true });
|
|
17370
|
+
} catch {
|
|
17371
|
+
switchElement.focus();
|
|
17372
|
+
}
|
|
17373
|
+
}
|
|
17374
|
+
switchElement.click();
|
|
17375
|
+
},
|
|
17376
|
+
[switchDisabled, switchId]
|
|
17377
|
+
);
|
|
17213
17378
|
const handleCheckedChange = (nextState) => {
|
|
17214
17379
|
var _a3, _b, _c;
|
|
17215
17380
|
const validationError = rules ? validateSwitch(nextState, rules) : void 0;
|
|
@@ -17227,7 +17392,19 @@ var FormSwitch = ({
|
|
|
17227
17392
|
};
|
|
17228
17393
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-start justify-between gap-4", className), children: [
|
|
17229
17394
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
17230
|
-
label ? /* @__PURE__ */ jsx(
|
|
17395
|
+
label ? /* @__PURE__ */ jsx(
|
|
17396
|
+
FormLabel,
|
|
17397
|
+
{
|
|
17398
|
+
id: `${switchId}-label`,
|
|
17399
|
+
htmlFor: switchId,
|
|
17400
|
+
onClick: handleLabelClick,
|
|
17401
|
+
className: cn(
|
|
17402
|
+
"text-sm leading-none font-medium",
|
|
17403
|
+
switchDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
17404
|
+
),
|
|
17405
|
+
children: label
|
|
17406
|
+
}
|
|
17407
|
+
) : null,
|
|
17231
17408
|
description ? /* @__PURE__ */ jsx(FormDescription, { id: descriptionId, children: description }) : null,
|
|
17232
17409
|
/* @__PURE__ */ jsx(FormMessage, { id: messageId, children: resolvedError })
|
|
17233
17410
|
] }),
|
|
@@ -17239,6 +17416,8 @@ var FormSwitch = ({
|
|
|
17239
17416
|
"aria-invalid": Boolean(resolvedError),
|
|
17240
17417
|
"aria-describedby": combinedAriaDescribedBy,
|
|
17241
17418
|
"aria-labelledby": computedAriaLabelledBy,
|
|
17419
|
+
className: cn("cursor-pointer", switchClassName),
|
|
17420
|
+
disabled: switchDisabled,
|
|
17242
17421
|
...restSwitchProps,
|
|
17243
17422
|
...fieldChecked !== void 0 ? { checked: fieldChecked } : { defaultChecked },
|
|
17244
17423
|
onCheckedChange: handleCheckedChange
|
|
@@ -17272,6 +17451,6 @@ var SIDEBAR_COLLAPSIBLE_VALUES = ["offcanvas", "icon", "none"];
|
|
|
17272
17451
|
var CONTENT_LAYOUT_VALUES = ["centered", "full-width"];
|
|
17273
17452
|
var NAVBAR_STYLE_VALUES = ["sticky", "scroll"];
|
|
17274
17453
|
|
|
17275
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CONTENT_LAYOUT_VALUES, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataGrid, DataTable, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DraggableRow, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FIELD_HEIGHT_MOBILE_CLASS, Flex, Form, FormBlock, FormCheckbox, FormDatePicker, FormError, FormInput, FormInputMask, FormInputNumeric, FormRadioGroup, FormSelect, FormSwitch, FormTextarea, FormTimePicker, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputMask, InputNumeric, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileFooter, MobileHeader, MobileHeaderProvider, MobileLayout, MobileSelectDrawer, MultiSelect, MultiSelectContent, MultiSelectItem, MultiSelectTrigger, MultiSelectValue, NAVBAR_STYLE_VALUES, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RouterProvider, SIDEBAR_COLLAPSIBLE_VALUES, SIDEBAR_VARIANT_VALUES, SafeArea, ScrollArea, ScrollBar, Select, SelectContent, SelectItem, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, THEME_MODE_CHANGE_EVENT, THEME_MODE_STORAGE_KEY, THEME_MODE_VALUES, THEME_PRESET_OPTIONS, THEME_PRESET_VALUES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, TimePicker, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, createStore, dragColumn, formatCurrency, getInitials, getMonitor, getThemeMode, initializeMonitoring, isNullOrEmpty, isThemeMode, mobileFooterVariantMeta, mobileFooterVariants, mobileHeaderVariantMeta, mobileHeaderVariants, navigationMenuTriggerStyle, redirect, resolveThemeMode, setThemeMode, showError, showInfo, showSonner, showSuccess, showWarning, toBool, toggleVariants, updateContentLayout, updateNavbarStyle, updateThemeMode, updateThemePreset, useDataTableInstance, useForm, useIsMobile, useMobileHeader, useMonitor, useNavigate, usePathname, useSidebar, useStore, useTheme, useThemeExtras, withDndColumn };
|
|
17454
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CONTENT_LAYOUT_VALUES, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataGrid, DataTable, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DraggableRow, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FIELD_HEIGHT_MOBILE_CLASS, Flex, Form, FormBlock, FormCheckbox, FormDatePicker, FormError, FormInput, FormInputMask, FormInputNumeric, FormRadioGroup, FormSelect, FormSwitch, FormTextarea, FormTimePicker, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputMask, InputNumeric, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileFooter, MobileHeader, MobileHeaderProvider, MobileLayout, MobileSelectDrawer, MultiSelect, MultiSelectContent, MultiSelectItem, MultiSelectTrigger, MultiSelectValue, NAVBAR_STYLE_VALUES, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RouterProvider, SIDEBAR_COLLAPSIBLE_VALUES, SIDEBAR_VARIANT_VALUES, SafeArea, ScrollArea, ScrollBar, Select, SelectContent, SelectItem, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Switch, THEME_MODE_CHANGE_EVENT, THEME_MODE_STORAGE_KEY, THEME_MODE_VALUES, THEME_PRESET_OPTIONS, THEME_PRESET_VALUES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, TimePicker, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, __virtualKeyboardTesting, badgeVariants, buttonVariants, cn, createStore, detectVirtualKeyboardDevice, dragColumn, formatCurrency, getInitials, getMonitor, getThemeMode, initializeMonitoring, isNullOrEmpty, isThemeMode, maybeScrollElementIntoView, mobileFooterVariantMeta, mobileFooterVariants, mobileHeaderVariantMeta, mobileHeaderVariants, navigationMenuTriggerStyle, redirect, resolveThemeMode, setThemeMode, showError, showInfo, showSonner, showSuccess, showWarning, toBool, toggleVariants, updateContentLayout, updateNavbarStyle, updateThemeMode, updateThemePreset, useDataTableInstance, useForm, useIsMobile, useMobileHeader, useMonitor, useNavigate, usePathname, useSidebar, useStore, useTheme, useThemeExtras, withDndColumn };
|
|
17276
17455
|
//# sourceMappingURL=index.js.map
|
|
17277
17456
|
//# sourceMappingURL=index.js.map
|