@chekinapp/ui 0.0.25 → 0.0.28
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 +329 -177
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -7
- package/dist/index.d.ts +53 -7
- package/dist/index.js +257 -109
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -297,18 +297,22 @@ __export(index_exports, {
|
|
|
297
297
|
useAbortController: () => useAbortController,
|
|
298
298
|
useClickEscape: () => useClickEscape,
|
|
299
299
|
useCombinedRef: () => useCombinedRef,
|
|
300
|
+
useCopyToClipboard: () => useCopyToClipboard,
|
|
300
301
|
useDebounce: () => useDebounce,
|
|
301
302
|
useDebouncedFunction: () => useDebouncedFunction,
|
|
302
303
|
useEvent: () => useEvent,
|
|
303
304
|
useHover: () => useHover,
|
|
305
|
+
useIsFormTouched: () => useIsFormTouched,
|
|
304
306
|
useIsMobile: () => useIsMobile,
|
|
305
307
|
useIsMounted: () => useIsMounted,
|
|
308
|
+
useKeyDown: () => useKeyDown,
|
|
306
309
|
useModalControls: () => useModalControls,
|
|
307
310
|
useOutsideClick: () => useOutsideClick,
|
|
308
311
|
usePagination: () => usePagination,
|
|
309
312
|
usePrevious: () => usePrevious,
|
|
310
313
|
usePromisedModalControls: () => usePromisedModalControls,
|
|
311
314
|
useRadioOptions: () => useRadioOptions,
|
|
315
|
+
useResetAfterRequestStatus: () => useResetAfterRequestStatus,
|
|
312
316
|
useScreenResize: () => useScreenResize,
|
|
313
317
|
useScrollFrameIntoView: () => useScrollFrameIntoView,
|
|
314
318
|
useScrollToTop: () => useScrollToTop,
|
|
@@ -2830,12 +2834,76 @@ function usePagination(config) {
|
|
|
2830
2834
|
};
|
|
2831
2835
|
}
|
|
2832
2836
|
|
|
2833
|
-
// src/hooks/use-
|
|
2837
|
+
// src/hooks/use-copy-to-clipboard.ts
|
|
2834
2838
|
var import_react23 = require("react");
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2839
|
+
|
|
2840
|
+
// src/lib/copy-to-clipboard.ts
|
|
2841
|
+
function copyToClipboardFallback(value) {
|
|
2842
|
+
const targetDocument = getDocument();
|
|
2843
|
+
const targetBody = targetDocument.body;
|
|
2844
|
+
if (!targetBody) {
|
|
2845
|
+
return;
|
|
2846
|
+
}
|
|
2847
|
+
const el = targetDocument.createElement("textarea");
|
|
2848
|
+
el.value = value;
|
|
2849
|
+
el.setAttribute("readonly", "");
|
|
2850
|
+
el.style.position = "fixed";
|
|
2851
|
+
el.style.opacity = "0";
|
|
2852
|
+
el.style.pointerEvents = "none";
|
|
2853
|
+
el.style.left = "-9999px";
|
|
2854
|
+
targetBody.appendChild(el);
|
|
2855
|
+
el.focus();
|
|
2856
|
+
el.select();
|
|
2857
|
+
targetDocument.execCommand("copy");
|
|
2858
|
+
targetBody.removeChild(el);
|
|
2859
|
+
}
|
|
2860
|
+
function copyToClipboard2(value) {
|
|
2861
|
+
const text = typeof value === "number" ? value.toString() : value;
|
|
2862
|
+
const targetDocument = getDocument();
|
|
2863
|
+
const clipboard = targetDocument.defaultView?.navigator?.clipboard ?? globalThis.navigator?.clipboard;
|
|
2864
|
+
if (!clipboard?.writeText) {
|
|
2865
|
+
copyToClipboardFallback(text);
|
|
2866
|
+
return;
|
|
2867
|
+
}
|
|
2868
|
+
void clipboard.writeText(text).catch(() => {
|
|
2869
|
+
copyToClipboardFallback(text);
|
|
2870
|
+
});
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2873
|
+
// src/hooks/use-copy-to-clipboard.ts
|
|
2874
|
+
var COPIED_TIMEOUT_S = 1.5;
|
|
2875
|
+
function useCopyToClipboard({ value, onCopiedLink, onReset }) {
|
|
2876
|
+
const [isCopied, setIsLinkCopied] = (0, import_react23.useState)(false);
|
|
2877
|
+
const timeoutRef = (0, import_react23.useRef)();
|
|
2838
2878
|
(0, import_react23.useEffect)(() => {
|
|
2879
|
+
return () => {
|
|
2880
|
+
if (timeoutRef.current) {
|
|
2881
|
+
clearTimeout(timeoutRef.current);
|
|
2882
|
+
}
|
|
2883
|
+
};
|
|
2884
|
+
}, []);
|
|
2885
|
+
const copy = () => {
|
|
2886
|
+
if (!value) return;
|
|
2887
|
+
if (timeoutRef.current) {
|
|
2888
|
+
clearTimeout(timeoutRef.current);
|
|
2889
|
+
}
|
|
2890
|
+
copyToClipboard2(value);
|
|
2891
|
+
setIsLinkCopied(true);
|
|
2892
|
+
timeoutRef.current = setTimeout(() => {
|
|
2893
|
+
setIsLinkCopied(false);
|
|
2894
|
+
onReset?.();
|
|
2895
|
+
}, COPIED_TIMEOUT_S * 1e3);
|
|
2896
|
+
onCopiedLink?.();
|
|
2897
|
+
};
|
|
2898
|
+
return { isCopied, copy };
|
|
2899
|
+
}
|
|
2900
|
+
|
|
2901
|
+
// src/hooks/use-timer.ts
|
|
2902
|
+
var import_react24 = require("react");
|
|
2903
|
+
var useTimer = ({ seconds }) => {
|
|
2904
|
+
const [timeLeft, setTimeLeft] = (0, import_react24.useState)(seconds);
|
|
2905
|
+
const [isTimerRunning, setIsTimerRunning] = (0, import_react24.useState)(true);
|
|
2906
|
+
(0, import_react24.useEffect)(() => {
|
|
2839
2907
|
if (!isTimerRunning) return;
|
|
2840
2908
|
const timer = setInterval(() => {
|
|
2841
2909
|
setTimeLeft((prev) => {
|
|
@@ -2861,32 +2929,46 @@ var useTimer = ({ seconds }) => {
|
|
|
2861
2929
|
};
|
|
2862
2930
|
|
|
2863
2931
|
// src/hooks/use-timeout.ts
|
|
2864
|
-
var
|
|
2865
|
-
function useTimeout() {
|
|
2866
|
-
const
|
|
2867
|
-
const
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2932
|
+
var import_react25 = require("react");
|
|
2933
|
+
function useTimeout(callback, ms = 0) {
|
|
2934
|
+
const timeoutId = (0, import_react25.useRef)();
|
|
2935
|
+
const memoizedCallback = useEvent(callback);
|
|
2936
|
+
const handler = (0, import_react25.useMemo)(() => {
|
|
2937
|
+
return {
|
|
2938
|
+
start(overrideMs) {
|
|
2939
|
+
handler.stop();
|
|
2940
|
+
timeoutId.current = setTimeout(
|
|
2941
|
+
memoizedCallback,
|
|
2942
|
+
overrideMs === void 0 ? ms : overrideMs
|
|
2943
|
+
);
|
|
2944
|
+
},
|
|
2945
|
+
stop() {
|
|
2946
|
+
if (timeoutId.current) {
|
|
2947
|
+
clearTimeout(timeoutId.current);
|
|
2948
|
+
}
|
|
2949
|
+
},
|
|
2950
|
+
restart() {
|
|
2951
|
+
handler.stop();
|
|
2952
|
+
handler.start();
|
|
2953
|
+
}
|
|
2954
|
+
};
|
|
2955
|
+
}, [memoizedCallback, ms]);
|
|
2956
|
+
(0, import_react25.useEffect)(() => {
|
|
2957
|
+
return () => {
|
|
2958
|
+
handler.stop();
|
|
2959
|
+
};
|
|
2960
|
+
}, [handler]);
|
|
2961
|
+
return handler;
|
|
2880
2962
|
}
|
|
2881
2963
|
|
|
2882
2964
|
// src/hooks/use-hover.ts
|
|
2883
|
-
var
|
|
2965
|
+
var import_react26 = require("react");
|
|
2884
2966
|
function useHover() {
|
|
2885
|
-
const [isHovering, setIsHovering] = (0,
|
|
2886
|
-
const handleMouseEnter = (0,
|
|
2967
|
+
const [isHovering, setIsHovering] = (0, import_react26.useState)(false);
|
|
2968
|
+
const handleMouseEnter = (0, import_react26.useCallback)(() => {
|
|
2887
2969
|
setIsHovering(true);
|
|
2888
2970
|
}, []);
|
|
2889
|
-
const handleMouseLeave = (0,
|
|
2971
|
+
const handleMouseLeave = (0, import_react26.useCallback)(() => {
|
|
2890
2972
|
setIsHovering(false);
|
|
2891
2973
|
}, []);
|
|
2892
2974
|
return {
|
|
@@ -2896,11 +2978,60 @@ function useHover() {
|
|
|
2896
2978
|
};
|
|
2897
2979
|
}
|
|
2898
2980
|
|
|
2981
|
+
// src/hooks/use-key-down.ts
|
|
2982
|
+
var import_react27 = require("react");
|
|
2983
|
+
function useKeyDown(key, cb, options) {
|
|
2984
|
+
const {
|
|
2985
|
+
enabled = true,
|
|
2986
|
+
metaKey = false,
|
|
2987
|
+
ctrlKey = false,
|
|
2988
|
+
shiftKey = false,
|
|
2989
|
+
altKey = false
|
|
2990
|
+
} = options ?? {};
|
|
2991
|
+
const handleCallback = useEvent(cb);
|
|
2992
|
+
const handleKeyDown = (0, import_react27.useCallback)(
|
|
2993
|
+
(event) => {
|
|
2994
|
+
const keys = Array.isArray(key) ? key : [key];
|
|
2995
|
+
const isKeyMatch = keys.includes(event.key);
|
|
2996
|
+
const isModifierMatch = event.metaKey === metaKey && event.ctrlKey === ctrlKey && event.shiftKey === shiftKey && event.altKey === altKey;
|
|
2997
|
+
if (isKeyMatch && isModifierMatch) {
|
|
2998
|
+
handleCallback(event);
|
|
2999
|
+
}
|
|
3000
|
+
},
|
|
3001
|
+
[key, handleCallback, metaKey, ctrlKey, shiftKey, altKey]
|
|
3002
|
+
);
|
|
3003
|
+
(0, import_react27.useEffect)(() => {
|
|
3004
|
+
if (!enabled) return;
|
|
3005
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
3006
|
+
return () => {
|
|
3007
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
3008
|
+
};
|
|
3009
|
+
}, [handleKeyDown, enabled]);
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
// src/hooks/use-reset-after-request-status.ts
|
|
3013
|
+
var import_react28 = require("react");
|
|
3014
|
+
var ResetStatusTimeoutMs = 2e3;
|
|
3015
|
+
function useResetAfterRequestStatus({ status, reset }) {
|
|
3016
|
+
const stateTimeoutRef = (0, import_react28.useRef)();
|
|
3017
|
+
const handleReset = useEvent(reset);
|
|
3018
|
+
const isNotIdle = ["success", "error"].includes(status);
|
|
3019
|
+
(0, import_react28.useEffect)(() => {
|
|
3020
|
+
if (isNotIdle) {
|
|
3021
|
+
stateTimeoutRef.current = setTimeout(handleReset, ResetStatusTimeoutMs);
|
|
3022
|
+
return () => {
|
|
3023
|
+
clearTimeout(stateTimeoutRef.current);
|
|
3024
|
+
};
|
|
3025
|
+
}
|
|
3026
|
+
}, [handleReset, isNotIdle]);
|
|
3027
|
+
return { isNotIdle };
|
|
3028
|
+
}
|
|
3029
|
+
|
|
2899
3030
|
// src/hooks/use-promised-modal-controls.ts
|
|
2900
|
-
var
|
|
3031
|
+
var import_react29 = require("react");
|
|
2901
3032
|
var usePromisedModalControls = () => {
|
|
2902
3033
|
const { closeModal, isOpen, openModal } = useModalControls();
|
|
2903
|
-
const resolveRef = (0,
|
|
3034
|
+
const resolveRef = (0, import_react29.useRef)();
|
|
2904
3035
|
const openModalWithPromise = async () => {
|
|
2905
3036
|
openModal();
|
|
2906
3037
|
return new Promise((resolve) => {
|
|
@@ -2915,6 +3046,56 @@ var usePromisedModalControls = () => {
|
|
|
2915
3046
|
};
|
|
2916
3047
|
};
|
|
2917
3048
|
|
|
3049
|
+
// src/hooks/use-is-form-touched.ts
|
|
3050
|
+
var import_react30 = require("react");
|
|
3051
|
+
function useIsFormTouched({
|
|
3052
|
+
watch,
|
|
3053
|
+
displayFields,
|
|
3054
|
+
debug,
|
|
3055
|
+
defaultValues
|
|
3056
|
+
}) {
|
|
3057
|
+
const [untouchedValues, setUntouchedValues] = (0, import_react30.useState)(defaultValues || {});
|
|
3058
|
+
const getIsFormTouched = () => {
|
|
3059
|
+
if (!Object.keys(untouchedValues)) {
|
|
3060
|
+
return false;
|
|
3061
|
+
}
|
|
3062
|
+
return Object.keys(untouchedValues).some((field) => {
|
|
3063
|
+
if (!displayFields[field] || watch(field) === void 0) {
|
|
3064
|
+
return false;
|
|
3065
|
+
}
|
|
3066
|
+
if (watch(field)?.value && untouchedValues[field]?.value) {
|
|
3067
|
+
if (debug) {
|
|
3068
|
+
console.log({
|
|
3069
|
+
res: untouchedValues[field]?.value !== watch(field)?.value,
|
|
3070
|
+
[field]: { form: watch(field), untouched: untouchedValues[field] }
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
return untouchedValues[field]?.value !== watch(field)?.value;
|
|
3074
|
+
}
|
|
3075
|
+
if (watch(field) instanceof Array || watch(field) instanceof Object) {
|
|
3076
|
+
if (debug) {
|
|
3077
|
+
console.log({
|
|
3078
|
+
res: JSON.stringify(untouchedValues[field]) !== JSON.stringify(watch(field)),
|
|
3079
|
+
[field]: { form: watch(field), untouched: untouchedValues[field] }
|
|
3080
|
+
});
|
|
3081
|
+
}
|
|
3082
|
+
return JSON.stringify(untouchedValues[field]) !== JSON.stringify(watch(field));
|
|
3083
|
+
}
|
|
3084
|
+
if (debug) {
|
|
3085
|
+
console.log({
|
|
3086
|
+
res: untouchedValues[field] !== watch(field),
|
|
3087
|
+
[field]: { form: watch(field), untouched: untouchedValues[field] }
|
|
3088
|
+
});
|
|
3089
|
+
}
|
|
3090
|
+
return untouchedValues[field] !== watch(field);
|
|
3091
|
+
});
|
|
3092
|
+
};
|
|
3093
|
+
return {
|
|
3094
|
+
setUntouchedValues,
|
|
3095
|
+
isFormTouched: getIsFormTouched()
|
|
3096
|
+
};
|
|
3097
|
+
}
|
|
3098
|
+
|
|
2918
3099
|
// src/dialog/Dialog.tsx
|
|
2919
3100
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2920
3101
|
function useIframeTitleFix(titleRef) {
|
|
@@ -3150,7 +3331,7 @@ function DownloadEntryFormsButton({
|
|
|
3150
3331
|
}
|
|
3151
3332
|
|
|
3152
3333
|
// src/dropdown-button/DropdownButton.tsx
|
|
3153
|
-
var
|
|
3334
|
+
var import_react31 = require("react");
|
|
3154
3335
|
|
|
3155
3336
|
// src/dropdown-menu/DropdownMenu.tsx
|
|
3156
3337
|
var React13 = __toESM(require("react"), 1);
|
|
@@ -3214,7 +3395,7 @@ function DropdownButton({
|
|
|
3214
3395
|
modal,
|
|
3215
3396
|
className
|
|
3216
3397
|
}) {
|
|
3217
|
-
const [isOpen, setIsOpen] = (0,
|
|
3398
|
+
const [isOpen, setIsOpen] = (0, import_react31.useState)(false);
|
|
3218
3399
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(DropdownMenu, { onOpenChange: setIsOpen, modal, children: [
|
|
3219
3400
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuTrigger, { asChild: true, children: typeof trigger === "function" ? trigger(isOpen) : trigger }),
|
|
3220
3401
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -3341,7 +3522,7 @@ var import_lucide_react12 = require("lucide-react");
|
|
|
3341
3522
|
var import_react_i18next7 = require("react-i18next");
|
|
3342
3523
|
|
|
3343
3524
|
// src/halo-icon/HaloIcon.tsx
|
|
3344
|
-
var
|
|
3525
|
+
var import_react32 = require("react");
|
|
3345
3526
|
|
|
3346
3527
|
// src/halo-icon/constants.ts
|
|
3347
3528
|
var HALO_ICON_STATUS = {
|
|
@@ -3371,7 +3552,7 @@ var statusStyles = {
|
|
|
3371
3552
|
color: "text-chekin-red"
|
|
3372
3553
|
}
|
|
3373
3554
|
};
|
|
3374
|
-
var HaloIcon = (0,
|
|
3555
|
+
var HaloIcon = (0, import_react32.forwardRef)(
|
|
3375
3556
|
({
|
|
3376
3557
|
children,
|
|
3377
3558
|
variant = "default",
|
|
@@ -3552,7 +3733,7 @@ var Switch = React15.forwardRef(
|
|
|
3552
3733
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
3553
3734
|
|
|
3554
3735
|
// src/video-player/VideoPlayer.tsx
|
|
3555
|
-
var
|
|
3736
|
+
var import_react33 = require("react");
|
|
3556
3737
|
var import_react_i18next8 = require("react-i18next");
|
|
3557
3738
|
var import_lucide_react13 = require("lucide-react");
|
|
3558
3739
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
@@ -3565,20 +3746,20 @@ function VideoPlayer({
|
|
|
3565
3746
|
autoPlay = false
|
|
3566
3747
|
}) {
|
|
3567
3748
|
const { t } = (0, import_react_i18next8.useTranslation)();
|
|
3568
|
-
const videoRef = (0,
|
|
3569
|
-
const iframeRef = (0,
|
|
3570
|
-
const containerRef = (0,
|
|
3571
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
3572
|
-
const [isMuted, setIsMuted] = (0,
|
|
3573
|
-
const [currentTime, setCurrentTime] = (0,
|
|
3574
|
-
const [duration, setDuration] = (0,
|
|
3575
|
-
const [isFullScreenMode, setIsFullScreenMode] = (0,
|
|
3576
|
-
const [isLoading, setIsLoading] = (0,
|
|
3577
|
-
const [videoSource, setVideoSource] = (0,
|
|
3578
|
-
const [youtubeEmbedUrl, setYoutubeEmbedUrl] = (0,
|
|
3579
|
-
const [vimeoEmbedUrl, setVimeoEmbedUrl] = (0,
|
|
3749
|
+
const videoRef = (0, import_react33.useRef)(null);
|
|
3750
|
+
const iframeRef = (0, import_react33.useRef)(null);
|
|
3751
|
+
const containerRef = (0, import_react33.useRef)(null);
|
|
3752
|
+
const [isPlaying, setIsPlaying] = (0, import_react33.useState)(false);
|
|
3753
|
+
const [isMuted, setIsMuted] = (0, import_react33.useState)(false);
|
|
3754
|
+
const [currentTime, setCurrentTime] = (0, import_react33.useState)(0);
|
|
3755
|
+
const [duration, setDuration] = (0, import_react33.useState)(0);
|
|
3756
|
+
const [isFullScreenMode, setIsFullScreenMode] = (0, import_react33.useState)(isFullScreen);
|
|
3757
|
+
const [isLoading, setIsLoading] = (0, import_react33.useState)(true);
|
|
3758
|
+
const [videoSource, setVideoSource] = (0, import_react33.useState)("file");
|
|
3759
|
+
const [youtubeEmbedUrl, setYoutubeEmbedUrl] = (0, import_react33.useState)("");
|
|
3760
|
+
const [vimeoEmbedUrl, setVimeoEmbedUrl] = (0, import_react33.useState)("");
|
|
3580
3761
|
useClickEscape({ enabled: isFullScreenMode, onClick: onClose });
|
|
3581
|
-
(0,
|
|
3762
|
+
(0, import_react33.useEffect)(() => {
|
|
3582
3763
|
const youtubeRegex = /(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/;
|
|
3583
3764
|
const vimeoRegex = /(?:vimeo\.com\/|vimeo\.com\/video\/)(\d+)/;
|
|
3584
3765
|
const youtubeMatch = src.match(youtubeRegex);
|
|
@@ -3607,7 +3788,7 @@ function VideoPlayer({
|
|
|
3607
3788
|
setYoutubeEmbedUrl("");
|
|
3608
3789
|
setVimeoEmbedUrl("");
|
|
3609
3790
|
}, [src, autoPlay]);
|
|
3610
|
-
(0,
|
|
3791
|
+
(0, import_react33.useEffect)(() => {
|
|
3611
3792
|
if (videoSource !== "file") return;
|
|
3612
3793
|
const video = videoRef.current;
|
|
3613
3794
|
if (!video) return;
|
|
@@ -3635,7 +3816,7 @@ function VideoPlayer({
|
|
|
3635
3816
|
video.removeEventListener("canplay", handleCanPlay);
|
|
3636
3817
|
};
|
|
3637
3818
|
}, [videoSource]);
|
|
3638
|
-
(0,
|
|
3819
|
+
(0, import_react33.useEffect)(() => {
|
|
3639
3820
|
if (isFullScreenMode && videoRef.current && videoSource === "file") {
|
|
3640
3821
|
void videoRef.current.play();
|
|
3641
3822
|
setIsPlaying(true);
|
|
@@ -3912,10 +4093,10 @@ function FeatureCard({
|
|
|
3912
4093
|
}
|
|
3913
4094
|
|
|
3914
4095
|
// src/file-input-button/FileInputButton.tsx
|
|
3915
|
-
var
|
|
4096
|
+
var import_react34 = require("react");
|
|
3916
4097
|
var import_lucide_react15 = require("lucide-react");
|
|
3917
4098
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3918
|
-
var FileInputButton = (0,
|
|
4099
|
+
var FileInputButton = (0, import_react34.forwardRef)(
|
|
3919
4100
|
({
|
|
3920
4101
|
label,
|
|
3921
4102
|
onChange,
|
|
@@ -3927,7 +4108,7 @@ var FileInputButton = (0, import_react30.forwardRef)(
|
|
|
3927
4108
|
size = "default",
|
|
3928
4109
|
...props
|
|
3929
4110
|
}, ref) => {
|
|
3930
|
-
const handleChange = (0,
|
|
4111
|
+
const handleChange = (0, import_react34.useCallback)(
|
|
3931
4112
|
(event) => {
|
|
3932
4113
|
onChange?.(event);
|
|
3933
4114
|
event.target.value = "";
|
|
@@ -4007,7 +4188,7 @@ var FormBox = {
|
|
|
4007
4188
|
};
|
|
4008
4189
|
|
|
4009
4190
|
// src/free-text-field/FreeTextField.tsx
|
|
4010
|
-
var
|
|
4191
|
+
var import_react35 = require("react");
|
|
4011
4192
|
var import_react_i18next10 = require("react-i18next");
|
|
4012
4193
|
|
|
4013
4194
|
// src/free-text-field/styles.module.css
|
|
@@ -4015,7 +4196,7 @@ var styles_default3 = {};
|
|
|
4015
4196
|
|
|
4016
4197
|
// src/free-text-field/FreeTextField.tsx
|
|
4017
4198
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4018
|
-
var FreeTextField = (0,
|
|
4199
|
+
var FreeTextField = (0, import_react35.forwardRef)(
|
|
4019
4200
|
({
|
|
4020
4201
|
label,
|
|
4021
4202
|
error,
|
|
@@ -4037,9 +4218,9 @@ var FreeTextField = (0, import_react31.forwardRef)(
|
|
|
4037
4218
|
...inputProps
|
|
4038
4219
|
}, ref) => {
|
|
4039
4220
|
const { t } = (0, import_react_i18next10.useTranslation)();
|
|
4040
|
-
const inputId = (0,
|
|
4041
|
-
const [internalValue, setInternalValue] = (0,
|
|
4042
|
-
const [isFocused, setIsFocused] = (0,
|
|
4221
|
+
const inputId = (0, import_react35.useId)();
|
|
4222
|
+
const [internalValue, setInternalValue] = (0, import_react35.useState)(defaultValue ?? "");
|
|
4223
|
+
const [isFocused, setIsFocused] = (0, import_react35.useState)(false);
|
|
4043
4224
|
const currentValue = value !== void 0 ? value : internalValue;
|
|
4044
4225
|
const isEmpty = !currentValue || String(currentValue).length === 0;
|
|
4045
4226
|
const hasError = Boolean(error);
|
|
@@ -4162,9 +4343,9 @@ var FramedIcon = React16.forwardRef(
|
|
|
4162
4343
|
FramedIcon.displayName = "FramedIcon";
|
|
4163
4344
|
|
|
4164
4345
|
// src/grid-items/GridItems.tsx
|
|
4165
|
-
var
|
|
4346
|
+
var import_react36 = require("react");
|
|
4166
4347
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4167
|
-
var GridItems = (0,
|
|
4348
|
+
var GridItems = (0, import_react36.forwardRef)(
|
|
4168
4349
|
({ children, title, placeholder, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
4169
4350
|
"div",
|
|
4170
4351
|
{
|
|
@@ -4241,9 +4422,9 @@ function HelpTooltip({
|
|
|
4241
4422
|
}
|
|
4242
4423
|
|
|
4243
4424
|
// src/icon/Icon.tsx
|
|
4244
|
-
var
|
|
4425
|
+
var import_react37 = require("react");
|
|
4245
4426
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4246
|
-
var MissingIcon = (0,
|
|
4427
|
+
var MissingIcon = (0, import_react37.forwardRef)(
|
|
4247
4428
|
({ size = 24, className = "", fallback = null, color, ...props }, ref) => {
|
|
4248
4429
|
if (fallback) {
|
|
4249
4430
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, { children: fallback });
|
|
@@ -4272,8 +4453,8 @@ var MissingIcon = (0, import_react33.forwardRef)(
|
|
|
4272
4453
|
}
|
|
4273
4454
|
);
|
|
4274
4455
|
MissingIcon.displayName = "MissingIcon";
|
|
4275
|
-
var Icon = (0,
|
|
4276
|
-
(0,
|
|
4456
|
+
var Icon = (0, import_react37.memo)(
|
|
4457
|
+
(0, import_react37.forwardRef)(
|
|
4277
4458
|
({ name: _name, size = 24, className = "", fallback = null, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4278
4459
|
MissingIcon,
|
|
4279
4460
|
{
|
|
@@ -4371,7 +4552,7 @@ function InfoBox({ className, children }) {
|
|
|
4371
4552
|
}
|
|
4372
4553
|
|
|
4373
4554
|
// src/image/Image.tsx
|
|
4374
|
-
var
|
|
4555
|
+
var import_react38 = require("react");
|
|
4375
4556
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4376
4557
|
function Image2({
|
|
4377
4558
|
src,
|
|
@@ -4380,7 +4561,7 @@ function Image2({
|
|
|
4380
4561
|
fallbackSrc = "https://placehold.co/600x400?text=Image",
|
|
4381
4562
|
...props
|
|
4382
4563
|
}) {
|
|
4383
|
-
const [error, setError] = (0,
|
|
4564
|
+
const [error, setError] = (0, import_react38.useState)(false);
|
|
4384
4565
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4385
4566
|
"img",
|
|
4386
4567
|
{
|
|
@@ -4424,10 +4605,10 @@ Input.displayName = "Input";
|
|
|
4424
4605
|
var React19 = __toESM(require("react"), 1);
|
|
4425
4606
|
|
|
4426
4607
|
// src/input-otp/InputOTPContext.ts
|
|
4427
|
-
var
|
|
4428
|
-
var InputOTPContext = (0,
|
|
4608
|
+
var import_react39 = require("react");
|
|
4609
|
+
var InputOTPContext = (0, import_react39.createContext)(null);
|
|
4429
4610
|
function useInputOTPContext() {
|
|
4430
|
-
const ctx = (0,
|
|
4611
|
+
const ctx = (0, import_react39.useContext)(InputOTPContext);
|
|
4431
4612
|
if (!ctx) {
|
|
4432
4613
|
throw new Error("InputOTP compound components must be used within <InputOTP>");
|
|
4433
4614
|
}
|
|
@@ -4439,7 +4620,7 @@ function extractDigits(str) {
|
|
|
4439
4620
|
}
|
|
4440
4621
|
|
|
4441
4622
|
// src/input-otp/useInputOTP.ts
|
|
4442
|
-
var
|
|
4623
|
+
var import_react40 = require("react");
|
|
4443
4624
|
function useInputOTP({
|
|
4444
4625
|
maxLength,
|
|
4445
4626
|
value,
|
|
@@ -4448,12 +4629,12 @@ function useInputOTP({
|
|
|
4448
4629
|
autoFocus,
|
|
4449
4630
|
error
|
|
4450
4631
|
}) {
|
|
4451
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
4452
|
-
const inputRefs = (0,
|
|
4453
|
-
const containerRef = (0,
|
|
4454
|
-
const blurTimeoutRef = (0,
|
|
4455
|
-
const slotsRef = (0,
|
|
4456
|
-
const slots = (0,
|
|
4632
|
+
const [activeIndex, setActiveIndex] = (0, import_react40.useState)(-1);
|
|
4633
|
+
const inputRefs = (0, import_react40.useRef)([]);
|
|
4634
|
+
const containerRef = (0, import_react40.useRef)(null);
|
|
4635
|
+
const blurTimeoutRef = (0, import_react40.useRef)();
|
|
4636
|
+
const slotsRef = (0, import_react40.useRef)(Array.from({ length: maxLength }, () => ""));
|
|
4637
|
+
const slots = (0, import_react40.useMemo)(() => {
|
|
4457
4638
|
const nextSlots = Array.from({ length: maxLength }, () => "");
|
|
4458
4639
|
for (let index = 0; index < Math.min(value.length, maxLength); index += 1) {
|
|
4459
4640
|
const char = value[index];
|
|
@@ -4464,7 +4645,7 @@ function useInputOTP({
|
|
|
4464
4645
|
return nextSlots;
|
|
4465
4646
|
}, [value, maxLength]);
|
|
4466
4647
|
slotsRef.current = slots;
|
|
4467
|
-
const emitValue = (0,
|
|
4648
|
+
const emitValue = (0, import_react40.useCallback)(
|
|
4468
4649
|
(newSlots) => {
|
|
4469
4650
|
let lastFilledIndex = -1;
|
|
4470
4651
|
for (let index = newSlots.length - 1; index >= 0; index -= 1) {
|
|
@@ -4485,12 +4666,12 @@ function useInputOTP({
|
|
|
4485
4666
|
},
|
|
4486
4667
|
[onChange]
|
|
4487
4668
|
);
|
|
4488
|
-
(0,
|
|
4669
|
+
(0, import_react40.useEffect)(() => {
|
|
4489
4670
|
if (autoFocus && inputRefs.current[0]) {
|
|
4490
4671
|
inputRefs.current[0].focus();
|
|
4491
4672
|
}
|
|
4492
4673
|
}, [autoFocus]);
|
|
4493
|
-
const handleContainerFocusIn = (0,
|
|
4674
|
+
const handleContainerFocusIn = (0, import_react40.useCallback)((event) => {
|
|
4494
4675
|
clearTimeout(blurTimeoutRef.current);
|
|
4495
4676
|
const target = event.target;
|
|
4496
4677
|
const slotIndex = inputRefs.current.indexOf(target);
|
|
@@ -4498,7 +4679,7 @@ function useInputOTP({
|
|
|
4498
4679
|
setActiveIndex(slotIndex);
|
|
4499
4680
|
}
|
|
4500
4681
|
}, []);
|
|
4501
|
-
const handleContainerFocusOut = (0,
|
|
4682
|
+
const handleContainerFocusOut = (0, import_react40.useCallback)(() => {
|
|
4502
4683
|
clearTimeout(blurTimeoutRef.current);
|
|
4503
4684
|
blurTimeoutRef.current = setTimeout(() => {
|
|
4504
4685
|
if (!containerRef.current?.contains(document.activeElement)) {
|
|
@@ -4506,8 +4687,8 @@ function useInputOTP({
|
|
|
4506
4687
|
}
|
|
4507
4688
|
}, 0);
|
|
4508
4689
|
}, []);
|
|
4509
|
-
(0,
|
|
4510
|
-
const handleDigitInput = (0,
|
|
4690
|
+
(0, import_react40.useEffect)(() => () => clearTimeout(blurTimeoutRef.current), []);
|
|
4691
|
+
const handleDigitInput = (0, import_react40.useCallback)(
|
|
4511
4692
|
(index, digit) => {
|
|
4512
4693
|
if (!DIGIT_REGEX.test(digit)) return;
|
|
4513
4694
|
const newSlots = [...slotsRef.current];
|
|
@@ -4521,7 +4702,7 @@ function useInputOTP({
|
|
|
4521
4702
|
},
|
|
4522
4703
|
[maxLength, emitValue]
|
|
4523
4704
|
);
|
|
4524
|
-
const handleDelete = (0,
|
|
4705
|
+
const handleDelete = (0, import_react40.useCallback)(
|
|
4525
4706
|
(index) => {
|
|
4526
4707
|
const newSlots = [...slotsRef.current];
|
|
4527
4708
|
if (newSlots[index]) {
|
|
@@ -4536,7 +4717,7 @@ function useInputOTP({
|
|
|
4536
4717
|
},
|
|
4537
4718
|
[emitValue]
|
|
4538
4719
|
);
|
|
4539
|
-
const handlePaste = (0,
|
|
4720
|
+
const handlePaste = (0, import_react40.useCallback)(
|
|
4540
4721
|
(text) => {
|
|
4541
4722
|
const digits = extractDigits(text).slice(0, maxLength);
|
|
4542
4723
|
if (digits.length > 0) {
|
|
@@ -4552,7 +4733,7 @@ function useInputOTP({
|
|
|
4552
4733
|
},
|
|
4553
4734
|
[maxLength, emitValue]
|
|
4554
4735
|
);
|
|
4555
|
-
const contextValue = (0,
|
|
4736
|
+
const contextValue = (0, import_react40.useMemo)(
|
|
4556
4737
|
() => ({
|
|
4557
4738
|
slots,
|
|
4558
4739
|
activeIndex,
|
|
@@ -4585,7 +4766,7 @@ function useInputOTP({
|
|
|
4585
4766
|
}
|
|
4586
4767
|
|
|
4587
4768
|
// src/input-otp/useInputOTPSlot.ts
|
|
4588
|
-
var
|
|
4769
|
+
var import_react41 = require("react");
|
|
4589
4770
|
function useInputOTPSlot(index) {
|
|
4590
4771
|
const {
|
|
4591
4772
|
slots,
|
|
@@ -4655,13 +4836,13 @@ function useInputOTPSlot(index) {
|
|
|
4655
4836
|
event.preventDefault();
|
|
4656
4837
|
handlePaste(event.clipboardData.getData("text/plain"));
|
|
4657
4838
|
};
|
|
4658
|
-
const setInputRef = (0,
|
|
4839
|
+
const setInputRef = (0, import_react41.useCallback)(
|
|
4659
4840
|
(element) => {
|
|
4660
4841
|
inputRefs.current[index] = element;
|
|
4661
4842
|
},
|
|
4662
4843
|
[index, inputRefs]
|
|
4663
4844
|
);
|
|
4664
|
-
const focusSlot = (0,
|
|
4845
|
+
const focusSlot = (0, import_react41.useCallback)(() => {
|
|
4665
4846
|
inputRefs.current[index]?.focus();
|
|
4666
4847
|
}, [index, inputRefs]);
|
|
4667
4848
|
return {
|
|
@@ -4763,7 +4944,7 @@ var InputOTPSeparator = React19.forwardRef(
|
|
|
4763
4944
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
4764
4945
|
|
|
4765
4946
|
// src/icons-dropdown/IconsDropdown.tsx
|
|
4766
|
-
var
|
|
4947
|
+
var import_react42 = require("react");
|
|
4767
4948
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4768
4949
|
function IconsDropdown({
|
|
4769
4950
|
icons,
|
|
@@ -4775,7 +4956,7 @@ function IconsDropdown({
|
|
|
4775
4956
|
defaultOpen,
|
|
4776
4957
|
onOpenChange: onOpenChangeProp
|
|
4777
4958
|
}) {
|
|
4778
|
-
const [open, setOpen] = (0,
|
|
4959
|
+
const [open, setOpen] = (0, import_react42.useState)(defaultOpen ?? false);
|
|
4779
4960
|
function handleOpenChange(value) {
|
|
4780
4961
|
setOpen(value);
|
|
4781
4962
|
onOpenChangeProp?.(value);
|
|
@@ -5358,9 +5539,9 @@ function LearnMoreButton({ label, ...props }) {
|
|
|
5358
5539
|
}
|
|
5359
5540
|
|
|
5360
5541
|
// src/link/Link.tsx
|
|
5361
|
-
var
|
|
5542
|
+
var import_react43 = require("react");
|
|
5362
5543
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5363
|
-
var LinkInternal = (0,
|
|
5544
|
+
var LinkInternal = (0, import_react43.forwardRef)(
|
|
5364
5545
|
({ disabled = false, className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5365
5546
|
"a",
|
|
5366
5547
|
{
|
|
@@ -5379,17 +5560,17 @@ var LinkInternal = (0, import_react39.forwardRef)(
|
|
|
5379
5560
|
)
|
|
5380
5561
|
);
|
|
5381
5562
|
LinkInternal.displayName = "Link";
|
|
5382
|
-
var Link = (0,
|
|
5563
|
+
var Link = (0, import_react43.memo)(LinkInternal);
|
|
5383
5564
|
|
|
5384
5565
|
// src/image-full-screen-view/ImageFullScreenView.tsx
|
|
5385
|
-
var
|
|
5566
|
+
var import_react44 = require("react");
|
|
5386
5567
|
var import_lucide_react20 = require("lucide-react");
|
|
5387
5568
|
var import_react_i18next13 = require("react-i18next");
|
|
5388
5569
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5389
5570
|
function ImageFullScreenView({ src, alt, onClose }) {
|
|
5390
5571
|
const { t } = (0, import_react_i18next13.useTranslation)();
|
|
5391
|
-
const [scale, setScale] = (0,
|
|
5392
|
-
const [rotation, setRotation] = (0,
|
|
5572
|
+
const [scale, setScale] = (0, import_react44.useState)(1);
|
|
5573
|
+
const [rotation, setRotation] = (0, import_react44.useState)(0);
|
|
5393
5574
|
useClickEscape({ onClick: onClose });
|
|
5394
5575
|
const zoomIn = () => setScale((value) => Math.min(value + 0.25, 3));
|
|
5395
5576
|
const zoomOut = () => setScale((value) => Math.max(value - 0.25, 0.5));
|
|
@@ -5587,7 +5768,7 @@ var METRIC_CARD_VARIANTS = {
|
|
|
5587
5768
|
};
|
|
5588
5769
|
|
|
5589
5770
|
// src/modal/Modal.tsx
|
|
5590
|
-
var
|
|
5771
|
+
var import_react45 = require("react");
|
|
5591
5772
|
var import_lucide_react23 = require("lucide-react");
|
|
5592
5773
|
|
|
5593
5774
|
// src/modal/styles.module.css
|
|
@@ -5618,7 +5799,7 @@ function Modal({
|
|
|
5618
5799
|
container,
|
|
5619
5800
|
modal
|
|
5620
5801
|
}) {
|
|
5621
|
-
const contentRef = (0,
|
|
5802
|
+
const contentRef = (0, import_react45.useRef)(null);
|
|
5622
5803
|
useScrollFrameIntoView(open, { elementRef: contentRef });
|
|
5623
5804
|
const handleClose = () => {
|
|
5624
5805
|
onOpenChange?.(false);
|
|
@@ -5660,7 +5841,7 @@ function Modal({
|
|
|
5660
5841
|
}
|
|
5661
5842
|
) });
|
|
5662
5843
|
}
|
|
5663
|
-
var ModalButton = (0,
|
|
5844
|
+
var ModalButton = (0, import_react45.forwardRef)(
|
|
5664
5845
|
({ children, size, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5665
5846
|
Button,
|
|
5666
5847
|
{
|
|
@@ -5676,9 +5857,9 @@ ModalButton.displayName = "ModalButton";
|
|
|
5676
5857
|
Modal.displayName = "Modal";
|
|
5677
5858
|
|
|
5678
5859
|
// src/modal-loader/ModalLoader.tsx
|
|
5679
|
-
var
|
|
5860
|
+
var import_react46 = require("react");
|
|
5680
5861
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5681
|
-
var ModalLoader = (0,
|
|
5862
|
+
var ModalLoader = (0, import_react46.memo)(({ visible, className }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5682
5863
|
"div",
|
|
5683
5864
|
{
|
|
5684
5865
|
className: cn(
|
|
@@ -6066,7 +6247,7 @@ var PopoverContent = React21.forwardRef(({ className, sideOffset = 8, align = "s
|
|
|
6066
6247
|
PopoverContent.displayName = "PopoverContent";
|
|
6067
6248
|
|
|
6068
6249
|
// src/radio/Radio.tsx
|
|
6069
|
-
var
|
|
6250
|
+
var import_react48 = require("react");
|
|
6070
6251
|
|
|
6071
6252
|
// src/radio-group/RadioGroup.tsx
|
|
6072
6253
|
var React22 = __toESM(require("react"), 1);
|
|
@@ -6099,11 +6280,11 @@ var RadioGroupItem = React22.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
6099
6280
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
6100
6281
|
|
|
6101
6282
|
// src/radio/useRadioOptions.ts
|
|
6102
|
-
var
|
|
6283
|
+
var import_react47 = require("react");
|
|
6103
6284
|
function useRadioOptions({ options, defaultValue, onChange }) {
|
|
6104
6285
|
const initialValue = (typeof defaultValue === "string" ? options.find((option) => option.value === defaultValue) : defaultValue) || "";
|
|
6105
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
6106
|
-
const handleValueChange = (0,
|
|
6286
|
+
const [selectedValue, setSelectedValue] = (0, import_react47.useState)(initialValue);
|
|
6287
|
+
const handleValueChange = (0, import_react47.useCallback)(
|
|
6107
6288
|
(value) => {
|
|
6108
6289
|
setSelectedValue(value);
|
|
6109
6290
|
const selectedOption = options.find((option) => option.value === value) || "";
|
|
@@ -6124,7 +6305,7 @@ var styles_default5 = {};
|
|
|
6124
6305
|
|
|
6125
6306
|
// src/radio/Radio.tsx
|
|
6126
6307
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
6127
|
-
var Radio = (0,
|
|
6308
|
+
var Radio = (0, import_react48.forwardRef)(
|
|
6128
6309
|
({ options, value, onChange, error, className = "", disabled = false, renderOption }, ref) => {
|
|
6129
6310
|
const { selectedValue, handleValueChange } = useRadioOptions({
|
|
6130
6311
|
options,
|
|
@@ -6514,7 +6695,7 @@ var SectionTagColors = /* @__PURE__ */ ((SectionTagColors2) => {
|
|
|
6514
6695
|
})(SectionTagColors || {});
|
|
6515
6696
|
|
|
6516
6697
|
// src/section/Section.tsx
|
|
6517
|
-
var
|
|
6698
|
+
var import_react49 = require("react");
|
|
6518
6699
|
var import_lucide_react31 = require("lucide-react");
|
|
6519
6700
|
|
|
6520
6701
|
// src/section/constants.ts
|
|
@@ -6541,7 +6722,7 @@ function TooltipInfo({ content, className }) {
|
|
|
6541
6722
|
}
|
|
6542
6723
|
) });
|
|
6543
6724
|
}
|
|
6544
|
-
var Section = (0,
|
|
6725
|
+
var Section = (0, import_react49.forwardRef)(
|
|
6545
6726
|
({
|
|
6546
6727
|
children,
|
|
6547
6728
|
title,
|
|
@@ -6593,17 +6774,17 @@ var Section = (0, import_react45.forwardRef)(
|
|
|
6593
6774
|
)
|
|
6594
6775
|
);
|
|
6595
6776
|
Section.displayName = "Section";
|
|
6596
|
-
var SubSection = (0,
|
|
6777
|
+
var SubSection = (0, import_react49.forwardRef)(
|
|
6597
6778
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Section, { ref, className: cn(Section_default.section_sub, className), ...props })
|
|
6598
6779
|
);
|
|
6599
6780
|
SubSection.displayName = "SubSection";
|
|
6600
|
-
var DividingSubsection = (0,
|
|
6781
|
+
var DividingSubsection = (0, import_react49.forwardRef)(
|
|
6601
6782
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SubSection, { ref, className: cn(Section_default.section_dividing, className), ...props })
|
|
6602
6783
|
);
|
|
6603
6784
|
DividingSubsection.displayName = "DividingSubsection";
|
|
6604
6785
|
|
|
6605
6786
|
// src/selectors/Selectors.tsx
|
|
6606
|
-
var
|
|
6787
|
+
var import_react50 = require("react");
|
|
6607
6788
|
|
|
6608
6789
|
// src/selector-button/styles.module.css
|
|
6609
6790
|
var styles_default7 = {};
|
|
@@ -6675,8 +6856,8 @@ var getValueArray = (value) => {
|
|
|
6675
6856
|
return [];
|
|
6676
6857
|
};
|
|
6677
6858
|
function getSelectorContent(label, disabled, readOnly, active) {
|
|
6678
|
-
if ((0,
|
|
6679
|
-
return (0,
|
|
6859
|
+
if ((0, import_react50.isValidElement)(label)) {
|
|
6860
|
+
return (0, import_react50.cloneElement)(label, {
|
|
6680
6861
|
disabled,
|
|
6681
6862
|
readOnly,
|
|
6682
6863
|
active
|
|
@@ -6721,7 +6902,7 @@ function SelectorsInternal({
|
|
|
6721
6902
|
}
|
|
6722
6903
|
};
|
|
6723
6904
|
const isAnyActive = getValueArray(value).length > 0;
|
|
6724
|
-
(0,
|
|
6905
|
+
(0, import_react50.useEffect)(() => {
|
|
6725
6906
|
onAnySelectorActive?.(isAnyActive);
|
|
6726
6907
|
}, [isAnyActive, onAnySelectorActive]);
|
|
6727
6908
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
@@ -6764,7 +6945,7 @@ function SelectorsInternal({
|
|
|
6764
6945
|
)
|
|
6765
6946
|
] });
|
|
6766
6947
|
}
|
|
6767
|
-
var Selectors = (0,
|
|
6948
|
+
var Selectors = (0, import_react50.forwardRef)(SelectorsInternal);
|
|
6768
6949
|
|
|
6769
6950
|
// src/separator/Separator.tsx
|
|
6770
6951
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
@@ -6924,19 +7105,19 @@ function Skeleton({ className, ...props }) {
|
|
|
6924
7105
|
}
|
|
6925
7106
|
|
|
6926
7107
|
// src/sidebar/SidebarContext.ts
|
|
6927
|
-
var
|
|
6928
|
-
var SidebarContext = (0,
|
|
7108
|
+
var import_react51 = require("react");
|
|
7109
|
+
var SidebarContext = (0, import_react51.createContext)(null);
|
|
6929
7110
|
|
|
6930
7111
|
// src/sidebar/useSidebarMenuButton.ts
|
|
6931
|
-
var
|
|
7112
|
+
var import_react53 = require("react");
|
|
6932
7113
|
|
|
6933
7114
|
// src/sidebar/SidebarMenuButtonContext.ts
|
|
6934
|
-
var
|
|
6935
|
-
var SidebarMenuButtonContext = (0,
|
|
7115
|
+
var import_react52 = require("react");
|
|
7116
|
+
var SidebarMenuButtonContext = (0, import_react52.createContext)(null);
|
|
6936
7117
|
|
|
6937
7118
|
// src/sidebar/useSidebarMenuButton.ts
|
|
6938
7119
|
function useSidebarMenuButton() {
|
|
6939
|
-
return (0,
|
|
7120
|
+
return (0, import_react53.useContext)(SidebarMenuButtonContext);
|
|
6940
7121
|
}
|
|
6941
7122
|
|
|
6942
7123
|
// src/sidebar/SidebarIcon.tsx
|
|
@@ -6977,16 +7158,16 @@ var SidebarIcon = ({
|
|
|
6977
7158
|
};
|
|
6978
7159
|
|
|
6979
7160
|
// src/sidebar/useSidebar.ts
|
|
6980
|
-
var
|
|
7161
|
+
var import_react54 = require("react");
|
|
6981
7162
|
function useSidebar() {
|
|
6982
|
-
const context = (0,
|
|
7163
|
+
const context = (0, import_react54.useContext)(SidebarContext);
|
|
6983
7164
|
if (!context) {
|
|
6984
7165
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
6985
7166
|
}
|
|
6986
7167
|
return context;
|
|
6987
7168
|
}
|
|
6988
7169
|
function useSidebarSafe() {
|
|
6989
|
-
return (0,
|
|
7170
|
+
return (0, import_react54.useContext)(SidebarContext);
|
|
6990
7171
|
}
|
|
6991
7172
|
|
|
6992
7173
|
// src/sidebar/Sidebar.tsx
|
|
@@ -7559,9 +7740,9 @@ var VALUE_PART = 1;
|
|
|
7559
7740
|
var getSidebarState = (stateName) => document.cookie.split("; ").find((row) => row.startsWith(`${stateName}=`))?.split("=")[VALUE_PART] === "true";
|
|
7560
7741
|
|
|
7561
7742
|
// src/circular-loader/CircularLoader.tsx
|
|
7562
|
-
var
|
|
7743
|
+
var import_react55 = __toESM(require("react"), 1);
|
|
7563
7744
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
7564
|
-
var CircularLoader =
|
|
7745
|
+
var CircularLoader = import_react55.default.memo(
|
|
7565
7746
|
({ visible = true, height, width, position, label, className }) => {
|
|
7566
7747
|
if (!visible) return null;
|
|
7567
7748
|
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
@@ -7655,10 +7836,10 @@ var CircularLoader = import_react51.default.memo(
|
|
|
7655
7836
|
CircularLoader.displayName = "CircularLoader";
|
|
7656
7837
|
|
|
7657
7838
|
// src/small-grid-single-item/SmallGridSingleItem.tsx
|
|
7658
|
-
var
|
|
7839
|
+
var import_react56 = require("react");
|
|
7659
7840
|
var import_lucide_react34 = require("lucide-react");
|
|
7660
7841
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
7661
|
-
var SmallGridSingleItem = (0,
|
|
7842
|
+
var SmallGridSingleItem = (0, import_react56.memo)(
|
|
7662
7843
|
({
|
|
7663
7844
|
title,
|
|
7664
7845
|
subtitle,
|
|
@@ -7779,7 +7960,7 @@ function SortingAction({
|
|
|
7779
7960
|
}
|
|
7780
7961
|
|
|
7781
7962
|
// src/status-button/StatusButton.tsx
|
|
7782
|
-
var
|
|
7963
|
+
var import_react57 = require("react");
|
|
7783
7964
|
var import_react_i18next20 = require("react-i18next");
|
|
7784
7965
|
var import_lucide_react36 = require("lucide-react");
|
|
7785
7966
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
@@ -7797,7 +7978,7 @@ function StatusButton({
|
|
|
7797
7978
|
...props
|
|
7798
7979
|
}) {
|
|
7799
7980
|
const { t } = (0, import_react_i18next20.useTranslation)();
|
|
7800
|
-
const configMap = (0,
|
|
7981
|
+
const configMap = (0, import_react57.useMemo)(() => {
|
|
7801
7982
|
const defaultLoadingConfig = {
|
|
7802
7983
|
text: loadingText ?? `${t("saving")}...`,
|
|
7803
7984
|
icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_lucide_react36.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
@@ -7922,9 +8103,9 @@ function Stepper({
|
|
|
7922
8103
|
}
|
|
7923
8104
|
|
|
7924
8105
|
// src/switch-blocks/SwitchBlocks.tsx
|
|
7925
|
-
var
|
|
8106
|
+
var import_react58 = require("react");
|
|
7926
8107
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
7927
|
-
var SwitchBlocksInternal = (0,
|
|
8108
|
+
var SwitchBlocksInternal = (0, import_react58.forwardRef)(
|
|
7928
8109
|
({ options, value, onChange, disabled, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
7929
8110
|
"div",
|
|
7930
8111
|
{
|
|
@@ -7948,7 +8129,7 @@ var SwitchBlocksInternal = (0, import_react54.forwardRef)(
|
|
|
7948
8129
|
)
|
|
7949
8130
|
);
|
|
7950
8131
|
SwitchBlocksInternal.displayName = "SwitchBlocks";
|
|
7951
|
-
var SwitchBlocks = (0,
|
|
8132
|
+
var SwitchBlocks = (0, import_react58.memo)(SwitchBlocksInternal);
|
|
7952
8133
|
|
|
7953
8134
|
// src/switch-group/SwitchGroup.tsx
|
|
7954
8135
|
var React26 = __toESM(require("react"), 1);
|
|
@@ -8008,7 +8189,7 @@ var SwitchGroup = React26.forwardRef(
|
|
|
8008
8189
|
SwitchGroup.displayName = "SwitchGroup";
|
|
8009
8190
|
|
|
8010
8191
|
// src/tabs/Tabs.tsx
|
|
8011
|
-
var
|
|
8192
|
+
var import_react59 = require("react");
|
|
8012
8193
|
var TabsPrimitive2 = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
8013
8194
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
8014
8195
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
@@ -8024,7 +8205,7 @@ var tabsListVariants = (0, import_class_variance_authority12.cva)("inline-flex i
|
|
|
8024
8205
|
variant: "default"
|
|
8025
8206
|
}
|
|
8026
8207
|
});
|
|
8027
|
-
var TabsList = (0,
|
|
8208
|
+
var TabsList = (0, import_react59.forwardRef)(
|
|
8028
8209
|
({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
8029
8210
|
TabsPrimitive2.List,
|
|
8030
8211
|
{
|
|
@@ -8049,7 +8230,7 @@ var tabsTriggerVariants = (0, import_class_variance_authority12.cva)(
|
|
|
8049
8230
|
}
|
|
8050
8231
|
}
|
|
8051
8232
|
);
|
|
8052
|
-
var TabsTrigger = (0,
|
|
8233
|
+
var TabsTrigger = (0, import_react59.forwardRef)(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
8053
8234
|
TabsPrimitive2.Trigger,
|
|
8054
8235
|
{
|
|
8055
8236
|
ref,
|
|
@@ -8058,7 +8239,7 @@ var TabsTrigger = (0, import_react55.forwardRef)(({ className, variant, ...props
|
|
|
8058
8239
|
}
|
|
8059
8240
|
));
|
|
8060
8241
|
TabsTrigger.displayName = TabsPrimitive2.Trigger.displayName;
|
|
8061
|
-
var TabsContent = (0,
|
|
8242
|
+
var TabsContent = (0, import_react59.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(TabsPrimitive2.Content, { ref, className, tabIndex: -1, ...props }));
|
|
8062
8243
|
TabsContent.displayName = TabsPrimitive2.Content.displayName;
|
|
8063
8244
|
|
|
8064
8245
|
// src/tabbed-section/TabbedSection.tsx
|
|
@@ -8199,11 +8380,11 @@ var TASK_VARIANTS = {
|
|
|
8199
8380
|
var import_sonner2 = require("sonner");
|
|
8200
8381
|
|
|
8201
8382
|
// src/toaster/useUpdateToast.ts
|
|
8202
|
-
var
|
|
8383
|
+
var import_react60 = require("react");
|
|
8203
8384
|
var import_sonner = require("sonner");
|
|
8204
8385
|
function useUpdateToast({ id }) {
|
|
8205
|
-
const toastIdRef = (0,
|
|
8206
|
-
const getToastOptions = (0,
|
|
8386
|
+
const toastIdRef = (0, import_react60.useRef)("");
|
|
8387
|
+
const getToastOptions = (0, import_react60.useCallback)(
|
|
8207
8388
|
(options) => ({
|
|
8208
8389
|
id: toastIdRef.current,
|
|
8209
8390
|
dismissible: false,
|
|
@@ -8318,7 +8499,7 @@ var ToggleGroupItem = React27.forwardRef(({ className, children, variant, size,
|
|
|
8318
8499
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
8319
8500
|
|
|
8320
8501
|
// src/toggle-group/Toggles.tsx
|
|
8321
|
-
var
|
|
8502
|
+
var import_react61 = require("react");
|
|
8322
8503
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
8323
8504
|
var getValueArray2 = (value) => {
|
|
8324
8505
|
if (value) {
|
|
@@ -8393,7 +8574,7 @@ function TogglesInternal({
|
|
|
8393
8574
|
}
|
|
8394
8575
|
};
|
|
8395
8576
|
const isAnyActive = getValueArray2(value).length > 0;
|
|
8396
|
-
(0,
|
|
8577
|
+
(0, import_react61.useEffect)(() => {
|
|
8397
8578
|
onAnySelectorActive?.(isAnyActive);
|
|
8398
8579
|
}, [isAnyActive, onAnySelectorActive]);
|
|
8399
8580
|
const currentValue = getValueArray2(value).map((item) => String(item));
|
|
@@ -8424,7 +8605,7 @@ function TogglesInternal({
|
|
|
8424
8605
|
}) })
|
|
8425
8606
|
] });
|
|
8426
8607
|
}
|
|
8427
|
-
var Toggles = (0,
|
|
8608
|
+
var Toggles = (0, import_react61.forwardRef)(TogglesInternal);
|
|
8428
8609
|
|
|
8429
8610
|
// src/text-field/TextField.tsx
|
|
8430
8611
|
var React28 = __toESM(require("react"), 1);
|
|
@@ -8635,16 +8816,16 @@ var TextField = React28.forwardRef(
|
|
|
8635
8816
|
TextField.displayName = "TextField";
|
|
8636
8817
|
|
|
8637
8818
|
// src/textarea/Textarea.tsx
|
|
8638
|
-
var
|
|
8819
|
+
var import_react62 = require("react");
|
|
8639
8820
|
|
|
8640
8821
|
// src/textarea/styles.module.css
|
|
8641
8822
|
var styles_default9 = {};
|
|
8642
8823
|
|
|
8643
8824
|
// src/textarea/Textarea.tsx
|
|
8644
8825
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
8645
|
-
var Textarea = (0,
|
|
8826
|
+
var Textarea = (0, import_react62.forwardRef)(
|
|
8646
8827
|
({ className, textareaClassName, label, disabled, name, invalid, ...textareaProps }, ref) => {
|
|
8647
|
-
const inputId = (0,
|
|
8828
|
+
const inputId = (0, import_react62.useId)();
|
|
8648
8829
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: cn(styles_default9.container, className), children: [
|
|
8649
8830
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
8650
8831
|
"textarea",
|
|
@@ -11537,7 +11718,7 @@ AirbnbSearchInput.displayName = "SearchInput";
|
|
|
11537
11718
|
var React41 = __toESM(require("react"), 1);
|
|
11538
11719
|
var import_lucide_react46 = require("lucide-react");
|
|
11539
11720
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
11540
|
-
var
|
|
11721
|
+
var import_react63 = require("react");
|
|
11541
11722
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
11542
11723
|
var ROW_HEIGHT = 48;
|
|
11543
11724
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
@@ -11612,7 +11793,7 @@ var SearchableSelectInternal = ({
|
|
|
11612
11793
|
const activeOptionId = highlightedIndex >= 0 ? getOptionId(reactId, highlightedIndex) : void 0;
|
|
11613
11794
|
useOutsideClick(containerRef, open && !isMobile ? () => closeSelect() : null);
|
|
11614
11795
|
const handleOnOpenChange = useEvent(onOpenChange);
|
|
11615
|
-
const setSelectOpen = (0,
|
|
11796
|
+
const setSelectOpen = (0, import_react63.useCallback)(
|
|
11616
11797
|
(nextOpen, options2) => {
|
|
11617
11798
|
setOpen(nextOpen);
|
|
11618
11799
|
handleOnOpenChange?.(nextOpen);
|
|
@@ -11980,39 +12161,6 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
11980
12161
|
}
|
|
11981
12162
|
return -1;
|
|
11982
12163
|
}
|
|
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
|
-
}
|
|
12016
12164
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12017
12165
|
0 && (module.exports = {
|
|
12018
12166
|
Accordion,
|
|
@@ -12282,18 +12430,22 @@ function copyToClipboard2(value) {
|
|
|
12282
12430
|
useAbortController,
|
|
12283
12431
|
useClickEscape,
|
|
12284
12432
|
useCombinedRef,
|
|
12433
|
+
useCopyToClipboard,
|
|
12285
12434
|
useDebounce,
|
|
12286
12435
|
useDebouncedFunction,
|
|
12287
12436
|
useEvent,
|
|
12288
12437
|
useHover,
|
|
12438
|
+
useIsFormTouched,
|
|
12289
12439
|
useIsMobile,
|
|
12290
12440
|
useIsMounted,
|
|
12441
|
+
useKeyDown,
|
|
12291
12442
|
useModalControls,
|
|
12292
12443
|
useOutsideClick,
|
|
12293
12444
|
usePagination,
|
|
12294
12445
|
usePrevious,
|
|
12295
12446
|
usePromisedModalControls,
|
|
12296
12447
|
useRadioOptions,
|
|
12448
|
+
useResetAfterRequestStatus,
|
|
12297
12449
|
useScreenResize,
|
|
12298
12450
|
useScrollFrameIntoView,
|
|
12299
12451
|
useScrollToTop,
|