@chekinapp/ui 0.0.93 → 0.0.95
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 +24 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +53 -36
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -334,11 +334,14 @@ __export(index_exports, {
|
|
|
334
334
|
buttonVariants: () => buttonVariants,
|
|
335
335
|
calendarClassNames: () => calendarClassNames,
|
|
336
336
|
cn: () => cn,
|
|
337
|
+
compressFile: () => compressFile,
|
|
338
|
+
compressImage: () => compressImage,
|
|
337
339
|
copyToClipboard: () => copyToClipboard,
|
|
338
340
|
createDisabledMatchers: () => createDisabledMatchers,
|
|
339
341
|
emptyMediaVariants: () => emptyMediaVariants,
|
|
340
342
|
formatDate: () => formatDate,
|
|
341
343
|
getErrorMessage: () => getErrorMessage,
|
|
344
|
+
getFileSizeMB: () => getFileSizeMB,
|
|
342
345
|
getScrollableAreaState: () => getScrollableAreaState,
|
|
343
346
|
getSidebarState: () => getSidebarState,
|
|
344
347
|
isDayBlocked: () => isDayBlocked,
|
|
@@ -3785,9 +3788,14 @@ function useSwitchSectionActive(preloadedSectionActive, { canToggle, onToggle, o
|
|
|
3785
3788
|
|
|
3786
3789
|
// src/hooks/use-timer.ts
|
|
3787
3790
|
var import_react33 = require("react");
|
|
3788
|
-
var useTimer = ({ seconds }) => {
|
|
3791
|
+
var useTimer = ({ seconds, enabled = true, onFinish }) => {
|
|
3789
3792
|
const [timeLeft, setTimeLeft] = (0, import_react33.useState)(seconds);
|
|
3790
|
-
const [isTimerRunning, setIsTimerRunning] = (0, import_react33.useState)(
|
|
3793
|
+
const [isTimerRunning, setIsTimerRunning] = (0, import_react33.useState)(enabled);
|
|
3794
|
+
const handleOnFinish = useEvent(onFinish);
|
|
3795
|
+
(0, import_react33.useEffect)(() => {
|
|
3796
|
+
setTimeLeft(seconds);
|
|
3797
|
+
setIsTimerRunning(enabled);
|
|
3798
|
+
}, [enabled, seconds]);
|
|
3791
3799
|
(0, import_react33.useEffect)(() => {
|
|
3792
3800
|
if (!isTimerRunning) return;
|
|
3793
3801
|
const timer = setInterval(() => {
|
|
@@ -3802,9 +3810,14 @@ var useTimer = ({ seconds }) => {
|
|
|
3802
3810
|
}, 1e3);
|
|
3803
3811
|
return () => clearInterval(timer);
|
|
3804
3812
|
}, [isTimerRunning]);
|
|
3813
|
+
(0, import_react33.useEffect)(() => {
|
|
3814
|
+
if (timeLeft <= 0) {
|
|
3815
|
+
handleOnFinish();
|
|
3816
|
+
}
|
|
3817
|
+
}, [timeLeft]);
|
|
3805
3818
|
const resetTimer = () => {
|
|
3806
3819
|
setTimeLeft(seconds);
|
|
3807
|
-
setIsTimerRunning(
|
|
3820
|
+
setIsTimerRunning(enabled);
|
|
3808
3821
|
};
|
|
3809
3822
|
return {
|
|
3810
3823
|
timeLeft,
|
|
@@ -11169,7 +11182,11 @@ async function compressImage(image) {
|
|
|
11169
11182
|
},
|
|
11170
11183
|
error: (error) => {
|
|
11171
11184
|
if (error.message.includes("Failed to load the image")) {
|
|
11172
|
-
reject(
|
|
11185
|
+
reject(
|
|
11186
|
+
new Error(
|
|
11187
|
+
"Unable to process the selected image. Please try a different image."
|
|
11188
|
+
)
|
|
11189
|
+
);
|
|
11173
11190
|
return;
|
|
11174
11191
|
}
|
|
11175
11192
|
reject(error);
|
|
@@ -19157,11 +19174,14 @@ AirbnbSearchInput.displayName = "AirbnbSearchInput";
|
|
|
19157
19174
|
buttonVariants,
|
|
19158
19175
|
calendarClassNames,
|
|
19159
19176
|
cn,
|
|
19177
|
+
compressFile,
|
|
19178
|
+
compressImage,
|
|
19160
19179
|
copyToClipboard,
|
|
19161
19180
|
createDisabledMatchers,
|
|
19162
19181
|
emptyMediaVariants,
|
|
19163
19182
|
formatDate,
|
|
19164
19183
|
getErrorMessage,
|
|
19184
|
+
getFileSizeMB,
|
|
19165
19185
|
getScrollableAreaState,
|
|
19166
19186
|
getSidebarState,
|
|
19167
19187
|
isDayBlocked,
|