@ecohouse/ui 0.1.62 → 0.1.64
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 +21 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.tsx +18 -7
- package/src/components/DatePicker/DatePicker.stories.tsx +12 -0
- package/src/components/DatePicker/DatePicker.tsx +7 -6
- package/src/components/VerificationCodeInput/VerificationCodeInput.test.ts +14 -0
- package/src/components/VerificationCodeInput/VerificationCodeInput.utils.ts +6 -1
package/dist/index.js
CHANGED
|
@@ -31545,6 +31545,11 @@ var triggerWebBlurStyle = Platform.OS === "web" ? {
|
|
|
31545
31545
|
backdropFilter: "blur(40px)",
|
|
31546
31546
|
WebkitBackdropFilter: "blur(40px)"
|
|
31547
31547
|
} : {};
|
|
31548
|
+
var variantWebTransitionStyle = Platform.OS === "web" ? {
|
|
31549
|
+
transitionProperty: "background-color, border-color, box-shadow, backdrop-filter, -webkit-backdrop-filter",
|
|
31550
|
+
transitionDuration: "200ms",
|
|
31551
|
+
transitionTimingFunction: "ease"
|
|
31552
|
+
} : {};
|
|
31548
31553
|
var menuWebBlurStyle = Platform.OS === "web" ? {
|
|
31549
31554
|
backdropFilter: "blur(40px)",
|
|
31550
31555
|
WebkitBackdropFilter: "blur(40px)"
|
|
@@ -31650,6 +31655,7 @@ var Avatar = forwardRef(function Avatar2({
|
|
|
31650
31655
|
accessibilityState: isInteractive ? { disabled, expanded: hasMenu ? isOpen : void 0 } : void 0,
|
|
31651
31656
|
style: [
|
|
31652
31657
|
styles6.root,
|
|
31658
|
+
variantWebTransitionStyle,
|
|
31653
31659
|
isLightVariant ? styles6.rootLight : styles6.rootDark,
|
|
31654
31660
|
isLightVariant && triggerWebBlurStyle,
|
|
31655
31661
|
disabled && styles6.disabled,
|
|
@@ -31705,6 +31711,7 @@ var Avatar = forwardRef(function Avatar2({
|
|
|
31705
31711
|
{
|
|
31706
31712
|
style: [
|
|
31707
31713
|
styles6.menu,
|
|
31714
|
+
variantWebTransitionStyle,
|
|
31708
31715
|
isLightVariant ? styles6.menuLight : styles6.menuDark,
|
|
31709
31716
|
isLightVariant && menuWebBlurStyle,
|
|
31710
31717
|
menuWidth != null && { right: void 0, width: menuWidth }
|
|
@@ -31721,7 +31728,7 @@ var Avatar = forwardRef(function Avatar2({
|
|
|
31721
31728
|
hoverColor: item.hoverColor ?? (isLightVariant ? colors.whiteAlpha7 : void 0),
|
|
31722
31729
|
labelStyle: item.labelStyle,
|
|
31723
31730
|
onPress: () => handleItemPress(item),
|
|
31724
|
-
style:
|
|
31731
|
+
style: item.backgroundColor ? styles6.emphasizedMenuItem : styles6.menuItem
|
|
31725
31732
|
},
|
|
31726
31733
|
itemKey
|
|
31727
31734
|
);
|
|
@@ -31831,6 +31838,9 @@ var styles6 = StyleSheet.create({
|
|
|
31831
31838
|
overflow: "hidden"
|
|
31832
31839
|
},
|
|
31833
31840
|
menuDark: {
|
|
31841
|
+
// Matches menuLight's border so switching variants does not shift the menu by 2px.
|
|
31842
|
+
borderWidth: 1,
|
|
31843
|
+
borderColor: "transparent",
|
|
31834
31844
|
backgroundColor: colors.grey700,
|
|
31835
31845
|
...Platform.select({
|
|
31836
31846
|
web: {
|
|
@@ -35228,7 +35238,7 @@ var DatePicker = forwardRef(
|
|
|
35228
35238
|
style: [
|
|
35229
35239
|
styles27.dayCircle,
|
|
35230
35240
|
isSelectedEndpoint && styles27.dayCircleSelected,
|
|
35231
|
-
dayUnavailable && styles27.
|
|
35241
|
+
dayUnavailable && styles27.dayCircleUnavailable,
|
|
35232
35242
|
isHovered && styles27.dayCircleHovered
|
|
35233
35243
|
],
|
|
35234
35244
|
children: /* @__PURE__ */ jsx(
|
|
@@ -35237,7 +35247,7 @@ var DatePicker = forwardRef(
|
|
|
35237
35247
|
style: [
|
|
35238
35248
|
styles27.dayText,
|
|
35239
35249
|
{ color: dayTextColor },
|
|
35240
|
-
dayUnavailable && styles27.
|
|
35250
|
+
dayUnavailable && styles27.dayTextUnavailable
|
|
35241
35251
|
],
|
|
35242
35252
|
children: day.getDate()
|
|
35243
35253
|
}
|
|
@@ -35553,13 +35563,14 @@ var styles27 = StyleSheet.create({
|
|
|
35553
35563
|
borderRadius: 22,
|
|
35554
35564
|
overflow: "hidden"
|
|
35555
35565
|
},
|
|
35556
|
-
|
|
35557
|
-
|
|
35566
|
+
/** Unavailable day: filled circle a step lighter than the calendar, dimmed number. */
|
|
35567
|
+
dayCircleUnavailable: {
|
|
35568
|
+
backgroundColor: colors.grey600,
|
|
35558
35569
|
borderRadius: 22,
|
|
35559
35570
|
overflow: "hidden"
|
|
35560
35571
|
},
|
|
35561
|
-
|
|
35562
|
-
|
|
35572
|
+
dayTextUnavailable: {
|
|
35573
|
+
color: colors.grey200
|
|
35563
35574
|
},
|
|
35564
35575
|
dayCircleHovered: {
|
|
35565
35576
|
backgroundColor: colors.grey600
|
|
@@ -36725,11 +36736,13 @@ function reconcileVerificationCells(cells, code, length) {
|
|
|
36725
36736
|
}
|
|
36726
36737
|
function updateVerificationCells(currentCells, index, input, length) {
|
|
36727
36738
|
const safeLength = Math.max(1, length);
|
|
36728
|
-
const
|
|
36739
|
+
const focusedIndex = Math.min(Math.max(0, index), safeLength - 1);
|
|
36729
36740
|
const cells = Array.from({ length: safeLength }, (_, cellIndex) => {
|
|
36730
36741
|
const cell = currentCells[cellIndex] ?? "";
|
|
36731
36742
|
return /^\d$/.test(cell) ? cell : "";
|
|
36732
36743
|
});
|
|
36744
|
+
const pastedDigits = input.replace(/\D/g, "");
|
|
36745
|
+
const safeIndex = pastedDigits.length > 1 && pastedDigits.length > safeLength - focusedIndex ? 0 : focusedIndex;
|
|
36733
36746
|
const insertedDigits = normalizeVerificationCode(input, safeLength - safeIndex);
|
|
36734
36747
|
if (!insertedDigits) {
|
|
36735
36748
|
cells[safeIndex] = "";
|