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