@ecohouse/ui 0.1.60 → 0.1.62

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.
Files changed (44) hide show
  1. package/dist/index.cjs +345 -115
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +16 -4
  4. package/dist/index.d.ts +16 -4
  5. package/dist/index.js +344 -117
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/Checkbox/Checkbox.tsx +6 -0
  9. package/src/components/Counter/Counter.test.ts +38 -0
  10. package/src/components/Counter/Counter.tsx +7 -10
  11. package/src/components/Counter/Counter.utils.ts +28 -0
  12. package/src/components/DatePicker/DatePicker.tsx +5 -14
  13. package/src/components/Drawer/Drawer.tsx +15 -12
  14. package/src/components/Modal/Modal.tsx +31 -11
  15. package/src/components/RadioButton/RadioButton.tsx +14 -0
  16. package/src/components/Select/Select.tsx +16 -8
  17. package/src/components/Toggle/Toggle.tsx +6 -0
  18. package/src/components/VerificationCodeInput/VerificationCodeInput.test.ts +60 -12
  19. package/src/components/VerificationCodeInput/VerificationCodeInput.tsx +29 -24
  20. package/src/components/VerificationCodeInput/VerificationCodeInput.utils.ts +53 -13
  21. package/src/icons/PaymentCard/PaymentCardIcon.tsx +14 -0
  22. package/src/icons/PaymentCard/PaymentCardIcon.web.tsx +13 -0
  23. package/src/icons/PaymentCard/index.ts +1 -0
  24. package/src/icons/PaymentCard/paymentCardPath.ts +3 -0
  25. package/src/icons/Receipt/ReceiptIcon.tsx +14 -0
  26. package/src/icons/Receipt/ReceiptIcon.web.tsx +13 -0
  27. package/src/icons/Receipt/index.ts +1 -0
  28. package/src/icons/Receipt/receiptPath.ts +3 -0
  29. package/src/icons/index.ts +2 -0
  30. package/src/icons/registry.ts +4 -0
  31. package/src/index.ts +8 -1
  32. package/src/theme/typography.ts +2 -2
  33. package/src/utils/dateUtils.test.ts +72 -0
  34. package/src/utils/dateUtils.ts +30 -2
  35. package/src/utils/focusTrap.test.ts +26 -0
  36. package/src/utils/focusTrap.ts +39 -0
  37. package/src/utils/overlayStack.test.ts +175 -0
  38. package/src/utils/overlayStack.ts +105 -0
  39. package/src/utils/useHydrated.test.ts +14 -0
  40. package/src/utils/useHydrated.ts +14 -0
  41. package/src/utils/useOverlayLayer.ts +41 -0
  42. package/src/utils/useWebFocusTrap.ts +68 -0
  43. package/src/utils/webToggleKey.test.ts +49 -0
  44. package/src/utils/webToggleKey.ts +23 -0
package/dist/index.cjs CHANGED
@@ -18771,29 +18771,29 @@ var require_react_dom_development = __commonJS({
18771
18771
  }
18772
18772
  return [newState, dispatch];
18773
18773
  }
