@ecohouse/ui 0.1.28 → 0.1.30
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/README.md +17 -13
- package/dist/index.cjs +782 -191
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -2
- package/dist/index.d.ts +89 -2
- package/dist/index.js +782 -194
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AvatarSimple/AvatarSimple.stories.tsx +62 -0
- package/src/components/AvatarSimple/AvatarSimple.tsx +178 -0
- package/src/components/AvatarSimple/index.ts +2 -0
- package/src/components/SegmentedToggle/SegmentedToggle.stories.tsx +22 -0
- package/src/components/SegmentedToggle/SegmentedToggle.tsx +51 -18
- package/src/components/Sidebar/Sidebar.stories.tsx +119 -0
- package/src/components/Sidebar/Sidebar.tsx +305 -0
- package/src/components/Sidebar/index.ts +2 -0
- package/src/components/VerificationCodeInput/VerificationCodeInput.stories.tsx +112 -0
- package/src/components/VerificationCodeInput/VerificationCodeInput.test.ts +42 -0
- package/src/components/VerificationCodeInput/VerificationCodeInput.tsx +255 -0
- package/src/components/VerificationCodeInput/VerificationCodeInput.utils.ts +34 -0
- package/src/components/VerificationCodeInput/index.ts +5 -0
- package/src/components/index.ts +12 -0
- package/src/icons/LogOut/logOutPath.ts +1 -1
- package/src/index.ts +9 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { forwardRef, useRef, useMemo, useState, useCallback, useEffect, useLayoutEffect, isValidElement, cloneElement } from 'react';
|
|
2
|
-
import { View, Text, Platform, Pressable, StyleSheet, Image, Animated, Easing, TouchableOpacity, TextInput, ScrollView, PanResponder } from 'react-native';
|
|
1
|
+
import { forwardRef, useRef, useMemo, useState, useCallback, useEffect, useImperativeHandle, useLayoutEffect, isValidElement, cloneElement } from 'react';
|
|
2
|
+
import { View, Text, Platform, Pressable, StyleSheet, Image, Animated, Easing, TouchableOpacity, TextInput, useWindowDimensions, ScrollView, PanResponder } from 'react-native';
|
|
3
3
|
import Svg16, { Path } from 'react-native-svg';
|
|
4
4
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -872,7 +872,7 @@ function LocationPinIcon({ size = 20, color = colors.grey200, strokeWidth = 2 })
|
|
|
872
872
|
}
|
|
873
873
|
|
|
874
874
|
// src/icons/LogOut/logOutPath.ts
|
|
875
|
-
var LOG_OUT_PATH = "M10.6667 4.66667L14 8L10.6667 11.3333M14
|
|
875
|
+
var LOG_OUT_PATH = "M10.6667 4.66667L14 8L10.6667 11.3333M14 8H6M6 2H5.2C4.0799 2 3.51984 2 3.09202 2.21799C2.7157 2.40973 2.40973 2.71569 2.21799 3.09202C2 3.51984 2 4.07989 2 5.2V10.8C2 11.9201 2 12.4802 2.21799 12.908C2.40973 13.2843 2.71569 13.5903 3.09202 13.782C3.51984 14 4.0799 14 5.2 14H6";
|
|
876
876
|
function LogOutIcon({ size = 20, color = colors.red, strokeWidth = 1.5 }) {
|
|
877
877
|
return /* @__PURE__ */ jsx(Svg16, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx(
|
|
878
878
|
Path,
|
|
@@ -2070,6 +2070,136 @@ var styles4 = StyleSheet.create({
|
|
|
2070
2070
|
})
|
|
2071
2071
|
}
|
|
2072
2072
|
});
|
|
2073
|
+
var IMAGE_SIZE2 = 32;
|
|
2074
|
+
var CARD_WIDTH = 268;
|
|
2075
|
+
var CARD_HEIGHT = 56;
|
|
2076
|
+
var LOG_OUT_SIZE = 16;
|
|
2077
|
+
var AvatarSimple = forwardRef(
|
|
2078
|
+
function AvatarSimple2({
|
|
2079
|
+
name,
|
|
2080
|
+
email,
|
|
2081
|
+
imageUrl,
|
|
2082
|
+
onLogOut,
|
|
2083
|
+
logOutAccessibilityLabel = "Log out",
|
|
2084
|
+
compact = false,
|
|
2085
|
+
style,
|
|
2086
|
+
className,
|
|
2087
|
+
...rest
|
|
2088
|
+
}, forwardedRef) {
|
|
2089
|
+
const containerRef = useRef(null);
|
|
2090
|
+
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
2091
|
+
const [imageFailed, setImageFailed] = useState(false);
|
|
2092
|
+
const showImage = Boolean(imageUrl) && !imageFailed;
|
|
2093
|
+
useApplyWebClassName(containerRef, className);
|
|
2094
|
+
return /* @__PURE__ */ jsxs(
|
|
2095
|
+
View,
|
|
2096
|
+
{
|
|
2097
|
+
...rest,
|
|
2098
|
+
ref: setContainerRef,
|
|
2099
|
+
style: [styles5.root, compact ? styles5.rootCompact : styles5.rootCard, style],
|
|
2100
|
+
accessibilityRole: "summary",
|
|
2101
|
+
accessibilityLabel: `${name}, ${email}`,
|
|
2102
|
+
children: [
|
|
2103
|
+
/* @__PURE__ */ jsx(View, { style: styles5.avatar, children: showImage ? /* @__PURE__ */ jsx(
|
|
2104
|
+
Image,
|
|
2105
|
+
{
|
|
2106
|
+
source: { uri: imageUrl ?? void 0 },
|
|
2107
|
+
style: styles5.avatarImage,
|
|
2108
|
+
onError: () => setImageFailed(true),
|
|
2109
|
+
accessibilityIgnoresInvertColors: true
|
|
2110
|
+
}
|
|
2111
|
+
) : null }),
|
|
2112
|
+
!compact ? /* @__PURE__ */ jsxs(View, { style: styles5.details, children: [
|
|
2113
|
+
/* @__PURE__ */ jsxs(View, { style: styles5.textBlock, children: [
|
|
2114
|
+
/* @__PURE__ */ jsx(Text, { style: styles5.name, numberOfLines: 1, children: name }),
|
|
2115
|
+
/* @__PURE__ */ jsx(Text, { style: styles5.email, numberOfLines: 1, children: email })
|
|
2116
|
+
] }),
|
|
2117
|
+
/* @__PURE__ */ jsx(
|
|
2118
|
+
Pressable,
|
|
2119
|
+
{
|
|
2120
|
+
onPress: onLogOut,
|
|
2121
|
+
accessibilityRole: "button",
|
|
2122
|
+
accessibilityLabel: logOutAccessibilityLabel,
|
|
2123
|
+
hitSlop: 8,
|
|
2124
|
+
style: styles5.logOutButton,
|
|
2125
|
+
children: /* @__PURE__ */ jsx(LogOutIcon, { color: colors.primary, size: LOG_OUT_SIZE, strokeWidth: 2 })
|
|
2126
|
+
}
|
|
2127
|
+
)
|
|
2128
|
+
] }) : null
|
|
2129
|
+
]
|
|
2130
|
+
}
|
|
2131
|
+
);
|
|
2132
|
+
}
|
|
2133
|
+
);
|
|
2134
|
+
var styles5 = StyleSheet.create({
|
|
2135
|
+
root: {
|
|
2136
|
+
flexDirection: "row",
|
|
2137
|
+
alignItems: "center",
|
|
2138
|
+
overflow: "hidden"
|
|
2139
|
+
},
|
|
2140
|
+
rootCard: {
|
|
2141
|
+
width: CARD_WIDTH,
|
|
2142
|
+
height: CARD_HEIGHT,
|
|
2143
|
+
gap: 12,
|
|
2144
|
+
borderRadius: 12,
|
|
2145
|
+
paddingVertical: 4,
|
|
2146
|
+
paddingHorizontal: 12,
|
|
2147
|
+
backgroundColor: colors.grey700
|
|
2148
|
+
},
|
|
2149
|
+
rootCompact: {
|
|
2150
|
+
width: IMAGE_SIZE2,
|
|
2151
|
+
height: IMAGE_SIZE2,
|
|
2152
|
+
borderRadius: IMAGE_SIZE2,
|
|
2153
|
+
backgroundColor: "transparent"
|
|
2154
|
+
},
|
|
2155
|
+
avatar: {
|
|
2156
|
+
width: IMAGE_SIZE2,
|
|
2157
|
+
height: IMAGE_SIZE2,
|
|
2158
|
+
borderRadius: 56,
|
|
2159
|
+
backgroundColor: colors.grey500,
|
|
2160
|
+
overflow: "hidden",
|
|
2161
|
+
flexShrink: 0
|
|
2162
|
+
},
|
|
2163
|
+
avatarImage: {
|
|
2164
|
+
width: IMAGE_SIZE2,
|
|
2165
|
+
height: IMAGE_SIZE2
|
|
2166
|
+
},
|
|
2167
|
+
details: {
|
|
2168
|
+
flex: 1,
|
|
2169
|
+
minWidth: 0,
|
|
2170
|
+
flexDirection: "row",
|
|
2171
|
+
alignItems: "center",
|
|
2172
|
+
gap: 12
|
|
2173
|
+
},
|
|
2174
|
+
textBlock: {
|
|
2175
|
+
flex: 1,
|
|
2176
|
+
minWidth: 0
|
|
2177
|
+
},
|
|
2178
|
+
name: {
|
|
2179
|
+
fontFamily: fonts.sans,
|
|
2180
|
+
fontSize: 12,
|
|
2181
|
+
fontWeight: "600",
|
|
2182
|
+
lineHeight: 16,
|
|
2183
|
+
letterSpacing: 0,
|
|
2184
|
+
color: colors.white
|
|
2185
|
+
},
|
|
2186
|
+
email: {
|
|
2187
|
+
marginTop: 2,
|
|
2188
|
+
fontFamily: fonts.sans,
|
|
2189
|
+
fontSize: 12,
|
|
2190
|
+
fontWeight: "400",
|
|
2191
|
+
lineHeight: 16,
|
|
2192
|
+
letterSpacing: 0,
|
|
2193
|
+
color: colors.grey0
|
|
2194
|
+
},
|
|
2195
|
+
logOutButton: {
|
|
2196
|
+
width: LOG_OUT_SIZE,
|
|
2197
|
+
height: LOG_OUT_SIZE,
|
|
2198
|
+
alignItems: "center",
|
|
2199
|
+
justifyContent: "center",
|
|
2200
|
+
flexShrink: 0
|
|
2201
|
+
}
|
|
2202
|
+
});
|
|
2073
2203
|
var ICON_SIZE3 = 20;
|
|
2074
2204
|
var webBlurStyle2 = Platform.OS === "web" ? {
|
|
2075
2205
|
backdropFilter: "blur(10.3px)",
|
|
@@ -2101,22 +2231,22 @@ var Badge = forwardRef(function Badge2({ label, variant = "default", icon: Icon2
|
|
|
2101
2231
|
...rest,
|
|
2102
2232
|
ref: setContainerRef,
|
|
2103
2233
|
style: [
|
|
2104
|
-
|
|
2234
|
+
styles6.base,
|
|
2105
2235
|
{ backgroundColor: preset.backgroundColor },
|
|
2106
|
-
preset.border ?
|
|
2236
|
+
preset.border ? styles6.transparentBorder : null,
|
|
2107
2237
|
preset.blur ? webBlurStyle2 : null,
|
|
2108
2238
|
style
|
|
2109
2239
|
],
|
|
2110
2240
|
accessibilityRole: "text",
|
|
2111
2241
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
2112
2242
|
children: [
|
|
2113
|
-
Icon2 ? /* @__PURE__ */ jsx(View, { style:
|
|
2114
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2243
|
+
Icon2 ? /* @__PURE__ */ jsx(View, { style: styles6.iconSlot, children: /* @__PURE__ */ jsx(Icon2, { size: ICON_SIZE3, color: preset.iconColor }) }) : null,
|
|
2244
|
+
/* @__PURE__ */ jsx(Text, { style: [styles6.label, Platform.OS === "android" ? styles6.labelAndroid : null], children: label })
|
|
2115
2245
|
]
|
|
2116
2246
|
}
|
|
2117
2247
|
);
|
|
2118
2248
|
});
|
|
2119
|
-
var
|
|
2249
|
+
var styles6 = StyleSheet.create({
|
|
2120
2250
|
base: {
|
|
2121
2251
|
flexDirection: "row",
|
|
2122
2252
|
alignItems: "center",
|
|
@@ -2189,7 +2319,7 @@ var Counter = forwardRef(function Counter2({
|
|
|
2189
2319
|
if (!isControlled) setUncontrolledValue(next);
|
|
2190
2320
|
onValueChange?.(next);
|
|
2191
2321
|
};
|
|
2192
|
-
return /* @__PURE__ */ jsxs(View, { ...rest, ref: setContainerRef, style: [
|
|
2322
|
+
return /* @__PURE__ */ jsxs(View, { ...rest, ref: setContainerRef, style: [styles7.base, style], children: [
|
|
2193
2323
|
/* @__PURE__ */ jsx(
|
|
2194
2324
|
Pressable,
|
|
2195
2325
|
{
|
|
@@ -2199,11 +2329,11 @@ var Counter = forwardRef(function Counter2({
|
|
|
2199
2329
|
accessibilityRole: "button",
|
|
2200
2330
|
accessibilityLabel: "Decrease value",
|
|
2201
2331
|
accessibilityState: { disabled: decrementDisabled },
|
|
2202
|
-
style: [
|
|
2332
|
+
style: [styles7.button, webBlurStyle3, decrementDisabled && styles7.buttonDisabled],
|
|
2203
2333
|
children: /* @__PURE__ */ jsx(MinusIcon, {})
|
|
2204
2334
|
}
|
|
2205
2335
|
),
|
|
2206
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
2336
|
+
/* @__PURE__ */ jsx(Text, { style: styles7.value, children: resolvedValue }),
|
|
2207
2337
|
/* @__PURE__ */ jsx(
|
|
2208
2338
|
Pressable,
|
|
2209
2339
|
{
|
|
@@ -2213,13 +2343,13 @@ var Counter = forwardRef(function Counter2({
|
|
|
2213
2343
|
accessibilityRole: "button",
|
|
2214
2344
|
accessibilityLabel: "Increase value",
|
|
2215
2345
|
accessibilityState: { disabled: incrementDisabled },
|
|
2216
|
-
style: [
|
|
2346
|
+
style: [styles7.button, webBlurStyle3, incrementDisabled && styles7.buttonDisabled],
|
|
2217
2347
|
children: /* @__PURE__ */ jsx(PlusIcon, {})
|
|
2218
2348
|
}
|
|
2219
2349
|
)
|
|
2220
2350
|
] });
|
|
2221
2351
|
});
|
|
2222
|
-
var
|
|
2352
|
+
var styles7 = StyleSheet.create({
|
|
2223
2353
|
base: {
|
|
2224
2354
|
flexDirection: "row",
|
|
2225
2355
|
alignItems: "center",
|
|
@@ -2249,6 +2379,17 @@ var OPTION_HORIZONTAL_PADDING = 16;
|
|
|
2249
2379
|
var OPTION_CONTENT_GAP = 12;
|
|
2250
2380
|
var OPTION_MIN_WIDTH = 97;
|
|
2251
2381
|
var OPTION_MEASUREMENT_TOLERANCE = 0.5;
|
|
2382
|
+
var TRACK_PADDING = 4;
|
|
2383
|
+
var OPTION_GAP = 4;
|
|
2384
|
+
function buildIndicatorOutputRange(optionWidths) {
|
|
2385
|
+
const outputRange = [];
|
|
2386
|
+
let offset = 0;
|
|
2387
|
+
for (let index = 0; index < optionWidths.length; index += 1) {
|
|
2388
|
+
outputRange.push(offset);
|
|
2389
|
+
offset += optionWidths[index] + OPTION_GAP;
|
|
2390
|
+
}
|
|
2391
|
+
return outputRange;
|
|
2392
|
+
}
|
|
2252
2393
|
var SegmentedToggle = forwardRef(
|
|
2253
2394
|
function SegmentedToggle2({
|
|
2254
2395
|
options,
|
|
@@ -2263,6 +2404,7 @@ var SegmentedToggle = forwardRef(
|
|
|
2263
2404
|
onLayout,
|
|
2264
2405
|
...rest
|
|
2265
2406
|
}, forwardedRef) {
|
|
2407
|
+
const optionCount = options.length;
|
|
2266
2408
|
const containerRef = useRef(null);
|
|
2267
2409
|
const isControlled = value !== void 0;
|
|
2268
2410
|
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
@@ -2274,20 +2416,31 @@ var SegmentedToggle = forwardRef(
|
|
|
2274
2416
|
const resolvedClassName = className?.trim() || void 0;
|
|
2275
2417
|
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
2276
2418
|
const progress = useRef(new Animated.Value(selectedIndex)).current;
|
|
2277
|
-
const [contentWidths, setContentWidths] = useState(
|
|
2419
|
+
const [contentWidths, setContentWidths] = useState(
|
|
2420
|
+
() => Array.from({ length: optionCount }, () => 0)
|
|
2421
|
+
);
|
|
2278
2422
|
const [containerWidth, setContainerWidth] = useState(0);
|
|
2279
|
-
const
|
|
2423
|
+
const trackChrome = TRACK_PADDING * 2 + OPTION_GAP * (optionCount - 1);
|
|
2424
|
+
const availableOptionWidth = Math.max(0, (containerWidth - trackChrome) / optionCount);
|
|
2280
2425
|
const resolveContentOptionWidth = (contentWidth) => contentWidth > 0 ? Math.max(
|
|
2281
2426
|
OPTION_MIN_WIDTH,
|
|
2282
2427
|
contentWidth + OPTION_HORIZONTAL_PADDING * 2 + OPTION_MEASUREMENT_TOLERANCE
|
|
2283
2428
|
) : 0;
|
|
2284
|
-
const optionWidths = fullWidth ?
|
|
2285
|
-
const selectedOptionWidth = optionWidths[selectedIndex];
|
|
2429
|
+
const optionWidths = fullWidth ? Array.from({ length: optionCount }, () => availableOptionWidth) : contentWidths.map((width) => resolveContentOptionWidth(width));
|
|
2430
|
+
const selectedOptionWidth = optionWidths[selectedIndex] ?? 0;
|
|
2431
|
+
const indicatorInputRange = options.map((_, index) => index);
|
|
2432
|
+
const indicatorOutputRange = buildIndicatorOutputRange(optionWidths);
|
|
2286
2433
|
const indicatorTranslateX = progress.interpolate({
|
|
2287
|
-
inputRange:
|
|
2288
|
-
outputRange:
|
|
2434
|
+
inputRange: indicatorInputRange,
|
|
2435
|
+
outputRange: indicatorOutputRange
|
|
2289
2436
|
});
|
|
2290
2437
|
useApplyWebClassName(containerRef, resolvedClassName);
|
|
2438
|
+
useEffect(() => {
|
|
2439
|
+
setContentWidths((current) => {
|
|
2440
|
+
if (current.length === optionCount) return current;
|
|
2441
|
+
return Array.from({ length: optionCount }, (_, index) => current[index] ?? 0);
|
|
2442
|
+
});
|
|
2443
|
+
}, [optionCount]);
|
|
2291
2444
|
useEffect(() => {
|
|
2292
2445
|
const animation = Animated.timing(progress, {
|
|
2293
2446
|
toValue: selectedIndex,
|
|
@@ -2316,9 +2469,9 @@ var SegmentedToggle = forwardRef(
|
|
|
2316
2469
|
onLayout?.(event);
|
|
2317
2470
|
},
|
|
2318
2471
|
style: [
|
|
2319
|
-
|
|
2320
|
-
fullWidth ?
|
|
2321
|
-
disabled &&
|
|
2472
|
+
styles8.base,
|
|
2473
|
+
fullWidth ? styles8.fullWidth : styles8.contentWidth,
|
|
2474
|
+
disabled && styles8.disabled,
|
|
2322
2475
|
style
|
|
2323
2476
|
],
|
|
2324
2477
|
accessibilityRole: "radiogroup",
|
|
@@ -2334,15 +2487,15 @@ var SegmentedToggle = forwardRef(
|
|
|
2334
2487
|
const nextWidth = event.nativeEvent.layout.width;
|
|
2335
2488
|
setContentWidths((currentWidths) => {
|
|
2336
2489
|
if (currentWidths[index] === nextWidth) return currentWidths;
|
|
2337
|
-
const nextWidths = [currentWidths
|
|
2490
|
+
const nextWidths = [...currentWidths];
|
|
2338
2491
|
nextWidths[index] = nextWidth;
|
|
2339
2492
|
return nextWidths;
|
|
2340
2493
|
});
|
|
2341
2494
|
},
|
|
2342
|
-
style:
|
|
2495
|
+
style: styles8.optionMeasurement,
|
|
2343
2496
|
children: [
|
|
2344
2497
|
Icon2 ? /* @__PURE__ */ jsx(Icon2, { size: ICON_SIZE4 }) : null,
|
|
2345
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2498
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.label, styles8.contentWidthLabel], children: label })
|
|
2346
2499
|
]
|
|
2347
2500
|
},
|
|
2348
2501
|
`${optionValue}-measurement`
|
|
@@ -2352,7 +2505,7 @@ var SegmentedToggle = forwardRef(
|
|
|
2352
2505
|
{
|
|
2353
2506
|
pointerEvents: "none",
|
|
2354
2507
|
style: [
|
|
2355
|
-
|
|
2508
|
+
styles8.activeIndicator,
|
|
2356
2509
|
{ width: selectedOptionWidth, transform: [{ translateX: indicatorTranslateX }] }
|
|
2357
2510
|
]
|
|
2358
2511
|
}
|
|
@@ -2361,6 +2514,7 @@ var SegmentedToggle = forwardRef(
|
|
|
2361
2514
|
const selected = optionValue === selectedValue;
|
|
2362
2515
|
const iconColor = selected ? colors.primary : colors.whiteAlpha20;
|
|
2363
2516
|
const labelColor = selected ? colors.whiteAlpha86 : colors.whiteAlpha40;
|
|
2517
|
+
const optionWidth = optionWidths[index] ?? 0;
|
|
2364
2518
|
return /* @__PURE__ */ jsx(
|
|
2365
2519
|
Pressable,
|
|
2366
2520
|
{
|
|
@@ -2371,21 +2525,18 @@ var SegmentedToggle = forwardRef(
|
|
|
2371
2525
|
accessibilityLabel: label,
|
|
2372
2526
|
accessibilityState: { selected, disabled },
|
|
2373
2527
|
style: [
|
|
2374
|
-
|
|
2375
|
-
fullWidth ?
|
|
2376
|
-
styles7.optionContentWidth,
|
|
2377
|
-
optionWidths[index] > 0 && { width: optionWidths[index] }
|
|
2378
|
-
]
|
|
2528
|
+
styles8.option,
|
|
2529
|
+
fullWidth ? styles8.optionFullWidth : [styles8.optionContentWidth, optionWidth > 0 && { width: optionWidth }]
|
|
2379
2530
|
],
|
|
2380
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
2531
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles8.optionContent, children: [
|
|
2381
2532
|
Icon2 ? /* @__PURE__ */ jsx(Icon2, { size: ICON_SIZE4, color: iconColor }) : null,
|
|
2382
2533
|
/* @__PURE__ */ jsx(
|
|
2383
2534
|
Text,
|
|
2384
2535
|
{
|
|
2385
2536
|
numberOfLines: fullWidth ? 1 : void 0,
|
|
2386
2537
|
style: [
|
|
2387
|
-
|
|
2388
|
-
!fullWidth &&
|
|
2538
|
+
styles8.label,
|
|
2539
|
+
!fullWidth && styles8.contentWidthLabel,
|
|
2389
2540
|
{ color: labelColor }
|
|
2390
2541
|
],
|
|
2391
2542
|
children: label
|
|
@@ -2401,12 +2552,12 @@ var SegmentedToggle = forwardRef(
|
|
|
2401
2552
|
);
|
|
2402
2553
|
}
|
|
2403
2554
|
);
|
|
2404
|
-
var
|
|
2555
|
+
var styles8 = StyleSheet.create({
|
|
2405
2556
|
base: {
|
|
2406
2557
|
height: 44,
|
|
2407
2558
|
flexDirection: "row",
|
|
2408
|
-
padding:
|
|
2409
|
-
gap:
|
|
2559
|
+
padding: TRACK_PADDING,
|
|
2560
|
+
gap: OPTION_GAP,
|
|
2410
2561
|
borderRadius: 60,
|
|
2411
2562
|
backgroundColor: colors.grey700,
|
|
2412
2563
|
overflow: "hidden"
|
|
@@ -2451,8 +2602,8 @@ var styles7 = StyleSheet.create({
|
|
|
2451
2602
|
},
|
|
2452
2603
|
activeIndicator: {
|
|
2453
2604
|
position: "absolute",
|
|
2454
|
-
top:
|
|
2455
|
-
left:
|
|
2605
|
+
top: TRACK_PADDING,
|
|
2606
|
+
left: TRACK_PADDING,
|
|
2456
2607
|
height: 36,
|
|
2457
2608
|
backgroundColor: colors.grey600,
|
|
2458
2609
|
borderRadius: 60
|
|
@@ -2465,6 +2616,242 @@ var styles7 = StyleSheet.create({
|
|
|
2465
2616
|
flexShrink: 0
|
|
2466
2617
|
}
|
|
2467
2618
|
});
|
|
2619
|
+
var SIDEBAR_WIDTH = 300;
|
|
2620
|
+
var SIDEBAR_COLLAPSED_WIDTH = 72;
|
|
2621
|
+
var HEADER_HEIGHT = 64;
|
|
2622
|
+
var LOGO_WIDTH = 31;
|
|
2623
|
+
var LOGO_HEIGHT = 44;
|
|
2624
|
+
var TOGGLE_SIZE = 20;
|
|
2625
|
+
var MENU_ICON_SIZE = 16;
|
|
2626
|
+
var PROFILE_SECTION_HEIGHT = 80;
|
|
2627
|
+
var SIDEBAR_TRANSITION_MS = 300;
|
|
2628
|
+
var Sidebar = forwardRef(function Sidebar2({
|
|
2629
|
+
items,
|
|
2630
|
+
user,
|
|
2631
|
+
onLogOut,
|
|
2632
|
+
logoAccessibilityLabel = "Cortel Booking",
|
|
2633
|
+
navigationAccessibilityLabel = "Account navigation",
|
|
2634
|
+
collapseAccessibilityLabel = "Collapse sidebar",
|
|
2635
|
+
expandAccessibilityLabel = "Expand sidebar",
|
|
2636
|
+
logOutAccessibilityLabel = "Log out",
|
|
2637
|
+
collapsed: collapsedProp,
|
|
2638
|
+
defaultCollapsed = false,
|
|
2639
|
+
onCollapsedChange,
|
|
2640
|
+
style,
|
|
2641
|
+
className,
|
|
2642
|
+
...rest
|
|
2643
|
+
}, forwardedRef) {
|
|
2644
|
+
const containerRef = useRef(null);
|
|
2645
|
+
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
2646
|
+
const [uncontrolledCollapsed, setUncontrolledCollapsed] = useState(defaultCollapsed);
|
|
2647
|
+
const collapsed = collapsedProp ?? uncontrolledCollapsed;
|
|
2648
|
+
const widthAnim = useRef(
|
|
2649
|
+
new Animated.Value(collapsed ? SIDEBAR_COLLAPSED_WIDTH : SIDEBAR_WIDTH)
|
|
2650
|
+
).current;
|
|
2651
|
+
const labelOpacity = useRef(new Animated.Value(collapsed ? 0 : 1)).current;
|
|
2652
|
+
useApplyWebClassName(containerRef, className);
|
|
2653
|
+
useEffect(() => {
|
|
2654
|
+
const nextWidth = collapsed ? SIDEBAR_COLLAPSED_WIDTH : SIDEBAR_WIDTH;
|
|
2655
|
+
const nextOpacity = collapsed ? 0 : 1;
|
|
2656
|
+
const timing = {
|
|
2657
|
+
duration: SIDEBAR_TRANSITION_MS,
|
|
2658
|
+
easing: Easing.inOut(Easing.ease),
|
|
2659
|
+
useNativeDriver: false
|
|
2660
|
+
};
|
|
2661
|
+
const widthAnimation = Animated.timing(widthAnim, { ...timing, toValue: nextWidth });
|
|
2662
|
+
const opacityAnimation = Animated.timing(labelOpacity, { ...timing, toValue: nextOpacity });
|
|
2663
|
+
Animated.parallel([widthAnimation, opacityAnimation]).start();
|
|
2664
|
+
return () => {
|
|
2665
|
+
widthAnimation.stop();
|
|
2666
|
+
opacityAnimation.stop();
|
|
2667
|
+
};
|
|
2668
|
+
}, [collapsed, labelOpacity, widthAnim]);
|
|
2669
|
+
const setCollapsed = (next) => {
|
|
2670
|
+
onCollapsedChange?.(next);
|
|
2671
|
+
if (collapsedProp === void 0) {
|
|
2672
|
+
setUncontrolledCollapsed(next);
|
|
2673
|
+
}
|
|
2674
|
+
};
|
|
2675
|
+
return /* @__PURE__ */ jsxs(
|
|
2676
|
+
Animated.View,
|
|
2677
|
+
{
|
|
2678
|
+
...rest,
|
|
2679
|
+
ref: setContainerRef,
|
|
2680
|
+
style: [styles9.root, { width: widthAnim }, style],
|
|
2681
|
+
accessibilityRole: "menu",
|
|
2682
|
+
children: [
|
|
2683
|
+
/* @__PURE__ */ jsxs(View, { style: [styles9.header, collapsed ? styles9.headerCollapsed : styles9.headerExpanded], children: [
|
|
2684
|
+
/* @__PURE__ */ jsx(
|
|
2685
|
+
Animated.View,
|
|
2686
|
+
{
|
|
2687
|
+
pointerEvents: collapsed ? "none" : "auto",
|
|
2688
|
+
style: [
|
|
2689
|
+
styles9.logoSlot,
|
|
2690
|
+
{
|
|
2691
|
+
opacity: labelOpacity,
|
|
2692
|
+
maxWidth: collapsed ? 0 : LOGO_WIDTH
|
|
2693
|
+
}
|
|
2694
|
+
],
|
|
2695
|
+
accessibilityElementsHidden: collapsed,
|
|
2696
|
+
importantForAccessibility: collapsed ? "no-hide-descendants" : "auto",
|
|
2697
|
+
children: /* @__PURE__ */ jsx(
|
|
2698
|
+
BrandLogo,
|
|
2699
|
+
{
|
|
2700
|
+
accessibilityLabel: logoAccessibilityLabel,
|
|
2701
|
+
height: LOGO_HEIGHT,
|
|
2702
|
+
variant: "brand",
|
|
2703
|
+
width: LOGO_WIDTH
|
|
2704
|
+
}
|
|
2705
|
+
)
|
|
2706
|
+
}
|
|
2707
|
+
),
|
|
2708
|
+
/* @__PURE__ */ jsx(
|
|
2709
|
+
Pressable,
|
|
2710
|
+
{
|
|
2711
|
+
accessibilityRole: "button",
|
|
2712
|
+
accessibilityLabel: collapsed ? expandAccessibilityLabel : collapseAccessibilityLabel,
|
|
2713
|
+
accessibilityState: { expanded: !collapsed },
|
|
2714
|
+
hitSlop: 8,
|
|
2715
|
+
onPress: () => setCollapsed(!collapsed),
|
|
2716
|
+
style: styles9.toggleButton,
|
|
2717
|
+
children: /* @__PURE__ */ jsx(SidebarIcon, { color: colors.grey100, size: TOGGLE_SIZE, strokeWidth: 2 })
|
|
2718
|
+
}
|
|
2719
|
+
)
|
|
2720
|
+
] }),
|
|
2721
|
+
/* @__PURE__ */ jsx(
|
|
2722
|
+
View,
|
|
2723
|
+
{
|
|
2724
|
+
accessibilityLabel: navigationAccessibilityLabel,
|
|
2725
|
+
accessibilityRole: "menu",
|
|
2726
|
+
style: styles9.nav,
|
|
2727
|
+
children: items.map((item) => {
|
|
2728
|
+
const isActive = Boolean(item.active);
|
|
2729
|
+
const iconColor = isActive ? colors.primary : colors.grey300;
|
|
2730
|
+
const Icon2 = item.icon;
|
|
2731
|
+
const iconNode = /* @__PURE__ */ jsx(Icon2, { color: iconColor, size: MENU_ICON_SIZE, strokeWidth: 1.5 });
|
|
2732
|
+
return /* @__PURE__ */ jsx(
|
|
2733
|
+
MenuItem,
|
|
2734
|
+
{
|
|
2735
|
+
icon: iconNode,
|
|
2736
|
+
label: item.label,
|
|
2737
|
+
accessibilityLabel: item.label,
|
|
2738
|
+
backgroundColor: isActive ? colors.grey700 : "transparent",
|
|
2739
|
+
hoverColor: colors.grey700,
|
|
2740
|
+
onPress: item.onPress,
|
|
2741
|
+
labelStyle: [
|
|
2742
|
+
styles9.menuLabel,
|
|
2743
|
+
{ color: isActive ? colors.white : colors.grey200 },
|
|
2744
|
+
collapsed ? styles9.menuLabelCollapsed : styles9.menuLabelExpanded
|
|
2745
|
+
],
|
|
2746
|
+
style: [styles9.menuItem, collapsed ? styles9.menuItemCollapsed : null]
|
|
2747
|
+
},
|
|
2748
|
+
item.key
|
|
2749
|
+
);
|
|
2750
|
+
})
|
|
2751
|
+
}
|
|
2752
|
+
),
|
|
2753
|
+
/* @__PURE__ */ jsx(View, { style: [styles9.footer, collapsed ? styles9.footerCollapsed : styles9.footerExpanded], children: /* @__PURE__ */ jsx(
|
|
2754
|
+
AvatarSimple,
|
|
2755
|
+
{
|
|
2756
|
+
name: user.name,
|
|
2757
|
+
email: user.email,
|
|
2758
|
+
imageUrl: user.imageUrl,
|
|
2759
|
+
onLogOut,
|
|
2760
|
+
logOutAccessibilityLabel,
|
|
2761
|
+
compact: collapsed
|
|
2762
|
+
}
|
|
2763
|
+
) })
|
|
2764
|
+
]
|
|
2765
|
+
}
|
|
2766
|
+
);
|
|
2767
|
+
});
|
|
2768
|
+
var styles9 = StyleSheet.create({
|
|
2769
|
+
root: {
|
|
2770
|
+
height: "100%",
|
|
2771
|
+
flexShrink: 0,
|
|
2772
|
+
backgroundColor: colors.dark,
|
|
2773
|
+
borderRightWidth: 1,
|
|
2774
|
+
borderRightColor: colors.grey700,
|
|
2775
|
+
overflow: "hidden"
|
|
2776
|
+
},
|
|
2777
|
+
header: {
|
|
2778
|
+
zIndex: 1,
|
|
2779
|
+
height: HEADER_HEIGHT,
|
|
2780
|
+
width: "100%",
|
|
2781
|
+
flexDirection: "row",
|
|
2782
|
+
alignItems: "center",
|
|
2783
|
+
borderBottomWidth: 1,
|
|
2784
|
+
borderBottomColor: colors.grey700,
|
|
2785
|
+
backgroundColor: colors.dark
|
|
2786
|
+
},
|
|
2787
|
+
headerExpanded: {
|
|
2788
|
+
justifyContent: "space-between",
|
|
2789
|
+
paddingHorizontal: 24
|
|
2790
|
+
},
|
|
2791
|
+
headerCollapsed: {
|
|
2792
|
+
justifyContent: "center",
|
|
2793
|
+
paddingHorizontal: 0
|
|
2794
|
+
},
|
|
2795
|
+
logoSlot: {
|
|
2796
|
+
minWidth: 0,
|
|
2797
|
+
height: LOGO_HEIGHT,
|
|
2798
|
+
flexShrink: 0,
|
|
2799
|
+
overflow: "hidden"
|
|
2800
|
+
},
|
|
2801
|
+
toggleButton: {
|
|
2802
|
+
width: TOGGLE_SIZE,
|
|
2803
|
+
height: TOGGLE_SIZE,
|
|
2804
|
+
alignItems: "center",
|
|
2805
|
+
justifyContent: "center",
|
|
2806
|
+
flexShrink: 0
|
|
2807
|
+
},
|
|
2808
|
+
nav: {
|
|
2809
|
+
flex: 1,
|
|
2810
|
+
width: "100%",
|
|
2811
|
+
padding: 16,
|
|
2812
|
+
gap: 10
|
|
2813
|
+
},
|
|
2814
|
+
menuItem: {
|
|
2815
|
+
gap: 8
|
|
2816
|
+
},
|
|
2817
|
+
menuItemCollapsed: {
|
|
2818
|
+
gap: 0
|
|
2819
|
+
},
|
|
2820
|
+
menuLabel: {
|
|
2821
|
+
fontFamily: fonts.sans,
|
|
2822
|
+
fontSize: 12,
|
|
2823
|
+
fontWeight: "600",
|
|
2824
|
+
lineHeight: 16,
|
|
2825
|
+
letterSpacing: 0
|
|
2826
|
+
},
|
|
2827
|
+
menuLabelExpanded: {
|
|
2828
|
+
flexGrow: 1,
|
|
2829
|
+
flexShrink: 1,
|
|
2830
|
+
opacity: 1
|
|
2831
|
+
},
|
|
2832
|
+
menuLabelCollapsed: {
|
|
2833
|
+
flexGrow: 0,
|
|
2834
|
+
flexShrink: 0,
|
|
2835
|
+
width: 0,
|
|
2836
|
+
maxWidth: 0,
|
|
2837
|
+
opacity: 0,
|
|
2838
|
+
overflow: "hidden"
|
|
2839
|
+
},
|
|
2840
|
+
footer: {
|
|
2841
|
+
height: PROFILE_SECTION_HEIGHT,
|
|
2842
|
+
width: "100%",
|
|
2843
|
+
flexShrink: 0,
|
|
2844
|
+
alignItems: "center",
|
|
2845
|
+
justifyContent: "center",
|
|
2846
|
+
paddingVertical: 12
|
|
2847
|
+
},
|
|
2848
|
+
footerExpanded: {
|
|
2849
|
+
paddingHorizontal: 16
|
|
2850
|
+
},
|
|
2851
|
+
footerCollapsed: {
|
|
2852
|
+
paddingHorizontal: 0
|
|
2853
|
+
}
|
|
2854
|
+
});
|
|
2468
2855
|
var defaultLanguageOptions = [
|
|
2469
2856
|
{ value: "hy", label: "\u0540\u0561\u0575" },
|
|
2470
2857
|
{ value: "en", label: "Eng" },
|
|
@@ -2552,7 +2939,7 @@ var LanguageSwitcher = forwardRef(
|
|
|
2552
2939
|
{
|
|
2553
2940
|
...rest,
|
|
2554
2941
|
ref: setWrapperRef,
|
|
2555
|
-
style: [
|
|
2942
|
+
style: [styles10.wrapper, isOpen && styles10.wrapperOpen, disabled && styles10.disabled, style],
|
|
2556
2943
|
children: [
|
|
2557
2944
|
/* @__PURE__ */ jsxs(
|
|
2558
2945
|
Pressable,
|
|
@@ -2567,17 +2954,17 @@ var LanguageSwitcher = forwardRef(
|
|
|
2567
2954
|
onHoverIn: () => setTriggerHovered(true),
|
|
2568
2955
|
onHoverOut: () => setTriggerHovered(false),
|
|
2569
2956
|
style: ({ pressed }) => [
|
|
2570
|
-
|
|
2571
|
-
(triggerHovered || pressed || isOpen) &&
|
|
2957
|
+
styles10.trigger,
|
|
2958
|
+
(triggerHovered || pressed || isOpen) && styles10.triggerActive
|
|
2572
2959
|
],
|
|
2573
2960
|
children: [
|
|
2574
2961
|
/* @__PURE__ */ jsx(GlobeIcon, { size: ICON_SIZE5, color: colors.white, strokeWidth: 2 }),
|
|
2575
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
2576
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
2962
|
+
/* @__PURE__ */ jsx(Text, { style: styles10.triggerLabel, numberOfLines: 1, children: selectedOption?.label ?? "" }),
|
|
2963
|
+
/* @__PURE__ */ jsx(View, { style: [styles10.chevron, isOpen && styles10.chevronOpen], children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: ICON_SIZE5, color: colors.white, strokeWidth: 2 }) })
|
|
2577
2964
|
]
|
|
2578
2965
|
}
|
|
2579
2966
|
),
|
|
2580
|
-
isOpen && options.length > 0 ? /* @__PURE__ */ jsx(View, { style:
|
|
2967
|
+
isOpen && options.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles10.menu, accessibilityRole: "menu", children: options.map((option) => {
|
|
2581
2968
|
const selected = option.value === selectedValue;
|
|
2582
2969
|
return /* @__PURE__ */ jsx(
|
|
2583
2970
|
Pressable,
|
|
@@ -2589,10 +2976,10 @@ var LanguageSwitcher = forwardRef(
|
|
|
2589
2976
|
onHoverIn: () => setHoveredValue(option.value),
|
|
2590
2977
|
onHoverOut: () => setHoveredValue(null),
|
|
2591
2978
|
style: ({ pressed }) => [
|
|
2592
|
-
|
|
2593
|
-
selected ?
|
|
2979
|
+
styles10.item,
|
|
2980
|
+
selected ? styles10.itemSelected : (hoveredValue === option.value || pressed) && styles10.itemHovered
|
|
2594
2981
|
],
|
|
2595
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
2982
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles10.itemLabel, selected && styles10.itemLabelSelected], children: option.label })
|
|
2596
2983
|
},
|
|
2597
2984
|
option.value
|
|
2598
2985
|
);
|
|
@@ -2602,7 +2989,7 @@ var LanguageSwitcher = forwardRef(
|
|
|
2602
2989
|
);
|
|
2603
2990
|
}
|
|
2604
2991
|
);
|
|
2605
|
-
var
|
|
2992
|
+
var styles10 = StyleSheet.create({
|
|
2606
2993
|
wrapper: {
|
|
2607
2994
|
position: "relative",
|
|
2608
2995
|
width: CONTROL_WIDTH,
|
|
@@ -2698,17 +3085,17 @@ var StatCard = forwardRef(function StatCard2({
|
|
|
2698
3085
|
{
|
|
2699
3086
|
...rest,
|
|
2700
3087
|
ref: setContainerRef,
|
|
2701
|
-
style: [
|
|
3088
|
+
style: [styles11.base, style],
|
|
2702
3089
|
accessibilityRole: "text",
|
|
2703
3090
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
2704
3091
|
children: [
|
|
2705
3092
|
/* @__PURE__ */ jsx(Icon2, { ...iconProps, size: iconSize, color: iconProps?.color ?? colors.white }),
|
|
2706
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
3093
|
+
/* @__PURE__ */ jsx(Text, { style: styles11.label, children: label })
|
|
2707
3094
|
]
|
|
2708
3095
|
}
|
|
2709
3096
|
);
|
|
2710
3097
|
});
|
|
2711
|
-
var
|
|
3098
|
+
var styles11 = StyleSheet.create({
|
|
2712
3099
|
base: {
|
|
2713
3100
|
width: 204.5,
|
|
2714
3101
|
minHeight: 114,
|
|
@@ -2794,7 +3181,7 @@ var Button = forwardRef(
|
|
|
2794
3181
|
useApplyWebClassName(textRef, textClassName);
|
|
2795
3182
|
const iconNode = customIcon ?? /* @__PURE__ */ jsx(ArrowRightIcon, { size: metrics.iconSize, color: preset.iconColor });
|
|
2796
3183
|
const containerStyle = [
|
|
2797
|
-
|
|
3184
|
+
styles12.base,
|
|
2798
3185
|
{
|
|
2799
3186
|
minHeight: metrics.minHeight,
|
|
2800
3187
|
borderRadius: metrics.borderRadius,
|
|
@@ -2805,16 +3192,16 @@ var Button = forwardRef(
|
|
|
2805
3192
|
paddingRight: hasIcon ? metrics.paddingRightWithIcon : metrics.paddingRight,
|
|
2806
3193
|
gap: hasIcon ? metrics.gap : 0
|
|
2807
3194
|
},
|
|
2808
|
-
hasIcon ?
|
|
2809
|
-
disabled &&
|
|
3195
|
+
hasIcon ? styles12.contentWithIcon : styles12.contentWithoutIcon,
|
|
3196
|
+
disabled && styles12.disabled,
|
|
2810
3197
|
style
|
|
2811
3198
|
];
|
|
2812
3199
|
const labelStyle = [
|
|
2813
|
-
|
|
3200
|
+
styles12.label,
|
|
2814
3201
|
metrics.text,
|
|
2815
3202
|
{ color: preset.textColor },
|
|
2816
|
-
Platform.OS === "android" ?
|
|
2817
|
-
!hasIcon &&
|
|
3203
|
+
Platform.OS === "android" ? styles12.labelAndroid : null,
|
|
3204
|
+
!hasIcon && styles12.labelCentered,
|
|
2818
3205
|
textStyle
|
|
2819
3206
|
];
|
|
2820
3207
|
return /* @__PURE__ */ jsxs(
|
|
@@ -2835,7 +3222,7 @@ var Button = forwardRef(
|
|
|
2835
3222
|
View,
|
|
2836
3223
|
{
|
|
2837
3224
|
style: [
|
|
2838
|
-
|
|
3225
|
+
styles12.iconContainer,
|
|
2839
3226
|
{
|
|
2840
3227
|
width: metrics.iconContainerSize,
|
|
2841
3228
|
height: metrics.iconContainerSize,
|
|
@@ -2851,7 +3238,7 @@ var Button = forwardRef(
|
|
|
2851
3238
|
);
|
|
2852
3239
|
}
|
|
2853
3240
|
);
|
|
2854
|
-
var
|
|
3241
|
+
var styles12 = StyleSheet.create({
|
|
2855
3242
|
base: {
|
|
2856
3243
|
flexDirection: "row",
|
|
2857
3244
|
alignItems: "center",
|
|
@@ -2935,13 +3322,13 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
2935
3322
|
accessibilityRole: "checkbox",
|
|
2936
3323
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
2937
3324
|
accessibilityState: { checked: isActive, disabled },
|
|
2938
|
-
style: [
|
|
3325
|
+
style: [styles13.root, disabled && styles13.disabled, style],
|
|
2939
3326
|
children: [
|
|
2940
3327
|
/* @__PURE__ */ jsx(
|
|
2941
3328
|
View,
|
|
2942
3329
|
{
|
|
2943
3330
|
style: [
|
|
2944
|
-
|
|
3331
|
+
styles13.box,
|
|
2945
3332
|
{
|
|
2946
3333
|
backgroundColor: chrome.backgroundColor,
|
|
2947
3334
|
borderColor: chrome.borderColor
|
|
@@ -2950,12 +3337,12 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
2950
3337
|
children: isActive ? /* @__PURE__ */ jsx(CheckIcon, { size: CHECK_SIZE, color: colors.primary, strokeWidth: CHECK_STROKE }) : null
|
|
2951
3338
|
}
|
|
2952
3339
|
),
|
|
2953
|
-
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3340
|
+
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [styles13.label, labelStyle], children: labelContent }) : labelContent : null
|
|
2954
3341
|
]
|
|
2955
3342
|
}
|
|
2956
3343
|
);
|
|
2957
3344
|
});
|
|
2958
|
-
var
|
|
3345
|
+
var styles13 = StyleSheet.create({
|
|
2959
3346
|
root: {
|
|
2960
3347
|
flexDirection: "row",
|
|
2961
3348
|
alignItems: "center",
|
|
@@ -3063,13 +3450,13 @@ function RangeTriggerField({
|
|
|
3063
3450
|
value,
|
|
3064
3451
|
time
|
|
3065
3452
|
}) {
|
|
3066
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
3067
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style:
|
|
3068
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3069
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style:
|
|
3070
|
-
time ? /* @__PURE__ */ jsxs(View, { style:
|
|
3453
|
+
return /* @__PURE__ */ jsxs(View, { style: styles14.rangeField, children: [
|
|
3454
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles14.rangeLabel, children: label }),
|
|
3455
|
+
/* @__PURE__ */ jsxs(View, { style: styles14.rangeValueRow, children: [
|
|
3456
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles14.rangeDate, children: value }),
|
|
3457
|
+
time ? /* @__PURE__ */ jsxs(View, { style: styles14.rangeTimeWrap, children: [
|
|
3071
3458
|
/* @__PURE__ */ jsx(ClockFilledIcon, { color: colors.lightGrey, size: 16 }),
|
|
3072
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
3459
|
+
/* @__PURE__ */ jsx(Text, { style: styles14.rangeTime, children: time })
|
|
3073
3460
|
] }) : null
|
|
3074
3461
|
] })
|
|
3075
3462
|
] });
|
|
@@ -3235,14 +3622,14 @@ var DatePicker = forwardRef(
|
|
|
3235
3622
|
...rest,
|
|
3236
3623
|
ref: setRootRef,
|
|
3237
3624
|
style: [
|
|
3238
|
-
|
|
3239
|
-
usesRangeTrigger &&
|
|
3240
|
-
isOpen &&
|
|
3241
|
-
disabled &&
|
|
3625
|
+
styles14.root,
|
|
3626
|
+
usesRangeTrigger && styles14.rangeRoot,
|
|
3627
|
+
isOpen && styles14.rootOpen,
|
|
3628
|
+
disabled && styles14.disabled,
|
|
3242
3629
|
style
|
|
3243
3630
|
],
|
|
3244
3631
|
accessibilityState: { disabled, expanded: isOpen },
|
|
3245
|
-
children: /* @__PURE__ */ jsxs(View, { style: [
|
|
3632
|
+
children: /* @__PURE__ */ jsxs(View, { style: [styles14.triggerWrap, isOpen && styles14.triggerWrapOpen], children: [
|
|
3246
3633
|
/* @__PURE__ */ jsx(
|
|
3247
3634
|
Pressable,
|
|
3248
3635
|
{
|
|
@@ -3253,9 +3640,9 @@ var DatePicker = forwardRef(
|
|
|
3253
3640
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
3254
3641
|
accessibilityState: { disabled, expanded: isOpen },
|
|
3255
3642
|
style: [
|
|
3256
|
-
|
|
3257
|
-
usesRangeTrigger &&
|
|
3258
|
-
usesRangeTrigger && (usesVerticalRangeTrigger ?
|
|
3643
|
+
styles14.trigger,
|
|
3644
|
+
usesRangeTrigger && styles14.rangeTrigger,
|
|
3645
|
+
usesRangeTrigger && (usesVerticalRangeTrigger ? styles14.rangeTriggerVertical : styles14.rangeTriggerHorizontal),
|
|
3259
3646
|
{
|
|
3260
3647
|
borderColor: triggerBorderColor,
|
|
3261
3648
|
backgroundColor: usesRangeTrigger ? "transparent" : colors.grey700
|
|
@@ -3266,18 +3653,18 @@ var DatePicker = forwardRef(
|
|
|
3266
3653
|
/* @__PURE__ */ jsx(
|
|
3267
3654
|
View,
|
|
3268
3655
|
{
|
|
3269
|
-
style: usesVerticalRangeTrigger ?
|
|
3656
|
+
style: usesVerticalRangeTrigger ? styles14.rangeDividerVertical : styles14.rangeDividerHorizontal
|
|
3270
3657
|
}
|
|
3271
3658
|
),
|
|
3272
3659
|
/* @__PURE__ */ jsx(RangeTriggerField, { label: endLabel, time: endTime, value: endValue })
|
|
3273
3660
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3274
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3275
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
3661
|
+
/* @__PURE__ */ jsx(Text, { style: [styles14.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: triggerLabel }),
|
|
3662
|
+
/* @__PURE__ */ jsx(View, { style: styles14.iconSlot, children: /* @__PURE__ */ jsx(CalendarOutlineIcon, { size: ICON_SIZE7, color: colors.grey100 }) })
|
|
3276
3663
|
] })
|
|
3277
3664
|
}
|
|
3278
3665
|
),
|
|
3279
|
-
isOpen ? /* @__PURE__ */ jsxs(View, { style: [
|
|
3280
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3666
|
+
isOpen ? /* @__PURE__ */ jsxs(View, { style: [styles14.menu, usesRangeTrigger && styles14.rangeMenu, calendarStyle], children: [
|
|
3667
|
+
/* @__PURE__ */ jsxs(View, { style: styles14.calendarHeader, children: [
|
|
3281
3668
|
/* @__PURE__ */ jsx(
|
|
3282
3669
|
Pressable,
|
|
3283
3670
|
{
|
|
@@ -3285,11 +3672,11 @@ var DatePicker = forwardRef(
|
|
|
3285
3672
|
hitSlop: 8,
|
|
3286
3673
|
accessibilityRole: "button",
|
|
3287
3674
|
accessibilityLabel: "Previous month",
|
|
3288
|
-
style:
|
|
3675
|
+
style: styles14.navButton,
|
|
3289
3676
|
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: NAV_ICON_SIZE, color: colors.white })
|
|
3290
3677
|
}
|
|
3291
3678
|
),
|
|
3292
|
-
/* @__PURE__ */ jsxs(Text, { style:
|
|
3679
|
+
/* @__PURE__ */ jsxs(Text, { style: styles14.monthHeading, children: [
|
|
3293
3680
|
monthNames[visibleMonth.getMonth()],
|
|
3294
3681
|
" ",
|
|
3295
3682
|
visibleMonth.getFullYear()
|
|
@@ -3301,13 +3688,13 @@ var DatePicker = forwardRef(
|
|
|
3301
3688
|
hitSlop: 8,
|
|
3302
3689
|
accessibilityRole: "button",
|
|
3303
3690
|
accessibilityLabel: "Next month",
|
|
3304
|
-
style:
|
|
3305
|
-
children: /* @__PURE__ */ jsx(View, { style:
|
|
3691
|
+
style: styles14.navButton,
|
|
3692
|
+
children: /* @__PURE__ */ jsx(View, { style: styles14.navIconMirror, children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: NAV_ICON_SIZE, color: colors.white }) })
|
|
3306
3693
|
}
|
|
3307
3694
|
)
|
|
3308
3695
|
] }),
|
|
3309
3696
|
/* @__PURE__ */ jsxs(View, { children: [
|
|
3310
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
3697
|
+
/* @__PURE__ */ jsx(View, { style: styles14.weekdayRow, children: weekdayLabels.map((weekdayLabel, index) => /* @__PURE__ */ jsx(View, { style: styles14.dayCellWrap, children: /* @__PURE__ */ jsx(Text, { style: styles14.weekdayText, children: weekdayLabel }) }, `${weekdayLabel}-${index}`)) }),
|
|
3311
3698
|
weeks.map((week, weekIndex) => {
|
|
3312
3699
|
let rangeHighlightStyle = null;
|
|
3313
3700
|
if (isRange && rangeValue.start && rangeValue.end) {
|
|
@@ -3344,13 +3731,13 @@ var DatePicker = forwardRef(
|
|
|
3344
3731
|
return /* @__PURE__ */ jsxs(
|
|
3345
3732
|
View,
|
|
3346
3733
|
{
|
|
3347
|
-
style: [
|
|
3734
|
+
style: [styles14.weekRow, weekIndex > 0 && styles14.weekRowSpaced],
|
|
3348
3735
|
children: [
|
|
3349
3736
|
rangeHighlightStyle ? /* @__PURE__ */ jsx(
|
|
3350
3737
|
View,
|
|
3351
3738
|
{
|
|
3352
3739
|
pointerEvents: "none",
|
|
3353
|
-
style: [
|
|
3740
|
+
style: [styles14.rangeHighlight, rangeHighlightStyle]
|
|
3354
3741
|
}
|
|
3355
3742
|
) : null,
|
|
3356
3743
|
week.map((day, dayIndex) => {
|
|
@@ -3373,7 +3760,7 @@ var DatePicker = forwardRef(
|
|
|
3373
3760
|
onHoverOut: () => setHoveredDayKey((current) => current === dayKey ? null : current),
|
|
3374
3761
|
onPressIn: () => setHoveredDayKey(dayKey),
|
|
3375
3762
|
onPressOut: () => setHoveredDayKey((current) => current === dayKey ? null : current),
|
|
3376
|
-
style:
|
|
3763
|
+
style: styles14.dayCellWrap,
|
|
3377
3764
|
accessibilityRole: "button",
|
|
3378
3765
|
accessibilityLabel: formatValue(day),
|
|
3379
3766
|
accessibilityState: {
|
|
@@ -3385,14 +3772,14 @@ var DatePicker = forwardRef(
|
|
|
3385
3772
|
View,
|
|
3386
3773
|
{
|
|
3387
3774
|
style: [
|
|
3388
|
-
|
|
3389
|
-
isSelectedEndpoint &&
|
|
3390
|
-
isHovered &&
|
|
3775
|
+
styles14.dayCircle,
|
|
3776
|
+
isSelectedEndpoint && styles14.dayCircleSelected,
|
|
3777
|
+
isHovered && styles14.dayCircleHovered
|
|
3391
3778
|
],
|
|
3392
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
3779
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles14.dayText, { color: dayTextColor }], children: day.getDate() })
|
|
3393
3780
|
}
|
|
3394
3781
|
),
|
|
3395
|
-
isToday && !isSelectedEndpoint ? /* @__PURE__ */ jsx(View, { style:
|
|
3782
|
+
isToday && !isSelectedEndpoint ? /* @__PURE__ */ jsx(View, { style: styles14.todayDot }) : null
|
|
3396
3783
|
]
|
|
3397
3784
|
},
|
|
3398
3785
|
dayIndex
|
|
@@ -3410,7 +3797,7 @@ var DatePicker = forwardRef(
|
|
|
3410
3797
|
);
|
|
3411
3798
|
}
|
|
3412
3799
|
);
|
|
3413
|
-
var
|
|
3800
|
+
var styles14 = StyleSheet.create({
|
|
3414
3801
|
root: {
|
|
3415
3802
|
width: DEFAULT_WIDTH,
|
|
3416
3803
|
gap: 8,
|
|
@@ -3754,13 +4141,13 @@ var Input = forwardRef(function Input2({
|
|
|
3754
4141
|
});
|
|
3755
4142
|
useApplyWebClassName(rootRef, className);
|
|
3756
4143
|
useApplyWebClassName(inputRef, inputClassName);
|
|
3757
|
-
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [
|
|
3758
|
-
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [
|
|
4144
|
+
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [styles15.root, disabled && styles15.disabled, style], children: [
|
|
4145
|
+
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [styles15.label, { color: chrome.labelColor }], children: label }) : null,
|
|
3759
4146
|
/* @__PURE__ */ jsxs(
|
|
3760
4147
|
View,
|
|
3761
4148
|
{
|
|
3762
4149
|
style: [
|
|
3763
|
-
|
|
4150
|
+
styles15.field,
|
|
3764
4151
|
{
|
|
3765
4152
|
height: metrics.height,
|
|
3766
4153
|
borderRadius: metrics.borderRadius,
|
|
@@ -3775,7 +4162,7 @@ var Input = forwardRef(function Input2({
|
|
|
3775
4162
|
fieldStyle
|
|
3776
4163
|
],
|
|
3777
4164
|
children: [
|
|
3778
|
-
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style: [
|
|
4165
|
+
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style: [styles15.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }], children: leftIconNode }) : null,
|
|
3779
4166
|
/* @__PURE__ */ jsx(
|
|
3780
4167
|
TextInput,
|
|
3781
4168
|
{
|
|
@@ -3799,11 +4186,11 @@ var Input = forwardRef(function Input2({
|
|
|
3799
4186
|
onBlur?.(event);
|
|
3800
4187
|
},
|
|
3801
4188
|
style: [
|
|
3802
|
-
|
|
4189
|
+
styles15.input,
|
|
3803
4190
|
metrics.text,
|
|
3804
4191
|
{ color: chrome.textColor },
|
|
3805
|
-
Platform.OS === "web" ?
|
|
3806
|
-
Platform.OS === "android" ?
|
|
4192
|
+
Platform.OS === "web" ? styles15.inputWeb : null,
|
|
4193
|
+
Platform.OS === "android" ? styles15.inputAndroid : null,
|
|
3807
4194
|
inputStyle
|
|
3808
4195
|
],
|
|
3809
4196
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
@@ -3815,20 +4202,20 @@ var Input = forwardRef(function Input2({
|
|
|
3815
4202
|
{
|
|
3816
4203
|
onPress: onRightIconPress,
|
|
3817
4204
|
disabled,
|
|
3818
|
-
style: [
|
|
4205
|
+
style: [styles15.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }],
|
|
3819
4206
|
accessibilityRole: "button",
|
|
3820
4207
|
accessibilityLabel: rightIconAccessibilityLabel,
|
|
3821
4208
|
hitSlop: 8,
|
|
3822
4209
|
children: rightIconNode
|
|
3823
4210
|
}
|
|
3824
|
-
) : /* @__PURE__ */ jsx(View, { style: [
|
|
4211
|
+
) : /* @__PURE__ */ jsx(View, { style: [styles15.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }], children: rightIconNode }) : null
|
|
3825
4212
|
]
|
|
3826
4213
|
}
|
|
3827
4214
|
),
|
|
3828
|
-
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
4215
|
+
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [styles15.hint, { color: chrome.hintColor }], children: hint }) : null
|
|
3829
4216
|
] });
|
|
3830
4217
|
});
|
|
3831
|
-
var
|
|
4218
|
+
var styles15 = StyleSheet.create({
|
|
3832
4219
|
root: {
|
|
3833
4220
|
width: DEFAULT_WIDTH2,
|
|
3834
4221
|
gap: 8,
|
|
@@ -3865,6 +4252,207 @@ var styles13 = StyleSheet.create({
|
|
|
3865
4252
|
...inputTypography.hint
|
|
3866
4253
|
}
|
|
3867
4254
|
});
|
|
4255
|
+
|
|
4256
|
+
// src/components/VerificationCodeInput/VerificationCodeInput.utils.ts
|
|
4257
|
+
function normalizeVerificationCode(value, length) {
|
|
4258
|
+
return value.replace(/\D/g, "").slice(0, Math.max(1, length));
|
|
4259
|
+
}
|
|
4260
|
+
function updateVerificationCode(currentCode, index, input, length) {
|
|
4261
|
+
const safeLength = Math.max(1, length);
|
|
4262
|
+
const safeIndex = Math.min(Math.max(0, index), safeLength - 1);
|
|
4263
|
+
const current = normalizeVerificationCode(currentCode, safeLength);
|
|
4264
|
+
const insertedDigits = normalizeVerificationCode(input, safeLength - safeIndex);
|
|
4265
|
+
if (!insertedDigits) {
|
|
4266
|
+
return {
|
|
4267
|
+
code: `${current.slice(0, safeIndex)}${current.slice(safeIndex + 1)}`,
|
|
4268
|
+
nextFocus: safeIndex
|
|
4269
|
+
};
|
|
4270
|
+
}
|
|
4271
|
+
return {
|
|
4272
|
+
code: `${current.slice(0, safeIndex)}${insertedDigits}${current.slice(
|
|
4273
|
+
safeIndex + insertedDigits.length
|
|
4274
|
+
)}`.slice(0, safeLength),
|
|
4275
|
+
nextFocus: Math.min(safeIndex + insertedDigits.length, safeLength - 1)
|
|
4276
|
+
};
|
|
4277
|
+
}
|
|
4278
|
+
var DEFAULT_LENGTH = 6;
|
|
4279
|
+
var DESKTOP_CELL_WIDTH = 54;
|
|
4280
|
+
var MOBILE_CELL_WIDTH = 50;
|
|
4281
|
+
var CELL_HEIGHT = 68;
|
|
4282
|
+
var DESKTOP_GAP = 12;
|
|
4283
|
+
var MOBILE_GAP = 4;
|
|
4284
|
+
var MOBILE_BREAKPOINT = 640;
|
|
4285
|
+
var VerificationCodeInput = forwardRef(function VerificationCodeInput2({
|
|
4286
|
+
length = DEFAULT_LENGTH,
|
|
4287
|
+
value,
|
|
4288
|
+
defaultValue = "",
|
|
4289
|
+
onValueChange,
|
|
4290
|
+
onComplete,
|
|
4291
|
+
onSubmit,
|
|
4292
|
+
error = false,
|
|
4293
|
+
disabled = false,
|
|
4294
|
+
autoFocus = false,
|
|
4295
|
+
getDigitAccessibilityLabel,
|
|
4296
|
+
style,
|
|
4297
|
+
inputStyle,
|
|
4298
|
+
className,
|
|
4299
|
+
...viewProps
|
|
4300
|
+
}, forwardedRef) {
|
|
4301
|
+
const safeLength = Math.max(1, Math.floor(length));
|
|
4302
|
+
const isControlled = typeof value === "string";
|
|
4303
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(
|
|
4304
|
+
() => normalizeVerificationCode(defaultValue, safeLength)
|
|
4305
|
+
);
|
|
4306
|
+
const [focusedIndex, setFocusedIndex] = useState(null);
|
|
4307
|
+
const { width: viewportWidth } = useWindowDimensions();
|
|
4308
|
+
const rootRef = useRef(null);
|
|
4309
|
+
const inputRefs = useRef([]);
|
|
4310
|
+
const currentCode = normalizeVerificationCode(
|
|
4311
|
+
isControlled ? value : uncontrolledValue,
|
|
4312
|
+
safeLength
|
|
4313
|
+
);
|
|
4314
|
+
useApplyWebClassName(rootRef, className);
|
|
4315
|
+
const focus = useCallback(
|
|
4316
|
+
(index = 0) => {
|
|
4317
|
+
const safeIndex = Math.min(Math.max(0, index), safeLength - 1);
|
|
4318
|
+
inputRefs.current[safeIndex]?.focus();
|
|
4319
|
+
},
|
|
4320
|
+
[safeLength]
|
|
4321
|
+
);
|
|
4322
|
+
const commit = useCallback(
|
|
4323
|
+
(nextValue) => {
|
|
4324
|
+
const normalized = normalizeVerificationCode(nextValue, safeLength);
|
|
4325
|
+
if (!isControlled) {
|
|
4326
|
+
setUncontrolledValue(normalized);
|
|
4327
|
+
}
|
|
4328
|
+
onValueChange?.(normalized);
|
|
4329
|
+
if (normalized.length === safeLength) {
|
|
4330
|
+
onComplete?.(normalized);
|
|
4331
|
+
}
|
|
4332
|
+
},
|
|
4333
|
+
[isControlled, onComplete, onValueChange, safeLength]
|
|
4334
|
+
);
|
|
4335
|
+
useImperativeHandle(
|
|
4336
|
+
forwardedRef,
|
|
4337
|
+
() => ({
|
|
4338
|
+
clear: () => {
|
|
4339
|
+
commit("");
|
|
4340
|
+
focus(0);
|
|
4341
|
+
},
|
|
4342
|
+
focus
|
|
4343
|
+
}),
|
|
4344
|
+
[commit, focus]
|
|
4345
|
+
);
|
|
4346
|
+
const handleChange = (index, input) => {
|
|
4347
|
+
const update = updateVerificationCode(currentCode, index, input, safeLength);
|
|
4348
|
+
commit(update.code);
|
|
4349
|
+
focus(update.nextFocus);
|
|
4350
|
+
};
|
|
4351
|
+
const handleKeyPress = (index, event) => {
|
|
4352
|
+
const key = event.nativeEvent.key;
|
|
4353
|
+
if (key === "Backspace" && !currentCode[index] && index > 0) {
|
|
4354
|
+
const update = updateVerificationCode(currentCode, index - 1, "", safeLength);
|
|
4355
|
+
commit(update.code);
|
|
4356
|
+
focus(index - 1);
|
|
4357
|
+
return;
|
|
4358
|
+
}
|
|
4359
|
+
if (key === "ArrowLeft" && index > 0) {
|
|
4360
|
+
focus(index - 1);
|
|
4361
|
+
}
|
|
4362
|
+
if (key === "ArrowRight" && index < safeLength - 1) {
|
|
4363
|
+
focus(index + 1);
|
|
4364
|
+
}
|
|
4365
|
+
};
|
|
4366
|
+
const mobile = viewportWidth < MOBILE_BREAKPOINT;
|
|
4367
|
+
const cellWidth = mobile ? MOBILE_CELL_WIDTH : DESKTOP_CELL_WIDTH;
|
|
4368
|
+
const cellGap = mobile ? MOBILE_GAP : DESKTOP_GAP;
|
|
4369
|
+
const rootWidth = cellWidth * safeLength + cellGap * Math.max(0, safeLength - 1);
|
|
4370
|
+
return /* @__PURE__ */ jsx(
|
|
4371
|
+
View,
|
|
4372
|
+
{
|
|
4373
|
+
...viewProps,
|
|
4374
|
+
ref: rootRef,
|
|
4375
|
+
style: [
|
|
4376
|
+
styles16.root,
|
|
4377
|
+
{ width: rootWidth, maxWidth: "100%", gap: cellGap },
|
|
4378
|
+
disabled && styles16.disabled,
|
|
4379
|
+
style
|
|
4380
|
+
],
|
|
4381
|
+
children: Array.from({ length: safeLength }, (_, index) => {
|
|
4382
|
+
const active = focusedIndex === index;
|
|
4383
|
+
const borderColor = error ? colors.redHover : active ? colors.primary : colors.grey600;
|
|
4384
|
+
return /* @__PURE__ */ jsx(
|
|
4385
|
+
TextInput,
|
|
4386
|
+
{
|
|
4387
|
+
ref: (element) => {
|
|
4388
|
+
inputRefs.current[index] = element;
|
|
4389
|
+
},
|
|
4390
|
+
accessibilityLabel: getDigitAccessibilityLabel?.(index) ?? `Verification code digit ${index + 1}`,
|
|
4391
|
+
accessibilityState: { disabled },
|
|
4392
|
+
autoComplete: index === 0 ? "one-time-code" : "off",
|
|
4393
|
+
autoFocus: autoFocus && index === 0,
|
|
4394
|
+
caretHidden: Platform.OS !== "web",
|
|
4395
|
+
editable: !disabled,
|
|
4396
|
+
inputMode: "numeric",
|
|
4397
|
+
keyboardType: "number-pad",
|
|
4398
|
+
maxLength: safeLength,
|
|
4399
|
+
onBlur: () => setFocusedIndex((current) => current === index ? null : current),
|
|
4400
|
+
onChangeText: (text) => handleChange(index, text),
|
|
4401
|
+
onFocus: () => setFocusedIndex(index),
|
|
4402
|
+
onKeyPress: (event) => handleKeyPress(index, event),
|
|
4403
|
+
onSubmitEditing: () => onSubmit?.(currentCode),
|
|
4404
|
+
selectTextOnFocus: true,
|
|
4405
|
+
style: [
|
|
4406
|
+
styles16.cell,
|
|
4407
|
+
{
|
|
4408
|
+
width: cellWidth,
|
|
4409
|
+
height: CELL_HEIGHT,
|
|
4410
|
+
borderColor,
|
|
4411
|
+
color: error ? colors.red : colors.white
|
|
4412
|
+
},
|
|
4413
|
+
Platform.OS === "web" ? styles16.cellWeb : null,
|
|
4414
|
+
Platform.OS === "android" ? styles16.cellAndroid : null,
|
|
4415
|
+
inputStyle
|
|
4416
|
+
],
|
|
4417
|
+
value: currentCode[index] ?? ""
|
|
4418
|
+
},
|
|
4419
|
+
index
|
|
4420
|
+
);
|
|
4421
|
+
})
|
|
4422
|
+
}
|
|
4423
|
+
);
|
|
4424
|
+
});
|
|
4425
|
+
var styles16 = StyleSheet.create({
|
|
4426
|
+
root: {
|
|
4427
|
+
minWidth: 0,
|
|
4428
|
+
alignSelf: "center",
|
|
4429
|
+
flexDirection: "row",
|
|
4430
|
+
justifyContent: "center"
|
|
4431
|
+
},
|
|
4432
|
+
disabled: {
|
|
4433
|
+
opacity: 0.6
|
|
4434
|
+
},
|
|
4435
|
+
cell: {
|
|
4436
|
+
minWidth: 0,
|
|
4437
|
+
flexGrow: 0,
|
|
4438
|
+
flexShrink: 0,
|
|
4439
|
+
borderWidth: 1,
|
|
4440
|
+
borderRadius: 16,
|
|
4441
|
+
padding: 0,
|
|
4442
|
+
margin: 0,
|
|
4443
|
+
textAlign: "center",
|
|
4444
|
+
fontFamily: fonts.sans,
|
|
4445
|
+
fontSize: 22,
|
|
4446
|
+
fontWeight: "600",
|
|
4447
|
+
lineHeight: 22
|
|
4448
|
+
},
|
|
4449
|
+
cellWeb: {
|
|
4450
|
+
outlineStyle: "none"
|
|
4451
|
+
},
|
|
4452
|
+
cellAndroid: {
|
|
4453
|
+
includeFontPadding: false
|
|
4454
|
+
}
|
|
4455
|
+
});
|
|
3868
4456
|
var DEFAULT_WIDTH3 = 308;
|
|
3869
4457
|
var TRIGGER_HEIGHT2 = 44;
|
|
3870
4458
|
var TRIGGER_RADIUS2 = 60;
|
|
@@ -3944,25 +4532,25 @@ function MultiValueChips({ options, disabled, onRemove }) {
|
|
|
3944
4532
|
const next = Math.ceil(event.nativeEvent.layout.width);
|
|
3945
4533
|
setEllipsisWidth((current) => current === next ? current : next);
|
|
3946
4534
|
};
|
|
3947
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
3948
|
-
/* @__PURE__ */ jsxs(View, { pointerEvents: "none", style:
|
|
4535
|
+
return /* @__PURE__ */ jsxs(View, { style: styles17.multiValueRoot, children: [
|
|
4536
|
+
/* @__PURE__ */ jsxs(View, { pointerEvents: "none", style: styles17.measureRow, children: [
|
|
3949
4537
|
options.map((option) => /* @__PURE__ */ jsxs(
|
|
3950
4538
|
View,
|
|
3951
4539
|
{
|
|
3952
|
-
style:
|
|
4540
|
+
style: styles17.chip,
|
|
3953
4541
|
onLayout: (event) => handleChipLayout(option.value, event),
|
|
3954
4542
|
children: [
|
|
3955
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
3956
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
4543
|
+
/* @__PURE__ */ jsx(Text, { style: styles17.chipLabel, numberOfLines: 1, children: option.label }),
|
|
4544
|
+
/* @__PURE__ */ jsx(Text, { style: styles17.chipRemove, children: "\xD7" })
|
|
3957
4545
|
]
|
|
3958
4546
|
},
|
|
3959
4547
|
`measure-${option.value}`
|
|
3960
4548
|
)),
|
|
3961
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
4549
|
+
/* @__PURE__ */ jsx(View, { style: styles17.ellipsis, onLayout: handleEllipsisLayout, children: /* @__PURE__ */ jsx(Text, { style: styles17.ellipsisText, children: "..." }) })
|
|
3962
4550
|
] }),
|
|
3963
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3964
|
-
visible.map((option) => /* @__PURE__ */ jsxs(View, { style:
|
|
3965
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
4551
|
+
/* @__PURE__ */ jsxs(View, { style: styles17.chipsRow, onLayout: handleContainerLayout, children: [
|
|
4552
|
+
visible.map((option) => /* @__PURE__ */ jsxs(View, { style: styles17.chip, children: [
|
|
4553
|
+
/* @__PURE__ */ jsx(Text, { style: styles17.chipLabel, numberOfLines: 1, children: option.label }),
|
|
3966
4554
|
/* @__PURE__ */ jsx(
|
|
3967
4555
|
Pressable,
|
|
3968
4556
|
{
|
|
@@ -3974,11 +4562,11 @@ function MultiValueChips({ options, disabled, onRemove }) {
|
|
|
3974
4562
|
hitSlop: 6,
|
|
3975
4563
|
accessibilityRole: "button",
|
|
3976
4564
|
accessibilityLabel: `Remove ${option.label}`,
|
|
3977
|
-
children: /* @__PURE__ */ jsx(Text, { style:
|
|
4565
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles17.chipRemove, children: "\xD7" })
|
|
3978
4566
|
}
|
|
3979
4567
|
)
|
|
3980
4568
|
] }, option.value)),
|
|
3981
|
-
hasOverflow ? /* @__PURE__ */ jsx(View, { style:
|
|
4569
|
+
hasOverflow ? /* @__PURE__ */ jsx(View, { style: styles17.ellipsis, children: /* @__PURE__ */ jsx(Text, { style: styles17.ellipsisText, children: "..." }) }) : null
|
|
3982
4570
|
] })
|
|
3983
4571
|
] });
|
|
3984
4572
|
}
|
|
@@ -4202,11 +4790,11 @@ var Select = forwardRef(
|
|
|
4202
4790
|
{
|
|
4203
4791
|
...rest,
|
|
4204
4792
|
ref: setRootRef,
|
|
4205
|
-
style: [
|
|
4793
|
+
style: [styles17.root, isOpen && styles17.rootOpen, disabled && styles17.disabled, style],
|
|
4206
4794
|
accessibilityState: { disabled, expanded: isOpen },
|
|
4207
4795
|
children: [
|
|
4208
|
-
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [
|
|
4209
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
4796
|
+
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [styles17.label, { color: labelColor }], children: label }) : null,
|
|
4797
|
+
/* @__PURE__ */ jsxs(View, { style: [styles17.triggerWrap, isOpen && styles17.triggerWrapOpen], children: [
|
|
4210
4798
|
/* @__PURE__ */ jsxs(
|
|
4211
4799
|
Pressable,
|
|
4212
4800
|
{
|
|
@@ -4217,29 +4805,29 @@ var Select = forwardRef(
|
|
|
4217
4805
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
4218
4806
|
accessibilityState: { disabled, expanded: isOpen },
|
|
4219
4807
|
style: [
|
|
4220
|
-
|
|
4808
|
+
styles17.trigger,
|
|
4221
4809
|
{
|
|
4222
4810
|
borderColor: triggerBorderColor,
|
|
4223
4811
|
backgroundColor: colors.grey700
|
|
4224
4812
|
}
|
|
4225
4813
|
],
|
|
4226
4814
|
children: [
|
|
4227
|
-
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style:
|
|
4228
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
4815
|
+
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style: styles17.iconSlot, children: leftIconNode }) : null,
|
|
4816
|
+
/* @__PURE__ */ jsx(View, { style: styles17.triggerContent, children: multiple && hasValue ? /* @__PURE__ */ jsx(
|
|
4229
4817
|
MultiValueChips,
|
|
4230
4818
|
{
|
|
4231
4819
|
options: selectedOptions,
|
|
4232
4820
|
disabled,
|
|
4233
4821
|
onRemove: handleRemoveChip
|
|
4234
4822
|
}
|
|
4235
|
-
) : /* @__PURE__ */ jsx(Text, { style: [
|
|
4236
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
4823
|
+
) : /* @__PURE__ */ jsx(Text, { style: [styles17.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: multiple ? placeholder : singleLabel }) }),
|
|
4824
|
+
/* @__PURE__ */ jsx(View, { style: [styles17.iconSlot, isOpen && styles17.chevronOpen], children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: ICON_SIZE8, color: isOpen ? colors.primary : colors.grey100 }) })
|
|
4237
4825
|
]
|
|
4238
4826
|
}
|
|
4239
4827
|
),
|
|
4240
|
-
isOpen ? /* @__PURE__ */ jsxs(View, { style:
|
|
4241
|
-
showSearch ? /* @__PURE__ */ jsxs(View, { style:
|
|
4242
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
4828
|
+
isOpen ? /* @__PURE__ */ jsxs(View, { style: styles17.menu, children: [
|
|
4829
|
+
showSearch ? /* @__PURE__ */ jsxs(View, { style: styles17.searchField, children: [
|
|
4830
|
+
/* @__PURE__ */ jsx(View, { style: styles17.iconSlot, children: /* @__PURE__ */ jsx(SearchIcon, { size: ICON_SIZE8, color: colors.grey100 }) }),
|
|
4243
4831
|
/* @__PURE__ */ jsx(
|
|
4244
4832
|
TextInput,
|
|
4245
4833
|
{
|
|
@@ -4250,9 +4838,9 @@ var Select = forwardRef(
|
|
|
4250
4838
|
placeholder: searchPlaceholder,
|
|
4251
4839
|
placeholderTextColor: colors.grey100,
|
|
4252
4840
|
style: [
|
|
4253
|
-
|
|
4254
|
-
Platform.OS === "web" ?
|
|
4255
|
-
Platform.OS === "android" ?
|
|
4841
|
+
styles17.searchInput,
|
|
4842
|
+
Platform.OS === "web" ? styles17.searchInputWeb : null,
|
|
4843
|
+
Platform.OS === "android" ? styles17.searchInputAndroid : null
|
|
4256
4844
|
],
|
|
4257
4845
|
accessibilityLabel: searchPlaceholder
|
|
4258
4846
|
}
|
|
@@ -4261,12 +4849,12 @@ var Select = forwardRef(
|
|
|
4261
4849
|
/* @__PURE__ */ jsxs(
|
|
4262
4850
|
ScrollView,
|
|
4263
4851
|
{
|
|
4264
|
-
style:
|
|
4265
|
-
contentContainerStyle:
|
|
4852
|
+
style: styles17.optionList,
|
|
4853
|
+
contentContainerStyle: styles17.optionListContent,
|
|
4266
4854
|
keyboardShouldPersistTaps: "handled",
|
|
4267
4855
|
showsVerticalScrollIndicator: false,
|
|
4268
4856
|
children: [
|
|
4269
|
-
loading ? /* @__PURE__ */ jsx(View, { style:
|
|
4857
|
+
loading ? /* @__PURE__ */ jsx(View, { style: styles17.statusRow, children: /* @__PURE__ */ jsx(Text, { style: styles17.statusText, children: "Loading..." }) }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsx(View, { style: styles17.statusRow, children: /* @__PURE__ */ jsx(Text, { style: styles17.statusText, children: emptyText }) }) : null,
|
|
4270
4858
|
!loading && filteredOptions.map((option) => {
|
|
4271
4859
|
const isSelected = selectedValues.includes(option.value);
|
|
4272
4860
|
const isHovered = hoveredValue === option.value;
|
|
@@ -4283,14 +4871,14 @@ var Select = forwardRef(
|
|
|
4283
4871
|
accessibilityRole: multiple ? "checkbox" : "button",
|
|
4284
4872
|
accessibilityState: { selected: isSelected, checked: isSelected, disabled },
|
|
4285
4873
|
style: [
|
|
4286
|
-
|
|
4874
|
+
styles17.item,
|
|
4287
4875
|
{
|
|
4288
4876
|
backgroundColor: itemBackground(visualState)
|
|
4289
4877
|
}
|
|
4290
4878
|
],
|
|
4291
4879
|
children: [
|
|
4292
|
-
multiple ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style:
|
|
4293
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
4880
|
+
multiple ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles17.itemCheckbox, children: /* @__PURE__ */ jsx(Checkbox, { value: isSelected, variant: "light" }) }) : null,
|
|
4881
|
+
/* @__PURE__ */ jsx(Text, { style: styles17.itemLabel, numberOfLines: 1, children: option.label })
|
|
4294
4882
|
]
|
|
4295
4883
|
},
|
|
4296
4884
|
option.value
|
|
@@ -4301,13 +4889,13 @@ var Select = forwardRef(
|
|
|
4301
4889
|
)
|
|
4302
4890
|
] }) : null
|
|
4303
4891
|
] }),
|
|
4304
|
-
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
4892
|
+
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [styles17.hint, { color: hintColor }], children: hint }) : null
|
|
4305
4893
|
]
|
|
4306
4894
|
}
|
|
4307
4895
|
);
|
|
4308
4896
|
}
|
|
4309
4897
|
);
|
|
4310
|
-
var
|
|
4898
|
+
var styles17 = StyleSheet.create({
|
|
4311
4899
|
root: {
|
|
4312
4900
|
width: DEFAULT_WIDTH3,
|
|
4313
4901
|
gap: 8,
|
|
@@ -4569,13 +5157,13 @@ var Textarea = forwardRef(function Textarea2({
|
|
|
4569
5157
|
const resolvedAccessibilityLabel = accessibilityLabel ?? (showLabel ? void 0 : label);
|
|
4570
5158
|
useApplyWebClassName(rootRef, className);
|
|
4571
5159
|
useApplyWebClassName(inputRef, inputClassName);
|
|
4572
|
-
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [
|
|
4573
|
-
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [
|
|
5160
|
+
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [styles18.root, disabled && styles18.disabled, style], children: [
|
|
5161
|
+
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [styles18.label, { color: chrome.labelColor }], children: label }) : null,
|
|
4574
5162
|
/* @__PURE__ */ jsx(
|
|
4575
5163
|
View,
|
|
4576
5164
|
{
|
|
4577
5165
|
style: [
|
|
4578
|
-
|
|
5166
|
+
styles18.field,
|
|
4579
5167
|
{
|
|
4580
5168
|
borderColor: chrome.borderColor,
|
|
4581
5169
|
backgroundColor: chrome.backgroundColor
|
|
@@ -4607,11 +5195,11 @@ var Textarea = forwardRef(function Textarea2({
|
|
|
4607
5195
|
onBlur?.(event);
|
|
4608
5196
|
},
|
|
4609
5197
|
style: [
|
|
4610
|
-
|
|
5198
|
+
styles18.input,
|
|
4611
5199
|
textareaTypography.field,
|
|
4612
5200
|
{ color: chrome.textColor },
|
|
4613
|
-
Platform.OS === "web" ?
|
|
4614
|
-
Platform.OS === "android" ?
|
|
5201
|
+
Platform.OS === "web" ? styles18.inputWeb : null,
|
|
5202
|
+
Platform.OS === "android" ? styles18.inputAndroid : null,
|
|
4615
5203
|
inputStyle
|
|
4616
5204
|
],
|
|
4617
5205
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
@@ -4620,10 +5208,10 @@ var Textarea = forwardRef(function Textarea2({
|
|
|
4620
5208
|
)
|
|
4621
5209
|
}
|
|
4622
5210
|
),
|
|
4623
|
-
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
5211
|
+
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [styles18.hint, { color: chrome.hintColor }], children: hint }) : null
|
|
4624
5212
|
] });
|
|
4625
5213
|
});
|
|
4626
|
-
var
|
|
5214
|
+
var styles18 = StyleSheet.create({
|
|
4627
5215
|
root: {
|
|
4628
5216
|
width: DEFAULT_WIDTH4,
|
|
4629
5217
|
gap: 8,
|
|
@@ -4663,9 +5251,9 @@ var styles15 = StyleSheet.create({
|
|
|
4663
5251
|
var TRACK_WIDTH = 44;
|
|
4664
5252
|
var TRACK_HEIGHT = 24;
|
|
4665
5253
|
var TRACK_RADIUS = 43;
|
|
4666
|
-
var
|
|
4667
|
-
var THUMB_SIZE = TRACK_HEIGHT -
|
|
4668
|
-
var THUMB_TRAVEL = TRACK_WIDTH -
|
|
5254
|
+
var TRACK_PADDING2 = 4;
|
|
5255
|
+
var THUMB_SIZE = TRACK_HEIGHT - TRACK_PADDING2 * 2;
|
|
5256
|
+
var THUMB_TRAVEL = TRACK_WIDTH - TRACK_PADDING2 * 2 - THUMB_SIZE;
|
|
4669
5257
|
var ANIMATION_DURATION2 = 300;
|
|
4670
5258
|
var Toggle = forwardRef(function Toggle2({
|
|
4671
5259
|
value,
|
|
@@ -4723,13 +5311,13 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
4723
5311
|
accessibilityRole: "switch",
|
|
4724
5312
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
4725
5313
|
accessibilityState: { checked: isActive, disabled },
|
|
4726
|
-
style: [
|
|
5314
|
+
style: [styles19.pressable, disabled && styles19.disabled, style],
|
|
4727
5315
|
children: [
|
|
4728
5316
|
/* @__PURE__ */ jsx(
|
|
4729
5317
|
Animated.View,
|
|
4730
5318
|
{
|
|
4731
5319
|
style: [
|
|
4732
|
-
|
|
5320
|
+
styles19.track,
|
|
4733
5321
|
{
|
|
4734
5322
|
backgroundColor: trackBackgroundColor
|
|
4735
5323
|
}
|
|
@@ -4738,7 +5326,7 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
4738
5326
|
Animated.View,
|
|
4739
5327
|
{
|
|
4740
5328
|
style: [
|
|
4741
|
-
|
|
5329
|
+
styles19.thumb,
|
|
4742
5330
|
{
|
|
4743
5331
|
transform: [{ translateX: thumbTranslateX }]
|
|
4744
5332
|
}
|
|
@@ -4747,12 +5335,12 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
4747
5335
|
)
|
|
4748
5336
|
}
|
|
4749
5337
|
),
|
|
4750
|
-
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
5338
|
+
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [styles19.label, labelStyle], children: labelContent }) : labelContent : null
|
|
4751
5339
|
]
|
|
4752
5340
|
}
|
|
4753
5341
|
);
|
|
4754
5342
|
});
|
|
4755
|
-
var
|
|
5343
|
+
var styles19 = StyleSheet.create({
|
|
4756
5344
|
pressable: {
|
|
4757
5345
|
flexDirection: "row",
|
|
4758
5346
|
alignItems: "center",
|
|
@@ -4766,7 +5354,7 @@ var styles16 = StyleSheet.create({
|
|
|
4766
5354
|
width: TRACK_WIDTH,
|
|
4767
5355
|
height: TRACK_HEIGHT,
|
|
4768
5356
|
borderRadius: TRACK_RADIUS,
|
|
4769
|
-
padding:
|
|
5357
|
+
padding: TRACK_PADDING2,
|
|
4770
5358
|
justifyContent: "center"
|
|
4771
5359
|
},
|
|
4772
5360
|
thumb: {
|
|
@@ -4827,21 +5415,21 @@ var RatingInput = forwardRef(
|
|
|
4827
5415
|
{
|
|
4828
5416
|
...rest,
|
|
4829
5417
|
ref: setContainerRef,
|
|
4830
|
-
style: [
|
|
5418
|
+
style: [styles20.root, disabled && styles20.disabled, style],
|
|
4831
5419
|
children: [
|
|
4832
|
-
showValue ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [
|
|
5420
|
+
showValue ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles20.value, valueStyle], children: selectedValue.toFixed(precision) }) : null,
|
|
4833
5421
|
/* @__PURE__ */ jsx(
|
|
4834
5422
|
View,
|
|
4835
5423
|
{
|
|
4836
5424
|
accessibilityRole: readOnly ? "image" : "radiogroup",
|
|
4837
5425
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
4838
5426
|
accessibilityState: { disabled },
|
|
4839
|
-
style: [
|
|
5427
|
+
style: [styles20.stars, { gap: resolvedStarGap }],
|
|
4840
5428
|
children: Array.from({ length: STAR_COUNT }, (_, index) => {
|
|
4841
5429
|
const starValue = index + 1;
|
|
4842
5430
|
const isSelected = starValue <= selectedStarCount;
|
|
4843
5431
|
const icon = isSelected ? /* @__PURE__ */ jsx(StarFilledIcon, { size: iconWidth, height: iconHeight }) : /* @__PURE__ */ jsx(StarIcon, { size: iconWidth, height: iconHeight });
|
|
4844
|
-
const itemStyle = [
|
|
5432
|
+
const itemStyle = [styles20.starItem, { width: size, height: size }];
|
|
4845
5433
|
if (readOnly) {
|
|
4846
5434
|
return /* @__PURE__ */ jsx(View, { style: itemStyle, children: icon }, starValue);
|
|
4847
5435
|
}
|
|
@@ -4867,7 +5455,7 @@ var RatingInput = forwardRef(
|
|
|
4867
5455
|
);
|
|
4868
5456
|
}
|
|
4869
5457
|
);
|
|
4870
|
-
var
|
|
5458
|
+
var styles20 = StyleSheet.create({
|
|
4871
5459
|
root: {
|
|
4872
5460
|
flexDirection: "row",
|
|
4873
5461
|
alignItems: "center",
|
|
@@ -4891,7 +5479,7 @@ var styles17 = StyleSheet.create({
|
|
|
4891
5479
|
opacity: 0.5
|
|
4892
5480
|
}
|
|
4893
5481
|
});
|
|
4894
|
-
var
|
|
5482
|
+
var CARD_WIDTH2 = 370;
|
|
4895
5483
|
var CARD_MIN_HEIGHT = 173;
|
|
4896
5484
|
var AVATAR_SIZE = 44;
|
|
4897
5485
|
var CommentCard = forwardRef(
|
|
@@ -4931,19 +5519,19 @@ var CommentCard = forwardRef(
|
|
|
4931
5519
|
setExpanded(next);
|
|
4932
5520
|
onExpandedChange?.(next);
|
|
4933
5521
|
};
|
|
4934
|
-
return /* @__PURE__ */ jsxs(View, { ...rest, ref: setContainerRef, style: [
|
|
4935
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4936
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
5522
|
+
return /* @__PURE__ */ jsxs(View, { ...rest, ref: setContainerRef, style: [styles21.root, style], children: [
|
|
5523
|
+
/* @__PURE__ */ jsxs(View, { style: styles21.header, children: [
|
|
5524
|
+
/* @__PURE__ */ jsx(View, { style: styles21.avatar, children: hasImage ? /* @__PURE__ */ jsx(
|
|
4937
5525
|
Image,
|
|
4938
5526
|
{
|
|
4939
5527
|
source: { uri: imageUrl ?? void 0 },
|
|
4940
|
-
style:
|
|
5528
|
+
style: styles21.avatarImage,
|
|
4941
5529
|
onError: () => setImageFailed(true)
|
|
4942
5530
|
}
|
|
4943
5531
|
) : /* @__PURE__ */ jsx(UserIcon, { size: 20, color: colors.primary }) }),
|
|
4944
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4945
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style:
|
|
4946
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style:
|
|
5532
|
+
/* @__PURE__ */ jsxs(View, { style: styles21.identity, children: [
|
|
5533
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles21.name, children: userName }),
|
|
5534
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles21.date, children: date })
|
|
4947
5535
|
] }),
|
|
4948
5536
|
/* @__PURE__ */ jsx(RatingInput, { value: rating, readOnly: true, showValue: false, size: 16 })
|
|
4949
5537
|
] }),
|
|
@@ -4951,7 +5539,7 @@ var CommentCard = forwardRef(
|
|
|
4951
5539
|
Text,
|
|
4952
5540
|
{
|
|
4953
5541
|
numberOfLines: expanded ? void 0 : maxCommentLines,
|
|
4954
|
-
style: [
|
|
5542
|
+
style: [styles21.comment, commentStyle],
|
|
4955
5543
|
children: commentText
|
|
4956
5544
|
}
|
|
4957
5545
|
),
|
|
@@ -4964,14 +5552,14 @@ var CommentCard = forwardRef(
|
|
|
4964
5552
|
hitSlop: 6,
|
|
4965
5553
|
onHoverIn: () => setActionHovered(true),
|
|
4966
5554
|
onHoverOut: () => setActionHovered(false),
|
|
4967
|
-
style:
|
|
5555
|
+
style: styles21.action,
|
|
4968
5556
|
children: /* @__PURE__ */ jsx(
|
|
4969
5557
|
Text,
|
|
4970
5558
|
{
|
|
4971
5559
|
style: [
|
|
4972
|
-
|
|
4973
|
-
expanded &&
|
|
4974
|
-
actionHovered && (expanded ?
|
|
5560
|
+
styles21.actionText,
|
|
5561
|
+
expanded && styles21.closeActionText,
|
|
5562
|
+
actionHovered && (expanded ? styles21.closeActionTextHovered : styles21.openActionTextHovered)
|
|
4975
5563
|
],
|
|
4976
5564
|
children: expanded ? readLessLabel : readMoreLabel
|
|
4977
5565
|
}
|
|
@@ -4981,9 +5569,9 @@ var CommentCard = forwardRef(
|
|
|
4981
5569
|
] });
|
|
4982
5570
|
}
|
|
4983
5571
|
);
|
|
4984
|
-
var
|
|
5572
|
+
var styles21 = StyleSheet.create({
|
|
4985
5573
|
root: {
|
|
4986
|
-
width:
|
|
5574
|
+
width: CARD_WIDTH2,
|
|
4987
5575
|
minHeight: CARD_MIN_HEIGHT,
|
|
4988
5576
|
padding: 16,
|
|
4989
5577
|
gap: 12,
|
|
@@ -5420,7 +6008,7 @@ var Range = forwardRef(function Range2({
|
|
|
5420
6008
|
...rest,
|
|
5421
6009
|
ref: setRootRef,
|
|
5422
6010
|
onLayout,
|
|
5423
|
-
style: [
|
|
6011
|
+
style: [styles22.root, disabled && styles22.disabled, style],
|
|
5424
6012
|
children: [
|
|
5425
6013
|
/* @__PURE__ */ jsxs(
|
|
5426
6014
|
Pressable,
|
|
@@ -5434,16 +6022,16 @@ var Range = forwardRef(function Range2({
|
|
|
5434
6022
|
updateNearestFromTrack(event.nativeEvent.offsetX);
|
|
5435
6023
|
} : void 0,
|
|
5436
6024
|
onPress: Platform.OS === "web" ? void 0 : handleTrackPress,
|
|
5437
|
-
style:
|
|
6025
|
+
style: styles22.sliderPlane,
|
|
5438
6026
|
tabIndex: -1,
|
|
5439
6027
|
children: [
|
|
5440
|
-
/* @__PURE__ */ jsx(View, { pointerEvents: "none", style:
|
|
6028
|
+
/* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles22.track }),
|
|
5441
6029
|
/* @__PURE__ */ jsx(
|
|
5442
6030
|
View,
|
|
5443
6031
|
{
|
|
5444
6032
|
pointerEvents: "none",
|
|
5445
6033
|
style: [
|
|
5446
|
-
|
|
6034
|
+
styles22.activeTrack,
|
|
5447
6035
|
{
|
|
5448
6036
|
left: TRACK_HORIZONTAL_INSET + fromOffset,
|
|
5449
6037
|
width: toOffset - fromOffset + THUMB_SIZE2
|
|
@@ -5485,9 +6073,9 @@ var Range = forwardRef(function Range2({
|
|
|
5485
6073
|
onAccessibilityAction: (event) => handleAccessibilityAction(event, effectiveFrom, updateFromInput),
|
|
5486
6074
|
pointerEvents: disabled ? "none" : "auto",
|
|
5487
6075
|
style: [
|
|
5488
|
-
|
|
5489
|
-
Platform.OS === "web" &&
|
|
5490
|
-
focusedThumb === "from" && Platform.OS === "web" &&
|
|
6076
|
+
styles22.thumb,
|
|
6077
|
+
Platform.OS === "web" && styles22.thumbWeb,
|
|
6078
|
+
focusedThumb === "from" && Platform.OS === "web" && styles22.thumbFocusedWeb,
|
|
5491
6079
|
{ left: TRACK_HORIZONTAL_INSET + fromOffset }
|
|
5492
6080
|
],
|
|
5493
6081
|
tabIndex: disabled ? -1 : 0
|
|
@@ -5527,9 +6115,9 @@ var Range = forwardRef(function Range2({
|
|
|
5527
6115
|
onAccessibilityAction: (event) => handleAccessibilityAction(event, effectiveTo, updateToInput),
|
|
5528
6116
|
pointerEvents: disabled ? "none" : "auto",
|
|
5529
6117
|
style: [
|
|
5530
|
-
|
|
5531
|
-
Platform.OS === "web" &&
|
|
5532
|
-
focusedThumb === "to" && Platform.OS === "web" &&
|
|
6118
|
+
styles22.thumb,
|
|
6119
|
+
Platform.OS === "web" && styles22.thumbWeb,
|
|
6120
|
+
focusedThumb === "to" && Platform.OS === "web" && styles22.thumbFocusedWeb,
|
|
5533
6121
|
{ left: TRACK_HORIZONTAL_INSET + toOffset }
|
|
5534
6122
|
],
|
|
5535
6123
|
tabIndex: disabled ? -1 : 0
|
|
@@ -5538,7 +6126,7 @@ var Range = forwardRef(function Range2({
|
|
|
5538
6126
|
]
|
|
5539
6127
|
}
|
|
5540
6128
|
),
|
|
5541
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
6129
|
+
/* @__PURE__ */ jsxs(View, { style: styles22.inputs, children: [
|
|
5542
6130
|
/* @__PURE__ */ jsx(
|
|
5543
6131
|
RangeInput,
|
|
5544
6132
|
{
|
|
@@ -5589,7 +6177,7 @@ function RangeInput({
|
|
|
5589
6177
|
placeholder,
|
|
5590
6178
|
value
|
|
5591
6179
|
}) {
|
|
5592
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
6180
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles22.inputField, focused && styles22.inputFieldFocused], children: [
|
|
5593
6181
|
/* @__PURE__ */ jsx(
|
|
5594
6182
|
TextInput,
|
|
5595
6183
|
{
|
|
@@ -5605,15 +6193,15 @@ function RangeInput({
|
|
|
5605
6193
|
placeholder,
|
|
5606
6194
|
placeholderTextColor: colors.grey150,
|
|
5607
6195
|
returnKeyType: "done",
|
|
5608
|
-
style: [
|
|
6196
|
+
style: [styles22.input, Platform.OS === "web" && styles22.inputWeb],
|
|
5609
6197
|
tabIndex: disabled ? -1 : void 0,
|
|
5610
6198
|
value
|
|
5611
6199
|
}
|
|
5612
6200
|
),
|
|
5613
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
6201
|
+
/* @__PURE__ */ jsx(View, { style: styles22.currencySlot, children: /* @__PURE__ */ jsx(Text, { style: styles22.currency, children: currency }) })
|
|
5614
6202
|
] });
|
|
5615
6203
|
}
|
|
5616
|
-
var
|
|
6204
|
+
var styles22 = StyleSheet.create({
|
|
5617
6205
|
root: {
|
|
5618
6206
|
width: DEFAULT_WIDTH5,
|
|
5619
6207
|
gap: 15,
|
|
@@ -5717,6 +6305,6 @@ var styles19 = StyleSheet.create({
|
|
|
5717
6305
|
}
|
|
5718
6306
|
});
|
|
5719
6307
|
|
|
5720
|
-
export { Amenity, AmenityIcon, AppleIcon, AreaExpandIcon, ArrowRightIcon, Avatar, BRAND_LOGO_COLORS, BRAND_LOGO_DEFAULT_HEIGHT, BRAND_LOGO_DEFAULT_WIDTH, Badge, BagIcon, BathroomsIcon, BedroomsIcon, BellIcon, BrandLogo, BuildingIcon, Button, CalendarIcon, CalendarOutlineIcon, CameraIcon, CardLocationIcon, CheckBadgeIcon, CheckIcon, CheckSuccessIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ClockFilledIcon, ClockIcon, CloseIcon, CommentCard, CopyIcon, Counter, DatePicker, FacebookIcon, FavoritesButton, FiltersIcon, GlobeIcon, GooglePlayIcon, GuestsIcon, HeartIcon, HelpCircleIcon, HomeIcon, Icon, Input, InstagramIcon, KeyIcon, LanguageSwitcher, LayoutGridIcon, LinkedInIcon, ListViewIcon, LocationPinIcon, LogOutIcon, MailIcon, MapCollapseIcon, MapExpandIcon, MapViewIcon, MenuIcon, MenuItem, MinusIcon, NavigateIcon, PhoneIcon, PlusIcon, QrCodeIcon, Range, RatingInput, RatingStarIcon, SaveHeartIcon, SearchIcon, SegmentedToggle, Select, SettingsIcon, ShareIcon, ShowIcon, SidebarIcon, SortIcon, StarFilledIcon, StarIcon, StatCard, Textarea, Toggle, TooltipArrowIcon, UserIcon, UsersAltIcon, VideoIcon, WhatsAppIcon, avatarTypography, badgeTypography, buttonTypography, colors, commentCardTypography, counterTypography, datePickerTypography, defaultLanguageOptions, fonts, getIconsByGroup, grey, iconGroupNames, iconGroups, iconNames, icons, inputTypography, languageSwitcherTypography, ratingTypography, segmentedToggleTypography, selectTypography, statCardTypography, textareaTypography };
|
|
6308
|
+
export { Amenity, AmenityIcon, AppleIcon, AreaExpandIcon, ArrowRightIcon, Avatar, AvatarSimple, BRAND_LOGO_COLORS, BRAND_LOGO_DEFAULT_HEIGHT, BRAND_LOGO_DEFAULT_WIDTH, Badge, BagIcon, BathroomsIcon, BedroomsIcon, BellIcon, BrandLogo, BuildingIcon, Button, CalendarIcon, CalendarOutlineIcon, CameraIcon, CardLocationIcon, CheckBadgeIcon, CheckIcon, CheckSuccessIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ClockFilledIcon, ClockIcon, CloseIcon, CommentCard, CopyIcon, Counter, DatePicker, FacebookIcon, FavoritesButton, FiltersIcon, GlobeIcon, GooglePlayIcon, GuestsIcon, HeartIcon, HelpCircleIcon, HomeIcon, Icon, Input, InstagramIcon, KeyIcon, LanguageSwitcher, LayoutGridIcon, LinkedInIcon, ListViewIcon, LocationPinIcon, LogOutIcon, MailIcon, MapCollapseIcon, MapExpandIcon, MapViewIcon, MenuIcon, MenuItem, MinusIcon, NavigateIcon, PhoneIcon, PlusIcon, QrCodeIcon, Range, RatingInput, RatingStarIcon, SaveHeartIcon, SearchIcon, SegmentedToggle, Select, SettingsIcon, ShareIcon, ShowIcon, Sidebar, SidebarIcon, SortIcon, StarFilledIcon, StarIcon, StatCard, Textarea, Toggle, TooltipArrowIcon, UserIcon, UsersAltIcon, VerificationCodeInput, VideoIcon, WhatsAppIcon, avatarTypography, badgeTypography, buttonTypography, colors, commentCardTypography, counterTypography, datePickerTypography, defaultLanguageOptions, fonts, getIconsByGroup, grey, iconGroupNames, iconGroups, iconNames, icons, inputTypography, languageSwitcherTypography, ratingTypography, segmentedToggleTypography, selectTypography, statCardTypography, textareaTypography };
|
|
5721
6309
|
//# sourceMappingURL=index.js.map
|
|
5722
6310
|
//# sourceMappingURL=index.js.map
|