@ecohouse/ui 0.1.61 → 0.1.63
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 +331 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +332 -117
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Checkbox/Checkbox.tsx +6 -0
- package/src/components/Counter/Counter.test.ts +38 -0
- package/src/components/Counter/Counter.tsx +7 -10
- package/src/components/Counter/Counter.utils.ts +28 -0
- package/src/components/DatePicker/DatePicker.tsx +5 -14
- package/src/components/Drawer/Drawer.tsx +15 -12
- package/src/components/Modal/Modal.tsx +31 -11
- package/src/components/RadioButton/RadioButton.tsx +14 -0
- package/src/components/Select/Select.tsx +16 -8
- package/src/components/Toggle/Toggle.tsx +6 -0
- package/src/components/VerificationCodeInput/VerificationCodeInput.test.ts +74 -12
- package/src/components/VerificationCodeInput/VerificationCodeInput.tsx +29 -24
- package/src/components/VerificationCodeInput/VerificationCodeInput.utils.ts +59 -14
- package/src/index.ts +6 -1
- package/src/utils/dateUtils.test.ts +72 -0
- package/src/utils/dateUtils.ts +30 -2
- package/src/utils/focusTrap.test.ts +26 -0
- package/src/utils/focusTrap.ts +39 -0
- package/src/utils/overlayStack.test.ts +175 -0
- package/src/utils/overlayStack.ts +105 -0
- package/src/utils/useHydrated.test.ts +14 -0
- package/src/utils/useHydrated.ts +14 -0
- package/src/utils/useOverlayLayer.ts +41 -0
- package/src/utils/useWebFocusTrap.ts +68 -0
- package/src/utils/webToggleKey.test.ts +49 -0
- 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,
|
|
18774
|
+
function mountMutableSource(source, getSnapshot, subscribe2) {
|
|
18775
18775
|
{
|
|
18776
18776
|
return void 0;
|
|
18777
18777
|
}
|
|
18778
18778
|
}
|
|
18779
|
-
function updateMutableSource(source, getSnapshot,
|
|
18779
|
+
function updateMutableSource(source, getSnapshot, subscribe2) {
|
|
18780
18780
|
{
|
|
18781
18781
|
return void 0;
|
|
18782
18782
|
}
|
|
18783
18783
|
}
|
|
18784
|
-
function mountSyncExternalStore(
|
|
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 (
|
|
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 =
|
|
18793
|
+
nextSnapshot = getServerSnapshot2();
|
|
18794
18794
|
{
|
|
18795
18795
|
if (!didWarnUncachedGetSnapshot) {
|
|
18796
|
-
if (nextSnapshot !==
|
|
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,
|
|
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(
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
19482
|
+
useMutableSource: function(source, getSnapshot, subscribe2) {
|
|
19483
19483
|
currentHookNameInDev = "useMutableSource";
|
|
19484
19484
|
mountHookTypesDev();
|
|
19485
19485
|
return mountMutableSource();
|
|
19486
19486
|
},
|
|
19487
|
-
useSyncExternalStore: function(
|
|
19487
|
+
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
|
|
19488
19488
|
currentHookNameInDev = "useSyncExternalStore";
|
|
19489
19489
|
mountHookTypesDev();
|
|
19490
|
-
return mountSyncExternalStore(
|
|
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,
|
|
19586
|
+
useMutableSource: function(source, getSnapshot, subscribe2) {
|
|
19587
19587
|
currentHookNameInDev = "useMutableSource";
|
|
19588
19588
|
updateHookTypesDev();
|
|
19589
19589
|
return mountMutableSource();
|
|
19590
19590
|
},
|
|
19591
|
-
useSyncExternalStore: function(
|
|
19591
|
+
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
|
|
19592
19592
|
currentHookNameInDev = "useSyncExternalStore";
|
|
19593
19593
|
updateHookTypesDev();
|
|
19594
|
-
return mountSyncExternalStore(
|
|
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,
|
|
19690
|
+
useMutableSource: function(source, getSnapshot, subscribe2) {
|
|
19691
19691
|
currentHookNameInDev = "useMutableSource";
|
|
19692
19692
|
updateHookTypesDev();
|
|
19693
19693
|
return updateMutableSource();
|
|
19694
19694
|
},
|
|
19695
|
-
useSyncExternalStore: function(
|
|
19695
|
+
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
|
|
19696
19696
|
currentHookNameInDev = "useSyncExternalStore";
|
|
19697
19697
|
updateHookTypesDev();
|
|
19698
|
-
return updateSyncExternalStore(
|
|
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,
|
|
19794
|
+
useMutableSource: function(source, getSnapshot, subscribe2) {
|
|
19795
19795
|
currentHookNameInDev = "useMutableSource";
|
|
19796
19796
|
updateHookTypesDev();
|
|
19797
19797
|
return updateMutableSource();
|
|
19798
19798
|
},
|
|
19799
|
-
useSyncExternalStore: function(
|
|
19799
|
+
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
|
|
19800
19800
|
currentHookNameInDev = "useSyncExternalStore";
|
|
19801
19801
|
updateHookTypesDev();
|
|
19802
|
-
return updateSyncExternalStore(
|
|
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,
|
|
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(
|
|
19918
|
+
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
|
|
19919
19919
|
currentHookNameInDev = "useSyncExternalStore";
|
|
19920
19920
|
warnInvalidHookAccess();
|
|
19921
19921
|
mountHookTypesDev();
|
|
19922
|
-
return mountSyncExternalStore(
|
|
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,
|
|
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(
|
|
20039
|
+
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
|
|
20040
20040
|
currentHookNameInDev = "useSyncExternalStore";
|
|
20041
20041
|
warnInvalidHookAccess();
|
|
20042
20042
|
updateHookTypesDev();
|
|
20043
|
-
return updateSyncExternalStore(
|
|
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,
|
|
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(
|
|
20160
|
+
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot2) {
|
|
20161
20161
|
currentHookNameInDev = "useSyncExternalStore";
|
|
20162
20162
|
warnInvalidHookAccess();
|
|
20163
20163
|
updateHookTypesDev();
|
|
20164
|
-
return updateSyncExternalStore(
|
|
20164
|
+
return updateSyncExternalStore(subscribe2, getSnapshot);
|
|
20165
20165
|
},
|
|
20166
20166
|
useId: function() {
|
|
20167
20167
|
currentHookNameInDev = "useId";
|
|
@@ -33162,14 +33162,23 @@ var styles18 = reactNative.StyleSheet.create({
|
|
|
33162
33162
|
includeFontPadding: false
|
|
33163
33163
|
}
|
|
33164
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
|
+
}
|
|
33165
33177
|
var BUTTON_SIZE = 32;
|
|
33166
33178
|
var webBlurStyle7 = reactNative.Platform.OS === "web" ? {
|
|
33167
33179
|
backdropFilter: "blur(20px)",
|
|
33168
33180
|
WebkitBackdropFilter: "blur(20px)"
|
|
33169
33181
|
} : {};
|
|
33170
|
-
function clamp(value, min, max) {
|
|
33171
|
-
return Math.max(min, max === void 0 ? value : Math.min(value, max));
|
|
33172
|
-
}
|
|
33173
33182
|
var Counter = react.forwardRef(function Counter2({
|
|
33174
33183
|
value,
|
|
33175
33184
|
defaultValue,
|
|
@@ -33187,16 +33196,16 @@ var Counter = react.forwardRef(function Counter2({
|
|
|
33187
33196
|
const containerRef = react.useRef(null);
|
|
33188
33197
|
const isControlled = value !== void 0;
|
|
33189
33198
|
const [uncontrolledValue, setUncontrolledValue] = react.useState(
|
|
33190
|
-
() =>
|
|
33199
|
+
() => clampCounterValue(defaultValue ?? min, min, max)
|
|
33191
33200
|
);
|
|
33192
|
-
const resolvedValue =
|
|
33201
|
+
const resolvedValue = resolveCounterValue(value, uncontrolledValue, min, max);
|
|
33193
33202
|
const resolvedClassName = className?.trim() || void 0;
|
|
33194
33203
|
const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
33195
33204
|
const decrementDisabled = disabled || resolvedValue <= min;
|
|
33196
33205
|
const incrementDisabled = disabled || max !== void 0 && resolvedValue >= max;
|
|
33197
33206
|
useApplyWebClassName(containerRef, resolvedClassName);
|
|
33198
|
-
const updateValue = (
|
|
33199
|
-
const next =
|
|
33207
|
+
const updateValue = (delta) => {
|
|
33208
|
+
const next = stepCounterValue(resolvedValue, delta, min, max);
|
|
33200
33209
|
if (next === resolvedValue) return;
|
|
33201
33210
|
if (!isControlled) setUncontrolledValue(next);
|
|
33202
33211
|
onValueChange?.(next);
|
|
@@ -33206,7 +33215,7 @@ var Counter = react.forwardRef(function Counter2({
|
|
|
33206
33215
|
{
|
|
33207
33216
|
disabled: decrementDisabled,
|
|
33208
33217
|
hitSlop,
|
|
33209
|
-
onPress: () => updateValue(
|
|
33218
|
+
onPress: () => updateValue(-step),
|
|
33210
33219
|
accessibilityRole: "button",
|
|
33211
33220
|
accessibilityLabel: "Decrease value",
|
|
33212
33221
|
accessibilityState: { disabled: decrementDisabled },
|
|
@@ -33219,7 +33228,7 @@ var Counter = react.forwardRef(function Counter2({
|
|
|
33219
33228
|
{
|
|
33220
33229
|
disabled: incrementDisabled,
|
|
33221
33230
|
hitSlop,
|
|
33222
|
-
onPress: () => updateValue(
|
|
33231
|
+
onPress: () => updateValue(step),
|
|
33223
33232
|
accessibilityRole: "button",
|
|
33224
33233
|
accessibilityLabel: "Increase value",
|
|
33225
33234
|
accessibilityState: { disabled: incrementDisabled },
|
|
@@ -34502,6 +34511,15 @@ var styles25 = reactNative.StyleSheet.create({
|
|
|
34502
34511
|
top: 0
|
|
34503
34512
|
}
|
|
34504
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
|
+
}
|
|
34505
34523
|
var BOX_SIZE = 20;
|
|
34506
34524
|
var BOX_RADIUS = 6;
|
|
34507
34525
|
var CHECK_SIZE = 12;
|
|
@@ -34557,6 +34575,8 @@ var Checkbox = react.forwardRef(function Checkbox2({
|
|
|
34557
34575
|
accessibilityRole: "checkbox",
|
|
34558
34576
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
34559
34577
|
accessibilityState: { checked: isActive, disabled },
|
|
34578
|
+
"aria-checked": isActive,
|
|
34579
|
+
...reactNative.Platform.OS === "web" && !disabled ? { onKeyDown: (event) => handleWebToggleKeyDown(event, handlePress) } : null,
|
|
34560
34580
|
style: [styles26.root, disabled && styles26.disabled, style],
|
|
34561
34581
|
children: [
|
|
34562
34582
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -34650,8 +34670,23 @@ function abbreviateMonthName(monthName, letterCount = 3) {
|
|
|
34650
34670
|
}
|
|
34651
34671
|
return chars.slice(0, end).join("");
|
|
34652
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
|
+
}
|
|
34653
34688
|
function formatDateDayShortMonth(date, monthNames, letterCount = 3) {
|
|
34654
|
-
const month =
|
|
34689
|
+
const month = abbreviateMonthNames(monthNames, letterCount)[date.getMonth()] ?? "";
|
|
34655
34690
|
return `${date.getDate()} ${month} ${date.getFullYear()}`;
|
|
34656
34691
|
}
|
|
34657
34692
|
function getMonthMatrix(monthDate, weekStartsOn = 1) {
|
|
@@ -34675,6 +34710,78 @@ function getMonthMatrix(monthDate, weekStartsOn = 1) {
|
|
|
34675
34710
|
}
|
|
34676
34711
|
return weeks;
|
|
34677
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
|
+
}
|
|
34678
34785
|
var DEFAULT_MONTH_NAMES = [
|
|
34679
34786
|
"\u0540\u0578\u0582\u0576\u057E\u0561\u0580",
|
|
34680
34787
|
"\u0553\u0565\u057F\u0580\u057E\u0561\u0580",
|
|
@@ -34869,17 +34976,7 @@ var DatePicker = react.forwardRef(
|
|
|
34869
34976
|
setOpen(false);
|
|
34870
34977
|
focusTrigger();
|
|
34871
34978
|
}, [focusTrigger, setOpen]);
|
|
34872
|
-
|
|
34873
|
-
if (reactNative.Platform.OS !== "web" || !isOpen) return;
|
|
34874
|
-
const handleKeyDown = (event) => {
|
|
34875
|
-
if (event.key === "Escape") {
|
|
34876
|
-
event.preventDefault();
|
|
34877
|
-
closeAndFocusTrigger();
|
|
34878
|
-
}
|
|
34879
|
-
};
|
|
34880
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
34881
|
-
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
34882
|
-
}, [isOpen, closeAndFocusTrigger]);
|
|
34979
|
+
useOverlayLayer("popover", isOpen, closeAndFocusTrigger);
|
|
34883
34980
|
const handleTriggerPress = () => {
|
|
34884
34981
|
if (disabled) return;
|
|
34885
34982
|
setOpen(!isOpen);
|
|
@@ -34969,6 +35066,7 @@ var DatePicker = react.forwardRef(
|
|
|
34969
35066
|
accessibilityRole: "button",
|
|
34970
35067
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
34971
35068
|
accessibilityState: { disabled, expanded: isOpen },
|
|
35069
|
+
"aria-expanded": isOpen,
|
|
34972
35070
|
style: [
|
|
34973
35071
|
styles27.trigger,
|
|
34974
35072
|
usesRangeTrigger && styles27.rangeTrigger,
|
|
@@ -35527,6 +35625,78 @@ var styles28 = reactNative.StyleSheet.create({
|
|
|
35527
35625
|
|
|
35528
35626
|
// src/components/Modal/Modal.tsx
|
|
35529
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
|
+
}
|
|
35530
35700
|
var BACKDROP_COLOR = "#09090933";
|
|
35531
35701
|
var WEB_Z_INDEX = 500;
|
|
35532
35702
|
var webBackdropDomStyle = {
|
|
@@ -35554,6 +35724,13 @@ var webRootDomStyle = {
|
|
|
35554
35724
|
alignItems: "center",
|
|
35555
35725
|
justifyContent: "center"
|
|
35556
35726
|
};
|
|
35727
|
+
var webDialogDomStyle = {
|
|
35728
|
+
position: "relative",
|
|
35729
|
+
zIndex: 1,
|
|
35730
|
+
maxWidth: "100%",
|
|
35731
|
+
maxHeight: "100%",
|
|
35732
|
+
outline: "none"
|
|
35733
|
+
};
|
|
35557
35734
|
var Modal = react.forwardRef(function Modal2({
|
|
35558
35735
|
open,
|
|
35559
35736
|
onClose,
|
|
@@ -35564,22 +35741,22 @@ var Modal = react.forwardRef(function Modal2({
|
|
|
35564
35741
|
className
|
|
35565
35742
|
}, forwardedRef) {
|
|
35566
35743
|
const contentRef = react.useRef(null);
|
|
35744
|
+
const dialogRef = react.useRef(null);
|
|
35567
35745
|
const setContentRef = react.useMemo(() => mergeRefs(contentRef, forwardedRef), [forwardedRef]);
|
|
35568
35746
|
const resolvedClassName = className?.trim() || void 0;
|
|
35569
|
-
|
|
35747
|
+
const hydrated = useHydrated();
|
|
35748
|
+
const webOpen = open && hydrated && reactNative.Platform.OS === "web";
|
|
35749
|
+
useApplyWebClassName(contentRef, resolvedClassName, webOpen);
|
|
35570
35750
|
react.useEffect(() => {
|
|
35571
|
-
if (!
|
|
35751
|
+
if (!webOpen) return void 0;
|
|
35572
35752
|
const previousOverflow = document.body.style.overflow;
|
|
35573
35753
|
document.body.style.overflow = "hidden";
|
|
35574
|
-
const onKeyDown = (event) => {
|
|
35575
|
-
if (event.key === "Escape") onClose();
|
|
35576
|
-
};
|
|
35577
|
-
document.addEventListener("keydown", onKeyDown);
|
|
35578
35754
|
return () => {
|
|
35579
35755
|
document.body.style.overflow = previousOverflow;
|
|
35580
|
-
document.removeEventListener("keydown", onKeyDown);
|
|
35581
35756
|
};
|
|
35582
|
-
}, [
|
|
35757
|
+
}, [webOpen]);
|
|
35758
|
+
const isTopLayer = useOverlayLayer("overlay", webOpen, onClose);
|
|
35759
|
+
useWebFocusTrap(dialogRef, webOpen, isTopLayer);
|
|
35583
35760
|
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
35584
35761
|
reactNative.View,
|
|
35585
35762
|
{
|
|
@@ -35590,7 +35767,7 @@ var Modal = react.forwardRef(function Modal2({
|
|
|
35590
35767
|
}
|
|
35591
35768
|
);
|
|
35592
35769
|
if (reactNative.Platform.OS === "web") {
|
|
35593
|
-
if (!
|
|
35770
|
+
if (!webOpen) return null;
|
|
35594
35771
|
return (0, import_react_dom.createPortal)(
|
|
35595
35772
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: webRootDomStyle, role: "presentation", children: [
|
|
35596
35773
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -35603,7 +35780,16 @@ var Modal = react.forwardRef(function Modal2({
|
|
|
35603
35780
|
style: webBackdropDomStyle
|
|
35604
35781
|
}
|
|
35605
35782
|
),
|
|
35606
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
35783
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
35784
|
+
"div",
|
|
35785
|
+
{
|
|
35786
|
+
ref: dialogRef,
|
|
35787
|
+
role: "dialog",
|
|
35788
|
+
tabIndex: -1,
|
|
35789
|
+
style: webDialogDomStyle,
|
|
35790
|
+
children: content
|
|
35791
|
+
}
|
|
35792
|
+
)
|
|
35607
35793
|
] }),
|
|
35608
35794
|
document.body
|
|
35609
35795
|
);
|
|
@@ -35678,20 +35864,18 @@ var Drawer = react.forwardRef(function Drawer2({
|
|
|
35678
35864
|
const [entered, setEntered] = react.useState(false);
|
|
35679
35865
|
const animatedWidth = react.useRef(new reactNative.Animated.Value(open ? width : 0)).current;
|
|
35680
35866
|
const animatedBackdrop = react.useRef(new reactNative.Animated.Value(open ? 1 : 0)).current;
|
|
35681
|
-
|
|
35867
|
+
const hydrated = useHydrated();
|
|
35868
|
+
const webMounted = mounted && hydrated && reactNative.Platform.OS === "web";
|
|
35869
|
+
useApplyWebClassName(panelRef, resolvedClassName, webMounted);
|
|
35682
35870
|
react.useEffect(() => {
|
|
35683
|
-
if (!
|
|
35871
|
+
if (!webMounted) return void 0;
|
|
35684
35872
|
const previousOverflow = document.body.style.overflow;
|
|
35685
35873
|
document.body.style.overflow = "hidden";
|
|
35686
|
-
const onKeyDown = (event) => {
|
|
35687
|
-
if (event.key === "Escape") onClose();
|
|
35688
|
-
};
|
|
35689
|
-
document.addEventListener("keydown", onKeyDown);
|
|
35690
35874
|
return () => {
|
|
35691
35875
|
document.body.style.overflow = previousOverflow;
|
|
35692
|
-
document.removeEventListener("keydown", onKeyDown);
|
|
35693
35876
|
};
|
|
35694
|
-
}, [
|
|
35877
|
+
}, [webMounted]);
|
|
35878
|
+
useOverlayLayer("overlay", webMounted && open, onClose);
|
|
35695
35879
|
const targetWidth = Math.min(width, typeof window !== "undefined" ? window.innerWidth : width);
|
|
35696
35880
|
const playWidth = react.useCallback(
|
|
35697
35881
|
(target) => {
|
|
@@ -35732,7 +35916,7 @@ var Drawer = react.forwardRef(function Drawer2({
|
|
|
35732
35916
|
};
|
|
35733
35917
|
}, [open, animationDuration, playWidth]);
|
|
35734
35918
|
react.useEffect(() => {
|
|
35735
|
-
if (
|
|
35919
|
+
if (!webMounted || !open) return void 0;
|
|
35736
35920
|
const shell = shellRef.current;
|
|
35737
35921
|
if (shell) {
|
|
35738
35922
|
shell.style.transition = "none";
|
|
@@ -35745,7 +35929,7 @@ var Drawer = react.forwardRef(function Drawer2({
|
|
|
35745
35929
|
});
|
|
35746
35930
|
});
|
|
35747
35931
|
return () => cancelAnimationFrame(frame);
|
|
35748
|
-
}, [
|
|
35932
|
+
}, [webMounted, open, targetWidth, playWidth]);
|
|
35749
35933
|
react.useEffect(() => {
|
|
35750
35934
|
if (reactNative.Platform.OS === "web") return void 0;
|
|
35751
35935
|
if (open) {
|
|
@@ -35826,7 +36010,7 @@ var Drawer = react.forwardRef(function Drawer2({
|
|
|
35826
36010
|
}
|
|
35827
36011
|
);
|
|
35828
36012
|
if (reactNative.Platform.OS === "web") {
|
|
35829
|
-
if (!
|
|
36013
|
+
if (!webMounted) return null;
|
|
35830
36014
|
return (0, import_react_dom2.createPortal)(
|
|
35831
36015
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
35832
36016
|
"div",
|
|
@@ -36526,21 +36710,44 @@ var styles32 = reactNative.StyleSheet.create({
|
|
|
36526
36710
|
function normalizeVerificationCode(value, length) {
|
|
36527
36711
|
return value.replace(/\D/g, "").slice(0, Math.max(1, length));
|
|
36528
36712
|
}
|
|
36529
|
-
function
|
|
36713
|
+
function toVerificationCells(code, length) {
|
|
36530
36714
|
const safeLength = Math.max(1, length);
|
|
36531
|
-
const
|
|
36532
|
-
|
|
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) {
|
|
36733
|
+
const safeLength = Math.max(1, length);
|
|
36734
|
+
const focusedIndex = Math.min(Math.max(0, index), safeLength - 1);
|
|
36735
|
+
const cells = Array.from({ length: safeLength }, (_, cellIndex) => {
|
|
36736
|
+
const cell = currentCells[cellIndex] ?? "";
|
|
36737
|
+
return /^\d$/.test(cell) ? cell : "";
|
|
36738
|
+
});
|
|
36739
|
+
const pastedDigits = input.replace(/\D/g, "");
|
|
36740
|
+
const safeIndex = pastedDigits.length > 1 && pastedDigits.length > safeLength - focusedIndex ? 0 : focusedIndex;
|
|
36533
36741
|
const insertedDigits = normalizeVerificationCode(input, safeLength - safeIndex);
|
|
36534
36742
|
if (!insertedDigits) {
|
|
36535
|
-
|
|
36536
|
-
|
|
36537
|
-
nextFocus: safeIndex
|
|
36538
|
-
};
|
|
36743
|
+
cells[safeIndex] = "";
|
|
36744
|
+
return { cells, nextFocus: safeIndex };
|
|
36539
36745
|
}
|
|
36746
|
+
Array.from(insertedDigits).forEach((digit, offset) => {
|
|
36747
|
+
cells[safeIndex + offset] = digit;
|
|
36748
|
+
});
|
|
36540
36749
|
return {
|
|
36541
|
-
|
|
36542
|
-
safeIndex + insertedDigits.length
|
|
36543
|
-
)}`.slice(0, safeLength),
|
|
36750
|
+
cells,
|
|
36544
36751
|
nextFocus: Math.min(safeIndex + insertedDigits.length, safeLength - 1)
|
|
36545
36752
|
};
|
|
36546
36753
|
}
|
|
@@ -36571,17 +36778,17 @@ var VerificationCodeInput = react.forwardRef(function VerificationCodeInput2({
|
|
|
36571
36778
|
}, forwardedRef) {
|
|
36572
36779
|
const safeLength = Math.max(1, Math.floor(length));
|
|
36573
36780
|
const isControlled = typeof value === "string";
|
|
36574
|
-
const [
|
|
36575
|
-
() => normalizeVerificationCode(defaultValue, safeLength)
|
|
36576
|
-
);
|
|
36781
|
+
const [cellsState, setCellsState] = react.useState(() => toVerificationCells(defaultValue, safeLength));
|
|
36577
36782
|
const [focusedIndex, setFocusedIndex] = react.useState(null);
|
|
36578
36783
|
const { width: viewportWidth } = reactNative.useWindowDimensions();
|
|
36579
36784
|
const rootRef = react.useRef(null);
|
|
36580
36785
|
const inputRefs = react.useRef([]);
|
|
36581
|
-
const
|
|
36582
|
-
|
|
36786
|
+
const cells = reconcileVerificationCells(
|
|
36787
|
+
cellsState,
|
|
36788
|
+
isControlled ? value : verificationCellsToCode(cellsState),
|
|
36583
36789
|
safeLength
|
|
36584
36790
|
);
|
|
36791
|
+
const currentCode = verificationCellsToCode(cells);
|
|
36585
36792
|
useApplyWebClassName(rootRef, className);
|
|
36586
36793
|
const focus = react.useCallback(
|
|
36587
36794
|
(index = 0) => {
|
|
@@ -36591,39 +36798,37 @@ var VerificationCodeInput = react.forwardRef(function VerificationCodeInput2({
|
|
|
36591
36798
|
[safeLength]
|
|
36592
36799
|
);
|
|
36593
36800
|
const commit = react.useCallback(
|
|
36594
|
-
(
|
|
36595
|
-
|
|
36596
|
-
|
|
36597
|
-
|
|
36598
|
-
|
|
36599
|
-
|
|
36600
|
-
if (normalized.length === safeLength) {
|
|
36601
|
-
onComplete?.(normalized);
|
|
36801
|
+
(nextCells) => {
|
|
36802
|
+
setCellsState(nextCells);
|
|
36803
|
+
const code = verificationCellsToCode(nextCells);
|
|
36804
|
+
onValueChange?.(code);
|
|
36805
|
+
if (isVerificationCodeComplete(nextCells)) {
|
|
36806
|
+
onComplete?.(code);
|
|
36602
36807
|
}
|
|
36603
36808
|
},
|
|
36604
|
-
[
|
|
36809
|
+
[onComplete, onValueChange]
|
|
36605
36810
|
);
|
|
36606
36811
|
react.useImperativeHandle(
|
|
36607
36812
|
forwardedRef,
|
|
36608
36813
|
() => ({
|
|
36609
36814
|
clear: () => {
|
|
36610
|
-
commit("");
|
|
36815
|
+
commit(toVerificationCells("", safeLength));
|
|
36611
36816
|
focus(0);
|
|
36612
36817
|
},
|
|
36613
36818
|
focus
|
|
36614
36819
|
}),
|
|
36615
|
-
[commit, focus]
|
|
36820
|
+
[commit, focus, safeLength]
|
|
36616
36821
|
);
|
|
36617
36822
|
const handleChange = (index, input) => {
|
|
36618
|
-
const update =
|
|
36619
|
-
commit(update.
|
|
36823
|
+
const update = updateVerificationCells(cells, index, input, safeLength);
|
|
36824
|
+
commit(update.cells);
|
|
36620
36825
|
focus(update.nextFocus);
|
|
36621
36826
|
};
|
|
36622
36827
|
const handleKeyPress = (index, event) => {
|
|
36623
36828
|
const key = event.nativeEvent.key;
|
|
36624
|
-
if (key === "Backspace" && !
|
|
36625
|
-
const update =
|
|
36626
|
-
commit(update.
|
|
36829
|
+
if (key === "Backspace" && !cells[index] && index > 0) {
|
|
36830
|
+
const update = updateVerificationCells(cells, index - 1, "", safeLength);
|
|
36831
|
+
commit(update.cells);
|
|
36627
36832
|
focus(index - 1);
|
|
36628
36833
|
return;
|
|
36629
36834
|
}
|
|
@@ -36691,7 +36896,7 @@ var VerificationCodeInput = react.forwardRef(function VerificationCodeInput2({
|
|
|
36691
36896
|
reactNative.Platform.OS === "android" ? styles33.cellAndroid : null,
|
|
36692
36897
|
inputStyle
|
|
36693
36898
|
],
|
|
36694
|
-
value:
|
|
36899
|
+
value: cells[index] ?? ""
|
|
36695
36900
|
},
|
|
36696
36901
|
index
|
|
36697
36902
|
);
|
|
@@ -36777,6 +36982,9 @@ var FALLBACK_ELLIPSIS_WIDTH = 20;
|
|
|
36777
36982
|
var WEB_MENU_Z_INDEX = 600;
|
|
36778
36983
|
var WEB_VIEWPORT_PADDING = 8;
|
|
36779
36984
|
var WEB_MENU_GAP = 8;
|
|
36985
|
+
function webListboxProps(multiple) {
|
|
36986
|
+
return { role: "listbox", "aria-multiselectable": multiple };
|
|
36987
|
+
}
|
|
36780
36988
|
function itemBackground(state) {
|
|
36781
36989
|
switch (state) {
|
|
36782
36990
|
case "hover":
|
|
@@ -37090,6 +37298,7 @@ var Select = react.forwardRef(
|
|
|
37090
37298
|
setOpen(false);
|
|
37091
37299
|
focusTrigger();
|
|
37092
37300
|
}, [focusTrigger, setOpen]);
|
|
37301
|
+
useOverlayLayer("popover", isOpen, closeAndFocusTrigger);
|
|
37093
37302
|
react.useEffect(() => {
|
|
37094
37303
|
if (reactNative.Platform.OS !== "web") return;
|
|
37095
37304
|
const isTriggerFocused = () => document.activeElement === triggerRef.current;
|
|
@@ -37103,11 +37312,6 @@ var Select = react.forwardRef(
|
|
|
37103
37312
|
}
|
|
37104
37313
|
return;
|
|
37105
37314
|
}
|
|
37106
|
-
if (event.key === "Escape") {
|
|
37107
|
-
event.preventDefault();
|
|
37108
|
-
closeAndFocusTrigger();
|
|
37109
|
-
return;
|
|
37110
|
-
}
|
|
37111
37315
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
37112
37316
|
event.preventDefault();
|
|
37113
37317
|
setHoveredValue((current) => {
|
|
@@ -37145,7 +37349,6 @@ var Select = react.forwardRef(
|
|
|
37145
37349
|
filteredOptions,
|
|
37146
37350
|
hoveredValue,
|
|
37147
37351
|
multiple,
|
|
37148
|
-
closeAndFocusTrigger,
|
|
37149
37352
|
focusTrigger,
|
|
37150
37353
|
handleSelect,
|
|
37151
37354
|
setOpen
|
|
@@ -37212,6 +37415,7 @@ var Select = react.forwardRef(
|
|
|
37212
37415
|
contentContainerStyle: styles34.optionListContent,
|
|
37213
37416
|
keyboardShouldPersistTaps: "handled",
|
|
37214
37417
|
showsVerticalScrollIndicator: false,
|
|
37418
|
+
...reactNative.Platform.OS === "web" ? webListboxProps(multiple) : null,
|
|
37215
37419
|
children: [
|
|
37216
37420
|
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,
|
|
37217
37421
|
!loading && filteredOptions.map((option) => {
|
|
@@ -37229,6 +37433,8 @@ var Select = react.forwardRef(
|
|
|
37229
37433
|
onPressOut: () => setHoveredValue((current) => current === option.value ? null : current),
|
|
37230
37434
|
accessibilityRole: multiple ? "checkbox" : "button",
|
|
37231
37435
|
accessibilityState: { selected: isSelected, checked: isSelected, disabled },
|
|
37436
|
+
role: reactNative.Platform.OS === "web" ? "option" : void 0,
|
|
37437
|
+
"aria-selected": isSelected,
|
|
37232
37438
|
style: [
|
|
37233
37439
|
styles34.item,
|
|
37234
37440
|
{
|
|
@@ -37269,6 +37475,7 @@ var Select = react.forwardRef(
|
|
|
37269
37475
|
accessibilityRole: "combobox",
|
|
37270
37476
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
37271
37477
|
accessibilityState: { disabled, expanded: isOpen },
|
|
37478
|
+
"aria-expanded": isOpen,
|
|
37272
37479
|
style: [
|
|
37273
37480
|
styles34.trigger,
|
|
37274
37481
|
{
|
|
@@ -37752,6 +37959,8 @@ var Toggle = react.forwardRef(function Toggle2({
|
|
|
37752
37959
|
accessibilityRole: "switch",
|
|
37753
37960
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
37754
37961
|
accessibilityState: { checked: isActive, disabled },
|
|
37962
|
+
"aria-checked": isActive,
|
|
37963
|
+
...reactNative.Platform.OS === "web" && !disabled ? { onKeyDown: (event) => handleWebToggleKeyDown(event, handlePress) } : null,
|
|
37755
37964
|
style: [styles36.pressable, disabled && styles36.disabled, style],
|
|
37756
37965
|
children: [
|
|
37757
37966
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -37903,7 +38112,7 @@ var BASE_ITEM_SIZE = 16;
|
|
|
37903
38112
|
var ICON_WIDTH_RATIO = 12.57 / BASE_ITEM_SIZE;
|
|
37904
38113
|
var ICON_HEIGHT_RATIO = 11.98 / BASE_ITEM_SIZE;
|
|
37905
38114
|
var STAR_GAP_RATIO = 2 / BASE_ITEM_SIZE;
|
|
37906
|
-
function
|
|
38115
|
+
function clamp(value) {
|
|
37907
38116
|
return Math.max(0, Math.min(value, STAR_COUNT));
|
|
37908
38117
|
}
|
|
37909
38118
|
var RatingInput = react.forwardRef(
|
|
@@ -37927,8 +38136,8 @@ var RatingInput = react.forwardRef(
|
|
|
37927
38136
|
const containerRef = react.useRef(null);
|
|
37928
38137
|
const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
37929
38138
|
const isControlled = value !== void 0;
|
|
37930
|
-
const [uncontrolledValue, setUncontrolledValue] = react.useState(() =>
|
|
37931
|
-
const selectedValue =
|
|
38139
|
+
const [uncontrolledValue, setUncontrolledValue] = react.useState(() => clamp(defaultValue));
|
|
38140
|
+
const selectedValue = clamp(isControlled ? value : uncontrolledValue);
|
|
37932
38141
|
const selectedStarCount = Math.round(selectedValue);
|
|
37933
38142
|
const iconWidth = size * ICON_WIDTH_RATIO;
|
|
37934
38143
|
const iconHeight = size * ICON_HEIGHT_RATIO;
|
|
@@ -39091,6 +39300,12 @@ var RadioButton = react.forwardRef(
|
|
|
39091
39300
|
accessibilityRole: "radio",
|
|
39092
39301
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
39093
39302
|
accessibilityState: { selected: isActive, disabled },
|
|
39303
|
+
...reactNative.Platform.OS === "web" ? {
|
|
39304
|
+
"aria-checked": isActive,
|
|
39305
|
+
...disabled ? null : {
|
|
39306
|
+
onKeyDown: (event) => handleWebToggleKeyDown(event, handlePress)
|
|
39307
|
+
}
|
|
39308
|
+
} : null,
|
|
39094
39309
|
style: [styles42.root, disabled && styles42.disabled, style],
|
|
39095
39310
|
children: [
|
|
39096
39311
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles42.control, children: isActive ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles42.dot }) : null }),
|
|
@@ -39416,6 +39631,7 @@ exports.WasherIcon = WasherIcon;
|
|
|
39416
39631
|
exports.WhatsAppIcon = WhatsAppIcon;
|
|
39417
39632
|
exports.ZoomOutIcon = ZoomOutIcon;
|
|
39418
39633
|
exports.abbreviateMonthName = abbreviateMonthName;
|
|
39634
|
+
exports.abbreviateMonthNames = abbreviateMonthNames;
|
|
39419
39635
|
exports.avatarTypography = avatarTypography;
|
|
39420
39636
|
exports.badgeTypography = badgeTypography;
|
|
39421
39637
|
exports.buttonTypography = buttonTypography;
|