18774
- function mountMutableSource(source, getSnapshot, subscribe) {
18774
+ function mountMutableSource(source, getSnapshot, subscribe2) {
18775
18775
  {
18776
18776
  return void 0;
18777
18777
  }
18778
18778
  }
18779
- function updateMutableSource(source, getSnapshot, subscribe) {
18779
+ function updateMutableSource(source, getSnapshot, subscribe2) {
18780
18780
  {
18781
18781
  return void 0;
18782
18782
  }
18783
18783
  }
18784
- function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
18784
+ function mountSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot2) {
18785
18785
  var fiber = currentlyRenderingFiber$1;
18786
18786
  var hook = mountWorkInProgressHook();
18787
18787
  var nextSnapshot;
18788
18788
  var isHydrating2 = getIsHydrating();
18789
18789
  if (isHydrating2) {
18790
- if (getServerSnapshot === void 0) {
18790
+ if (getServerSnapshot2 === void 0) {
18791
18791
  throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
18792
18792
  }
18793
- nextSnapshot = getServerSnapshot();
18793
+ nextSnapshot = getServerSnapshot2();
18794
18794
  {
18795
18795
  if (!didWarnUncachedGetSnapshot) {
18796
- if (nextSnapshot !== getServerSnapshot()) {
18796
+ if (nextSnapshot !== getServerSnapshot2()) {
18797
18797
  error("The result of getServerSnapshot should be cached to avoid an infinite loop");
18798
18798
  didWarnUncachedGetSnapshot = true;
18799
18799
  }
@@ -18824,12 +18824,12 @@ var require_react_dom_development = __commonJS({
18824
18824
  getSnapshot
18825
18825
  };
18826
18826
  hook.queue = inst;
18827
- mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
18827
+ mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe2), [subscribe2]);
18828
18828
  fiber.flags |= Passive;
18829
18829
  pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
18830
18830
  return nextSnapshot;
18831
18831
  }
18832
- function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
18832
+ function updateSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot2) {
18833
18833
  var fiber = currentlyRenderingFiber$1;
18834
18834
  var hook = updateWorkInProgressHook();
18835
18835
  var nextSnapshot = getSnapshot();
@@ -18849,7 +18849,7 @@ var require_react_dom_development = __commonJS({
18849
18849
  markWorkInProgressReceivedUpdate();
18850
18850
  }
18851
18851
  var inst = hook.queue;
18852
- updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
18852
+ updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe2), [subscribe2]);
18853
18853
  if (inst.getSnapshot !== getSnapshot || snapshotChanged || // Check if the susbcribe function changed. We can save some memory by
18854
18854
  // checking whether we scheduled a subscription effect above.
18855
18855
  workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
@@ -18892,13 +18892,13 @@ var require_react_dom_development = __commonJS({
18892
18892
  forceStoreRerender(fiber);
18893
18893
  }
18894
18894
  }
18895
- function subscribeToStore(fiber, inst, subscribe) {
18895
+ function subscribeToStore(fiber, inst, subscribe2) {
18896
18896
  var handleStoreChange = function() {
18897
18897
  if (checkIfSnapshotChanged(inst)) {
18898
18898
  forceStoreRerender(fiber);
18899
18899
  }
18900
18900
  };
18901
- return subscribe(handleStoreChange);
18901
+ return subscribe2(handleStoreChange);
18902
18902
  }
18903
18903
  function checkIfSnapshotChanged(inst) {
18904
18904
  var latestGetSnapshot = inst.getSnapshot;
@@ -19479,15 +19479,15 @@ var require_react_dom_development = __commonJS({
19479
19479
  mountHookTypesDev();
19480
19480
  return mountTransition();
19481
19481
  },
19482
- useMutableSource: function(source, getSnapshot, subscribe) {
19482
+ useMutableSource: function(source, getSnapshot, subscribe2) {
19483
19483
  currentHookNameInDev = "useMutableSource";
19484
19484
  mountHookTypesDev();
19485
19485
  return mountMutableSource();
19486
19486
  },
19487
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
19487
+ useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
19488
19488
  currentHookNameInDev = "useSyncExternalStore";
19489
19489
  mountHookTypesDev();
19490
- return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
19490
+ return mountSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot2);
19491
19491
  },
19492
19492
  useId: function() {
19493
19493
  currentHookNameInDev = "useId";
@@ -19583,15 +19583,15 @@ var require_react_dom_development = __commonJS({
19583
19583
  updateHookTypesDev();
19584
19584
  return mountTransition();
19585
19585
  },
19586
- useMutableSource: function(source, getSnapshot, subscribe) {
19586
+ useMutableSource: function(source, getSnapshot, subscribe2) {
19587
19587
  currentHookNameInDev = "useMutableSource";
19588
19588
  updateHookTypesDev();
19589
19589
  return mountMutableSource();
19590
19590
  },
19591
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
19591
+ useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
19592
19592
  currentHookNameInDev = "useSyncExternalStore";
19593
19593
  updateHookTypesDev();
19594
- return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
19594
+ return mountSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot2);
19595
19595
  },
19596
19596
  useId: function() {
19597
19597
  currentHookNameInDev = "useId";
@@ -19687,15 +19687,15 @@ var require_react_dom_development = __commonJS({
19687
19687
  updateHookTypesDev();
19688
19688
  return updateTransition();
19689
19689
  },
19690
- useMutableSource: function(source, getSnapshot, subscribe) {
19690
+ useMutableSource: function(source, getSnapshot, subscribe2) {
19691
19691
  currentHookNameInDev = "useMutableSource";
19692
19692
  updateHookTypesDev();
19693
19693
  return updateMutableSource();
19694
19694
  },
19695
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
19695
+ useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
19696
19696
  currentHookNameInDev = "useSyncExternalStore";
19697
19697
  updateHookTypesDev();
19698
- return updateSyncExternalStore(subscribe, getSnapshot);
19698
+ return updateSyncExternalStore(subscribe2, getSnapshot);
19699
19699
  },
19700
19700
  useId: function() {
19701
19701
  currentHookNameInDev = "useId";
@@ -19791,15 +19791,15 @@ var require_react_dom_development = __commonJS({
19791
19791
  updateHookTypesDev();
19792
19792
  return rerenderTransition();
19793
19793
  },
19794
- useMutableSource: function(source, getSnapshot, subscribe) {
19794
+ useMutableSource: function(source, getSnapshot, subscribe2) {
19795
19795
  currentHookNameInDev = "useMutableSource";
19796
19796
  updateHookTypesDev();
19797
19797
  return updateMutableSource();
19798
19798
  },
19799
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
19799
+ useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
19800
19800
  currentHookNameInDev = "useSyncExternalStore";
19801
19801
  updateHookTypesDev();
19802
- return updateSyncExternalStore(subscribe, getSnapshot);
19802
+ return updateSyncExternalStore(subscribe2, getSnapshot);
19803
19803
  },
19804
19804
  useId: function() {
19805
19805
  currentHookNameInDev = "useId";
@@ -19909,17 +19909,17 @@ var require_react_dom_development = __commonJS({
19909
19909
  mountHookTypesDev();
19910
19910
  return mountTransition();
19911
19911
  },
19912
- useMutableSource: function(source, getSnapshot, subscribe) {
19912
+ useMutableSource: function(source, getSnapshot, subscribe2) {
19913
19913
  currentHookNameInDev = "useMutableSource";
19914
19914
  warnInvalidHookAccess();
19915
19915
  mountHookTypesDev();
19916
19916
  return mountMutableSource();
19917
19917
  },
19918
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
19918
+ useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
19919
19919
  currentHookNameInDev = "useSyncExternalStore";
19920
19920
  warnInvalidHookAccess();
19921
19921
  mountHookTypesDev();
19922
- return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
19922
+ return mountSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot2);
19923
19923
  },
19924
19924
  useId: function() {
19925
19925
  currentHookNameInDev = "useId";
@@ -20030,17 +20030,17 @@ var require_react_dom_development = __commonJS({
20030
20030
  updateHookTypesDev();
20031
20031
  return updateTransition();
20032
20032
  },
20033
- useMutableSource: function(source, getSnapshot, subscribe) {
20033
+ useMutableSource: function(source, getSnapshot, subscribe2) {
20034
20034
  currentHookNameInDev = "useMutableSource";
20035
20035
  warnInvalidHookAccess();
20036
20036
  updateHookTypesDev();
20037
20037
  return updateMutableSource();
20038
20038
  },
20039
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
20039
+ useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
20040
20040
  currentHookNameInDev = "useSyncExternalStore";
20041
20041
  warnInvalidHookAccess();
20042
20042
  updateHookTypesDev();
20043
- return updateSyncExternalStore(subscribe, getSnapshot);
20043
+ return updateSyncExternalStore(subscribe2, getSnapshot);
20044
20044
  },
20045
20045
  useId: function() {
20046
20046
  currentHookNameInDev = "useId";
@@ -20151,17 +20151,17 @@ var require_react_dom_development = __commonJS({
20151
20151
  updateHookTypesDev();
20152
20152
  return rerenderTransition();
20153
20153
  },
20154
- useMutableSource: function(source, getSnapshot, subscribe) {
20154
+ useMutableSource: function(source, getSnapshot, subscribe2) {
20155
20155
  currentHookNameInDev = "useMutableSource";
20156
20156
  warnInvalidHookAccess();
20157
20157
  updateHookTypesDev();
20158
20158
  return updateMutableSource();
20159
20159
  },
20160
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
20160
+ useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
20161
20161
  currentHookNameInDev = "useSyncExternalStore";
20162
20162
  warnInvalidHookAccess();
20163
20163
  updateHookTypesDev();
20164
- return updateSyncExternalStore(subscribe, getSnapshot);
20164
+ return updateSyncExternalStore(subscribe2, getSnapshot);
20165
20165
  },
20166
20166
  useId: function() {
20167
20167
  currentHookNameInDev = "useId";
@@ -28619,7 +28619,7 @@ var languageSwitcherTypography = {
28619
28619
  fontFamily: fonts.sans,
28620
28620
  fontSize: 14,
28621
28621
  fontWeight: "600",
28622
- lineHeight: 14,
28622
+ lineHeight: 18,
28623
28623
  letterSpacing: 0.42
28624
28624
  };
28625
28625
  var counterTypography = {
@@ -30177,6 +30177,12 @@ function PhoneIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
30177
30177
  ) });
30178
30178
  }
30179
30179
 
30180
+ // src/icons/PaymentCard/paymentCardPath.ts
30181
+ var PAYMENT_CARD_PATH = "M4.66536 10H6.66536C6.84218 10 7.01174 9.9298 7.13677 9.80478C7.26179 9.67975 7.33203 9.51019 7.33203 9.33337C7.33203 9.15656 7.26179 8.98699 7.13677 8.86197C7.01174 8.73695 6.84218 8.66671 6.66536 8.66671H4.66536C4.48855 8.66671 4.31898 8.73695 4.19396 8.86197C4.06894 8.98699 3.9987 9.15656 3.9987 9.33337C3.9987 9.51019 4.06894 9.67975 4.19396 9.80478C4.31898 9.9298 4.48855 10 4.66536 10ZM12.6654 3.33337H3.33203C2.8016 3.33337 2.29289 3.54409 1.91782 3.91916C1.54274 4.29423 1.33203 4.80294 1.33203 5.33337V11.3334C1.33203 11.8638 1.54274 12.3725 1.91782 12.7476C2.29289 13.1227 2.8016 13.3334 3.33203 13.3334H12.6654C13.1958 13.3334 13.7045 13.1227 14.0796 12.7476C14.4546 12.3725 14.6654 11.8638 14.6654 11.3334V5.33337C14.6654 4.80294 14.4546 4.29423 14.0796 3.91916C13.7045 3.54409 13.1958 3.33337 12.6654 3.33337ZM13.332 11.3334C13.332 11.5102 13.2618 11.6798 13.1368 11.8048C13.0117 11.9298 12.8422 12 12.6654 12H3.33203C3.15522 12 2.98565 11.9298 2.86063 11.8048C2.7356 11.6798 2.66536 11.5102 2.66536 11.3334V7.33337H13.332V11.3334ZM13.332 6.00004H2.66536V5.33337C2.66536 5.15656 2.7356 4.98699 2.86063 4.86197C2.98565 4.73695 3.15522 4.66671 3.33203 4.66671H12.6654C12.8422 4.66671 13.0117 4.73695 13.1368 4.86197C13.2618 4.98699 13.332 5.15656 13.332 5.33337V6.00004Z";
30182
+ function PaymentCardIcon({ size = 16, color = colors.grey100 }) {
30183
+ return /* @__PURE__ */ jsxRuntime.jsx(Svg31__default.default, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(Svg31.Path, { d: PAYMENT_CARD_PATH, fill: color }) });
30184
+ }
30185
+
30180
30186
  // src/icons/Plus/plusPath.ts
30181
30187
  var PLUS_PATH = "M8.00004 3.33325V12.6666M3.33337 7.99992H12.6667";
30182
30188
  function PlusIcon({ size = 16, color = colors.white, strokeWidth = 2 }) {
@@ -30207,6 +30213,12 @@ function RefreshIcon({ size = 20, color = colors.white, strokeWidth = 2 }) {
30207
30213
  ) });
30208
30214
  }
30209
30215
 
30216
+ // src/icons/Receipt/receiptPath.ts
30217
+ var RECEIPT_PATH = "M6.66667 5.33337H10.6667C10.8435 5.33337 11.013 5.26314 11.1381 5.13811C11.2631 5.01309 11.3333 4.84352 11.3333 4.66671C11.3333 4.4899 11.2631 4.32033 11.1381 4.1953C11.013 4.07028 10.8435 4.00004 10.6667 4.00004H6.66667C6.48986 4.00004 6.32029 4.07028 6.19526 4.1953C6.07024 4.32033 6 4.4899 6 4.66671C6 4.84352 6.07024 5.01309 6.19526 5.13811C6.32029 5.26314 6.48986 5.33337 6.66667 5.33337ZM5.33333 8.00004H10.6667C10.8435 8.00004 11.013 7.9298 11.1381 7.80478C11.2631 7.67975 11.3333 7.51019 11.3333 7.33337C11.3333 7.15656 11.2631 6.98699 11.1381 6.86197C11.013 6.73695 10.8435 6.66671 10.6667 6.66671H5.33333C5.15652 6.66671 4.98695 6.73695 4.86193 6.86197C4.7369 6.98699 4.66667 7.15656 4.66667 7.33337C4.66667 7.51019 4.7369 7.67975 4.86193 7.80478C4.98695 7.9298 5.15652 8.00004 5.33333 8.00004ZM5.33333 10.6667H10.6667C10.8435 10.6667 11.013 10.5965 11.1381 10.4714C11.2631 10.3464 11.3333 10.1769 11.3333 10C11.3333 9.82323 11.2631 9.65366 11.1381 9.52864C11.013 9.40361 10.8435 9.33337 10.6667 9.33337H5.33333C5.15652 9.33337 4.98695 9.40361 4.86193 9.52864C4.7369 9.65366 4.66667 9.82323 4.66667 10C4.66667 10.1769 4.7369 10.3464 4.86193 10.4714C4.98695 10.5965 5.15652 10.6667 5.33333 10.6667ZM13.3333 1.33337H2.66667C2.48986 1.33337 2.32029 1.40361 2.19526 1.52864C2.07024 1.65366 2 1.82323 2 2.00004V14C2 14.1238 2.03448 14.2452 2.09957 14.3505C2.16466 14.4558 2.25779 14.541 2.36852 14.5963C2.47926 14.6517 2.60323 14.6751 2.72654 14.664C2.84984 14.6529 2.96762 14.6077 3.06667 14.5334L4.44667 13.5L5.82 14.5334C5.9354 14.6199 6.07575 14.6667 6.22 14.6667C6.36425 14.6667 6.5046 14.6199 6.62 14.5334L8 13.5L9.38 14.5334C9.4954 14.6199 9.63575 14.6667 9.78 14.6667C9.92425 14.6667 10.0646 14.6199 10.18 14.5334L11.5533 13.5L12.9333 14.5334C13.0329 14.6075 13.1511 14.6525 13.2748 14.6631C13.3985 14.6737 13.5226 14.6495 13.6333 14.5934C13.7433 14.538 13.8357 14.4532 13.9005 14.3485C13.9652 14.2438 13.9996 14.1232 14 14V2.00004C14 1.82323 13.9298 1.65366 13.8047 1.52864C13.6797 1.40361 13.5101 1.33337 13.3333 1.33337ZM12.6667 12.6667L11.9533 12.1334C11.8379 12.0468 11.6976 12 11.5533 12C11.4091 12 11.2687 12.0468 11.1533 12.1334L9.78 13.1667L8.4 12.1334C8.2846 12.0468 8.14425 12 8 12C7.85575 12 7.7154 12.0468 7.6 12.1334L6.22 13.1667L4.84667 12.1334C4.73127 12.0468 4.59091 12 4.44667 12C4.30242 12 4.16206 12.0468 4.04667 12.1334L3.33333 12.6667V2.66671H12.6667V12.6667Z";
30218
+ function ReceiptIcon({ size = 16, color = colors.grey100 }) {
30219
+ return /* @__PURE__ */ jsxRuntime.jsx(Svg31__default.default, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(Svg31.Path, { d: RECEIPT_PATH, fill: color }) });
30220
+ }
30221
+
30210
30222
  // src/icons/RefundStatus/refundStatusPath.ts
30211
30223
  var REFUND_STATUS_PATH = "M15.1333 7.66667L13.8004 9L12.4666 7.66667M13.9634 8.66667C13.9876 8.44778 14 8.22534 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C9.88484 14 11.5667 13.1309 12.6667 11.7716M8 4.66667V8L10 9.33333";
30212
30224
  function RefundStatusIcon({
@@ -30667,12 +30679,14 @@ var icons = {
30667
30679
  notificationSuccess: NotificationSuccessIcon,
30668
30680
  notificationWarning: NotificationWarningIcon,
30669
30681
  paw: PawIcon,
30682
+ paymentCard: PaymentCardIcon,
30670
30683
  phone: PhoneIcon,
30671
30684
  qrCode: QrCodeIcon,
30672
30685
  quietHours: QuietHoursIcon,
30673
30686
  ratingStar: RatingStarIcon,
30674
30687
  plus: PlusIcon,
30675
30688
  refresh: RefreshIcon,
30689
+ receipt: ReceiptIcon,
30676
30690
  refundStatus: RefundStatusIcon,
30677
30691
  search: SearchIcon,
30678
30692
  saveHeart: SaveHeartIcon,
@@ -33148,14 +33162,23 @@ var styles18 = reactNative.StyleSheet.create({
33148
33162
  includeFontPadding: false
33149
33163
  }
33150
33164
  });
33165
+
33166
+ // src/components/Counter/Counter.utils.ts
33167
+ function clampCounterValue(value, min, max) {
33168
+ return Math.max(min, max === void 0 ? value : Math.min(value, max));
33169
+ }
33170
+ function resolveCounterValue(controlledValue, uncontrolledValue, min, max) {
33171
+ if (controlledValue !== void 0 && Number.isFinite(controlledValue)) return controlledValue;
33172
+ return clampCounterValue(controlledValue === void 0 ? uncontrolledValue : min, min, max);
33173
+ }
33174
+ function stepCounterValue(current, delta, min, max) {
33175
+ return clampCounterValue(current + delta, min, max);
33176
+ }
33151
33177
  var BUTTON_SIZE = 32;
33152
33178
  var webBlurStyle7 = reactNative.Platform.OS === "web" ? {
33153
33179
  backdropFilter: "blur(20px)",
33154
33180
  WebkitBackdropFilter: "blur(20px)"
33155
33181
  } : {};
33156
- function clamp(value, min, max) {
33157
- return Math.max(min, max === void 0 ? value : Math.min(value, max));
33158
- }
33159
33182
  var Counter = react.forwardRef(function Counter2({
33160
33183
  value,
33161
33184
  defaultValue,
@@ -33173,16 +33196,16 @@ var Counter = react.forwardRef(function Counter2({
33173
33196
  const containerRef = react.useRef(null);
33174
33197
  const isControlled = value !== void 0;
33175
33198
  const [uncontrolledValue, setUncontrolledValue] = react.useState(
33176
- () => clamp(defaultValue ?? min, min, max)
33199
+ () => clampCounterValue(defaultValue ?? min, min, max)
33177
33200
  );
33178
- const resolvedValue = clamp(isControlled ? value : uncontrolledValue, min, max);
33201
+ const resolvedValue = resolveCounterValue(value, uncontrolledValue, min, max);
33179
33202
  const resolvedClassName = className?.trim() || void 0;
33180
33203
  const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
33181
33204
  const decrementDisabled = disabled || resolvedValue <= min;
33182
33205
  const incrementDisabled = disabled || max !== void 0 && resolvedValue >= max;
33183
33206
  useApplyWebClassName(containerRef, resolvedClassName);
33184
- const updateValue = (nextValue) => {
33185
- const next = clamp(nextValue, min, max);
33207
+ const updateValue = (delta) => {
33208
+ const next = stepCounterValue(resolvedValue, delta, min, max);
33186
33209
  if (next === resolvedValue) return;
33187
33210
  if (!isControlled) setUncontrolledValue(next);
33188
33211
  onValueChange?.(next);
@@ -33192,7 +33215,7 @@ var Counter = react.forwardRef(function Counter2({
33192
33215
  {
33193
33216
  disabled: decrementDisabled,
33194
33217
  hitSlop,
33195
- onPress: () => updateValue(resolvedValue - step),
33218
+ onPress: () => updateValue(-step),
33196
33219
  accessibilityRole: "button",
33197
33220
  accessibilityLabel: "Decrease value",
33198
33221
  accessibilityState: { disabled: decrementDisabled },
@@ -33205,7 +33228,7 @@ var Counter = react.forwardRef(function Counter2({
33205
33228
  {
33206
33229
  disabled: incrementDisabled,
33207
33230
  hitSlop,
33208
- onPress: () => updateValue(resolvedValue + step),
33231
+ onPress: () => updateValue(step),
33209
33232
  accessibilityRole: "button",
33210
33233
  accessibilityLabel: "Increase value",
33211
33234
  accessibilityState: { disabled: incrementDisabled },
@@ -34488,6 +34511,15 @@ var styles25 = reactNative.StyleSheet.create({
34488
34511
  top: 0
34489
34512
  }
34490
34513
  });
34514
+
34515
+ // src/utils/webToggleKey.ts
34516
+ function handleWebToggleKeyDown(event, onToggle) {
34517
+ const isSpace = event.key === " " || event.key === "Spacebar";
34518
+ if (!isSpace || event.target !== event.currentTarget) return false;
34519
+ event.preventDefault();
34520
+ if (!event.repeat) onToggle();
34521
+ return true;
34522
+ }
34491
34523
  var BOX_SIZE = 20;
34492
34524
  var BOX_RADIUS = 6;
34493
34525
  var CHECK_SIZE = 12;
@@ -34543,6 +34575,8 @@ var Checkbox = react.forwardRef(function Checkbox2({
34543
34575
  accessibilityRole: "checkbox",
34544
34576
  accessibilityLabel: resolvedAccessibilityLabel,
34545
34577
  accessibilityState: { checked: isActive, disabled },
34578
+ "aria-checked": isActive,
34579
+ ...reactNative.Platform.OS === "web" && !disabled ? { onKeyDown: (event) => handleWebToggleKeyDown(event, handlePress) } : null,
34546
34580
  style: [styles26.root, disabled && styles26.disabled, style],
34547
34581
  children: [
34548
34582
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -34636,8 +34670,23 @@ function abbreviateMonthName(monthName, letterCount = 3) {
34636
34670
  }
34637
34671
  return chars.slice(0, end).join("");
34638
34672
  }
34673
+ function abbreviateMonthNames(monthNames, letterCount = 3) {
34674
+ return monthNames.map((name, index) => {
34675
+ const maxLetters = abbreviatedLetterCount(name);
34676
+ let count = letterCount;
34677
+ while (count < maxLetters && monthNames.some(
34678
+ (other, otherIndex) => otherIndex !== index && abbreviateMonthName(other, count) === abbreviateMonthName(name, count)
34679
+ )) {
34680
+ count += 1;
34681
+ }
34682
+ return abbreviateMonthName(name, count);
34683
+ });
34684
+ }
34685
+ function abbreviatedLetterCount(monthName) {
34686
+ return Array.from(monthName.replace(/ու/g, "u")).length;
34687
+ }
34639
34688
  function formatDateDayShortMonth(date, monthNames, letterCount = 3) {
34640
- const month = abbreviateMonthName(monthNames[date.getMonth()] ?? "", letterCount);
34689
+ const month = abbreviateMonthNames(monthNames, letterCount)[date.getMonth()] ?? "";
34641
34690
  return `${date.getDate()} ${month} ${date.getFullYear()}`;
34642
34691
  }
34643
34692
  function getMonthMatrix(monthDate, weekStartsOn = 1) {
@@ -34661,6 +34710,78 @@ function getMonthMatrix(monthDate, weekStartsOn = 1) {
34661
34710
  }
34662
34711
  return weeks;
34663
34712
  }
34713
+
34714
+ // src/utils/overlayStack.ts
34715
+ function createOverlayStack(target) {
34716
+ const layers = [];
34717
+ const top = (kind) => {
34718
+ for (let index = layers.length - 1; index >= 0; index -= 1) {
34719
+ if (layers[index].kind === kind) return layers[index];
34720
+ }
34721
+ return void 0;
34722
+ };
34723
+ const handleCapture = (event) => {
34724
+ const layer = top("popover");
34725
+ if (event.key !== "Escape" || event.defaultPrevented || !layer) return;
34726
+ event.preventDefault();
34727
+ event.stopImmediatePropagation();
34728
+ layer.onEscape();
34729
+ };
34730
+ const handleBubble = (event) => {
34731
+ const layer = top("overlay");
34732
+ if (event.key !== "Escape" || event.defaultPrevented || !layer) return;
34733
+ event.preventDefault();
34734
+ layer.onEscape();
34735
+ };
34736
+ return {
34737
+ push(layer) {
34738
+ layers.push(layer);
34739
+ if (layers.length === 1) {
34740
+ target.addEventListener("keydown", handleCapture, true);
34741
+ target.addEventListener("keydown", handleBubble, false);
34742
+ }
34743
+ return () => {
34744
+ const index = layers.indexOf(layer);
34745
+ if (index === -1) return;
34746
+ layers.splice(index, 1);
34747
+ if (layers.length === 0) {
34748
+ target.removeEventListener("keydown", handleCapture, true);
34749
+ target.removeEventListener("keydown", handleBubble, false);
34750
+ }
34751
+ };
34752
+ },
34753
+ isTop: (layer) => top(layer.kind) === layer
34754
+ };
34755
+ }
34756
+ var documentStack = null;
34757
+ function getDocumentOverlayStack() {
34758
+ if (!documentStack) {
34759
+ documentStack = createOverlayStack(document);
34760
+ }
34761
+ return documentStack;
34762
+ }
34763
+
34764
+ // src/utils/useOverlayLayer.ts
34765
+ function useOverlayLayer(kind, active, onEscape) {
34766
+ const onEscapeRef = react.useRef(onEscape);
34767
+ onEscapeRef.current = onEscape;
34768
+ const layerRef = react.useRef(null);
34769
+ react.useEffect(() => {
34770
+ if (!active || reactNative.Platform.OS !== "web" || typeof document === "undefined") return void 0;
34771
+ const layer = { kind, onEscape: () => onEscapeRef.current() };
34772
+ const stack = getDocumentOverlayStack();
34773
+ const remove = stack.push(layer);
34774
+ layerRef.current = layer;
34775
+ return () => {
34776
+ remove();
34777
+ if (layerRef.current === layer) layerRef.current = null;
34778
+ };
34779
+ }, [active, kind]);
34780
+ return react.useCallback(() => {
34781
+ const layer = layerRef.current;
34782
+ return layer !== null && getDocumentOverlayStack().isTop(layer);
34783
+ }, []);
34784
+ }
34664
34785
  var DEFAULT_MONTH_NAMES = [
34665
34786
  "\u0540\u0578\u0582\u0576\u057E\u0561\u0580",
34666
34787
  "\u0553\u0565\u057F\u0580\u057E\u0561\u0580",
@@ -34855,17 +34976,7 @@ var DatePicker = react.forwardRef(
34855
34976
  setOpen(false);
34856
34977
  focusTrigger();
34857
34978
  }, [focusTrigger, setOpen]);
34858
- react.useEffect(() => {
34859
- if (reactNative.Platform.OS !== "web" || !isOpen) return;
34860
- const handleKeyDown = (event) => {
34861
- if (event.key === "Escape") {
34862
- event.preventDefault();
34863
- closeAndFocusTrigger();
34864
- }
34865
- };
34866
- document.addEventListener("keydown", handleKeyDown);
34867
- return () => document.removeEventListener("keydown", handleKeyDown);
34868
- }, [isOpen, closeAndFocusTrigger]);
34979
+ useOverlayLayer("popover", isOpen, closeAndFocusTrigger);
34869
34980
  const handleTriggerPress = () => {
34870
34981
  if (disabled) return;
34871
34982
  setOpen(!isOpen);
@@ -34955,6 +35066,7 @@ var DatePicker = react.forwardRef(
34955
35066
  accessibilityRole: "button",
34956
35067
  accessibilityLabel: resolvedAccessibilityLabel,
34957
35068
  accessibilityState: { disabled, expanded: isOpen },
35069
+ "aria-expanded": isOpen,
34958
35070
  style: [
34959
35071
  styles27.trigger,
34960
35072
  usesRangeTrigger && styles27.rangeTrigger,
@@ -35513,6 +35625,78 @@ var styles28 = reactNative.StyleSheet.create({
35513
35625
 
35514
35626
  // src/components/Modal/Modal.tsx
35515
35627
  var import_react_dom = __toESM(require_react_dom());
35628
+ var subscribe = () => () => {
35629
+ };
35630
+ var getClientSnapshot = () => true;
35631
+ var getServerSnapshot = () => false;
35632
+ function useHydrated() {
35633
+ return react.useSyncExternalStore(subscribe, getClientSnapshot, getServerSnapshot);
35634
+ }
35635
+
35636
+ // src/utils/focusTrap.ts
35637
+ var TABBABLE_SELECTOR = [
35638
+ "a[href]",
35639
+ "area[href]",
35640
+ "button",
35641
+ "input:not([type='hidden'])",
35642
+ "select",
35643
+ "textarea",
35644
+ "iframe",
35645
+ "[contenteditable='true']",
35646
+ "[tabindex]"
35647
+ ].join(",");
35648
+ function getTabbableElements(container) {
35649
+ return Array.from(container.querySelectorAll(TABBABLE_SELECTOR)).filter(
35650
+ (element) => element.tabIndex >= 0 && !element.hasAttribute("disabled") && element.getAttribute("aria-hidden") !== "true" && element.getClientRects().length > 0
35651
+ );
35652
+ }
35653
+ function getWrappedFocusIndex(count, currentIndex, backwards) {
35654
+ if (count === 0) return null;
35655
+ if (currentIndex === -1) return backwards ? count - 1 : 0;
35656
+ if (backwards && currentIndex === 0) return count - 1;
35657
+ if (!backwards && currentIndex === count - 1) return 0;
35658
+ return null;
35659
+ }
35660
+
35661
+ // src/utils/useWebFocusTrap.ts
35662
+ function useWebFocusTrap(containerRef, active, isTopLayer) {
35663
+ react.useEffect(() => {
35664
+ if (!active || reactNative.Platform.OS !== "web" || typeof document === "undefined") return void 0;
35665
+ const container = containerRef.current;
35666
+ if (!container) return void 0;
35667
+ const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
35668
+ if (!container.contains(document.activeElement)) container.focus({ preventScroll: true });
35669
+ const handleKeyDown = (event) => {
35670
+ if (event.key !== "Tab" || event.defaultPrevented || !isTopLayer()) return;
35671
+ const activeElement = document.activeElement;
35672
+ if (activeElement !== null && activeElement !== document.body && !container.contains(activeElement)) {
35673
+ return;
35674
+ }
35675
+ const tabbables = getTabbableElements(container);
35676
+ if (tabbables.length === 0) {
35677
+ event.preventDefault();
35678
+ container.focus({ preventScroll: true });
35679
+ return;
35680
+ }
35681
+ const nextIndex = getWrappedFocusIndex(
35682
+ tabbables.length,
35683
+ tabbables.indexOf(activeElement),
35684
+ event.shiftKey
35685
+ );
35686
+ if (nextIndex === null) return;
35687
+ event.preventDefault();
35688
+ tabbables[nextIndex].focus();
35689
+ };
35690
+ document.addEventListener("keydown", handleKeyDown);
35691
+ return () => {
35692
+ document.removeEventListener("keydown", handleKeyDown);
35693
+ const current = document.activeElement;
35694
+ if (previouslyFocused?.isConnected && (current === null || current === document.body || container.contains(current))) {
35695
+ previouslyFocused.focus({ preventScroll: true });
35696
+ }
35697
+ };
35698
+ }, [active, containerRef, isTopLayer]);
35699
+ }
35516
35700
  var BACKDROP_COLOR = "#09090933";
35517
35701
  var WEB_Z_INDEX = 500;
35518
35702
  var webBackdropDomStyle = {
@@ -35540,6 +35724,13 @@ var webRootDomStyle = {
35540
35724
  alignItems: "center",
35541
35725
  justifyContent: "center"
35542
35726
  };
35727
+ var webDialogDomStyle = {
35728
+ position: "relative",
35729
+ zIndex: 1,
35730
+ maxWidth: "100%",
35731
+ maxHeight: "100%",
35732
+ outline: "none"
35733
+ };
35543
35734
  var Modal = react.forwardRef(function Modal2({
35544
35735
  open,
35545
35736
  onClose,
@@ -35550,22 +35741,22 @@ var Modal = react.forwardRef(function Modal2({
35550
35741
  className
35551
35742
  }, forwardedRef) {
35552
35743
  const contentRef = react.useRef(null);
35744
+ const dialogRef = react.useRef(null);
35553
35745
  const setContentRef = react.useMemo(() => mergeRefs(contentRef, forwardedRef), [forwardedRef]);
35554
35746
  const resolvedClassName = className?.trim() || void 0;
35555
- useApplyWebClassName(contentRef, resolvedClassName, open && reactNative.Platform.OS === "web");
35747
+ const hydrated = useHydrated();
35748
+ const webOpen = open && hydrated && reactNative.Platform.OS === "web";
35749
+ useApplyWebClassName(contentRef, resolvedClassName, webOpen);
35556
35750
  react.useEffect(() => {
35557
- if (!open || reactNative.Platform.OS !== "web") return void 0;
35751
+ if (!webOpen) return void 0;
35558
35752
  const previousOverflow = document.body.style.overflow;
35559
35753
  document.body.style.overflow = "hidden";
35560
- const onKeyDown = (event) => {
35561
- if (event.key === "Escape") onClose();
35562
- };
35563
- document.addEventListener("keydown", onKeyDown);
35564
35754
  return () => {
35565
35755
  document.body.style.overflow = previousOverflow;
35566
- document.removeEventListener("keydown", onKeyDown);
35567
35756
  };
35568
- }, [open, onClose]);
35757
+ }, [webOpen]);
35758
+ const isTopLayer = useOverlayLayer("overlay", webOpen, onClose);
35759
+ useWebFocusTrap(dialogRef, webOpen, isTopLayer);
35569
35760
  const content = /* @__PURE__ */ jsxRuntime.jsx(
35570
35761
  reactNative.View,
35571
35762
  {
@@ -35576,7 +35767,7 @@ var Modal = react.forwardRef(function Modal2({
35576
35767
  }
35577
35768
  );
35578
35769
  if (reactNative.Platform.OS === "web") {
35579
- if (!open || typeof document === "undefined") return null;
35770
+ if (!webOpen) return null;
35580
35771
  return (0, import_react_dom.createPortal)(
35581
35772
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: webRootDomStyle, role: "presentation", children: [
35582
35773
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -35589,7 +35780,16 @@ var Modal = react.forwardRef(function Modal2({
35589
35780
  style: webBackdropDomStyle
35590
35781
  }
35591
35782
  ),
35592
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { position: "relative", zIndex: 1, maxWidth: "100%", maxHeight: "100%" }, children: content })
35783
+ /* @__PURE__ */ jsxRuntime.jsx(
35784
+ "div",
35785
+ {
35786
+ ref: dialogRef,
35787
+ role: "dialog",
35788
+ tabIndex: -1,
35789
+ style: webDialogDomStyle,
35790
+ children: content
35791
+ }
35792
+ )
35593
35793
  ] }),
35594
35794
  document.body
35595
35795
  );
@@ -35664,20 +35864,18 @@ var Drawer = react.forwardRef(function Drawer2({
35664
35864
  const [entered, setEntered] = react.useState(false);
35665
35865
  const animatedWidth = react.useRef(new reactNative.Animated.Value(open ? width : 0)).current;
35666
35866
  const animatedBackdrop = react.useRef(new reactNative.Animated.Value(open ? 1 : 0)).current;
35667
- useApplyWebClassName(panelRef, resolvedClassName, mounted && reactNative.Platform.OS === "web");
35867
+ const hydrated = useHydrated();
35868
+ const webMounted = mounted && hydrated && reactNative.Platform.OS === "web";
35869
+ useApplyWebClassName(panelRef, resolvedClassName, webMounted);
35668
35870
  react.useEffect(() => {
35669
- if (!mounted || reactNative.Platform.OS !== "web") return void 0;
35871
+ if (!webMounted) return void 0;
35670
35872
  const previousOverflow = document.body.style.overflow;
35671
35873
  document.body.style.overflow = "hidden";
35672
- const onKeyDown = (event) => {
35673
- if (event.key === "Escape") onClose();
35674
- };
35675
- document.addEventListener("keydown", onKeyDown);
35676
35874
  return () => {
35677
35875
  document.body.style.overflow = previousOverflow;
35678
- document.removeEventListener("keydown", onKeyDown);
35679
35876
  };
35680
- }, [mounted, onClose]);
35877
+ }, [webMounted]);
35878
+ useOverlayLayer("overlay", webMounted && open, onClose);
35681
35879
  const targetWidth = Math.min(width, typeof window !== "undefined" ? window.innerWidth : width);
35682
35880
  const playWidth = react.useCallback(
35683
35881
  (target) => {
@@ -35718,7 +35916,7 @@ var Drawer = react.forwardRef(function Drawer2({
35718
35916
  };
35719
35917
  }, [open, animationDuration, playWidth]);
35720
35918
  react.useEffect(() => {
35721
- if (reactNative.Platform.OS !== "web" || !mounted || !open) return void 0;
35919
+ if (!webMounted || !open) return void 0;
35722
35920
  const shell = shellRef.current;
35723
35921
  if (shell) {
35724
35922
  shell.style.transition = "none";
@@ -35731,7 +35929,7 @@ var Drawer = react.forwardRef(function Drawer2({
35731
35929
  });
35732
35930
  });
35733
35931
  return () => cancelAnimationFrame(frame);
35734
- }, [mounted, open, targetWidth, playWidth]);
35932
+ }, [webMounted, open, targetWidth, playWidth]);
35735
35933
  react.useEffect(() => {
35736
35934
  if (reactNative.Platform.OS === "web") return void 0;
35737
35935
  if (open) {
@@ -35812,7 +36010,7 @@ var Drawer = react.forwardRef(function Drawer2({
35812
36010
  }
35813
36011
  );
35814
36012
  if (reactNative.Platform.OS === "web") {
35815
- if (!mounted || typeof document === "undefined") return null;
36013
+ if (!webMounted) return null;
35816
36014
  return (0, import_react_dom2.createPortal)(
35817
36015
  /* @__PURE__ */ jsxRuntime.jsxs(
35818
36016
  "div",
@@ -36512,21 +36710,42 @@ var styles32 = reactNative.StyleSheet.create({
36512
36710
  function normalizeVerificationCode(value, length) {
36513
36711
  return value.replace(/\D/g, "").slice(0, Math.max(1, length));
36514
36712
  }
36515
- function updateVerificationCode(currentCode, index, input, length) {
36713
+ function toVerificationCells(code, length) {
36714
+ const safeLength = Math.max(1, length);
36715
+ const digits = normalizeVerificationCode(code, safeLength);
36716
+ return Array.from({ length: safeLength }, (_, index) => digits[index] ?? "");
36717
+ }
36718
+ function verificationCellsToCode(cells) {
36719
+ return cells.join("");
36720
+ }
36721
+ function isVerificationCodeComplete(cells) {
36722
+ return cells.length > 0 && cells.every((cell) => cell !== "");
36723
+ }
36724
+ function reconcileVerificationCells(cells, code, length) {
36725
+ const safeLength = Math.max(1, length);
36726
+ const normalized = normalizeVerificationCode(code, safeLength);
36727
+ if (cells.length === safeLength && verificationCellsToCode(cells) === normalized) {
36728
+ return [...cells];
36729
+ }
36730
+ return toVerificationCells(normalized, safeLength);
36731
+ }
36732
+ function updateVerificationCells(currentCells, index, input, length) {
36516
36733
  const safeLength = Math.max(1, length);
36517
36734
  const safeIndex = Math.min(Math.max(0, index), safeLength - 1);
36518
- const current = normalizeVerificationCode(currentCode, safeLength);
36735
+ const cells = Array.from({ length: safeLength }, (_, cellIndex) => {
36736
+ const cell = currentCells[cellIndex] ?? "";
36737
+ return /^\d$/.test(cell) ? cell : "";
36738
+ });
36519
36739
  const insertedDigits = normalizeVerificationCode(input, safeLength - safeIndex);
36520
36740
  if (!insertedDigits) {
36521
- return {
36522
- code: `${current.slice(0, safeIndex)}${current.slice(safeIndex + 1)}`,
36523
- nextFocus: safeIndex
36524
- };
36741
+ cells[safeIndex] = "";
36742
+ return { cells, nextFocus: safeIndex };
36525
36743
  }
36744
+ Array.from(insertedDigits).forEach((digit, offset) => {
36745
+ cells[safeIndex + offset] = digit;
36746
+ });
36526
36747
  return {
36527
- code: `${current.slice(0, safeIndex)}${insertedDigits}${current.slice(
36528
- safeIndex + insertedDigits.length
36529
- )}`.slice(0, safeLength),
36748
+ cells,
36530
36749
  nextFocus: Math.min(safeIndex + insertedDigits.length, safeLength - 1)
36531
36750
  };
36532
36751
  }
@@ -36557,17 +36776,17 @@ var VerificationCodeInput = react.forwardRef(function VerificationCodeInput2({
36557
36776
  }, forwardedRef) {
36558
36777
  const safeLength = Math.max(1, Math.floor(length));
36559
36778
  const isControlled = typeof value === "string";
36560
- const [uncontrolledValue, setUncontrolledValue] = react.useState(
36561
- () => normalizeVerificationCode(defaultValue, safeLength)
36562
- );
36779
+ const [cellsState, setCellsState] = react.useState(() => toVerificationCells(defaultValue, safeLength));
36563
36780
  const [focusedIndex, setFocusedIndex] = react.useState(null);
36564
36781
  const { width: viewportWidth } = reactNative.useWindowDimensions();
36565
36782
  const rootRef = react.useRef(null);
36566
36783
  const inputRefs = react.useRef([]);
36567
- const currentCode = normalizeVerificationCode(
36568
- isControlled ? value : uncontrolledValue,
36784
+ const cells = reconcileVerificationCells(
36785
+ cellsState,
36786
+ isControlled ? value : verificationCellsToCode(cellsState),
36569
36787
  safeLength
36570
36788
  );
36789
+ const currentCode = verificationCellsToCode(cells);
36571
36790
  useApplyWebClassName(rootRef, className);
36572
36791
  const focus = react.useCallback(
36573
36792
  (index = 0) => {
@@ -36577,39 +36796,37 @@ var VerificationCodeInput = react.forwardRef(function VerificationCodeInput2({
36577
36796
  [safeLength]
36578
36797
  );
36579
36798
  const commit = react.useCallback(
36580
- (nextValue) => {
36581
- const normalized = normalizeVerificationCode(nextValue, safeLength);
36582
- if (!isControlled) {
36583
- setUncontrolledValue(normalized);
36584
- }
36585
- onValueChange?.(normalized);
36586
- if (normalized.length === safeLength) {
36587
- onComplete?.(normalized);
36799
+ (nextCells) => {
36800
+ setCellsState(nextCells);
36801
+ const code = verificationCellsToCode(nextCells);
36802
+ onValueChange?.(code);
36803
+ if (isVerificationCodeComplete(nextCells)) {
36804
+ onComplete?.(code);
36588
36805
  }
36589
36806
  },
36590
- [isControlled, onComplete, onValueChange, safeLength]
36807
+ [onComplete, onValueChange]
36591
36808
  );
36592
36809
  react.useImperativeHandle(
36593
36810
  forwardedRef,
36594
36811
  () => ({
36595
36812
  clear: () => {
36596
- commit("");
36813
+ commit(toVerificationCells("", safeLength));
36597
36814
  focus(0);
36598
36815
  },
36599
36816
  focus
36600
36817
  }),
36601
- [commit, focus]
36818
+ [commit, focus, safeLength]
36602
36819
  );
36603
36820
  const handleChange = (index, input) => {
36604
- const update = updateVerificationCode(currentCode, index, input, safeLength);
36605
- commit(update.code);
36821
+ const update = updateVerificationCells(cells, index, input, safeLength);
36822
+ commit(update.cells);
36606
36823
  focus(update.nextFocus);
36607
36824
  };
36608
36825
  const handleKeyPress = (index, event) => {
36609
36826
  const key = event.nativeEvent.key;
36610
- if (key === "Backspace" && !currentCode[index] && index > 0) {
36611
- const update = updateVerificationCode(currentCode, index - 1, "", safeLength);
36612
- commit(update.code);
36827
+ if (key === "Backspace" && !cells[index] && index > 0) {
36828
+ const update = updateVerificationCells(cells, index - 1, "", safeLength);
36829
+ commit(update.cells);
36613
36830
  focus(index - 1);
36614
36831
  return;
36615
36832
  }
@@ -36677,7 +36894,7 @@ var VerificationCodeInput = react.forwardRef(function VerificationCodeInput2({
36677
36894
  reactNative.Platform.OS === "android" ? styles33.cellAndroid : null,
36678
36895
  inputStyle
36679
36896
  ],
36680
- value: currentCode[index] ?? ""
36897
+ value: cells[index] ?? ""
36681
36898
  },
36682
36899
  index
36683
36900
  );
@@ -36763,6 +36980,9 @@ var FALLBACK_ELLIPSIS_WIDTH = 20;
36763
36980
  var WEB_MENU_Z_INDEX = 600;
36764
36981
  var WEB_VIEWPORT_PADDING = 8;
36765
36982
  var WEB_MENU_GAP = 8;
36983
+ function webListboxProps(multiple) {
36984
+ return { role: "listbox", "aria-multiselectable": multiple };
36985
+ }
36766
36986
  function itemBackground(state) {
36767
36987
  switch (state) {
36768
36988
  case "hover":
@@ -37076,6 +37296,7 @@ var Select = react.forwardRef(
37076
37296
  setOpen(false);
37077
37297
  focusTrigger();
37078
37298
  }, [focusTrigger, setOpen]);
37299
+ useOverlayLayer("popover", isOpen, closeAndFocusTrigger);
37079
37300
  react.useEffect(() => {
37080
37301
  if (reactNative.Platform.OS !== "web") return;
37081
37302
  const isTriggerFocused = () => document.activeElement === triggerRef.current;
@@ -37089,11 +37310,6 @@ var Select = react.forwardRef(
37089
37310
  }
37090
37311
  return;
37091
37312
  }
37092
- if (event.key === "Escape") {
37093
- event.preventDefault();
37094
- closeAndFocusTrigger();
37095
- return;
37096
- }
37097
37313
  if (event.key === "ArrowDown" || event.key === "ArrowUp") {
37098
37314
  event.preventDefault();
37099
37315
  setHoveredValue((current) => {
@@ -37131,7 +37347,6 @@ var Select = react.forwardRef(
37131
37347
  filteredOptions,
37132
37348
  hoveredValue,
37133
37349
  multiple,
37134
- closeAndFocusTrigger,
37135
37350
  focusTrigger,
37136
37351
  handleSelect,
37137
37352
  setOpen
@@ -37198,6 +37413,7 @@ var Select = react.forwardRef(
37198
37413
  contentContainerStyle: styles34.optionListContent,
37199
37414
  keyboardShouldPersistTaps: "handled",
37200
37415
  showsVerticalScrollIndicator: false,
37416
+ ...reactNative.Platform.OS === "web" ? webListboxProps(multiple) : null,
37201
37417
  children: [
37202
37418
  loading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles34.statusRow, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles34.statusText, children: "Loading..." }) }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles34.statusRow, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles34.statusText, children: emptyText }) }) : null,
37203
37419
  !loading && filteredOptions.map((option) => {
@@ -37215,6 +37431,8 @@ var Select = react.forwardRef(
37215
37431
  onPressOut: () => setHoveredValue((current) => current === option.value ? null : current),
37216
37432
  accessibilityRole: multiple ? "checkbox" : "button",
37217
37433
  accessibilityState: { selected: isSelected, checked: isSelected, disabled },
37434
+ role: reactNative.Platform.OS === "web" ? "option" : void 0,
37435
+ "aria-selected": isSelected,
37218
37436
  style: [
37219
37437
  styles34.item,
37220
37438
  {
@@ -37255,6 +37473,7 @@ var Select = react.forwardRef(
37255
37473
  accessibilityRole: "combobox",
37256
37474
  accessibilityLabel: resolvedAccessibilityLabel,
37257
37475
  accessibilityState: { disabled, expanded: isOpen },
37476
+ "aria-expanded": isOpen,
37258
37477
  style: [
37259
37478
  styles34.trigger,
37260
37479
  {
@@ -37738,6 +37957,8 @@ var Toggle = react.forwardRef(function Toggle2({
37738
37957
  accessibilityRole: "switch",
37739
37958
  accessibilityLabel: resolvedAccessibilityLabel,
37740
37959
  accessibilityState: { checked: isActive, disabled },
37960
+ "aria-checked": isActive,
37961
+ ...reactNative.Platform.OS === "web" && !disabled ? { onKeyDown: (event) => handleWebToggleKeyDown(event, handlePress) } : null,
37741
37962
  style: [styles36.pressable, disabled && styles36.disabled, style],
37742
37963
  children: [
37743
37964
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -37889,7 +38110,7 @@ var BASE_ITEM_SIZE = 16;
37889
38110
  var ICON_WIDTH_RATIO = 12.57 / BASE_ITEM_SIZE;
37890
38111
  var ICON_HEIGHT_RATIO = 11.98 / BASE_ITEM_SIZE;
37891
38112
  var STAR_GAP_RATIO = 2 / BASE_ITEM_SIZE;
37892
- function clamp2(value) {
38113
+ function clamp(value) {
37893
38114
  return Math.max(0, Math.min(value, STAR_COUNT));
37894
38115
  }
37895
38116
  var RatingInput = react.forwardRef(
@@ -37913,8 +38134,8 @@ var RatingInput = react.forwardRef(
37913
38134
  const containerRef = react.useRef(null);
37914
38135
  const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
37915
38136
  const isControlled = value !== void 0;
37916
- const [uncontrolledValue, setUncontrolledValue] = react.useState(() => clamp2(defaultValue));
37917
- const selectedValue = clamp2(isControlled ? value : uncontrolledValue);
38137
+ const [uncontrolledValue, setUncontrolledValue] = react.useState(() => clamp(defaultValue));
38138
+ const selectedValue = clamp(isControlled ? value : uncontrolledValue);
37918
38139
  const selectedStarCount = Math.round(selectedValue);
37919
38140
  const iconWidth = size * ICON_WIDTH_RATIO;
37920
38141
  const iconHeight = size * ICON_HEIGHT_RATIO;
@@ -39077,6 +39298,12 @@ var RadioButton = react.forwardRef(
39077
39298
  accessibilityRole: "radio",
39078
39299
  accessibilityLabel: resolvedAccessibilityLabel,
39079
39300
  accessibilityState: { selected: isActive, disabled },
39301
+ ...reactNative.Platform.OS === "web" ? {
39302
+ "aria-checked": isActive,
39303
+ ...disabled ? null : {
39304
+ onKeyDown: (event) => handleWebToggleKeyDown(event, handlePress)
39305
+ }
39306
+ } : null,
39080
39307
  style: [styles42.root, disabled && styles42.disabled, style],
39081
39308
  children: [
39082
39309
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles42.control, children: isActive ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles42.dot }) : null }),
@@ -39350,6 +39577,7 @@ exports.NotificationSuccessIcon = NotificationSuccessIcon;
39350
39577
  exports.NotificationWarningIcon = NotificationWarningIcon;
39351
39578
  exports.PaginationDots = PaginationDots;
39352
39579
  exports.PawIcon = PawIcon;
39580
+ exports.PaymentCardIcon = PaymentCardIcon;
39353
39581
  exports.PhoneIcon = PhoneIcon;
39354
39582
  exports.PlusIcon = PlusIcon;
39355
39583
  exports.QrCodeIcon = QrCodeIcon;
@@ -39360,6 +39588,7 @@ exports.RadioButton = RadioButton;
39360
39588
  exports.Range = Range;
39361
39589
  exports.RatingInput = RatingInput;
39362
39590
  exports.RatingStarIcon = RatingStarIcon;
39591
+ exports.ReceiptIcon = ReceiptIcon;
39363
39592
  exports.RefreshIcon = RefreshIcon;
39364
39593
  exports.RefundStatusIcon = RefundStatusIcon;
39365
39594
  exports.SaveHeartIcon = SaveHeartIcon;
@@ -39400,6 +39629,7 @@ exports.WasherIcon = WasherIcon;
39400
39629
  exports.WhatsAppIcon = WhatsAppIcon;
39401
39630
  exports.ZoomOutIcon = ZoomOutIcon;
39402
39631
  exports.abbreviateMonthName = abbreviateMonthName;
39632
+ exports.abbreviateMonthNames = abbreviateMonthNames;
39403
39633
  exports.avatarTypography = avatarTypography;
39404
39634
  exports.badgeTypography = badgeTypography;
39405
39635
  exports.buttonTypography = buttonTypography;