@chekinapp/ui 0.0.25 → 0.0.26
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 +199 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +122 -90
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -297,6 +297,7 @@ __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,
|
|
@@ -2830,12 +2831,76 @@ function usePagination(config) {
|
|
|
2830
2831
|
};
|
|
2831
2832
|
}
|
|
2832
2833
|
|
|
2833
|
-
// src/hooks/use-
|
|
2834
|
+
// src/hooks/use-copy-to-clipboard.ts
|
|
2834
2835
|
var import_react23 = require("react");
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2836
|
+
|
|
2837
|
+
// src/lib/copy-to-clipboard.ts
|
|
2838
|
+
function copyToClipboardFallback(value) {
|
|
2839
|
+
const targetDocument = getDocument();
|
|
2840
|
+
const targetBody = targetDocument.body;
|
|
2841
|
+
if (!targetBody) {
|
|
2842
|
+
return;
|
|
2843
|
+
}
|
|
2844
|
+
const el = targetDocument.createElement("textarea");
|
|
2845
|
+
el.value = value;
|
|
2846
|
+
el.setAttribute("readonly", "");
|
|
2847
|
+
el.style.position = "fixed";
|
|
2848
|
+
el.style.opacity = "0";
|
|
2849
|
+
el.style.pointerEvents = "none";
|
|
2850
|
+
el.style.left = "-9999px";
|
|
2851
|
+
targetBody.appendChild(el);
|
|
2852
|
+
el.focus();
|
|
2853
|
+
el.select();
|
|
2854
|
+
targetDocument.execCommand("copy");
|
|
2855
|
+
targetBody.removeChild(el);
|
|
2856
|
+
}
|
|
2857
|
+
function copyToClipboard2(value) {
|
|
2858
|
+
const text = typeof value === "number" ? value.toString() : value;
|
|
2859
|
+
const targetDocument = getDocument();
|
|
2860
|
+
const clipboard = targetDocument.defaultView?.navigator?.clipboard ?? globalThis.navigator?.clipboard;
|
|
2861
|
+
if (!clipboard?.writeText) {
|
|
2862
|
+
copyToClipboardFallback(text);
|
|
2863
|
+
return;
|
|
2864
|
+
}
|
|
2865
|
+
void clipboard.writeText(text).catch(() => {
|
|
2866
|
+
copyToClipboardFallback(text);
|
|
2867
|
+
});
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
// src/hooks/use-copy-to-clipboard.ts
|
|
2871
|
+
var COPIED_TIMEOUT_S = 1.5;
|
|
2872
|
+
function useCopyToClipboard({ value, onCopiedLink, onReset }) {
|
|
2873
|
+
const [isCopied, setIsLinkCopied] = (0, import_react23.useState)(false);
|
|
2874
|
+
const timeoutRef = (0, import_react23.useRef)();
|
|
2838
2875
|
(0, import_react23.useEffect)(() => {
|
|
2876
|
+
return () => {
|
|
2877
|
+
if (timeoutRef.current) {
|
|
2878
|
+
clearTimeout(timeoutRef.current);
|
|
2879
|
+
}
|
|
2880
|
+
};
|
|
2881
|
+
}, []);
|
|
2882
|
+
const copy = () => {
|
|
2883
|
+
if (!value) return;
|
|
2884
|
+
if (timeoutRef.current) {
|
|
2885
|
+
clearTimeout(timeoutRef.current);
|
|
2886
|
+
}
|
|
2887
|
+
copyToClipboard2(value);
|
|
2888
|
+
setIsLinkCopied(true);
|
|
2889
|
+
timeoutRef.current = setTimeout(() => {
|
|
2890
|
+
setIsLinkCopied(false);
|
|
2891
|
+
onReset?.();
|
|
2892
|
+
}, COPIED_TIMEOUT_S * 1e3);
|
|
2893
|
+
onCopiedLink?.();
|
|
2894
|
+
};
|
|
2895
|
+
return { isCopied, copy };
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
// src/hooks/use-timer.ts
|
|
2899
|
+
var import_react24 = require("react");
|
|
2900
|
+
var useTimer = ({ seconds }) => {
|
|
2901
|
+
const [timeLeft, setTimeLeft] = (0, import_react24.useState)(seconds);
|
|
2902
|
+
const [isTimerRunning, setIsTimerRunning] = (0, import_react24.useState)(true);
|
|
2903
|
+
(0, import_react24.useEffect)(() => {
|
|
2839
2904
|
if (!isTimerRunning) return;
|
|
2840
2905
|
const timer = setInterval(() => {
|
|
2841
2906
|
setTimeLeft((prev) => {
|
|
@@ -2861,32 +2926,32 @@ var useTimer = ({ seconds }) => {
|
|
|
2861
2926
|
};
|
|
2862
2927
|
|
|
2863
2928
|
// src/hooks/use-timeout.ts
|
|
2864
|
-
var
|
|
2929
|
+
var import_react25 = require("react");
|
|
2865
2930
|
function useTimeout() {
|
|
2866
|
-
const timeoutRef = (0,
|
|
2867
|
-
const clearTimeoutRef = (0,
|
|
2931
|
+
const timeoutRef = (0, import_react25.useRef)();
|
|
2932
|
+
const clearTimeoutRef = (0, import_react25.useCallback)(() => {
|
|
2868
2933
|
clearTimeout(timeoutRef.current);
|
|
2869
2934
|
timeoutRef.current = void 0;
|
|
2870
2935
|
}, []);
|
|
2871
|
-
const scheduleTimeout = (0,
|
|
2936
|
+
const scheduleTimeout = (0, import_react25.useCallback)(
|
|
2872
2937
|
(callback, delay) => {
|
|
2873
2938
|
clearTimeoutRef();
|
|
2874
2939
|
timeoutRef.current = setTimeout(callback, delay);
|
|
2875
2940
|
},
|
|
2876
2941
|
[clearTimeoutRef]
|
|
2877
2942
|
);
|
|
2878
|
-
(0,
|
|
2943
|
+
(0, import_react25.useEffect)(() => clearTimeoutRef, [clearTimeoutRef]);
|
|
2879
2944
|
return { scheduleTimeout, clearTimeoutRef };
|
|
2880
2945
|
}
|
|
2881
2946
|
|
|
2882
2947
|
// src/hooks/use-hover.ts
|
|
2883
|
-
var
|
|
2948
|
+
var import_react26 = require("react");
|
|
2884
2949
|
function useHover() {
|
|
2885
|
-
const [isHovering, setIsHovering] = (0,
|
|
2886
|
-
const handleMouseEnter = (0,
|
|
2950
|
+
const [isHovering, setIsHovering] = (0, import_react26.useState)(false);
|
|
2951
|
+
const handleMouseEnter = (0, import_react26.useCallback)(() => {
|
|
2887
2952
|
setIsHovering(true);
|
|
2888
2953
|
}, []);
|
|
2889
|
-
const handleMouseLeave = (0,
|
|
2954
|
+
const handleMouseLeave = (0, import_react26.useCallback)(() => {
|
|
2890
2955
|
setIsHovering(false);
|
|
2891
2956
|
}, []);
|
|
2892
2957
|
return {
|
|
@@ -2897,10 +2962,10 @@ function useHover() {
|
|
|
2897
2962
|
}
|
|
2898
2963
|
|
|
2899
2964
|
// src/hooks/use-promised-modal-controls.ts
|
|
2900
|
-
var
|
|
2965
|
+
var import_react27 = require("react");
|
|
2901
2966
|
var usePromisedModalControls = () => {
|
|
2902
2967
|
const { closeModal, isOpen, openModal } = useModalControls();
|
|
2903
|
-
const resolveRef = (0,
|
|
2968
|
+
const resolveRef = (0, import_react27.useRef)();
|
|
2904
2969
|
const openModalWithPromise = async () => {
|
|
2905
2970
|
openModal();
|
|
2906
2971
|
return new Promise((resolve) => {
|
|
@@ -3150,7 +3215,7 @@ function DownloadEntryFormsButton({
|
|
|
3150
3215
|
}
|
|
3151
3216
|
|
|
3152
3217
|
// src/dropdown-button/DropdownButton.tsx
|
|
3153
|
-
var
|
|
3218
|
+
var import_react28 = require("react");
|
|
3154
3219
|
|
|
3155
3220
|
// src/dropdown-menu/DropdownMenu.tsx
|
|
3156
3221
|
var React13 = __toESM(require("react"), 1);
|
|
@@ -3214,7 +3279,7 @@ function DropdownButton({
|
|
|
3214
3279
|
modal,
|
|
3215
3280
|
className
|
|
3216
3281
|
}) {
|
|
3217
|
-
const [isOpen, setIsOpen] = (0,
|
|
3282
|
+
const [isOpen, setIsOpen] = (0, import_react28.useState)(false);
|
|
3218
3283
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(DropdownMenu, { onOpenChange: setIsOpen, modal, children: [
|
|
3219
3284
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuTrigger, { asChild: true, children: typeof trigger === "function" ? trigger(isOpen) : trigger }),
|
|
3220
3285
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -3341,7 +3406,7 @@ var import_lucide_react12 = require("lucide-react");
|
|
|
3341
3406
|
var import_react_i18next7 = require("react-i18next");
|
|
3342
3407
|
|
|
3343
3408
|
// src/halo-icon/HaloIcon.tsx
|
|
3344
|
-
var
|
|
3409
|
+
var import_react29 = require("react");
|
|
3345
3410
|
|
|
3346
3411
|
// src/halo-icon/constants.ts
|
|
3347
3412
|
var HALO_ICON_STATUS = {
|
|
@@ -3371,7 +3436,7 @@ var statusStyles = {
|
|
|
3371
3436
|
color: "text-chekin-red"
|
|
3372
3437
|
}
|
|
3373
3438
|
};
|
|
3374
|
-
var HaloIcon = (0,
|
|
3439
|
+
var HaloIcon = (0, import_react29.forwardRef)(
|
|
3375
3440
|
({
|
|
3376
3441
|
children,
|
|
3377
3442
|
variant = "default",
|
|
@@ -3552,7 +3617,7 @@ var Switch = React15.forwardRef(
|
|
|
3552
3617
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
3553
3618
|
|
|
3554
3619
|
// src/video-player/VideoPlayer.tsx
|
|
3555
|
-
var
|
|
3620
|
+
var import_react30 = require("react");
|
|
3556
3621
|
var import_react_i18next8 = require("react-i18next");
|
|
3557
3622
|
var import_lucide_react13 = require("lucide-react");
|
|
3558
3623
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
@@ -3565,20 +3630,20 @@ function VideoPlayer({
|
|
|
3565
3630
|
autoPlay = false
|
|
3566
3631
|
}) {
|
|
3567
3632
|
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,
|
|
3633
|
+
const videoRef = (0, import_react30.useRef)(null);
|
|
3634
|
+
const iframeRef = (0, import_react30.useRef)(null);
|
|
3635
|
+
const containerRef = (0, import_react30.useRef)(null);
|
|
3636
|
+
const [isPlaying, setIsPlaying] = (0, import_react30.useState)(false);
|
|
3637
|
+
const [isMuted, setIsMuted] = (0, import_react30.useState)(false);
|
|
3638
|
+
const [currentTime, setCurrentTime] = (0, import_react30.useState)(0);
|
|
3639
|
+
const [duration, setDuration] = (0, import_react30.useState)(0);
|
|
3640
|
+
const [isFullScreenMode, setIsFullScreenMode] = (0, import_react30.useState)(isFullScreen);
|
|
3641
|
+
const [isLoading, setIsLoading] = (0, import_react30.useState)(true);
|
|
3642
|
+
const [videoSource, setVideoSource] = (0, import_react30.useState)("file");
|
|
3643
|
+
const [youtubeEmbedUrl, setYoutubeEmbedUrl] = (0, import_react30.useState)("");
|
|
3644
|
+
const [vimeoEmbedUrl, setVimeoEmbedUrl] = (0, import_react30.useState)("");
|
|
3580
3645
|
useClickEscape({ enabled: isFullScreenMode, onClick: onClose });
|
|
3581
|
-
(0,
|
|
3646
|
+
(0, import_react30.useEffect)(() => {
|
|
3582
3647
|
const youtubeRegex = /(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/;
|
|
3583
3648
|
const vimeoRegex = /(?:vimeo\.com\/|vimeo\.com\/video\/)(\d+)/;
|
|
3584
3649
|
const youtubeMatch = src.match(youtubeRegex);
|
|
@@ -3607,7 +3672,7 @@ function VideoPlayer({
|
|
|
3607
3672
|
setYoutubeEmbedUrl("");
|
|
3608
3673
|
setVimeoEmbedUrl("");
|
|
3609
3674
|
}, [src, autoPlay]);
|
|
3610
|
-
(0,
|
|
3675
|
+
(0, import_react30.useEffect)(() => {
|
|
3611
3676
|
if (videoSource !== "file") return;
|
|
3612
3677
|
const video = videoRef.current;
|
|
3613
3678
|
if (!video) return;
|
|
@@ -3635,7 +3700,7 @@ function VideoPlayer({
|
|
|
3635
3700
|
video.removeEventListener("canplay", handleCanPlay);
|
|
3636
3701
|
};
|
|
3637
3702
|
}, [videoSource]);
|
|
3638
|
-
(0,
|
|
3703
|
+
(0, import_react30.useEffect)(() => {
|
|
3639
3704
|
if (isFullScreenMode && videoRef.current && videoSource === "file") {
|
|
3640
3705
|
void videoRef.current.play();
|
|
3641
3706
|
setIsPlaying(true);
|
|
@@ -3912,10 +3977,10 @@ function FeatureCard({
|
|
|
3912
3977
|
}
|
|
3913
3978
|
|
|
3914
3979
|
// src/file-input-button/FileInputButton.tsx
|
|
3915
|
-
var
|
|
3980
|
+
var import_react31 = require("react");
|
|
3916
3981
|
var import_lucide_react15 = require("lucide-react");
|
|
3917
3982
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3918
|
-
var FileInputButton = (0,
|
|
3983
|
+
var FileInputButton = (0, import_react31.forwardRef)(
|
|
3919
3984
|
({
|
|
3920
3985
|
label,
|
|
3921
3986
|
onChange,
|
|
@@ -3927,7 +3992,7 @@ var FileInputButton = (0, import_react30.forwardRef)(
|
|
|
3927
3992
|
size = "default",
|
|
3928
3993
|
...props
|
|
3929
3994
|
}, ref) => {
|
|
3930
|
-
const handleChange = (0,
|
|
3995
|
+
const handleChange = (0, import_react31.useCallback)(
|
|
3931
3996
|
(event) => {
|
|
3932
3997
|
onChange?.(event);
|
|
3933
3998
|
event.target.value = "";
|
|
@@ -4007,7 +4072,7 @@ var FormBox = {
|
|
|
4007
4072
|
};
|
|
4008
4073
|
|
|
4009
4074
|
// src/free-text-field/FreeTextField.tsx
|
|
4010
|
-
var
|
|
4075
|
+
var import_react32 = require("react");
|
|
4011
4076
|
var import_react_i18next10 = require("react-i18next");
|
|
4012
4077
|
|
|
4013
4078
|
// src/free-text-field/styles.module.css
|
|
@@ -4015,7 +4080,7 @@ var styles_default3 = {};
|
|
|
4015
4080
|
|
|
4016
4081
|
// src/free-text-field/FreeTextField.tsx
|
|
4017
4082
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4018
|
-
var FreeTextField = (0,
|
|
4083
|
+
var FreeTextField = (0, import_react32.forwardRef)(
|
|
4019
4084
|
({
|
|
4020
4085
|
label,
|
|
4021
4086
|
error,
|
|
@@ -4037,9 +4102,9 @@ var FreeTextField = (0, import_react31.forwardRef)(
|
|
|
4037
4102
|
...inputProps
|
|
4038
4103
|
}, ref) => {
|
|
4039
4104
|
const { t } = (0, import_react_i18next10.useTranslation)();
|
|
4040
|
-
const inputId = (0,
|
|
4041
|
-
const [internalValue, setInternalValue] = (0,
|
|
4042
|
-
const [isFocused, setIsFocused] = (0,
|
|
4105
|
+
const inputId = (0, import_react32.useId)();
|
|
4106
|
+
const [internalValue, setInternalValue] = (0, import_react32.useState)(defaultValue ?? "");
|
|
4107
|
+
const [isFocused, setIsFocused] = (0, import_react32.useState)(false);
|
|
4043
4108
|
const currentValue = value !== void 0 ? value : internalValue;
|
|
4044
4109
|
const isEmpty = !currentValue || String(currentValue).length === 0;
|
|
4045
4110
|
const hasError = Boolean(error);
|
|
@@ -4162,9 +4227,9 @@ var FramedIcon = React16.forwardRef(
|
|
|
4162
4227
|
FramedIcon.displayName = "FramedIcon";
|
|
4163
4228
|
|
|
4164
4229
|
// src/grid-items/GridItems.tsx
|
|
4165
|
-
var
|
|
4230
|
+
var import_react33 = require("react");
|
|
4166
4231
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4167
|
-
var GridItems = (0,
|
|
4232
|
+
var GridItems = (0, import_react33.forwardRef)(
|
|
4168
4233
|
({ children, title, placeholder, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
4169
4234
|
"div",
|
|
4170
4235
|
{
|
|
@@ -4241,9 +4306,9 @@ function HelpTooltip({
|
|
|
4241
4306
|
}
|
|
4242
4307
|
|
|
4243
4308
|
// src/icon/Icon.tsx
|
|
4244
|
-
var
|
|
4309
|
+
var import_react34 = require("react");
|
|
4245
4310
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4246
|
-
var MissingIcon = (0,
|
|
4311
|
+
var MissingIcon = (0, import_react34.forwardRef)(
|
|
4247
4312
|
({ size = 24, className = "", fallback = null, color, ...props }, ref) => {
|
|
4248
4313
|
if (fallback) {
|
|
4249
4314
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, { children: fallback });
|
|
@@ -4272,8 +4337,8 @@ var MissingIcon = (0, import_react33.forwardRef)(
|
|
|
4272
4337
|
}
|
|
4273
4338
|
);
|
|
4274
4339
|
MissingIcon.displayName = "MissingIcon";
|
|
4275
|
-
var Icon = (0,
|
|
4276
|
-
(0,
|
|
4340
|
+
var Icon = (0, import_react34.memo)(
|
|
4341
|
+
(0, import_react34.forwardRef)(
|
|
4277
4342
|
({ name: _name, size = 24, className = "", fallback = null, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4278
4343
|
MissingIcon,
|
|
4279
4344
|
{
|
|
@@ -4371,7 +4436,7 @@ function InfoBox({ className, children }) {
|
|
|
4371
4436
|
}
|
|
4372
4437
|
|
|
4373
4438
|
// src/image/Image.tsx
|
|
4374
|
-
var
|
|
4439
|
+
var import_react35 = require("react");
|
|
4375
4440
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4376
4441
|
function Image2({
|
|
4377
4442
|
src,
|
|
@@ -4380,7 +4445,7 @@ function Image2({
|
|
|
4380
4445
|
fallbackSrc = "https://placehold.co/600x400?text=Image",
|
|
4381
4446
|
...props
|
|
4382
4447
|
}) {
|
|
4383
|
-
const [error, setError] = (0,
|
|
4448
|
+
const [error, setError] = (0, import_react35.useState)(false);
|
|
4384
4449
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4385
4450
|
"img",
|
|
4386
4451
|
{
|
|
@@ -4424,10 +4489,10 @@ Input.displayName = "Input";
|
|
|
4424
4489
|
var React19 = __toESM(require("react"), 1);
|
|
4425
4490
|
|
|
4426
4491
|
// src/input-otp/InputOTPContext.ts
|
|
4427
|
-
var
|
|
4428
|
-
var InputOTPContext = (0,
|
|
4492
|
+
var import_react36 = require("react");
|
|
4493
|
+
var InputOTPContext = (0, import_react36.createContext)(null);
|
|
4429
4494
|
function useInputOTPContext() {
|
|
4430
|
-
const ctx = (0,
|
|
4495
|
+
const ctx = (0, import_react36.useContext)(InputOTPContext);
|
|
4431
4496
|
if (!ctx) {
|
|
4432
4497
|
throw new Error("InputOTP compound components must be used within <InputOTP>");
|
|
4433
4498
|
}
|
|
@@ -4439,7 +4504,7 @@ function extractDigits(str) {
|
|
|
4439
4504
|
}
|
|
4440
4505
|
|
|
4441
4506
|
// src/input-otp/useInputOTP.ts
|
|
4442
|
-
var
|
|
4507
|
+
var import_react37 = require("react");
|
|
4443
4508
|
function useInputOTP({
|
|
4444
4509
|
maxLength,
|
|
4445
4510
|
value,
|
|
@@ -4448,12 +4513,12 @@ function useInputOTP({
|
|
|
4448
4513
|
autoFocus,
|
|
4449
4514
|
error
|
|
4450
4515
|
}) {
|
|
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,
|
|
4516
|
+
const [activeIndex, setActiveIndex] = (0, import_react37.useState)(-1);
|
|
4517
|
+
const inputRefs = (0, import_react37.useRef)([]);
|
|
4518
|
+
const containerRef = (0, import_react37.useRef)(null);
|
|
4519
|
+
const blurTimeoutRef = (0, import_react37.useRef)();
|
|
4520
|
+
const slotsRef = (0, import_react37.useRef)(Array.from({ length: maxLength }, () => ""));
|
|
4521
|
+
const slots = (0, import_react37.useMemo)(() => {
|
|
4457
4522
|
const nextSlots = Array.from({ length: maxLength }, () => "");
|
|
4458
4523
|
for (let index = 0; index < Math.min(value.length, maxLength); index += 1) {
|
|
4459
4524
|
const char = value[index];
|
|
@@ -4464,7 +4529,7 @@ function useInputOTP({
|
|
|
4464
4529
|
return nextSlots;
|
|
4465
4530
|
}, [value, maxLength]);
|
|
4466
4531
|
slotsRef.current = slots;
|
|
4467
|
-
const emitValue = (0,
|
|
4532
|
+
const emitValue = (0, import_react37.useCallback)(
|
|
4468
4533
|
(newSlots) => {
|
|
4469
4534
|
let lastFilledIndex = -1;
|
|
4470
4535
|
for (let index = newSlots.length - 1; index >= 0; index -= 1) {
|
|
@@ -4485,12 +4550,12 @@ function useInputOTP({
|
|
|
4485
4550
|
},
|
|
4486
4551
|
[onChange]
|
|
4487
4552
|
);
|
|
4488
|
-
(0,
|
|
4553
|
+
(0, import_react37.useEffect)(() => {
|
|
4489
4554
|
if (autoFocus && inputRefs.current[0]) {
|
|
4490
4555
|
inputRefs.current[0].focus();
|
|
4491
4556
|
}
|
|
4492
4557
|
}, [autoFocus]);
|
|
4493
|
-
const handleContainerFocusIn = (0,
|
|
4558
|
+
const handleContainerFocusIn = (0, import_react37.useCallback)((event) => {
|
|
4494
4559
|
clearTimeout(blurTimeoutRef.current);
|
|
4495
4560
|
const target = event.target;
|
|
4496
4561
|
const slotIndex = inputRefs.current.indexOf(target);
|
|
@@ -4498,7 +4563,7 @@ function useInputOTP({
|
|
|
4498
4563
|
setActiveIndex(slotIndex);
|
|
4499
4564
|
}
|
|
4500
4565
|
}, []);
|
|
4501
|
-
const handleContainerFocusOut = (0,
|
|
4566
|
+
const handleContainerFocusOut = (0, import_react37.useCallback)(() => {
|
|
4502
4567
|
clearTimeout(blurTimeoutRef.current);
|
|
4503
4568
|
blurTimeoutRef.current = setTimeout(() => {
|
|
4504
4569
|
if (!containerRef.current?.contains(document.activeElement)) {
|
|
@@ -4506,8 +4571,8 @@ function useInputOTP({
|
|
|
4506
4571
|
}
|
|
4507
4572
|
}, 0);
|
|
4508
4573
|
}, []);
|
|
4509
|
-
(0,
|
|
4510
|
-
const handleDigitInput = (0,
|
|
4574
|
+
(0, import_react37.useEffect)(() => () => clearTimeout(blurTimeoutRef.current), []);
|
|
4575
|
+
const handleDigitInput = (0, import_react37.useCallback)(
|
|
4511
4576
|
(index, digit) => {
|
|
4512
4577
|
if (!DIGIT_REGEX.test(digit)) return;
|
|
4513
4578
|
const newSlots = [...slotsRef.current];
|
|
@@ -4521,7 +4586,7 @@ function useInputOTP({
|
|
|
4521
4586
|
},
|
|
4522
4587
|
[maxLength, emitValue]
|
|
4523
4588
|
);
|
|
4524
|
-
const handleDelete = (0,
|
|
4589
|
+
const handleDelete = (0, import_react37.useCallback)(
|
|
4525
4590
|
(index) => {
|
|
4526
4591
|
const newSlots = [...slotsRef.current];
|
|
4527
4592
|
if (newSlots[index]) {
|
|
@@ -4536,7 +4601,7 @@ function useInputOTP({
|
|
|
4536
4601
|
},
|
|
4537
4602
|
[emitValue]
|
|
4538
4603
|
);
|
|
4539
|
-
const handlePaste = (0,
|
|
4604
|
+
const handlePaste = (0, import_react37.useCallback)(
|
|
4540
4605
|
(text) => {
|
|
4541
4606
|
const digits = extractDigits(text).slice(0, maxLength);
|
|
4542
4607
|
if (digits.length > 0) {
|
|
@@ -4552,7 +4617,7 @@ function useInputOTP({
|
|
|
4552
4617
|
},
|
|
4553
4618
|
[maxLength, emitValue]
|
|
4554
4619
|
);
|
|
4555
|
-
const contextValue = (0,
|
|
4620
|
+
const contextValue = (0, import_react37.useMemo)(
|
|
4556
4621
|
() => ({
|
|
4557
4622
|
slots,
|
|
4558
4623
|
activeIndex,
|
|
@@ -4585,7 +4650,7 @@ function useInputOTP({
|
|
|
4585
4650
|
}
|
|
4586
4651
|
|
|
4587
4652
|
// src/input-otp/useInputOTPSlot.ts
|
|
4588
|
-
var
|
|
4653
|
+
var import_react38 = require("react");
|
|
4589
4654
|
function useInputOTPSlot(index) {
|
|
4590
4655
|
const {
|
|
4591
4656
|
slots,
|
|
@@ -4655,13 +4720,13 @@ function useInputOTPSlot(index) {
|
|
|
4655
4720
|
event.preventDefault();
|
|
4656
4721
|
handlePaste(event.clipboardData.getData("text/plain"));
|
|
4657
4722
|
};
|
|
4658
|
-
const setInputRef = (0,
|
|
4723
|
+
const setInputRef = (0, import_react38.useCallback)(
|
|
4659
4724
|
(element) => {
|
|
4660
4725
|
inputRefs.current[index] = element;
|
|
4661
4726
|
},
|
|
4662
4727
|
[index, inputRefs]
|
|
4663
4728
|
);
|
|
4664
|
-
const focusSlot = (0,
|
|
4729
|
+
const focusSlot = (0, import_react38.useCallback)(() => {
|
|
4665
4730
|
inputRefs.current[index]?.focus();
|
|
4666
4731
|
}, [index, inputRefs]);
|
|
4667
4732
|
return {
|
|
@@ -4763,7 +4828,7 @@ var InputOTPSeparator = React19.forwardRef(
|
|
|
4763
4828
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
4764
4829
|
|
|
4765
4830
|
// src/icons-dropdown/IconsDropdown.tsx
|
|
4766
|
-
var
|
|
4831
|
+
var import_react39 = require("react");
|
|
4767
4832
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4768
4833
|
function IconsDropdown({
|
|
4769
4834
|
icons,
|
|
@@ -4775,7 +4840,7 @@ function IconsDropdown({
|
|
|
4775
4840
|
defaultOpen,
|
|
4776
4841
|
onOpenChange: onOpenChangeProp
|
|
4777
4842
|
}) {
|
|
4778
|
-
const [open, setOpen] = (0,
|
|
4843
|
+
const [open, setOpen] = (0, import_react39.useState)(defaultOpen ?? false);
|
|
4779
4844
|
function handleOpenChange(value) {
|
|
4780
4845
|
setOpen(value);
|
|
4781
4846
|
onOpenChangeProp?.(value);
|
|
@@ -5358,9 +5423,9 @@ function LearnMoreButton({ label, ...props }) {
|
|
|
5358
5423
|
}
|
|
5359
5424
|
|
|
5360
5425
|
// src/link/Link.tsx
|
|
5361
|
-
var
|
|
5426
|
+
var import_react40 = require("react");
|
|
5362
5427
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5363
|
-
var LinkInternal = (0,
|
|
5428
|
+
var LinkInternal = (0, import_react40.forwardRef)(
|
|
5364
5429
|
({ disabled = false, className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5365
5430
|
"a",
|
|
5366
5431
|
{
|
|
@@ -5379,17 +5444,17 @@ var LinkInternal = (0, import_react39.forwardRef)(
|
|
|
5379
5444
|
)
|
|
5380
5445
|
);
|
|
5381
5446
|
LinkInternal.displayName = "Link";
|
|
5382
|
-
var Link = (0,
|
|
5447
|
+
var Link = (0, import_react40.memo)(LinkInternal);
|
|
5383
5448
|
|
|
5384
5449
|
// src/image-full-screen-view/ImageFullScreenView.tsx
|
|
5385
|
-
var
|
|
5450
|
+
var import_react41 = require("react");
|
|
5386
5451
|
var import_lucide_react20 = require("lucide-react");
|
|
5387
5452
|
var import_react_i18next13 = require("react-i18next");
|
|
5388
5453
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5389
5454
|
function ImageFullScreenView({ src, alt, onClose }) {
|
|
5390
5455
|
const { t } = (0, import_react_i18next13.useTranslation)();
|
|
5391
|
-
const [scale, setScale] = (0,
|
|
5392
|
-
const [rotation, setRotation] = (0,
|
|
5456
|
+
const [scale, setScale] = (0, import_react41.useState)(1);
|
|
5457
|
+
const [rotation, setRotation] = (0, import_react41.useState)(0);
|
|
5393
5458
|
useClickEscape({ onClick: onClose });
|
|
5394
5459
|
const zoomIn = () => setScale((value) => Math.min(value + 0.25, 3));
|
|
5395
5460
|
const zoomOut = () => setScale((value) => Math.max(value - 0.25, 0.5));
|
|
@@ -5587,7 +5652,7 @@ var METRIC_CARD_VARIANTS = {
|
|
|
5587
5652
|
};
|
|
5588
5653
|
|
|
5589
5654
|
// src/modal/Modal.tsx
|
|
5590
|
-
var
|
|
5655
|
+
var import_react42 = require("react");
|
|
5591
5656
|
var import_lucide_react23 = require("lucide-react");
|
|
5592
5657
|
|
|
5593
5658
|
// src/modal/styles.module.css
|
|
@@ -5618,7 +5683,7 @@ function Modal({
|
|
|
5618
5683
|
container,
|
|
5619
5684
|
modal
|
|
5620
5685
|
}) {
|
|
5621
|
-
const contentRef = (0,
|
|
5686
|
+
const contentRef = (0, import_react42.useRef)(null);
|
|
5622
5687
|
useScrollFrameIntoView(open, { elementRef: contentRef });
|
|
5623
5688
|
const handleClose = () => {
|
|
5624
5689
|
onOpenChange?.(false);
|
|
@@ -5660,7 +5725,7 @@ function Modal({
|
|
|
5660
5725
|
}
|
|
5661
5726
|
) });
|
|
5662
5727
|
}
|
|
5663
|
-
var ModalButton = (0,
|
|
5728
|
+
var ModalButton = (0, import_react42.forwardRef)(
|
|
5664
5729
|
({ children, size, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5665
5730
|
Button,
|
|
5666
5731
|
{
|
|
@@ -5676,9 +5741,9 @@ ModalButton.displayName = "ModalButton";
|
|
|
5676
5741
|
Modal.displayName = "Modal";
|
|
5677
5742
|
|
|
5678
5743
|
// src/modal-loader/ModalLoader.tsx
|
|
5679
|
-
var
|
|
5744
|
+
var import_react43 = require("react");
|
|
5680
5745
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5681
|
-
var ModalLoader = (0,
|
|
5746
|
+
var ModalLoader = (0, import_react43.memo)(({ visible, className }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5682
5747
|
"div",
|
|
5683
5748
|
{
|
|
5684
5749
|
className: cn(
|
|
@@ -6066,7 +6131,7 @@ var PopoverContent = React21.forwardRef(({ className, sideOffset = 8, align = "s
|
|
|
6066
6131
|
PopoverContent.displayName = "PopoverContent";
|
|
6067
6132
|
|
|
6068
6133
|
// src/radio/Radio.tsx
|
|
6069
|
-
var
|
|
6134
|
+
var import_react45 = require("react");
|
|
6070
6135
|
|
|
6071
6136
|
// src/radio-group/RadioGroup.tsx
|
|
6072
6137
|
var React22 = __toESM(require("react"), 1);
|
|
@@ -6099,11 +6164,11 @@ var RadioGroupItem = React22.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
6099
6164
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
6100
6165
|
|
|
6101
6166
|
// src/radio/useRadioOptions.ts
|
|
6102
|
-
var
|
|
6167
|
+
var import_react44 = require("react");
|
|
6103
6168
|
function useRadioOptions({ options, defaultValue, onChange }) {
|
|
6104
6169
|
const initialValue = (typeof defaultValue === "string" ? options.find((option) => option.value === defaultValue) : defaultValue) || "";
|
|
6105
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
6106
|
-
const handleValueChange = (0,
|
|
6170
|
+
const [selectedValue, setSelectedValue] = (0, import_react44.useState)(initialValue);
|
|
6171
|
+
const handleValueChange = (0, import_react44.useCallback)(
|
|
6107
6172
|
(value) => {
|
|
6108
6173
|
setSelectedValue(value);
|
|
6109
6174
|
const selectedOption = options.find((option) => option.value === value) || "";
|
|
@@ -6124,7 +6189,7 @@ var styles_default5 = {};
|
|
|
6124
6189
|
|
|
6125
6190
|
// src/radio/Radio.tsx
|
|
6126
6191
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
6127
|
-
var Radio = (0,
|
|
6192
|
+
var Radio = (0, import_react45.forwardRef)(
|
|
6128
6193
|
({ options, value, onChange, error, className = "", disabled = false, renderOption }, ref) => {
|
|
6129
6194
|
const { selectedValue, handleValueChange } = useRadioOptions({
|
|
6130
6195
|
options,
|
|
@@ -6514,7 +6579,7 @@ var SectionTagColors = /* @__PURE__ */ ((SectionTagColors2) => {
|
|
|
6514
6579
|
})(SectionTagColors || {});
|
|
6515
6580
|
|
|
6516
6581
|
// src/section/Section.tsx
|
|
6517
|
-
var
|
|
6582
|
+
var import_react46 = require("react");
|
|
6518
6583
|
var import_lucide_react31 = require("lucide-react");
|
|
6519
6584
|
|
|
6520
6585
|
// src/section/constants.ts
|
|
@@ -6541,7 +6606,7 @@ function TooltipInfo({ content, className }) {
|
|
|
6541
6606
|
}
|
|
6542
6607
|
) });
|
|
6543
6608
|
}
|
|
6544
|
-
var Section = (0,
|
|
6609
|
+
var Section = (0, import_react46.forwardRef)(
|
|
6545
6610
|
({
|
|
6546
6611
|
children,
|
|
6547
6612
|
title,
|
|
@@ -6593,17 +6658,17 @@ var Section = (0, import_react45.forwardRef)(
|
|
|
6593
6658
|
)
|
|
6594
6659
|
);
|
|
6595
6660
|
Section.displayName = "Section";
|
|
6596
|
-
var SubSection = (0,
|
|
6661
|
+
var SubSection = (0, import_react46.forwardRef)(
|
|
6597
6662
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Section, { ref, className: cn(Section_default.section_sub, className), ...props })
|
|
6598
6663
|
);
|
|
6599
6664
|
SubSection.displayName = "SubSection";
|
|
6600
|
-
var DividingSubsection = (0,
|
|
6665
|
+
var DividingSubsection = (0, import_react46.forwardRef)(
|
|
6601
6666
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SubSection, { ref, className: cn(Section_default.section_dividing, className), ...props })
|
|
6602
6667
|
);
|
|
6603
6668
|
DividingSubsection.displayName = "DividingSubsection";
|
|
6604
6669
|
|
|
6605
6670
|
// src/selectors/Selectors.tsx
|
|
6606
|
-
var
|
|
6671
|
+
var import_react47 = require("react");
|
|
6607
6672
|
|
|
6608
6673
|
// src/selector-button/styles.module.css
|
|
6609
6674
|
var styles_default7 = {};
|
|
@@ -6675,8 +6740,8 @@ var getValueArray = (value) => {
|
|
|
6675
6740
|
return [];
|
|
6676
6741
|
};
|
|
6677
6742
|
function getSelectorContent(label, disabled, readOnly, active) {
|
|
6678
|
-
if ((0,
|
|
6679
|
-
return (0,
|
|
6743
|
+
if ((0, import_react47.isValidElement)(label)) {
|
|
6744
|
+
return (0, import_react47.cloneElement)(label, {
|
|
6680
6745
|
disabled,
|
|
6681
6746
|
readOnly,
|
|
6682
6747
|
active
|
|
@@ -6721,7 +6786,7 @@ function SelectorsInternal({
|
|
|
6721
6786
|
}
|
|
6722
6787
|
};
|
|
6723
6788
|
const isAnyActive = getValueArray(value).length > 0;
|
|
6724
|
-
(0,
|
|
6789
|
+
(0, import_react47.useEffect)(() => {
|
|
6725
6790
|
onAnySelectorActive?.(isAnyActive);
|
|
6726
6791
|
}, [isAnyActive, onAnySelectorActive]);
|
|
6727
6792
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
@@ -6764,7 +6829,7 @@ function SelectorsInternal({
|
|
|
6764
6829
|
)
|
|
6765
6830
|
] });
|
|
6766
6831
|
}
|
|
6767
|
-
var Selectors = (0,
|
|
6832
|
+
var Selectors = (0, import_react47.forwardRef)(SelectorsInternal);
|
|
6768
6833
|
|
|
6769
6834
|
// src/separator/Separator.tsx
|
|
6770
6835
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
@@ -6924,19 +6989,19 @@ function Skeleton({ className, ...props }) {
|
|
|
6924
6989
|
}
|
|
6925
6990
|
|
|
6926
6991
|
// src/sidebar/SidebarContext.ts
|
|
6927
|
-
var
|
|
6928
|
-
var SidebarContext = (0,
|
|
6992
|
+
var import_react48 = require("react");
|
|
6993
|
+
var SidebarContext = (0, import_react48.createContext)(null);
|
|
6929
6994
|
|
|
6930
6995
|
// src/sidebar/useSidebarMenuButton.ts
|
|
6931
|
-
var
|
|
6996
|
+
var import_react50 = require("react");
|
|
6932
6997
|
|
|
6933
6998
|
// src/sidebar/SidebarMenuButtonContext.ts
|
|
6934
|
-
var
|
|
6935
|
-
var SidebarMenuButtonContext = (0,
|
|
6999
|
+
var import_react49 = require("react");
|
|
7000
|
+
var SidebarMenuButtonContext = (0, import_react49.createContext)(null);
|
|
6936
7001
|
|
|
6937
7002
|
// src/sidebar/useSidebarMenuButton.ts
|
|
6938
7003
|
function useSidebarMenuButton() {
|
|
6939
|
-
return (0,
|
|
7004
|
+
return (0, import_react50.useContext)(SidebarMenuButtonContext);
|
|
6940
7005
|
}
|
|
6941
7006
|
|
|
6942
7007
|
// src/sidebar/SidebarIcon.tsx
|
|
@@ -6977,16 +7042,16 @@ var SidebarIcon = ({
|
|
|
6977
7042
|
};
|
|
6978
7043
|
|
|
6979
7044
|
// src/sidebar/useSidebar.ts
|
|
6980
|
-
var
|
|
7045
|
+
var import_react51 = require("react");
|
|
6981
7046
|
function useSidebar() {
|
|
6982
|
-
const context = (0,
|
|
7047
|
+
const context = (0, import_react51.useContext)(SidebarContext);
|
|
6983
7048
|
if (!context) {
|
|
6984
7049
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
6985
7050
|
}
|
|
6986
7051
|
return context;
|
|
6987
7052
|
}
|
|
6988
7053
|
function useSidebarSafe() {
|
|
6989
|
-
return (0,
|
|
7054
|
+
return (0, import_react51.useContext)(SidebarContext);
|
|
6990
7055
|
}
|
|
6991
7056
|
|
|
6992
7057
|
// src/sidebar/Sidebar.tsx
|
|
@@ -7559,9 +7624,9 @@ var VALUE_PART = 1;
|
|
|
7559
7624
|
var getSidebarState = (stateName) => document.cookie.split("; ").find((row) => row.startsWith(`${stateName}=`))?.split("=")[VALUE_PART] === "true";
|
|
7560
7625
|
|
|
7561
7626
|
// src/circular-loader/CircularLoader.tsx
|
|
7562
|
-
var
|
|
7627
|
+
var import_react52 = __toESM(require("react"), 1);
|
|
7563
7628
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
7564
|
-
var CircularLoader =
|
|
7629
|
+
var CircularLoader = import_react52.default.memo(
|
|
7565
7630
|
({ visible = true, height, width, position, label, className }) => {
|
|
7566
7631
|
if (!visible) return null;
|
|
7567
7632
|
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
@@ -7655,10 +7720,10 @@ var CircularLoader = import_react51.default.memo(
|
|
|
7655
7720
|
CircularLoader.displayName = "CircularLoader";
|
|
7656
7721
|
|
|
7657
7722
|
// src/small-grid-single-item/SmallGridSingleItem.tsx
|
|
7658
|
-
var
|
|
7723
|
+
var import_react53 = require("react");
|
|
7659
7724
|
var import_lucide_react34 = require("lucide-react");
|
|
7660
7725
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
7661
|
-
var SmallGridSingleItem = (0,
|
|
7726
|
+
var SmallGridSingleItem = (0, import_react53.memo)(
|
|
7662
7727
|
({
|
|
7663
7728
|
title,
|
|
7664
7729
|
subtitle,
|
|
@@ -7779,7 +7844,7 @@ function SortingAction({
|
|
|
7779
7844
|
}
|
|
7780
7845
|
|
|
7781
7846
|
// src/status-button/StatusButton.tsx
|
|
7782
|
-
var
|
|
7847
|
+
var import_react54 = require("react");
|
|
7783
7848
|
var import_react_i18next20 = require("react-i18next");
|
|
7784
7849
|
var import_lucide_react36 = require("lucide-react");
|
|
7785
7850
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
@@ -7797,7 +7862,7 @@ function StatusButton({
|
|
|
7797
7862
|
...props
|
|
7798
7863
|
}) {
|
|
7799
7864
|
const { t } = (0, import_react_i18next20.useTranslation)();
|
|
7800
|
-
const configMap = (0,
|
|
7865
|
+
const configMap = (0, import_react54.useMemo)(() => {
|
|
7801
7866
|
const defaultLoadingConfig = {
|
|
7802
7867
|
text: loadingText ?? `${t("saving")}...`,
|
|
7803
7868
|
icon: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_lucide_react36.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
@@ -7922,9 +7987,9 @@ function Stepper({
|
|
|
7922
7987
|
}
|
|
7923
7988
|
|
|
7924
7989
|
// src/switch-blocks/SwitchBlocks.tsx
|
|
7925
|
-
var
|
|
7990
|
+
var import_react55 = require("react");
|
|
7926
7991
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
7927
|
-
var SwitchBlocksInternal = (0,
|
|
7992
|
+
var SwitchBlocksInternal = (0, import_react55.forwardRef)(
|
|
7928
7993
|
({ options, value, onChange, disabled, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
7929
7994
|
"div",
|
|
7930
7995
|
{
|
|
@@ -7948,7 +8013,7 @@ var SwitchBlocksInternal = (0, import_react54.forwardRef)(
|
|
|
7948
8013
|
)
|
|
7949
8014
|
);
|
|
7950
8015
|
SwitchBlocksInternal.displayName = "SwitchBlocks";
|
|
7951
|
-
var SwitchBlocks = (0,
|
|
8016
|
+
var SwitchBlocks = (0, import_react55.memo)(SwitchBlocksInternal);
|
|
7952
8017
|
|
|
7953
8018
|
// src/switch-group/SwitchGroup.tsx
|
|
7954
8019
|
var React26 = __toESM(require("react"), 1);
|
|
@@ -8008,7 +8073,7 @@ var SwitchGroup = React26.forwardRef(
|
|
|
8008
8073
|
SwitchGroup.displayName = "SwitchGroup";
|
|
8009
8074
|
|
|
8010
8075
|
// src/tabs/Tabs.tsx
|
|
8011
|
-
var
|
|
8076
|
+
var import_react56 = require("react");
|
|
8012
8077
|
var TabsPrimitive2 = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
8013
8078
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
8014
8079
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
@@ -8024,7 +8089,7 @@ var tabsListVariants = (0, import_class_variance_authority12.cva)("inline-flex i
|
|
|
8024
8089
|
variant: "default"
|
|
8025
8090
|
}
|
|
8026
8091
|
});
|
|
8027
|
-
var TabsList = (0,
|
|
8092
|
+
var TabsList = (0, import_react56.forwardRef)(
|
|
8028
8093
|
({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
8029
8094
|
TabsPrimitive2.List,
|
|
8030
8095
|
{
|
|
@@ -8049,7 +8114,7 @@ var tabsTriggerVariants = (0, import_class_variance_authority12.cva)(
|
|
|
8049
8114
|
}
|
|
8050
8115
|
}
|
|
8051
8116
|
);
|
|
8052
|
-
var TabsTrigger = (0,
|
|
8117
|
+
var TabsTrigger = (0, import_react56.forwardRef)(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
8053
8118
|
TabsPrimitive2.Trigger,
|
|
8054
8119
|
{
|
|
8055
8120
|
ref,
|
|
@@ -8058,7 +8123,7 @@ var TabsTrigger = (0, import_react55.forwardRef)(({ className, variant, ...props
|
|
|
8058
8123
|
}
|
|
8059
8124
|
));
|
|
8060
8125
|
TabsTrigger.displayName = TabsPrimitive2.Trigger.displayName;
|
|
8061
|
-
var TabsContent = (0,
|
|
8126
|
+
var TabsContent = (0, import_react56.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(TabsPrimitive2.Content, { ref, className, tabIndex: -1, ...props }));
|
|
8062
8127
|
TabsContent.displayName = TabsPrimitive2.Content.displayName;
|
|
8063
8128
|
|
|
8064
8129
|
// src/tabbed-section/TabbedSection.tsx
|
|
@@ -8199,11 +8264,11 @@ var TASK_VARIANTS = {
|
|
|
8199
8264
|
var import_sonner2 = require("sonner");
|
|
8200
8265
|
|
|
8201
8266
|
// src/toaster/useUpdateToast.ts
|
|
8202
|
-
var
|
|
8267
|
+
var import_react57 = require("react");
|
|
8203
8268
|
var import_sonner = require("sonner");
|
|
8204
8269
|
function useUpdateToast({ id }) {
|
|
8205
|
-
const toastIdRef = (0,
|
|
8206
|
-
const getToastOptions = (0,
|
|
8270
|
+
const toastIdRef = (0, import_react57.useRef)("");
|
|
8271
|
+
const getToastOptions = (0, import_react57.useCallback)(
|
|
8207
8272
|
(options) => ({
|
|
8208
8273
|
id: toastIdRef.current,
|
|
8209
8274
|
dismissible: false,
|
|
@@ -8318,7 +8383,7 @@ var ToggleGroupItem = React27.forwardRef(({ className, children, variant, size,
|
|
|
8318
8383
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
8319
8384
|
|
|
8320
8385
|
// src/toggle-group/Toggles.tsx
|
|
8321
|
-
var
|
|
8386
|
+
var import_react58 = require("react");
|
|
8322
8387
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
8323
8388
|
var getValueArray2 = (value) => {
|
|
8324
8389
|
if (value) {
|
|
@@ -8393,7 +8458,7 @@ function TogglesInternal({
|
|
|
8393
8458
|
}
|
|
8394
8459
|
};
|
|
8395
8460
|
const isAnyActive = getValueArray2(value).length > 0;
|
|
8396
|
-
(0,
|
|
8461
|
+
(0, import_react58.useEffect)(() => {
|
|
8397
8462
|
onAnySelectorActive?.(isAnyActive);
|
|
8398
8463
|
}, [isAnyActive, onAnySelectorActive]);
|
|
8399
8464
|
const currentValue = getValueArray2(value).map((item) => String(item));
|
|
@@ -8424,7 +8489,7 @@ function TogglesInternal({
|
|
|
8424
8489
|
}) })
|
|
8425
8490
|
] });
|
|
8426
8491
|
}
|
|
8427
|
-
var Toggles = (0,
|
|
8492
|
+
var Toggles = (0, import_react58.forwardRef)(TogglesInternal);
|
|
8428
8493
|
|
|
8429
8494
|
// src/text-field/TextField.tsx
|
|
8430
8495
|
var React28 = __toESM(require("react"), 1);
|
|
@@ -8635,16 +8700,16 @@ var TextField = React28.forwardRef(
|
|
|
8635
8700
|
TextField.displayName = "TextField";
|
|
8636
8701
|
|
|
8637
8702
|
// src/textarea/Textarea.tsx
|
|
8638
|
-
var
|
|
8703
|
+
var import_react59 = require("react");
|
|
8639
8704
|
|
|
8640
8705
|
// src/textarea/styles.module.css
|
|
8641
8706
|
var styles_default9 = {};
|
|
8642
8707
|
|
|
8643
8708
|
// src/textarea/Textarea.tsx
|
|
8644
8709
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
8645
|
-
var Textarea = (0,
|
|
8710
|
+
var Textarea = (0, import_react59.forwardRef)(
|
|
8646
8711
|
({ className, textareaClassName, label, disabled, name, invalid, ...textareaProps }, ref) => {
|
|
8647
|
-
const inputId = (0,
|
|
8712
|
+
const inputId = (0, import_react59.useId)();
|
|
8648
8713
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: cn(styles_default9.container, className), children: [
|
|
8649
8714
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
8650
8715
|
"textarea",
|
|
@@ -11537,7 +11602,7 @@ AirbnbSearchInput.displayName = "SearchInput";
|
|
|
11537
11602
|
var React41 = __toESM(require("react"), 1);
|
|
11538
11603
|
var import_lucide_react46 = require("lucide-react");
|
|
11539
11604
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
11540
|
-
var
|
|
11605
|
+
var import_react60 = require("react");
|
|
11541
11606
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
11542
11607
|
var ROW_HEIGHT = 48;
|
|
11543
11608
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
@@ -11612,7 +11677,7 @@ var SearchableSelectInternal = ({
|
|
|
11612
11677
|
const activeOptionId = highlightedIndex >= 0 ? getOptionId(reactId, highlightedIndex) : void 0;
|
|
11613
11678
|
useOutsideClick(containerRef, open && !isMobile ? () => closeSelect() : null);
|
|
11614
11679
|
const handleOnOpenChange = useEvent(onOpenChange);
|
|
11615
|
-
const setSelectOpen = (0,
|
|
11680
|
+
const setSelectOpen = (0, import_react60.useCallback)(
|
|
11616
11681
|
(nextOpen, options2) => {
|
|
11617
11682
|
setOpen(nextOpen);
|
|
11618
11683
|
handleOnOpenChange?.(nextOpen);
|
|
@@ -11980,39 +12045,6 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
11980
12045
|
}
|
|
11981
12046
|
return -1;
|
|
11982
12047
|
}
|
|
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
12048
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12017
12049
|
0 && (module.exports = {
|
|
12018
12050
|
Accordion,
|
|
@@ -12282,6 +12314,7 @@ function copyToClipboard2(value) {
|
|
|
12282
12314
|
useAbortController,
|
|
12283
12315
|
useClickEscape,
|
|
12284
12316
|
useCombinedRef,
|
|
12317
|
+
useCopyToClipboard,
|
|
12285
12318
|
useDebounce,
|
|
12286
12319
|
useDebouncedFunction,
|
|
12287
12320
|
useEvent,
|