@retray-dev/ui-kit 2.5.0 → 2.5.2
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 +11 -7
- package/README.md +3 -5
- package/dist/index.js +374 -362
- package/dist/index.mjs +362 -331
- package/package.json +23 -21
- package/src/components/Accordion/Accordion.tsx +61 -57
- package/src/components/Alert/Alert.tsx +11 -10
- package/src/components/AlertBanner/AlertBanner.tsx +9 -8
- package/src/components/Avatar/Avatar.tsx +9 -8
- package/src/components/Badge/Badge.tsx +11 -10
- package/src/components/Button/Button.tsx +10 -9
- package/src/components/Card/Card.tsx +12 -11
- package/src/components/Checkbox/Checkbox.tsx +16 -13
- package/src/components/Chip/Chip.tsx +8 -7
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +12 -11
- package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +2 -1
- package/src/components/CurrencyInput/CurrencyInput.tsx +2 -1
- package/src/components/EmptyState/EmptyState.tsx +19 -18
- package/src/components/Input/Input.tsx +15 -14
- package/src/components/LabelValue/LabelValue.tsx +6 -5
- package/src/components/ListItem/ListItem.tsx +20 -19
- package/src/components/MonthPicker/MonthPicker.tsx +9 -8
- package/src/components/Progress/Progress.tsx +2 -1
- package/src/components/RadioGroup/RadioGroup.tsx +18 -15
- package/src/components/Select/Select.tsx +25 -24
- package/src/components/Sheet/Sheet.tsx +15 -14
- package/src/components/Slider/Slider.tsx +7 -6
- package/src/components/Switch/Switch.tsx +7 -6
- package/src/components/Tabs/Tabs.tsx +17 -14
- package/src/components/Text/Text.tsx +7 -6
- package/src/components/Textarea/Textarea.tsx +9 -8
- package/src/components/Toast/Toast.tsx +19 -18
- package/src/components/Toggle/Toggle.tsx +9 -8
- package/src/utils/haptics.ts +32 -0
- package/src/utils/scaling.ts +26 -0
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React23, { createContext, useMemo, useContext, useRef, useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { Platform, StyleSheet, useColorScheme, Animated, TouchableOpacity, ActivityIndicator, Text, View, TextInput, Image, Easing, Modal } from 'react-native';
|
|
3
|
-
import
|
|
2
|
+
import { Platform, StyleSheet, useColorScheme, Animated, TouchableOpacity, ActivityIndicator, Text, View, TextInput, Image, Easing, Modal, Pressable } from 'react-native';
|
|
3
|
+
import { verticalScale, scale, moderateScale, moderateVerticalScale } from 'react-native-size-matters';
|
|
4
4
|
import { AntDesign, Entypo, FontAwesome5, MaterialIcons } from '@expo/vector-icons';
|
|
5
5
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
|
-
import
|
|
6
|
+
import Animated10, { useSharedValue, useDerivedValue, withTiming, Easing as Easing$1, useAnimatedStyle, withSpring } from 'react-native-reanimated';
|
|
7
7
|
import RNSlider from '@react-native-community/slider';
|
|
8
8
|
import { BottomSheetModal, BottomSheetView, BottomSheetBackdrop } from '@gorhom/bottom-sheet';
|
|
9
9
|
export { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
@@ -12,7 +12,12 @@ import { scheduleOnRN } from 'react-native-worklets';
|
|
|
12
12
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
13
13
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
16
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
17
|
+
}) : x)(function(x) {
|
|
18
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
19
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
20
|
+
});
|
|
16
21
|
|
|
17
22
|
// src/theme/colors.ts
|
|
18
23
|
var defaultLight = {
|
|
@@ -80,16 +85,39 @@ function useTheme() {
|
|
|
80
85
|
}
|
|
81
86
|
return context;
|
|
82
87
|
}
|
|
88
|
+
var Haptics = null;
|
|
89
|
+
if (Platform.OS !== "web") {
|
|
90
|
+
Haptics = __require("expo-haptics");
|
|
91
|
+
}
|
|
92
|
+
function selectionAsync() {
|
|
93
|
+
Haptics?.selectionAsync();
|
|
94
|
+
}
|
|
95
|
+
function impactLight() {
|
|
96
|
+
Haptics?.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
|
97
|
+
}
|
|
98
|
+
function notificationSuccess() {
|
|
99
|
+
Haptics?.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
|
100
|
+
}
|
|
101
|
+
function notificationError() {
|
|
102
|
+
Haptics?.notificationAsync(Haptics.NotificationFeedbackType.Error);
|
|
103
|
+
}
|
|
104
|
+
var isWeb = Platform.OS === "web";
|
|
105
|
+
var s = isWeb ? (n) => n : scale;
|
|
106
|
+
var vs = isWeb ? (n) => n : verticalScale;
|
|
107
|
+
var ms = isWeb ? (n, _factor) => n : moderateScale;
|
|
108
|
+
var mvs = isWeb ? (n, _factor) => n : moderateVerticalScale;
|
|
109
|
+
|
|
110
|
+
// src/components/Button/Button.tsx
|
|
83
111
|
var nativeDriver = Platform.OS !== "web";
|
|
84
112
|
var containerSizeStyles = {
|
|
85
|
-
sm: { paddingHorizontal: 20, paddingVertical: 10 },
|
|
86
|
-
md: { paddingHorizontal: 24, paddingVertical: 14 },
|
|
87
|
-
lg: { paddingHorizontal: 32, paddingVertical: 18 }
|
|
113
|
+
sm: { paddingHorizontal: s(20), paddingVertical: vs(10) },
|
|
114
|
+
md: { paddingHorizontal: s(24), paddingVertical: vs(14) },
|
|
115
|
+
lg: { paddingHorizontal: s(32), paddingVertical: vs(18) }
|
|
88
116
|
};
|
|
89
117
|
var labelSizeStyles = {
|
|
90
|
-
sm: { fontSize: 15 },
|
|
91
|
-
md: { fontSize: 17 },
|
|
92
|
-
lg: { fontSize: 18 }
|
|
118
|
+
sm: { fontSize: ms(15) },
|
|
119
|
+
md: { fontSize: ms(17) },
|
|
120
|
+
lg: { fontSize: ms(18) }
|
|
93
121
|
};
|
|
94
122
|
function Button({
|
|
95
123
|
label,
|
|
@@ -106,10 +134,10 @@ function Button({
|
|
|
106
134
|
}) {
|
|
107
135
|
const { colors } = useTheme();
|
|
108
136
|
const isDisabled = disabled || loading;
|
|
109
|
-
const
|
|
137
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
110
138
|
const handlePressIn = () => {
|
|
111
139
|
if (isDisabled) return;
|
|
112
|
-
Animated.spring(
|
|
140
|
+
Animated.spring(scale2, {
|
|
113
141
|
toValue: 0.95,
|
|
114
142
|
useNativeDriver: nativeDriver,
|
|
115
143
|
speed: 40,
|
|
@@ -117,10 +145,10 @@ function Button({
|
|
|
117
145
|
}).start();
|
|
118
146
|
};
|
|
119
147
|
const handlePressOut = () => {
|
|
120
|
-
Animated.spring(
|
|
148
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: nativeDriver, speed: 40, bounciness: 4 }).start();
|
|
121
149
|
};
|
|
122
150
|
const handlePress = (e) => {
|
|
123
|
-
|
|
151
|
+
impactLight();
|
|
124
152
|
onPress?.(e);
|
|
125
153
|
};
|
|
126
154
|
const containerVariantStyle = {
|
|
@@ -138,7 +166,7 @@ function Button({
|
|
|
138
166
|
destructive: { color: colors.destructiveForeground }
|
|
139
167
|
}[variant];
|
|
140
168
|
const spinnerColor = variant === "destructive" ? colors.destructiveForeground : variant === "primary" || variant === "secondary" ? colors.primaryForeground : colors.foreground;
|
|
141
|
-
return /* @__PURE__ */ React23.createElement(Animated.View, { style: [fullWidth && styles.fullWidth, { transform: [{ scale }] }] }, /* @__PURE__ */ React23.createElement(
|
|
169
|
+
return /* @__PURE__ */ React23.createElement(Animated.View, { style: [fullWidth && styles.fullWidth, { transform: [{ scale: scale2 }] }] }, /* @__PURE__ */ React23.createElement(
|
|
142
170
|
TouchableOpacity,
|
|
143
171
|
{
|
|
144
172
|
style: [
|
|
@@ -177,16 +205,16 @@ var styles = StyleSheet.create({
|
|
|
177
205
|
fontWeight: "600"
|
|
178
206
|
},
|
|
179
207
|
labelWithIcon: {
|
|
180
|
-
marginHorizontal: 8
|
|
208
|
+
marginHorizontal: s(8)
|
|
181
209
|
}
|
|
182
210
|
});
|
|
183
211
|
var variantStyles = {
|
|
184
|
-
h1: { fontSize: 40, fontWeight: "700", lineHeight: 52 },
|
|
185
|
-
h2: { fontSize: 28, fontWeight: "700", lineHeight: 36 },
|
|
186
|
-
h3: { fontSize: 22, fontWeight: "600", lineHeight: 30 },
|
|
187
|
-
body: { fontSize: 17, fontWeight: "400", lineHeight: 26 },
|
|
188
|
-
caption: { fontSize: 13, fontWeight: "400", lineHeight: 20 },
|
|
189
|
-
label: { fontSize: 15, fontWeight: "500", lineHeight: 22 }
|
|
212
|
+
h1: { fontSize: ms(40), fontWeight: "700", lineHeight: mvs(52) },
|
|
213
|
+
h2: { fontSize: ms(28), fontWeight: "700", lineHeight: mvs(36) },
|
|
214
|
+
h3: { fontSize: ms(22), fontWeight: "600", lineHeight: mvs(30) },
|
|
215
|
+
body: { fontSize: ms(17), fontWeight: "400", lineHeight: mvs(26) },
|
|
216
|
+
caption: { fontSize: ms(13), fontWeight: "400", lineHeight: mvs(20) },
|
|
217
|
+
label: { fontSize: ms(15), fontWeight: "500", lineHeight: mvs(22) }
|
|
190
218
|
};
|
|
191
219
|
function Text2({ variant = "body", color, style, children, ...props }) {
|
|
192
220
|
const { colors } = useTheme();
|
|
@@ -251,60 +279,60 @@ function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, t
|
|
|
251
279
|
}
|
|
252
280
|
var styles2 = StyleSheet.create({
|
|
253
281
|
container: {
|
|
254
|
-
gap: 8
|
|
282
|
+
gap: vs(8)
|
|
255
283
|
},
|
|
256
284
|
label: {
|
|
257
|
-
fontSize: 15,
|
|
285
|
+
fontSize: ms(15),
|
|
258
286
|
fontWeight: "500"
|
|
259
287
|
},
|
|
260
288
|
inputWrapper: {
|
|
261
289
|
flexDirection: "row",
|
|
262
290
|
alignItems: "center",
|
|
263
291
|
borderWidth: 1.5,
|
|
264
|
-
borderRadius: 8,
|
|
265
|
-
paddingHorizontal: 16,
|
|
266
|
-
paddingVertical: 14
|
|
292
|
+
borderRadius: ms(8),
|
|
293
|
+
paddingHorizontal: s(16),
|
|
294
|
+
paddingVertical: vs(14)
|
|
267
295
|
},
|
|
268
296
|
input: {
|
|
269
297
|
flex: 1,
|
|
270
|
-
fontSize: 17,
|
|
298
|
+
fontSize: ms(17),
|
|
271
299
|
paddingVertical: 0
|
|
272
300
|
},
|
|
273
301
|
prefixContainer: {
|
|
274
|
-
marginRight: 8
|
|
302
|
+
marginRight: s(8)
|
|
275
303
|
},
|
|
276
304
|
prefixText: {
|
|
277
|
-
fontSize: 17,
|
|
278
|
-
marginRight: 8
|
|
305
|
+
fontSize: ms(17),
|
|
306
|
+
marginRight: s(8)
|
|
279
307
|
},
|
|
280
308
|
suffixContainer: {
|
|
281
|
-
marginLeft: 8
|
|
309
|
+
marginLeft: s(8)
|
|
282
310
|
},
|
|
283
311
|
suffixText: {
|
|
284
|
-
fontSize: 17,
|
|
285
|
-
marginLeft: 8
|
|
312
|
+
fontSize: ms(17),
|
|
313
|
+
marginLeft: s(8)
|
|
286
314
|
},
|
|
287
315
|
passwordToggle: {
|
|
288
|
-
padding: 4
|
|
316
|
+
padding: s(4)
|
|
289
317
|
},
|
|
290
318
|
helperText: {
|
|
291
|
-
fontSize: 13
|
|
319
|
+
fontSize: ms(13)
|
|
292
320
|
}
|
|
293
321
|
});
|
|
294
322
|
var sizePadding = {
|
|
295
|
-
sm: { paddingHorizontal: 8, paddingVertical: 2 },
|
|
296
|
-
md: { paddingHorizontal: 10, paddingVertical: 4 },
|
|
297
|
-
lg: { paddingHorizontal: 12, paddingVertical: 6 }
|
|
323
|
+
sm: { paddingHorizontal: s(8), paddingVertical: vs(2) },
|
|
324
|
+
md: { paddingHorizontal: s(10), paddingVertical: vs(4) },
|
|
325
|
+
lg: { paddingHorizontal: s(12), paddingVertical: vs(6) }
|
|
298
326
|
};
|
|
299
327
|
var sizeFontSize = {
|
|
300
|
-
sm: { fontSize: 11 },
|
|
301
|
-
md: { fontSize: 13 },
|
|
302
|
-
lg: { fontSize: 15 }
|
|
328
|
+
sm: { fontSize: ms(11) },
|
|
329
|
+
md: { fontSize: ms(13) },
|
|
330
|
+
lg: { fontSize: ms(15) }
|
|
303
331
|
};
|
|
304
332
|
var sizeIconGap = {
|
|
305
|
-
sm: 4,
|
|
306
|
-
md: 6,
|
|
307
|
-
lg: 6
|
|
333
|
+
sm: s(4),
|
|
334
|
+
md: s(6),
|
|
335
|
+
lg: s(6)
|
|
308
336
|
};
|
|
309
337
|
function Badge({ label, children, variant = "default", size = "md", icon, style }) {
|
|
310
338
|
const { colors } = useTheme();
|
|
@@ -325,7 +353,7 @@ function Badge({ label, children, variant = "default", size = "md", icon, style
|
|
|
325
353
|
}
|
|
326
354
|
var styles3 = StyleSheet.create({
|
|
327
355
|
container: {
|
|
328
|
-
borderRadius: 6,
|
|
356
|
+
borderRadius: ms(6),
|
|
329
357
|
alignSelf: "flex-start",
|
|
330
358
|
flexDirection: "row",
|
|
331
359
|
alignItems: "center"
|
|
@@ -341,10 +369,10 @@ var styles3 = StyleSheet.create({
|
|
|
341
369
|
var nativeDriver2 = Platform.OS !== "web";
|
|
342
370
|
function Card({ children, variant = "elevated", onPress, style }) {
|
|
343
371
|
const { colors } = useTheme();
|
|
344
|
-
const
|
|
372
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
345
373
|
const handlePressIn = () => {
|
|
346
374
|
if (!onPress) return;
|
|
347
|
-
Animated.spring(
|
|
375
|
+
Animated.spring(scale2, {
|
|
348
376
|
toValue: 0.98,
|
|
349
377
|
useNativeDriver: nativeDriver2,
|
|
350
378
|
speed: 40,
|
|
@@ -353,7 +381,7 @@ function Card({ children, variant = "elevated", onPress, style }) {
|
|
|
353
381
|
};
|
|
354
382
|
const handlePressOut = () => {
|
|
355
383
|
if (!onPress) return;
|
|
356
|
-
Animated.spring(
|
|
384
|
+
Animated.spring(scale2, {
|
|
357
385
|
toValue: 1,
|
|
358
386
|
useNativeDriver: nativeDriver2,
|
|
359
387
|
speed: 40,
|
|
@@ -362,7 +390,7 @@ function Card({ children, variant = "elevated", onPress, style }) {
|
|
|
362
390
|
};
|
|
363
391
|
const handlePress = () => {
|
|
364
392
|
if (!onPress) return;
|
|
365
|
-
|
|
393
|
+
impactLight();
|
|
366
394
|
onPress();
|
|
367
395
|
};
|
|
368
396
|
const variantStyle = {
|
|
@@ -390,7 +418,7 @@ function Card({ children, variant = "elevated", onPress, style }) {
|
|
|
390
418
|
}[variant];
|
|
391
419
|
const cardContent = /* @__PURE__ */ React23.createElement(View, { style: [styles4.card, variantStyle, style] }, children);
|
|
392
420
|
if (onPress) {
|
|
393
|
-
return /* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23.createElement(
|
|
421
|
+
return /* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale: scale2 }] } }, /* @__PURE__ */ React23.createElement(
|
|
394
422
|
TouchableOpacity,
|
|
395
423
|
{
|
|
396
424
|
onPress: handlePress,
|
|
@@ -423,28 +451,28 @@ function CardFooter({ children, style }) {
|
|
|
423
451
|
}
|
|
424
452
|
var styles4 = StyleSheet.create({
|
|
425
453
|
card: {
|
|
426
|
-
borderRadius: 12,
|
|
454
|
+
borderRadius: ms(12),
|
|
427
455
|
borderWidth: 1
|
|
428
456
|
},
|
|
429
457
|
header: {
|
|
430
|
-
padding: 24,
|
|
458
|
+
padding: s(24),
|
|
431
459
|
paddingBottom: 0,
|
|
432
|
-
gap: 8
|
|
460
|
+
gap: vs(8)
|
|
433
461
|
},
|
|
434
462
|
title: {
|
|
435
|
-
fontSize: 20,
|
|
463
|
+
fontSize: ms(20),
|
|
436
464
|
fontWeight: "600",
|
|
437
|
-
lineHeight: 28
|
|
465
|
+
lineHeight: mvs(28)
|
|
438
466
|
},
|
|
439
467
|
description: {
|
|
440
|
-
fontSize: 15,
|
|
441
|
-
lineHeight: 22
|
|
468
|
+
fontSize: ms(15),
|
|
469
|
+
lineHeight: mvs(22)
|
|
442
470
|
},
|
|
443
471
|
content: {
|
|
444
|
-
padding: 24
|
|
472
|
+
padding: s(24)
|
|
445
473
|
},
|
|
446
474
|
footer: {
|
|
447
|
-
padding: 24,
|
|
475
|
+
padding: s(24),
|
|
448
476
|
paddingTop: 0,
|
|
449
477
|
flexDirection: "row",
|
|
450
478
|
alignItems: "center"
|
|
@@ -529,16 +557,16 @@ var styles6 = StyleSheet.create({
|
|
|
529
557
|
}
|
|
530
558
|
});
|
|
531
559
|
var sizeMap2 = {
|
|
532
|
-
sm: 28,
|
|
533
|
-
md: 40,
|
|
534
|
-
lg: 56,
|
|
535
|
-
xl: 72
|
|
560
|
+
sm: s(28),
|
|
561
|
+
md: s(40),
|
|
562
|
+
lg: s(56),
|
|
563
|
+
xl: s(72)
|
|
536
564
|
};
|
|
537
565
|
var fontSizeMap = {
|
|
538
|
-
sm: 12,
|
|
539
|
-
md: 16,
|
|
540
|
-
lg: 22,
|
|
541
|
-
xl: 28
|
|
566
|
+
sm: ms(12),
|
|
567
|
+
md: ms(16),
|
|
568
|
+
lg: ms(22),
|
|
569
|
+
xl: ms(28)
|
|
542
570
|
};
|
|
543
571
|
function Avatar({ src, fallback, size = "md", style }) {
|
|
544
572
|
const { colors } = useTheme();
|
|
@@ -589,9 +617,9 @@ var styles8 = StyleSheet.create({
|
|
|
589
617
|
container: {
|
|
590
618
|
flexDirection: "row",
|
|
591
619
|
borderWidth: 1,
|
|
592
|
-
borderRadius: 12,
|
|
593
|
-
padding: 16,
|
|
594
|
-
gap: 12,
|
|
620
|
+
borderRadius: ms(12),
|
|
621
|
+
padding: s(16),
|
|
622
|
+
gap: s(12),
|
|
595
623
|
shadowColor: "#000",
|
|
596
624
|
shadowOffset: { width: 0, height: 4 },
|
|
597
625
|
shadowOpacity: 0.06,
|
|
@@ -603,16 +631,16 @@ var styles8 = StyleSheet.create({
|
|
|
603
631
|
},
|
|
604
632
|
content: {
|
|
605
633
|
flex: 1,
|
|
606
|
-
gap: 4
|
|
634
|
+
gap: vs(4)
|
|
607
635
|
},
|
|
608
636
|
title: {
|
|
609
|
-
fontSize: 14,
|
|
637
|
+
fontSize: ms(14),
|
|
610
638
|
fontWeight: "500",
|
|
611
|
-
lineHeight: 20
|
|
639
|
+
lineHeight: mvs(20)
|
|
612
640
|
},
|
|
613
641
|
description: {
|
|
614
|
-
fontSize: 14,
|
|
615
|
-
lineHeight: 20
|
|
642
|
+
fontSize: ms(14),
|
|
643
|
+
lineHeight: mvs(20)
|
|
616
644
|
}
|
|
617
645
|
});
|
|
618
646
|
function Progress({ value = 0, max = 100, style }) {
|
|
@@ -645,7 +673,7 @@ function Progress({ value = 0, max = 100, style }) {
|
|
|
645
673
|
}
|
|
646
674
|
var styles9 = StyleSheet.create({
|
|
647
675
|
track: {
|
|
648
|
-
height: 8,
|
|
676
|
+
height: vs(8),
|
|
649
677
|
borderRadius: 999,
|
|
650
678
|
overflow: "hidden",
|
|
651
679
|
width: "100%"
|
|
@@ -696,46 +724,46 @@ var styles10 = StyleSheet.create({
|
|
|
696
724
|
justifyContent: "center",
|
|
697
725
|
borderWidth: 1,
|
|
698
726
|
borderStyle: "dashed",
|
|
699
|
-
borderRadius: 12,
|
|
700
|
-
padding: 32,
|
|
701
|
-
gap: 16
|
|
727
|
+
borderRadius: ms(12),
|
|
728
|
+
padding: s(32),
|
|
729
|
+
gap: vs(16)
|
|
702
730
|
},
|
|
703
731
|
containerCompact: {
|
|
704
|
-
padding: 20,
|
|
705
|
-
gap: 10
|
|
732
|
+
padding: s(20),
|
|
733
|
+
gap: vs(10)
|
|
706
734
|
},
|
|
707
735
|
iconWrapper: {
|
|
708
|
-
width: 48,
|
|
709
|
-
height: 48,
|
|
710
|
-
borderRadius: 12,
|
|
736
|
+
width: s(48),
|
|
737
|
+
height: s(48),
|
|
738
|
+
borderRadius: ms(12),
|
|
711
739
|
alignItems: "center",
|
|
712
740
|
justifyContent: "center"
|
|
713
741
|
},
|
|
714
742
|
iconWrapperCompact: {
|
|
715
|
-
width: 36,
|
|
716
|
-
height: 36,
|
|
717
|
-
borderRadius: 8
|
|
743
|
+
width: s(36),
|
|
744
|
+
height: s(36),
|
|
745
|
+
borderRadius: ms(8)
|
|
718
746
|
},
|
|
719
747
|
textWrapper: {
|
|
720
748
|
alignItems: "center",
|
|
721
|
-
gap: 8,
|
|
722
|
-
maxWidth: 320
|
|
749
|
+
gap: vs(8),
|
|
750
|
+
maxWidth: s(320)
|
|
723
751
|
},
|
|
724
752
|
title: {
|
|
725
|
-
fontSize: 18,
|
|
753
|
+
fontSize: ms(18),
|
|
726
754
|
fontWeight: "500",
|
|
727
755
|
textAlign: "center"
|
|
728
756
|
},
|
|
729
757
|
titleCompact: {
|
|
730
|
-
fontSize: 15
|
|
758
|
+
fontSize: ms(15)
|
|
731
759
|
},
|
|
732
760
|
description: {
|
|
733
|
-
fontSize: 14,
|
|
734
|
-
lineHeight: 20,
|
|
761
|
+
fontSize: ms(14),
|
|
762
|
+
lineHeight: mvs(20),
|
|
735
763
|
textAlign: "center"
|
|
736
764
|
},
|
|
737
765
|
action: {
|
|
738
|
-
marginTop: 8
|
|
766
|
+
marginTop: vs(8)
|
|
739
767
|
}
|
|
740
768
|
});
|
|
741
769
|
var webInputResetStyle2 = Platform.OS === "web" ? { outlineStyle: "none", outlineWidth: 0, outlineColor: "transparent", boxShadow: "none" } : {};
|
|
@@ -764,7 +792,7 @@ function Textarea({
|
|
|
764
792
|
borderColor: error ? colors.destructive : focused ? colors.ring ?? colors.primary : colors.border,
|
|
765
793
|
color: colors.foreground,
|
|
766
794
|
backgroundColor: colors.background,
|
|
767
|
-
minHeight: rows * 30
|
|
795
|
+
minHeight: rows * vs(30)
|
|
768
796
|
},
|
|
769
797
|
webInputResetStyle2,
|
|
770
798
|
style
|
|
@@ -785,23 +813,24 @@ function Textarea({
|
|
|
785
813
|
}
|
|
786
814
|
var styles11 = StyleSheet.create({
|
|
787
815
|
container: {
|
|
788
|
-
gap: 8
|
|
816
|
+
gap: vs(8)
|
|
789
817
|
},
|
|
790
818
|
label: {
|
|
791
|
-
fontSize: 15,
|
|
819
|
+
fontSize: ms(15),
|
|
792
820
|
fontWeight: "500"
|
|
793
821
|
},
|
|
794
822
|
input: {
|
|
795
823
|
borderWidth: 1.5,
|
|
796
|
-
borderRadius: 8,
|
|
797
|
-
paddingHorizontal: 16,
|
|
798
|
-
paddingVertical: 14,
|
|
799
|
-
fontSize: 17
|
|
824
|
+
borderRadius: ms(8),
|
|
825
|
+
paddingHorizontal: s(16),
|
|
826
|
+
paddingVertical: vs(14),
|
|
827
|
+
fontSize: ms(17)
|
|
800
828
|
},
|
|
801
829
|
helperText: {
|
|
802
|
-
fontSize: 13
|
|
830
|
+
fontSize: ms(13)
|
|
803
831
|
}
|
|
804
832
|
});
|
|
833
|
+
var nativeDriver3 = Platform.OS !== "web";
|
|
805
834
|
function Checkbox({
|
|
806
835
|
checked = false,
|
|
807
836
|
onCheckedChange,
|
|
@@ -810,20 +839,20 @@ function Checkbox({
|
|
|
810
839
|
style
|
|
811
840
|
}) {
|
|
812
841
|
const { colors } = useTheme();
|
|
813
|
-
const
|
|
842
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
814
843
|
const handlePressIn = () => {
|
|
815
844
|
if (disabled) return;
|
|
816
|
-
Animated.spring(
|
|
845
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: nativeDriver3, speed: 40, bounciness: 0 }).start();
|
|
817
846
|
};
|
|
818
847
|
const handlePressOut = () => {
|
|
819
|
-
Animated.spring(
|
|
848
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: nativeDriver3, speed: 40, bounciness: 4 }).start();
|
|
820
849
|
};
|
|
821
|
-
return /* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23.createElement(
|
|
850
|
+
return /* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale: scale2 }] } }, /* @__PURE__ */ React23.createElement(
|
|
822
851
|
TouchableOpacity,
|
|
823
852
|
{
|
|
824
853
|
style: [styles12.row, style],
|
|
825
854
|
onPress: () => {
|
|
826
|
-
|
|
855
|
+
selectionAsync();
|
|
827
856
|
onCheckedChange?.(!checked);
|
|
828
857
|
},
|
|
829
858
|
onPressIn: handlePressIn,
|
|
@@ -859,33 +888,33 @@ var styles12 = StyleSheet.create({
|
|
|
859
888
|
row: {
|
|
860
889
|
flexDirection: "row",
|
|
861
890
|
alignItems: "center",
|
|
862
|
-
gap: 12
|
|
891
|
+
gap: s(12)
|
|
863
892
|
},
|
|
864
893
|
box: {
|
|
865
|
-
width: 24,
|
|
866
|
-
height: 24,
|
|
867
|
-
borderRadius: 8,
|
|
894
|
+
width: s(24),
|
|
895
|
+
height: s(24),
|
|
896
|
+
borderRadius: ms(8),
|
|
868
897
|
borderWidth: 1.5,
|
|
869
898
|
alignItems: "center",
|
|
870
899
|
justifyContent: "center"
|
|
871
900
|
},
|
|
872
901
|
checkmark: {
|
|
873
|
-
width: 12,
|
|
874
|
-
height: 7,
|
|
902
|
+
width: s(12),
|
|
903
|
+
height: vs(7),
|
|
875
904
|
borderLeftWidth: 2,
|
|
876
905
|
borderBottomWidth: 2,
|
|
877
906
|
transform: [{ rotate: "-45deg" }, { translateY: -1 }]
|
|
878
907
|
},
|
|
879
908
|
label: {
|
|
880
|
-
fontSize: 15,
|
|
881
|
-
lineHeight: 22
|
|
909
|
+
fontSize: ms(15),
|
|
910
|
+
lineHeight: mvs(22)
|
|
882
911
|
}
|
|
883
912
|
});
|
|
884
|
-
var
|
|
885
|
-
var TRACK_WIDTH = 60;
|
|
886
|
-
var TRACK_HEIGHT = 36;
|
|
887
|
-
var THUMB_SIZE = 28;
|
|
888
|
-
var THUMB_OFFSET = 4;
|
|
913
|
+
var nativeDriver4 = Platform.OS !== "web";
|
|
914
|
+
var TRACK_WIDTH = s(60);
|
|
915
|
+
var TRACK_HEIGHT = vs(36);
|
|
916
|
+
var THUMB_SIZE = s(28);
|
|
917
|
+
var THUMB_OFFSET = s(4);
|
|
889
918
|
var THUMB_TRAVEL = TRACK_WIDTH - THUMB_SIZE - THUMB_OFFSET * 2;
|
|
890
919
|
function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
891
920
|
const { colors } = useTheme();
|
|
@@ -895,7 +924,7 @@ function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
|
895
924
|
Animated.parallel([
|
|
896
925
|
Animated.spring(translateX, {
|
|
897
926
|
toValue: checked ? THUMB_TRAVEL : 0,
|
|
898
|
-
useNativeDriver:
|
|
927
|
+
useNativeDriver: nativeDriver4,
|
|
899
928
|
bounciness: 4
|
|
900
929
|
}),
|
|
901
930
|
Animated.timing(trackOpacity, {
|
|
@@ -913,7 +942,7 @@ function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
|
913
942
|
TouchableOpacity,
|
|
914
943
|
{
|
|
915
944
|
onPress: () => {
|
|
916
|
-
|
|
945
|
+
selectionAsync();
|
|
917
946
|
onCheckedChange?.(!checked);
|
|
918
947
|
},
|
|
919
948
|
disabled,
|
|
@@ -956,9 +985,9 @@ var styles13 = StyleSheet.create({
|
|
|
956
985
|
}
|
|
957
986
|
});
|
|
958
987
|
var sizeStyles = {
|
|
959
|
-
sm: { paddingHorizontal: 12, paddingVertical: 8, minWidth: 40, minHeight: 40 },
|
|
960
|
-
md: { paddingHorizontal: 16, paddingVertical: 12, minWidth: 44, minHeight: 44 },
|
|
961
|
-
lg: { paddingHorizontal: 20, paddingVertical: 14, minWidth: 48, minHeight: 48 }
|
|
988
|
+
sm: { paddingHorizontal: s(12), paddingVertical: vs(8), minWidth: s(40), minHeight: vs(40) },
|
|
989
|
+
md: { paddingHorizontal: s(16), paddingVertical: vs(12), minWidth: s(44), minHeight: vs(44) },
|
|
990
|
+
lg: { paddingHorizontal: s(20), paddingVertical: vs(14), minWidth: s(48), minHeight: vs(48) }
|
|
962
991
|
};
|
|
963
992
|
function Toggle({
|
|
964
993
|
pressed = false,
|
|
@@ -973,7 +1002,7 @@ function Toggle({
|
|
|
973
1002
|
...props
|
|
974
1003
|
}) {
|
|
975
1004
|
const { colors } = useTheme();
|
|
976
|
-
const
|
|
1005
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
977
1006
|
const pressAnim = useRef(new Animated.Value(pressed ? 1 : 0)).current;
|
|
978
1007
|
useEffect(() => {
|
|
979
1008
|
Animated.timing(pressAnim, {
|
|
@@ -985,10 +1014,10 @@ function Toggle({
|
|
|
985
1014
|
}, [pressed, pressAnim]);
|
|
986
1015
|
const handlePressIn = () => {
|
|
987
1016
|
if (disabled) return;
|
|
988
|
-
Animated.spring(
|
|
1017
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: true, speed: 40, bounciness: 0 }).start();
|
|
989
1018
|
};
|
|
990
1019
|
const handlePressOut = () => {
|
|
991
|
-
Animated.spring(
|
|
1020
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: true, speed: 40, bounciness: 4 }).start();
|
|
992
1021
|
};
|
|
993
1022
|
const borderColor = pressAnim.interpolate({
|
|
994
1023
|
inputRange: [0, 1],
|
|
@@ -1017,11 +1046,11 @@ function Toggle({
|
|
|
1017
1046
|
if (custom) return /* @__PURE__ */ React23.createElement(React23.Fragment, null, custom);
|
|
1018
1047
|
return /* @__PURE__ */ React23.createElement(FontAwesome5, { name: "circle", size: 20, color: colors.mutedForeground });
|
|
1019
1048
|
};
|
|
1020
|
-
return /* @__PURE__ */ React23.createElement(Animated.View, { style: [{ transform: [{ scale }] }, disabled && styles14.disabled, style] }, /* @__PURE__ */ React23.createElement(
|
|
1049
|
+
return /* @__PURE__ */ React23.createElement(Animated.View, { style: [{ transform: [{ scale: scale2 }] }, disabled && styles14.disabled, style] }, /* @__PURE__ */ React23.createElement(
|
|
1021
1050
|
TouchableOpacity,
|
|
1022
1051
|
{
|
|
1023
1052
|
onPress: () => {
|
|
1024
|
-
|
|
1053
|
+
selectionAsync();
|
|
1025
1054
|
onPressedChange?.(!pressed);
|
|
1026
1055
|
},
|
|
1027
1056
|
onPressIn: handlePressIn,
|
|
@@ -1046,43 +1075,44 @@ function Toggle({
|
|
|
1046
1075
|
}
|
|
1047
1076
|
var styles14 = StyleSheet.create({
|
|
1048
1077
|
base: {
|
|
1049
|
-
borderRadius: 8
|
|
1078
|
+
borderRadius: ms(8)
|
|
1050
1079
|
},
|
|
1051
1080
|
inner: {
|
|
1052
1081
|
flexDirection: "row",
|
|
1053
1082
|
alignItems: "center",
|
|
1054
1083
|
justifyContent: "center",
|
|
1055
|
-
gap: 8
|
|
1084
|
+
gap: s(8)
|
|
1056
1085
|
},
|
|
1057
1086
|
disabled: {
|
|
1058
1087
|
opacity: 0.45
|
|
1059
1088
|
},
|
|
1060
1089
|
label: {
|
|
1061
|
-
fontSize: 14,
|
|
1090
|
+
fontSize: ms(14),
|
|
1062
1091
|
fontWeight: "500"
|
|
1063
1092
|
}
|
|
1064
1093
|
});
|
|
1094
|
+
var nativeDriver5 = Platform.OS !== "web";
|
|
1065
1095
|
function RadioItem({
|
|
1066
1096
|
option,
|
|
1067
1097
|
selected,
|
|
1068
1098
|
onSelect
|
|
1069
1099
|
}) {
|
|
1070
1100
|
const { colors } = useTheme();
|
|
1071
|
-
const
|
|
1101
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
1072
1102
|
const handlePressIn = () => {
|
|
1073
1103
|
if (option.disabled) return;
|
|
1074
|
-
Animated.spring(
|
|
1104
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: nativeDriver5, speed: 40, bounciness: 0 }).start();
|
|
1075
1105
|
};
|
|
1076
1106
|
const handlePressOut = () => {
|
|
1077
|
-
Animated.spring(
|
|
1107
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: nativeDriver5, speed: 40, bounciness: 4 }).start();
|
|
1078
1108
|
};
|
|
1079
|
-
return /* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23.createElement(
|
|
1109
|
+
return /* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale: scale2 }] } }, /* @__PURE__ */ React23.createElement(
|
|
1080
1110
|
TouchableOpacity,
|
|
1081
1111
|
{
|
|
1082
1112
|
style: styles15.row,
|
|
1083
1113
|
onPress: () => {
|
|
1084
1114
|
if (!option.disabled) {
|
|
1085
|
-
|
|
1115
|
+
selectionAsync();
|
|
1086
1116
|
onSelect();
|
|
1087
1117
|
}
|
|
1088
1118
|
},
|
|
@@ -1136,7 +1166,7 @@ function RadioGroup({
|
|
|
1136
1166
|
}
|
|
1137
1167
|
var styles15 = StyleSheet.create({
|
|
1138
1168
|
container: {
|
|
1139
|
-
gap: 12
|
|
1169
|
+
gap: vs(12)
|
|
1140
1170
|
},
|
|
1141
1171
|
horizontal: {
|
|
1142
1172
|
flexDirection: "row",
|
|
@@ -1145,26 +1175,27 @@ var styles15 = StyleSheet.create({
|
|
|
1145
1175
|
row: {
|
|
1146
1176
|
flexDirection: "row",
|
|
1147
1177
|
alignItems: "center",
|
|
1148
|
-
gap: 12
|
|
1178
|
+
gap: s(12)
|
|
1149
1179
|
},
|
|
1150
1180
|
radio: {
|
|
1151
|
-
width: 24,
|
|
1152
|
-
height: 24,
|
|
1153
|
-
borderRadius: 12,
|
|
1181
|
+
width: s(24),
|
|
1182
|
+
height: s(24),
|
|
1183
|
+
borderRadius: s(12),
|
|
1154
1184
|
borderWidth: 1.5,
|
|
1155
1185
|
alignItems: "center",
|
|
1156
1186
|
justifyContent: "center"
|
|
1157
1187
|
},
|
|
1158
1188
|
dot: {
|
|
1159
|
-
width: 10,
|
|
1160
|
-
height: 10,
|
|
1161
|
-
borderRadius: 5
|
|
1189
|
+
width: s(10),
|
|
1190
|
+
height: s(10),
|
|
1191
|
+
borderRadius: s(5)
|
|
1162
1192
|
},
|
|
1163
1193
|
label: {
|
|
1164
|
-
fontSize: 14,
|
|
1165
|
-
lineHeight: 20
|
|
1194
|
+
fontSize: ms(14),
|
|
1195
|
+
lineHeight: mvs(20)
|
|
1166
1196
|
}
|
|
1167
1197
|
});
|
|
1198
|
+
var nativeDriver6 = Platform.OS !== "web";
|
|
1168
1199
|
function TabTrigger({
|
|
1169
1200
|
tab,
|
|
1170
1201
|
isActive,
|
|
@@ -1172,12 +1203,12 @@ function TabTrigger({
|
|
|
1172
1203
|
onLayout
|
|
1173
1204
|
}) {
|
|
1174
1205
|
const { colors } = useTheme();
|
|
1175
|
-
const
|
|
1206
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
1176
1207
|
const handlePressIn = () => {
|
|
1177
|
-
Animated.spring(
|
|
1208
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: nativeDriver6, speed: 40, bounciness: 0 }).start();
|
|
1178
1209
|
};
|
|
1179
1210
|
const handlePressOut = () => {
|
|
1180
|
-
Animated.spring(
|
|
1211
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: nativeDriver6, speed: 40, bounciness: 4 }).start();
|
|
1181
1212
|
};
|
|
1182
1213
|
return /* @__PURE__ */ React23.createElement(
|
|
1183
1214
|
TouchableOpacity,
|
|
@@ -1190,7 +1221,7 @@ function TabTrigger({
|
|
|
1190
1221
|
activeOpacity: 1,
|
|
1191
1222
|
touchSoundDisabled: true
|
|
1192
1223
|
},
|
|
1193
|
-
/* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23.createElement(View, { style: styles16.triggerInner }, tab.icon ? /* @__PURE__ */ React23.createElement(View, { style: styles16.triggerIcon }, typeof tab.icon === "function" ? tab.icon(isActive) : tab.icon) : null, /* @__PURE__ */ React23.createElement(
|
|
1224
|
+
/* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale: scale2 }] } }, /* @__PURE__ */ React23.createElement(View, { style: styles16.triggerInner }, tab.icon ? /* @__PURE__ */ React23.createElement(View, { style: styles16.triggerIcon }, typeof tab.icon === "function" ? tab.icon(isActive) : tab.icon) : null, /* @__PURE__ */ React23.createElement(
|
|
1194
1225
|
Text,
|
|
1195
1226
|
{
|
|
1196
1227
|
style: [
|
|
@@ -1240,7 +1271,7 @@ function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
|
1240
1271
|
}
|
|
1241
1272
|
}, [active]);
|
|
1242
1273
|
const handlePress = (v) => {
|
|
1243
|
-
|
|
1274
|
+
selectionAsync();
|
|
1244
1275
|
if (!value) setInternal(v);
|
|
1245
1276
|
onValueChange?.(v);
|
|
1246
1277
|
};
|
|
@@ -1290,16 +1321,16 @@ function TabsContent({ value, activeValue, children, style }) {
|
|
|
1290
1321
|
var styles16 = StyleSheet.create({
|
|
1291
1322
|
list: {
|
|
1292
1323
|
flexDirection: "row",
|
|
1293
|
-
borderRadius: 12,
|
|
1294
|
-
padding: 4,
|
|
1295
|
-
gap: 4
|
|
1324
|
+
borderRadius: ms(12),
|
|
1325
|
+
padding: s(4),
|
|
1326
|
+
gap: s(4)
|
|
1296
1327
|
},
|
|
1297
1328
|
pill: {},
|
|
1298
1329
|
trigger: {
|
|
1299
1330
|
flex: 1,
|
|
1300
|
-
paddingVertical: 12,
|
|
1301
|
-
paddingHorizontal: 16,
|
|
1302
|
-
borderRadius: 8,
|
|
1331
|
+
paddingVertical: vs(12),
|
|
1332
|
+
paddingHorizontal: s(16),
|
|
1333
|
+
borderRadius: ms(8),
|
|
1303
1334
|
alignItems: "center",
|
|
1304
1335
|
justifyContent: "center",
|
|
1305
1336
|
zIndex: 1
|
|
@@ -1308,15 +1339,15 @@ var styles16 = StyleSheet.create({
|
|
|
1308
1339
|
flexDirection: "row",
|
|
1309
1340
|
alignItems: "center",
|
|
1310
1341
|
justifyContent: "center",
|
|
1311
|
-
gap: 8
|
|
1342
|
+
gap: s(8)
|
|
1312
1343
|
},
|
|
1313
1344
|
triggerIcon: {
|
|
1314
|
-
marginRight: 6,
|
|
1345
|
+
marginRight: s(6),
|
|
1315
1346
|
alignItems: "center",
|
|
1316
1347
|
justifyContent: "center"
|
|
1317
1348
|
},
|
|
1318
1349
|
triggerLabel: {
|
|
1319
|
-
fontSize: 15,
|
|
1350
|
+
fontSize: ms(15),
|
|
1320
1351
|
fontWeight: "400"
|
|
1321
1352
|
},
|
|
1322
1353
|
activeTriggerLabel: {
|
|
@@ -1329,53 +1360,51 @@ function AccordionItemComponent({
|
|
|
1329
1360
|
onToggle
|
|
1330
1361
|
}) {
|
|
1331
1362
|
const { colors } = useTheme();
|
|
1332
|
-
const
|
|
1333
|
-
const
|
|
1334
|
-
const contentHeight = useRef(0);
|
|
1335
|
-
const scale = useRef(new Animated.Value(1)).current;
|
|
1336
|
-
const toggle = (open) => {
|
|
1337
|
-
const easing = open ? Easing$1.out(Easing$1.ease) : Easing$1.in(Easing$1.ease);
|
|
1338
|
-
animatedHeight.value = withTiming(open ? contentHeight.current : 0, { duration: 220, easing });
|
|
1339
|
-
animatedRotation.value = withTiming(open ? 1 : 0, { duration: 220, easing });
|
|
1340
|
-
};
|
|
1363
|
+
const isExpanded = useSharedValue(isOpen);
|
|
1364
|
+
const height = useSharedValue(0);
|
|
1341
1365
|
React23.useEffect(() => {
|
|
1342
|
-
|
|
1366
|
+
isExpanded.value = isOpen;
|
|
1343
1367
|
}, [isOpen]);
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1368
|
+
const derivedHeight = useDerivedValue(
|
|
1369
|
+
() => withTiming(height.value * Number(isExpanded.value), {
|
|
1370
|
+
duration: 220,
|
|
1371
|
+
easing: isExpanded.value ? Easing$1.out(Easing$1.ease) : Easing$1.in(Easing$1.ease)
|
|
1372
|
+
})
|
|
1373
|
+
);
|
|
1374
|
+
const derivedRotation = useDerivedValue(
|
|
1375
|
+
() => withTiming(isExpanded.value ? 1 : 0, {
|
|
1376
|
+
duration: 220,
|
|
1377
|
+
easing: isExpanded.value ? Easing$1.out(Easing$1.ease) : Easing$1.in(Easing$1.ease)
|
|
1378
|
+
})
|
|
1379
|
+
);
|
|
1380
|
+
const bodyStyle = useAnimatedStyle(() => ({
|
|
1381
|
+
height: derivedHeight.value,
|
|
1352
1382
|
overflow: "hidden"
|
|
1353
1383
|
}));
|
|
1354
1384
|
const rotationStyle = useAnimatedStyle(() => ({
|
|
1355
|
-
transform: [{ rotate: `${
|
|
1385
|
+
transform: [{ rotate: `${derivedRotation.value * 180}deg` }]
|
|
1356
1386
|
}));
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
};
|
|
1360
|
-
const handlePressOut = () => {
|
|
1361
|
-
Animated.spring(scale, { toValue: 1, useNativeDriver: true, speed: 40, bounciness: 4 }).start();
|
|
1362
|
-
};
|
|
1363
|
-
return /* @__PURE__ */ React23.createElement(View, { style: [styles17.item, { borderBottomColor: colors.border }] }, /* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23.createElement(
|
|
1364
|
-
TouchableOpacity,
|
|
1387
|
+
return /* @__PURE__ */ React23.createElement(View, { style: [styles17.item, { borderBottomColor: colors.border }] }, /* @__PURE__ */ React23.createElement(
|
|
1388
|
+
Pressable,
|
|
1365
1389
|
{
|
|
1366
|
-
style: styles17.trigger,
|
|
1390
|
+
style: ({ pressed }) => [styles17.trigger, { opacity: pressed ? 0.6 : 1 }],
|
|
1367
1391
|
onPress: () => {
|
|
1368
|
-
|
|
1392
|
+
selectionAsync();
|
|
1369
1393
|
onToggle();
|
|
1370
|
-
}
|
|
1371
|
-
onPressIn: handlePressIn,
|
|
1372
|
-
onPressOut: handlePressOut,
|
|
1373
|
-
activeOpacity: 1,
|
|
1374
|
-
touchSoundDisabled: true
|
|
1394
|
+
}
|
|
1375
1395
|
},
|
|
1376
1396
|
/* @__PURE__ */ React23.createElement(Text, { style: [styles17.triggerText, { color: colors.foreground }] }, item.trigger),
|
|
1377
|
-
/* @__PURE__ */ React23.createElement(
|
|
1378
|
-
)
|
|
1397
|
+
/* @__PURE__ */ React23.createElement(Animated10.View, { style: [styles17.chevron, rotationStyle] }, /* @__PURE__ */ React23.createElement(Entypo, { name: "chevron-down", size: 20, color: colors.foreground }))
|
|
1398
|
+
), /* @__PURE__ */ React23.createElement(Animated10.View, { style: bodyStyle }, /* @__PURE__ */ React23.createElement(
|
|
1399
|
+
View,
|
|
1400
|
+
{
|
|
1401
|
+
style: styles17.content,
|
|
1402
|
+
onLayout: (e) => {
|
|
1403
|
+
height.value = e.nativeEvent.layout.height;
|
|
1404
|
+
}
|
|
1405
|
+
},
|
|
1406
|
+
item.content
|
|
1407
|
+
)));
|
|
1379
1408
|
}
|
|
1380
1409
|
function Accordion({ items, type = "single", defaultValue, style }) {
|
|
1381
1410
|
const [openValues, setOpenValues] = useState(() => {
|
|
@@ -1409,18 +1438,20 @@ var styles17 = StyleSheet.create({
|
|
|
1409
1438
|
flexDirection: "row",
|
|
1410
1439
|
justifyContent: "space-between",
|
|
1411
1440
|
alignItems: "center",
|
|
1412
|
-
paddingVertical: 20
|
|
1441
|
+
paddingVertical: vs(20)
|
|
1413
1442
|
},
|
|
1414
1443
|
triggerText: {
|
|
1415
|
-
fontSize: 17,
|
|
1444
|
+
fontSize: ms(17),
|
|
1416
1445
|
fontWeight: "500",
|
|
1417
1446
|
flex: 1
|
|
1418
1447
|
},
|
|
1419
1448
|
chevron: {
|
|
1420
|
-
marginLeft: 8
|
|
1449
|
+
marginLeft: s(8)
|
|
1421
1450
|
},
|
|
1451
|
+
// position:'absolute' is the key — the inner View escapes the animated wrapper's
|
|
1452
|
+
// clipped height so onLayout always reports the true content height.
|
|
1422
1453
|
content: {
|
|
1423
|
-
paddingBottom: 20,
|
|
1454
|
+
paddingBottom: vs(20),
|
|
1424
1455
|
position: "absolute",
|
|
1425
1456
|
width: "100%"
|
|
1426
1457
|
}
|
|
@@ -1444,7 +1475,7 @@ function Slider({
|
|
|
1444
1475
|
const handleValueChange = (v) => {
|
|
1445
1476
|
if (step && v !== lastSteppedValue.current) {
|
|
1446
1477
|
lastSteppedValue.current = v;
|
|
1447
|
-
|
|
1478
|
+
selectionAsync();
|
|
1448
1479
|
}
|
|
1449
1480
|
onValueChange?.(v);
|
|
1450
1481
|
};
|
|
@@ -1468,7 +1499,7 @@ function Slider({
|
|
|
1468
1499
|
}
|
|
1469
1500
|
var styles18 = StyleSheet.create({
|
|
1470
1501
|
wrapper: {
|
|
1471
|
-
gap: 8
|
|
1502
|
+
gap: vs(8)
|
|
1472
1503
|
},
|
|
1473
1504
|
header: {
|
|
1474
1505
|
flexDirection: "row",
|
|
@@ -1476,16 +1507,16 @@ var styles18 = StyleSheet.create({
|
|
|
1476
1507
|
alignItems: "center"
|
|
1477
1508
|
},
|
|
1478
1509
|
label: {
|
|
1479
|
-
fontSize: 15,
|
|
1510
|
+
fontSize: ms(15),
|
|
1480
1511
|
fontWeight: "500"
|
|
1481
1512
|
},
|
|
1482
1513
|
valueText: {
|
|
1483
|
-
fontSize: 14,
|
|
1514
|
+
fontSize: ms(14),
|
|
1484
1515
|
fontWeight: "500"
|
|
1485
1516
|
},
|
|
1486
1517
|
slider: {
|
|
1487
1518
|
width: "100%",
|
|
1488
|
-
height: 40
|
|
1519
|
+
height: vs(40)
|
|
1489
1520
|
},
|
|
1490
1521
|
disabled: {
|
|
1491
1522
|
opacity: 0.45
|
|
@@ -1504,7 +1535,7 @@ function Sheet({
|
|
|
1504
1535
|
const ref = useRef(null);
|
|
1505
1536
|
useEffect(() => {
|
|
1506
1537
|
if (open) {
|
|
1507
|
-
|
|
1538
|
+
impactLight();
|
|
1508
1539
|
ref.current?.present();
|
|
1509
1540
|
} else {
|
|
1510
1541
|
ref.current?.dismiss();
|
|
@@ -1535,34 +1566,34 @@ function Sheet({
|
|
|
1535
1566
|
}
|
|
1536
1567
|
var styles19 = StyleSheet.create({
|
|
1537
1568
|
background: {
|
|
1538
|
-
borderTopLeftRadius: 16,
|
|
1539
|
-
borderTopRightRadius: 16
|
|
1569
|
+
borderTopLeftRadius: ms(16),
|
|
1570
|
+
borderTopRightRadius: ms(16)
|
|
1540
1571
|
},
|
|
1541
1572
|
handle: {
|
|
1542
|
-
width: 36,
|
|
1543
|
-
height: 4,
|
|
1544
|
-
borderRadius: 2
|
|
1573
|
+
width: s(36),
|
|
1574
|
+
height: vs(4),
|
|
1575
|
+
borderRadius: ms(2)
|
|
1545
1576
|
},
|
|
1546
1577
|
content: {
|
|
1547
|
-
paddingHorizontal: 24,
|
|
1548
|
-
paddingBottom: 32
|
|
1578
|
+
paddingHorizontal: s(24),
|
|
1579
|
+
paddingBottom: vs(32)
|
|
1549
1580
|
},
|
|
1550
1581
|
header: {
|
|
1551
|
-
gap: 8,
|
|
1552
|
-
marginBottom: 16
|
|
1582
|
+
gap: vs(8),
|
|
1583
|
+
marginBottom: vs(16)
|
|
1553
1584
|
},
|
|
1554
1585
|
title: {
|
|
1555
|
-
fontSize: 18,
|
|
1586
|
+
fontSize: ms(18),
|
|
1556
1587
|
fontWeight: "600"
|
|
1557
1588
|
},
|
|
1558
1589
|
description: {
|
|
1559
|
-
fontSize: 14,
|
|
1560
|
-
lineHeight: 20
|
|
1590
|
+
fontSize: ms(14),
|
|
1591
|
+
lineHeight: mvs(20)
|
|
1561
1592
|
}
|
|
1562
1593
|
});
|
|
1563
1594
|
var isIOS = Platform.OS === "ios";
|
|
1564
1595
|
var isAndroid = Platform.OS === "android";
|
|
1565
|
-
var
|
|
1596
|
+
var isWeb2 = Platform.OS === "web";
|
|
1566
1597
|
function Select({
|
|
1567
1598
|
options,
|
|
1568
1599
|
value,
|
|
@@ -1574,21 +1605,21 @@ function Select({
|
|
|
1574
1605
|
style
|
|
1575
1606
|
}) {
|
|
1576
1607
|
const { colors } = useTheme();
|
|
1577
|
-
const
|
|
1608
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
1578
1609
|
const [pickerVisible, setPickerVisible] = useState(false);
|
|
1579
1610
|
const [pendingValue, setPendingValue] = useState(value);
|
|
1580
1611
|
const pickerRef = useRef(null);
|
|
1581
1612
|
const selected = options.find((o) => o.value === value);
|
|
1582
1613
|
const handlePressIn = () => {
|
|
1583
1614
|
if (disabled) return;
|
|
1584
|
-
Animated.spring(
|
|
1615
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: true, speed: 40, bounciness: 0 }).start();
|
|
1585
1616
|
};
|
|
1586
1617
|
const handlePressOut = () => {
|
|
1587
|
-
Animated.spring(
|
|
1618
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: true, speed: 40, bounciness: 4 }).start();
|
|
1588
1619
|
};
|
|
1589
1620
|
const handleOpen = () => {
|
|
1590
1621
|
if (disabled) return;
|
|
1591
|
-
|
|
1622
|
+
selectionAsync();
|
|
1592
1623
|
if (isIOS) {
|
|
1593
1624
|
setPendingValue(value);
|
|
1594
1625
|
setPickerVisible(true);
|
|
@@ -1601,12 +1632,12 @@ function Select({
|
|
|
1601
1632
|
};
|
|
1602
1633
|
const handleConfirm = () => {
|
|
1603
1634
|
if (pendingValue !== void 0 && pendingValue !== "") {
|
|
1604
|
-
|
|
1635
|
+
selectionAsync();
|
|
1605
1636
|
onValueChange?.(pendingValue);
|
|
1606
1637
|
}
|
|
1607
1638
|
setPickerVisible(false);
|
|
1608
1639
|
};
|
|
1609
|
-
return /* @__PURE__ */ React23.createElement(View, { style: [styles20.container, style] }, label ? /* @__PURE__ */ React23.createElement(Text, { style: [styles20.label, { color: colors.foreground }] }, label) : null, !
|
|
1640
|
+
return /* @__PURE__ */ React23.createElement(View, { style: [styles20.container, style] }, label ? /* @__PURE__ */ React23.createElement(Text, { style: [styles20.label, { color: colors.foreground }] }, label) : null, !isWeb2 ? /* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale: scale2 }], opacity: disabled ? 0.45 : 1 } }, /* @__PURE__ */ React23.createElement(
|
|
1610
1641
|
TouchableOpacity,
|
|
1611
1642
|
{
|
|
1612
1643
|
style: [
|
|
@@ -1670,7 +1701,7 @@ function Select({
|
|
|
1670
1701
|
selectedValue: value ?? "",
|
|
1671
1702
|
onValueChange: (val) => {
|
|
1672
1703
|
if (val !== "") {
|
|
1673
|
-
|
|
1704
|
+
selectionAsync();
|
|
1674
1705
|
onValueChange?.(val);
|
|
1675
1706
|
}
|
|
1676
1707
|
},
|
|
@@ -1689,7 +1720,7 @@ function Select({
|
|
|
1689
1720
|
enabled: !o.disabled
|
|
1690
1721
|
}
|
|
1691
1722
|
))
|
|
1692
|
-
) : null,
|
|
1723
|
+
) : null, isWeb2 ? /* @__PURE__ */ React23.createElement(
|
|
1693
1724
|
Picker,
|
|
1694
1725
|
{
|
|
1695
1726
|
selectedValue: value ?? "",
|
|
@@ -1723,10 +1754,10 @@ function Select({
|
|
|
1723
1754
|
}
|
|
1724
1755
|
var styles20 = StyleSheet.create({
|
|
1725
1756
|
container: {
|
|
1726
|
-
gap: 8
|
|
1757
|
+
gap: vs(8)
|
|
1727
1758
|
},
|
|
1728
1759
|
label: {
|
|
1729
|
-
fontSize: 15,
|
|
1760
|
+
fontSize: ms(15),
|
|
1730
1761
|
fontWeight: "500"
|
|
1731
1762
|
},
|
|
1732
1763
|
trigger: {
|
|
@@ -1734,9 +1765,9 @@ var styles20 = StyleSheet.create({
|
|
|
1734
1765
|
alignItems: "center",
|
|
1735
1766
|
justifyContent: "space-between",
|
|
1736
1767
|
borderWidth: 1.5,
|
|
1737
|
-
borderRadius: 8,
|
|
1738
|
-
paddingHorizontal: 16,
|
|
1739
|
-
paddingVertical: 14,
|
|
1768
|
+
borderRadius: ms(8),
|
|
1769
|
+
paddingHorizontal: s(16),
|
|
1770
|
+
paddingVertical: vs(14),
|
|
1740
1771
|
shadowColor: "#000",
|
|
1741
1772
|
shadowOffset: { width: 0, height: 1 },
|
|
1742
1773
|
shadowOpacity: 0.04,
|
|
@@ -1744,41 +1775,41 @@ var styles20 = StyleSheet.create({
|
|
|
1744
1775
|
elevation: 1
|
|
1745
1776
|
},
|
|
1746
1777
|
triggerText: {
|
|
1747
|
-
fontSize: 17,
|
|
1778
|
+
fontSize: ms(17),
|
|
1748
1779
|
flex: 1
|
|
1749
1780
|
},
|
|
1750
1781
|
chevron: {
|
|
1751
|
-
marginLeft: 8
|
|
1782
|
+
marginLeft: s(8)
|
|
1752
1783
|
},
|
|
1753
1784
|
helperText: {
|
|
1754
|
-
fontSize: 13
|
|
1785
|
+
fontSize: ms(13)
|
|
1755
1786
|
},
|
|
1756
1787
|
iosBackdrop: {
|
|
1757
1788
|
flex: 1,
|
|
1758
1789
|
backgroundColor: "rgba(0,0,0,0.4)"
|
|
1759
1790
|
},
|
|
1760
1791
|
iosSheet: {
|
|
1761
|
-
borderTopLeftRadius: 16,
|
|
1762
|
-
borderTopRightRadius: 16,
|
|
1763
|
-
paddingBottom: 32
|
|
1792
|
+
borderTopLeftRadius: ms(16),
|
|
1793
|
+
borderTopRightRadius: ms(16),
|
|
1794
|
+
paddingBottom: vs(32)
|
|
1764
1795
|
},
|
|
1765
1796
|
iosToolbar: {
|
|
1766
1797
|
flexDirection: "row",
|
|
1767
1798
|
alignItems: "center",
|
|
1768
1799
|
justifyContent: "space-between",
|
|
1769
|
-
paddingHorizontal: 16,
|
|
1770
|
-
paddingVertical: 12,
|
|
1800
|
+
paddingHorizontal: s(16),
|
|
1801
|
+
paddingVertical: vs(12),
|
|
1771
1802
|
borderBottomWidth: 1
|
|
1772
1803
|
},
|
|
1773
1804
|
iosToolbarTitle: {
|
|
1774
|
-
fontSize: 17,
|
|
1805
|
+
fontSize: ms(17),
|
|
1775
1806
|
fontWeight: "600"
|
|
1776
1807
|
},
|
|
1777
1808
|
iosDoneBtn: {
|
|
1778
|
-
padding: 4
|
|
1809
|
+
padding: s(4)
|
|
1779
1810
|
},
|
|
1780
1811
|
iosDoneBtnText: {
|
|
1781
|
-
fontSize: 17,
|
|
1812
|
+
fontSize: ms(17),
|
|
1782
1813
|
fontWeight: "600"
|
|
1783
1814
|
},
|
|
1784
1815
|
androidHiddenPicker: {
|
|
@@ -1788,10 +1819,10 @@ var styles20 = StyleSheet.create({
|
|
|
1788
1819
|
},
|
|
1789
1820
|
webPicker: {
|
|
1790
1821
|
borderWidth: 1.5,
|
|
1791
|
-
borderRadius: 8,
|
|
1792
|
-
paddingHorizontal: 16,
|
|
1793
|
-
paddingVertical: 14,
|
|
1794
|
-
fontSize: 17
|
|
1822
|
+
borderRadius: ms(8),
|
|
1823
|
+
paddingHorizontal: s(16),
|
|
1824
|
+
paddingVertical: vs(14),
|
|
1825
|
+
fontSize: ms(17)
|
|
1795
1826
|
}
|
|
1796
1827
|
});
|
|
1797
1828
|
var ToastContext = createContext({
|
|
@@ -1851,7 +1882,7 @@ function ToastNotification({ item, onDismiss }) {
|
|
|
1851
1882
|
}[item.variant ?? "default"];
|
|
1852
1883
|
const defaultIcon = item.variant === "success" ? /* @__PURE__ */ React23.createElement(FontAwesome5, { name: "check-circle", size: 22, color: textColor }) : item.variant === "destructive" ? /* @__PURE__ */ React23.createElement(MaterialIcons, { name: "error-outline", size: 24, color: textColor }) : /* @__PURE__ */ React23.createElement(Entypo, { name: "info-with-circle", size: 22, color: textColor });
|
|
1853
1884
|
const leftIcon = item.icon ?? defaultIcon;
|
|
1854
|
-
return /* @__PURE__ */ React23.createElement(GestureDetector, { gesture: panGesture }, /* @__PURE__ */ React23.createElement(
|
|
1885
|
+
return /* @__PURE__ */ React23.createElement(GestureDetector, { gesture: panGesture }, /* @__PURE__ */ React23.createElement(Animated10.View, { style: [styles21.toast, { backgroundColor: bgColor }, animatedStyle] }, /* @__PURE__ */ React23.createElement(View, { style: styles21.leftIconContainer }, leftIcon), /* @__PURE__ */ React23.createElement(View, { style: styles21.toastContent }, item.title ? /* @__PURE__ */ React23.createElement(Text, { style: [styles21.toastTitle, { color: textColor }] }, item.title) : null, item.description ? /* @__PURE__ */ React23.createElement(Text, { style: [styles21.toastDescription, { color: textColor, opacity: 0.85 }] }, item.description) : null), /* @__PURE__ */ React23.createElement(TouchableOpacity, { onPress: onDismiss, style: styles21.dismissButton, touchSoundDisabled: true }, /* @__PURE__ */ React23.createElement(AntDesign, { name: "close-circle", size: 18, color: textColor }))));
|
|
1855
1886
|
}
|
|
1856
1887
|
function ToastProvider({ children }) {
|
|
1857
1888
|
const [toasts, setToasts] = useState([]);
|
|
@@ -1859,11 +1890,11 @@ function ToastProvider({ children }) {
|
|
|
1859
1890
|
const toast = useCallback((item) => {
|
|
1860
1891
|
const id = Math.random().toString(36).slice(2);
|
|
1861
1892
|
if (item.variant === "success") {
|
|
1862
|
-
|
|
1893
|
+
notificationSuccess();
|
|
1863
1894
|
} else if (item.variant === "destructive") {
|
|
1864
|
-
|
|
1895
|
+
notificationError();
|
|
1865
1896
|
} else {
|
|
1866
|
-
|
|
1897
|
+
impactLight();
|
|
1867
1898
|
}
|
|
1868
1899
|
setToasts((prev) => [{ ...item, id }, ...prev].slice(0, 3));
|
|
1869
1900
|
}, []);
|
|
@@ -1875,23 +1906,23 @@ function ToastProvider({ children }) {
|
|
|
1875
1906
|
var styles21 = StyleSheet.create({
|
|
1876
1907
|
container: {
|
|
1877
1908
|
position: "absolute",
|
|
1878
|
-
left: 16,
|
|
1879
|
-
right: 16,
|
|
1880
|
-
gap: 8,
|
|
1909
|
+
left: s(16),
|
|
1910
|
+
right: s(16),
|
|
1911
|
+
gap: vs(8),
|
|
1881
1912
|
zIndex: 9999
|
|
1882
1913
|
},
|
|
1883
1914
|
containerWeb: {
|
|
1884
1915
|
left: void 0,
|
|
1885
1916
|
right: void 0,
|
|
1886
1917
|
alignSelf: "center",
|
|
1887
|
-
width: 400
|
|
1918
|
+
width: s(400)
|
|
1888
1919
|
},
|
|
1889
1920
|
toast: {
|
|
1890
1921
|
flexDirection: "row",
|
|
1891
1922
|
alignItems: "center",
|
|
1892
|
-
borderRadius: 16,
|
|
1893
|
-
paddingHorizontal: 20,
|
|
1894
|
-
paddingVertical: 14,
|
|
1923
|
+
borderRadius: ms(16),
|
|
1924
|
+
paddingHorizontal: s(20),
|
|
1925
|
+
paddingVertical: vs(14),
|
|
1895
1926
|
shadowColor: "#000",
|
|
1896
1927
|
shadowOffset: { width: 0, height: 4 },
|
|
1897
1928
|
shadowOpacity: 0.15,
|
|
@@ -1900,24 +1931,24 @@ var styles21 = StyleSheet.create({
|
|
|
1900
1931
|
},
|
|
1901
1932
|
toastContent: {
|
|
1902
1933
|
flex: 1,
|
|
1903
|
-
gap: 4
|
|
1934
|
+
gap: vs(4)
|
|
1904
1935
|
},
|
|
1905
1936
|
leftIconContainer: {
|
|
1906
|
-
width: 40,
|
|
1937
|
+
width: s(40),
|
|
1907
1938
|
alignItems: "center",
|
|
1908
1939
|
justifyContent: "center",
|
|
1909
|
-
marginRight: 8
|
|
1940
|
+
marginRight: s(8)
|
|
1910
1941
|
},
|
|
1911
1942
|
toastTitle: {
|
|
1912
|
-
fontSize: 15,
|
|
1943
|
+
fontSize: ms(15),
|
|
1913
1944
|
fontWeight: "600"
|
|
1914
1945
|
},
|
|
1915
1946
|
toastDescription: {
|
|
1916
|
-
fontSize: 14
|
|
1947
|
+
fontSize: ms(14)
|
|
1917
1948
|
},
|
|
1918
1949
|
dismissButton: {
|
|
1919
|
-
padding: 8,
|
|
1920
|
-
marginLeft: 4
|
|
1950
|
+
padding: s(8),
|
|
1951
|
+
marginLeft: s(4)
|
|
1921
1952
|
}
|
|
1922
1953
|
});
|
|
1923
1954
|
function formatCurrency(raw, separator) {
|
|
@@ -1949,7 +1980,7 @@ function CurrencyInput({
|
|
|
1949
1980
|
const raw = parseFloat(formatted.replace(separatorRegex, "") || "0");
|
|
1950
1981
|
onChangeValue?.(isNaN(raw) ? 0 : raw);
|
|
1951
1982
|
};
|
|
1952
|
-
const inputStyle = size === "large" ? { fontSize: 36 } : {};
|
|
1983
|
+
const inputStyle = size === "large" ? { fontSize: ms(36) } : {};
|
|
1953
1984
|
return /* @__PURE__ */ React23.createElement(
|
|
1954
1985
|
Input,
|
|
1955
1986
|
{
|
|
@@ -1986,11 +2017,11 @@ function CurrencyDisplay({ value, prefix = "$", showDecimals = false, textColor,
|
|
|
1986
2017
|
var styles22 = StyleSheet.create({
|
|
1987
2018
|
container: {},
|
|
1988
2019
|
amount: {
|
|
1989
|
-
fontSize: 56,
|
|
2020
|
+
fontSize: ms(56),
|
|
1990
2021
|
fontWeight: "700"
|
|
1991
2022
|
}
|
|
1992
2023
|
});
|
|
1993
|
-
var
|
|
2024
|
+
var nativeDriver7 = Platform.OS !== "web";
|
|
1994
2025
|
function ListItem({
|
|
1995
2026
|
leftRender,
|
|
1996
2027
|
rightRender,
|
|
@@ -2010,26 +2041,26 @@ function ListItem({
|
|
|
2010
2041
|
captionStyle
|
|
2011
2042
|
}) {
|
|
2012
2043
|
const { colors } = useTheme();
|
|
2013
|
-
const
|
|
2044
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
2014
2045
|
const handlePressIn = () => {
|
|
2015
2046
|
if (!onPress || disabled) return;
|
|
2016
|
-
Animated.spring(
|
|
2047
|
+
Animated.spring(scale2, {
|
|
2017
2048
|
toValue: 0.97,
|
|
2018
|
-
useNativeDriver:
|
|
2049
|
+
useNativeDriver: nativeDriver7,
|
|
2019
2050
|
speed: 40,
|
|
2020
2051
|
bounciness: 0
|
|
2021
2052
|
}).start();
|
|
2022
2053
|
};
|
|
2023
2054
|
const handlePressOut = () => {
|
|
2024
|
-
Animated.spring(
|
|
2055
|
+
Animated.spring(scale2, {
|
|
2025
2056
|
toValue: 1,
|
|
2026
|
-
useNativeDriver:
|
|
2057
|
+
useNativeDriver: nativeDriver7,
|
|
2027
2058
|
speed: 40,
|
|
2028
2059
|
bounciness: 4
|
|
2029
2060
|
}).start();
|
|
2030
2061
|
};
|
|
2031
2062
|
const handlePress = () => {
|
|
2032
|
-
|
|
2063
|
+
selectionAsync();
|
|
2033
2064
|
onPress?.();
|
|
2034
2065
|
};
|
|
2035
2066
|
const effectiveLeft = leftRender ?? icon;
|
|
@@ -2045,7 +2076,7 @@ function ListItem({
|
|
|
2045
2076
|
shadowRadius: 6,
|
|
2046
2077
|
elevation: 2
|
|
2047
2078
|
} : {};
|
|
2048
|
-
return /* @__PURE__ */ React23.createElement(Animated.View, { style: [{ transform: [{ scale }] }, disabled && styles23.disabled] }, /* @__PURE__ */ React23.createElement(
|
|
2079
|
+
return /* @__PURE__ */ React23.createElement(Animated.View, { style: [{ transform: [{ scale: scale2 }] }, disabled && styles23.disabled] }, /* @__PURE__ */ React23.createElement(
|
|
2049
2080
|
TouchableOpacity,
|
|
2050
2081
|
{
|
|
2051
2082
|
style: [styles23.container, cardStyle, style],
|
|
@@ -2095,7 +2126,7 @@ function ListItem({
|
|
|
2095
2126
|
{
|
|
2096
2127
|
style: [
|
|
2097
2128
|
styles23.separator,
|
|
2098
|
-
{ backgroundColor: colors.border, marginLeft: effectiveLeft ? 16 + 44 + 12 : 16 }
|
|
2129
|
+
{ backgroundColor: colors.border, marginLeft: effectiveLeft ? s(16) + s(44) + s(12) : s(16) }
|
|
2099
2130
|
]
|
|
2100
2131
|
}
|
|
2101
2132
|
) : null);
|
|
@@ -2104,61 +2135,61 @@ var styles23 = StyleSheet.create({
|
|
|
2104
2135
|
container: {
|
|
2105
2136
|
flexDirection: "row",
|
|
2106
2137
|
alignItems: "center",
|
|
2107
|
-
paddingHorizontal: 16,
|
|
2108
|
-
paddingVertical: 14,
|
|
2109
|
-
gap: 12
|
|
2138
|
+
paddingHorizontal: s(16),
|
|
2139
|
+
paddingVertical: vs(14),
|
|
2140
|
+
gap: s(12)
|
|
2110
2141
|
},
|
|
2111
2142
|
leftContainer: {
|
|
2112
|
-
width: 44,
|
|
2113
|
-
height: 44,
|
|
2143
|
+
width: s(44),
|
|
2144
|
+
height: s(44),
|
|
2114
2145
|
alignItems: "center",
|
|
2115
2146
|
justifyContent: "center",
|
|
2116
2147
|
flexShrink: 0
|
|
2117
2148
|
},
|
|
2118
2149
|
content: {
|
|
2119
2150
|
flex: 1,
|
|
2120
|
-
gap: 4
|
|
2151
|
+
gap: vs(4)
|
|
2121
2152
|
},
|
|
2122
2153
|
title: {
|
|
2123
|
-
fontSize: 17,
|
|
2154
|
+
fontSize: ms(17),
|
|
2124
2155
|
fontWeight: "500",
|
|
2125
|
-
lineHeight: 24
|
|
2156
|
+
lineHeight: mvs(24)
|
|
2126
2157
|
},
|
|
2127
2158
|
subtitle: {
|
|
2128
|
-
fontSize: 14,
|
|
2159
|
+
fontSize: ms(14),
|
|
2129
2160
|
fontWeight: "400",
|
|
2130
|
-
lineHeight: 20
|
|
2161
|
+
lineHeight: mvs(20)
|
|
2131
2162
|
},
|
|
2132
2163
|
caption: {
|
|
2133
|
-
fontSize: 12,
|
|
2164
|
+
fontSize: ms(12),
|
|
2134
2165
|
fontWeight: "400",
|
|
2135
|
-
lineHeight: 16,
|
|
2166
|
+
lineHeight: mvs(16),
|
|
2136
2167
|
opacity: 0.7
|
|
2137
2168
|
},
|
|
2138
2169
|
rightContainer: {
|
|
2139
2170
|
alignItems: "flex-end",
|
|
2140
2171
|
justifyContent: "center",
|
|
2141
2172
|
flexShrink: 0,
|
|
2142
|
-
maxWidth: 160
|
|
2173
|
+
maxWidth: s(160)
|
|
2143
2174
|
},
|
|
2144
2175
|
rightText: {
|
|
2145
|
-
fontSize: 15
|
|
2176
|
+
fontSize: ms(15)
|
|
2146
2177
|
},
|
|
2147
2178
|
chevron: {
|
|
2148
|
-
marginLeft: 4
|
|
2179
|
+
marginLeft: s(4)
|
|
2149
2180
|
},
|
|
2150
2181
|
separator: {
|
|
2151
2182
|
height: StyleSheet.hairlineWidth,
|
|
2152
|
-
marginRight: 16
|
|
2183
|
+
marginRight: s(16)
|
|
2153
2184
|
},
|
|
2154
2185
|
disabled: {
|
|
2155
2186
|
opacity: 0.45
|
|
2156
2187
|
}
|
|
2157
2188
|
});
|
|
2158
|
-
var
|
|
2189
|
+
var nativeDriver8 = Platform.OS !== "web";
|
|
2159
2190
|
function Chip({ label, selected = false, onPress, style }) {
|
|
2160
2191
|
const { colors } = useTheme();
|
|
2161
|
-
const
|
|
2192
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
2162
2193
|
const pressAnim = useRef(new Animated.Value(selected ? 1 : 0)).current;
|
|
2163
2194
|
useEffect(() => {
|
|
2164
2195
|
Animated.timing(pressAnim, {
|
|
@@ -2169,23 +2200,23 @@ function Chip({ label, selected = false, onPress, style }) {
|
|
|
2169
2200
|
}).start();
|
|
2170
2201
|
}, [selected, pressAnim]);
|
|
2171
2202
|
const handlePressIn = () => {
|
|
2172
|
-
Animated.spring(
|
|
2203
|
+
Animated.spring(scale2, {
|
|
2173
2204
|
toValue: 0.95,
|
|
2174
|
-
useNativeDriver:
|
|
2205
|
+
useNativeDriver: nativeDriver8,
|
|
2175
2206
|
speed: 40,
|
|
2176
2207
|
bounciness: 0
|
|
2177
2208
|
}).start();
|
|
2178
2209
|
};
|
|
2179
2210
|
const handlePressOut = () => {
|
|
2180
|
-
Animated.spring(
|
|
2211
|
+
Animated.spring(scale2, {
|
|
2181
2212
|
toValue: 1,
|
|
2182
|
-
useNativeDriver:
|
|
2213
|
+
useNativeDriver: nativeDriver8,
|
|
2183
2214
|
speed: 40,
|
|
2184
2215
|
bounciness: 4
|
|
2185
2216
|
}).start();
|
|
2186
2217
|
};
|
|
2187
2218
|
const handlePress = () => {
|
|
2188
|
-
|
|
2219
|
+
selectionAsync();
|
|
2189
2220
|
onPress?.();
|
|
2190
2221
|
};
|
|
2191
2222
|
const backgroundColor = pressAnim.interpolate({
|
|
@@ -2200,7 +2231,7 @@ function Chip({ label, selected = false, onPress, style }) {
|
|
|
2200
2231
|
inputRange: [0, 1],
|
|
2201
2232
|
outputRange: [colors.border, colors.primary]
|
|
2202
2233
|
});
|
|
2203
|
-
return /* @__PURE__ */ React23.createElement(Animated.View, { style: [styles24.wrapper, { transform: [{ scale }] }, style] }, /* @__PURE__ */ React23.createElement(
|
|
2234
|
+
return /* @__PURE__ */ React23.createElement(Animated.View, { style: [styles24.wrapper, { transform: [{ scale: scale2 }] }, style] }, /* @__PURE__ */ React23.createElement(
|
|
2204
2235
|
TouchableOpacity,
|
|
2205
2236
|
{
|
|
2206
2237
|
onPress: handlePress,
|
|
@@ -2248,21 +2279,21 @@ var styles24 = StyleSheet.create({
|
|
|
2248
2279
|
wrapper: {},
|
|
2249
2280
|
chip: {
|
|
2250
2281
|
borderRadius: 999,
|
|
2251
|
-
paddingHorizontal: 14,
|
|
2252
|
-
paddingVertical: 8,
|
|
2282
|
+
paddingHorizontal: s(14),
|
|
2283
|
+
paddingVertical: vs(8),
|
|
2253
2284
|
borderWidth: 1.5,
|
|
2254
2285
|
alignItems: "center",
|
|
2255
2286
|
justifyContent: "center"
|
|
2256
2287
|
},
|
|
2257
2288
|
label: {
|
|
2258
|
-
fontSize: 14,
|
|
2289
|
+
fontSize: ms(14),
|
|
2259
2290
|
fontWeight: "500",
|
|
2260
|
-
lineHeight: 20
|
|
2291
|
+
lineHeight: mvs(20)
|
|
2261
2292
|
},
|
|
2262
2293
|
group: {
|
|
2263
2294
|
flexDirection: "row",
|
|
2264
2295
|
flexWrap: "wrap",
|
|
2265
|
-
gap: 8
|
|
2296
|
+
gap: s(8)
|
|
2266
2297
|
}
|
|
2267
2298
|
});
|
|
2268
2299
|
function ConfirmDialog({
|
|
@@ -2293,14 +2324,14 @@ var styles25 = StyleSheet.create({
|
|
|
2293
2324
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
2294
2325
|
justifyContent: "center",
|
|
2295
2326
|
alignItems: "center",
|
|
2296
|
-
padding: 24
|
|
2327
|
+
padding: s(24)
|
|
2297
2328
|
},
|
|
2298
2329
|
dialog: {
|
|
2299
2330
|
width: "100%",
|
|
2300
|
-
maxWidth: 400,
|
|
2301
|
-
borderRadius: 16,
|
|
2302
|
-
padding: 24,
|
|
2303
|
-
gap: 12,
|
|
2331
|
+
maxWidth: s(400),
|
|
2332
|
+
borderRadius: ms(16),
|
|
2333
|
+
padding: s(24),
|
|
2334
|
+
gap: vs(12),
|
|
2304
2335
|
shadowColor: "#000",
|
|
2305
2336
|
shadowOffset: { width: 0, height: 8 },
|
|
2306
2337
|
shadowOpacity: 0.15,
|
|
@@ -2308,17 +2339,17 @@ var styles25 = StyleSheet.create({
|
|
|
2308
2339
|
elevation: 8
|
|
2309
2340
|
},
|
|
2310
2341
|
title: {
|
|
2311
|
-
fontSize: 18,
|
|
2342
|
+
fontSize: ms(18),
|
|
2312
2343
|
fontWeight: "600",
|
|
2313
|
-
lineHeight: 26
|
|
2344
|
+
lineHeight: mvs(26)
|
|
2314
2345
|
},
|
|
2315
2346
|
description: {
|
|
2316
|
-
fontSize: 15,
|
|
2317
|
-
lineHeight: 22
|
|
2347
|
+
fontSize: ms(15),
|
|
2348
|
+
lineHeight: mvs(22)
|
|
2318
2349
|
},
|
|
2319
2350
|
actions: {
|
|
2320
|
-
gap: 10,
|
|
2321
|
-
marginTop: 8
|
|
2351
|
+
gap: vs(10),
|
|
2352
|
+
marginTop: vs(8)
|
|
2322
2353
|
}
|
|
2323
2354
|
});
|
|
2324
2355
|
function LabelValue({ label, value, style }) {
|
|
@@ -2330,16 +2361,16 @@ var styles26 = StyleSheet.create({
|
|
|
2330
2361
|
flexDirection: "row",
|
|
2331
2362
|
justifyContent: "space-between",
|
|
2332
2363
|
alignItems: "center",
|
|
2333
|
-
gap: 12
|
|
2364
|
+
gap: s(12)
|
|
2334
2365
|
},
|
|
2335
2366
|
label: {
|
|
2336
|
-
fontSize: 13,
|
|
2337
|
-
lineHeight: 18
|
|
2367
|
+
fontSize: ms(13),
|
|
2368
|
+
lineHeight: mvs(18)
|
|
2338
2369
|
},
|
|
2339
2370
|
value: {
|
|
2340
|
-
fontSize: 15,
|
|
2371
|
+
fontSize: ms(15),
|
|
2341
2372
|
fontWeight: "500",
|
|
2342
|
-
lineHeight: 22,
|
|
2373
|
+
lineHeight: mvs(22),
|
|
2343
2374
|
textAlign: "right"
|
|
2344
2375
|
}
|
|
2345
2376
|
});
|
|
@@ -2360,7 +2391,7 @@ var MONTH_NAMES = [
|
|
|
2360
2391
|
function MonthPicker({ value, onChange, style }) {
|
|
2361
2392
|
const { colors } = useTheme();
|
|
2362
2393
|
const handlePrev = () => {
|
|
2363
|
-
|
|
2394
|
+
selectionAsync();
|
|
2364
2395
|
if (value.month === 1) {
|
|
2365
2396
|
onChange({ month: 12, year: value.year - 1 });
|
|
2366
2397
|
} else {
|
|
@@ -2368,7 +2399,7 @@ function MonthPicker({ value, onChange, style }) {
|
|
|
2368
2399
|
}
|
|
2369
2400
|
};
|
|
2370
2401
|
const handleNext = () => {
|
|
2371
|
-
|
|
2402
|
+
selectionAsync();
|
|
2372
2403
|
if (value.month === 12) {
|
|
2373
2404
|
onChange({ month: 1, year: value.year + 1 });
|
|
2374
2405
|
} else {
|
|
@@ -2402,17 +2433,17 @@ var styles27 = StyleSheet.create({
|
|
|
2402
2433
|
justifyContent: "space-between"
|
|
2403
2434
|
},
|
|
2404
2435
|
arrow: {
|
|
2405
|
-
width: 44,
|
|
2406
|
-
height: 44,
|
|
2436
|
+
width: s(44),
|
|
2437
|
+
height: s(44),
|
|
2407
2438
|
alignItems: "center",
|
|
2408
2439
|
justifyContent: "center"
|
|
2409
2440
|
},
|
|
2410
2441
|
label: {
|
|
2411
|
-
fontSize: 17,
|
|
2442
|
+
fontSize: ms(17),
|
|
2412
2443
|
fontWeight: "500",
|
|
2413
|
-
lineHeight: 24,
|
|
2444
|
+
lineHeight: mvs(24),
|
|
2414
2445
|
textAlign: "center",
|
|
2415
|
-
minWidth: 160
|
|
2446
|
+
minWidth: s(160)
|
|
2416
2447
|
}
|
|
2417
2448
|
});
|
|
2418
2449
|
|