@chekinapp/ui 0.0.23 → 0.0.25
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 +421 -162
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -1
- package/dist/index.d.ts +41 -1
- package/dist/index.js +364 -109
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -280,6 +280,7 @@ __export(index_exports, {
|
|
|
280
280
|
buttonVariants: () => buttonVariants,
|
|
281
281
|
calendarClassNames: () => calendarClassNames,
|
|
282
282
|
cn: () => cn,
|
|
283
|
+
copyToClipboard: () => copyToClipboard2,
|
|
283
284
|
emptyMediaVariants: () => emptyMediaVariants,
|
|
284
285
|
getSidebarState: () => getSidebarState,
|
|
285
286
|
inputVariants: () => inputVariants,
|
|
@@ -297,13 +298,16 @@ __export(index_exports, {
|
|
|
297
298
|
useClickEscape: () => useClickEscape,
|
|
298
299
|
useCombinedRef: () => useCombinedRef,
|
|
299
300
|
useDebounce: () => useDebounce,
|
|
301
|
+
useDebouncedFunction: () => useDebouncedFunction,
|
|
300
302
|
useEvent: () => useEvent,
|
|
301
303
|
useHover: () => useHover,
|
|
302
304
|
useIsMobile: () => useIsMobile,
|
|
303
305
|
useIsMounted: () => useIsMounted,
|
|
304
306
|
useModalControls: () => useModalControls,
|
|
305
307
|
useOutsideClick: () => useOutsideClick,
|
|
308
|
+
usePagination: () => usePagination,
|
|
306
309
|
usePrevious: () => usePrevious,
|
|
310
|
+
usePromisedModalControls: () => usePromisedModalControls,
|
|
307
311
|
useRadioOptions: () => useRadioOptions,
|
|
308
312
|
useScreenResize: () => useScreenResize,
|
|
309
313
|
useScrollFrameIntoView: () => useScrollFrameIntoView,
|
|
@@ -2367,29 +2371,42 @@ function useAbortController() {
|
|
|
2367
2371
|
}
|
|
2368
2372
|
|
|
2369
2373
|
// src/hooks/use-click-escape.ts
|
|
2374
|
+
var import_react11 = require("react");
|
|
2375
|
+
|
|
2376
|
+
// src/hooks/use-event.ts
|
|
2370
2377
|
var import_react10 = require("react");
|
|
2378
|
+
function useEvent(fn) {
|
|
2379
|
+
const fnRef = (0, import_react10.useRef)(fn);
|
|
2380
|
+
(0, import_react10.useLayoutEffect)(() => {
|
|
2381
|
+
fnRef.current = fn;
|
|
2382
|
+
}, [fn]);
|
|
2383
|
+
const eventCb = (0, import_react10.useCallback)(
|
|
2384
|
+
(...args) => {
|
|
2385
|
+
return fnRef.current?.apply(null, args);
|
|
2386
|
+
},
|
|
2387
|
+
[fnRef]
|
|
2388
|
+
);
|
|
2389
|
+
return eventCb;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
// src/hooks/use-click-escape.ts
|
|
2371
2393
|
function useClickEscape({ enabled = true, onClick }) {
|
|
2372
|
-
const
|
|
2373
|
-
(0,
|
|
2374
|
-
onClickRef.current = onClick;
|
|
2375
|
-
}, [onClick]);
|
|
2376
|
-
(0, import_react10.useEffect)(() => {
|
|
2394
|
+
const handler = useEvent(onClick);
|
|
2395
|
+
(0, import_react11.useEffect)(() => {
|
|
2377
2396
|
const handleKeyDown = (event) => {
|
|
2378
2397
|
if (event.key === "Escape" && enabled) {
|
|
2379
|
-
|
|
2398
|
+
handler();
|
|
2380
2399
|
}
|
|
2381
2400
|
};
|
|
2382
2401
|
window.addEventListener("keydown", handleKeyDown);
|
|
2383
|
-
return () =>
|
|
2384
|
-
|
|
2385
|
-
};
|
|
2386
|
-
}, [enabled]);
|
|
2402
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
2403
|
+
}, [handler, enabled]);
|
|
2387
2404
|
}
|
|
2388
2405
|
|
|
2389
2406
|
// src/hooks/use-combined-ref.ts
|
|
2390
|
-
var
|
|
2407
|
+
var import_react12 = require("react");
|
|
2391
2408
|
function useCombinedRef(...refs) {
|
|
2392
|
-
return (0,
|
|
2409
|
+
return (0, import_react12.useCallback)(
|
|
2393
2410
|
(node) => {
|
|
2394
2411
|
refs.forEach((ref) => {
|
|
2395
2412
|
if (!ref) return;
|
|
@@ -2405,22 +2422,6 @@ function useCombinedRef(...refs) {
|
|
|
2405
2422
|
);
|
|
2406
2423
|
}
|
|
2407
2424
|
|
|
2408
|
-
// src/hooks/use-event.ts
|
|
2409
|
-
var import_react12 = require("react");
|
|
2410
|
-
function useEvent(fn) {
|
|
2411
|
-
const fnRef = (0, import_react12.useRef)(fn);
|
|
2412
|
-
(0, import_react12.useLayoutEffect)(() => {
|
|
2413
|
-
fnRef.current = fn;
|
|
2414
|
-
}, [fn]);
|
|
2415
|
-
const eventCb = (0, import_react12.useCallback)(
|
|
2416
|
-
(...args) => {
|
|
2417
|
-
return fnRef.current?.apply(null, args);
|
|
2418
|
-
},
|
|
2419
|
-
[fnRef]
|
|
2420
|
-
);
|
|
2421
|
-
return eventCb;
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
2425
|
// src/hooks/use-is-mobile.ts
|
|
2425
2426
|
var import_react13 = require("react");
|
|
2426
2427
|
var MOBILE_BREAKPOINT = 768;
|
|
@@ -2617,22 +2618,224 @@ function useDebounce(value, delayMs = 1e3, handleChange) {
|
|
|
2617
2618
|
return [debouncedValue, setDebouncedValue];
|
|
2618
2619
|
}
|
|
2619
2620
|
|
|
2620
|
-
// src/hooks/use-
|
|
2621
|
+
// src/hooks/use-debounced-function.ts
|
|
2621
2622
|
var import_react20 = require("react");
|
|
2623
|
+
function useDebouncedFunction(callback, delay) {
|
|
2624
|
+
const timerRef = (0, import_react20.useRef)();
|
|
2625
|
+
const immediateCalling = (0, import_react20.useRef)(false);
|
|
2626
|
+
const callbackFn = useEvent(callback);
|
|
2627
|
+
const throttled = (0, import_react20.useCallback)(
|
|
2628
|
+
(...args) => {
|
|
2629
|
+
clearTimeout(timerRef.current);
|
|
2630
|
+
if (immediateCalling.current) {
|
|
2631
|
+
immediateCalling.current = false;
|
|
2632
|
+
callbackFn?.(...args);
|
|
2633
|
+
} else {
|
|
2634
|
+
timerRef.current = setTimeout(() => {
|
|
2635
|
+
immediateCalling.current = false;
|
|
2636
|
+
callbackFn?.(...args);
|
|
2637
|
+
}, delay);
|
|
2638
|
+
}
|
|
2639
|
+
},
|
|
2640
|
+
[callbackFn, delay]
|
|
2641
|
+
);
|
|
2642
|
+
const immediate = (0, import_react20.useCallback)(() => {
|
|
2643
|
+
immediateCalling.current = true;
|
|
2644
|
+
}, []);
|
|
2645
|
+
return { throttled, immediate };
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
// src/hooks/use-previous.ts
|
|
2649
|
+
var import_react21 = require("react");
|
|
2622
2650
|
function usePrevious(value, defaultValue) {
|
|
2623
|
-
const ref = (0,
|
|
2624
|
-
(0,
|
|
2651
|
+
const ref = (0, import_react21.useRef)(defaultValue);
|
|
2652
|
+
(0, import_react21.useEffect)(() => {
|
|
2625
2653
|
ref.current = isObject(value) ? { ...value } : value;
|
|
2626
2654
|
}, [value]);
|
|
2627
2655
|
return ref.current;
|
|
2628
2656
|
}
|
|
2629
2657
|
|
|
2658
|
+
// src/hooks/use-pagination.ts
|
|
2659
|
+
var import_react22 = require("react");
|
|
2660
|
+
|
|
2661
|
+
// src/storage/AbstractStorage.ts
|
|
2662
|
+
var AbstractStorage = class {
|
|
2663
|
+
static get(key) {
|
|
2664
|
+
if (!key) {
|
|
2665
|
+
throw new Error("The key is not valid");
|
|
2666
|
+
}
|
|
2667
|
+
return null;
|
|
2668
|
+
}
|
|
2669
|
+
static set(key, value) {
|
|
2670
|
+
if (!key) {
|
|
2671
|
+
throw new Error("The key is not valid");
|
|
2672
|
+
}
|
|
2673
|
+
if (!value) {
|
|
2674
|
+
throw new Error("The value not passed");
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
static remove(key) {
|
|
2678
|
+
if (!key) {
|
|
2679
|
+
throw new Error("The key is not valid");
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
static clear() {
|
|
2683
|
+
}
|
|
2684
|
+
};
|
|
2685
|
+
var AbstractStorage_default = AbstractStorage;
|
|
2686
|
+
|
|
2687
|
+
// src/storage/utils.ts
|
|
2688
|
+
function jsonParse(data) {
|
|
2689
|
+
try {
|
|
2690
|
+
if (data) {
|
|
2691
|
+
return JSON.parse(data);
|
|
2692
|
+
}
|
|
2693
|
+
return null;
|
|
2694
|
+
} catch {
|
|
2695
|
+
return data;
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
// src/storage/SessionStorage.ts
|
|
2700
|
+
var SessionStorage = class _SessionStorage extends AbstractStorage_default {
|
|
2701
|
+
static get(key) {
|
|
2702
|
+
const data = sessionStorage.getItem(key);
|
|
2703
|
+
return jsonParse(data);
|
|
2704
|
+
}
|
|
2705
|
+
static set(key, value) {
|
|
2706
|
+
if (value) {
|
|
2707
|
+
sessionStorage.setItem(key, JSON.stringify(value));
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
static update(key, field, value) {
|
|
2711
|
+
const data = _SessionStorage.get(key);
|
|
2712
|
+
if (data) {
|
|
2713
|
+
data[field] = value;
|
|
2714
|
+
_SessionStorage.set(key, data);
|
|
2715
|
+
} else {
|
|
2716
|
+
_SessionStorage.set(key, { [field]: value });
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
static remove(key) {
|
|
2720
|
+
sessionStorage.removeItem(key);
|
|
2721
|
+
}
|
|
2722
|
+
static clear() {
|
|
2723
|
+
sessionStorage.clear();
|
|
2724
|
+
}
|
|
2725
|
+
};
|
|
2726
|
+
|
|
2727
|
+
// src/hooks/use-pagination.ts
|
|
2728
|
+
var DEFAULT_PAGE_SIZE = 20;
|
|
2729
|
+
var DEFAULT_PAGE = 1;
|
|
2730
|
+
function usePagination(config) {
|
|
2731
|
+
const { key, defaultPageSize = DEFAULT_PAGE_SIZE, defaultPage = DEFAULT_PAGE } = config;
|
|
2732
|
+
const [state, setState] = (0, import_react22.useState)(() => {
|
|
2733
|
+
const stored = SessionStorage.get(`pagination-${key}`);
|
|
2734
|
+
if (stored) {
|
|
2735
|
+
return {
|
|
2736
|
+
page: stored.page || defaultPage,
|
|
2737
|
+
pageSize: stored.pageSize || defaultPageSize,
|
|
2738
|
+
totalItems: stored.totalItems || 0
|
|
2739
|
+
};
|
|
2740
|
+
}
|
|
2741
|
+
return {
|
|
2742
|
+
page: defaultPage,
|
|
2743
|
+
pageSize: defaultPageSize,
|
|
2744
|
+
totalItems: 0
|
|
2745
|
+
};
|
|
2746
|
+
});
|
|
2747
|
+
(0, import_react22.useEffect)(() => {
|
|
2748
|
+
SessionStorage.set(`pagination-${key}`, state);
|
|
2749
|
+
}, [key, state]);
|
|
2750
|
+
const pages = (0, import_react22.useMemo)(() => {
|
|
2751
|
+
return state.totalItems > 0 ? Math.ceil(state.totalItems / state.pageSize) : 0;
|
|
2752
|
+
}, [state.totalItems, state.pageSize]);
|
|
2753
|
+
const hasNextPage = (0, import_react22.useMemo)(() => state.page < pages, [state.page, pages]);
|
|
2754
|
+
const hasPreviousPage = (0, import_react22.useMemo)(() => state.page > 1, [state.page]);
|
|
2755
|
+
const startItem = (0, import_react22.useMemo)(() => {
|
|
2756
|
+
return state.totalItems === 0 ? 0 : (state.page - 1) * state.pageSize + 1;
|
|
2757
|
+
}, [state.page, state.pageSize, state.totalItems]);
|
|
2758
|
+
const endItem = (0, import_react22.useMemo)(() => {
|
|
2759
|
+
return Math.min(state.page * state.pageSize, state.totalItems);
|
|
2760
|
+
}, [state.page, state.pageSize, state.totalItems]);
|
|
2761
|
+
const isEmpty = (0, import_react22.useMemo)(() => state.totalItems === 0, [state.totalItems]);
|
|
2762
|
+
const setPage = (0, import_react22.useCallback)(
|
|
2763
|
+
(page) => {
|
|
2764
|
+
const clampedPage = Math.max(1, Math.min(page, pages || 1));
|
|
2765
|
+
setState((prev) => ({ ...prev, page: clampedPage }));
|
|
2766
|
+
},
|
|
2767
|
+
[pages]
|
|
2768
|
+
);
|
|
2769
|
+
const setPageSize = (0, import_react22.useCallback)((pageSize) => {
|
|
2770
|
+
const validPageSize = Math.max(1, pageSize);
|
|
2771
|
+
setState((prev) => {
|
|
2772
|
+
const currentFirstItem = (prev.page - 1) * prev.pageSize + 1;
|
|
2773
|
+
const newPage = Math.max(1, Math.ceil(currentFirstItem / validPageSize));
|
|
2774
|
+
return {
|
|
2775
|
+
...prev,
|
|
2776
|
+
pageSize: validPageSize,
|
|
2777
|
+
page: newPage
|
|
2778
|
+
};
|
|
2779
|
+
});
|
|
2780
|
+
}, []);
|
|
2781
|
+
const setTotalItems = (0, import_react22.useCallback)((totalItems) => {
|
|
2782
|
+
const validTotalItems = Math.max(0, totalItems);
|
|
2783
|
+
setState((prev) => {
|
|
2784
|
+
const newPages = validTotalItems > 0 ? Math.ceil(validTotalItems / prev.pageSize) : 0;
|
|
2785
|
+
const clampedPage = prev.page > newPages && newPages > 0 ? newPages : prev.page;
|
|
2786
|
+
return {
|
|
2787
|
+
...prev,
|
|
2788
|
+
totalItems: validTotalItems,
|
|
2789
|
+
page: clampedPage
|
|
2790
|
+
};
|
|
2791
|
+
});
|
|
2792
|
+
}, []);
|
|
2793
|
+
const nextPage = (0, import_react22.useCallback)(() => {
|
|
2794
|
+
setPage(state.page + 1);
|
|
2795
|
+
}, [setPage, state.page]);
|
|
2796
|
+
const previousPage = (0, import_react22.useCallback)(() => {
|
|
2797
|
+
setPage(state.page - 1);
|
|
2798
|
+
}, [setPage, state.page]);
|
|
2799
|
+
const goToFirstPage = (0, import_react22.useCallback)(() => {
|
|
2800
|
+
setPage(1);
|
|
2801
|
+
}, [setPage]);
|
|
2802
|
+
const goToLastPage = (0, import_react22.useCallback)(() => {
|
|
2803
|
+
setPage(pages);
|
|
2804
|
+
}, [setPage, pages]);
|
|
2805
|
+
const reset = (0, import_react22.useCallback)(() => {
|
|
2806
|
+
setState({
|
|
2807
|
+
page: defaultPage,
|
|
2808
|
+
pageSize: defaultPageSize,
|
|
2809
|
+
totalItems: 0
|
|
2810
|
+
});
|
|
2811
|
+
}, [defaultPage, defaultPageSize]);
|
|
2812
|
+
return {
|
|
2813
|
+
page: state.page,
|
|
2814
|
+
pageSize: state.pageSize,
|
|
2815
|
+
totalItems: state.totalItems,
|
|
2816
|
+
pages,
|
|
2817
|
+
setPage,
|
|
2818
|
+
setPageSize,
|
|
2819
|
+
setTotalItems,
|
|
2820
|
+
nextPage,
|
|
2821
|
+
previousPage,
|
|
2822
|
+
goToFirstPage,
|
|
2823
|
+
goToLastPage,
|
|
2824
|
+
reset,
|
|
2825
|
+
hasNextPage,
|
|
2826
|
+
hasPreviousPage,
|
|
2827
|
+
startItem,
|
|
2828
|
+
endItem,
|
|
2829
|
+
isEmpty
|
|
2830
|
+
};
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2630
2833
|
// src/hooks/use-timer.ts
|
|
2631
|
-
var
|
|
2834
|
+
var import_react23 = require("react");
|
|
2632
2835
|
var useTimer = ({ seconds }) => {
|
|
2633
|
-
const [timeLeft, setTimeLeft] = (0,
|
|
2634
|
-
const [isTimerRunning, setIsTimerRunning] = (0,
|
|
2635
|
-
(0,
|
|
2836
|
+
const [timeLeft, setTimeLeft] = (0, import_react23.useState)(seconds);
|
|
2837
|
+
const [isTimerRunning, setIsTimerRunning] = (0, import_react23.useState)(true);
|
|
2838
|
+
(0, import_react23.useEffect)(() => {
|
|
2636
2839
|
if (!isTimerRunning) return;
|
|
2637
2840
|
const timer = setInterval(() => {
|
|
2638
2841
|
setTimeLeft((prev) => {
|
|
@@ -2658,32 +2861,32 @@ var useTimer = ({ seconds }) => {
|
|
|
2658
2861
|
};
|
|
2659
2862
|
|
|
2660
2863
|
// src/hooks/use-timeout.ts
|
|
2661
|
-
var
|
|
2864
|
+
var import_react24 = require("react");
|
|
2662
2865
|
function useTimeout() {
|
|
2663
|
-
const timeoutRef = (0,
|
|
2664
|
-
const clearTimeoutRef = (0,
|
|
2866
|
+
const timeoutRef = (0, import_react24.useRef)();
|
|
2867
|
+
const clearTimeoutRef = (0, import_react24.useCallback)(() => {
|
|
2665
2868
|
clearTimeout(timeoutRef.current);
|
|
2666
2869
|
timeoutRef.current = void 0;
|
|
2667
2870
|
}, []);
|
|
2668
|
-
const scheduleTimeout = (0,
|
|
2871
|
+
const scheduleTimeout = (0, import_react24.useCallback)(
|
|
2669
2872
|
(callback, delay) => {
|
|
2670
2873
|
clearTimeoutRef();
|
|
2671
2874
|
timeoutRef.current = setTimeout(callback, delay);
|
|
2672
2875
|
},
|
|
2673
2876
|
[clearTimeoutRef]
|
|
2674
2877
|
);
|
|
2675
|
-
(0,
|
|
2878
|
+
(0, import_react24.useEffect)(() => clearTimeoutRef, [clearTimeoutRef]);
|
|
2676
2879
|
return { scheduleTimeout, clearTimeoutRef };
|
|
2677
2880
|
}
|
|
2678
2881
|
|
|
2679
2882
|
// src/hooks/use-hover.ts
|
|
2680
|
-
var
|
|
2883
|
+
var import_react25 = require("react");
|
|
2681
2884
|
function useHover() {
|
|
2682
|
-
const [isHovering, setIsHovering] = (0,
|
|
2683
|
-
const handleMouseEnter = (0,
|
|
2885
|
+
const [isHovering, setIsHovering] = (0, import_react25.useState)(false);
|
|
2886
|
+
const handleMouseEnter = (0, import_react25.useCallback)(() => {
|
|
2684
2887
|
setIsHovering(true);
|
|
2685
2888
|
}, []);
|
|
2686
|
-
const handleMouseLeave = (0,
|
|
2889
|
+
const handleMouseLeave = (0, import_react25.useCallback)(() => {
|
|
2687
2890
|
setIsHovering(false);
|
|
2688
2891
|
}, []);
|
|
2689
2892
|
return {
|
|
@@ -2693,6 +2896,25 @@ function useHover() {
|
|
|
2693
2896
|
};
|
|
2694
2897
|
}
|
|
2695
2898
|
|
|
2899
|
+
// src/hooks/use-promised-modal-controls.ts
|
|
2900
|
+
var import_react26 = require("react");
|
|
2901
|
+
var usePromisedModalControls = () => {
|
|
2902
|
+
const { closeModal, isOpen, openModal } = useModalControls();
|
|
2903
|
+
const resolveRef = (0, import_react26.useRef)();
|
|
2904
|
+
const openModalWithPromise = async () => {
|
|
2905
|
+
openModal();
|
|
2906
|
+
return new Promise((resolve) => {
|
|
2907
|
+
resolveRef.current = resolve;
|
|
2908
|
+
});
|
|
2909
|
+
};
|
|
2910
|
+
return {
|
|
2911
|
+
isOpen,
|
|
2912
|
+
openModal: openModalWithPromise,
|
|
2913
|
+
closeModal,
|
|
2914
|
+
resolveRef
|
|
2915
|
+
};
|
|
2916
|
+
};
|
|
2917
|
+
|
|
2696
2918
|
// src/dialog/Dialog.tsx
|
|
2697
2919
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2698
2920
|
function useIframeTitleFix(titleRef) {
|
|
@@ -2928,7 +3150,7 @@ function DownloadEntryFormsButton({
|
|
|
2928
3150
|
}
|
|
2929
3151
|
|
|
2930
3152
|
// src/dropdown-button/DropdownButton.tsx
|
|
2931
|
-
var
|
|
3153
|
+
var import_react27 = require("react");
|
|
2932
3154
|
|
|
2933
3155
|
// src/dropdown-menu/DropdownMenu.tsx
|
|
2934
3156
|
var React13 = __toESM(require("react"), 1);
|
|
@@ -2992,7 +3214,7 @@ function DropdownButton({
|
|
|
2992
3214
|
modal,
|
|
2993
3215
|
className
|
|
2994
3216
|
}) {
|
|
2995
|
-
const [isOpen, setIsOpen] = (0,
|
|
3217
|
+
const [isOpen, setIsOpen] = (0, import_react27.useState)(false);
|
|
2996
3218
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(DropdownMenu, { onOpenChange: setIsOpen, modal, children: [
|
|
2997
3219
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuTrigger, { asChild: true, children: typeof trigger === "function" ? trigger(isOpen) : trigger }),
|
|
2998
3220
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -3119,7 +3341,7 @@ var import_lucide_react12 = require("lucide-react");
|
|
|
3119
3341
|
var import_react_i18next7 = require("react-i18next");
|
|
3120
3342
|
|
|
3121
3343
|
// src/halo-icon/HaloIcon.tsx
|
|
3122
|
-
var
|
|
3344
|
+
var import_react28 = require("react");
|
|
3123
3345
|
|
|
3124
3346
|
// src/halo-icon/constants.ts
|
|
3125
3347
|
var HALO_ICON_STATUS = {
|
|
@@ -3149,7 +3371,7 @@ var statusStyles = {
|
|
|
3149
3371
|
color: "text-chekin-red"
|
|
3150
3372
|
}
|
|
3151
3373
|
};
|
|
3152
|
-
var HaloIcon = (0,
|
|
3374
|
+
var HaloIcon = (0, import_react28.forwardRef)(
|
|
3153
3375
|
({
|
|
3154
3376
|
children,
|
|
3155
3377
|
variant = "default",
|
|
@@ -3330,7 +3552,7 @@ var Switch = React15.forwardRef(
|
|
|
3330
3552
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
3331
3553
|
|
|
3332
3554
|
// src/video-player/VideoPlayer.tsx
|
|
3333
|
-
var
|
|
3555
|
+
var import_react29 = require("react");
|
|
3334
3556
|
var import_react_i18next8 = require("react-i18next");
|
|
3335
3557
|
var import_lucide_react13 = require("lucide-react");
|
|
3336
3558
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
@@ -3343,20 +3565,20 @@ function VideoPlayer({
|
|
|
3343
3565
|
autoPlay = false
|
|
3344
3566
|
}) {
|
|
3345
3567
|
const { t } = (0, import_react_i18next8.useTranslation)();
|
|
3346
|
-
const videoRef = (0,
|
|
3347
|
-
const iframeRef = (0,
|
|
3348
|
-
const containerRef = (0,
|
|
3349
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
3350
|
-
const [isMuted, setIsMuted] = (0,
|
|
3351
|
-
const [currentTime, setCurrentTime] = (0,
|
|
3352
|
-
const [duration, setDuration] = (0,
|
|
3353
|
-
const [isFullScreenMode, setIsFullScreenMode] = (0,
|
|
3354
|
-
const [isLoading, setIsLoading] = (0,
|
|
3355
|
-
const [videoSource, setVideoSource] = (0,
|
|
3356
|
-
const [youtubeEmbedUrl, setYoutubeEmbedUrl] = (0,
|
|
3357
|
-
const [vimeoEmbedUrl, setVimeoEmbedUrl] = (0,
|
|
3568
|
+
const videoRef = (0, import_react29.useRef)(null);
|
|
3569
|
+
const iframeRef = (0, import_react29.useRef)(null);
|
|
3570
|
+
const containerRef = (0, import_react29.useRef)(null);
|
|
3571
|
+
const [isPlaying, setIsPlaying] = (0, import_react29.useState)(false);
|
|
3572
|
+
const [isMuted, setIsMuted] = (0, import_react29.useState)(false);
|
|
3573
|
+
const [currentTime, setCurrentTime] = (0, import_react29.useState)(0);
|
|
3574
|
+
const [duration, setDuration] = (0, import_react29.useState)(0);
|
|
3575
|
+
const [isFullScreenMode, setIsFullScreenMode] = (0, import_react29.useState)(isFullScreen);
|
|
3576
|
+
const [isLoading, setIsLoading] = (0, import_react29.useState)(true);
|
|
3577
|
+
const [videoSource, setVideoSource] = (0, import_react29.useState)("file");
|
|
3578
|
+
const [youtubeEmbedUrl, setYoutubeEmbedUrl] = (0, import_react29.useState)("");
|
|
3579
|
+
const [vimeoEmbedUrl, setVimeoEmbedUrl] = (0, import_react29.useState)("");
|
|
3358
3580
|
useClickEscape({ enabled: isFullScreenMode, onClick: onClose });
|
|
3359
|
-
(0,
|
|
3581
|
+
(0, import_react29.useEffect)(() => {
|
|
3360
3582
|
const youtubeRegex = /(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/;
|
|
3361
3583
|
const vimeoRegex = /(?:vimeo\.com\/|vimeo\.com\/video\/)(\d+)/;
|
|
3362
3584
|
const youtubeMatch = src.match(youtubeRegex);
|
|
@@ -3385,7 +3607,7 @@ function VideoPlayer({
|
|
|
3385
3607
|
setYoutubeEmbedUrl("");
|
|
3386
3608
|
setVimeoEmbedUrl("");
|
|
3387
3609
|
}, [src, autoPlay]);
|
|
3388
|
-
(0,
|
|
3610
|
+
(0, import_react29.useEffect)(() => {
|
|
3389
3611
|
if (videoSource !== "file") return;
|
|
3390
3612
|
const video = videoRef.current;
|
|
3391
3613
|
if (!video) return;
|
|
@@ -3413,7 +3635,7 @@ function VideoPlayer({
|
|
|
3413
3635
|
video.removeEventListener("canplay", handleCanPlay);
|
|
3414
3636
|
};
|
|
3415
3637
|
}, [videoSource]);
|
|
3416
|
-
(0,
|
|
3638
|
+
(0, import_react29.useEffect)(() => {
|
|
3417
3639
|
if (isFullScreenMode && videoRef.current && videoSource === "file") {
|
|
3418
3640
|
void videoRef.current.play();
|
|
3419
3641
|
setIsPlaying(true);
|
|
@@ -3690,10 +3912,10 @@ function FeatureCard({
|
|
|
3690
3912
|
}
|
|
3691
3913
|
|
|
3692
3914
|
// src/file-input-button/FileInputButton.tsx
|
|
3693
|
-
var
|
|
3915
|
+
var import_react30 = require("react");
|
|
3694
3916
|
var import_lucide_react15 = require("lucide-react");
|
|
3695
3917
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3696
|
-
var FileInputButton = (0,
|
|
3918
|
+
var FileInputButton = (0, import_react30.forwardRef)(
|
|
3697
3919
|
({
|
|
3698
3920
|
label,
|
|
3699
3921
|
onChange,
|
|
@@ -3705,7 +3927,7 @@ var FileInputButton = (0, import_react27.forwardRef)(
|
|
|
3705
3927
|
size = "default",
|
|
3706
3928
|
...props
|
|
3707
3929
|
}, ref) => {
|
|
3708
|
-
const handleChange = (0,
|
|
3930
|
+
const handleChange = (0, import_react30.useCallback)(
|
|
3709
3931
|
(event) => {
|
|
3710
3932
|
onChange?.(event);
|
|
3711
3933
|
event.target.value = "";
|
|
@@ -3785,7 +4007,7 @@ var FormBox = {
|
|
|
3785
4007
|
};
|
|
3786
4008
|
|
|
3787
4009
|
// src/free-text-field/FreeTextField.tsx
|
|
3788
|
-
var
|
|
4010
|
+
var import_react31 = require("react");
|
|
3789
4011
|
var import_react_i18next10 = require("react-i18next");
|
|
3790
4012
|
|
|
3791
4013
|
// src/free-text-field/styles.module.css
|
|
@@ -3793,7 +4015,7 @@ var styles_default3 = {};
|
|
|
3793
4015
|
|
|
3794
4016
|
// src/free-text-field/FreeTextField.tsx
|
|
3795
4017
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3796
|
-
var FreeTextField = (0,
|
|
4018
|
+
var FreeTextField = (0, import_react31.forwardRef)(
|
|
3797
4019
|
({
|
|
3798
4020
|
label,
|
|
3799
4021
|
error,
|
|
@@ -3815,9 +4037,9 @@ var FreeTextField = (0, import_react28.forwardRef)(
|
|
|
3815
4037
|
...inputProps
|
|
3816
4038
|
}, ref) => {
|
|
3817
4039
|
const { t } = (0, import_react_i18next10.useTranslation)();
|
|
3818
|
-
const inputId = (0,
|
|
3819
|
-
const [internalValue, setInternalValue] = (0,
|
|
3820
|
-
const [isFocused, setIsFocused] = (0,
|
|
4040
|
+
const inputId = (0, import_react31.useId)();
|
|
4041
|
+
const [internalValue, setInternalValue] = (0, import_react31.useState)(defaultValue ?? "");
|
|
4042
|
+
const [isFocused, setIsFocused] = (0, import_react31.useState)(false);
|
|
3821
4043
|
const currentValue = value !== void 0 ? value : internalValue;
|
|
3822
4044
|
const isEmpty = !currentValue || String(currentValue).length === 0;
|
|
3823
4045
|
const hasError = Boolean(error);
|
|
@@ -3940,9 +4162,9 @@ var FramedIcon = React16.forwardRef(
|
|
|
3940
4162
|
FramedIcon.displayName = "FramedIcon";
|
|
3941
4163
|
|
|
3942
4164
|
// src/grid-items/GridItems.tsx
|
|
3943
|
-
var
|
|
4165
|
+
var import_react32 = require("react");
|
|
3944
4166
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3945
|
-
var GridItems = (0,
|
|
4167
|
+
var GridItems = (0, import_react32.forwardRef)(
|
|
3946
4168
|
({ children, title, placeholder, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
3947
4169
|
"div",
|
|
3948
4170
|
{
|
|
@@ -4019,9 +4241,9 @@ function HelpTooltip({
|
|
|
4019
4241
|
}
|
|
4020
4242
|
|
|
4021
4243
|
// src/icon/Icon.tsx
|
|
4022
|
-
var
|
|
4244
|
+
var import_react33 = require("react");
|
|
4023
4245
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4024
|
-
var MissingIcon = (0,
|
|
4246
|
+
var MissingIcon = (0, import_react33.forwardRef)(
|
|
4025
4247
|
({ size = 24, className = "", fallback = null, color, ...props }, ref) => {
|
|
4026
4248
|
if (fallback) {
|
|
4027
4249
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, { children: fallback });
|
|
@@ -4050,8 +4272,8 @@ var MissingIcon = (0, import_react30.forwardRef)(
|
|
|
4050
4272
|
}
|
|
4051
4273
|
);
|
|
4052
4274
|
MissingIcon.displayName = "MissingIcon";
|
|
4053
|
-
var Icon = (0,
|
|
4054
|
-
(0,
|
|
4275
|
+
var Icon = (0, import_react33.memo)(
|
|
4276
|
+
(0, import_react33.forwardRef)(
|
|
4055
4277
|
({ name: _name, size = 24, className = "", fallback = null, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4056
4278
|
MissingIcon,
|
|
4057
4279
|
{
|
|
@@ -4149,7 +4371,7 @@ function InfoBox({ className, children }) {
|
|
|
4149
4371
|
}
|
|
4150
4372
|
|
|
4151
4373
|
// src/image/Image.tsx
|
|
4152
|
-
var
|
|
4374
|
+
var import_react34 = require("react");
|
|
4153
4375
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4154
4376
|
function Image2({
|
|
4155
4377
|
src,
|
|
@@ -4158,7 +4380,7 @@ function Image2({
|
|
|
4158
4380
|
fallbackSrc = "https://placehold.co/600x400?text=Image",
|
|
4159
4381
|
...props
|
|
4160
4382
|
}) {
|
|
4161
|
-
const [error, setError] = (0,
|
|
4383
|
+
const [error, setError] = (0, import_react34.useState)(false);
|
|
4162
4384
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4163
4385
|
"img",
|
|
4164
4386
|
{
|
|
@@ -4202,10 +4424,10 @@ Input.displayName = "Input";
|
|
|
4202
4424
|
var React19 = __toESM(require("react"), 1);
|
|
4203
4425
|
|
|
4204
4426
|
// src/input-otp/InputOTPContext.ts
|
|
4205
|
-
var
|
|
4206
|
-
var InputOTPContext = (0,
|
|
4427
|
+
var import_react35 = require("react");
|
|
4428
|
+
var InputOTPContext = (0, import_react35.createContext)(null);
|
|
4207
4429
|
function useInputOTPContext() {
|
|
4208
|
-
const ctx = (0,
|
|
4430
|
+
const ctx = (0, import_react35.useContext)(InputOTPContext);
|
|
4209
4431
|
if (!ctx) {
|
|
4210
4432
|
throw new Error("InputOTP compound components must be used within <InputOTP>");
|
|
4211
4433
|
}
|
|
@@ -4217,7 +4439,7 @@ function extractDigits(str) {
|
|
|
4217
4439
|
}
|
|
4218
4440
|
|
|
4219
4441
|
// src/input-otp/useInputOTP.ts
|
|
4220
|
-
var
|
|
4442
|
+
var import_react36 = require("react");
|
|
4221
4443
|
function useInputOTP({
|
|
4222
4444
|
maxLength,
|
|
4223
4445
|
value,
|
|
@@ -4226,12 +4448,12 @@ function useInputOTP({
|
|
|
4226
4448
|
autoFocus,
|
|
4227
4449
|
error
|
|
4228
4450
|
}) {
|
|
4229
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
4230
|
-
const inputRefs = (0,
|
|
4231
|
-
const containerRef = (0,
|
|
4232
|
-
const blurTimeoutRef = (0,
|
|
4233
|
-
const slotsRef = (0,
|
|
4234
|
-
const slots = (0,
|
|
4451
|
+
const [activeIndex, setActiveIndex] = (0, import_react36.useState)(-1);
|
|
4452
|
+
const inputRefs = (0, import_react36.useRef)([]);
|
|
4453
|
+
const containerRef = (0, import_react36.useRef)(null);
|
|
4454
|
+
const blurTimeoutRef = (0, import_react36.useRef)();
|
|
4455
|
+
const slotsRef = (0, import_react36.useRef)(Array.from({ length: maxLength }, () => ""));
|
|
4456
|
+
const slots = (0, import_react36.useMemo)(() => {
|
|
4235
4457
|
const nextSlots = Array.from({ length: maxLength }, () => "");
|
|
4236
4458
|
for (let index = 0; index < Math.min(value.length, maxLength); index += 1) {
|
|
4237
4459
|
const char = value[index];
|
|
@@ -4242,7 +4464,7 @@ function useInputOTP({
|
|
|
4242
4464
|
return nextSlots;
|
|
4243
4465
|
}, [value, maxLength]);
|
|
4244
4466
|
slotsRef.current = slots;
|
|
4245
|
-
const emitValue = (0,
|
|
4467
|
+
const emitValue = (0, import_react36.useCallback)(
|
|
4246
4468
|
(newSlots) => {
|
|
4247
4469
|
let lastFilledIndex = -1;
|
|
4248
4470
|
for (let index = newSlots.length - 1; index >= 0; index -= 1) {
|
|
@@ -4263,12 +4485,12 @@ function useInputOTP({
|
|
|
4263
4485
|
},
|
|
4264
4486
|
[onChange]
|
|
4265
4487
|
);
|
|
4266
|
-
(0,
|
|
4488
|
+
(0, import_react36.useEffect)(() => {
|
|
4267
4489
|
if (autoFocus && inputRefs.current[0]) {
|
|
4268
4490
|
inputRefs.current[0].focus();
|
|
4269
4491
|
}
|
|
4270
4492
|
}, [autoFocus]);
|
|
4271
|
-
const handleContainerFocusIn = (0,
|
|
4493
|
+
const handleContainerFocusIn = (0, import_react36.useCallback)((event) => {
|
|
4272
4494
|
clearTimeout(blurTimeoutRef.current);
|
|
4273
4495
|
const target = event.target;
|
|
4274
4496
|
const slotIndex = inputRefs.current.indexOf(target);
|
|
@@ -4276,7 +4498,7 @@ function useInputOTP({
|
|
|
4276
4498
|
setActiveIndex(slotIndex);
|
|
4277
4499
|
}
|
|
4278
4500
|
}, []);
|
|
4279
|
-
const handleContainerFocusOut = (0,
|
|
4501
|
+
const handleContainerFocusOut = (0, import_react36.useCallback)(() => {
|
|
4280
4502
|
clearTimeout(blurTimeoutRef.current);
|
|
4281
4503
|
blurTimeoutRef.current = setTimeout(() => {
|
|
4282
4504
|
if (!containerRef.current?.contains(document.activeElement)) {
|
|
@@ -4284,8 +4506,8 @@ function useInputOTP({
|
|
|
4284
4506
|
}
|
|
4285
4507
|
}, 0);
|
|
4286
4508
|
}, []);
|
|
4287
|
-
(0,
|
|
4288
|
-
const handleDigitInput = (0,
|
|
4509
|
+
(0, import_react36.useEffect)(() => () => clearTimeout(blurTimeoutRef.current), []);
|
|
4510
|
+
const handleDigitInput = (0, import_react36.useCallback)(
|
|
4289
4511
|
(index, digit) => {
|
|
4290
4512
|
if (!DIGIT_REGEX.test(digit)) return;
|
|
4291
4513
|
const newSlots = [...slotsRef.current];
|
|
@@ -4299,7 +4521,7 @@ function useInputOTP({
|
|
|
4299
4521
|
},
|
|
4300
4522
|
[maxLength, emitValue]
|
|
4301
4523
|
);
|
|
4302
|
-
const handleDelete = (0,
|
|
4524
|
+
const handleDelete = (0, import_react36.useCallback)(
|
|
4303
4525
|
(index) => {
|
|
4304
4526
|
const newSlots = [...slotsRef.current];
|
|
4305
4527
|
if (newSlots[index]) {
|
|
@@ -4314,7 +4536,7 @@ function useInputOTP({
|
|
|
4314
4536
|
},
|
|
4315
4537
|
[emitValue]
|
|
4316
4538
|
);
|
|
4317
|
-
const handlePaste = (0,
|
|
4539
|
+
const handlePaste = (0, import_react36.useCallback)(
|
|
4318
4540
|
(text) => {
|
|
4319
4541
|
const digits = extractDigits(text).slice(0, maxLength);
|
|
4320
4542
|
if (digits.length > 0) {
|
|
@@ -4330,7 +4552,7 @@ function useInputOTP({
|
|
|
4330
4552
|
},
|
|
4331
4553
|
[maxLength, emitValue]
|
|
4332
4554
|
);
|
|
4333
|
-
const contextValue = (0,
|
|
4555
|
+
const contextValue = (0, import_react36.useMemo)(
|
|
4334
4556
|
() => ({
|
|
4335
4557
|
slots,
|
|
4336
4558
|
activeIndex,
|
|
@@ -4363,7 +4585,7 @@ function useInputOTP({
|
|
|
4363
4585
|
}
|
|
4364
4586
|
|
|
4365
4587
|
// src/input-otp/useInputOTPSlot.ts
|
|
4366
|
-
var
|
|
4588
|
+
var import_react37 = require("react");
|
|
4367
4589
|
function useInputOTPSlot(index) {
|
|
4368
4590
|
const {
|
|
4369
4591
|
slots,
|
|
@@ -4433,13 +4655,13 @@ function useInputOTPSlot(index) {
|
|
|
4433
4655
|
event.preventDefault();
|
|
4434
4656
|
handlePaste(event.clipboardData.getData("text/plain"));
|
|
4435
4657
|
};
|
|
4436
|
-
const setInputRef = (0,
|
|
4658
|
+
const setInputRef = (0, import_react37.useCallback)(
|
|
4437
4659
|
(element) => {
|
|
4438
4660
|
inputRefs.current[index] = element;
|
|
4439
4661
|
},
|
|
4440
4662
|
[index, inputRefs]
|
|
4441
4663
|
);
|
|
4442
|
-
const focusSlot = (0,
|
|
4664
|
+
const focusSlot = (0, import_react37.useCallback)(() => {
|
|
4443
4665
|
inputRefs.current[index]?.focus();
|
|
4444
4666
|
}, [index, inputRefs]);
|
|
4445
4667
|
return {
|
|
@@ -4541,7 +4763,7 @@ var InputOTPSeparator = React19.forwardRef(
|
|
|
4541
4763
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
4542
4764
|
|
|
4543
4765
|
// src/icons-dropdown/IconsDropdown.tsx
|
|
4544
|
-
var
|
|
4766
|
+
var import_react38 = require("react");
|
|
4545
4767
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4546
4768
|
function IconsDropdown({
|
|
4547
4769
|
icons,
|
|
@@ -4553,7 +4775,7 @@ function IconsDropdown({
|
|
|
4553
4775
|
defaultOpen,
|
|
4554
4776
|
onOpenChange: onOpenChangeProp
|
|
4555
4777
|
}) {
|
|
4556
|
-
const [open, setOpen] = (0,
|
|
4778
|
+
const [open, setOpen] = (0, import_react38.useState)(defaultOpen ?? false);
|
|
4557
4779
|
function handleOpenChange(value) {
|
|
4558
4780
|
setOpen(value);
|
|
4559
4781
|
onOpenChangeProp?.(value);
|
|
@@ -5136,9 +5358,9 @@ function LearnMoreButton({ label, ...props }) {
|
|
|
5136
5358
|
}
|
|
5137
5359
|
|
|
5138
5360
|
// src/link/Link.tsx
|
|
5139
|
-
var
|
|
5361
|
+
var import_react39 = require("react");
|
|
5140
5362
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5141
|
-
var LinkInternal = (0,
|
|
5363
|
+
var LinkInternal = (0, import_react39.forwardRef)(
|
|
5142
5364
|
({ disabled = false, className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5143
5365
|
"a",
|
|
5144
5366
|
{
|
|
@@ -5157,17 +5379,17 @@ var LinkInternal = (0, import_react36.forwardRef)(
|
|
|
5157
5379
|
)
|
|
5158
5380
|
);
|
|
5159
5381
|
LinkInternal.displayName = "Link";
|
|
5160
|
-
var Link = (0,
|
|
5382
|
+
var Link = (0, import_react39.memo)(LinkInternal);
|
|
5161
5383
|
|
|
5162
5384
|
// src/image-full-screen-view/ImageFullScreenView.tsx
|
|
5163
|
-
var
|
|
5385
|
+
var import_react40 = require("react");
|
|
5164
5386
|
var import_lucide_react20 = require("lucide-react");
|
|
5165
5387
|
var import_react_i18next13 = require("react-i18next");
|
|
5166
5388
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5167
5389
|
function ImageFullScreenView({ src, alt, onClose }) {
|
|
5168
5390
|
const { t } = (0, import_react_i18next13.useTranslation)();
|
|
5169
|
-
const [scale, setScale] = (0,
|
|
5170
|
-
const [rotation, setRotation] = (0,
|
|
5391
|
+
const [scale, setScale] = (0, import_react40.useState)(1);
|
|
5392
|
+
const [rotation, setRotation] = (0, import_react40.useState)(0);
|
|
5171
5393
|
useClickEscape({ onClick: onClose });
|
|
5172
5394
|
const zoomIn = () => setScale((value) => Math.min(value + 0.25, 3));
|
|
5173
5395
|
const zoomOut = () => setScale((value) => Math.max(value - 0.25, 0.5));
|
|
@@ -5365,7 +5587,7 @@ var METRIC_CARD_VARIANTS = {
|
|
|
5365
5587
|
};
|
|
5366
5588
|
|
|
5367
5589
|
// src/modal/Modal.tsx
|
|
5368
|
-
var
|
|
5590
|
+
var import_react41 = require("react");
|
|
5369
5591
|
var import_lucide_react23 = require("lucide-react");
|
|
5370
5592
|
|
|
5371
5593
|
// src/modal/styles.module.css
|
|
@@ -5396,7 +5618,7 @@ function Modal({
|
|
|
5396
5618
|
container,
|
|
5397
5619
|
modal
|
|
5398
5620
|
}) {
|
|
5399
|
-
const contentRef = (0,
|
|
5621
|
+
const contentRef = (0, import_react41.useRef)(null);
|
|
5400
5622
|
useScrollFrameIntoView(open, { elementRef: contentRef });
|
|
5401
5623
|
const handleClose = () => {
|
|
5402
5624
|
onOpenChange?.(false);
|
|
@@ -5438,7 +5660,7 @@ function Modal({
|
|
|
5438
5660
|
}
|
|
5439
5661
|
) });
|
|
5440
5662
|
}
|
|
5441
|
-
var ModalButton = (0,
|
|
5663
|
+
var ModalButton = (0, import_react41.forwardRef)(
|
|
5442
5664
|
({ children, size, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5443
5665
|
Button,
|
|
5444
5666
|
{
|
|
@@ -5454,9 +5676,9 @@ ModalButton.displayName = "ModalButton";
|
|
|
5454
5676
|
Modal.displayName = "Modal";
|
|
5455
5677
|
|
|
5456
5678
|
// src/modal-loader/ModalLoader.tsx
|
|
5457
|
-
var
|
|
5679
|
+
var import_react42 = require("react");
|
|
5458
5680
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5459
|
-
var ModalLoader = (0,
|
|
5681
|
+
var ModalLoader = (0, import_react42.memo)(({ visible, className }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5460
5682
|
"div",
|
|
5461
5683
|
{
|
|
5462
5684
|
className: cn(
|
|
@@ -5844,7 +6066,7 @@ var PopoverContent = React21.forwardRef(({ className, sideOffset = 8, align = "s
|
|
|
5844
6066
|
PopoverContent.displayName = "PopoverContent";
|
|
5845
6067
|
|
|
5846
6068
|
// src/radio/Radio.tsx
|
|
5847
|
-
var
|
|
6069
|
+
var import_react44 = require("react");
|
|
5848
6070
|
|
|
5849
6071
|
// src/radio-group/RadioGroup.tsx
|
|
5850
6072
|
var React22 = __toESM(require("react"), 1);
|
|
@@ -5877,11 +6099,11 @@ var RadioGroupItem = React22.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5877
6099
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
5878
6100
|
|
|
5879
6101
|
// src/radio/useRadioOptions.ts
|
|
5880
|
-
var
|
|
6102
|
+
var import_react43 = require("react");
|
|
5881
6103
|
function useRadioOptions({ options, defaultValue, onChange }) {
|
|
5882
6104
|
const initialValue = (typeof defaultValue === "string" ? options.find((option) => option.value === defaultValue) : defaultValue) || "";
|
|
5883
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
5884
|
-
const handleValueChange = (0,
|
|
6105
|
+
const [selectedValue, setSelectedValue] = (0, import_react43.useState)(initialValue);
|
|
6106
|
+
const handleValueChange = (0, import_react43.useCallback)(
|
|
5885
6107
|
(value) => {
|
|
5886
6108
|
setSelectedValue(value);
|
|
5887
6109
|
const selectedOption = options.find((option) => option.value === value) || "";
|
|
@@ -5902,7 +6124,7 @@ var styles_default5 = {};
|
|
|
5902
6124
|
|
|
5903
6125
|
// src/radio/Radio.tsx
|
|
5904
6126
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
5905
|
-
var Radio = (0,
|
|
6127
|
+
var Radio = (0, import_react44.forwardRef)(
|
|
5906
6128
|
({ options, value, onChange, error, className = "", disabled = false, renderOption }, ref) => {
|
|
5907
6129
|
const { selectedValue, handleValueChange } = useRadioOptions({
|
|
5908
6130
|
options,
|
|
@@ -6292,7 +6514,7 @@ var SectionTagColors = /* @__PURE__ */ ((SectionTagColors2) => {
|
|
|
6292
6514
|
})(SectionTagColors || {});
|
|
6293
6515
|
|
|
6294
6516
|
// src/section/Section.tsx
|
|
6295
|
-
var
|
|
6517
|
+
var import_react45 = require("react");
|
|
6296
6518
|
var import_lucide_react31 = require("lucide-react");
|
|
6297
6519
|
|
|
6298
6520
|
// src/section/constants.ts
|
|
@@ -6319,7 +6541,7 @@ function TooltipInfo({ content, className }) {
|
|
|
6319
6541
|
}
|
|
6320
6542
|
) });
|
|
6321
6543
|
}
|
|
6322
|
-
var Section = (0,
|
|
6544
|
+
var Section = (0, import_react45.forwardRef)(
|
|
6323
6545
|
({
|
|
6324
6546
|
children,
|
|
6325
6547
|
title,
|
|
@@ -6371,17 +6593,17 @@ var Section = (0, import_react42.forwardRef)(
|
|
|
6371
6593
|
)
|
|
6372
6594
|
);
|
|
6373
6595
|
Section.displayName = "Section";
|
|
6374
|
-
var SubSection = (0,
|
|
6596
|
+
var SubSection = (0, import_react45.forwardRef)(
|
|
6375
6597
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Section, { ref, className: cn(Section_default.section_sub, className), ...props })
|
|
6376
6598
|
);
|
|
6377
6599
|
SubSection.displayName = "SubSection";
|
|
6378
|
-
var DividingSubsection = (0,
|
|
6600
|
+
var DividingSubsection = (0, import_react45.forwardRef)(
|
|
6379
6601
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SubSection, { ref, className: cn(Section_default.section_dividing, className), ...props })
|
|
6380
6602
|
);
|
|
6381
6603
|
DividingSubsection.displayName = "DividingSubsection";
|
|
6382
6604
|
|
|
6383
6605
|
// src/selectors/Selectors.tsx
|
|
6384
|
-
var
|
|
6606
|
+
var import_react46 = require("react");
|
|
6385
6607
|
|
|
6386
6608
|
// src/selector-button/styles.module.css
|
|
6387
6609
|
var styles_default7 = {};
|
|
@@ -6453,8 +6675,8 @@ var getValueArray = (value) => {
|
|
|
6453
6675
|
return [];
|
|
6454
6676
|
};
|
|
6455
6677
|
function getSelectorContent(label, disabled, readOnly, active) {
|
|
6456
|
-
if ((0,
|
|
6457
|
-
return (0,
|
|
6678
|
+
if ((0, import_react46.isValidElement)(label)) {
|
|
6679
|
+
return (0, import_react46.cloneElement)(label, {
|
|
6458
6680
|
disabled,
|
|
6459
6681
|
readOnly,
|
|
6460
6682
|
active
|
|
@@ -6499,7 +6721,7 @@ function SelectorsInternal({
|
|
|
6499
6721
|
}
|
|
6500
6722
|
};
|
|
6501
6723
|
const isAnyActive = getValueArray(value).length > 0;
|
|
6502
|
-
(0,
|
|
6724
|
+
(0, import_react46.useEffect)(() => {
|
|
6503
6725
|
onAnySelectorActive?.(isAnyActive);
|
|
6504
6726
|
}, [isAnyActive, onAnySelectorActive]);
|
|
6505
6727
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
@@ -6542,7 +6764,7 @@ function SelectorsInternal({
|
|
|
6542
6764
|
)
|
|
6543
6765
|
] });
|
|
6544
6766
|
}
|
|
6545
|
-
var Selectors = (0,
|
|
6767
|
+
var Selectors = (0, import_react46.forwardRef)(SelectorsInternal);
|
|
6546
6768
|
|
|
6547
6769
|
// src/separator/Separator.tsx
|
|
6548
6770
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
@@ -6702,19 +6924,19 @@ function Skeleton({ className, ...props }) {
|
|
|
6702
6924
|
}
|
|
6703
6925
|
|
|
6704
6926
|
// src/sidebar/SidebarContext.ts
|
|
6705
|
-
var
|
|
6706
|
-
var SidebarContext = (0,
|
|
6927
|
+
var import_react47 = require("react");
|
|
6928
|
+
var SidebarContext = (0, import_react47.createContext)(null);
|
|
6707
6929
|
|
|
6708
6930
|
// src/sidebar/useSidebarMenuButton.ts
|
|
6709
|
-
var
|
|
6931
|
+
var import_react49 = require("react");
|
|
6710
6932
|
|
|
6711
6933
|
// src/sidebar/SidebarMenuButtonContext.ts
|
|
6712
|
-
var
|
|
6713
|
-
var SidebarMenuButtonContext = (0,
|
|
6934
|
+
var import_react48 = require("react");
|
|
6935
|
+
var SidebarMenuButtonContext = (0, import_react48.createContext)(null);
|
|
6714
6936
|
|
|
6715
6937
|
// src/sidebar/useSidebarMenuButton.ts
|
|
6716
6938
|
function useSidebarMenuButton() {
|
|
6717
|
-
return (0,
|
|
6939
|
+
return (0, import_react49.useContext)(SidebarMenuButtonContext);
|
|
6718
6940
|
}
|
|
6719
6941
|
|
|
6720
6942
|
// src/sidebar/SidebarIcon.tsx
|
|
@@ -6755,16 +6977,16 @@ var SidebarIcon = ({
|
|
|
6755
6977
|
};
|
|
6756
6978
|
|
|
6757
6979
|
// src/sidebar/useSidebar.ts
|
|
6758
|
-
var
|
|
6980
|
+
var import_react50 = require("react");
|
|
6759
6981
|
function useSidebar() {
|
|
6760
|
-
const context = (0,
|
|
6982
|
+
const context = (0, import_react50.useContext)(SidebarContext);
|
|
6761
6983
|
if (!context) {
|
|
6762
6984
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
6763
6985
|
}
|
|
6764
6986
|
return context;
|
|
6765
6987
|
}
|
|
6766
6988
|
function useSidebarSafe() {
|
|
6767
|
-
return (0,
|
|
6989
|
+
return (0, import_react50.useContext)(SidebarContext);
|
|
6768
6990
|
}
|
|
6769
6991
|
|
|
6770
6992
|
// src/sidebar/Sidebar.tsx
|
|
@@ -7337,9 +7559,9 @@ var VALUE_PART = 1;
|
|
|
7337
7559
|
var getSidebarState = (stateName) => document.cookie.split("; ").find((row) => row.startsWith(`${stateName}=`))?.split("=")[VALUE_PART] === "true";
|
|
7338
7560
|
|
|
7339
7561
|
// src/circular-loader/CircularLoader.tsx
|
|
7340
|
-
var
|
|
7562
|
+
var import_react51 = __toESM(require("react"), 1);
|
|
7341
7563
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
7342
|
-
var CircularLoader =
|
|
7564
|
+
var CircularLoader = import_react51.default.memo(
|
|
7343
7565
|
({ visible = true, height, width, position, label, className }) => {
|
|
7344
7566
|
if (!visible) return null;
|
|
7345
7567
|
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
@@ -7433,10 +7655,10 @@ var CircularLoader = import_react48.default.memo(
|
|
|
7433
7655
|
CircularLoader.displayName = "CircularLoader";
|
|
7434
7656
|
|
|
7435
7657
|
// src/small-grid-single-item/SmallGridSingleItem.tsx
|
|
7436
|
-
var
|
|
7658
|
+
var import_react52 = require("react");
|
|
7437
7659
|
var import_lucide_react34 = require("lucide-react");
|
|
7438
7660
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
7439
|
-
var SmallGridSingleItem = (0,
|
|
7661
|
+
var SmallGridSingleItem = (0, import_react52.memo)(
|
|
7440
7662
|
({
|
|
7441
7663
|
title,
|
|
7442
7664
|
subtitle,
|
|
@@ -7557,7 +7779,7 @@ function SortingAction({
|
|
|
7557
7779
|
}
|
|
7558
7780
|
|
|
7559
7781
|
// src/status-button/StatusButton.tsx
|
|
7560
|
-
var
|
|
7782
|
+
var import_react53 = require("react");
|
|
7561
7783
|
var import_react_i18next20 = require("react-i18next");
|
|
7562
7784
|
var import_lucide_react36 = require("lucide-react");
|
|
7563
7785
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
@@ -7575,7 +7797,7 @@ function StatusButton({
|
|
|
7575
7797
|
...props
|
|
7576
7798
|
}) {
|
|
7577
7799
|
const { t } = (0, import_react_i18next20.useTranslation)();
|
|
7578
|
-
const configMap = (0,
|
|
7800
|
+
const configMap = (0, import_react53.useMemo)(() => {
|
|
7579
7801
|
const defaultLoadingConfig = {
|
|
7580
7802
|
text: loadingText ?? `${t("saving")}...`,
|
|
7581
7803
|
icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_lucide_react36.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
@@ -7700,9 +7922,9 @@ function Stepper({
|
|
|
7700
7922
|
}
|
|
7701
7923
|
|
|
7702
7924
|
// src/switch-blocks/SwitchBlocks.tsx
|
|
7703
|
-
var
|
|
7925
|
+
var import_react54 = require("react");
|
|
7704
7926
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
7705
|
-
var SwitchBlocksInternal = (0,
|
|
7927
|
+
var SwitchBlocksInternal = (0, import_react54.forwardRef)(
|
|
7706
7928
|
({ options, value, onChange, disabled, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
7707
7929
|
"div",
|
|
7708
7930
|
{
|
|
@@ -7726,7 +7948,7 @@ var SwitchBlocksInternal = (0, import_react51.forwardRef)(
|
|
|
7726
7948
|
)
|
|
7727
7949
|
);
|
|
7728
7950
|
SwitchBlocksInternal.displayName = "SwitchBlocks";
|
|
7729
|
-
var SwitchBlocks = (0,
|
|
7951
|
+
var SwitchBlocks = (0, import_react54.memo)(SwitchBlocksInternal);
|
|
7730
7952
|
|
|
7731
7953
|
// src/switch-group/SwitchGroup.tsx
|
|
7732
7954
|
var React26 = __toESM(require("react"), 1);
|
|
@@ -7786,7 +8008,7 @@ var SwitchGroup = React26.forwardRef(
|
|
|
7786
8008
|
SwitchGroup.displayName = "SwitchGroup";
|
|
7787
8009
|
|
|
7788
8010
|
// src/tabs/Tabs.tsx
|
|
7789
|
-
var
|
|
8011
|
+
var import_react55 = require("react");
|
|
7790
8012
|
var TabsPrimitive2 = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
7791
8013
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
7792
8014
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
@@ -7802,7 +8024,7 @@ var tabsListVariants = (0, import_class_variance_authority12.cva)("inline-flex i
|
|
|
7802
8024
|
variant: "default"
|
|
7803
8025
|
}
|
|
7804
8026
|
});
|
|
7805
|
-
var TabsList = (0,
|
|
8027
|
+
var TabsList = (0, import_react55.forwardRef)(
|
|
7806
8028
|
({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
7807
8029
|
TabsPrimitive2.List,
|
|
7808
8030
|
{
|
|
@@ -7827,7 +8049,7 @@ var tabsTriggerVariants = (0, import_class_variance_authority12.cva)(
|
|
|
7827
8049
|
}
|
|
7828
8050
|
}
|
|
7829
8051
|
);
|
|
7830
|
-
var TabsTrigger = (0,
|
|
8052
|
+
var TabsTrigger = (0, import_react55.forwardRef)(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
7831
8053
|
TabsPrimitive2.Trigger,
|
|
7832
8054
|
{
|
|
7833
8055
|
ref,
|
|
@@ -7836,7 +8058,7 @@ var TabsTrigger = (0, import_react52.forwardRef)(({ className, variant, ...props
|
|
|
7836
8058
|
}
|
|
7837
8059
|
));
|
|
7838
8060
|
TabsTrigger.displayName = TabsPrimitive2.Trigger.displayName;
|
|
7839
|
-
var TabsContent = (0,
|
|
8061
|
+
var TabsContent = (0, import_react55.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(TabsPrimitive2.Content, { ref, className, tabIndex: -1, ...props }));
|
|
7840
8062
|
TabsContent.displayName = TabsPrimitive2.Content.displayName;
|
|
7841
8063
|
|
|
7842
8064
|
// src/tabbed-section/TabbedSection.tsx
|
|
@@ -7977,11 +8199,11 @@ var TASK_VARIANTS = {
|
|
|
7977
8199
|
var import_sonner2 = require("sonner");
|
|
7978
8200
|
|
|
7979
8201
|
// src/toaster/useUpdateToast.ts
|
|
7980
|
-
var
|
|
8202
|
+
var import_react56 = require("react");
|
|
7981
8203
|
var import_sonner = require("sonner");
|
|
7982
8204
|
function useUpdateToast({ id }) {
|
|
7983
|
-
const toastIdRef = (0,
|
|
7984
|
-
const getToastOptions = (0,
|
|
8205
|
+
const toastIdRef = (0, import_react56.useRef)("");
|
|
8206
|
+
const getToastOptions = (0, import_react56.useCallback)(
|
|
7985
8207
|
(options) => ({
|
|
7986
8208
|
id: toastIdRef.current,
|
|
7987
8209
|
dismissible: false,
|
|
@@ -8096,7 +8318,7 @@ var ToggleGroupItem = React27.forwardRef(({ className, children, variant, size,
|
|
|
8096
8318
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
8097
8319
|
|
|
8098
8320
|
// src/toggle-group/Toggles.tsx
|
|
8099
|
-
var
|
|
8321
|
+
var import_react57 = require("react");
|
|
8100
8322
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
8101
8323
|
var getValueArray2 = (value) => {
|
|
8102
8324
|
if (value) {
|
|
@@ -8171,7 +8393,7 @@ function TogglesInternal({
|
|
|
8171
8393
|
}
|
|
8172
8394
|
};
|
|
8173
8395
|
const isAnyActive = getValueArray2(value).length > 0;
|
|
8174
|
-
(0,
|
|
8396
|
+
(0, import_react57.useEffect)(() => {
|
|
8175
8397
|
onAnySelectorActive?.(isAnyActive);
|
|
8176
8398
|
}, [isAnyActive, onAnySelectorActive]);
|
|
8177
8399
|
const currentValue = getValueArray2(value).map((item) => String(item));
|
|
@@ -8202,7 +8424,7 @@ function TogglesInternal({
|
|
|
8202
8424
|
}) })
|
|
8203
8425
|
] });
|
|
8204
8426
|
}
|
|
8205
|
-
var Toggles = (0,
|
|
8427
|
+
var Toggles = (0, import_react57.forwardRef)(TogglesInternal);
|
|
8206
8428
|
|
|
8207
8429
|
// src/text-field/TextField.tsx
|
|
8208
8430
|
var React28 = __toESM(require("react"), 1);
|
|
@@ -8413,16 +8635,16 @@ var TextField = React28.forwardRef(
|
|
|
8413
8635
|
TextField.displayName = "TextField";
|
|
8414
8636
|
|
|
8415
8637
|
// src/textarea/Textarea.tsx
|
|
8416
|
-
var
|
|
8638
|
+
var import_react58 = require("react");
|
|
8417
8639
|
|
|
8418
8640
|
// src/textarea/styles.module.css
|
|
8419
8641
|
var styles_default9 = {};
|
|
8420
8642
|
|
|
8421
8643
|
// src/textarea/Textarea.tsx
|
|
8422
8644
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
8423
|
-
var Textarea = (0,
|
|
8645
|
+
var Textarea = (0, import_react58.forwardRef)(
|
|
8424
8646
|
({ className, textareaClassName, label, disabled, name, invalid, ...textareaProps }, ref) => {
|
|
8425
|
-
const inputId = (0,
|
|
8647
|
+
const inputId = (0, import_react58.useId)();
|
|
8426
8648
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: cn(styles_default9.container, className), children: [
|
|
8427
8649
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
8428
8650
|
"textarea",
|
|
@@ -11315,7 +11537,7 @@ AirbnbSearchInput.displayName = "SearchInput";
|
|
|
11315
11537
|
var React41 = __toESM(require("react"), 1);
|
|
11316
11538
|
var import_lucide_react46 = require("lucide-react");
|
|
11317
11539
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
11318
|
-
var
|
|
11540
|
+
var import_react59 = require("react");
|
|
11319
11541
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
11320
11542
|
var ROW_HEIGHT = 48;
|
|
11321
11543
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
@@ -11390,7 +11612,7 @@ var SearchableSelectInternal = ({
|
|
|
11390
11612
|
const activeOptionId = highlightedIndex >= 0 ? getOptionId(reactId, highlightedIndex) : void 0;
|
|
11391
11613
|
useOutsideClick(containerRef, open && !isMobile ? () => closeSelect() : null);
|
|
11392
11614
|
const handleOnOpenChange = useEvent(onOpenChange);
|
|
11393
|
-
const setSelectOpen = (0,
|
|
11615
|
+
const setSelectOpen = (0, import_react59.useCallback)(
|
|
11394
11616
|
(nextOpen, options2) => {
|
|
11395
11617
|
setOpen(nextOpen);
|
|
11396
11618
|
handleOnOpenChange?.(nextOpen);
|
|
@@ -11758,6 +11980,39 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
11758
11980
|
}
|
|
11759
11981
|
return -1;
|
|
11760
11982
|
}
|
|
11983
|
+
|
|
11984
|
+
// src/lib/copy-to-clipboard.ts
|
|
11985
|
+
function copyToClipboardFallback(value) {
|
|
11986
|
+
const targetDocument = getDocument();
|
|
11987
|
+
const targetBody = targetDocument.body;
|
|
11988
|
+
if (!targetBody) {
|
|
11989
|
+
return;
|
|
11990
|
+
}
|
|
11991
|
+
const el = targetDocument.createElement("textarea");
|
|
11992
|
+
el.value = value;
|
|
11993
|
+
el.setAttribute("readonly", "");
|
|
11994
|
+
el.style.position = "fixed";
|
|
11995
|
+
el.style.opacity = "0";
|
|
11996
|
+
el.style.pointerEvents = "none";
|
|
11997
|
+
el.style.left = "-9999px";
|
|
11998
|
+
targetBody.appendChild(el);
|
|
11999
|
+
el.focus();
|
|
12000
|
+
el.select();
|
|
12001
|
+
targetDocument.execCommand("copy");
|
|
12002
|
+
targetBody.removeChild(el);
|
|
12003
|
+
}
|
|
12004
|
+
function copyToClipboard2(value) {
|
|
12005
|
+
const text = typeof value === "number" ? value.toString() : value;
|
|
12006
|
+
const targetDocument = getDocument();
|
|
12007
|
+
const clipboard = targetDocument.defaultView?.navigator?.clipboard ?? globalThis.navigator?.clipboard;
|
|
12008
|
+
if (!clipboard?.writeText) {
|
|
12009
|
+
copyToClipboardFallback(text);
|
|
12010
|
+
return;
|
|
12011
|
+
}
|
|
12012
|
+
void clipboard.writeText(text).catch(() => {
|
|
12013
|
+
copyToClipboardFallback(text);
|
|
12014
|
+
});
|
|
12015
|
+
}
|
|
11761
12016
|
// Annotate the CommonJS export names for ESM import in node:
|
|
11762
12017
|
0 && (module.exports = {
|
|
11763
12018
|
Accordion,
|
|
@@ -12010,6 +12265,7 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
12010
12265
|
buttonVariants,
|
|
12011
12266
|
calendarClassNames,
|
|
12012
12267
|
cn,
|
|
12268
|
+
copyToClipboard,
|
|
12013
12269
|
emptyMediaVariants,
|
|
12014
12270
|
getSidebarState,
|
|
12015
12271
|
inputVariants,
|
|
@@ -12027,13 +12283,16 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
12027
12283
|
useClickEscape,
|
|
12028
12284
|
useCombinedRef,
|
|
12029
12285
|
useDebounce,
|
|
12286
|
+
useDebouncedFunction,
|
|
12030
12287
|
useEvent,
|
|
12031
12288
|
useHover,
|
|
12032
12289
|
useIsMobile,
|
|
12033
12290
|
useIsMounted,
|
|
12034
12291
|
useModalControls,
|
|
12035
12292
|
useOutsideClick,
|
|
12293
|
+
usePagination,
|
|
12036
12294
|
usePrevious,
|
|
12295
|
+
usePromisedModalControls,
|
|
12037
12296
|
useRadioOptions,
|
|
12038
12297
|
useScreenResize,
|
|
12039
12298
|
useScrollFrameIntoView,
|