@chekinapp/ui 0.0.95 → 0.0.96
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 +12 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +43 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -367,6 +367,7 @@ __export(index_exports, {
|
|
|
367
367
|
useClickEscape: () => useClickEscape,
|
|
368
368
|
useCombinedRef: () => useCombinedRef,
|
|
369
369
|
useCopyToClipboard: () => useCopyToClipboard,
|
|
370
|
+
useCountdown: () => useCountdown,
|
|
370
371
|
useDebounce: () => useDebounce,
|
|
371
372
|
useDebouncedFunction: () => useDebouncedFunction,
|
|
372
373
|
useEvent: () => useEvent,
|
|
@@ -399,7 +400,6 @@ __export(index_exports, {
|
|
|
399
400
|
useTimeline: () => useTimeline,
|
|
400
401
|
useTimeout: () => useTimeout,
|
|
401
402
|
useTimeoutRef: () => useTimeoutRef,
|
|
402
|
-
useTimer: () => useTimer,
|
|
403
403
|
useUpdateToast: () => useUpdateToast,
|
|
404
404
|
useValidateDates: () => useValidateDates
|
|
405
405
|
});
|
|
@@ -3786,16 +3786,20 @@ function useSwitchSectionActive(preloadedSectionActive, { canToggle, onToggle, o
|
|
|
3786
3786
|
};
|
|
3787
3787
|
}
|
|
3788
3788
|
|
|
3789
|
-
// src/hooks/use-
|
|
3789
|
+
// src/hooks/use-countdown.ts
|
|
3790
3790
|
var import_react33 = require("react");
|
|
3791
|
-
var
|
|
3792
|
-
|
|
3791
|
+
var useCountdown = ({
|
|
3792
|
+
initialTime = 60,
|
|
3793
|
+
enabled = true,
|
|
3794
|
+
onFinish
|
|
3795
|
+
} = {}) => {
|
|
3796
|
+
const [timeLeft, setTimeLeft] = (0, import_react33.useState)(initialTime);
|
|
3793
3797
|
const [isTimerRunning, setIsTimerRunning] = (0, import_react33.useState)(enabled);
|
|
3794
3798
|
const handleOnFinish = useEvent(onFinish);
|
|
3795
3799
|
(0, import_react33.useEffect)(() => {
|
|
3796
|
-
setTimeLeft(
|
|
3800
|
+
setTimeLeft(initialTime);
|
|
3797
3801
|
setIsTimerRunning(enabled);
|
|
3798
|
-
}, [
|
|
3802
|
+
}, [initialTime, enabled]);
|
|
3799
3803
|
(0, import_react33.useEffect)(() => {
|
|
3800
3804
|
if (!isTimerRunning) return;
|
|
3801
3805
|
const timer = setInterval(() => {
|
|
@@ -3816,7 +3820,7 @@ var useTimer = ({ seconds, enabled = true, onFinish }) => {
|
|
|
3816
3820
|
}
|
|
3817
3821
|
}, [timeLeft]);
|
|
3818
3822
|
const resetTimer = () => {
|
|
3819
|
-
setTimeLeft(
|
|
3823
|
+
setTimeLeft(initialTime);
|
|
3820
3824
|
setIsTimerRunning(enabled);
|
|
3821
3825
|
};
|
|
3822
3826
|
return {
|
|
@@ -19207,6 +19211,7 @@ AirbnbSearchInput.displayName = "AirbnbSearchInput";
|
|
|
19207
19211
|
useClickEscape,
|
|
19208
19212
|
useCombinedRef,
|
|
19209
19213
|
useCopyToClipboard,
|
|
19214
|
+
useCountdown,
|
|
19210
19215
|
useDebounce,
|
|
19211
19216
|
useDebouncedFunction,
|
|
19212
19217
|
useEvent,
|
|
@@ -19239,7 +19244,6 @@ AirbnbSearchInput.displayName = "AirbnbSearchInput";
|
|
|
19239
19244
|
useTimeline,
|
|
19240
19245
|
useTimeout,
|
|
19241
19246
|
useTimeoutRef,
|
|
19242
|
-
useTimer,
|
|
19243
19247
|
useUpdateToast,
|
|
19244
19248
|
useValidateDates
|
|
19245
19249
|
});
|