@chekinapp/ui 0.0.26 → 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 +254 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -7
- package/dist/index.d.ts +43 -7
- package/dist/index.js +187 -71
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -302,14 +302,17 @@ __export(index_exports, {
|
|
|
302
302
|
useDebouncedFunction: () => useDebouncedFunction,
|
|
303
303
|
useEvent: () => useEvent,
|
|
304
304
|
useHover: () => useHover,
|
|
305
|
+
useIsFormTouched: () => useIsFormTouched,
|
|
305
306
|
useIsMobile: () => useIsMobile,
|
|
306
307
|
useIsMounted: () => useIsMounted,
|
|
308
|
+
useKeyDown: () => useKeyDown,
|
|
307
309
|
useModalControls: () => useModalControls,
|
|
308
310
|
useOutsideClick: () => useOutsideClick,
|
|
309
311
|
usePagination: () => usePagination,
|
|
310
312
|
usePrevious: () => usePrevious,
|
|
311
313
|
usePromisedModalControls: () => usePromisedModalControls,
|
|
312
314
|
useRadioOptions: () => useRadioOptions,
|
|
315
|
+
useResetAfterRequestStatus: () => useResetAfterRequestStatus,
|
|
313
316
|
useScreenResize: () => useScreenResize,
|
|
314
317
|
useScrollFrameIntoView: () => useScrollFrameIntoView,
|
|
315
318
|
useScrollToTop: () => useScrollToTop,
|
|
@@ -2927,21 +2930,35 @@ var useTimer = ({ seconds }) => {
|
|
|
2927
2930
|
|
|
2928
2931
|
// src/hooks/use-timeout.ts
|
|
2929
2932
|
var import_react25 = require("react");
|
|
2930
|
-
function useTimeout() {
|
|
2931
|
-
const
|
|
2932
|
-
const
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
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;
|
|
2945
2962
|
}
|
|
2946
2963
|
|
|
2947
2964
|
// src/hooks/use-hover.ts
|
|
@@ -2961,11 +2978,60 @@ function useHover() {
|
|
|
2961
2978
|
};
|
|
2962
2979
|
}
|
|
2963
2980
|
|
|
2964
|
-
// src/hooks/use-
|
|
2981
|
+
// src/hooks/use-key-down.ts
|
|
2965
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
|
+
|
|
3030
|
+
// src/hooks/use-promised-modal-controls.ts
|
|
3031
|
+
var import_react29 = require("react");
|
|
2966
3032
|
var usePromisedModalControls = () => {
|
|
2967
3033
|
const { closeModal, isOpen, openModal } = useModalControls();
|
|
2968
|
-
const resolveRef = (0,
|
|
3034
|
+
const resolveRef = (0, import_react29.useRef)();
|
|
2969
3035
|
const openModalWithPromise = async () => {
|
|
2970
3036
|
openModal();
|
|
2971
3037
|
return new Promise((resolve) => {
|
|
@@ -2980,6 +3046,56 @@ var usePromisedModalControls = () => {
|
|
|
2980
3046
|
};
|
|
2981
3047
|
};
|
|
2982
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
|
+
|
|
2983
3099
|
// src/dialog/Dialog.tsx
|
|
2984
3100
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2985
3101
|
function useIframeTitleFix(titleRef) {
|
|
@@ -3215,7 +3331,7 @@ function DownloadEntryFormsButton({
|
|
|
3215
3331
|
}
|
|
3216
3332
|
|
|
3217
3333
|
// src/dropdown-button/DropdownButton.tsx
|
|
3218
|
-
var
|
|
3334
|
+
var import_react31 = require("react");
|
|
3219
3335
|
|
|
3220
3336
|
// src/dropdown-menu/DropdownMenu.tsx
|
|
3221
3337
|
var React13 = __toESM(require("react"), 1);
|
|
@@ -3279,7 +3395,7 @@ function DropdownButton({
|
|
|
3279
3395
|
modal,
|
|
3280
3396
|
className
|
|
3281
3397
|
}) {
|
|
3282
|
-
const [isOpen, setIsOpen] = (0,
|
|
3398
|
+
const [isOpen, setIsOpen] = (0, import_react31.useState)(false);
|
|
3283
3399
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(DropdownMenu, { onOpenChange: setIsOpen, modal, children: [
|
|
3284
3400
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuTrigger, { asChild: true, children: typeof trigger === "function" ? trigger(isOpen) : trigger }),
|
|
3285
3401
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -3406,7 +3522,7 @@ var import_lucide_react12 = require("lucide-react");
|
|
|
3406
3522
|
var import_react_i18next7 = require("react-i18next");
|
|
3407
3523
|
|
|
3408
3524
|
// src/halo-icon/HaloIcon.tsx
|
|
3409
|
-
var
|
|
3525
|
+
var import_react32 = require("react");
|
|
3410
3526
|
|
|
3411
3527
|
// src/halo-icon/constants.ts
|
|
3412
3528
|
var HALO_ICON_STATUS = {
|
|
@@ -3436,7 +3552,7 @@ var statusStyles = {
|
|
|
3436
3552
|
color: "text-chekin-red"
|
|
3437
3553
|
}
|
|
3438
3554
|
};
|
|
3439
|
-
var HaloIcon = (0,
|
|
3555
|
+
var HaloIcon = (0, import_react32.forwardRef)(
|
|
3440
3556
|
({
|
|
3441
3557
|
children,
|
|
3442
3558
|
variant = "default",
|
|
@@ -3617,7 +3733,7 @@ var Switch = React15.forwardRef(
|
|
|
3617
3733
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
3618
3734
|
|
|
3619
3735
|
// src/video-player/VideoPlayer.tsx
|
|
3620
|
-
var
|
|
3736
|
+
var import_react33 = require("react");
|
|
3621
3737
|
var import_react_i18next8 = require("react-i18next");
|
|
3622
3738
|
var import_lucide_react13 = require("lucide-react");
|
|
3623
3739
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
@@ -3630,20 +3746,20 @@ function VideoPlayer({
|
|
|
3630
3746
|
autoPlay = false
|
|
3631
3747
|
}) {
|
|
3632
3748
|
const { t } = (0, import_react_i18next8.useTranslation)();
|
|
3633
|
-
const videoRef = (0,
|
|
3634
|
-
const iframeRef = (0,
|
|
3635
|
-
const containerRef = (0,
|
|
3636
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
3637
|
-
const [isMuted, setIsMuted] = (0,
|
|
3638
|
-
const [currentTime, setCurrentTime] = (0,
|
|
3639
|
-
const [duration, setDuration] = (0,
|
|
3640
|
-
const [isFullScreenMode, setIsFullScreenMode] = (0,
|
|
3641
|
-
const [isLoading, setIsLoading] = (0,
|
|
3642
|
-
const [videoSource, setVideoSource] = (0,
|
|
3643
|
-
const [youtubeEmbedUrl, setYoutubeEmbedUrl] = (0,
|
|
3644
|
-
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)("");
|
|
3645
3761
|
useClickEscape({ enabled: isFullScreenMode, onClick: onClose });
|
|
3646
|
-
(0,
|
|
3762
|
+
(0, import_react33.useEffect)(() => {
|
|
3647
3763
|
const youtubeRegex = /(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/;
|
|
3648
3764
|
const vimeoRegex = /(?:vimeo\.com\/|vimeo\.com\/video\/)(\d+)/;
|
|
3649
3765
|
const youtubeMatch = src.match(youtubeRegex);
|
|
@@ -3672,7 +3788,7 @@ function VideoPlayer({
|
|
|
3672
3788
|
setYoutubeEmbedUrl("");
|
|
3673
3789
|
setVimeoEmbedUrl("");
|
|
3674
3790
|
}, [src, autoPlay]);
|
|
3675
|
-
(0,
|
|
3791
|
+
(0, import_react33.useEffect)(() => {
|
|
3676
3792
|
if (videoSource !== "file") return;
|
|
3677
3793
|
const video = videoRef.current;
|
|
3678
3794
|
if (!video) return;
|
|
@@ -3700,7 +3816,7 @@ function VideoPlayer({
|
|
|
3700
3816
|
video.removeEventListener("canplay", handleCanPlay);
|
|
3701
3817
|
};
|
|
3702
3818
|
}, [videoSource]);
|
|
3703
|
-
(0,
|
|
3819
|
+
(0, import_react33.useEffect)(() => {
|
|
3704
3820
|
if (isFullScreenMode && videoRef.current && videoSource === "file") {
|
|
3705
3821
|
void videoRef.current.play();
|
|
3706
3822
|
setIsPlaying(true);
|
|
@@ -3977,10 +4093,10 @@ function FeatureCard({
|
|
|
3977
4093
|
}
|
|
3978
4094
|
|
|
3979
4095
|
// src/file-input-button/FileInputButton.tsx
|
|
3980
|
-
var
|
|
4096
|
+
var import_react34 = require("react");
|
|
3981
4097
|
var import_lucide_react15 = require("lucide-react");
|
|
3982
4098
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3983
|
-
var FileInputButton = (0,
|
|
4099
|
+
var FileInputButton = (0, import_react34.forwardRef)(
|
|
3984
4100
|
({
|
|
3985
4101
|
label,
|
|
3986
4102
|
onChange,
|
|
@@ -3992,7 +4108,7 @@ var FileInputButton = (0, import_react31.forwardRef)(
|
|
|
3992
4108
|
size = "default",
|
|
3993
4109
|
...props
|
|
3994
4110
|
}, ref) => {
|
|
3995
|
-
const handleChange = (0,
|
|
4111
|
+
const handleChange = (0, import_react34.useCallback)(
|
|
3996
4112
|
(event) => {
|
|
3997
4113
|
onChange?.(event);
|
|
3998
4114
|
event.target.value = "";
|
|
@@ -4072,7 +4188,7 @@ var FormBox = {
|
|
|
4072
4188
|
};
|
|
4073
4189
|
|
|
4074
4190
|
// src/free-text-field/FreeTextField.tsx
|
|
4075
|
-
var
|
|
4191
|
+
var import_react35 = require("react");
|
|
4076
4192
|
var import_react_i18next10 = require("react-i18next");
|
|
4077
4193
|
|
|
4078
4194
|
// src/free-text-field/styles.module.css
|
|
@@ -4080,7 +4196,7 @@ var styles_default3 = {};
|
|
|
4080
4196
|
|
|
4081
4197
|
// src/free-text-field/FreeTextField.tsx
|
|
4082
4198
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4083
|
-
var FreeTextField = (0,
|
|
4199
|
+
var FreeTextField = (0, import_react35.forwardRef)(
|
|
4084
4200
|
({
|
|
4085
4201
|
label,
|
|
4086
4202
|
error,
|
|
@@ -4102,9 +4218,9 @@ var FreeTextField = (0, import_react32.forwardRef)(
|
|
|
4102
4218
|
...inputProps
|
|
4103
4219
|
}, ref) => {
|
|
4104
4220
|
const { t } = (0, import_react_i18next10.useTranslation)();
|
|
4105
|
-
const inputId = (0,
|
|
4106
|
-
const [internalValue, setInternalValue] = (0,
|
|
4107
|
-
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);
|
|
4108
4224
|
const currentValue = value !== void 0 ? value : internalValue;
|
|
4109
4225
|
const isEmpty = !currentValue || String(currentValue).length === 0;
|
|
4110
4226
|
const hasError = Boolean(error);
|
|
@@ -4227,9 +4343,9 @@ var FramedIcon = React16.forwardRef(
|
|
|
4227
4343
|
FramedIcon.displayName = "FramedIcon";
|
|
4228
4344
|
|
|
4229
4345
|
// src/grid-items/GridItems.tsx
|
|
4230
|
-
var
|
|
4346
|
+
var import_react36 = require("react");
|
|
4231
4347
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4232
|
-
var GridItems = (0,
|
|
4348
|
+
var GridItems = (0, import_react36.forwardRef)(
|
|
4233
4349
|
({ children, title, placeholder, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
4234
4350
|
"div",
|
|
4235
4351
|
{
|
|
@@ -4306,9 +4422,9 @@ function HelpTooltip({
|
|
|
4306
4422
|
}
|
|
4307
4423
|
|
|
4308
4424
|
// src/icon/Icon.tsx
|
|
4309
|
-
var
|
|
4425
|
+
var import_react37 = require("react");
|
|
4310
4426
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4311
|
-
var MissingIcon = (0,
|
|
4427
|
+
var MissingIcon = (0, import_react37.forwardRef)(
|
|
4312
4428
|
({ size = 24, className = "", fallback = null, color, ...props }, ref) => {
|
|
4313
4429
|
if (fallback) {
|
|
4314
4430
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, { children: fallback });
|
|
@@ -4337,8 +4453,8 @@ var MissingIcon = (0, import_react34.forwardRef)(
|
|
|
4337
4453
|
}
|
|
4338
4454
|
);
|
|
4339
4455
|
MissingIcon.displayName = "MissingIcon";
|
|
4340
|
-
var Icon = (0,
|
|
4341
|
-
(0,
|
|
4456
|
+
var Icon = (0, import_react37.memo)(
|
|
4457
|
+
(0, import_react37.forwardRef)(
|
|
4342
4458
|
({ name: _name, size = 24, className = "", fallback = null, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4343
4459
|
MissingIcon,
|
|
4344
4460
|
{
|
|
@@ -4436,7 +4552,7 @@ function InfoBox({ className, children }) {
|
|
|
4436
4552
|
}
|
|
4437
4553
|
|
|
4438
4554
|
// src/image/Image.tsx
|
|
4439
|
-
var
|
|
4555
|
+
var import_react38 = require("react");
|
|
4440
4556
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4441
4557
|
function Image2({
|
|
4442
4558
|
src,
|
|
@@ -4445,7 +4561,7 @@ function Image2({
|
|
|
4445
4561
|
fallbackSrc = "https://placehold.co/600x400?text=Image",
|
|
4446
4562
|
...props
|
|
4447
4563
|
}) {
|
|
4448
|
-
const [error, setError] = (0,
|
|
4564
|
+
const [error, setError] = (0, import_react38.useState)(false);
|
|
4449
4565
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4450
4566
|
"img",
|
|
4451
4567
|
{
|
|
@@ -4489,10 +4605,10 @@ Input.displayName = "Input";
|
|
|
4489
4605
|
var React19 = __toESM(require("react"), 1);
|
|
4490
4606
|
|
|
4491
4607
|
// src/input-otp/InputOTPContext.ts
|
|
4492
|
-
var
|
|
4493
|
-
var InputOTPContext = (0,
|
|
4608
|
+
var import_react39 = require("react");
|
|
4609
|
+
var InputOTPContext = (0, import_react39.createContext)(null);
|
|
4494
4610
|
function useInputOTPContext() {
|
|
4495
|
-
const ctx = (0,
|
|
4611
|
+
const ctx = (0, import_react39.useContext)(InputOTPContext);
|
|
4496
4612
|
if (!ctx) {
|
|
4497
4613
|
throw new Error("InputOTP compound components must be used within <InputOTP>");
|
|
4498
4614
|
}
|
|
@@ -4504,7 +4620,7 @@ function extractDigits(str) {
|
|
|
4504
4620
|
}
|
|
4505
4621
|
|
|
4506
4622
|
// src/input-otp/useInputOTP.ts
|
|
4507
|
-
var
|
|
4623
|
+
var import_react40 = require("react");
|
|
4508
4624
|
function useInputOTP({
|
|
4509
4625
|
maxLength,
|
|
4510
4626
|
value,
|
|
@@ -4513,12 +4629,12 @@ function useInputOTP({
|
|
|
4513
4629
|
autoFocus,
|
|
4514
4630
|
error
|
|
4515
4631
|
}) {
|
|
4516
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
4517
|
-
const inputRefs = (0,
|
|
4518
|
-
const containerRef = (0,
|
|
4519
|
-
const blurTimeoutRef = (0,
|
|
4520
|
-
const slotsRef = (0,
|
|
4521
|
-
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)(() => {
|
|
4522
4638
|
const nextSlots = Array.from({ length: maxLength }, () => "");
|
|
4523
4639
|
for (let index = 0; index < Math.min(value.length, maxLength); index += 1) {
|
|
4524
4640
|
const char = value[index];
|
|
@@ -4529,7 +4645,7 @@ function useInputOTP({
|
|
|
4529
4645
|
return nextSlots;
|
|
4530
4646
|
}, [value, maxLength]);
|
|
4531
4647
|
slotsRef.current = slots;
|
|
4532
|
-
const emitValue = (0,
|
|
4648
|
+
const emitValue = (0, import_react40.useCallback)(
|
|
4533
4649
|
(newSlots) => {
|
|
4534
4650
|
let lastFilledIndex = -1;
|
|
4535
4651
|
for (let index = newSlots.length - 1; index >= 0; index -= 1) {
|
|
@@ -4550,12 +4666,12 @@ function useInputOTP({
|
|
|
4550
4666
|
},
|
|
4551
4667
|
[onChange]
|
|
4552
4668
|
);
|
|
4553
|
-
(0,
|
|
4669
|
+
(0, import_react40.useEffect)(() => {
|
|
4554
4670
|
if (autoFocus && inputRefs.current[0]) {
|
|
4555
4671
|
inputRefs.current[0].focus();
|
|
4556
4672
|
}
|
|
4557
4673
|
}, [autoFocus]);
|
|
4558
|
-
const handleContainerFocusIn = (0,
|
|
4674
|
+
const handleContainerFocusIn = (0, import_react40.useCallback)((event) => {
|
|
4559
4675
|
clearTimeout(blurTimeoutRef.current);
|
|
4560
4676
|
const target = event.target;
|
|
4561
4677
|
const slotIndex = inputRefs.current.indexOf(target);
|
|
@@ -4563,7 +4679,7 @@ function useInputOTP({
|
|
|
4563
4679
|
setActiveIndex(slotIndex);
|
|
4564
4680
|
}
|
|
4565
4681
|
}, []);
|
|
4566
|
-
const handleContainerFocusOut = (0,
|
|
4682
|
+
const handleContainerFocusOut = (0, import_react40.useCallback)(() => {
|
|
4567
4683
|
clearTimeout(blurTimeoutRef.current);
|
|
4568
4684
|
blurTimeoutRef.current = setTimeout(() => {
|
|
4569
4685
|
if (!containerRef.current?.contains(document.activeElement)) {
|
|
@@ -4571,8 +4687,8 @@ function useInputOTP({
|
|
|
4571
4687
|
}
|
|
4572
4688
|
}, 0);
|
|
4573
4689
|
}, []);
|
|
4574
|
-
(0,
|
|
4575
|
-
const handleDigitInput = (0,
|
|
4690
|
+
(0, import_react40.useEffect)(() => () => clearTimeout(blurTimeoutRef.current), []);
|
|
4691
|
+
const handleDigitInput = (0, import_react40.useCallback)(
|
|
4576
4692
|
(index, digit) => {
|
|
4577
4693
|
if (!DIGIT_REGEX.test(digit)) return;
|
|
4578
4694
|
const newSlots = [...slotsRef.current];
|
|
@@ -4586,7 +4702,7 @@ function useInputOTP({
|
|
|
4586
4702
|
},
|
|
4587
4703
|
[maxLength, emitValue]
|
|
4588
4704
|
);
|
|
4589
|
-
const handleDelete = (0,
|
|
4705
|
+
const handleDelete = (0, import_react40.useCallback)(
|
|
4590
4706
|
(index) => {
|
|
4591
4707
|
const newSlots = [...slotsRef.current];
|
|
4592
4708
|
if (newSlots[index]) {
|
|
@@ -4601,7 +4717,7 @@ function useInputOTP({
|
|
|
4601
4717
|
},
|
|
4602
4718
|
[emitValue]
|
|
4603
4719
|
);
|
|
4604
|
-
const handlePaste = (0,
|
|
4720
|
+
const handlePaste = (0, import_react40.useCallback)(
|
|
4605
4721
|
(text) => {
|
|
4606
4722
|
const digits = extractDigits(text).slice(0, maxLength);
|
|
4607
4723
|
if (digits.length > 0) {
|
|
@@ -4617,7 +4733,7 @@ function useInputOTP({
|
|
|
4617
4733
|
},
|
|
4618
4734
|
[maxLength, emitValue]
|
|
4619
4735
|
);
|
|
4620
|
-
const contextValue = (0,
|
|
4736
|
+
const contextValue = (0, import_react40.useMemo)(
|
|
4621
4737
|
() => ({
|
|
4622
4738
|
slots,
|
|
4623
4739
|
activeIndex,
|
|
@@ -4650,7 +4766,7 @@ function useInputOTP({
|
|
|
4650
4766
|
}
|
|
4651
4767
|
|
|
4652
4768
|
// src/input-otp/useInputOTPSlot.ts
|
|
4653
|
-
var
|
|
4769
|
+
var import_react41 = require("react");
|
|
4654
4770
|
function useInputOTPSlot(index) {
|
|
4655
4771
|
const {
|
|
4656
4772
|
slots,
|
|
@@ -4720,13 +4836,13 @@ function useInputOTPSlot(index) {
|
|
|
4720
4836
|
event.preventDefault();
|
|
4721
4837
|
handlePaste(event.clipboardData.getData("text/plain"));
|
|
4722
4838
|
};
|
|
4723
|
-
const setInputRef = (0,
|
|
4839
|
+
const setInputRef = (0, import_react41.useCallback)(
|
|
4724
4840
|
(element) => {
|
|
4725
4841
|
inputRefs.current[index] = element;
|
|
4726
4842
|
},
|
|
4727
4843
|
[index, inputRefs]
|
|
4728
4844
|
);
|
|
4729
|
-
const focusSlot = (0,
|
|
4845
|
+
const focusSlot = (0, import_react41.useCallback)(() => {
|
|
4730
4846
|
inputRefs.current[index]?.focus();
|
|
4731
4847
|
}, [index, inputRefs]);
|
|
4732
4848
|
return {
|
|
@@ -4828,7 +4944,7 @@ var InputOTPSeparator = React19.forwardRef(
|
|
|
4828
4944
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
4829
4945
|
|
|
4830
4946
|
// src/icons-dropdown/IconsDropdown.tsx
|
|
4831
|
-
var
|
|
4947
|
+
var import_react42 = require("react");
|
|
4832
4948
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4833
4949
|
function IconsDropdown({
|
|
4834
4950
|
icons,
|
|
@@ -4840,7 +4956,7 @@ function IconsDropdown({
|
|
|
4840
4956
|
defaultOpen,
|
|
4841
4957
|
onOpenChange: onOpenChangeProp
|
|
4842
4958
|
}) {
|
|
4843
|
-
const [open, setOpen] = (0,
|
|
4959
|
+
const [open, setOpen] = (0, import_react42.useState)(defaultOpen ?? false);
|
|
4844
4960
|
function handleOpenChange(value) {
|
|
4845
4961
|
setOpen(value);
|
|
4846
4962
|
onOpenChangeProp?.(value);
|
|
@@ -5423,9 +5539,9 @@ function LearnMoreButton({ label, ...props }) {
|
|
|
5423
5539
|
}
|
|
5424
5540
|
|
|
5425
5541
|
// src/link/Link.tsx
|
|
5426
|
-
var
|
|
5542
|
+
var import_react43 = require("react");
|
|
5427
5543
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5428
|
-
var LinkInternal = (0,
|
|
5544
|
+
var LinkInternal = (0, import_react43.forwardRef)(
|
|
5429
5545
|
({ disabled = false, className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5430
5546
|
"a",
|
|
5431
5547
|
{
|
|
@@ -5444,17 +5560,17 @@ var LinkInternal = (0, import_react40.forwardRef)(
|
|
|
5444
5560
|
)
|
|
5445
5561
|
);
|
|
5446
5562
|
LinkInternal.displayName = "Link";
|
|
5447
|
-
var Link = (0,
|
|
5563
|
+
var Link = (0, import_react43.memo)(LinkInternal);
|
|
5448
5564
|
|
|
5449
5565
|
// src/image-full-screen-view/ImageFullScreenView.tsx
|
|
5450
|
-
var
|
|
5566
|
+
var import_react44 = require("react");
|
|
5451
5567
|
var import_lucide_react20 = require("lucide-react");
|
|
5452
5568
|
var import_react_i18next13 = require("react-i18next");
|
|
5453
5569
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5454
5570
|
function ImageFullScreenView({ src, alt, onClose }) {
|
|
5455
5571
|
const { t } = (0, import_react_i18next13.useTranslation)();
|
|
5456
|
-
const [scale, setScale] = (0,
|
|
5457
|
-
const [rotation, setRotation] = (0,
|
|
5572
|
+
const [scale, setScale] = (0, import_react44.useState)(1);
|
|
5573
|
+
const [rotation, setRotation] = (0, import_react44.useState)(0);
|
|
5458
5574
|
useClickEscape({ onClick: onClose });
|
|
5459
5575
|
const zoomIn = () => setScale((value) => Math.min(value + 0.25, 3));
|
|
5460
5576
|
const zoomOut = () => setScale((value) => Math.max(value - 0.25, 0.5));
|
|
@@ -5652,7 +5768,7 @@ var METRIC_CARD_VARIANTS = {
|
|
|
5652
5768
|
};
|
|
5653
5769
|
|
|
5654
5770
|
// src/modal/Modal.tsx
|
|
5655
|
-
var
|
|
5771
|
+
var import_react45 = require("react");
|
|
5656
5772
|
var import_lucide_react23 = require("lucide-react");
|
|
5657
5773
|
|
|
5658
5774
|
// src/modal/styles.module.css
|
|
@@ -5683,7 +5799,7 @@ function Modal({
|
|
|
5683
5799
|
container,
|
|
5684
5800
|
modal
|
|
5685
5801
|
}) {
|
|
5686
|
-
const contentRef = (0,
|
|
5802
|
+
const contentRef = (0, import_react45.useRef)(null);
|
|
5687
5803
|
useScrollFrameIntoView(open, { elementRef: contentRef });
|
|
5688
5804
|
const handleClose = () => {
|
|
5689
5805
|
onOpenChange?.(false);
|
|
@@ -5725,7 +5841,7 @@ function Modal({
|
|
|
5725
5841
|
}
|
|
5726
5842
|
) });
|
|
5727
5843
|
}
|
|
5728
|
-
var ModalButton = (0,
|
|
5844
|
+
var ModalButton = (0, import_react45.forwardRef)(
|
|
5729
5845
|
({ children, size, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5730
5846
|
Button,
|
|
5731
5847
|
{
|
|
@@ -5741,9 +5857,9 @@ ModalButton.displayName = "ModalButton";
|
|
|
5741
5857
|
Modal.displayName = "Modal";
|
|
5742
5858
|
|
|
5743
5859
|
// src/modal-loader/ModalLoader.tsx
|
|
5744
|
-
var
|
|
5860
|
+
var import_react46 = require("react");
|
|
5745
5861
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5746
|
-
var ModalLoader = (0,
|
|
5862
|
+
var ModalLoader = (0, import_react46.memo)(({ visible, className }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5747
5863
|
"div",
|
|
5748
5864
|
{
|
|
5749
5865
|
className: cn(
|
|
@@ -6131,7 +6247,7 @@ var PopoverContent = React21.forwardRef(({ className, sideOffset = 8, align = "s
|
|
|
6131
6247
|
PopoverContent.displayName = "PopoverContent";
|
|
6132
6248
|
|
|
6133
6249
|
// src/radio/Radio.tsx
|
|
6134
|
-
var
|
|
6250
|
+
var import_react48 = require("react");
|
|
6135
6251
|
|
|
6136
6252
|
// src/radio-group/RadioGroup.tsx
|
|
6137
6253
|
var React22 = __toESM(require("react"), 1);
|
|
@@ -6164,11 +6280,11 @@ var RadioGroupItem = React22.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
6164
6280
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
6165
6281
|
|
|
6166
6282
|
// src/radio/useRadioOptions.ts
|
|
6167
|
-
var
|
|
6283
|
+
var import_react47 = require("react");
|
|
6168
6284
|
function useRadioOptions({ options, defaultValue, onChange }) {
|
|
6169
6285
|
const initialValue = (typeof defaultValue === "string" ? options.find((option) => option.value === defaultValue) : defaultValue) || "";
|
|
6170
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
6171
|
-
const handleValueChange = (0,
|
|
6286
|
+
const [selectedValue, setSelectedValue] = (0, import_react47.useState)(initialValue);
|
|
6287
|
+
const handleValueChange = (0, import_react47.useCallback)(
|
|
6172
6288
|
(value) => {
|
|
6173
6289
|
setSelectedValue(value);
|
|
6174
6290
|
const selectedOption = options.find((option) => option.value === value) || "";
|
|
@@ -6189,7 +6305,7 @@ var styles_default5 = {};
|
|
|
6189
6305
|
|
|
6190
6306
|
// src/radio/Radio.tsx
|
|
6191
6307
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
6192
|
-
var Radio = (0,
|
|
6308
|
+
var Radio = (0, import_react48.forwardRef)(
|
|
6193
6309
|
({ options, value, onChange, error, className = "", disabled = false, renderOption }, ref) => {
|
|
6194
6310
|
const { selectedValue, handleValueChange } = useRadioOptions({
|
|
6195
6311
|
options,
|
|
@@ -6579,7 +6695,7 @@ var SectionTagColors = /* @__PURE__ */ ((SectionTagColors2) => {
|
|
|
6579
6695
|
})(SectionTagColors || {});
|
|
6580
6696
|
|
|
6581
6697
|
// src/section/Section.tsx
|
|
6582
|
-
var
|
|
6698
|
+
var import_react49 = require("react");
|
|
6583
6699
|
var import_lucide_react31 = require("lucide-react");
|
|
6584
6700
|
|
|
6585
6701
|
// src/section/constants.ts
|
|
@@ -6606,7 +6722,7 @@ function TooltipInfo({ content, className }) {
|
|
|
6606
6722
|
}
|
|
6607
6723
|
) });
|
|
6608
6724
|
}
|
|
6609
|
-
var Section = (0,
|
|
6725
|
+
var Section = (0, import_react49.forwardRef)(
|
|
6610
6726
|
({
|
|
6611
6727
|
children,
|
|
6612
6728
|
title,
|
|
@@ -6658,17 +6774,17 @@ var Section = (0, import_react46.forwardRef)(
|
|
|
6658
6774
|
)
|
|
6659
6775
|
);
|
|
6660
6776
|
Section.displayName = "Section";
|
|
6661
|
-
var SubSection = (0,
|
|
6777
|
+
var SubSection = (0, import_react49.forwardRef)(
|
|
6662
6778
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Section, { ref, className: cn(Section_default.section_sub, className), ...props })
|
|
6663
6779
|
);
|
|
6664
6780
|
SubSection.displayName = "SubSection";
|
|
6665
|
-
var DividingSubsection = (0,
|
|
6781
|
+
var DividingSubsection = (0, import_react49.forwardRef)(
|
|
6666
6782
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SubSection, { ref, className: cn(Section_default.section_dividing, className), ...props })
|
|
6667
6783
|
);
|
|
6668
6784
|
DividingSubsection.displayName = "DividingSubsection";
|
|
6669
6785
|
|
|
6670
6786
|
// src/selectors/Selectors.tsx
|
|
6671
|
-
var
|
|
6787
|
+
var import_react50 = require("react");
|
|
6672
6788
|
|
|
6673
6789
|
// src/selector-button/styles.module.css
|
|
6674
6790
|
var styles_default7 = {};
|
|
@@ -6740,8 +6856,8 @@ var getValueArray = (value) => {
|
|
|
6740
6856
|
return [];
|
|
6741
6857
|
};
|
|
6742
6858
|
function getSelectorContent(label, disabled, readOnly, active) {
|
|
6743
|
-
if ((0,
|
|
6744
|
-
return (0,
|
|
6859
|
+
if ((0, import_react50.isValidElement)(label)) {
|
|
6860
|
+
return (0, import_react50.cloneElement)(label, {
|
|
6745
6861
|
disabled,
|
|
6746
6862
|
readOnly,
|
|
6747
6863
|
active
|
|
@@ -6786,7 +6902,7 @@ function SelectorsInternal({
|
|
|
6786
6902
|
}
|
|
6787
6903
|
};
|
|
6788
6904
|
const isAnyActive = getValueArray(value).length > 0;
|
|
6789
|
-
(0,
|
|
6905
|
+
(0, import_react50.useEffect)(() => {
|
|
6790
6906
|
onAnySelectorActive?.(isAnyActive);
|
|
6791
6907
|
}, [isAnyActive, onAnySelectorActive]);
|
|
6792
6908
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
@@ -6829,7 +6945,7 @@ function SelectorsInternal({
|
|
|
6829
6945
|
)
|
|
6830
6946
|
] });
|
|
6831
6947
|
}
|
|
6832
|
-
var Selectors = (0,
|
|
6948
|
+
var Selectors = (0, import_react50.forwardRef)(SelectorsInternal);
|
|
6833
6949
|
|
|
6834
6950
|
// src/separator/Separator.tsx
|
|
6835
6951
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
@@ -6989,19 +7105,19 @@ function Skeleton({ className, ...props }) {
|
|
|
6989
7105
|
}
|
|
6990
7106
|
|
|
6991
7107
|
// src/sidebar/SidebarContext.ts
|
|
6992
|
-
var
|
|
6993
|
-
var SidebarContext = (0,
|
|
7108
|
+
var import_react51 = require("react");
|
|
7109
|
+
var SidebarContext = (0, import_react51.createContext)(null);
|
|
6994
7110
|
|
|
6995
7111
|
// src/sidebar/useSidebarMenuButton.ts
|
|
6996
|
-
var
|
|
7112
|
+
var import_react53 = require("react");
|
|
6997
7113
|
|
|
6998
7114
|
// src/sidebar/SidebarMenuButtonContext.ts
|
|
6999
|
-
var
|
|
7000
|
-
var SidebarMenuButtonContext = (0,
|
|
7115
|
+
var import_react52 = require("react");
|
|
7116
|
+
var SidebarMenuButtonContext = (0, import_react52.createContext)(null);
|
|
7001
7117
|
|
|
7002
7118
|
// src/sidebar/useSidebarMenuButton.ts
|
|
7003
7119
|
function useSidebarMenuButton() {
|
|
7004
|
-
return (0,
|
|
7120
|
+
return (0, import_react53.useContext)(SidebarMenuButtonContext);
|
|
7005
7121
|
}
|
|
7006
7122
|
|
|
7007
7123
|
// src/sidebar/SidebarIcon.tsx
|
|
@@ -7042,16 +7158,16 @@ var SidebarIcon = ({
|
|
|
7042
7158
|
};
|
|
7043
7159
|
|
|
7044
7160
|
// src/sidebar/useSidebar.ts
|
|
7045
|
-
var
|
|
7161
|
+
var import_react54 = require("react");
|
|
7046
7162
|
function useSidebar() {
|
|
7047
|
-
const context = (0,
|
|
7163
|
+
const context = (0, import_react54.useContext)(SidebarContext);
|
|
7048
7164
|
if (!context) {
|
|
7049
7165
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
7050
7166
|
}
|
|
7051
7167
|
return context;
|
|
7052
7168
|
}
|
|
7053
7169
|
function useSidebarSafe() {
|
|
7054
|
-
return (0,
|
|
7170
|
+
return (0, import_react54.useContext)(SidebarContext);
|
|
7055
7171
|
}
|
|
7056
7172
|
|
|
7057
7173
|
// src/sidebar/Sidebar.tsx
|
|
@@ -7624,9 +7740,9 @@ var VALUE_PART = 1;
|
|
|
7624
7740
|
var getSidebarState = (stateName) => document.cookie.split("; ").find((row) => row.startsWith(`${stateName}=`))?.split("=")[VALUE_PART] === "true";
|
|
7625
7741
|
|
|
7626
7742
|
// src/circular-loader/CircularLoader.tsx
|
|
7627
|
-
var
|
|
7743
|
+
var import_react55 = __toESM(require("react"), 1);
|
|
7628
7744
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
7629
|
-
var CircularLoader =
|
|
7745
|
+
var CircularLoader = import_react55.default.memo(
|
|
7630
7746
|
({ visible = true, height, width, position, label, className }) => {
|
|
7631
7747
|
if (!visible) return null;
|
|
7632
7748
|
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
@@ -7720,10 +7836,10 @@ var CircularLoader = import_react52.default.memo(
|
|
|
7720
7836
|
CircularLoader.displayName = "CircularLoader";
|
|
7721
7837
|
|
|
7722
7838
|
// src/small-grid-single-item/SmallGridSingleItem.tsx
|
|
7723
|
-
var
|
|
7839
|
+
var import_react56 = require("react");
|
|
7724
7840
|
var import_lucide_react34 = require("lucide-react");
|
|
7725
7841
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
7726
|
-
var SmallGridSingleItem = (0,
|
|
7842
|
+
var SmallGridSingleItem = (0, import_react56.memo)(
|
|
7727
7843
|
({
|
|
7728
7844
|
title,
|
|
7729
7845
|
subtitle,
|
|
@@ -7844,7 +7960,7 @@ function SortingAction({
|
|
|
7844
7960
|
}
|
|
7845
7961
|
|
|
7846
7962
|
// src/status-button/StatusButton.tsx
|
|
7847
|
-
var
|
|
7963
|
+
var import_react57 = require("react");
|
|
7848
7964
|
var import_react_i18next20 = require("react-i18next");
|
|
7849
7965
|
var import_lucide_react36 = require("lucide-react");
|
|
7850
7966
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
@@ -7862,7 +7978,7 @@ function StatusButton({
|
|
|
7862
7978
|
...props
|
|
7863
7979
|
}) {
|
|
7864
7980
|
const { t } = (0, import_react_i18next20.useTranslation)();
|
|
7865
|
-
const configMap = (0,
|
|
7981
|
+
const configMap = (0, import_react57.useMemo)(() => {
|
|
7866
7982
|
const defaultLoadingConfig = {
|
|
7867
7983
|
text: loadingText ?? `${t("saving")}...`,
|
|
7868
7984
|
icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_lucide_react36.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
@@ -7987,9 +8103,9 @@ function Stepper({
|
|
|
7987
8103
|
}
|
|
7988
8104
|
|
|
7989
8105
|
// src/switch-blocks/SwitchBlocks.tsx
|
|
7990
|
-
var
|
|
8106
|
+
var import_react58 = require("react");
|
|
7991
8107
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
7992
|
-
var SwitchBlocksInternal = (0,
|
|
8108
|
+
var SwitchBlocksInternal = (0, import_react58.forwardRef)(
|
|
7993
8109
|
({ options, value, onChange, disabled, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
7994
8110
|
"div",
|
|
7995
8111
|
{
|
|
@@ -8013,7 +8129,7 @@ var SwitchBlocksInternal = (0, import_react55.forwardRef)(
|
|
|
8013
8129
|
)
|
|
8014
8130
|
);
|
|
8015
8131
|
SwitchBlocksInternal.displayName = "SwitchBlocks";
|
|
8016
|
-
var SwitchBlocks = (0,
|
|
8132
|
+
var SwitchBlocks = (0, import_react58.memo)(SwitchBlocksInternal);
|
|
8017
8133
|
|
|
8018
8134
|
// src/switch-group/SwitchGroup.tsx
|
|
8019
8135
|
var React26 = __toESM(require("react"), 1);
|
|
@@ -8073,7 +8189,7 @@ var SwitchGroup = React26.forwardRef(
|
|
|
8073
8189
|
SwitchGroup.displayName = "SwitchGroup";
|
|
8074
8190
|
|
|
8075
8191
|
// src/tabs/Tabs.tsx
|
|
8076
|
-
var
|
|
8192
|
+
var import_react59 = require("react");
|
|
8077
8193
|
var TabsPrimitive2 = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
8078
8194
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
8079
8195
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
@@ -8089,7 +8205,7 @@ var tabsListVariants = (0, import_class_variance_authority12.cva)("inline-flex i
|
|
|
8089
8205
|
variant: "default"
|
|
8090
8206
|
}
|
|
8091
8207
|
});
|
|
8092
|
-
var TabsList = (0,
|
|
8208
|
+
var TabsList = (0, import_react59.forwardRef)(
|
|
8093
8209
|
({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
8094
8210
|
TabsPrimitive2.List,
|
|
8095
8211
|
{
|
|
@@ -8114,7 +8230,7 @@ var tabsTriggerVariants = (0, import_class_variance_authority12.cva)(
|
|
|
8114
8230
|
}
|
|
8115
8231
|
}
|
|
8116
8232
|
);
|
|
8117
|
-
var TabsTrigger = (0,
|
|
8233
|
+
var TabsTrigger = (0, import_react59.forwardRef)(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
8118
8234
|
TabsPrimitive2.Trigger,
|
|
8119
8235
|
{
|
|
8120
8236
|
ref,
|
|
@@ -8123,7 +8239,7 @@ var TabsTrigger = (0, import_react56.forwardRef)(({ className, variant, ...props
|
|
|
8123
8239
|
}
|
|
8124
8240
|
));
|
|
8125
8241
|
TabsTrigger.displayName = TabsPrimitive2.Trigger.displayName;
|
|
8126
|
-
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 }));
|
|
8127
8243
|
TabsContent.displayName = TabsPrimitive2.Content.displayName;
|
|
8128
8244
|
|
|
8129
8245
|
// src/tabbed-section/TabbedSection.tsx
|
|
@@ -8264,11 +8380,11 @@ var TASK_VARIANTS = {
|
|
|
8264
8380
|
var import_sonner2 = require("sonner");
|
|
8265
8381
|
|
|
8266
8382
|
// src/toaster/useUpdateToast.ts
|
|
8267
|
-
var
|
|
8383
|
+
var import_react60 = require("react");
|
|
8268
8384
|
var import_sonner = require("sonner");
|
|
8269
8385
|
function useUpdateToast({ id }) {
|
|
8270
|
-
const toastIdRef = (0,
|
|
8271
|
-
const getToastOptions = (0,
|
|
8386
|
+
const toastIdRef = (0, import_react60.useRef)("");
|
|
8387
|
+
const getToastOptions = (0, import_react60.useCallback)(
|
|
8272
8388
|
(options) => ({
|
|
8273
8389
|
id: toastIdRef.current,
|
|
8274
8390
|
dismissible: false,
|
|
@@ -8383,7 +8499,7 @@ var ToggleGroupItem = React27.forwardRef(({ className, children, variant, size,
|
|
|
8383
8499
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
8384
8500
|
|
|
8385
8501
|
// src/toggle-group/Toggles.tsx
|
|
8386
|
-
var
|
|
8502
|
+
var import_react61 = require("react");
|
|
8387
8503
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
8388
8504
|
var getValueArray2 = (value) => {
|
|
8389
8505
|
if (value) {
|
|
@@ -8458,7 +8574,7 @@ function TogglesInternal({
|
|
|
8458
8574
|
}
|
|
8459
8575
|
};
|
|
8460
8576
|
const isAnyActive = getValueArray2(value).length > 0;
|
|
8461
|
-
(0,
|
|
8577
|
+
(0, import_react61.useEffect)(() => {
|
|
8462
8578
|
onAnySelectorActive?.(isAnyActive);
|
|
8463
8579
|
}, [isAnyActive, onAnySelectorActive]);
|
|
8464
8580
|
const currentValue = getValueArray2(value).map((item) => String(item));
|
|
@@ -8489,7 +8605,7 @@ function TogglesInternal({
|
|
|
8489
8605
|
}) })
|
|
8490
8606
|
] });
|
|
8491
8607
|
}
|
|
8492
|
-
var Toggles = (0,
|
|
8608
|
+
var Toggles = (0, import_react61.forwardRef)(TogglesInternal);
|
|
8493
8609
|
|
|
8494
8610
|
// src/text-field/TextField.tsx
|
|
8495
8611
|
var React28 = __toESM(require("react"), 1);
|
|
@@ -8700,16 +8816,16 @@ var TextField = React28.forwardRef(
|
|
|
8700
8816
|
TextField.displayName = "TextField";
|
|
8701
8817
|
|
|
8702
8818
|
// src/textarea/Textarea.tsx
|
|
8703
|
-
var
|
|
8819
|
+
var import_react62 = require("react");
|
|
8704
8820
|
|
|
8705
8821
|
// src/textarea/styles.module.css
|
|
8706
8822
|
var styles_default9 = {};
|
|
8707
8823
|
|
|
8708
8824
|
// src/textarea/Textarea.tsx
|
|
8709
8825
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
8710
|
-
var Textarea = (0,
|
|
8826
|
+
var Textarea = (0, import_react62.forwardRef)(
|
|
8711
8827
|
({ className, textareaClassName, label, disabled, name, invalid, ...textareaProps }, ref) => {
|
|
8712
|
-
const inputId = (0,
|
|
8828
|
+
const inputId = (0, import_react62.useId)();
|
|
8713
8829
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: cn(styles_default9.container, className), children: [
|
|
8714
8830
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
8715
8831
|
"textarea",
|
|
@@ -11602,7 +11718,7 @@ AirbnbSearchInput.displayName = "SearchInput";
|
|
|
11602
11718
|
var React41 = __toESM(require("react"), 1);
|
|
11603
11719
|
var import_lucide_react46 = require("lucide-react");
|
|
11604
11720
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
11605
|
-
var
|
|
11721
|
+
var import_react63 = require("react");
|
|
11606
11722
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
11607
11723
|
var ROW_HEIGHT = 48;
|
|
11608
11724
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
@@ -11677,7 +11793,7 @@ var SearchableSelectInternal = ({
|
|
|
11677
11793
|
const activeOptionId = highlightedIndex >= 0 ? getOptionId(reactId, highlightedIndex) : void 0;
|
|
11678
11794
|
useOutsideClick(containerRef, open && !isMobile ? () => closeSelect() : null);
|
|
11679
11795
|
const handleOnOpenChange = useEvent(onOpenChange);
|
|
11680
|
-
const setSelectOpen = (0,
|
|
11796
|
+
const setSelectOpen = (0, import_react63.useCallback)(
|
|
11681
11797
|
(nextOpen, options2) => {
|
|
11682
11798
|
setOpen(nextOpen);
|
|
11683
11799
|
handleOnOpenChange?.(nextOpen);
|
|
@@ -12319,14 +12435,17 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
12319
12435
|
useDebouncedFunction,
|
|
12320
12436
|
useEvent,
|
|
12321
12437
|
useHover,
|
|
12438
|
+
useIsFormTouched,
|
|
12322
12439
|
useIsMobile,
|
|
12323
12440
|
useIsMounted,
|
|
12441
|
+
useKeyDown,
|
|
12324
12442
|
useModalControls,
|
|
12325
12443
|
useOutsideClick,
|
|
12326
12444
|
usePagination,
|
|
12327
12445
|
usePrevious,
|
|
12328
12446
|
usePromisedModalControls,
|
|
12329
12447
|
useRadioOptions,
|
|
12448
|
+
useResetAfterRequestStatus,
|
|
12330
12449
|
useScreenResize,
|
|
12331
12450
|
useScrollFrameIntoView,
|
|
12332
12451
|
useScrollToTop,
|