@chekinapp/ui 0.0.95 → 0.0.98

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 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-timer.ts
3789
+ // src/hooks/use-countdown.ts
3790
3790
  var import_react33 = require("react");
3791
- var useTimer = ({ seconds, enabled = true, onFinish }) => {
3792
- const [timeLeft, setTimeLeft] = (0, import_react33.useState)(seconds);
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(seconds);
3800
+ setTimeLeft(initialTime);
3797
3801
  setIsTimerRunning(enabled);
3798
- }, [enabled, seconds]);
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(seconds);
3823
+ setTimeLeft(initialTime);
3820
3824
  setIsTimerRunning(enabled);
3821
3825
  };
3822
3826
  return {
@@ -6653,12 +6657,16 @@ var import_jsx_runtime74 = require("react/jsx-runtime");
6653
6657
  var loaderSizePixels = {
6654
6658
  sm: 16,
6655
6659
  md: 32,
6656
- lg: 48
6660
+ lg: 48,
6661
+ xl: 58,
6662
+ "2xl": 72
6657
6663
  };
6658
6664
  var labelSizeClassName = {
6659
6665
  sm: "text-xs",
6660
6666
  md: "text-sm",
6661
- lg: "text-base"
6667
+ lg: "text-base",
6668
+ xl: "text-base",
6669
+ "2xl": "text-base"
6662
6670
  };
6663
6671
  var CircularLoader = import_react57.default.memo(
6664
6672
  ({
@@ -6675,7 +6683,7 @@ var CircularLoader = import_react57.default.memo(
6675
6683
  "div",
6676
6684
  {
6677
6685
  className: cn(
6678
- "main-loader flex flex-col items-center justify-center gap-2",
6686
+ "main-loader flex flex-col items-center justify-center gap-2 z-50",
6679
6687
  position === "center" && "h-full",
6680
6688
  className
6681
6689
  ),
@@ -7565,7 +7573,16 @@ function useRadioOptions({ options, defaultValue, onChange }) {
7565
7573
  // src/radio/Radio.tsx
7566
7574
  var import_jsx_runtime86 = require("react/jsx-runtime");
7567
7575
  var Radio = (0, import_react64.forwardRef)(
7568
- ({ options, value, onChange, error, className = "", disabled = false, renderOption }, ref) => {
7576
+ ({
7577
+ options,
7578
+ value,
7579
+ onChange,
7580
+ error,
7581
+ className = "",
7582
+ size,
7583
+ disabled = false,
7584
+ renderOption
7585
+ }, ref) => {
7569
7586
  const { selectedValue, handleValueChange } = useRadioOptions({
7570
7587
  options,
7571
7588
  defaultValue: value,
@@ -7591,7 +7608,7 @@ var Radio = (0, import_react64.forwardRef)(
7591
7608
  {
7592
7609
  className: cn(
7593
7610
  "radio__wrapper",
7594
- "flex cursor-pointer items-center gap-2",
7611
+ "flex cursor-pointer items-center gap-2 transition-all duration-200",
7595
7612
  (disabled || option.disabled) && "cursor-default opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
7596
7613
  ),
7597
7614
  children: renderOption ? renderOption({ option, isSelected: getIsSelected(option) }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
@@ -7601,6 +7618,7 @@ var Radio = (0, import_react64.forwardRef)(
7601
7618
  value: option.value,
7602
7619
  id: `option-${option.value}`,
7603
7620
  disabled: option.disabled,
7621
+ size,
7604
7622
  className: "radio__indicator"
7605
7623
  }
7606
7624
  ),
@@ -7630,7 +7648,7 @@ function RadioWithBorder({ size, ...props }) {
7630
7648
  "div",
7631
7649
  {
7632
7650
  className: cn(
7633
- "flex w-full items-start gap-3 rounded-lg border p-4",
7651
+ "flex w-full items-start gap-3 rounded-lg border p-4 transition-all duration-200",
7634
7652
  isSelected && "border-[var(--chekin-color-brand-blue)] bg-[var(--chekin-color-surface-autocomplete)]"
7635
7653
  ),
7636
7654
  children: [
@@ -7644,12 +7662,15 @@ function RadioWithBorder({ size, ...props }) {
7644
7662
  size
7645
7663
  }
7646
7664
  ),
7647
- /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "space-y-1 leading-6", children: [
7648
- /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("p", { className: "flex items-center gap-3 font-semibold", children: [
7649
- option.label,
7650
- data?.subLabel && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "rounded bg-[color-mix(in_srgb,var(--chekin-color-brand-blue)_10%,transparent)] px-2 py-1 text-sm font-semibold leading-4 text-[var(--chekin-color-brand-blue)]", children: data.subLabel })
7665
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex min-w-0 flex-1 items-start justify-between gap-3", children: [
7666
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "min-w-0 space-y-1 leading-6", children: [
7667
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("p", { className: "flex items-center gap-3 font-semibold", children: [
7668
+ option.label,
7669
+ data?.subLabel && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "rounded bg-[color-mix(in_srgb,var(--chekin-color-brand-blue)_10%,transparent)] px-2 py-1 text-sm font-semibold leading-4 text-[var(--chekin-color-brand-blue)]", children: data.subLabel })
7670
+ ] }),
7671
+ data?.description && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-sm font-medium text-[var(--chekin-color-gray-1)]", children: data.description })
7651
7672
  ] }),
7652
- data?.description && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-sm font-medium text-[var(--chekin-color-gray-1)]", children: data.description })
7673
+ data?.rightContent && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "shrink-0", children: data.rightContent })
7653
7674
  ] })
7654
7675
  ]
7655
7676
  }
@@ -19207,6 +19228,7 @@ AirbnbSearchInput.displayName = "AirbnbSearchInput";
19207
19228
  useClickEscape,
19208
19229
  useCombinedRef,
19209
19230
  useCopyToClipboard,
19231
+ useCountdown,
19210
19232
  useDebounce,
19211
19233
  useDebouncedFunction,
19212
19234
  useEvent,
@@ -19239,7 +19261,6 @@ AirbnbSearchInput.displayName = "AirbnbSearchInput";
19239
19261
  useTimeline,
19240
19262
  useTimeout,
19241
19263
  useTimeoutRef,
19242
- useTimer,
19243
19264
  useUpdateToast,
19244
19265
  useValidateDates
19245
19266
  });