@retray-dev/ui-kit 1.8.0 → 2.5.0
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/COMPONENTS.md +150 -43
- package/dist/index.d.mts +80 -44
- package/dist/index.d.ts +80 -44
- package/dist/index.js +627 -457
- package/dist/index.mjs +626 -457
- package/package.json +8 -2
- package/src/components/Accordion/Accordion.tsx +4 -6
- package/src/components/Alert/Alert.tsx +3 -3
- package/src/components/AlertBanner/AlertBanner.tsx +85 -0
- package/src/components/{Alert → AlertBanner}/index.ts +2 -2
- package/src/components/Avatar/Avatar.tsx +1 -0
- package/src/components/Badge/Badge.tsx +45 -9
- package/src/components/Button/Button.tsx +5 -5
- package/src/components/Card/Card.tsx +90 -18
- package/src/components/Checkbox/Checkbox.tsx +4 -4
- package/src/components/Chip/Chip.tsx +36 -5
- package/src/components/CurrencyInput/CurrencyInput.tsx +9 -1
- package/src/components/EmptyState/EmptyState.tsx +2 -1
- package/src/components/Input/Input.tsx +107 -26
- package/src/components/ListItem/ListItem.tsx +157 -21
- package/src/components/MonthPicker/MonthPicker.tsx +3 -6
- package/src/components/RadioGroup/RadioGroup.tsx +2 -2
- package/src/components/Select/Select.tsx +200 -132
- package/src/components/Slider/Slider.tsx +64 -100
- package/src/components/Switch/Switch.tsx +22 -20
- package/src/components/Textarea/Textarea.tsx +16 -7
- package/src/components/Toast/Toast.tsx +23 -18
- package/src/components/Toggle/Toggle.tsx +36 -49
- package/src/index.ts +3 -2
- package/src/theme/ThemeProvider.tsx +11 -8
- package/src/theme/colors.ts +19 -18
- package/src/theme/types.ts +2 -0
- package/src/components/CurrencyInputLarge/CurrencyInputLarge.tsx +0 -66
- package/src/components/CurrencyInputLarge/index.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var React23 = require('react');
|
|
4
4
|
var reactNative = require('react-native');
|
|
5
|
-
var
|
|
5
|
+
var Haptics12 = require('expo-haptics');
|
|
6
|
+
var vectorIcons = require('@expo/vector-icons');
|
|
6
7
|
var expoLinearGradient = require('expo-linear-gradient');
|
|
7
8
|
var ReanimatedAnimated = require('react-native-reanimated');
|
|
9
|
+
var RNSlider = require('@react-native-community/slider');
|
|
8
10
|
var bottomSheet = require('@gorhom/bottom-sheet');
|
|
11
|
+
var picker = require('@react-native-picker/picker');
|
|
9
12
|
var reactNativeWorklets = require('react-native-worklets');
|
|
10
13
|
var reactNativeGestureHandler = require('react-native-gesture-handler');
|
|
11
14
|
var reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
@@ -31,8 +34,9 @@ function _interopNamespace(e) {
|
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
var React23__default = /*#__PURE__*/_interopDefault(React23);
|
|
34
|
-
var
|
|
37
|
+
var Haptics12__namespace = /*#__PURE__*/_interopNamespace(Haptics12);
|
|
35
38
|
var ReanimatedAnimated__default = /*#__PURE__*/_interopDefault(ReanimatedAnimated);
|
|
39
|
+
var RNSlider__default = /*#__PURE__*/_interopDefault(RNSlider);
|
|
36
40
|
|
|
37
41
|
// src/theme/ThemeProvider.tsx
|
|
38
42
|
|
|
@@ -43,41 +47,41 @@ var defaultLight = {
|
|
|
43
47
|
card: "#ffffff",
|
|
44
48
|
cardForeground: "#171717",
|
|
45
49
|
primary: "#1a1a1a",
|
|
46
|
-
primaryForeground: "#
|
|
47
|
-
secondary: "#
|
|
48
|
-
secondaryForeground: "#
|
|
49
|
-
muted: "#
|
|
50
|
-
mutedForeground: "#
|
|
51
|
-
accent: "#
|
|
52
|
-
accentForeground: "#
|
|
50
|
+
primaryForeground: "#ffffff",
|
|
51
|
+
secondary: "#f1f1f1",
|
|
52
|
+
secondaryForeground: "#171717",
|
|
53
|
+
muted: "#f1f1f1",
|
|
54
|
+
mutedForeground: "#a2a2a2",
|
|
55
|
+
accent: "#e4e4e4",
|
|
56
|
+
accentForeground: "#171717",
|
|
53
57
|
destructive: "#ef4444",
|
|
54
|
-
destructiveForeground: "#
|
|
58
|
+
destructiveForeground: "#1a1a1a",
|
|
55
59
|
border: "#e5e5e5",
|
|
56
60
|
input: "#e5e5e5",
|
|
57
|
-
ring: "#
|
|
61
|
+
ring: "#1a1a1a",
|
|
58
62
|
success: "#16a34a",
|
|
59
|
-
successForeground: "#
|
|
63
|
+
successForeground: "#1a1a1a"
|
|
60
64
|
};
|
|
61
65
|
var defaultDark = {
|
|
62
66
|
background: "#171717",
|
|
63
67
|
foreground: "#fafafa",
|
|
64
|
-
card: "#
|
|
68
|
+
card: "#222222",
|
|
65
69
|
cardForeground: "#fafafa",
|
|
66
70
|
primary: "#fafafa",
|
|
67
71
|
primaryForeground: "#1a1a1a",
|
|
68
|
-
secondary: "#
|
|
72
|
+
secondary: "#323232",
|
|
69
73
|
secondaryForeground: "#fafafa",
|
|
70
|
-
muted: "#
|
|
71
|
-
mutedForeground: "#
|
|
72
|
-
accent: "#
|
|
74
|
+
muted: "#323232",
|
|
75
|
+
mutedForeground: "#888888",
|
|
76
|
+
accent: "#323232",
|
|
73
77
|
accentForeground: "#fafafa",
|
|
74
78
|
destructive: "#dc2626",
|
|
75
|
-
destructiveForeground: "#
|
|
79
|
+
destructiveForeground: "#1a1a1a",
|
|
76
80
|
border: "#2a2a2a",
|
|
77
81
|
input: "#2a2a2a",
|
|
78
|
-
ring: "#
|
|
82
|
+
ring: "#fafafa",
|
|
79
83
|
success: "#22c55e",
|
|
80
|
-
successForeground: "#
|
|
84
|
+
successForeground: "#1a1a1a"
|
|
81
85
|
};
|
|
82
86
|
|
|
83
87
|
// src/theme/ThemeProvider.tsx
|
|
@@ -90,19 +94,23 @@ function ThemeProvider({ children, theme, colorScheme = "system" }) {
|
|
|
90
94
|
const resolvedScheme = colorScheme === "system" ? systemScheme : colorScheme;
|
|
91
95
|
const colors = React23.useMemo(() => {
|
|
92
96
|
const base = resolvedScheme === "dark" ? defaultDark : defaultLight;
|
|
93
|
-
const
|
|
94
|
-
return { ...base, ...
|
|
97
|
+
const override = resolvedScheme === "dark" ? theme?.dark : theme?.light;
|
|
98
|
+
return override ? { ...base, ...override } : base;
|
|
95
99
|
}, [resolvedScheme, theme]);
|
|
96
100
|
return /* @__PURE__ */ React23__default.default.createElement(ThemeContext.Provider, { value: { colors, colorScheme: resolvedScheme } }, children);
|
|
97
101
|
}
|
|
98
102
|
function useTheme() {
|
|
99
|
-
|
|
103
|
+
const context = React23.useContext(ThemeContext);
|
|
104
|
+
if (!context) {
|
|
105
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
106
|
+
}
|
|
107
|
+
return context;
|
|
100
108
|
}
|
|
101
109
|
var nativeDriver = reactNative.Platform.OS !== "web";
|
|
102
110
|
var containerSizeStyles = {
|
|
103
|
-
sm: { paddingHorizontal: 20, paddingVertical:
|
|
104
|
-
md: { paddingHorizontal: 24, paddingVertical:
|
|
105
|
-
lg: { paddingHorizontal: 32, paddingVertical:
|
|
111
|
+
sm: { paddingHorizontal: 20, paddingVertical: 10 },
|
|
112
|
+
md: { paddingHorizontal: 24, paddingVertical: 14 },
|
|
113
|
+
lg: { paddingHorizontal: 32, paddingVertical: 18 }
|
|
106
114
|
};
|
|
107
115
|
var labelSizeStyles = {
|
|
108
116
|
sm: { fontSize: 15 },
|
|
@@ -138,7 +146,7 @@ function Button({
|
|
|
138
146
|
reactNative.Animated.spring(scale, { toValue: 1, useNativeDriver: nativeDriver, speed: 40, bounciness: 4 }).start();
|
|
139
147
|
};
|
|
140
148
|
const handlePress = (e) => {
|
|
141
|
-
|
|
149
|
+
Haptics12__namespace.impactAsync(Haptics12__namespace.ImpactFeedbackStyle.Light);
|
|
142
150
|
onPress?.(e);
|
|
143
151
|
};
|
|
144
152
|
const containerVariantStyle = {
|
|
@@ -189,13 +197,13 @@ var styles = reactNative.StyleSheet.create({
|
|
|
189
197
|
width: "100%"
|
|
190
198
|
},
|
|
191
199
|
disabled: {
|
|
192
|
-
opacity: 0.
|
|
200
|
+
opacity: 0.5
|
|
193
201
|
},
|
|
194
202
|
label: {
|
|
195
203
|
fontWeight: "600"
|
|
196
204
|
},
|
|
197
205
|
labelWithIcon: {
|
|
198
|
-
marginHorizontal:
|
|
206
|
+
marginHorizontal: 8
|
|
199
207
|
}
|
|
200
208
|
});
|
|
201
209
|
var variantStyles = {
|
|
@@ -219,56 +227,112 @@ function Text2({ variant = "body", color, style, children, ...props }) {
|
|
|
219
227
|
children
|
|
220
228
|
);
|
|
221
229
|
}
|
|
222
|
-
|
|
230
|
+
var webInputResetStyle = reactNative.Platform.OS === "web" ? { outlineStyle: "none", outlineWidth: 0, outlineColor: "transparent", boxShadow: "none" } : {};
|
|
231
|
+
function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, type = "text", containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }) {
|
|
223
232
|
const { colors } = useTheme();
|
|
224
233
|
const [focused, setFocused] = React23.useState(false);
|
|
234
|
+
const [showPassword, setShowPassword] = React23.useState(false);
|
|
235
|
+
const isPassword = type === "password";
|
|
236
|
+
const effectiveSecure = isPassword ? !showPassword : secureTextEntry;
|
|
237
|
+
const effectiveSuffix = isPassword && !suffix ? /* @__PURE__ */ React23__default.default.createElement(reactNative.TouchableOpacity, { onPress: () => setShowPassword(!showPassword), style: styles2.passwordToggle, activeOpacity: 0.6 }, /* @__PURE__ */ React23__default.default.createElement(vectorIcons.AntDesign, { name: showPassword ? "eye" : "eye-invisible", size: 20, color: colors.mutedForeground })) : suffix;
|
|
225
238
|
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles2.container, containerStyle] }, label ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles2.label, { color: colors.foreground }], allowFontScaling: true }, label) : null, /* @__PURE__ */ React23__default.default.createElement(
|
|
226
|
-
reactNative.
|
|
239
|
+
reactNative.View,
|
|
227
240
|
{
|
|
228
241
|
style: [
|
|
229
|
-
styles2.
|
|
242
|
+
styles2.inputWrapper,
|
|
230
243
|
{
|
|
231
|
-
borderColor: error ? colors.destructive : focused ? colors.ring : colors.border,
|
|
232
|
-
color: colors.foreground,
|
|
244
|
+
borderColor: error ? colors.destructive : focused ? colors.ring ?? colors.primary : colors.border,
|
|
233
245
|
backgroundColor: colors.background
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
prefix ? typeof prefix === "string" ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles2.prefixText, { color: colors.mutedForeground }, prefixStyle], allowFontScaling: true }, prefix) : /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles2.prefixContainer }, prefix) : null,
|
|
250
|
+
/* @__PURE__ */ React23__default.default.createElement(
|
|
251
|
+
reactNative.TextInput,
|
|
252
|
+
{
|
|
253
|
+
style: [
|
|
254
|
+
styles2.input,
|
|
255
|
+
{
|
|
256
|
+
color: colors.foreground
|
|
257
|
+
},
|
|
258
|
+
webInputResetStyle,
|
|
259
|
+
style
|
|
260
|
+
],
|
|
261
|
+
onFocus: (e) => {
|
|
262
|
+
setFocused(true);
|
|
263
|
+
onFocus?.(e);
|
|
234
264
|
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
allowFontScaling: true,
|
|
247
|
-
...props
|
|
248
|
-
}
|
|
265
|
+
onBlur: (e) => {
|
|
266
|
+
setFocused(false);
|
|
267
|
+
onBlur?.(e);
|
|
268
|
+
},
|
|
269
|
+
placeholderTextColor: colors.mutedForeground,
|
|
270
|
+
allowFontScaling: true,
|
|
271
|
+
secureTextEntry: effectiveSecure,
|
|
272
|
+
...props
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
effectiveSuffix ? typeof effectiveSuffix === "string" ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles2.suffixText, { color: colors.mutedForeground }, suffixStyle], allowFontScaling: true }, effectiveSuffix) : /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles2.suffixContainer }, effectiveSuffix) : null
|
|
249
276
|
), error ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles2.helperText, { color: colors.destructive }], allowFontScaling: true }, error) : null, !error && hint ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles2.helperText, { color: colors.mutedForeground }], allowFontScaling: true }, hint) : null);
|
|
250
277
|
}
|
|
251
278
|
var styles2 = reactNative.StyleSheet.create({
|
|
252
279
|
container: {
|
|
253
|
-
gap:
|
|
280
|
+
gap: 8
|
|
254
281
|
},
|
|
255
282
|
label: {
|
|
256
283
|
fontSize: 15,
|
|
257
|
-
fontWeight: "500"
|
|
258
|
-
marginBottom: 6
|
|
284
|
+
fontWeight: "500"
|
|
259
285
|
},
|
|
260
|
-
|
|
286
|
+
inputWrapper: {
|
|
287
|
+
flexDirection: "row",
|
|
288
|
+
alignItems: "center",
|
|
261
289
|
borderWidth: 1.5,
|
|
262
|
-
borderRadius:
|
|
263
|
-
paddingHorizontal:
|
|
264
|
-
paddingVertical:
|
|
265
|
-
|
|
290
|
+
borderRadius: 8,
|
|
291
|
+
paddingHorizontal: 16,
|
|
292
|
+
paddingVertical: 14
|
|
293
|
+
},
|
|
294
|
+
input: {
|
|
295
|
+
flex: 1,
|
|
296
|
+
fontSize: 17,
|
|
297
|
+
paddingVertical: 0
|
|
298
|
+
},
|
|
299
|
+
prefixContainer: {
|
|
300
|
+
marginRight: 8
|
|
301
|
+
},
|
|
302
|
+
prefixText: {
|
|
303
|
+
fontSize: 17,
|
|
304
|
+
marginRight: 8
|
|
305
|
+
},
|
|
306
|
+
suffixContainer: {
|
|
307
|
+
marginLeft: 8
|
|
308
|
+
},
|
|
309
|
+
suffixText: {
|
|
310
|
+
fontSize: 17,
|
|
311
|
+
marginLeft: 8
|
|
312
|
+
},
|
|
313
|
+
passwordToggle: {
|
|
314
|
+
padding: 4
|
|
266
315
|
},
|
|
267
316
|
helperText: {
|
|
268
317
|
fontSize: 13
|
|
269
318
|
}
|
|
270
319
|
});
|
|
271
|
-
|
|
320
|
+
var sizePadding = {
|
|
321
|
+
sm: { paddingHorizontal: 8, paddingVertical: 2 },
|
|
322
|
+
md: { paddingHorizontal: 10, paddingVertical: 4 },
|
|
323
|
+
lg: { paddingHorizontal: 12, paddingVertical: 6 }
|
|
324
|
+
};
|
|
325
|
+
var sizeFontSize = {
|
|
326
|
+
sm: { fontSize: 11 },
|
|
327
|
+
md: { fontSize: 13 },
|
|
328
|
+
lg: { fontSize: 15 }
|
|
329
|
+
};
|
|
330
|
+
var sizeIconGap = {
|
|
331
|
+
sm: 4,
|
|
332
|
+
md: 6,
|
|
333
|
+
lg: 6
|
|
334
|
+
};
|
|
335
|
+
function Badge({ label, children, variant = "default", size = "md", icon, style }) {
|
|
272
336
|
const { colors } = useTheme();
|
|
273
337
|
const containerStyle = {
|
|
274
338
|
default: { backgroundColor: colors.primary },
|
|
@@ -282,40 +346,100 @@ function Badge({ label, variant = "default", style }) {
|
|
|
282
346
|
destructive: colors.destructiveForeground,
|
|
283
347
|
outline: colors.foreground
|
|
284
348
|
}[variant];
|
|
285
|
-
|
|
349
|
+
const content = children ?? label;
|
|
350
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles3.container, containerStyle, sizePadding[size], { gap: sizeIconGap[size] }, style] }, icon ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles3.iconContainer }, icon) : null, typeof content === "string" ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles3.label, { color: textColor }, sizeFontSize[size]], allowFontScaling: true }, content) : content);
|
|
286
351
|
}
|
|
287
352
|
var styles3 = reactNative.StyleSheet.create({
|
|
288
353
|
container: {
|
|
289
|
-
borderRadius:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
354
|
+
borderRadius: 6,
|
|
355
|
+
alignSelf: "flex-start",
|
|
356
|
+
flexDirection: "row",
|
|
357
|
+
alignItems: "center"
|
|
358
|
+
},
|
|
359
|
+
iconContainer: {
|
|
360
|
+
justifyContent: "center",
|
|
361
|
+
alignItems: "center"
|
|
293
362
|
},
|
|
294
363
|
label: {
|
|
295
|
-
fontSize: 13,
|
|
296
364
|
fontWeight: "500"
|
|
297
365
|
}
|
|
298
366
|
});
|
|
299
|
-
|
|
367
|
+
var nativeDriver2 = reactNative.Platform.OS !== "web";
|
|
368
|
+
function Card({ children, variant = "elevated", onPress, style }) {
|
|
300
369
|
const { colors } = useTheme();
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
370
|
+
const scale = React23.useRef(new reactNative.Animated.Value(1)).current;
|
|
371
|
+
const handlePressIn = () => {
|
|
372
|
+
if (!onPress) return;
|
|
373
|
+
reactNative.Animated.spring(scale, {
|
|
374
|
+
toValue: 0.98,
|
|
375
|
+
useNativeDriver: nativeDriver2,
|
|
376
|
+
speed: 40,
|
|
377
|
+
bounciness: 0
|
|
378
|
+
}).start();
|
|
379
|
+
};
|
|
380
|
+
const handlePressOut = () => {
|
|
381
|
+
if (!onPress) return;
|
|
382
|
+
reactNative.Animated.spring(scale, {
|
|
383
|
+
toValue: 1,
|
|
384
|
+
useNativeDriver: nativeDriver2,
|
|
385
|
+
speed: 40,
|
|
386
|
+
bounciness: 4
|
|
387
|
+
}).start();
|
|
388
|
+
};
|
|
389
|
+
const handlePress = () => {
|
|
390
|
+
if (!onPress) return;
|
|
391
|
+
Haptics12__namespace.impactAsync(Haptics12__namespace.ImpactFeedbackStyle.Light);
|
|
392
|
+
onPress();
|
|
393
|
+
};
|
|
394
|
+
const variantStyle = {
|
|
395
|
+
elevated: {
|
|
396
|
+
backgroundColor: colors.card,
|
|
397
|
+
borderColor: colors.border,
|
|
398
|
+
shadowColor: "#000",
|
|
399
|
+
shadowOffset: { width: 0, height: 4 },
|
|
400
|
+
shadowOpacity: 0.06,
|
|
401
|
+
shadowRadius: 12,
|
|
402
|
+
elevation: 3
|
|
305
403
|
},
|
|
306
|
-
|
|
307
|
-
|
|
404
|
+
outlined: {
|
|
405
|
+
backgroundColor: colors.card,
|
|
406
|
+
borderColor: colors.border,
|
|
407
|
+
shadowOpacity: 0,
|
|
408
|
+
elevation: 0
|
|
409
|
+
},
|
|
410
|
+
filled: {
|
|
411
|
+
backgroundColor: colors.accent,
|
|
412
|
+
borderColor: colors.border,
|
|
413
|
+
shadowOpacity: 0,
|
|
414
|
+
elevation: 0
|
|
415
|
+
}
|
|
416
|
+
}[variant];
|
|
417
|
+
const cardContent = /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles4.card, variantStyle, style] }, children);
|
|
418
|
+
if (onPress) {
|
|
419
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23__default.default.createElement(
|
|
420
|
+
reactNative.TouchableOpacity,
|
|
421
|
+
{
|
|
422
|
+
onPress: handlePress,
|
|
423
|
+
onPressIn: handlePressIn,
|
|
424
|
+
onPressOut: handlePressOut,
|
|
425
|
+
activeOpacity: 1,
|
|
426
|
+
touchSoundDisabled: true
|
|
427
|
+
},
|
|
428
|
+
cardContent
|
|
429
|
+
));
|
|
430
|
+
}
|
|
431
|
+
return cardContent;
|
|
308
432
|
}
|
|
309
433
|
function CardHeader({ children, style }) {
|
|
310
434
|
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles4.header, style] }, children);
|
|
311
435
|
}
|
|
312
436
|
function CardTitle({ children, style }) {
|
|
313
437
|
const { colors } = useTheme();
|
|
314
|
-
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles4.title, { color: colors.cardForeground }, style] }, children);
|
|
438
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles4.title, { color: colors.cardForeground }, style], allowFontScaling: true }, children);
|
|
315
439
|
}
|
|
316
440
|
function CardDescription({ children, style }) {
|
|
317
441
|
const { colors } = useTheme();
|
|
318
|
-
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles4.description, { color: colors.mutedForeground }, style] }, children);
|
|
442
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles4.description, { color: colors.mutedForeground }, style], allowFontScaling: true }, children);
|
|
319
443
|
}
|
|
320
444
|
function CardContent({ children, style }) {
|
|
321
445
|
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles4.content, style] }, children);
|
|
@@ -325,16 +449,11 @@ function CardFooter({ children, style }) {
|
|
|
325
449
|
}
|
|
326
450
|
var styles4 = reactNative.StyleSheet.create({
|
|
327
451
|
card: {
|
|
328
|
-
borderRadius:
|
|
329
|
-
borderWidth: 1
|
|
330
|
-
shadowColor: "#000",
|
|
331
|
-
shadowOffset: { width: 0, height: 1 },
|
|
332
|
-
shadowOpacity: 0.05,
|
|
333
|
-
shadowRadius: 2,
|
|
334
|
-
elevation: 1
|
|
452
|
+
borderRadius: 12,
|
|
453
|
+
borderWidth: 1
|
|
335
454
|
},
|
|
336
455
|
header: {
|
|
337
|
-
padding:
|
|
456
|
+
padding: 24,
|
|
338
457
|
paddingBottom: 0,
|
|
339
458
|
gap: 8
|
|
340
459
|
},
|
|
@@ -348,10 +467,10 @@ var styles4 = reactNative.StyleSheet.create({
|
|
|
348
467
|
lineHeight: 22
|
|
349
468
|
},
|
|
350
469
|
content: {
|
|
351
|
-
padding:
|
|
470
|
+
padding: 24
|
|
352
471
|
},
|
|
353
472
|
footer: {
|
|
354
|
-
padding:
|
|
473
|
+
padding: 24,
|
|
355
474
|
paddingTop: 0,
|
|
356
475
|
flexDirection: "row",
|
|
357
476
|
alignItems: "center"
|
|
@@ -469,7 +588,8 @@ function Avatar({ src, fallback, size = "md", style }) {
|
|
|
469
588
|
) : /* @__PURE__ */ React23__default.default.createElement(
|
|
470
589
|
reactNative.Text,
|
|
471
590
|
{
|
|
472
|
-
style: [styles7.fallback, { color: colors.mutedForeground, fontSize: fontSizeMap[size] }]
|
|
591
|
+
style: [styles7.fallback, { color: colors.mutedForeground, fontSize: fontSizeMap[size] }],
|
|
592
|
+
allowFontScaling: true
|
|
473
593
|
},
|
|
474
594
|
fallback?.slice(0, 2).toUpperCase() ?? "?"
|
|
475
595
|
));
|
|
@@ -488,19 +608,24 @@ function AlertBanner({ title, description, variant = "default", icon, style }) {
|
|
|
488
608
|
const borderColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : colors.border;
|
|
489
609
|
const titleColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : colors.foreground;
|
|
490
610
|
const descColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : colors.mutedForeground;
|
|
491
|
-
const defaultIcon = variant === "
|
|
492
|
-
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles8.container, { backgroundColor: colors.card, borderColor }, style] },
|
|
611
|
+
const defaultIcon = variant === "success" ? /* @__PURE__ */ React23__default.default.createElement(vectorIcons.FontAwesome5, { name: "check-circle", size: 18, color: titleColor }) : variant === "destructive" ? /* @__PURE__ */ React23__default.default.createElement(vectorIcons.MaterialIcons, { name: "error-outline", size: 20, color: titleColor }) : /* @__PURE__ */ React23__default.default.createElement(vectorIcons.Entypo, { name: "info-with-circle", size: 18, color: titleColor });
|
|
612
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles8.container, { backgroundColor: colors.card, borderColor }, style] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles8.icon }, icon ?? defaultIcon), /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles8.content }, title ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles8.title, { color: titleColor }], allowFontScaling: true }, title) : null, description ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles8.description, { color: descColor }], allowFontScaling: true }, description) : null));
|
|
493
613
|
}
|
|
494
614
|
var styles8 = reactNative.StyleSheet.create({
|
|
495
615
|
container: {
|
|
496
616
|
flexDirection: "row",
|
|
497
617
|
borderWidth: 1,
|
|
498
|
-
borderRadius:
|
|
618
|
+
borderRadius: 12,
|
|
499
619
|
padding: 16,
|
|
500
|
-
gap: 12
|
|
620
|
+
gap: 12,
|
|
621
|
+
shadowColor: "#000",
|
|
622
|
+
shadowOffset: { width: 0, height: 4 },
|
|
623
|
+
shadowOpacity: 0.06,
|
|
624
|
+
shadowRadius: 12,
|
|
625
|
+
elevation: 3
|
|
501
626
|
},
|
|
502
627
|
icon: {
|
|
503
|
-
marginTop:
|
|
628
|
+
marginTop: 0
|
|
504
629
|
},
|
|
505
630
|
content: {
|
|
506
631
|
flex: 1,
|
|
@@ -514,10 +639,6 @@ var styles8 = reactNative.StyleSheet.create({
|
|
|
514
639
|
description: {
|
|
515
640
|
fontSize: 14,
|
|
516
641
|
lineHeight: 20
|
|
517
|
-
},
|
|
518
|
-
defaultIcon: {
|
|
519
|
-
fontSize: 18,
|
|
520
|
-
fontWeight: "700"
|
|
521
642
|
}
|
|
522
643
|
});
|
|
523
644
|
function Progress({ value = 0, max = 100, style }) {
|
|
@@ -587,10 +708,11 @@ function EmptyState({ icon, title, description, action, size = "default", style
|
|
|
587
708
|
/* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles10.textWrapper }, /* @__PURE__ */ React23__default.default.createElement(
|
|
588
709
|
reactNative.Text,
|
|
589
710
|
{
|
|
590
|
-
style: [styles10.title, isCompact && styles10.titleCompact, { color: colors.foreground }]
|
|
711
|
+
style: [styles10.title, isCompact && styles10.titleCompact, { color: colors.foreground }],
|
|
712
|
+
allowFontScaling: true
|
|
591
713
|
},
|
|
592
714
|
title
|
|
593
|
-
), description && !isCompact ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles10.description, { color: colors.mutedForeground }] }, description) : null),
|
|
715
|
+
), description && !isCompact ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles10.description, { color: colors.mutedForeground }], allowFontScaling: true }, description) : null),
|
|
594
716
|
action && !isCompact ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles10.action }, action) : null
|
|
595
717
|
);
|
|
596
718
|
}
|
|
@@ -642,6 +764,7 @@ var styles10 = reactNative.StyleSheet.create({
|
|
|
642
764
|
marginTop: 8
|
|
643
765
|
}
|
|
644
766
|
});
|
|
767
|
+
var webInputResetStyle2 = reactNative.Platform.OS === "web" ? { outlineStyle: "none", outlineWidth: 0, outlineColor: "transparent", boxShadow: "none" } : {};
|
|
645
768
|
function Textarea({
|
|
646
769
|
label,
|
|
647
770
|
error,
|
|
@@ -664,11 +787,12 @@ function Textarea({
|
|
|
664
787
|
style: [
|
|
665
788
|
styles11.input,
|
|
666
789
|
{
|
|
667
|
-
borderColor: error ? colors.destructive : focused ? colors.ring : colors.border,
|
|
790
|
+
borderColor: error ? colors.destructive : focused ? colors.ring ?? colors.primary : colors.border,
|
|
668
791
|
color: colors.foreground,
|
|
669
792
|
backgroundColor: colors.background,
|
|
670
793
|
minHeight: rows * 30
|
|
671
794
|
},
|
|
795
|
+
webInputResetStyle2,
|
|
672
796
|
style
|
|
673
797
|
],
|
|
674
798
|
onFocus: (e) => {
|
|
@@ -687,18 +811,17 @@ function Textarea({
|
|
|
687
811
|
}
|
|
688
812
|
var styles11 = reactNative.StyleSheet.create({
|
|
689
813
|
container: {
|
|
690
|
-
gap:
|
|
814
|
+
gap: 8
|
|
691
815
|
},
|
|
692
816
|
label: {
|
|
693
817
|
fontSize: 15,
|
|
694
|
-
fontWeight: "500"
|
|
695
|
-
marginBottom: 6
|
|
818
|
+
fontWeight: "500"
|
|
696
819
|
},
|
|
697
820
|
input: {
|
|
698
821
|
borderWidth: 1.5,
|
|
699
|
-
borderRadius:
|
|
700
|
-
paddingHorizontal:
|
|
701
|
-
paddingVertical:
|
|
822
|
+
borderRadius: 8,
|
|
823
|
+
paddingHorizontal: 16,
|
|
824
|
+
paddingVertical: 14,
|
|
702
825
|
fontSize: 17
|
|
703
826
|
},
|
|
704
827
|
helperText: {
|
|
@@ -726,7 +849,7 @@ function Checkbox({
|
|
|
726
849
|
{
|
|
727
850
|
style: [styles12.row, style],
|
|
728
851
|
onPress: () => {
|
|
729
|
-
|
|
852
|
+
Haptics12__namespace.selectionAsync();
|
|
730
853
|
onCheckedChange?.(!checked);
|
|
731
854
|
},
|
|
732
855
|
onPressIn: handlePressIn,
|
|
@@ -765,16 +888,16 @@ var styles12 = reactNative.StyleSheet.create({
|
|
|
765
888
|
gap: 12
|
|
766
889
|
},
|
|
767
890
|
box: {
|
|
768
|
-
width:
|
|
769
|
-
height:
|
|
891
|
+
width: 24,
|
|
892
|
+
height: 24,
|
|
770
893
|
borderRadius: 8,
|
|
771
894
|
borderWidth: 1.5,
|
|
772
895
|
alignItems: "center",
|
|
773
896
|
justifyContent: "center"
|
|
774
897
|
},
|
|
775
898
|
checkmark: {
|
|
776
|
-
width:
|
|
777
|
-
height:
|
|
899
|
+
width: 12,
|
|
900
|
+
height: 7,
|
|
778
901
|
borderLeftWidth: 2,
|
|
779
902
|
borderBottomWidth: 2,
|
|
780
903
|
transform: [{ rotate: "-45deg" }, { translateY: -1 }]
|
|
@@ -784,7 +907,7 @@ var styles12 = reactNative.StyleSheet.create({
|
|
|
784
907
|
lineHeight: 22
|
|
785
908
|
}
|
|
786
909
|
});
|
|
787
|
-
var
|
|
910
|
+
var nativeDriver3 = reactNative.Platform.OS !== "web";
|
|
788
911
|
var TRACK_WIDTH = 60;
|
|
789
912
|
var TRACK_HEIGHT = 36;
|
|
790
913
|
var THUMB_SIZE = 28;
|
|
@@ -798,7 +921,7 @@ function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
|
798
921
|
reactNative.Animated.parallel([
|
|
799
922
|
reactNative.Animated.spring(translateX, {
|
|
800
923
|
toValue: checked ? THUMB_TRAVEL : 0,
|
|
801
|
-
useNativeDriver:
|
|
924
|
+
useNativeDriver: nativeDriver3,
|
|
802
925
|
bounciness: 4
|
|
803
926
|
}),
|
|
804
927
|
reactNative.Animated.timing(trackOpacity, {
|
|
@@ -812,17 +935,17 @@ function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
|
812
935
|
inputRange: [0, 1],
|
|
813
936
|
outputRange: [colors.muted, colors.primary]
|
|
814
937
|
});
|
|
815
|
-
return /* @__PURE__ */ React23__default.default.createElement(
|
|
938
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [{ opacity: disabled ? 0.45 : 1 }, style] }, /* @__PURE__ */ React23__default.default.createElement(
|
|
816
939
|
reactNative.TouchableOpacity,
|
|
817
940
|
{
|
|
818
941
|
onPress: () => {
|
|
819
|
-
|
|
942
|
+
Haptics12__namespace.selectionAsync();
|
|
820
943
|
onCheckedChange?.(!checked);
|
|
821
944
|
},
|
|
822
945
|
disabled,
|
|
823
946
|
activeOpacity: 0.8,
|
|
824
947
|
touchSoundDisabled: true,
|
|
825
|
-
style:
|
|
948
|
+
style: styles13.wrapper
|
|
826
949
|
},
|
|
827
950
|
/* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: [styles13.track, { backgroundColor: trackColor }] }, /* @__PURE__ */ React23__default.default.createElement(
|
|
828
951
|
reactNative.Animated.View,
|
|
@@ -833,7 +956,7 @@ function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
|
833
956
|
]
|
|
834
957
|
}
|
|
835
958
|
))
|
|
836
|
-
);
|
|
959
|
+
));
|
|
837
960
|
}
|
|
838
961
|
var styles13 = reactNative.StyleSheet.create({
|
|
839
962
|
wrapper: {},
|
|
@@ -911,53 +1034,51 @@ function Toggle({
|
|
|
911
1034
|
if (typeof prop === "function") return prop(pressed);
|
|
912
1035
|
return prop;
|
|
913
1036
|
};
|
|
914
|
-
if (
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
1037
|
+
if (pressed) {
|
|
1038
|
+
const active = renderProp(activeIcon);
|
|
1039
|
+
if (active) return /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, active);
|
|
1040
|
+
return /* @__PURE__ */ React23__default.default.createElement(vectorIcons.FontAwesome5, { name: "check-circle", size: 20, color: colors.primary });
|
|
1041
|
+
}
|
|
1042
|
+
const custom = renderProp(icon);
|
|
1043
|
+
if (custom) return /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, custom);
|
|
1044
|
+
return /* @__PURE__ */ React23__default.default.createElement(vectorIcons.FontAwesome5, { name: "circle", size: 20, color: colors.mutedForeground });
|
|
918
1045
|
};
|
|
919
|
-
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23__default.default.createElement(
|
|
920
|
-
reactNative.
|
|
1046
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: [{ transform: [{ scale }] }, disabled && styles14.disabled, style] }, /* @__PURE__ */ React23__default.default.createElement(
|
|
1047
|
+
reactNative.TouchableOpacity,
|
|
921
1048
|
{
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
1049
|
+
onPress: () => {
|
|
1050
|
+
Haptics12__namespace.selectionAsync();
|
|
1051
|
+
onPressedChange?.(!pressed);
|
|
1052
|
+
},
|
|
1053
|
+
onPressIn: handlePressIn,
|
|
1054
|
+
onPressOut: handlePressOut,
|
|
1055
|
+
disabled,
|
|
1056
|
+
activeOpacity: 1,
|
|
1057
|
+
touchSoundDisabled: true,
|
|
1058
|
+
...props
|
|
929
1059
|
},
|
|
930
1060
|
/* @__PURE__ */ React23__default.default.createElement(
|
|
931
|
-
reactNative.
|
|
1061
|
+
reactNative.Animated.View,
|
|
932
1062
|
{
|
|
933
|
-
style:
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
onPressIn: handlePressIn,
|
|
939
|
-
onPressOut: handlePressOut,
|
|
940
|
-
disabled,
|
|
941
|
-
activeOpacity: 1,
|
|
942
|
-
touchSoundDisabled: true,
|
|
943
|
-
...props
|
|
1063
|
+
style: [
|
|
1064
|
+
styles14.base,
|
|
1065
|
+
sizeStyles[size],
|
|
1066
|
+
{ borderColor, backgroundColor, borderWidth: 2 }
|
|
1067
|
+
]
|
|
944
1068
|
},
|
|
945
|
-
/* @__PURE__ */ React23__default.default.createElement(LeftIcon, null),
|
|
946
|
-
label ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.Text, { style: [styles14.label, { color: textColor }] }, label) : null
|
|
1069
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles14.inner }, /* @__PURE__ */ React23__default.default.createElement(LeftIcon, null), label ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.Text, { style: [styles14.label, { color: textColor }] }, label) : null)
|
|
947
1070
|
)
|
|
948
1071
|
));
|
|
949
1072
|
}
|
|
950
1073
|
var styles14 = reactNative.StyleSheet.create({
|
|
951
1074
|
base: {
|
|
952
|
-
borderRadius: 8
|
|
953
|
-
overflow: "hidden"
|
|
1075
|
+
borderRadius: 8
|
|
954
1076
|
},
|
|
955
|
-
|
|
1077
|
+
inner: {
|
|
956
1078
|
flexDirection: "row",
|
|
957
1079
|
alignItems: "center",
|
|
958
1080
|
justifyContent: "center",
|
|
959
|
-
gap: 8
|
|
960
|
-
flex: 1
|
|
1081
|
+
gap: 8
|
|
961
1082
|
},
|
|
962
1083
|
disabled: {
|
|
963
1084
|
opacity: 0.45
|
|
@@ -965,18 +1086,6 @@ var styles14 = reactNative.StyleSheet.create({
|
|
|
965
1086
|
label: {
|
|
966
1087
|
fontSize: 14,
|
|
967
1088
|
fontWeight: "500"
|
|
968
|
-
},
|
|
969
|
-
checkContainer: {
|
|
970
|
-
width: 24,
|
|
971
|
-
height: 24,
|
|
972
|
-
borderRadius: 12,
|
|
973
|
-
borderWidth: 2,
|
|
974
|
-
alignItems: "center",
|
|
975
|
-
justifyContent: "center"
|
|
976
|
-
},
|
|
977
|
-
checkMark: {
|
|
978
|
-
fontSize: 14,
|
|
979
|
-
fontWeight: "700"
|
|
980
1089
|
}
|
|
981
1090
|
});
|
|
982
1091
|
function RadioItem({
|
|
@@ -999,7 +1108,7 @@ function RadioItem({
|
|
|
999
1108
|
style: styles15.row,
|
|
1000
1109
|
onPress: () => {
|
|
1001
1110
|
if (!option.disabled) {
|
|
1002
|
-
|
|
1111
|
+
Haptics12__namespace.selectionAsync();
|
|
1003
1112
|
onSelect();
|
|
1004
1113
|
}
|
|
1005
1114
|
},
|
|
@@ -1053,7 +1162,7 @@ function RadioGroup({
|
|
|
1053
1162
|
}
|
|
1054
1163
|
var styles15 = reactNative.StyleSheet.create({
|
|
1055
1164
|
container: {
|
|
1056
|
-
gap:
|
|
1165
|
+
gap: 12
|
|
1057
1166
|
},
|
|
1058
1167
|
horizontal: {
|
|
1059
1168
|
flexDirection: "row",
|
|
@@ -1062,7 +1171,7 @@ var styles15 = reactNative.StyleSheet.create({
|
|
|
1062
1171
|
row: {
|
|
1063
1172
|
flexDirection: "row",
|
|
1064
1173
|
alignItems: "center",
|
|
1065
|
-
gap:
|
|
1174
|
+
gap: 12
|
|
1066
1175
|
},
|
|
1067
1176
|
radio: {
|
|
1068
1177
|
width: 24,
|
|
@@ -1157,7 +1266,7 @@ function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
|
1157
1266
|
}
|
|
1158
1267
|
}, [active]);
|
|
1159
1268
|
const handlePress = (v) => {
|
|
1160
|
-
|
|
1269
|
+
Haptics12__namespace.selectionAsync();
|
|
1161
1270
|
if (!value) setInternal(v);
|
|
1162
1271
|
onValueChange?.(v);
|
|
1163
1272
|
};
|
|
@@ -1282,7 +1391,7 @@ function AccordionItemComponent({
|
|
|
1282
1391
|
{
|
|
1283
1392
|
style: styles17.trigger,
|
|
1284
1393
|
onPress: () => {
|
|
1285
|
-
|
|
1394
|
+
Haptics12__namespace.selectionAsync();
|
|
1286
1395
|
onToggle();
|
|
1287
1396
|
},
|
|
1288
1397
|
onPressIn: handlePressIn,
|
|
@@ -1291,13 +1400,7 @@ function AccordionItemComponent({
|
|
|
1291
1400
|
touchSoundDisabled: true
|
|
1292
1401
|
},
|
|
1293
1402
|
/* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles17.triggerText, { color: colors.foreground }] }, item.trigger),
|
|
1294
|
-
/* @__PURE__ */ React23__default.default.createElement(
|
|
1295
|
-
ReanimatedAnimated__default.default.Text,
|
|
1296
|
-
{
|
|
1297
|
-
style: [styles17.chevron, { color: colors.foreground }, rotationStyle]
|
|
1298
|
-
},
|
|
1299
|
-
"\u25BE"
|
|
1300
|
-
)
|
|
1403
|
+
/* @__PURE__ */ React23__default.default.createElement(ReanimatedAnimated__default.default.View, { style: [styles17.chevron, rotationStyle] }, /* @__PURE__ */ React23__default.default.createElement(vectorIcons.Entypo, { name: "chevron-down", size: 20, color: colors.foreground }))
|
|
1301
1404
|
)), /* @__PURE__ */ React23__default.default.createElement(ReanimatedAnimated__default.default.View, { style: heightStyle }, /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles17.content, onLayout }, item.content)));
|
|
1302
1405
|
}
|
|
1303
1406
|
function Accordion({ items, type = "single", defaultValue, style }) {
|
|
@@ -1340,7 +1443,6 @@ var styles17 = reactNative.StyleSheet.create({
|
|
|
1340
1443
|
flex: 1
|
|
1341
1444
|
},
|
|
1342
1445
|
chevron: {
|
|
1343
|
-
fontSize: 18,
|
|
1344
1446
|
marginLeft: 8
|
|
1345
1447
|
},
|
|
1346
1448
|
content: {
|
|
@@ -1356,116 +1458,63 @@ function Slider({
|
|
|
1356
1458
|
step = 0,
|
|
1357
1459
|
onValueChange,
|
|
1358
1460
|
onSlidingComplete,
|
|
1461
|
+
label,
|
|
1462
|
+
showValue = false,
|
|
1463
|
+
formatValue: formatValue2 = (v) => v.toFixed(2),
|
|
1464
|
+
accessibilityLabel,
|
|
1359
1465
|
disabled,
|
|
1360
1466
|
style
|
|
1361
1467
|
}) {
|
|
1362
1468
|
const { colors } = useTheme();
|
|
1363
|
-
const trackWidth = React23.useRef(0);
|
|
1364
1469
|
const lastSteppedValue = React23.useRef(value);
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
};
|
|
1372
|
-
const xToValue = (x) => {
|
|
1373
|
-
const ratio = Math.min(Math.max(x / trackWidth.current, 0), 1);
|
|
1374
|
-
const raw = ratio * (maximumValue - minimumValue) + minimumValue;
|
|
1375
|
-
return clamp(snapToStep(raw));
|
|
1376
|
-
};
|
|
1377
|
-
const panResponder = React23.useRef(
|
|
1378
|
-
reactNative.PanResponder.create({
|
|
1379
|
-
onStartShouldSetPanResponder: () => !disabled,
|
|
1380
|
-
onMoveShouldSetPanResponder: () => !disabled,
|
|
1381
|
-
onPanResponderGrant: (e) => {
|
|
1382
|
-
const x = e.nativeEvent.locationX;
|
|
1383
|
-
const newValue = xToValue(x);
|
|
1384
|
-
setInternalValue(newValue);
|
|
1385
|
-
onValueChange?.(newValue);
|
|
1386
|
-
},
|
|
1387
|
-
onPanResponderMove: (e) => {
|
|
1388
|
-
const x = e.nativeEvent.locationX;
|
|
1389
|
-
const newValue = xToValue(x);
|
|
1390
|
-
if (newValue !== lastSteppedValue.current) {
|
|
1391
|
-
lastSteppedValue.current = newValue;
|
|
1392
|
-
Haptics11__namespace.selectionAsync();
|
|
1393
|
-
}
|
|
1394
|
-
setInternalValue(newValue);
|
|
1395
|
-
onValueChange?.(newValue);
|
|
1396
|
-
},
|
|
1397
|
-
onPanResponderRelease: (e) => {
|
|
1398
|
-
const x = e.nativeEvent.locationX;
|
|
1399
|
-
const newValue = xToValue(x);
|
|
1400
|
-
setInternalValue(newValue);
|
|
1401
|
-
onSlidingComplete?.(newValue);
|
|
1402
|
-
}
|
|
1403
|
-
})
|
|
1404
|
-
).current;
|
|
1405
|
-
const onLayout = (e) => {
|
|
1406
|
-
trackWidth.current = e.nativeEvent.layout.width;
|
|
1470
|
+
const handleValueChange = (v) => {
|
|
1471
|
+
if (step && v !== lastSteppedValue.current) {
|
|
1472
|
+
lastSteppedValue.current = v;
|
|
1473
|
+
Haptics12__namespace.selectionAsync();
|
|
1474
|
+
}
|
|
1475
|
+
onValueChange?.(v);
|
|
1407
1476
|
};
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
reactNative.View,
|
|
1477
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles18.wrapper, style], accessibilityLabel }, label || showValue ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles18.header }, label ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles18.label, { color: colors.foreground }], allowFontScaling: true }, label) : null, showValue ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles18.valueText, { color: colors.mutedForeground }], allowFontScaling: true }, formatValue2(value)) : null) : null, /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: disabled ? styles18.disabled : void 0 }, /* @__PURE__ */ React23__default.default.createElement(
|
|
1478
|
+
RNSlider__default.default,
|
|
1411
1479
|
{
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
styles18.thumb,
|
|
1427
|
-
{
|
|
1428
|
-
left: `${percent}%`,
|
|
1429
|
-
backgroundColor: colors.primary,
|
|
1430
|
-
borderColor: colors.background,
|
|
1431
|
-
transform: [{ translateX: -14 }]
|
|
1432
|
-
}
|
|
1433
|
-
],
|
|
1434
|
-
pointerEvents: "none"
|
|
1435
|
-
}
|
|
1436
|
-
)
|
|
1437
|
-
);
|
|
1480
|
+
value,
|
|
1481
|
+
minimumValue,
|
|
1482
|
+
maximumValue,
|
|
1483
|
+
step: step || 0,
|
|
1484
|
+
disabled,
|
|
1485
|
+
onValueChange: handleValueChange,
|
|
1486
|
+
onSlidingComplete,
|
|
1487
|
+
minimumTrackTintColor: colors.primary,
|
|
1488
|
+
maximumTrackTintColor: colors.muted,
|
|
1489
|
+
thumbTintColor: colors.primary,
|
|
1490
|
+
style: styles18.slider,
|
|
1491
|
+
accessibilityLabel
|
|
1492
|
+
}
|
|
1493
|
+
)));
|
|
1438
1494
|
}
|
|
1439
1495
|
var styles18 = reactNative.StyleSheet.create({
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
justifyContent: "center",
|
|
1443
|
-
position: "relative"
|
|
1496
|
+
wrapper: {
|
|
1497
|
+
gap: 8
|
|
1444
1498
|
},
|
|
1445
|
-
|
|
1446
|
-
|
|
1499
|
+
header: {
|
|
1500
|
+
flexDirection: "row",
|
|
1501
|
+
justifyContent: "space-between",
|
|
1502
|
+
alignItems: "center"
|
|
1447
1503
|
},
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
overflow: "hidden",
|
|
1452
|
-
width: "100%"
|
|
1504
|
+
label: {
|
|
1505
|
+
fontSize: 15,
|
|
1506
|
+
fontWeight: "500"
|
|
1453
1507
|
},
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1508
|
+
valueText: {
|
|
1509
|
+
fontSize: 14,
|
|
1510
|
+
fontWeight: "500"
|
|
1457
1511
|
},
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
shadowColor: "#000",
|
|
1465
|
-
shadowOffset: { width: 0, height: 1 },
|
|
1466
|
-
shadowOpacity: 0.2,
|
|
1467
|
-
shadowRadius: 2,
|
|
1468
|
-
elevation: 2
|
|
1512
|
+
slider: {
|
|
1513
|
+
width: "100%",
|
|
1514
|
+
height: 40
|
|
1515
|
+
},
|
|
1516
|
+
disabled: {
|
|
1517
|
+
opacity: 0.45
|
|
1469
1518
|
}
|
|
1470
1519
|
});
|
|
1471
1520
|
function Sheet({
|
|
@@ -1481,7 +1530,7 @@ function Sheet({
|
|
|
1481
1530
|
const ref = React23.useRef(null);
|
|
1482
1531
|
React23.useEffect(() => {
|
|
1483
1532
|
if (open) {
|
|
1484
|
-
|
|
1533
|
+
Haptics12__namespace.impactAsync(Haptics12__namespace.ImpactFeedbackStyle.Light);
|
|
1485
1534
|
ref.current?.present();
|
|
1486
1535
|
} else {
|
|
1487
1536
|
ref.current?.dismiss();
|
|
@@ -1537,6 +1586,9 @@ var styles19 = reactNative.StyleSheet.create({
|
|
|
1537
1586
|
lineHeight: 20
|
|
1538
1587
|
}
|
|
1539
1588
|
});
|
|
1589
|
+
var isIOS = reactNative.Platform.OS === "ios";
|
|
1590
|
+
var isAndroid = reactNative.Platform.OS === "android";
|
|
1591
|
+
var isWeb = reactNative.Platform.OS === "web";
|
|
1540
1592
|
function Select({
|
|
1541
1593
|
options,
|
|
1542
1594
|
value,
|
|
@@ -1548,8 +1600,10 @@ function Select({
|
|
|
1548
1600
|
style
|
|
1549
1601
|
}) {
|
|
1550
1602
|
const { colors } = useTheme();
|
|
1551
|
-
const bottomSheetRef = React23.useRef(null);
|
|
1552
1603
|
const scale = React23.useRef(new reactNative.Animated.Value(1)).current;
|
|
1604
|
+
const [pickerVisible, setPickerVisible] = React23.useState(false);
|
|
1605
|
+
const [pendingValue, setPendingValue] = React23.useState(value);
|
|
1606
|
+
const pickerRef = React23.useRef(null);
|
|
1553
1607
|
const selected = options.find((o) => o.value === value);
|
|
1554
1608
|
const handlePressIn = () => {
|
|
1555
1609
|
if (disabled) return;
|
|
@@ -1559,24 +1613,26 @@ function Select({
|
|
|
1559
1613
|
reactNative.Animated.spring(scale, { toValue: 1, useNativeDriver: true, speed: 40, bounciness: 4 }).start();
|
|
1560
1614
|
};
|
|
1561
1615
|
const handleOpen = () => {
|
|
1562
|
-
if (
|
|
1563
|
-
|
|
1564
|
-
|
|
1616
|
+
if (disabled) return;
|
|
1617
|
+
Haptics12__namespace.selectionAsync();
|
|
1618
|
+
if (isIOS) {
|
|
1619
|
+
setPendingValue(value);
|
|
1620
|
+
setPickerVisible(true);
|
|
1621
|
+
} else if (isAndroid) {
|
|
1622
|
+
pickerRef.current?.focus();
|
|
1565
1623
|
}
|
|
1566
1624
|
};
|
|
1567
|
-
const
|
|
1568
|
-
(
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
);
|
|
1579
|
-
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles20.container, style] }, label ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles20.label, { color: colors.foreground }] }, label) : null, /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: { transform: [{ scale }], opacity: disabled ? 0.45 : 1 } }, /* @__PURE__ */ React23__default.default.createElement(
|
|
1625
|
+
const handleDismiss = () => {
|
|
1626
|
+
setPickerVisible(false);
|
|
1627
|
+
};
|
|
1628
|
+
const handleConfirm = () => {
|
|
1629
|
+
if (pendingValue !== void 0 && pendingValue !== "") {
|
|
1630
|
+
Haptics12__namespace.selectionAsync();
|
|
1631
|
+
onValueChange?.(pendingValue);
|
|
1632
|
+
}
|
|
1633
|
+
setPickerVisible(false);
|
|
1634
|
+
};
|
|
1635
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles20.container, style] }, label ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles20.label, { color: colors.foreground }] }, label) : null, !isWeb ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: { transform: [{ scale }], opacity: disabled ? 0.45 : 1 } }, /* @__PURE__ */ React23__default.default.createElement(
|
|
1580
1636
|
reactNative.TouchableOpacity,
|
|
1581
1637
|
{
|
|
1582
1638
|
style: [
|
|
@@ -1599,125 +1655,169 @@ function Select({
|
|
|
1599
1655
|
styles20.triggerText,
|
|
1600
1656
|
{ color: selected ? colors.foreground : colors.mutedForeground }
|
|
1601
1657
|
],
|
|
1602
|
-
numberOfLines: 1
|
|
1658
|
+
numberOfLines: 1,
|
|
1659
|
+
allowFontScaling: true
|
|
1603
1660
|
},
|
|
1604
1661
|
selected?.label ?? placeholder
|
|
1605
1662
|
),
|
|
1606
|
-
/* @__PURE__ */ React23__default.default.createElement(
|
|
1607
|
-
))
|
|
1608
|
-
|
|
1663
|
+
/* @__PURE__ */ React23__default.default.createElement(vectorIcons.Entypo, { name: "chevron-with-circle-down", size: 20, color: colors.mutedForeground })
|
|
1664
|
+
)) : null, isIOS ? /* @__PURE__ */ React23__default.default.createElement(
|
|
1665
|
+
reactNative.Modal,
|
|
1609
1666
|
{
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
backgroundStyle: [styles20.sheetBackground, { backgroundColor: colors.card }],
|
|
1615
|
-
handleIndicatorStyle: [styles20.sheetHandle, { backgroundColor: colors.border }]
|
|
1667
|
+
visible: pickerVisible,
|
|
1668
|
+
transparent: true,
|
|
1669
|
+
animationType: "slide",
|
|
1670
|
+
onRequestClose: handleDismiss
|
|
1616
1671
|
},
|
|
1617
|
-
/* @__PURE__ */ React23__default.default.createElement(
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1672
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.TouchableOpacity, { style: styles20.iosBackdrop, activeOpacity: 1, onPress: handleDismiss }),
|
|
1673
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles20.iosSheet, { backgroundColor: colors.card }] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles20.iosToolbar, { borderBottomColor: colors.border }] }, label ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles20.iosToolbarTitle, { color: colors.foreground }], allowFontScaling: true }, label) : /* @__PURE__ */ React23__default.default.createElement(reactNative.View, null), /* @__PURE__ */ React23__default.default.createElement(reactNative.TouchableOpacity, { onPress: handleConfirm, style: styles20.iosDoneBtn, hitSlop: { top: 8, bottom: 8, left: 8, right: 8 } }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles20.iosDoneBtnText, { color: colors.primary }], allowFontScaling: true }, "Done"))), /* @__PURE__ */ React23__default.default.createElement(
|
|
1674
|
+
picker.Picker,
|
|
1675
|
+
{
|
|
1676
|
+
selectedValue: pendingValue ?? "",
|
|
1677
|
+
onValueChange: (val) => setPendingValue(val),
|
|
1678
|
+
itemStyle: { color: colors.foreground }
|
|
1679
|
+
},
|
|
1680
|
+
!value ? /* @__PURE__ */ React23__default.default.createElement(picker.Picker.Item, { label: placeholder, value: "", color: colors.mutedForeground, enabled: false }) : null,
|
|
1681
|
+
options.map((o) => /* @__PURE__ */ React23__default.default.createElement(
|
|
1682
|
+
picker.Picker.Item,
|
|
1621
1683
|
{
|
|
1622
|
-
key:
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1684
|
+
key: o.value,
|
|
1685
|
+
label: o.label,
|
|
1686
|
+
value: o.value,
|
|
1687
|
+
enabled: !o.disabled,
|
|
1688
|
+
color: o.disabled ? colors.mutedForeground : colors.foreground
|
|
1689
|
+
}
|
|
1690
|
+
))
|
|
1691
|
+
))
|
|
1692
|
+
) : null, isAndroid ? /* @__PURE__ */ React23__default.default.createElement(
|
|
1693
|
+
picker.Picker,
|
|
1694
|
+
{
|
|
1695
|
+
ref: pickerRef,
|
|
1696
|
+
selectedValue: value ?? "",
|
|
1697
|
+
onValueChange: (val) => {
|
|
1698
|
+
if (val !== "") {
|
|
1699
|
+
Haptics12__namespace.selectionAsync();
|
|
1700
|
+
onValueChange?.(val);
|
|
1701
|
+
}
|
|
1702
|
+
},
|
|
1703
|
+
mode: "dialog",
|
|
1704
|
+
enabled: !disabled,
|
|
1705
|
+
prompt: label,
|
|
1706
|
+
style: styles20.androidHiddenPicker
|
|
1707
|
+
},
|
|
1708
|
+
!value ? /* @__PURE__ */ React23__default.default.createElement(picker.Picker.Item, { label: placeholder, value: "", enabled: false }) : null,
|
|
1709
|
+
options.map((o) => /* @__PURE__ */ React23__default.default.createElement(
|
|
1710
|
+
picker.Picker.Item,
|
|
1711
|
+
{
|
|
1712
|
+
key: o.value,
|
|
1713
|
+
label: o.label,
|
|
1714
|
+
value: o.value,
|
|
1715
|
+
enabled: !o.disabled
|
|
1716
|
+
}
|
|
1717
|
+
))
|
|
1718
|
+
) : null, isWeb ? /* @__PURE__ */ React23__default.default.createElement(
|
|
1719
|
+
picker.Picker,
|
|
1720
|
+
{
|
|
1721
|
+
selectedValue: value ?? "",
|
|
1722
|
+
onValueChange: (val) => {
|
|
1723
|
+
if (val !== "") {
|
|
1724
|
+
onValueChange?.(val);
|
|
1725
|
+
}
|
|
1726
|
+
},
|
|
1727
|
+
enabled: !disabled,
|
|
1728
|
+
style: [
|
|
1729
|
+
styles20.webPicker,
|
|
1730
|
+
{
|
|
1731
|
+
borderColor: error ? colors.destructive : colors.border,
|
|
1732
|
+
color: selected ? colors.foreground : colors.mutedForeground,
|
|
1733
|
+
backgroundColor: colors.background,
|
|
1734
|
+
opacity: disabled ? 0.45 : 1
|
|
1735
|
+
}
|
|
1736
|
+
]
|
|
1737
|
+
},
|
|
1738
|
+
/* @__PURE__ */ React23__default.default.createElement(picker.Picker.Item, { label: placeholder, value: "", enabled: false }),
|
|
1739
|
+
options.map((o) => /* @__PURE__ */ React23__default.default.createElement(
|
|
1740
|
+
picker.Picker.Item,
|
|
1741
|
+
{
|
|
1742
|
+
key: o.value,
|
|
1743
|
+
label: o.label,
|
|
1744
|
+
value: o.value,
|
|
1745
|
+
enabled: !o.disabled
|
|
1746
|
+
}
|
|
1747
|
+
))
|
|
1748
|
+
) : null, error ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles20.helperText, { color: colors.destructive }] }, error) : null);
|
|
1653
1749
|
}
|
|
1654
1750
|
var styles20 = reactNative.StyleSheet.create({
|
|
1655
1751
|
container: {
|
|
1656
|
-
gap:
|
|
1752
|
+
gap: 8
|
|
1657
1753
|
},
|
|
1658
1754
|
label: {
|
|
1659
1755
|
fontSize: 15,
|
|
1660
|
-
fontWeight: "500"
|
|
1661
|
-
marginBottom: 2
|
|
1756
|
+
fontWeight: "500"
|
|
1662
1757
|
},
|
|
1663
1758
|
trigger: {
|
|
1664
1759
|
flexDirection: "row",
|
|
1665
1760
|
alignItems: "center",
|
|
1666
1761
|
justifyContent: "space-between",
|
|
1667
1762
|
borderWidth: 1.5,
|
|
1668
|
-
borderRadius:
|
|
1669
|
-
paddingHorizontal:
|
|
1670
|
-
paddingVertical:
|
|
1763
|
+
borderRadius: 8,
|
|
1764
|
+
paddingHorizontal: 16,
|
|
1765
|
+
paddingVertical: 14,
|
|
1766
|
+
shadowColor: "#000",
|
|
1767
|
+
shadowOffset: { width: 0, height: 1 },
|
|
1768
|
+
shadowOpacity: 0.04,
|
|
1769
|
+
shadowRadius: 2,
|
|
1770
|
+
elevation: 1
|
|
1671
1771
|
},
|
|
1672
1772
|
triggerText: {
|
|
1673
1773
|
fontSize: 17,
|
|
1674
1774
|
flex: 1
|
|
1675
1775
|
},
|
|
1676
1776
|
chevron: {
|
|
1677
|
-
fontSize: 16,
|
|
1678
1777
|
marginLeft: 8
|
|
1679
1778
|
},
|
|
1680
1779
|
helperText: {
|
|
1681
1780
|
fontSize: 13
|
|
1682
1781
|
},
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
},
|
|
1687
|
-
sheetHandle: {
|
|
1688
|
-
width: 36,
|
|
1689
|
-
height: 4,
|
|
1690
|
-
borderRadius: 2
|
|
1691
|
-
},
|
|
1692
|
-
sheetContent: {
|
|
1693
|
-
paddingHorizontal: 20,
|
|
1694
|
-
paddingBottom: 36
|
|
1782
|
+
iosBackdrop: {
|
|
1783
|
+
flex: 1,
|
|
1784
|
+
backgroundColor: "rgba(0,0,0,0.4)"
|
|
1695
1785
|
},
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
paddingHorizontal: 4
|
|
1786
|
+
iosSheet: {
|
|
1787
|
+
borderTopLeftRadius: 16,
|
|
1788
|
+
borderTopRightRadius: 16,
|
|
1789
|
+
paddingBottom: 32
|
|
1701
1790
|
},
|
|
1702
|
-
|
|
1791
|
+
iosToolbar: {
|
|
1703
1792
|
flexDirection: "row",
|
|
1704
1793
|
alignItems: "center",
|
|
1705
1794
|
justifyContent: "space-between",
|
|
1706
1795
|
paddingHorizontal: 16,
|
|
1707
|
-
paddingVertical:
|
|
1708
|
-
|
|
1796
|
+
paddingVertical: 12,
|
|
1797
|
+
borderBottomWidth: 1
|
|
1709
1798
|
},
|
|
1710
|
-
|
|
1799
|
+
iosToolbarTitle: {
|
|
1711
1800
|
fontSize: 17,
|
|
1712
|
-
|
|
1801
|
+
fontWeight: "600"
|
|
1713
1802
|
},
|
|
1714
|
-
|
|
1715
|
-
|
|
1803
|
+
iosDoneBtn: {
|
|
1804
|
+
padding: 4
|
|
1716
1805
|
},
|
|
1717
|
-
|
|
1718
|
-
fontSize:
|
|
1719
|
-
fontWeight: "600"
|
|
1720
|
-
|
|
1806
|
+
iosDoneBtnText: {
|
|
1807
|
+
fontSize: 17,
|
|
1808
|
+
fontWeight: "600"
|
|
1809
|
+
},
|
|
1810
|
+
androidHiddenPicker: {
|
|
1811
|
+
height: 0,
|
|
1812
|
+
opacity: 0,
|
|
1813
|
+
position: "absolute"
|
|
1814
|
+
},
|
|
1815
|
+
webPicker: {
|
|
1816
|
+
borderWidth: 1.5,
|
|
1817
|
+
borderRadius: 8,
|
|
1818
|
+
paddingHorizontal: 16,
|
|
1819
|
+
paddingVertical: 14,
|
|
1820
|
+
fontSize: 17
|
|
1721
1821
|
}
|
|
1722
1822
|
});
|
|
1723
1823
|
var ToastContext = React23.createContext({
|
|
@@ -1775,8 +1875,9 @@ function ToastNotification({ item, onDismiss }) {
|
|
|
1775
1875
|
destructive: colors.destructiveForeground,
|
|
1776
1876
|
success: colors.successForeground
|
|
1777
1877
|
}[item.variant ?? "default"];
|
|
1778
|
-
const
|
|
1779
|
-
|
|
1878
|
+
const defaultIcon = item.variant === "success" ? /* @__PURE__ */ React23__default.default.createElement(vectorIcons.FontAwesome5, { name: "check-circle", size: 22, color: textColor }) : item.variant === "destructive" ? /* @__PURE__ */ React23__default.default.createElement(vectorIcons.MaterialIcons, { name: "error-outline", size: 24, color: textColor }) : /* @__PURE__ */ React23__default.default.createElement(vectorIcons.Entypo, { name: "info-with-circle", size: 22, color: textColor });
|
|
1879
|
+
const leftIcon = item.icon ?? defaultIcon;
|
|
1880
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNativeGestureHandler.GestureDetector, { gesture: panGesture }, /* @__PURE__ */ React23__default.default.createElement(ReanimatedAnimated__default.default.View, { style: [styles21.toast, { backgroundColor: bgColor }, animatedStyle] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles21.leftIconContainer }, leftIcon), /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles21.toastContent }, item.title ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles21.toastTitle, { color: textColor }] }, item.title) : null, item.description ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles21.toastDescription, { color: textColor, opacity: 0.85 }] }, item.description) : null), /* @__PURE__ */ React23__default.default.createElement(reactNative.TouchableOpacity, { onPress: onDismiss, style: styles21.dismissButton, touchSoundDisabled: true }, /* @__PURE__ */ React23__default.default.createElement(vectorIcons.AntDesign, { name: "close-circle", size: 18, color: textColor }))));
|
|
1780
1881
|
}
|
|
1781
1882
|
function ToastProvider({ children }) {
|
|
1782
1883
|
const [toasts, setToasts] = React23.useState([]);
|
|
@@ -1784,18 +1885,18 @@ function ToastProvider({ children }) {
|
|
|
1784
1885
|
const toast = React23.useCallback((item) => {
|
|
1785
1886
|
const id = Math.random().toString(36).slice(2);
|
|
1786
1887
|
if (item.variant === "success") {
|
|
1787
|
-
|
|
1888
|
+
Haptics12__namespace.notificationAsync(Haptics12__namespace.NotificationFeedbackType.Success);
|
|
1788
1889
|
} else if (item.variant === "destructive") {
|
|
1789
|
-
|
|
1890
|
+
Haptics12__namespace.notificationAsync(Haptics12__namespace.NotificationFeedbackType.Error);
|
|
1790
1891
|
} else {
|
|
1791
|
-
|
|
1892
|
+
Haptics12__namespace.impactAsync(Haptics12__namespace.ImpactFeedbackStyle.Light);
|
|
1792
1893
|
}
|
|
1793
1894
|
setToasts((prev) => [{ ...item, id }, ...prev].slice(0, 3));
|
|
1794
1895
|
}, []);
|
|
1795
1896
|
const dismiss = React23.useCallback((id) => {
|
|
1796
1897
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
1797
1898
|
}, []);
|
|
1798
|
-
return /* @__PURE__ */ React23__default.default.createElement(ToastContext.Provider, { value: { toast, dismiss } }, children, /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles21.container, { top: insets.top + 8 }], pointerEvents: "box-none" }, toasts.map((item) => /* @__PURE__ */ React23__default.default.createElement(ToastNotification, { key: item.id, item, onDismiss: () => dismiss(item.id) }))));
|
|
1899
|
+
return /* @__PURE__ */ React23__default.default.createElement(ToastContext.Provider, { value: { toast, dismiss } }, children, /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles21.container, reactNative.Platform.OS === "web" && styles21.containerWeb, { top: insets.top + 8 }], pointerEvents: "box-none" }, toasts.map((item) => /* @__PURE__ */ React23__default.default.createElement(ToastNotification, { key: item.id, item, onDismiss: () => dismiss(item.id) }))));
|
|
1799
1900
|
}
|
|
1800
1901
|
var styles21 = reactNative.StyleSheet.create({
|
|
1801
1902
|
container: {
|
|
@@ -1805,6 +1906,12 @@ var styles21 = reactNative.StyleSheet.create({
|
|
|
1805
1906
|
gap: 8,
|
|
1806
1907
|
zIndex: 9999
|
|
1807
1908
|
},
|
|
1909
|
+
containerWeb: {
|
|
1910
|
+
left: void 0,
|
|
1911
|
+
right: void 0,
|
|
1912
|
+
alignSelf: "center",
|
|
1913
|
+
width: 400
|
|
1914
|
+
},
|
|
1808
1915
|
toast: {
|
|
1809
1916
|
flexDirection: "row",
|
|
1810
1917
|
alignItems: "center",
|
|
@@ -1822,15 +1929,11 @@ var styles21 = reactNative.StyleSheet.create({
|
|
|
1822
1929
|
gap: 4
|
|
1823
1930
|
},
|
|
1824
1931
|
leftIconContainer: {
|
|
1825
|
-
width:
|
|
1932
|
+
width: 40,
|
|
1826
1933
|
alignItems: "center",
|
|
1827
1934
|
justifyContent: "center",
|
|
1828
1935
|
marginRight: 8
|
|
1829
1936
|
},
|
|
1830
|
-
defaultIcon: {
|
|
1831
|
-
fontSize: 22,
|
|
1832
|
-
fontWeight: "700"
|
|
1833
|
-
},
|
|
1834
1937
|
toastTitle: {
|
|
1835
1938
|
fontSize: 15,
|
|
1836
1939
|
fontWeight: "600"
|
|
@@ -1839,11 +1942,8 @@ var styles21 = reactNative.StyleSheet.create({
|
|
|
1839
1942
|
fontSize: 14
|
|
1840
1943
|
},
|
|
1841
1944
|
dismissButton: {
|
|
1842
|
-
padding:
|
|
1945
|
+
padding: 8,
|
|
1843
1946
|
marginLeft: 4
|
|
1844
|
-
},
|
|
1845
|
-
dismissIcon: {
|
|
1846
|
-
fontSize: 14
|
|
1847
1947
|
}
|
|
1848
1948
|
});
|
|
1849
1949
|
function formatCurrency(raw, separator) {
|
|
@@ -1857,12 +1957,14 @@ function CurrencyInput({
|
|
|
1857
1957
|
onChangeValue,
|
|
1858
1958
|
prefix = "$",
|
|
1859
1959
|
thousandsSeparator = ".",
|
|
1960
|
+
size = "default",
|
|
1860
1961
|
label,
|
|
1861
1962
|
error,
|
|
1862
1963
|
hint,
|
|
1863
1964
|
placeholder,
|
|
1864
1965
|
editable,
|
|
1865
|
-
containerStyle
|
|
1966
|
+
containerStyle,
|
|
1967
|
+
style
|
|
1866
1968
|
}) {
|
|
1867
1969
|
const handleChange = (text) => {
|
|
1868
1970
|
const withoutPrefix = prefix && text.startsWith(prefix) ? text.slice(prefix.length) : text;
|
|
@@ -1873,6 +1975,7 @@ function CurrencyInput({
|
|
|
1873
1975
|
const raw = parseFloat(formatted.replace(separatorRegex, "") || "0");
|
|
1874
1976
|
onChangeValue?.(isNaN(raw) ? 0 : raw);
|
|
1875
1977
|
};
|
|
1978
|
+
const inputStyle = size === "large" ? { fontSize: 36 } : {};
|
|
1876
1979
|
return /* @__PURE__ */ React23__default.default.createElement(
|
|
1877
1980
|
Input,
|
|
1878
1981
|
{
|
|
@@ -1884,7 +1987,8 @@ function CurrencyInput({
|
|
|
1884
1987
|
hint,
|
|
1885
1988
|
placeholder: placeholder ?? `${prefix}0`,
|
|
1886
1989
|
editable,
|
|
1887
|
-
containerStyle
|
|
1990
|
+
containerStyle,
|
|
1991
|
+
style: [inputStyle, style]
|
|
1888
1992
|
}
|
|
1889
1993
|
);
|
|
1890
1994
|
}
|
|
@@ -1912,58 +2016,32 @@ var styles22 = reactNative.StyleSheet.create({
|
|
|
1912
2016
|
fontWeight: "700"
|
|
1913
2017
|
}
|
|
1914
2018
|
});
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
2019
|
+
var nativeDriver4 = reactNative.Platform.OS !== "web";
|
|
2020
|
+
function ListItem({
|
|
2021
|
+
leftRender,
|
|
2022
|
+
rightRender,
|
|
2023
|
+
trailing,
|
|
2024
|
+
icon,
|
|
2025
|
+
title,
|
|
2026
|
+
subtitle,
|
|
2027
|
+
caption,
|
|
2028
|
+
variant = "plain",
|
|
2029
|
+
showChevron = false,
|
|
2030
|
+
showSeparator = false,
|
|
2031
|
+
onPress,
|
|
2032
|
+
disabled,
|
|
2033
|
+
style,
|
|
2034
|
+
titleStyle,
|
|
2035
|
+
subtitleStyle,
|
|
2036
|
+
captionStyle
|
|
1932
2037
|
}) {
|
|
1933
|
-
const handleChange = (text) => {
|
|
1934
|
-
const withoutPrefix = prefix && text.startsWith(prefix) ? text.slice(prefix.length) : text;
|
|
1935
|
-
const formatted = formatCurrency2(withoutPrefix, thousandsSeparator);
|
|
1936
|
-
const display = formatted ? `${prefix}${formatted}` : "";
|
|
1937
|
-
onChangeText?.(display);
|
|
1938
|
-
const separatorRegex = new RegExp(`\\${thousandsSeparator}`, "g");
|
|
1939
|
-
const raw = parseFloat(formatted.replace(separatorRegex, "") || "0");
|
|
1940
|
-
onChangeValue?.(isNaN(raw) ? 0 : raw);
|
|
1941
|
-
};
|
|
1942
|
-
return /* @__PURE__ */ React23__default.default.createElement(
|
|
1943
|
-
Input,
|
|
1944
|
-
{
|
|
1945
|
-
value,
|
|
1946
|
-
onChangeText: handleChange,
|
|
1947
|
-
keyboardType: "numeric",
|
|
1948
|
-
label,
|
|
1949
|
-
error,
|
|
1950
|
-
hint,
|
|
1951
|
-
placeholder: placeholder ?? `${prefix}0`,
|
|
1952
|
-
editable,
|
|
1953
|
-
containerStyle,
|
|
1954
|
-
style: { fontSize: 36 }
|
|
1955
|
-
}
|
|
1956
|
-
);
|
|
1957
|
-
}
|
|
1958
|
-
var nativeDriver3 = reactNative.Platform.OS !== "web";
|
|
1959
|
-
function ListItem({ icon, title, subtitle, trailing, onPress, disabled, style }) {
|
|
1960
2038
|
const { colors } = useTheme();
|
|
1961
2039
|
const scale = React23.useRef(new reactNative.Animated.Value(1)).current;
|
|
1962
2040
|
const handlePressIn = () => {
|
|
1963
2041
|
if (!onPress || disabled) return;
|
|
1964
2042
|
reactNative.Animated.spring(scale, {
|
|
1965
2043
|
toValue: 0.97,
|
|
1966
|
-
useNativeDriver:
|
|
2044
|
+
useNativeDriver: nativeDriver4,
|
|
1967
2045
|
speed: 40,
|
|
1968
2046
|
bounciness: 0
|
|
1969
2047
|
}).start();
|
|
@@ -1971,19 +2049,32 @@ function ListItem({ icon, title, subtitle, trailing, onPress, disabled, style })
|
|
|
1971
2049
|
const handlePressOut = () => {
|
|
1972
2050
|
reactNative.Animated.spring(scale, {
|
|
1973
2051
|
toValue: 1,
|
|
1974
|
-
useNativeDriver:
|
|
2052
|
+
useNativeDriver: nativeDriver4,
|
|
1975
2053
|
speed: 40,
|
|
1976
2054
|
bounciness: 4
|
|
1977
2055
|
}).start();
|
|
1978
2056
|
};
|
|
1979
2057
|
const handlePress = () => {
|
|
1980
|
-
|
|
2058
|
+
Haptics12__namespace.selectionAsync();
|
|
1981
2059
|
onPress?.();
|
|
1982
2060
|
};
|
|
2061
|
+
const effectiveLeft = leftRender ?? icon;
|
|
2062
|
+
const effectiveRight = rightRender ?? trailing;
|
|
2063
|
+
const cardStyle = variant === "card" ? {
|
|
2064
|
+
backgroundColor: colors.card,
|
|
2065
|
+
borderRadius: 12,
|
|
2066
|
+
borderWidth: 1,
|
|
2067
|
+
borderColor: colors.border,
|
|
2068
|
+
shadowColor: "#000",
|
|
2069
|
+
shadowOffset: { width: 0, height: 2 },
|
|
2070
|
+
shadowOpacity: 0.06,
|
|
2071
|
+
shadowRadius: 6,
|
|
2072
|
+
elevation: 2
|
|
2073
|
+
} : {};
|
|
1983
2074
|
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: [{ transform: [{ scale }] }, disabled && styles23.disabled] }, /* @__PURE__ */ React23__default.default.createElement(
|
|
1984
2075
|
reactNative.TouchableOpacity,
|
|
1985
2076
|
{
|
|
1986
|
-
style: [styles23.container, style],
|
|
2077
|
+
style: [styles23.container, cardStyle, style],
|
|
1987
2078
|
onPress: onPress ? handlePress : void 0,
|
|
1988
2079
|
onPressIn: handlePressIn,
|
|
1989
2080
|
onPressOut: handlePressOut,
|
|
@@ -1991,10 +2082,49 @@ function ListItem({ icon, title, subtitle, trailing, onPress, disabled, style })
|
|
|
1991
2082
|
activeOpacity: 1,
|
|
1992
2083
|
touchSoundDisabled: true
|
|
1993
2084
|
},
|
|
1994
|
-
|
|
1995
|
-
/* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles23.content }, /* @__PURE__ */ React23__default.default.createElement(
|
|
1996
|
-
|
|
1997
|
-
|
|
2085
|
+
effectiveLeft ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles23.leftContainer }, effectiveLeft) : null,
|
|
2086
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles23.content }, /* @__PURE__ */ React23__default.default.createElement(
|
|
2087
|
+
reactNative.Text,
|
|
2088
|
+
{
|
|
2089
|
+
style: [styles23.title, { color: colors.foreground }, titleStyle],
|
|
2090
|
+
numberOfLines: 2,
|
|
2091
|
+
allowFontScaling: true
|
|
2092
|
+
},
|
|
2093
|
+
title
|
|
2094
|
+
), subtitle ? /* @__PURE__ */ React23__default.default.createElement(
|
|
2095
|
+
reactNative.Text,
|
|
2096
|
+
{
|
|
2097
|
+
style: [styles23.subtitle, { color: colors.mutedForeground }, subtitleStyle],
|
|
2098
|
+
numberOfLines: 2,
|
|
2099
|
+
allowFontScaling: true
|
|
2100
|
+
},
|
|
2101
|
+
subtitle
|
|
2102
|
+
) : null, caption ? /* @__PURE__ */ React23__default.default.createElement(
|
|
2103
|
+
reactNative.Text,
|
|
2104
|
+
{
|
|
2105
|
+
style: [styles23.caption, { color: colors.mutedForeground }, captionStyle],
|
|
2106
|
+
numberOfLines: 1,
|
|
2107
|
+
allowFontScaling: true
|
|
2108
|
+
},
|
|
2109
|
+
caption
|
|
2110
|
+
) : null),
|
|
2111
|
+
effectiveRight !== void 0 ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles23.rightContainer }, typeof effectiveRight === "string" ? /* @__PURE__ */ React23__default.default.createElement(
|
|
2112
|
+
reactNative.Text,
|
|
2113
|
+
{
|
|
2114
|
+
style: [styles23.rightText, { color: colors.mutedForeground }],
|
|
2115
|
+
allowFontScaling: true
|
|
2116
|
+
},
|
|
2117
|
+
effectiveRight
|
|
2118
|
+
) : effectiveRight) : showChevron ? /* @__PURE__ */ React23__default.default.createElement(vectorIcons.Entypo, { name: "chevron-with-circle-right", size: 20, color: colors.mutedForeground }) : null
|
|
2119
|
+
), showSeparator ? /* @__PURE__ */ React23__default.default.createElement(
|
|
2120
|
+
reactNative.View,
|
|
2121
|
+
{
|
|
2122
|
+
style: [
|
|
2123
|
+
styles23.separator,
|
|
2124
|
+
{ backgroundColor: colors.border, marginLeft: effectiveLeft ? 16 + 44 + 12 : 16 }
|
|
2125
|
+
]
|
|
2126
|
+
}
|
|
2127
|
+
) : null);
|
|
1998
2128
|
}
|
|
1999
2129
|
var styles23 = reactNative.StyleSheet.create({
|
|
2000
2130
|
container: {
|
|
@@ -2004,31 +2134,54 @@ var styles23 = reactNative.StyleSheet.create({
|
|
|
2004
2134
|
paddingVertical: 14,
|
|
2005
2135
|
gap: 12
|
|
2006
2136
|
},
|
|
2007
|
-
|
|
2137
|
+
leftContainer: {
|
|
2138
|
+
width: 44,
|
|
2139
|
+
height: 44,
|
|
2008
2140
|
alignItems: "center",
|
|
2009
|
-
justifyContent: "center"
|
|
2141
|
+
justifyContent: "center",
|
|
2142
|
+
flexShrink: 0
|
|
2010
2143
|
},
|
|
2011
2144
|
content: {
|
|
2012
2145
|
flex: 1,
|
|
2013
|
-
gap:
|
|
2146
|
+
gap: 4
|
|
2014
2147
|
},
|
|
2015
2148
|
title: {
|
|
2016
|
-
fontSize:
|
|
2149
|
+
fontSize: 17,
|
|
2017
2150
|
fontWeight: "500",
|
|
2018
|
-
lineHeight:
|
|
2151
|
+
lineHeight: 24
|
|
2019
2152
|
},
|
|
2020
2153
|
subtitle: {
|
|
2021
|
-
fontSize:
|
|
2022
|
-
|
|
2154
|
+
fontSize: 14,
|
|
2155
|
+
fontWeight: "400",
|
|
2156
|
+
lineHeight: 20
|
|
2157
|
+
},
|
|
2158
|
+
caption: {
|
|
2159
|
+
fontSize: 12,
|
|
2160
|
+
fontWeight: "400",
|
|
2161
|
+
lineHeight: 16,
|
|
2162
|
+
opacity: 0.7
|
|
2023
2163
|
},
|
|
2024
|
-
|
|
2164
|
+
rightContainer: {
|
|
2165
|
+
alignItems: "flex-end",
|
|
2166
|
+
justifyContent: "center",
|
|
2167
|
+
flexShrink: 0,
|
|
2168
|
+
maxWidth: 160
|
|
2169
|
+
},
|
|
2170
|
+
rightText: {
|
|
2025
2171
|
fontSize: 15
|
|
2026
2172
|
},
|
|
2173
|
+
chevron: {
|
|
2174
|
+
marginLeft: 4
|
|
2175
|
+
},
|
|
2176
|
+
separator: {
|
|
2177
|
+
height: reactNative.StyleSheet.hairlineWidth,
|
|
2178
|
+
marginRight: 16
|
|
2179
|
+
},
|
|
2027
2180
|
disabled: {
|
|
2028
2181
|
opacity: 0.45
|
|
2029
2182
|
}
|
|
2030
2183
|
});
|
|
2031
|
-
var
|
|
2184
|
+
var nativeDriver5 = reactNative.Platform.OS !== "web";
|
|
2032
2185
|
function Chip({ label, selected = false, onPress, style }) {
|
|
2033
2186
|
const { colors } = useTheme();
|
|
2034
2187
|
const scale = React23.useRef(new reactNative.Animated.Value(1)).current;
|
|
@@ -2044,7 +2197,7 @@ function Chip({ label, selected = false, onPress, style }) {
|
|
|
2044
2197
|
const handlePressIn = () => {
|
|
2045
2198
|
reactNative.Animated.spring(scale, {
|
|
2046
2199
|
toValue: 0.95,
|
|
2047
|
-
useNativeDriver:
|
|
2200
|
+
useNativeDriver: nativeDriver5,
|
|
2048
2201
|
speed: 40,
|
|
2049
2202
|
bounciness: 0
|
|
2050
2203
|
}).start();
|
|
@@ -2052,13 +2205,13 @@ function Chip({ label, selected = false, onPress, style }) {
|
|
|
2052
2205
|
const handlePressOut = () => {
|
|
2053
2206
|
reactNative.Animated.spring(scale, {
|
|
2054
2207
|
toValue: 1,
|
|
2055
|
-
useNativeDriver:
|
|
2208
|
+
useNativeDriver: nativeDriver5,
|
|
2056
2209
|
speed: 40,
|
|
2057
2210
|
bounciness: 4
|
|
2058
2211
|
}).start();
|
|
2059
2212
|
};
|
|
2060
2213
|
const handlePress = () => {
|
|
2061
|
-
|
|
2214
|
+
Haptics12__namespace.selectionAsync();
|
|
2062
2215
|
onPress?.();
|
|
2063
2216
|
};
|
|
2064
2217
|
const backgroundColor = pressAnim.interpolate({
|
|
@@ -2085,14 +2238,35 @@ function Chip({ label, selected = false, onPress, style }) {
|
|
|
2085
2238
|
/* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: [styles24.chip, { backgroundColor, borderColor }] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.Text, { style: [styles24.label, { color: textColor }], allowFontScaling: true }, label))
|
|
2086
2239
|
));
|
|
2087
2240
|
}
|
|
2088
|
-
function ChipGroup({ options, value, onValueChange, style }) {
|
|
2241
|
+
function ChipGroup({ options, value, onValueChange, multiSelect = false, style }) {
|
|
2242
|
+
const handlePress = (optionValue) => {
|
|
2243
|
+
if (!multiSelect) {
|
|
2244
|
+
onValueChange?.(optionValue);
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
const currentArray = Array.isArray(value) ? value : value ? [value] : [];
|
|
2248
|
+
const isSelected2 = currentArray.includes(optionValue);
|
|
2249
|
+
let newArray;
|
|
2250
|
+
if (isSelected2) {
|
|
2251
|
+
newArray = currentArray.filter((v) => v !== optionValue);
|
|
2252
|
+
} else {
|
|
2253
|
+
newArray = [...currentArray, optionValue];
|
|
2254
|
+
}
|
|
2255
|
+
onValueChange?.(newArray);
|
|
2256
|
+
};
|
|
2257
|
+
const isSelected = (optionValue) => {
|
|
2258
|
+
if (Array.isArray(value)) {
|
|
2259
|
+
return value.includes(optionValue);
|
|
2260
|
+
}
|
|
2261
|
+
return optionValue === value;
|
|
2262
|
+
};
|
|
2089
2263
|
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles24.group, style] }, options.map((opt) => /* @__PURE__ */ React23__default.default.createElement(
|
|
2090
2264
|
Chip,
|
|
2091
2265
|
{
|
|
2092
2266
|
key: opt.value,
|
|
2093
2267
|
label: opt.label,
|
|
2094
|
-
selected: opt.value
|
|
2095
|
-
onPress: () =>
|
|
2268
|
+
selected: isSelected(opt.value),
|
|
2269
|
+
onPress: () => handlePress(opt.value)
|
|
2096
2270
|
}
|
|
2097
2271
|
)));
|
|
2098
2272
|
}
|
|
@@ -2212,7 +2386,7 @@ var MONTH_NAMES = [
|
|
|
2212
2386
|
function MonthPicker({ value, onChange, style }) {
|
|
2213
2387
|
const { colors } = useTheme();
|
|
2214
2388
|
const handlePrev = () => {
|
|
2215
|
-
|
|
2389
|
+
Haptics12__namespace.selectionAsync();
|
|
2216
2390
|
if (value.month === 1) {
|
|
2217
2391
|
onChange({ month: 12, year: value.year - 1 });
|
|
2218
2392
|
} else {
|
|
@@ -2220,7 +2394,7 @@ function MonthPicker({ value, onChange, style }) {
|
|
|
2220
2394
|
}
|
|
2221
2395
|
};
|
|
2222
2396
|
const handleNext = () => {
|
|
2223
|
-
|
|
2397
|
+
Haptics12__namespace.selectionAsync();
|
|
2224
2398
|
if (value.month === 12) {
|
|
2225
2399
|
onChange({ month: 1, year: value.year + 1 });
|
|
2226
2400
|
} else {
|
|
@@ -2235,7 +2409,7 @@ function MonthPicker({ value, onChange, style }) {
|
|
|
2235
2409
|
activeOpacity: 0.6,
|
|
2236
2410
|
touchSoundDisabled: true
|
|
2237
2411
|
},
|
|
2238
|
-
/* @__PURE__ */ React23__default.default.createElement(
|
|
2412
|
+
/* @__PURE__ */ React23__default.default.createElement(vectorIcons.Entypo, { name: "chevron-left", size: 22, color: colors.foreground })
|
|
2239
2413
|
), /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles27.label, { color: colors.foreground }], allowFontScaling: true }, MONTH_NAMES[value.month - 1], " ", value.year), /* @__PURE__ */ React23__default.default.createElement(
|
|
2240
2414
|
reactNative.TouchableOpacity,
|
|
2241
2415
|
{
|
|
@@ -2244,7 +2418,7 @@ function MonthPicker({ value, onChange, style }) {
|
|
|
2244
2418
|
activeOpacity: 0.6,
|
|
2245
2419
|
touchSoundDisabled: true
|
|
2246
2420
|
},
|
|
2247
|
-
/* @__PURE__ */ React23__default.default.createElement(
|
|
2421
|
+
/* @__PURE__ */ React23__default.default.createElement(vectorIcons.Entypo, { name: "chevron-right", size: 22, color: colors.foreground })
|
|
2248
2422
|
));
|
|
2249
2423
|
}
|
|
2250
2424
|
var styles27 = reactNative.StyleSheet.create({
|
|
@@ -2259,10 +2433,6 @@ var styles27 = reactNative.StyleSheet.create({
|
|
|
2259
2433
|
alignItems: "center",
|
|
2260
2434
|
justifyContent: "center"
|
|
2261
2435
|
},
|
|
2262
|
-
arrowText: {
|
|
2263
|
-
fontSize: 24,
|
|
2264
|
-
lineHeight: 30
|
|
2265
|
-
},
|
|
2266
2436
|
label: {
|
|
2267
2437
|
fontSize: 17,
|
|
2268
2438
|
fontWeight: "500",
|
|
@@ -2293,7 +2463,7 @@ exports.ChipGroup = ChipGroup;
|
|
|
2293
2463
|
exports.ConfirmDialog = ConfirmDialog;
|
|
2294
2464
|
exports.CurrencyDisplay = CurrencyDisplay;
|
|
2295
2465
|
exports.CurrencyInput = CurrencyInput;
|
|
2296
|
-
exports.CurrencyInputLarge =
|
|
2466
|
+
exports.CurrencyInputLarge = CurrencyInput;
|
|
2297
2467
|
exports.EmptyState = EmptyState;
|
|
2298
2468
|
exports.Input = Input;
|
|
2299
2469
|
exports.LabelValue = LabelValue;
|