@retray-dev/ui-kit 2.5.1 → 2.6.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 +153 -6
- package/dist/index.d.mts +98 -8
- package/dist/index.d.ts +98 -8
- package/dist/index.js +591 -505
- package/dist/index.mjs +533 -436
- 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 +23 -10
- package/src/components/Avatar/Avatar.tsx +9 -8
- package/src/components/Badge/Badge.tsx +27 -12
- package/src/components/Button/Button.tsx +30 -12
- 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 +34 -21
- package/src/components/Input/Input.tsx +44 -22
- package/src/components/LabelValue/LabelValue.tsx +6 -5
- package/src/components/ListItem/ListItem.tsx +46 -22
- 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 +30 -19
- package/src/components/Toggle/Toggle.tsx +36 -10
- package/src/index.ts +4 -0
- package/src/utils/haptics.ts +32 -0
- package/src/utils/icons.ts +73 -0
- package/src/utils/scaling.ts +26 -0
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Platform, StyleSheet, useColorScheme, Animated, TouchableOpacity, ActivityIndicator, Text, View, TextInput, Image, Easing, Modal } from 'react-native';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import React24, { createContext, useMemo, useContext, useRef, useState, useEffect, useCallback } from 'react';
|
|
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
|
+
import AntDesign from '@expo/vector-icons/AntDesign';
|
|
5
|
+
import Entypo from '@expo/vector-icons/Entypo';
|
|
6
|
+
import Feather from '@expo/vector-icons/Feather';
|
|
7
|
+
import FontAwesome5 from '@expo/vector-icons/FontAwesome5';
|
|
8
|
+
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
|
9
|
+
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
10
|
+
import { AntDesign as AntDesign$1, Entypo as Entypo$1, FontAwesome5 as FontAwesome5$1, MaterialIcons as MaterialIcons$1 } from '@expo/vector-icons';
|
|
5
11
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
|
-
import
|
|
12
|
+
import Animated10, { useSharedValue, useDerivedValue, withTiming, Easing as Easing$1, useAnimatedStyle, withSpring } from 'react-native-reanimated';
|
|
7
13
|
import RNSlider from '@react-native-community/slider';
|
|
8
14
|
import { BottomSheetModal, BottomSheetView, BottomSheetBackdrop } from '@gorhom/bottom-sheet';
|
|
9
15
|
export { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
@@ -12,7 +18,12 @@ import { scheduleOnRN } from 'react-native-worklets';
|
|
|
12
18
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
13
19
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
22
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
23
|
+
}) : x)(function(x) {
|
|
24
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
25
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
+
});
|
|
16
27
|
|
|
17
28
|
// src/theme/colors.ts
|
|
18
29
|
var defaultLight = {
|
|
@@ -71,7 +82,7 @@ function ThemeProvider({ children, theme, colorScheme = "system" }) {
|
|
|
71
82
|
const override = resolvedScheme === "dark" ? theme?.dark : theme?.light;
|
|
72
83
|
return override ? { ...base, ...override } : base;
|
|
73
84
|
}, [resolvedScheme, theme]);
|
|
74
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ React24.createElement(ThemeContext.Provider, { value: { colors, colorScheme: resolvedScheme } }, children);
|
|
75
86
|
}
|
|
76
87
|
function useTheme() {
|
|
77
88
|
const context = useContext(ThemeContext);
|
|
@@ -80,17 +91,80 @@ function useTheme() {
|
|
|
80
91
|
}
|
|
81
92
|
return context;
|
|
82
93
|
}
|
|
94
|
+
var Haptics = null;
|
|
95
|
+
if (Platform.OS !== "web") {
|
|
96
|
+
Haptics = __require("expo-haptics");
|
|
97
|
+
}
|
|
98
|
+
function selectionAsync() {
|
|
99
|
+
Haptics?.selectionAsync();
|
|
100
|
+
}
|
|
101
|
+
function impactLight() {
|
|
102
|
+
Haptics?.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
|
103
|
+
}
|
|
104
|
+
function notificationSuccess() {
|
|
105
|
+
Haptics?.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
|
106
|
+
}
|
|
107
|
+
function notificationError() {
|
|
108
|
+
Haptics?.notificationAsync(Haptics.NotificationFeedbackType.Error);
|
|
109
|
+
}
|
|
110
|
+
var isWeb = Platform.OS === "web";
|
|
111
|
+
var s = isWeb ? (n) => n : scale;
|
|
112
|
+
var vs = isWeb ? (n) => n : verticalScale;
|
|
113
|
+
var ms = isWeb ? (n, _factor) => n : moderateScale;
|
|
114
|
+
var mvs = isWeb ? (n, _factor) => n : moderateVerticalScale;
|
|
115
|
+
var ICON_FAMILIES = [
|
|
116
|
+
{ name: "Ionicons", component: Ionicons, glyphMap: Ionicons.glyphMap },
|
|
117
|
+
{ name: "MaterialIcons", component: MaterialIcons, glyphMap: MaterialIcons.glyphMap },
|
|
118
|
+
{ name: "FontAwesome5", component: FontAwesome5, glyphMap: FontAwesome5.glyphMap },
|
|
119
|
+
{ name: "Entypo", component: Entypo, glyphMap: Entypo.glyphMap },
|
|
120
|
+
{ name: "AntDesign", component: AntDesign, glyphMap: AntDesign.glyphMap },
|
|
121
|
+
{ name: "Feather", component: Feather, glyphMap: Feather.glyphMap }
|
|
122
|
+
];
|
|
123
|
+
var resolvedCache = null;
|
|
124
|
+
function buildCache() {
|
|
125
|
+
const cache = /* @__PURE__ */ new Map();
|
|
126
|
+
for (const family of ICON_FAMILIES) {
|
|
127
|
+
if (!family.glyphMap) continue;
|
|
128
|
+
for (const iconName of Object.keys(family.glyphMap)) {
|
|
129
|
+
cache.set(iconName, family);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return cache;
|
|
133
|
+
}
|
|
134
|
+
function resolveFamily(name) {
|
|
135
|
+
if (!resolvedCache) {
|
|
136
|
+
resolvedCache = buildCache();
|
|
137
|
+
}
|
|
138
|
+
return resolvedCache.get(name) ?? null;
|
|
139
|
+
}
|
|
140
|
+
function Icon({ name, size, color, family }) {
|
|
141
|
+
let resolved = null;
|
|
142
|
+
if (family) {
|
|
143
|
+
resolved = ICON_FAMILIES.find((f) => f.name === family) ?? null;
|
|
144
|
+
} else {
|
|
145
|
+
resolved = resolveFamily(name);
|
|
146
|
+
}
|
|
147
|
+
if (!resolved) return null;
|
|
148
|
+
const Component = resolved.component;
|
|
149
|
+
return React24.createElement(Component, { name, size, color });
|
|
150
|
+
}
|
|
151
|
+
function renderIcon(name, size, color) {
|
|
152
|
+
return React24.createElement(Icon, { name, size, color });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/components/Button/Button.tsx
|
|
83
156
|
var nativeDriver = Platform.OS !== "web";
|
|
84
157
|
var containerSizeStyles = {
|
|
85
|
-
sm: { paddingHorizontal: 20, paddingVertical: 10 },
|
|
86
|
-
md: { paddingHorizontal: 24, paddingVertical: 14 },
|
|
87
|
-
lg: { paddingHorizontal: 32, paddingVertical: 18 }
|
|
158
|
+
sm: { paddingHorizontal: s(20), paddingVertical: vs(10) },
|
|
159
|
+
md: { paddingHorizontal: s(24), paddingVertical: vs(14) },
|
|
160
|
+
lg: { paddingHorizontal: s(32), paddingVertical: vs(18) }
|
|
88
161
|
};
|
|
89
162
|
var labelSizeStyles = {
|
|
90
|
-
sm: { fontSize: 15 },
|
|
91
|
-
md: { fontSize: 17 },
|
|
92
|
-
lg: { fontSize: 18 }
|
|
163
|
+
sm: { fontSize: ms(15) },
|
|
164
|
+
md: { fontSize: ms(17) },
|
|
165
|
+
lg: { fontSize: ms(18) }
|
|
93
166
|
};
|
|
167
|
+
var iconSizeMap = { sm: 16, md: 18, lg: 20 };
|
|
94
168
|
function Button({
|
|
95
169
|
label,
|
|
96
170
|
variant = "primary",
|
|
@@ -98,6 +172,8 @@ function Button({
|
|
|
98
172
|
loading = false,
|
|
99
173
|
fullWidth = false,
|
|
100
174
|
icon,
|
|
175
|
+
iconName,
|
|
176
|
+
iconColor,
|
|
101
177
|
iconPosition = "left",
|
|
102
178
|
disabled,
|
|
103
179
|
style,
|
|
@@ -106,10 +182,10 @@ function Button({
|
|
|
106
182
|
}) {
|
|
107
183
|
const { colors } = useTheme();
|
|
108
184
|
const isDisabled = disabled || loading;
|
|
109
|
-
const
|
|
185
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
110
186
|
const handlePressIn = () => {
|
|
111
187
|
if (isDisabled) return;
|
|
112
|
-
Animated.spring(
|
|
188
|
+
Animated.spring(scale2, {
|
|
113
189
|
toValue: 0.95,
|
|
114
190
|
useNativeDriver: nativeDriver,
|
|
115
191
|
speed: 40,
|
|
@@ -117,10 +193,10 @@ function Button({
|
|
|
117
193
|
}).start();
|
|
118
194
|
};
|
|
119
195
|
const handlePressOut = () => {
|
|
120
|
-
Animated.spring(
|
|
196
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: nativeDriver, speed: 40, bounciness: 4 }).start();
|
|
121
197
|
};
|
|
122
198
|
const handlePress = (e) => {
|
|
123
|
-
|
|
199
|
+
impactLight();
|
|
124
200
|
onPress?.(e);
|
|
125
201
|
};
|
|
126
202
|
const containerVariantStyle = {
|
|
@@ -137,8 +213,9 @@ function Button({
|
|
|
137
213
|
ghost: { color: colors.foreground },
|
|
138
214
|
destructive: { color: colors.destructiveForeground }
|
|
139
215
|
}[variant];
|
|
216
|
+
const effectiveIcon = iconName ? renderIcon(iconName, iconSizeMap[size], iconColor ?? labelVariantStyle.color) : typeof icon === "function" ? icon({ label, size, variant }) : icon;
|
|
140
217
|
const spinnerColor = variant === "destructive" ? colors.destructiveForeground : variant === "primary" || variant === "secondary" ? colors.primaryForeground : colors.foreground;
|
|
141
|
-
return /* @__PURE__ */
|
|
218
|
+
return /* @__PURE__ */ React24.createElement(Animated.View, { style: [fullWidth && styles.fullWidth, { transform: [{ scale: scale2 }] }] }, /* @__PURE__ */ React24.createElement(
|
|
142
219
|
TouchableOpacity,
|
|
143
220
|
{
|
|
144
221
|
style: [
|
|
@@ -157,7 +234,7 @@ function Button({
|
|
|
157
234
|
onPressOut: handlePressOut,
|
|
158
235
|
...props
|
|
159
236
|
},
|
|
160
|
-
loading ? /* @__PURE__ */
|
|
237
|
+
loading ? /* @__PURE__ */ React24.createElement(ActivityIndicator, { size: "small", color: spinnerColor }) : /* @__PURE__ */ React24.createElement(React24.Fragment, null, effectiveIcon && iconPosition === "left" && /* @__PURE__ */ React24.createElement(React24.Fragment, null, effectiveIcon), /* @__PURE__ */ React24.createElement(Text, { style: [styles.label, labelVariantStyle, labelSizeStyles[size], effectiveIcon ? styles.labelWithIcon : void 0] }, label), effectiveIcon && iconPosition === "right" && /* @__PURE__ */ React24.createElement(React24.Fragment, null, effectiveIcon))
|
|
161
238
|
));
|
|
162
239
|
}
|
|
163
240
|
var styles = StyleSheet.create({
|
|
@@ -177,21 +254,21 @@ var styles = StyleSheet.create({
|
|
|
177
254
|
fontWeight: "600"
|
|
178
255
|
},
|
|
179
256
|
labelWithIcon: {
|
|
180
|
-
marginHorizontal: 8
|
|
257
|
+
marginHorizontal: s(8)
|
|
181
258
|
}
|
|
182
259
|
});
|
|
183
260
|
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 }
|
|
261
|
+
h1: { fontSize: ms(40), fontWeight: "700", lineHeight: mvs(52) },
|
|
262
|
+
h2: { fontSize: ms(28), fontWeight: "700", lineHeight: mvs(36) },
|
|
263
|
+
h3: { fontSize: ms(22), fontWeight: "600", lineHeight: mvs(30) },
|
|
264
|
+
body: { fontSize: ms(17), fontWeight: "400", lineHeight: mvs(26) },
|
|
265
|
+
caption: { fontSize: ms(13), fontWeight: "400", lineHeight: mvs(20) },
|
|
266
|
+
label: { fontSize: ms(15), fontWeight: "500", lineHeight: mvs(22) }
|
|
190
267
|
};
|
|
191
268
|
function Text2({ variant = "body", color, style, children, ...props }) {
|
|
192
269
|
const { colors } = useTheme();
|
|
193
270
|
const defaultColor = variant === "caption" ? colors.mutedForeground : colors.foreground;
|
|
194
|
-
return /* @__PURE__ */
|
|
271
|
+
return /* @__PURE__ */ React24.createElement(
|
|
195
272
|
Text,
|
|
196
273
|
{
|
|
197
274
|
style: [variantStyles[variant], { color: color ?? defaultColor }, style],
|
|
@@ -202,14 +279,15 @@ function Text2({ variant = "body", color, style, children, ...props }) {
|
|
|
202
279
|
);
|
|
203
280
|
}
|
|
204
281
|
var webInputResetStyle = Platform.OS === "web" ? { outlineStyle: "none", outlineWidth: 0, outlineColor: "transparent", boxShadow: "none" } : {};
|
|
205
|
-
function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, type = "text", containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }) {
|
|
282
|
+
function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type = "text", containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }) {
|
|
206
283
|
const { colors } = useTheme();
|
|
207
284
|
const [focused, setFocused] = useState(false);
|
|
208
285
|
const [showPassword, setShowPassword] = useState(false);
|
|
209
286
|
const isPassword = type === "password";
|
|
210
287
|
const effectiveSecure = isPassword ? !showPassword : secureTextEntry;
|
|
211
|
-
const
|
|
212
|
-
|
|
288
|
+
const effectivePrefix = prefixIcon ? renderIcon(prefixIcon, 20, prefixIconColor ?? colors.mutedForeground) : prefix;
|
|
289
|
+
const effectiveSuffix = isPassword && !suffix && !suffixIcon ? /* @__PURE__ */ React24.createElement(TouchableOpacity, { onPress: () => setShowPassword(!showPassword), style: styles2.passwordToggle, activeOpacity: 0.6 }, /* @__PURE__ */ React24.createElement(AntDesign$1, { name: showPassword ? "eye" : "eye-invisible", size: 20, color: colors.mutedForeground })) : suffixIcon ? renderIcon(suffixIcon, 20, suffixIconColor ?? colors.mutedForeground) : suffix;
|
|
290
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles2.container, containerStyle] }, label ? /* @__PURE__ */ React24.createElement(Text, { style: [styles2.label, { color: colors.foreground }], allowFontScaling: true }, label) : null, /* @__PURE__ */ React24.createElement(
|
|
213
291
|
View,
|
|
214
292
|
{
|
|
215
293
|
style: [
|
|
@@ -220,8 +298,8 @@ function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, t
|
|
|
220
298
|
}
|
|
221
299
|
]
|
|
222
300
|
},
|
|
223
|
-
|
|
224
|
-
/* @__PURE__ */
|
|
301
|
+
effectivePrefix ? typeof effectivePrefix === "string" ? /* @__PURE__ */ React24.createElement(Text, { style: [styles2.prefixText, { color: colors.mutedForeground }, prefixStyle], allowFontScaling: true }, effectivePrefix) : /* @__PURE__ */ React24.createElement(View, { style: styles2.prefixContainer }, effectivePrefix) : null,
|
|
302
|
+
/* @__PURE__ */ React24.createElement(
|
|
225
303
|
TextInput,
|
|
226
304
|
{
|
|
227
305
|
style: [
|
|
@@ -246,67 +324,68 @@ function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, t
|
|
|
246
324
|
...props
|
|
247
325
|
}
|
|
248
326
|
),
|
|
249
|
-
effectiveSuffix ? typeof effectiveSuffix === "string" ? /* @__PURE__ */
|
|
250
|
-
), error ? /* @__PURE__ */
|
|
327
|
+
effectiveSuffix ? typeof effectiveSuffix === "string" ? /* @__PURE__ */ React24.createElement(Text, { style: [styles2.suffixText, { color: colors.mutedForeground }, suffixStyle], allowFontScaling: true }, effectiveSuffix) : /* @__PURE__ */ React24.createElement(View, { style: styles2.suffixContainer }, effectiveSuffix) : null
|
|
328
|
+
), error ? /* @__PURE__ */ React24.createElement(Text, { style: [styles2.helperText, { color: colors.destructive }], allowFontScaling: true }, error) : null, !error && hint ? /* @__PURE__ */ React24.createElement(Text, { style: [styles2.helperText, { color: colors.mutedForeground }], allowFontScaling: true }, hint) : null);
|
|
251
329
|
}
|
|
252
330
|
var styles2 = StyleSheet.create({
|
|
253
331
|
container: {
|
|
254
|
-
gap: 8
|
|
332
|
+
gap: vs(8)
|
|
255
333
|
},
|
|
256
334
|
label: {
|
|
257
|
-
fontSize: 15,
|
|
335
|
+
fontSize: ms(15),
|
|
258
336
|
fontWeight: "500"
|
|
259
337
|
},
|
|
260
338
|
inputWrapper: {
|
|
261
339
|
flexDirection: "row",
|
|
262
340
|
alignItems: "center",
|
|
263
341
|
borderWidth: 1.5,
|
|
264
|
-
borderRadius: 8,
|
|
265
|
-
paddingHorizontal: 16,
|
|
266
|
-
paddingVertical: 14
|
|
342
|
+
borderRadius: ms(8),
|
|
343
|
+
paddingHorizontal: s(16),
|
|
344
|
+
paddingVertical: vs(14)
|
|
267
345
|
},
|
|
268
346
|
input: {
|
|
269
347
|
flex: 1,
|
|
270
|
-
fontSize: 17,
|
|
348
|
+
fontSize: ms(17),
|
|
271
349
|
paddingVertical: 0
|
|
272
350
|
},
|
|
273
351
|
prefixContainer: {
|
|
274
|
-
marginRight: 8
|
|
352
|
+
marginRight: s(8)
|
|
275
353
|
},
|
|
276
354
|
prefixText: {
|
|
277
|
-
fontSize: 17,
|
|
278
|
-
marginRight: 8
|
|
355
|
+
fontSize: ms(17),
|
|
356
|
+
marginRight: s(8)
|
|
279
357
|
},
|
|
280
358
|
suffixContainer: {
|
|
281
|
-
marginLeft: 8
|
|
359
|
+
marginLeft: s(8)
|
|
282
360
|
},
|
|
283
361
|
suffixText: {
|
|
284
|
-
fontSize: 17,
|
|
285
|
-
marginLeft: 8
|
|
362
|
+
fontSize: ms(17),
|
|
363
|
+
marginLeft: s(8)
|
|
286
364
|
},
|
|
287
365
|
passwordToggle: {
|
|
288
|
-
padding: 4
|
|
366
|
+
padding: s(4)
|
|
289
367
|
},
|
|
290
368
|
helperText: {
|
|
291
|
-
fontSize: 13
|
|
369
|
+
fontSize: ms(13)
|
|
292
370
|
}
|
|
293
371
|
});
|
|
294
372
|
var sizePadding = {
|
|
295
|
-
sm: { paddingHorizontal: 8, paddingVertical: 2 },
|
|
296
|
-
md: { paddingHorizontal: 10, paddingVertical: 4 },
|
|
297
|
-
lg: { paddingHorizontal: 12, paddingVertical: 6 }
|
|
373
|
+
sm: { paddingHorizontal: s(8), paddingVertical: vs(2) },
|
|
374
|
+
md: { paddingHorizontal: s(10), paddingVertical: vs(4) },
|
|
375
|
+
lg: { paddingHorizontal: s(12), paddingVertical: vs(6) }
|
|
298
376
|
};
|
|
299
377
|
var sizeFontSize = {
|
|
300
|
-
sm: { fontSize: 11 },
|
|
301
|
-
md: { fontSize: 13 },
|
|
302
|
-
lg: { fontSize: 15 }
|
|
378
|
+
sm: { fontSize: ms(11) },
|
|
379
|
+
md: { fontSize: ms(13) },
|
|
380
|
+
lg: { fontSize: ms(15) }
|
|
303
381
|
};
|
|
304
382
|
var sizeIconGap = {
|
|
305
|
-
sm: 4,
|
|
306
|
-
md: 6,
|
|
307
|
-
lg: 6
|
|
383
|
+
sm: s(4),
|
|
384
|
+
md: s(6),
|
|
385
|
+
lg: s(6)
|
|
308
386
|
};
|
|
309
|
-
|
|
387
|
+
var sizeIconSize = { sm: 10, md: 12, lg: 14 };
|
|
388
|
+
function Badge({ label, children, variant = "default", size = "md", icon, iconName, iconColor, style }) {
|
|
310
389
|
const { colors } = useTheme();
|
|
311
390
|
const containerStyle = {
|
|
312
391
|
default: { backgroundColor: colors.primary },
|
|
@@ -320,12 +399,13 @@ function Badge({ label, children, variant = "default", size = "md", icon, style
|
|
|
320
399
|
destructive: colors.destructiveForeground,
|
|
321
400
|
outline: colors.foreground
|
|
322
401
|
}[variant];
|
|
402
|
+
const effectiveIcon = iconName ? renderIcon(iconName, sizeIconSize[size], iconColor ?? textColor) : icon;
|
|
323
403
|
const content = children ?? label;
|
|
324
|
-
return /* @__PURE__ */
|
|
404
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles3.container, containerStyle, sizePadding[size], { gap: sizeIconGap[size] }, style] }, effectiveIcon ? /* @__PURE__ */ React24.createElement(View, { style: styles3.iconContainer }, effectiveIcon) : null, typeof content === "string" ? /* @__PURE__ */ React24.createElement(Text, { style: [styles3.label, { color: textColor }, sizeFontSize[size]], allowFontScaling: true }, content) : content);
|
|
325
405
|
}
|
|
326
406
|
var styles3 = StyleSheet.create({
|
|
327
407
|
container: {
|
|
328
|
-
borderRadius: 6,
|
|
408
|
+
borderRadius: ms(6),
|
|
329
409
|
alignSelf: "flex-start",
|
|
330
410
|
flexDirection: "row",
|
|
331
411
|
alignItems: "center"
|
|
@@ -341,10 +421,10 @@ var styles3 = StyleSheet.create({
|
|
|
341
421
|
var nativeDriver2 = Platform.OS !== "web";
|
|
342
422
|
function Card({ children, variant = "elevated", onPress, style }) {
|
|
343
423
|
const { colors } = useTheme();
|
|
344
|
-
const
|
|
424
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
345
425
|
const handlePressIn = () => {
|
|
346
426
|
if (!onPress) return;
|
|
347
|
-
Animated.spring(
|
|
427
|
+
Animated.spring(scale2, {
|
|
348
428
|
toValue: 0.98,
|
|
349
429
|
useNativeDriver: nativeDriver2,
|
|
350
430
|
speed: 40,
|
|
@@ -353,7 +433,7 @@ function Card({ children, variant = "elevated", onPress, style }) {
|
|
|
353
433
|
};
|
|
354
434
|
const handlePressOut = () => {
|
|
355
435
|
if (!onPress) return;
|
|
356
|
-
Animated.spring(
|
|
436
|
+
Animated.spring(scale2, {
|
|
357
437
|
toValue: 1,
|
|
358
438
|
useNativeDriver: nativeDriver2,
|
|
359
439
|
speed: 40,
|
|
@@ -362,7 +442,7 @@ function Card({ children, variant = "elevated", onPress, style }) {
|
|
|
362
442
|
};
|
|
363
443
|
const handlePress = () => {
|
|
364
444
|
if (!onPress) return;
|
|
365
|
-
|
|
445
|
+
impactLight();
|
|
366
446
|
onPress();
|
|
367
447
|
};
|
|
368
448
|
const variantStyle = {
|
|
@@ -388,9 +468,9 @@ function Card({ children, variant = "elevated", onPress, style }) {
|
|
|
388
468
|
elevation: 0
|
|
389
469
|
}
|
|
390
470
|
}[variant];
|
|
391
|
-
const cardContent = /* @__PURE__ */
|
|
471
|
+
const cardContent = /* @__PURE__ */ React24.createElement(View, { style: [styles4.card, variantStyle, style] }, children);
|
|
392
472
|
if (onPress) {
|
|
393
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ React24.createElement(Animated.View, { style: { transform: [{ scale: scale2 }] } }, /* @__PURE__ */ React24.createElement(
|
|
394
474
|
TouchableOpacity,
|
|
395
475
|
{
|
|
396
476
|
onPress: handlePress,
|
|
@@ -405,46 +485,46 @@ function Card({ children, variant = "elevated", onPress, style }) {
|
|
|
405
485
|
return cardContent;
|
|
406
486
|
}
|
|
407
487
|
function CardHeader({ children, style }) {
|
|
408
|
-
return /* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles4.header, style] }, children);
|
|
409
489
|
}
|
|
410
490
|
function CardTitle({ children, style }) {
|
|
411
491
|
const { colors } = useTheme();
|
|
412
|
-
return /* @__PURE__ */
|
|
492
|
+
return /* @__PURE__ */ React24.createElement(Text, { style: [styles4.title, { color: colors.cardForeground }, style], allowFontScaling: true }, children);
|
|
413
493
|
}
|
|
414
494
|
function CardDescription({ children, style }) {
|
|
415
495
|
const { colors } = useTheme();
|
|
416
|
-
return /* @__PURE__ */
|
|
496
|
+
return /* @__PURE__ */ React24.createElement(Text, { style: [styles4.description, { color: colors.mutedForeground }, style], allowFontScaling: true }, children);
|
|
417
497
|
}
|
|
418
498
|
function CardContent({ children, style }) {
|
|
419
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles4.content, style] }, children);
|
|
420
500
|
}
|
|
421
501
|
function CardFooter({ children, style }) {
|
|
422
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles4.footer, style] }, children);
|
|
423
503
|
}
|
|
424
504
|
var styles4 = StyleSheet.create({
|
|
425
505
|
card: {
|
|
426
|
-
borderRadius: 12,
|
|
506
|
+
borderRadius: ms(12),
|
|
427
507
|
borderWidth: 1
|
|
428
508
|
},
|
|
429
509
|
header: {
|
|
430
|
-
padding: 24,
|
|
510
|
+
padding: s(24),
|
|
431
511
|
paddingBottom: 0,
|
|
432
|
-
gap: 8
|
|
512
|
+
gap: vs(8)
|
|
433
513
|
},
|
|
434
514
|
title: {
|
|
435
|
-
fontSize: 20,
|
|
515
|
+
fontSize: ms(20),
|
|
436
516
|
fontWeight: "600",
|
|
437
|
-
lineHeight: 28
|
|
517
|
+
lineHeight: mvs(28)
|
|
438
518
|
},
|
|
439
519
|
description: {
|
|
440
|
-
fontSize: 15,
|
|
441
|
-
lineHeight: 22
|
|
520
|
+
fontSize: ms(15),
|
|
521
|
+
lineHeight: mvs(22)
|
|
442
522
|
},
|
|
443
523
|
content: {
|
|
444
|
-
padding: 24
|
|
524
|
+
padding: s(24)
|
|
445
525
|
},
|
|
446
526
|
footer: {
|
|
447
|
-
padding: 24,
|
|
527
|
+
padding: s(24),
|
|
448
528
|
paddingTop: 0,
|
|
449
529
|
flexDirection: "row",
|
|
450
530
|
alignItems: "center"
|
|
@@ -452,7 +532,7 @@ var styles4 = StyleSheet.create({
|
|
|
452
532
|
});
|
|
453
533
|
function Separator({ orientation = "horizontal", style }) {
|
|
454
534
|
const { colors } = useTheme();
|
|
455
|
-
return /* @__PURE__ */
|
|
535
|
+
return /* @__PURE__ */ React24.createElement(
|
|
456
536
|
View,
|
|
457
537
|
{
|
|
458
538
|
style: [
|
|
@@ -480,7 +560,7 @@ var sizeMap = {
|
|
|
480
560
|
};
|
|
481
561
|
function Spinner({ size = "md", color, ...props }) {
|
|
482
562
|
const { colors } = useTheme();
|
|
483
|
-
return /* @__PURE__ */
|
|
563
|
+
return /* @__PURE__ */ React24.createElement(ActivityIndicator, { size: sizeMap[size], color: color ?? colors.primary, ...props });
|
|
484
564
|
}
|
|
485
565
|
function Skeleton({ width = "100%", height = 16, borderRadius = 6, style }) {
|
|
486
566
|
const { colors, colorScheme } = useTheme();
|
|
@@ -502,7 +582,7 @@ function Skeleton({ width = "100%", height = 16, borderRadius = 6, style }) {
|
|
|
502
582
|
inputRange: [0, 1],
|
|
503
583
|
outputRange: [-containerWidth, containerWidth]
|
|
504
584
|
});
|
|
505
|
-
return /* @__PURE__ */
|
|
585
|
+
return /* @__PURE__ */ React24.createElement(
|
|
506
586
|
View,
|
|
507
587
|
{
|
|
508
588
|
style: [
|
|
@@ -512,7 +592,7 @@ function Skeleton({ width = "100%", height = 16, borderRadius = 6, style }) {
|
|
|
512
592
|
],
|
|
513
593
|
onLayout: (e) => setContainerWidth(e.nativeEvent.layout.width)
|
|
514
594
|
},
|
|
515
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ React24.createElement(Animated.View, { style: [StyleSheet.absoluteFill, { transform: [{ translateX }] }] }, /* @__PURE__ */ React24.createElement(
|
|
516
596
|
LinearGradient,
|
|
517
597
|
{
|
|
518
598
|
colors: ["transparent", shimmerHighlight, "transparent"],
|
|
@@ -529,16 +609,16 @@ var styles6 = StyleSheet.create({
|
|
|
529
609
|
}
|
|
530
610
|
});
|
|
531
611
|
var sizeMap2 = {
|
|
532
|
-
sm: 28,
|
|
533
|
-
md: 40,
|
|
534
|
-
lg: 56,
|
|
535
|
-
xl: 72
|
|
612
|
+
sm: s(28),
|
|
613
|
+
md: s(40),
|
|
614
|
+
lg: s(56),
|
|
615
|
+
xl: s(72)
|
|
536
616
|
};
|
|
537
617
|
var fontSizeMap = {
|
|
538
|
-
sm: 12,
|
|
539
|
-
md: 16,
|
|
540
|
-
lg: 22,
|
|
541
|
-
xl: 28
|
|
618
|
+
sm: ms(12),
|
|
619
|
+
md: ms(16),
|
|
620
|
+
lg: ms(22),
|
|
621
|
+
xl: ms(28)
|
|
542
622
|
};
|
|
543
623
|
function Avatar({ src, fallback, size = "md", style }) {
|
|
544
624
|
const { colors } = useTheme();
|
|
@@ -552,14 +632,14 @@ function Avatar({ src, fallback, size = "md", style }) {
|
|
|
552
632
|
backgroundColor: colors.muted,
|
|
553
633
|
overflow: "hidden"
|
|
554
634
|
};
|
|
555
|
-
return /* @__PURE__ */
|
|
635
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles7.base, containerStyle, style] }, !showFallback ? /* @__PURE__ */ React24.createElement(
|
|
556
636
|
Image,
|
|
557
637
|
{
|
|
558
638
|
source: { uri: src },
|
|
559
639
|
style: { width: dimension, height: dimension },
|
|
560
640
|
onError: () => setImageError(true)
|
|
561
641
|
}
|
|
562
|
-
) : /* @__PURE__ */
|
|
642
|
+
) : /* @__PURE__ */ React24.createElement(
|
|
563
643
|
Text,
|
|
564
644
|
{
|
|
565
645
|
style: [styles7.fallback, { color: colors.mutedForeground, fontSize: fontSizeMap[size] }],
|
|
@@ -577,21 +657,22 @@ var styles7 = StyleSheet.create({
|
|
|
577
657
|
fontWeight: "500"
|
|
578
658
|
}
|
|
579
659
|
});
|
|
580
|
-
function AlertBanner({ title, description, variant = "default", icon, style }) {
|
|
660
|
+
function AlertBanner({ title, description, variant = "default", icon, iconName, iconColor, style }) {
|
|
581
661
|
const { colors } = useTheme();
|
|
582
662
|
const borderColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : colors.border;
|
|
583
663
|
const titleColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : colors.foreground;
|
|
584
664
|
const descColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : colors.mutedForeground;
|
|
585
|
-
const defaultIcon = variant === "success" ? /* @__PURE__ */
|
|
586
|
-
|
|
665
|
+
const defaultIcon = variant === "success" ? /* @__PURE__ */ React24.createElement(FontAwesome5$1, { name: "check-circle", size: 18, color: titleColor }) : variant === "destructive" ? /* @__PURE__ */ React24.createElement(MaterialIcons$1, { name: "error-outline", size: 20, color: titleColor }) : /* @__PURE__ */ React24.createElement(Entypo$1, { name: "info-with-circle", size: 18, color: titleColor });
|
|
666
|
+
const effectiveIcon = iconName ? renderIcon(iconName, 18, iconColor ?? titleColor) : icon ?? defaultIcon;
|
|
667
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles8.container, { backgroundColor: colors.card, borderColor }, style] }, /* @__PURE__ */ React24.createElement(View, { style: styles8.icon }, effectiveIcon), /* @__PURE__ */ React24.createElement(View, { style: styles8.content }, title ? /* @__PURE__ */ React24.createElement(Text, { style: [styles8.title, { color: titleColor }], allowFontScaling: true }, title) : null, description ? /* @__PURE__ */ React24.createElement(Text, { style: [styles8.description, { color: descColor }], allowFontScaling: true }, description) : null));
|
|
587
668
|
}
|
|
588
669
|
var styles8 = StyleSheet.create({
|
|
589
670
|
container: {
|
|
590
671
|
flexDirection: "row",
|
|
591
672
|
borderWidth: 1,
|
|
592
|
-
borderRadius: 12,
|
|
593
|
-
padding: 16,
|
|
594
|
-
gap: 12,
|
|
673
|
+
borderRadius: ms(12),
|
|
674
|
+
padding: s(16),
|
|
675
|
+
gap: s(12),
|
|
595
676
|
shadowColor: "#000",
|
|
596
677
|
shadowOffset: { width: 0, height: 4 },
|
|
597
678
|
shadowOpacity: 0.06,
|
|
@@ -603,16 +684,16 @@ var styles8 = StyleSheet.create({
|
|
|
603
684
|
},
|
|
604
685
|
content: {
|
|
605
686
|
flex: 1,
|
|
606
|
-
gap: 4
|
|
687
|
+
gap: vs(4)
|
|
607
688
|
},
|
|
608
689
|
title: {
|
|
609
|
-
fontSize: 14,
|
|
690
|
+
fontSize: ms(14),
|
|
610
691
|
fontWeight: "500",
|
|
611
|
-
lineHeight: 20
|
|
692
|
+
lineHeight: mvs(20)
|
|
612
693
|
},
|
|
613
694
|
description: {
|
|
614
|
-
fontSize: 14,
|
|
615
|
-
lineHeight: 20
|
|
695
|
+
fontSize: ms(14),
|
|
696
|
+
lineHeight: mvs(20)
|
|
616
697
|
}
|
|
617
698
|
});
|
|
618
699
|
function Progress({ value = 0, max = 100, style }) {
|
|
@@ -629,13 +710,13 @@ function Progress({ value = 0, max = 100, style }) {
|
|
|
629
710
|
bounciness: 0
|
|
630
711
|
}).start();
|
|
631
712
|
}, [percent, trackWidth]);
|
|
632
|
-
return /* @__PURE__ */
|
|
713
|
+
return /* @__PURE__ */ React24.createElement(
|
|
633
714
|
View,
|
|
634
715
|
{
|
|
635
716
|
style: [styles9.track, { backgroundColor: colors.muted }, style],
|
|
636
717
|
onLayout: (e) => setTrackWidth(e.nativeEvent.layout.width)
|
|
637
718
|
},
|
|
638
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ React24.createElement(
|
|
639
720
|
Animated.View,
|
|
640
721
|
{
|
|
641
722
|
style: [styles9.indicator, { width: animatedWidth, backgroundColor: colors.primary }]
|
|
@@ -645,7 +726,7 @@ function Progress({ value = 0, max = 100, style }) {
|
|
|
645
726
|
}
|
|
646
727
|
var styles9 = StyleSheet.create({
|
|
647
728
|
track: {
|
|
648
|
-
height: 8,
|
|
729
|
+
height: vs(8),
|
|
649
730
|
borderRadius: 999,
|
|
650
731
|
overflow: "hidden",
|
|
651
732
|
width: "100%"
|
|
@@ -655,10 +736,11 @@ var styles9 = StyleSheet.create({
|
|
|
655
736
|
borderRadius: 999
|
|
656
737
|
}
|
|
657
738
|
});
|
|
658
|
-
function EmptyState({ icon, title, description, action, size = "default", style }) {
|
|
739
|
+
function EmptyState({ icon, iconName, iconColor, title, description, action, size = "default", style }) {
|
|
659
740
|
const { colors } = useTheme();
|
|
660
741
|
const isCompact = size === "compact";
|
|
661
|
-
|
|
742
|
+
const effectiveIcon = iconName ? renderIcon(iconName, isCompact ? 32 : 48, iconColor ?? colors.mutedForeground) : icon;
|
|
743
|
+
return /* @__PURE__ */ React24.createElement(
|
|
662
744
|
View,
|
|
663
745
|
{
|
|
664
746
|
style: [
|
|
@@ -668,7 +750,7 @@ function EmptyState({ icon, title, description, action, size = "default", style
|
|
|
668
750
|
style
|
|
669
751
|
]
|
|
670
752
|
},
|
|
671
|
-
|
|
753
|
+
effectiveIcon ? /* @__PURE__ */ React24.createElement(
|
|
672
754
|
View,
|
|
673
755
|
{
|
|
674
756
|
style: [
|
|
@@ -677,17 +759,17 @@ function EmptyState({ icon, title, description, action, size = "default", style
|
|
|
677
759
|
{ backgroundColor: colors.muted }
|
|
678
760
|
]
|
|
679
761
|
},
|
|
680
|
-
|
|
762
|
+
effectiveIcon
|
|
681
763
|
) : null,
|
|
682
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ React24.createElement(View, { style: styles10.textWrapper }, /* @__PURE__ */ React24.createElement(
|
|
683
765
|
Text,
|
|
684
766
|
{
|
|
685
767
|
style: [styles10.title, isCompact && styles10.titleCompact, { color: colors.foreground }],
|
|
686
768
|
allowFontScaling: true
|
|
687
769
|
},
|
|
688
770
|
title
|
|
689
|
-
), description && !isCompact ? /* @__PURE__ */
|
|
690
|
-
action && !isCompact ? /* @__PURE__ */
|
|
771
|
+
), description && !isCompact ? /* @__PURE__ */ React24.createElement(Text, { style: [styles10.description, { color: colors.mutedForeground }], allowFontScaling: true }, description) : null),
|
|
772
|
+
action && !isCompact ? /* @__PURE__ */ React24.createElement(View, { style: styles10.action }, action) : null
|
|
691
773
|
);
|
|
692
774
|
}
|
|
693
775
|
var styles10 = StyleSheet.create({
|
|
@@ -696,46 +778,46 @@ var styles10 = StyleSheet.create({
|
|
|
696
778
|
justifyContent: "center",
|
|
697
779
|
borderWidth: 1,
|
|
698
780
|
borderStyle: "dashed",
|
|
699
|
-
borderRadius: 12,
|
|
700
|
-
padding: 32,
|
|
701
|
-
gap: 16
|
|
781
|
+
borderRadius: ms(12),
|
|
782
|
+
padding: s(32),
|
|
783
|
+
gap: vs(16)
|
|
702
784
|
},
|
|
703
785
|
containerCompact: {
|
|
704
|
-
padding: 20,
|
|
705
|
-
gap: 10
|
|
786
|
+
padding: s(20),
|
|
787
|
+
gap: vs(10)
|
|
706
788
|
},
|
|
707
789
|
iconWrapper: {
|
|
708
|
-
width: 48,
|
|
709
|
-
height: 48,
|
|
710
|
-
borderRadius: 12,
|
|
790
|
+
width: s(48),
|
|
791
|
+
height: s(48),
|
|
792
|
+
borderRadius: ms(12),
|
|
711
793
|
alignItems: "center",
|
|
712
794
|
justifyContent: "center"
|
|
713
795
|
},
|
|
714
796
|
iconWrapperCompact: {
|
|
715
|
-
width: 36,
|
|
716
|
-
height: 36,
|
|
717
|
-
borderRadius: 8
|
|
797
|
+
width: s(36),
|
|
798
|
+
height: s(36),
|
|
799
|
+
borderRadius: ms(8)
|
|
718
800
|
},
|
|
719
801
|
textWrapper: {
|
|
720
802
|
alignItems: "center",
|
|
721
|
-
gap: 8,
|
|
722
|
-
maxWidth: 320
|
|
803
|
+
gap: vs(8),
|
|
804
|
+
maxWidth: s(320)
|
|
723
805
|
},
|
|
724
806
|
title: {
|
|
725
|
-
fontSize: 18,
|
|
807
|
+
fontSize: ms(18),
|
|
726
808
|
fontWeight: "500",
|
|
727
809
|
textAlign: "center"
|
|
728
810
|
},
|
|
729
811
|
titleCompact: {
|
|
730
|
-
fontSize: 15
|
|
812
|
+
fontSize: ms(15)
|
|
731
813
|
},
|
|
732
814
|
description: {
|
|
733
|
-
fontSize: 14,
|
|
734
|
-
lineHeight: 20,
|
|
815
|
+
fontSize: ms(14),
|
|
816
|
+
lineHeight: mvs(20),
|
|
735
817
|
textAlign: "center"
|
|
736
818
|
},
|
|
737
819
|
action: {
|
|
738
|
-
marginTop: 8
|
|
820
|
+
marginTop: vs(8)
|
|
739
821
|
}
|
|
740
822
|
});
|
|
741
823
|
var webInputResetStyle2 = Platform.OS === "web" ? { outlineStyle: "none", outlineWidth: 0, outlineColor: "transparent", boxShadow: "none" } : {};
|
|
@@ -752,7 +834,7 @@ function Textarea({
|
|
|
752
834
|
}) {
|
|
753
835
|
const { colors } = useTheme();
|
|
754
836
|
const [focused, setFocused] = useState(false);
|
|
755
|
-
return /* @__PURE__ */
|
|
837
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles11.container, containerStyle] }, label ? /* @__PURE__ */ React24.createElement(Text, { style: [styles11.label, { color: colors.foreground }], allowFontScaling: true }, label) : null, /* @__PURE__ */ React24.createElement(
|
|
756
838
|
TextInput,
|
|
757
839
|
{
|
|
758
840
|
multiline: true,
|
|
@@ -764,7 +846,7 @@ function Textarea({
|
|
|
764
846
|
borderColor: error ? colors.destructive : focused ? colors.ring ?? colors.primary : colors.border,
|
|
765
847
|
color: colors.foreground,
|
|
766
848
|
backgroundColor: colors.background,
|
|
767
|
-
minHeight: rows * 30
|
|
849
|
+
minHeight: rows * vs(30)
|
|
768
850
|
},
|
|
769
851
|
webInputResetStyle2,
|
|
770
852
|
style
|
|
@@ -781,27 +863,28 @@ function Textarea({
|
|
|
781
863
|
allowFontScaling: true,
|
|
782
864
|
...props
|
|
783
865
|
}
|
|
784
|
-
), error ? /* @__PURE__ */
|
|
866
|
+
), error ? /* @__PURE__ */ React24.createElement(Text, { style: [styles11.helperText, { color: colors.destructive }], allowFontScaling: true }, error) : null, !error && hint ? /* @__PURE__ */ React24.createElement(Text, { style: [styles11.helperText, { color: colors.mutedForeground }], allowFontScaling: true }, hint) : null);
|
|
785
867
|
}
|
|
786
868
|
var styles11 = StyleSheet.create({
|
|
787
869
|
container: {
|
|
788
|
-
gap: 8
|
|
870
|
+
gap: vs(8)
|
|
789
871
|
},
|
|
790
872
|
label: {
|
|
791
|
-
fontSize: 15,
|
|
873
|
+
fontSize: ms(15),
|
|
792
874
|
fontWeight: "500"
|
|
793
875
|
},
|
|
794
876
|
input: {
|
|
795
877
|
borderWidth: 1.5,
|
|
796
|
-
borderRadius: 8,
|
|
797
|
-
paddingHorizontal: 16,
|
|
798
|
-
paddingVertical: 14,
|
|
799
|
-
fontSize: 17
|
|
878
|
+
borderRadius: ms(8),
|
|
879
|
+
paddingHorizontal: s(16),
|
|
880
|
+
paddingVertical: vs(14),
|
|
881
|
+
fontSize: ms(17)
|
|
800
882
|
},
|
|
801
883
|
helperText: {
|
|
802
|
-
fontSize: 13
|
|
884
|
+
fontSize: ms(13)
|
|
803
885
|
}
|
|
804
886
|
});
|
|
887
|
+
var nativeDriver3 = Platform.OS !== "web";
|
|
805
888
|
function Checkbox({
|
|
806
889
|
checked = false,
|
|
807
890
|
onCheckedChange,
|
|
@@ -810,20 +893,20 @@ function Checkbox({
|
|
|
810
893
|
style
|
|
811
894
|
}) {
|
|
812
895
|
const { colors } = useTheme();
|
|
813
|
-
const
|
|
896
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
814
897
|
const handlePressIn = () => {
|
|
815
898
|
if (disabled) return;
|
|
816
|
-
Animated.spring(
|
|
899
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: nativeDriver3, speed: 40, bounciness: 0 }).start();
|
|
817
900
|
};
|
|
818
901
|
const handlePressOut = () => {
|
|
819
|
-
Animated.spring(
|
|
902
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: nativeDriver3, speed: 40, bounciness: 4 }).start();
|
|
820
903
|
};
|
|
821
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ React24.createElement(Animated.View, { style: { transform: [{ scale: scale2 }] } }, /* @__PURE__ */ React24.createElement(
|
|
822
905
|
TouchableOpacity,
|
|
823
906
|
{
|
|
824
907
|
style: [styles12.row, style],
|
|
825
908
|
onPress: () => {
|
|
826
|
-
|
|
909
|
+
selectionAsync();
|
|
827
910
|
onCheckedChange?.(!checked);
|
|
828
911
|
},
|
|
829
912
|
onPressIn: handlePressIn,
|
|
@@ -832,7 +915,7 @@ function Checkbox({
|
|
|
832
915
|
activeOpacity: 1,
|
|
833
916
|
touchSoundDisabled: true
|
|
834
917
|
},
|
|
835
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ React24.createElement(
|
|
836
919
|
View,
|
|
837
920
|
{
|
|
838
921
|
style: [
|
|
@@ -844,9 +927,9 @@ function Checkbox({
|
|
|
844
927
|
}
|
|
845
928
|
]
|
|
846
929
|
},
|
|
847
|
-
checked ? /* @__PURE__ */
|
|
930
|
+
checked ? /* @__PURE__ */ React24.createElement(View, { style: [styles12.checkmark, { borderColor: colors.primaryForeground }] }) : null
|
|
848
931
|
),
|
|
849
|
-
label ? /* @__PURE__ */
|
|
932
|
+
label ? /* @__PURE__ */ React24.createElement(
|
|
850
933
|
Text,
|
|
851
934
|
{
|
|
852
935
|
style: [styles12.label, { color: disabled ? colors.mutedForeground : colors.foreground }]
|
|
@@ -859,33 +942,33 @@ var styles12 = StyleSheet.create({
|
|
|
859
942
|
row: {
|
|
860
943
|
flexDirection: "row",
|
|
861
944
|
alignItems: "center",
|
|
862
|
-
gap: 12
|
|
945
|
+
gap: s(12)
|
|
863
946
|
},
|
|
864
947
|
box: {
|
|
865
|
-
width: 24,
|
|
866
|
-
height: 24,
|
|
867
|
-
borderRadius: 8,
|
|
948
|
+
width: s(24),
|
|
949
|
+
height: s(24),
|
|
950
|
+
borderRadius: ms(8),
|
|
868
951
|
borderWidth: 1.5,
|
|
869
952
|
alignItems: "center",
|
|
870
953
|
justifyContent: "center"
|
|
871
954
|
},
|
|
872
955
|
checkmark: {
|
|
873
|
-
width: 12,
|
|
874
|
-
height: 7,
|
|
956
|
+
width: s(12),
|
|
957
|
+
height: vs(7),
|
|
875
958
|
borderLeftWidth: 2,
|
|
876
959
|
borderBottomWidth: 2,
|
|
877
960
|
transform: [{ rotate: "-45deg" }, { translateY: -1 }]
|
|
878
961
|
},
|
|
879
962
|
label: {
|
|
880
|
-
fontSize: 15,
|
|
881
|
-
lineHeight: 22
|
|
963
|
+
fontSize: ms(15),
|
|
964
|
+
lineHeight: mvs(22)
|
|
882
965
|
}
|
|
883
966
|
});
|
|
884
|
-
var
|
|
885
|
-
var TRACK_WIDTH = 60;
|
|
886
|
-
var TRACK_HEIGHT = 36;
|
|
887
|
-
var THUMB_SIZE = 28;
|
|
888
|
-
var THUMB_OFFSET = 4;
|
|
967
|
+
var nativeDriver4 = Platform.OS !== "web";
|
|
968
|
+
var TRACK_WIDTH = s(60);
|
|
969
|
+
var TRACK_HEIGHT = vs(36);
|
|
970
|
+
var THUMB_SIZE = s(28);
|
|
971
|
+
var THUMB_OFFSET = s(4);
|
|
889
972
|
var THUMB_TRAVEL = TRACK_WIDTH - THUMB_SIZE - THUMB_OFFSET * 2;
|
|
890
973
|
function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
891
974
|
const { colors } = useTheme();
|
|
@@ -895,7 +978,7 @@ function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
|
895
978
|
Animated.parallel([
|
|
896
979
|
Animated.spring(translateX, {
|
|
897
980
|
toValue: checked ? THUMB_TRAVEL : 0,
|
|
898
|
-
useNativeDriver:
|
|
981
|
+
useNativeDriver: nativeDriver4,
|
|
899
982
|
bounciness: 4
|
|
900
983
|
}),
|
|
901
984
|
Animated.timing(trackOpacity, {
|
|
@@ -909,11 +992,11 @@ function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
|
909
992
|
inputRange: [0, 1],
|
|
910
993
|
outputRange: [colors.muted, colors.primary]
|
|
911
994
|
});
|
|
912
|
-
return /* @__PURE__ */
|
|
995
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [{ opacity: disabled ? 0.45 : 1 }, style] }, /* @__PURE__ */ React24.createElement(
|
|
913
996
|
TouchableOpacity,
|
|
914
997
|
{
|
|
915
998
|
onPress: () => {
|
|
916
|
-
|
|
999
|
+
selectionAsync();
|
|
917
1000
|
onCheckedChange?.(!checked);
|
|
918
1001
|
},
|
|
919
1002
|
disabled,
|
|
@@ -921,7 +1004,7 @@ function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
|
921
1004
|
touchSoundDisabled: true,
|
|
922
1005
|
style: styles13.wrapper
|
|
923
1006
|
},
|
|
924
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ React24.createElement(Animated.View, { style: [styles13.track, { backgroundColor: trackColor }] }, /* @__PURE__ */ React24.createElement(
|
|
925
1008
|
Animated.View,
|
|
926
1009
|
{
|
|
927
1010
|
style: [
|
|
@@ -956,10 +1039,11 @@ var styles13 = StyleSheet.create({
|
|
|
956
1039
|
}
|
|
957
1040
|
});
|
|
958
1041
|
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 }
|
|
1042
|
+
sm: { paddingHorizontal: s(12), paddingVertical: vs(8), minWidth: s(40), minHeight: vs(40) },
|
|
1043
|
+
md: { paddingHorizontal: s(16), paddingVertical: vs(12), minWidth: s(44), minHeight: vs(44) },
|
|
1044
|
+
lg: { paddingHorizontal: s(20), paddingVertical: vs(14), minWidth: s(48), minHeight: vs(48) }
|
|
962
1045
|
};
|
|
1046
|
+
var iconSizeMap2 = { sm: 16, md: 18, lg: 20 };
|
|
963
1047
|
function Toggle({
|
|
964
1048
|
pressed = false,
|
|
965
1049
|
onPressedChange,
|
|
@@ -968,12 +1052,16 @@ function Toggle({
|
|
|
968
1052
|
label,
|
|
969
1053
|
icon,
|
|
970
1054
|
activeIcon,
|
|
1055
|
+
iconName,
|
|
1056
|
+
activeIconName,
|
|
1057
|
+
iconColor,
|
|
1058
|
+
activeIconColor,
|
|
971
1059
|
disabled,
|
|
972
1060
|
style,
|
|
973
1061
|
...props
|
|
974
1062
|
}) {
|
|
975
1063
|
const { colors } = useTheme();
|
|
976
|
-
const
|
|
1064
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
977
1065
|
const pressAnim = useRef(new Animated.Value(pressed ? 1 : 0)).current;
|
|
978
1066
|
useEffect(() => {
|
|
979
1067
|
Animated.timing(pressAnim, {
|
|
@@ -985,10 +1073,10 @@ function Toggle({
|
|
|
985
1073
|
}, [pressed, pressAnim]);
|
|
986
1074
|
const handlePressIn = () => {
|
|
987
1075
|
if (disabled) return;
|
|
988
|
-
Animated.spring(
|
|
1076
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: true, speed: 40, bounciness: 0 }).start();
|
|
989
1077
|
};
|
|
990
1078
|
const handlePressOut = () => {
|
|
991
|
-
Animated.spring(
|
|
1079
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: true, speed: 40, bounciness: 4 }).start();
|
|
992
1080
|
};
|
|
993
1081
|
const borderColor = pressAnim.interpolate({
|
|
994
1082
|
inputRange: [0, 1],
|
|
@@ -1002,6 +1090,7 @@ function Toggle({
|
|
|
1002
1090
|
inputRange: [0, 1],
|
|
1003
1091
|
outputRange: [colors.foreground, colors.primary]
|
|
1004
1092
|
});
|
|
1093
|
+
const iconSize = iconSizeMap2[size];
|
|
1005
1094
|
const LeftIcon = () => {
|
|
1006
1095
|
const renderProp = (prop) => {
|
|
1007
1096
|
if (!prop) return null;
|
|
@@ -1009,19 +1098,21 @@ function Toggle({
|
|
|
1009
1098
|
return prop;
|
|
1010
1099
|
};
|
|
1011
1100
|
if (pressed) {
|
|
1101
|
+
if (activeIconName) return /* @__PURE__ */ React24.createElement(React24.Fragment, null, renderIcon(activeIconName, iconSize, activeIconColor ?? colors.primary));
|
|
1012
1102
|
const active = renderProp(activeIcon);
|
|
1013
|
-
if (active) return /* @__PURE__ */
|
|
1014
|
-
return /* @__PURE__ */
|
|
1103
|
+
if (active) return /* @__PURE__ */ React24.createElement(React24.Fragment, null, active);
|
|
1104
|
+
return /* @__PURE__ */ React24.createElement(FontAwesome5$1, { name: "check-circle", size: iconSize, color: colors.primary });
|
|
1015
1105
|
}
|
|
1106
|
+
if (iconName) return /* @__PURE__ */ React24.createElement(React24.Fragment, null, renderIcon(iconName, iconSize, iconColor ?? colors.mutedForeground));
|
|
1016
1107
|
const custom = renderProp(icon);
|
|
1017
|
-
if (custom) return /* @__PURE__ */
|
|
1018
|
-
return /* @__PURE__ */
|
|
1108
|
+
if (custom) return /* @__PURE__ */ React24.createElement(React24.Fragment, null, custom);
|
|
1109
|
+
return /* @__PURE__ */ React24.createElement(FontAwesome5$1, { name: "circle", size: iconSize, color: colors.mutedForeground });
|
|
1019
1110
|
};
|
|
1020
|
-
return /* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ React24.createElement(Animated.View, { style: [{ transform: [{ scale: scale2 }] }, disabled && styles14.disabled, style] }, /* @__PURE__ */ React24.createElement(
|
|
1021
1112
|
TouchableOpacity,
|
|
1022
1113
|
{
|
|
1023
1114
|
onPress: () => {
|
|
1024
|
-
|
|
1115
|
+
selectionAsync();
|
|
1025
1116
|
onPressedChange?.(!pressed);
|
|
1026
1117
|
},
|
|
1027
1118
|
onPressIn: handlePressIn,
|
|
@@ -1031,7 +1122,7 @@ function Toggle({
|
|
|
1031
1122
|
touchSoundDisabled: true,
|
|
1032
1123
|
...props
|
|
1033
1124
|
},
|
|
1034
|
-
/* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ React24.createElement(
|
|
1035
1126
|
Animated.View,
|
|
1036
1127
|
{
|
|
1037
1128
|
style: [
|
|
@@ -1040,49 +1131,50 @@ function Toggle({
|
|
|
1040
1131
|
{ borderColor, backgroundColor, borderWidth: 2 }
|
|
1041
1132
|
]
|
|
1042
1133
|
},
|
|
1043
|
-
/* @__PURE__ */
|
|
1134
|
+
/* @__PURE__ */ React24.createElement(View, { style: styles14.inner }, /* @__PURE__ */ React24.createElement(LeftIcon, null), label ? /* @__PURE__ */ React24.createElement(Animated.Text, { style: [styles14.label, { color: textColor }] }, label) : null)
|
|
1044
1135
|
)
|
|
1045
1136
|
));
|
|
1046
1137
|
}
|
|
1047
1138
|
var styles14 = StyleSheet.create({
|
|
1048
1139
|
base: {
|
|
1049
|
-
borderRadius: 8
|
|
1140
|
+
borderRadius: ms(8)
|
|
1050
1141
|
},
|
|
1051
1142
|
inner: {
|
|
1052
1143
|
flexDirection: "row",
|
|
1053
1144
|
alignItems: "center",
|
|
1054
1145
|
justifyContent: "center",
|
|
1055
|
-
gap: 8
|
|
1146
|
+
gap: s(8)
|
|
1056
1147
|
},
|
|
1057
1148
|
disabled: {
|
|
1058
1149
|
opacity: 0.45
|
|
1059
1150
|
},
|
|
1060
1151
|
label: {
|
|
1061
|
-
fontSize: 14,
|
|
1152
|
+
fontSize: ms(14),
|
|
1062
1153
|
fontWeight: "500"
|
|
1063
1154
|
}
|
|
1064
1155
|
});
|
|
1156
|
+
var nativeDriver5 = Platform.OS !== "web";
|
|
1065
1157
|
function RadioItem({
|
|
1066
1158
|
option,
|
|
1067
1159
|
selected,
|
|
1068
1160
|
onSelect
|
|
1069
1161
|
}) {
|
|
1070
1162
|
const { colors } = useTheme();
|
|
1071
|
-
const
|
|
1163
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
1072
1164
|
const handlePressIn = () => {
|
|
1073
1165
|
if (option.disabled) return;
|
|
1074
|
-
Animated.spring(
|
|
1166
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: nativeDriver5, speed: 40, bounciness: 0 }).start();
|
|
1075
1167
|
};
|
|
1076
1168
|
const handlePressOut = () => {
|
|
1077
|
-
Animated.spring(
|
|
1169
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: nativeDriver5, speed: 40, bounciness: 4 }).start();
|
|
1078
1170
|
};
|
|
1079
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ React24.createElement(Animated.View, { style: { transform: [{ scale: scale2 }] } }, /* @__PURE__ */ React24.createElement(
|
|
1080
1172
|
TouchableOpacity,
|
|
1081
1173
|
{
|
|
1082
1174
|
style: styles15.row,
|
|
1083
1175
|
onPress: () => {
|
|
1084
1176
|
if (!option.disabled) {
|
|
1085
|
-
|
|
1177
|
+
selectionAsync();
|
|
1086
1178
|
onSelect();
|
|
1087
1179
|
}
|
|
1088
1180
|
},
|
|
@@ -1092,7 +1184,7 @@ function RadioItem({
|
|
|
1092
1184
|
touchSoundDisabled: true,
|
|
1093
1185
|
disabled: option.disabled
|
|
1094
1186
|
},
|
|
1095
|
-
/* @__PURE__ */
|
|
1187
|
+
/* @__PURE__ */ React24.createElement(
|
|
1096
1188
|
View,
|
|
1097
1189
|
{
|
|
1098
1190
|
style: [
|
|
@@ -1103,9 +1195,9 @@ function RadioItem({
|
|
|
1103
1195
|
}
|
|
1104
1196
|
]
|
|
1105
1197
|
},
|
|
1106
|
-
selected ? /* @__PURE__ */
|
|
1198
|
+
selected ? /* @__PURE__ */ React24.createElement(View, { style: [styles15.dot, { backgroundColor: colors.primary }] }) : null
|
|
1107
1199
|
),
|
|
1108
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ React24.createElement(
|
|
1109
1201
|
Text,
|
|
1110
1202
|
{
|
|
1111
1203
|
style: [
|
|
@@ -1124,7 +1216,7 @@ function RadioGroup({
|
|
|
1124
1216
|
orientation = "vertical",
|
|
1125
1217
|
style
|
|
1126
1218
|
}) {
|
|
1127
|
-
return /* @__PURE__ */
|
|
1219
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles15.container, orientation === "horizontal" && styles15.horizontal, style] }, options.map((option) => /* @__PURE__ */ React24.createElement(
|
|
1128
1220
|
RadioItem,
|
|
1129
1221
|
{
|
|
1130
1222
|
key: option.value,
|
|
@@ -1136,7 +1228,7 @@ function RadioGroup({
|
|
|
1136
1228
|
}
|
|
1137
1229
|
var styles15 = StyleSheet.create({
|
|
1138
1230
|
container: {
|
|
1139
|
-
gap: 12
|
|
1231
|
+
gap: vs(12)
|
|
1140
1232
|
},
|
|
1141
1233
|
horizontal: {
|
|
1142
1234
|
flexDirection: "row",
|
|
@@ -1145,26 +1237,27 @@ var styles15 = StyleSheet.create({
|
|
|
1145
1237
|
row: {
|
|
1146
1238
|
flexDirection: "row",
|
|
1147
1239
|
alignItems: "center",
|
|
1148
|
-
gap: 12
|
|
1240
|
+
gap: s(12)
|
|
1149
1241
|
},
|
|
1150
1242
|
radio: {
|
|
1151
|
-
width: 24,
|
|
1152
|
-
height: 24,
|
|
1153
|
-
borderRadius: 12,
|
|
1243
|
+
width: s(24),
|
|
1244
|
+
height: s(24),
|
|
1245
|
+
borderRadius: s(12),
|
|
1154
1246
|
borderWidth: 1.5,
|
|
1155
1247
|
alignItems: "center",
|
|
1156
1248
|
justifyContent: "center"
|
|
1157
1249
|
},
|
|
1158
1250
|
dot: {
|
|
1159
|
-
width: 10,
|
|
1160
|
-
height: 10,
|
|
1161
|
-
borderRadius: 5
|
|
1251
|
+
width: s(10),
|
|
1252
|
+
height: s(10),
|
|
1253
|
+
borderRadius: s(5)
|
|
1162
1254
|
},
|
|
1163
1255
|
label: {
|
|
1164
|
-
fontSize: 14,
|
|
1165
|
-
lineHeight: 20
|
|
1256
|
+
fontSize: ms(14),
|
|
1257
|
+
lineHeight: mvs(20)
|
|
1166
1258
|
}
|
|
1167
1259
|
});
|
|
1260
|
+
var nativeDriver6 = Platform.OS !== "web";
|
|
1168
1261
|
function TabTrigger({
|
|
1169
1262
|
tab,
|
|
1170
1263
|
isActive,
|
|
@@ -1172,14 +1265,14 @@ function TabTrigger({
|
|
|
1172
1265
|
onLayout
|
|
1173
1266
|
}) {
|
|
1174
1267
|
const { colors } = useTheme();
|
|
1175
|
-
const
|
|
1268
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
1176
1269
|
const handlePressIn = () => {
|
|
1177
|
-
Animated.spring(
|
|
1270
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: nativeDriver6, speed: 40, bounciness: 0 }).start();
|
|
1178
1271
|
};
|
|
1179
1272
|
const handlePressOut = () => {
|
|
1180
|
-
Animated.spring(
|
|
1273
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: nativeDriver6, speed: 40, bounciness: 4 }).start();
|
|
1181
1274
|
};
|
|
1182
|
-
return /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1183
1276
|
TouchableOpacity,
|
|
1184
1277
|
{
|
|
1185
1278
|
style: styles16.trigger,
|
|
@@ -1190,7 +1283,7 @@ function TabTrigger({
|
|
|
1190
1283
|
activeOpacity: 1,
|
|
1191
1284
|
touchSoundDisabled: true
|
|
1192
1285
|
},
|
|
1193
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ React24.createElement(Animated.View, { style: { transform: [{ scale: scale2 }] } }, /* @__PURE__ */ React24.createElement(View, { style: styles16.triggerInner }, tab.icon ? /* @__PURE__ */ React24.createElement(View, { style: styles16.triggerIcon }, typeof tab.icon === "function" ? tab.icon(isActive) : tab.icon) : null, /* @__PURE__ */ React24.createElement(
|
|
1194
1287
|
Text,
|
|
1195
1288
|
{
|
|
1196
1289
|
style: [
|
|
@@ -1240,11 +1333,11 @@ function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
|
1240
1333
|
}
|
|
1241
1334
|
}, [active]);
|
|
1242
1335
|
const handlePress = (v) => {
|
|
1243
|
-
|
|
1336
|
+
selectionAsync();
|
|
1244
1337
|
if (!value) setInternal(v);
|
|
1245
1338
|
onValueChange?.(v);
|
|
1246
1339
|
};
|
|
1247
|
-
return /* @__PURE__ */
|
|
1340
|
+
return /* @__PURE__ */ React24.createElement(View, { style }, /* @__PURE__ */ React24.createElement(View, { style: [styles16.list, { backgroundColor: colors.muted }] }, /* @__PURE__ */ React24.createElement(
|
|
1248
1341
|
Animated.View,
|
|
1249
1342
|
{
|
|
1250
1343
|
style: [
|
|
@@ -1265,7 +1358,7 @@ function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
|
1265
1358
|
}
|
|
1266
1359
|
]
|
|
1267
1360
|
}
|
|
1268
|
-
), tabs.map((tab) => /* @__PURE__ */
|
|
1361
|
+
), tabs.map((tab) => /* @__PURE__ */ React24.createElement(
|
|
1269
1362
|
TabTrigger,
|
|
1270
1363
|
{
|
|
1271
1364
|
key: tab.value,
|
|
@@ -1285,21 +1378,21 @@ function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
|
1285
1378
|
}
|
|
1286
1379
|
function TabsContent({ value, activeValue, children, style }) {
|
|
1287
1380
|
if (value !== activeValue) return null;
|
|
1288
|
-
return /* @__PURE__ */
|
|
1381
|
+
return /* @__PURE__ */ React24.createElement(View, { style }, children);
|
|
1289
1382
|
}
|
|
1290
1383
|
var styles16 = StyleSheet.create({
|
|
1291
1384
|
list: {
|
|
1292
1385
|
flexDirection: "row",
|
|
1293
|
-
borderRadius: 12,
|
|
1294
|
-
padding: 4,
|
|
1295
|
-
gap: 4
|
|
1386
|
+
borderRadius: ms(12),
|
|
1387
|
+
padding: s(4),
|
|
1388
|
+
gap: s(4)
|
|
1296
1389
|
},
|
|
1297
1390
|
pill: {},
|
|
1298
1391
|
trigger: {
|
|
1299
1392
|
flex: 1,
|
|
1300
|
-
paddingVertical: 12,
|
|
1301
|
-
paddingHorizontal: 16,
|
|
1302
|
-
borderRadius: 8,
|
|
1393
|
+
paddingVertical: vs(12),
|
|
1394
|
+
paddingHorizontal: s(16),
|
|
1395
|
+
borderRadius: ms(8),
|
|
1303
1396
|
alignItems: "center",
|
|
1304
1397
|
justifyContent: "center",
|
|
1305
1398
|
zIndex: 1
|
|
@@ -1308,15 +1401,15 @@ var styles16 = StyleSheet.create({
|
|
|
1308
1401
|
flexDirection: "row",
|
|
1309
1402
|
alignItems: "center",
|
|
1310
1403
|
justifyContent: "center",
|
|
1311
|
-
gap: 8
|
|
1404
|
+
gap: s(8)
|
|
1312
1405
|
},
|
|
1313
1406
|
triggerIcon: {
|
|
1314
|
-
marginRight: 6,
|
|
1407
|
+
marginRight: s(6),
|
|
1315
1408
|
alignItems: "center",
|
|
1316
1409
|
justifyContent: "center"
|
|
1317
1410
|
},
|
|
1318
1411
|
triggerLabel: {
|
|
1319
|
-
fontSize: 15,
|
|
1412
|
+
fontSize: ms(15),
|
|
1320
1413
|
fontWeight: "400"
|
|
1321
1414
|
},
|
|
1322
1415
|
activeTriggerLabel: {
|
|
@@ -1329,53 +1422,51 @@ function AccordionItemComponent({
|
|
|
1329
1422
|
onToggle
|
|
1330
1423
|
}) {
|
|
1331
1424
|
const { colors } = useTheme();
|
|
1332
|
-
const
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1335
|
-
|
|
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
|
-
};
|
|
1341
|
-
React23.useEffect(() => {
|
|
1342
|
-
toggle(isOpen);
|
|
1425
|
+
const isExpanded = useSharedValue(isOpen);
|
|
1426
|
+
const height = useSharedValue(0);
|
|
1427
|
+
React24.useEffect(() => {
|
|
1428
|
+
isExpanded.value = isOpen;
|
|
1343
1429
|
}, [isOpen]);
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1430
|
+
const derivedHeight = useDerivedValue(
|
|
1431
|
+
() => withTiming(height.value * Number(isExpanded.value), {
|
|
1432
|
+
duration: 220,
|
|
1433
|
+
easing: isExpanded.value ? Easing$1.out(Easing$1.ease) : Easing$1.in(Easing$1.ease)
|
|
1434
|
+
})
|
|
1435
|
+
);
|
|
1436
|
+
const derivedRotation = useDerivedValue(
|
|
1437
|
+
() => withTiming(isExpanded.value ? 1 : 0, {
|
|
1438
|
+
duration: 220,
|
|
1439
|
+
easing: isExpanded.value ? Easing$1.out(Easing$1.ease) : Easing$1.in(Easing$1.ease)
|
|
1440
|
+
})
|
|
1441
|
+
);
|
|
1442
|
+
const bodyStyle = useAnimatedStyle(() => ({
|
|
1443
|
+
height: derivedHeight.value,
|
|
1352
1444
|
overflow: "hidden"
|
|
1353
1445
|
}));
|
|
1354
1446
|
const rotationStyle = useAnimatedStyle(() => ({
|
|
1355
|
-
transform: [{ rotate: `${
|
|
1447
|
+
transform: [{ rotate: `${derivedRotation.value * 180}deg` }]
|
|
1356
1448
|
}));
|
|
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,
|
|
1449
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles17.item, { borderBottomColor: colors.border }] }, /* @__PURE__ */ React24.createElement(
|
|
1450
|
+
Pressable,
|
|
1365
1451
|
{
|
|
1366
|
-
style: styles17.trigger,
|
|
1452
|
+
style: ({ pressed }) => [styles17.trigger, { opacity: pressed ? 0.6 : 1 }],
|
|
1367
1453
|
onPress: () => {
|
|
1368
|
-
|
|
1454
|
+
selectionAsync();
|
|
1369
1455
|
onToggle();
|
|
1370
|
-
}
|
|
1371
|
-
onPressIn: handlePressIn,
|
|
1372
|
-
onPressOut: handlePressOut,
|
|
1373
|
-
activeOpacity: 1,
|
|
1374
|
-
touchSoundDisabled: true
|
|
1456
|
+
}
|
|
1375
1457
|
},
|
|
1376
|
-
/* @__PURE__ */
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
)
|
|
1458
|
+
/* @__PURE__ */ React24.createElement(Text, { style: [styles17.triggerText, { color: colors.foreground }] }, item.trigger),
|
|
1459
|
+
/* @__PURE__ */ React24.createElement(Animated10.View, { style: [styles17.chevron, rotationStyle] }, /* @__PURE__ */ React24.createElement(Entypo$1, { name: "chevron-down", size: 20, color: colors.foreground }))
|
|
1460
|
+
), /* @__PURE__ */ React24.createElement(Animated10.View, { style: bodyStyle }, /* @__PURE__ */ React24.createElement(
|
|
1461
|
+
View,
|
|
1462
|
+
{
|
|
1463
|
+
style: styles17.content,
|
|
1464
|
+
onLayout: (e) => {
|
|
1465
|
+
height.value = e.nativeEvent.layout.height;
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
item.content
|
|
1469
|
+
)));
|
|
1379
1470
|
}
|
|
1380
1471
|
function Accordion({ items, type = "single", defaultValue, style }) {
|
|
1381
1472
|
const [openValues, setOpenValues] = useState(() => {
|
|
@@ -1391,7 +1482,7 @@ function Accordion({ items, type = "single", defaultValue, style }) {
|
|
|
1391
1482
|
);
|
|
1392
1483
|
}
|
|
1393
1484
|
};
|
|
1394
|
-
return /* @__PURE__ */
|
|
1485
|
+
return /* @__PURE__ */ React24.createElement(View, { style }, items.map((item) => /* @__PURE__ */ React24.createElement(
|
|
1395
1486
|
AccordionItemComponent,
|
|
1396
1487
|
{
|
|
1397
1488
|
key: item.value,
|
|
@@ -1409,18 +1500,20 @@ var styles17 = StyleSheet.create({
|
|
|
1409
1500
|
flexDirection: "row",
|
|
1410
1501
|
justifyContent: "space-between",
|
|
1411
1502
|
alignItems: "center",
|
|
1412
|
-
paddingVertical: 20
|
|
1503
|
+
paddingVertical: vs(20)
|
|
1413
1504
|
},
|
|
1414
1505
|
triggerText: {
|
|
1415
|
-
fontSize: 17,
|
|
1506
|
+
fontSize: ms(17),
|
|
1416
1507
|
fontWeight: "500",
|
|
1417
1508
|
flex: 1
|
|
1418
1509
|
},
|
|
1419
1510
|
chevron: {
|
|
1420
|
-
marginLeft: 8
|
|
1511
|
+
marginLeft: s(8)
|
|
1421
1512
|
},
|
|
1513
|
+
// position:'absolute' is the key — the inner View escapes the animated wrapper's
|
|
1514
|
+
// clipped height so onLayout always reports the true content height.
|
|
1422
1515
|
content: {
|
|
1423
|
-
paddingBottom: 20,
|
|
1516
|
+
paddingBottom: vs(20),
|
|
1424
1517
|
position: "absolute",
|
|
1425
1518
|
width: "100%"
|
|
1426
1519
|
}
|
|
@@ -1444,11 +1537,11 @@ function Slider({
|
|
|
1444
1537
|
const handleValueChange = (v) => {
|
|
1445
1538
|
if (step && v !== lastSteppedValue.current) {
|
|
1446
1539
|
lastSteppedValue.current = v;
|
|
1447
|
-
|
|
1540
|
+
selectionAsync();
|
|
1448
1541
|
}
|
|
1449
1542
|
onValueChange?.(v);
|
|
1450
1543
|
};
|
|
1451
|
-
return /* @__PURE__ */
|
|
1544
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles18.wrapper, style], accessibilityLabel }, label || showValue ? /* @__PURE__ */ React24.createElement(View, { style: styles18.header }, label ? /* @__PURE__ */ React24.createElement(Text, { style: [styles18.label, { color: colors.foreground }], allowFontScaling: true }, label) : null, showValue ? /* @__PURE__ */ React24.createElement(Text, { style: [styles18.valueText, { color: colors.mutedForeground }], allowFontScaling: true }, formatValue2(value)) : null) : null, /* @__PURE__ */ React24.createElement(View, { style: disabled ? styles18.disabled : void 0 }, /* @__PURE__ */ React24.createElement(
|
|
1452
1545
|
RNSlider,
|
|
1453
1546
|
{
|
|
1454
1547
|
value,
|
|
@@ -1468,7 +1561,7 @@ function Slider({
|
|
|
1468
1561
|
}
|
|
1469
1562
|
var styles18 = StyleSheet.create({
|
|
1470
1563
|
wrapper: {
|
|
1471
|
-
gap: 8
|
|
1564
|
+
gap: vs(8)
|
|
1472
1565
|
},
|
|
1473
1566
|
header: {
|
|
1474
1567
|
flexDirection: "row",
|
|
@@ -1476,16 +1569,16 @@ var styles18 = StyleSheet.create({
|
|
|
1476
1569
|
alignItems: "center"
|
|
1477
1570
|
},
|
|
1478
1571
|
label: {
|
|
1479
|
-
fontSize: 15,
|
|
1572
|
+
fontSize: ms(15),
|
|
1480
1573
|
fontWeight: "500"
|
|
1481
1574
|
},
|
|
1482
1575
|
valueText: {
|
|
1483
|
-
fontSize: 14,
|
|
1576
|
+
fontSize: ms(14),
|
|
1484
1577
|
fontWeight: "500"
|
|
1485
1578
|
},
|
|
1486
1579
|
slider: {
|
|
1487
1580
|
width: "100%",
|
|
1488
|
-
height: 40
|
|
1581
|
+
height: vs(40)
|
|
1489
1582
|
},
|
|
1490
1583
|
disabled: {
|
|
1491
1584
|
opacity: 0.45
|
|
@@ -1504,13 +1597,13 @@ function Sheet({
|
|
|
1504
1597
|
const ref = useRef(null);
|
|
1505
1598
|
useEffect(() => {
|
|
1506
1599
|
if (open) {
|
|
1507
|
-
|
|
1600
|
+
impactLight();
|
|
1508
1601
|
ref.current?.present();
|
|
1509
1602
|
} else {
|
|
1510
1603
|
ref.current?.dismiss();
|
|
1511
1604
|
}
|
|
1512
1605
|
}, [open]);
|
|
1513
|
-
const renderBackdrop = (props) => /* @__PURE__ */
|
|
1606
|
+
const renderBackdrop = (props) => /* @__PURE__ */ React24.createElement(
|
|
1514
1607
|
BottomSheetBackdrop,
|
|
1515
1608
|
{
|
|
1516
1609
|
...props,
|
|
@@ -1519,7 +1612,7 @@ function Sheet({
|
|
|
1519
1612
|
pressBehavior: "close"
|
|
1520
1613
|
}
|
|
1521
1614
|
);
|
|
1522
|
-
return /* @__PURE__ */
|
|
1615
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1523
1616
|
BottomSheetModal,
|
|
1524
1617
|
{
|
|
1525
1618
|
ref,
|
|
@@ -1530,39 +1623,39 @@ function Sheet({
|
|
|
1530
1623
|
handleIndicatorStyle: [styles19.handle, { backgroundColor: colors.border }],
|
|
1531
1624
|
enablePanDownToClose: true
|
|
1532
1625
|
},
|
|
1533
|
-
/* @__PURE__ */
|
|
1626
|
+
/* @__PURE__ */ React24.createElement(BottomSheetView, { style: [styles19.content, style] }, title || description ? /* @__PURE__ */ React24.createElement(View, { style: styles19.header }, title ? /* @__PURE__ */ React24.createElement(Text, { style: [styles19.title, { color: colors.cardForeground }] }, title) : null, description ? /* @__PURE__ */ React24.createElement(Text, { style: [styles19.description, { color: colors.mutedForeground }] }, description) : null) : null, children)
|
|
1534
1627
|
);
|
|
1535
1628
|
}
|
|
1536
1629
|
var styles19 = StyleSheet.create({
|
|
1537
1630
|
background: {
|
|
1538
|
-
borderTopLeftRadius: 16,
|
|
1539
|
-
borderTopRightRadius: 16
|
|
1631
|
+
borderTopLeftRadius: ms(16),
|
|
1632
|
+
borderTopRightRadius: ms(16)
|
|
1540
1633
|
},
|
|
1541
1634
|
handle: {
|
|
1542
|
-
width: 36,
|
|
1543
|
-
height: 4,
|
|
1544
|
-
borderRadius: 2
|
|
1635
|
+
width: s(36),
|
|
1636
|
+
height: vs(4),
|
|
1637
|
+
borderRadius: ms(2)
|
|
1545
1638
|
},
|
|
1546
1639
|
content: {
|
|
1547
|
-
paddingHorizontal: 24,
|
|
1548
|
-
paddingBottom: 32
|
|
1640
|
+
paddingHorizontal: s(24),
|
|
1641
|
+
paddingBottom: vs(32)
|
|
1549
1642
|
},
|
|
1550
1643
|
header: {
|
|
1551
|
-
gap: 8,
|
|
1552
|
-
marginBottom: 16
|
|
1644
|
+
gap: vs(8),
|
|
1645
|
+
marginBottom: vs(16)
|
|
1553
1646
|
},
|
|
1554
1647
|
title: {
|
|
1555
|
-
fontSize: 18,
|
|
1648
|
+
fontSize: ms(18),
|
|
1556
1649
|
fontWeight: "600"
|
|
1557
1650
|
},
|
|
1558
1651
|
description: {
|
|
1559
|
-
fontSize: 14,
|
|
1560
|
-
lineHeight: 20
|
|
1652
|
+
fontSize: ms(14),
|
|
1653
|
+
lineHeight: mvs(20)
|
|
1561
1654
|
}
|
|
1562
1655
|
});
|
|
1563
1656
|
var isIOS = Platform.OS === "ios";
|
|
1564
1657
|
var isAndroid = Platform.OS === "android";
|
|
1565
|
-
var
|
|
1658
|
+
var isWeb2 = Platform.OS === "web";
|
|
1566
1659
|
function Select({
|
|
1567
1660
|
options,
|
|
1568
1661
|
value,
|
|
@@ -1574,21 +1667,21 @@ function Select({
|
|
|
1574
1667
|
style
|
|
1575
1668
|
}) {
|
|
1576
1669
|
const { colors } = useTheme();
|
|
1577
|
-
const
|
|
1670
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
1578
1671
|
const [pickerVisible, setPickerVisible] = useState(false);
|
|
1579
1672
|
const [pendingValue, setPendingValue] = useState(value);
|
|
1580
1673
|
const pickerRef = useRef(null);
|
|
1581
1674
|
const selected = options.find((o) => o.value === value);
|
|
1582
1675
|
const handlePressIn = () => {
|
|
1583
1676
|
if (disabled) return;
|
|
1584
|
-
Animated.spring(
|
|
1677
|
+
Animated.spring(scale2, { toValue: 0.95, useNativeDriver: true, speed: 40, bounciness: 0 }).start();
|
|
1585
1678
|
};
|
|
1586
1679
|
const handlePressOut = () => {
|
|
1587
|
-
Animated.spring(
|
|
1680
|
+
Animated.spring(scale2, { toValue: 1, useNativeDriver: true, speed: 40, bounciness: 4 }).start();
|
|
1588
1681
|
};
|
|
1589
1682
|
const handleOpen = () => {
|
|
1590
1683
|
if (disabled) return;
|
|
1591
|
-
|
|
1684
|
+
selectionAsync();
|
|
1592
1685
|
if (isIOS) {
|
|
1593
1686
|
setPendingValue(value);
|
|
1594
1687
|
setPickerVisible(true);
|
|
@@ -1601,12 +1694,12 @@ function Select({
|
|
|
1601
1694
|
};
|
|
1602
1695
|
const handleConfirm = () => {
|
|
1603
1696
|
if (pendingValue !== void 0 && pendingValue !== "") {
|
|
1604
|
-
|
|
1697
|
+
selectionAsync();
|
|
1605
1698
|
onValueChange?.(pendingValue);
|
|
1606
1699
|
}
|
|
1607
1700
|
setPickerVisible(false);
|
|
1608
1701
|
};
|
|
1609
|
-
return /* @__PURE__ */
|
|
1702
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles20.container, style] }, label ? /* @__PURE__ */ React24.createElement(Text, { style: [styles20.label, { color: colors.foreground }] }, label) : null, !isWeb2 ? /* @__PURE__ */ React24.createElement(Animated.View, { style: { transform: [{ scale: scale2 }], opacity: disabled ? 0.45 : 1 } }, /* @__PURE__ */ React24.createElement(
|
|
1610
1703
|
TouchableOpacity,
|
|
1611
1704
|
{
|
|
1612
1705
|
style: [
|
|
@@ -1622,7 +1715,7 @@ function Select({
|
|
|
1622
1715
|
activeOpacity: 1,
|
|
1623
1716
|
touchSoundDisabled: true
|
|
1624
1717
|
},
|
|
1625
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ React24.createElement(
|
|
1626
1719
|
Text,
|
|
1627
1720
|
{
|
|
1628
1721
|
style: [
|
|
@@ -1634,8 +1727,8 @@ function Select({
|
|
|
1634
1727
|
},
|
|
1635
1728
|
selected?.label ?? placeholder
|
|
1636
1729
|
),
|
|
1637
|
-
/* @__PURE__ */
|
|
1638
|
-
)) : null, isIOS ? /* @__PURE__ */
|
|
1730
|
+
/* @__PURE__ */ React24.createElement(Entypo$1, { name: "chevron-with-circle-down", size: 20, color: colors.mutedForeground })
|
|
1731
|
+
)) : null, isIOS ? /* @__PURE__ */ React24.createElement(
|
|
1639
1732
|
Modal,
|
|
1640
1733
|
{
|
|
1641
1734
|
visible: pickerVisible,
|
|
@@ -1643,16 +1736,16 @@ function Select({
|
|
|
1643
1736
|
animationType: "slide",
|
|
1644
1737
|
onRequestClose: handleDismiss
|
|
1645
1738
|
},
|
|
1646
|
-
/* @__PURE__ */
|
|
1647
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ React24.createElement(TouchableOpacity, { style: styles20.iosBackdrop, activeOpacity: 1, onPress: handleDismiss }),
|
|
1740
|
+
/* @__PURE__ */ React24.createElement(View, { style: [styles20.iosSheet, { backgroundColor: colors.card }] }, /* @__PURE__ */ React24.createElement(View, { style: [styles20.iosToolbar, { borderBottomColor: colors.border }] }, label ? /* @__PURE__ */ React24.createElement(Text, { style: [styles20.iosToolbarTitle, { color: colors.foreground }], allowFontScaling: true }, label) : /* @__PURE__ */ React24.createElement(View, null), /* @__PURE__ */ React24.createElement(TouchableOpacity, { onPress: handleConfirm, style: styles20.iosDoneBtn, hitSlop: { top: 8, bottom: 8, left: 8, right: 8 } }, /* @__PURE__ */ React24.createElement(Text, { style: [styles20.iosDoneBtnText, { color: colors.primary }], allowFontScaling: true }, "Done"))), /* @__PURE__ */ React24.createElement(
|
|
1648
1741
|
Picker,
|
|
1649
1742
|
{
|
|
1650
1743
|
selectedValue: pendingValue ?? "",
|
|
1651
1744
|
onValueChange: (val) => setPendingValue(val),
|
|
1652
1745
|
itemStyle: { color: colors.foreground }
|
|
1653
1746
|
},
|
|
1654
|
-
!value ? /* @__PURE__ */
|
|
1655
|
-
options.map((o) => /* @__PURE__ */
|
|
1747
|
+
!value ? /* @__PURE__ */ React24.createElement(Picker.Item, { label: placeholder, value: "", color: colors.mutedForeground, enabled: false }) : null,
|
|
1748
|
+
options.map((o) => /* @__PURE__ */ React24.createElement(
|
|
1656
1749
|
Picker.Item,
|
|
1657
1750
|
{
|
|
1658
1751
|
key: o.value,
|
|
@@ -1663,14 +1756,14 @@ function Select({
|
|
|
1663
1756
|
}
|
|
1664
1757
|
))
|
|
1665
1758
|
))
|
|
1666
|
-
) : null, isAndroid ? /* @__PURE__ */
|
|
1759
|
+
) : null, isAndroid ? /* @__PURE__ */ React24.createElement(
|
|
1667
1760
|
Picker,
|
|
1668
1761
|
{
|
|
1669
1762
|
ref: pickerRef,
|
|
1670
1763
|
selectedValue: value ?? "",
|
|
1671
1764
|
onValueChange: (val) => {
|
|
1672
1765
|
if (val !== "") {
|
|
1673
|
-
|
|
1766
|
+
selectionAsync();
|
|
1674
1767
|
onValueChange?.(val);
|
|
1675
1768
|
}
|
|
1676
1769
|
},
|
|
@@ -1679,8 +1772,8 @@ function Select({
|
|
|
1679
1772
|
prompt: label,
|
|
1680
1773
|
style: styles20.androidHiddenPicker
|
|
1681
1774
|
},
|
|
1682
|
-
!value ? /* @__PURE__ */
|
|
1683
|
-
options.map((o) => /* @__PURE__ */
|
|
1775
|
+
!value ? /* @__PURE__ */ React24.createElement(Picker.Item, { label: placeholder, value: "", enabled: false }) : null,
|
|
1776
|
+
options.map((o) => /* @__PURE__ */ React24.createElement(
|
|
1684
1777
|
Picker.Item,
|
|
1685
1778
|
{
|
|
1686
1779
|
key: o.value,
|
|
@@ -1689,7 +1782,7 @@ function Select({
|
|
|
1689
1782
|
enabled: !o.disabled
|
|
1690
1783
|
}
|
|
1691
1784
|
))
|
|
1692
|
-
) : null,
|
|
1785
|
+
) : null, isWeb2 ? /* @__PURE__ */ React24.createElement(
|
|
1693
1786
|
Picker,
|
|
1694
1787
|
{
|
|
1695
1788
|
selectedValue: value ?? "",
|
|
@@ -1709,8 +1802,8 @@ function Select({
|
|
|
1709
1802
|
}
|
|
1710
1803
|
]
|
|
1711
1804
|
},
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
options.map((o) => /* @__PURE__ */
|
|
1805
|
+
/* @__PURE__ */ React24.createElement(Picker.Item, { label: placeholder, value: "", enabled: false }),
|
|
1806
|
+
options.map((o) => /* @__PURE__ */ React24.createElement(
|
|
1714
1807
|
Picker.Item,
|
|
1715
1808
|
{
|
|
1716
1809
|
key: o.value,
|
|
@@ -1719,14 +1812,14 @@ function Select({
|
|
|
1719
1812
|
enabled: !o.disabled
|
|
1720
1813
|
}
|
|
1721
1814
|
))
|
|
1722
|
-
) : null, error ? /* @__PURE__ */
|
|
1815
|
+
) : null, error ? /* @__PURE__ */ React24.createElement(Text, { style: [styles20.helperText, { color: colors.destructive }] }, error) : null);
|
|
1723
1816
|
}
|
|
1724
1817
|
var styles20 = StyleSheet.create({
|
|
1725
1818
|
container: {
|
|
1726
|
-
gap: 8
|
|
1819
|
+
gap: vs(8)
|
|
1727
1820
|
},
|
|
1728
1821
|
label: {
|
|
1729
|
-
fontSize: 15,
|
|
1822
|
+
fontSize: ms(15),
|
|
1730
1823
|
fontWeight: "500"
|
|
1731
1824
|
},
|
|
1732
1825
|
trigger: {
|
|
@@ -1734,9 +1827,9 @@ var styles20 = StyleSheet.create({
|
|
|
1734
1827
|
alignItems: "center",
|
|
1735
1828
|
justifyContent: "space-between",
|
|
1736
1829
|
borderWidth: 1.5,
|
|
1737
|
-
borderRadius: 8,
|
|
1738
|
-
paddingHorizontal: 16,
|
|
1739
|
-
paddingVertical: 14,
|
|
1830
|
+
borderRadius: ms(8),
|
|
1831
|
+
paddingHorizontal: s(16),
|
|
1832
|
+
paddingVertical: vs(14),
|
|
1740
1833
|
shadowColor: "#000",
|
|
1741
1834
|
shadowOffset: { width: 0, height: 1 },
|
|
1742
1835
|
shadowOpacity: 0.04,
|
|
@@ -1744,41 +1837,41 @@ var styles20 = StyleSheet.create({
|
|
|
1744
1837
|
elevation: 1
|
|
1745
1838
|
},
|
|
1746
1839
|
triggerText: {
|
|
1747
|
-
fontSize: 17,
|
|
1840
|
+
fontSize: ms(17),
|
|
1748
1841
|
flex: 1
|
|
1749
1842
|
},
|
|
1750
1843
|
chevron: {
|
|
1751
|
-
marginLeft: 8
|
|
1844
|
+
marginLeft: s(8)
|
|
1752
1845
|
},
|
|
1753
1846
|
helperText: {
|
|
1754
|
-
fontSize: 13
|
|
1847
|
+
fontSize: ms(13)
|
|
1755
1848
|
},
|
|
1756
1849
|
iosBackdrop: {
|
|
1757
1850
|
flex: 1,
|
|
1758
1851
|
backgroundColor: "rgba(0,0,0,0.4)"
|
|
1759
1852
|
},
|
|
1760
1853
|
iosSheet: {
|
|
1761
|
-
borderTopLeftRadius: 16,
|
|
1762
|
-
borderTopRightRadius: 16,
|
|
1763
|
-
paddingBottom: 32
|
|
1854
|
+
borderTopLeftRadius: ms(16),
|
|
1855
|
+
borderTopRightRadius: ms(16),
|
|
1856
|
+
paddingBottom: vs(32)
|
|
1764
1857
|
},
|
|
1765
1858
|
iosToolbar: {
|
|
1766
1859
|
flexDirection: "row",
|
|
1767
1860
|
alignItems: "center",
|
|
1768
1861
|
justifyContent: "space-between",
|
|
1769
|
-
paddingHorizontal: 16,
|
|
1770
|
-
paddingVertical: 12,
|
|
1862
|
+
paddingHorizontal: s(16),
|
|
1863
|
+
paddingVertical: vs(12),
|
|
1771
1864
|
borderBottomWidth: 1
|
|
1772
1865
|
},
|
|
1773
1866
|
iosToolbarTitle: {
|
|
1774
|
-
fontSize: 17,
|
|
1867
|
+
fontSize: ms(17),
|
|
1775
1868
|
fontWeight: "600"
|
|
1776
1869
|
},
|
|
1777
1870
|
iosDoneBtn: {
|
|
1778
|
-
padding: 4
|
|
1871
|
+
padding: s(4)
|
|
1779
1872
|
},
|
|
1780
1873
|
iosDoneBtnText: {
|
|
1781
|
-
fontSize: 17,
|
|
1874
|
+
fontSize: ms(17),
|
|
1782
1875
|
fontWeight: "600"
|
|
1783
1876
|
},
|
|
1784
1877
|
androidHiddenPicker: {
|
|
@@ -1788,10 +1881,10 @@ var styles20 = StyleSheet.create({
|
|
|
1788
1881
|
},
|
|
1789
1882
|
webPicker: {
|
|
1790
1883
|
borderWidth: 1.5,
|
|
1791
|
-
borderRadius: 8,
|
|
1792
|
-
paddingHorizontal: 16,
|
|
1793
|
-
paddingVertical: 14,
|
|
1794
|
-
fontSize: 17
|
|
1884
|
+
borderRadius: ms(8),
|
|
1885
|
+
paddingHorizontal: s(16),
|
|
1886
|
+
paddingVertical: vs(14),
|
|
1887
|
+
fontSize: ms(17)
|
|
1795
1888
|
}
|
|
1796
1889
|
});
|
|
1797
1890
|
var ToastContext = createContext({
|
|
@@ -1849,9 +1942,9 @@ function ToastNotification({ item, onDismiss }) {
|
|
|
1849
1942
|
destructive: colors.destructiveForeground,
|
|
1850
1943
|
success: colors.successForeground
|
|
1851
1944
|
}[item.variant ?? "default"];
|
|
1852
|
-
const defaultIcon = item.variant === "success" ? /* @__PURE__ */
|
|
1853
|
-
const leftIcon = item.icon ?? defaultIcon;
|
|
1854
|
-
return /* @__PURE__ */
|
|
1945
|
+
const defaultIcon = item.variant === "success" ? /* @__PURE__ */ React24.createElement(FontAwesome5$1, { name: "check-circle", size: 22, color: textColor }) : item.variant === "destructive" ? /* @__PURE__ */ React24.createElement(MaterialIcons$1, { name: "error-outline", size: 24, color: textColor }) : /* @__PURE__ */ React24.createElement(Entypo$1, { name: "info-with-circle", size: 22, color: textColor });
|
|
1946
|
+
const leftIcon = item.iconName ? renderIcon(item.iconName, 22, item.iconColor ?? textColor) : item.icon ?? defaultIcon;
|
|
1947
|
+
return /* @__PURE__ */ React24.createElement(GestureDetector, { gesture: panGesture }, /* @__PURE__ */ React24.createElement(Animated10.View, { style: [styles21.toast, { backgroundColor: bgColor }, animatedStyle] }, /* @__PURE__ */ React24.createElement(View, { style: styles21.leftIconContainer }, leftIcon), /* @__PURE__ */ React24.createElement(View, { style: styles21.toastContent }, item.title ? /* @__PURE__ */ React24.createElement(Text, { style: [styles21.toastTitle, { color: textColor }] }, item.title) : null, item.description ? /* @__PURE__ */ React24.createElement(Text, { style: [styles21.toastDescription, { color: textColor, opacity: 0.85 }] }, item.description) : null), /* @__PURE__ */ React24.createElement(TouchableOpacity, { onPress: onDismiss, style: styles21.dismissButton, touchSoundDisabled: true }, /* @__PURE__ */ React24.createElement(AntDesign$1, { name: "close-circle", size: 18, color: textColor }))));
|
|
1855
1948
|
}
|
|
1856
1949
|
function ToastProvider({ children }) {
|
|
1857
1950
|
const [toasts, setToasts] = useState([]);
|
|
@@ -1859,39 +1952,39 @@ function ToastProvider({ children }) {
|
|
|
1859
1952
|
const toast = useCallback((item) => {
|
|
1860
1953
|
const id = Math.random().toString(36).slice(2);
|
|
1861
1954
|
if (item.variant === "success") {
|
|
1862
|
-
|
|
1955
|
+
notificationSuccess();
|
|
1863
1956
|
} else if (item.variant === "destructive") {
|
|
1864
|
-
|
|
1957
|
+
notificationError();
|
|
1865
1958
|
} else {
|
|
1866
|
-
|
|
1959
|
+
impactLight();
|
|
1867
1960
|
}
|
|
1868
1961
|
setToasts((prev) => [{ ...item, id }, ...prev].slice(0, 3));
|
|
1869
1962
|
}, []);
|
|
1870
1963
|
const dismiss = useCallback((id) => {
|
|
1871
1964
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
1872
1965
|
}, []);
|
|
1873
|
-
return /* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ React24.createElement(ToastContext.Provider, { value: { toast, dismiss } }, children, /* @__PURE__ */ React24.createElement(View, { style: [styles21.container, Platform.OS === "web" && styles21.containerWeb, { top: insets.top + 8 }], pointerEvents: "box-none" }, toasts.map((item) => /* @__PURE__ */ React24.createElement(ToastNotification, { key: item.id, item, onDismiss: () => dismiss(item.id) }))));
|
|
1874
1967
|
}
|
|
1875
1968
|
var styles21 = StyleSheet.create({
|
|
1876
1969
|
container: {
|
|
1877
1970
|
position: "absolute",
|
|
1878
|
-
left: 16,
|
|
1879
|
-
right: 16,
|
|
1880
|
-
gap: 8,
|
|
1971
|
+
left: s(16),
|
|
1972
|
+
right: s(16),
|
|
1973
|
+
gap: vs(8),
|
|
1881
1974
|
zIndex: 9999
|
|
1882
1975
|
},
|
|
1883
1976
|
containerWeb: {
|
|
1884
1977
|
left: void 0,
|
|
1885
1978
|
right: void 0,
|
|
1886
1979
|
alignSelf: "center",
|
|
1887
|
-
width: 400
|
|
1980
|
+
width: s(400)
|
|
1888
1981
|
},
|
|
1889
1982
|
toast: {
|
|
1890
1983
|
flexDirection: "row",
|
|
1891
1984
|
alignItems: "center",
|
|
1892
|
-
borderRadius: 16,
|
|
1893
|
-
paddingHorizontal: 20,
|
|
1894
|
-
paddingVertical: 14,
|
|
1985
|
+
borderRadius: ms(16),
|
|
1986
|
+
paddingHorizontal: s(20),
|
|
1987
|
+
paddingVertical: vs(14),
|
|
1895
1988
|
shadowColor: "#000",
|
|
1896
1989
|
shadowOffset: { width: 0, height: 4 },
|
|
1897
1990
|
shadowOpacity: 0.15,
|
|
@@ -1900,24 +1993,24 @@ var styles21 = StyleSheet.create({
|
|
|
1900
1993
|
},
|
|
1901
1994
|
toastContent: {
|
|
1902
1995
|
flex: 1,
|
|
1903
|
-
gap: 4
|
|
1996
|
+
gap: vs(4)
|
|
1904
1997
|
},
|
|
1905
1998
|
leftIconContainer: {
|
|
1906
|
-
width: 40,
|
|
1999
|
+
width: s(40),
|
|
1907
2000
|
alignItems: "center",
|
|
1908
2001
|
justifyContent: "center",
|
|
1909
|
-
marginRight: 8
|
|
2002
|
+
marginRight: s(8)
|
|
1910
2003
|
},
|
|
1911
2004
|
toastTitle: {
|
|
1912
|
-
fontSize: 15,
|
|
2005
|
+
fontSize: ms(15),
|
|
1913
2006
|
fontWeight: "600"
|
|
1914
2007
|
},
|
|
1915
2008
|
toastDescription: {
|
|
1916
|
-
fontSize: 14
|
|
2009
|
+
fontSize: ms(14)
|
|
1917
2010
|
},
|
|
1918
2011
|
dismissButton: {
|
|
1919
|
-
padding: 8,
|
|
1920
|
-
marginLeft: 4
|
|
2012
|
+
padding: s(8),
|
|
2013
|
+
marginLeft: s(4)
|
|
1921
2014
|
}
|
|
1922
2015
|
});
|
|
1923
2016
|
function formatCurrency(raw, separator) {
|
|
@@ -1949,8 +2042,8 @@ function CurrencyInput({
|
|
|
1949
2042
|
const raw = parseFloat(formatted.replace(separatorRegex, "") || "0");
|
|
1950
2043
|
onChangeValue?.(isNaN(raw) ? 0 : raw);
|
|
1951
2044
|
};
|
|
1952
|
-
const inputStyle = size === "large" ? { fontSize: 36 } : {};
|
|
1953
|
-
return /* @__PURE__ */
|
|
2045
|
+
const inputStyle = size === "large" ? { fontSize: ms(36) } : {};
|
|
2046
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1954
2047
|
Input,
|
|
1955
2048
|
{
|
|
1956
2049
|
value,
|
|
@@ -1981,21 +2074,25 @@ function formatValue(value, prefix, showDecimals) {
|
|
|
1981
2074
|
function CurrencyDisplay({ value, prefix = "$", showDecimals = false, textColor, style }) {
|
|
1982
2075
|
const { colors } = useTheme();
|
|
1983
2076
|
const formatted = formatValue(value, prefix, showDecimals);
|
|
1984
|
-
return /* @__PURE__ */
|
|
2077
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles22.container, style] }, /* @__PURE__ */ React24.createElement(Text, { style: [styles22.amount, { color: textColor ?? colors.foreground }], allowFontScaling: true }, formatted));
|
|
1985
2078
|
}
|
|
1986
2079
|
var styles22 = StyleSheet.create({
|
|
1987
2080
|
container: {},
|
|
1988
2081
|
amount: {
|
|
1989
|
-
fontSize: 56,
|
|
2082
|
+
fontSize: ms(56),
|
|
1990
2083
|
fontWeight: "700"
|
|
1991
2084
|
}
|
|
1992
2085
|
});
|
|
1993
|
-
var
|
|
2086
|
+
var nativeDriver7 = Platform.OS !== "web";
|
|
1994
2087
|
function ListItem({
|
|
1995
2088
|
leftRender,
|
|
1996
2089
|
rightRender,
|
|
1997
2090
|
trailing,
|
|
1998
2091
|
icon,
|
|
2092
|
+
leftIcon,
|
|
2093
|
+
rightIcon,
|
|
2094
|
+
leftIconColor,
|
|
2095
|
+
rightIconColor,
|
|
1999
2096
|
title,
|
|
2000
2097
|
subtitle,
|
|
2001
2098
|
caption,
|
|
@@ -2010,30 +2107,30 @@ function ListItem({
|
|
|
2010
2107
|
captionStyle
|
|
2011
2108
|
}) {
|
|
2012
2109
|
const { colors } = useTheme();
|
|
2013
|
-
const
|
|
2110
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
2014
2111
|
const handlePressIn = () => {
|
|
2015
2112
|
if (!onPress || disabled) return;
|
|
2016
|
-
Animated.spring(
|
|
2113
|
+
Animated.spring(scale2, {
|
|
2017
2114
|
toValue: 0.97,
|
|
2018
|
-
useNativeDriver:
|
|
2115
|
+
useNativeDriver: nativeDriver7,
|
|
2019
2116
|
speed: 40,
|
|
2020
2117
|
bounciness: 0
|
|
2021
2118
|
}).start();
|
|
2022
2119
|
};
|
|
2023
2120
|
const handlePressOut = () => {
|
|
2024
|
-
Animated.spring(
|
|
2121
|
+
Animated.spring(scale2, {
|
|
2025
2122
|
toValue: 1,
|
|
2026
|
-
useNativeDriver:
|
|
2123
|
+
useNativeDriver: nativeDriver7,
|
|
2027
2124
|
speed: 40,
|
|
2028
2125
|
bounciness: 4
|
|
2029
2126
|
}).start();
|
|
2030
2127
|
};
|
|
2031
2128
|
const handlePress = () => {
|
|
2032
|
-
|
|
2129
|
+
selectionAsync();
|
|
2033
2130
|
onPress?.();
|
|
2034
2131
|
};
|
|
2035
|
-
const effectiveLeft = leftRender ?? icon;
|
|
2036
|
-
const effectiveRight = rightRender ?? trailing;
|
|
2132
|
+
const effectiveLeft = leftIcon ? renderIcon(leftIcon, 24, leftIconColor ?? colors.foreground) : leftRender ?? icon;
|
|
2133
|
+
const effectiveRight = rightIcon ? renderIcon(rightIcon, 24, rightIconColor ?? colors.mutedForeground) : rightRender ?? trailing;
|
|
2037
2134
|
const cardStyle = variant === "card" ? {
|
|
2038
2135
|
backgroundColor: colors.card,
|
|
2039
2136
|
borderRadius: 12,
|
|
@@ -2045,7 +2142,7 @@ function ListItem({
|
|
|
2045
2142
|
shadowRadius: 6,
|
|
2046
2143
|
elevation: 2
|
|
2047
2144
|
} : {};
|
|
2048
|
-
return /* @__PURE__ */
|
|
2145
|
+
return /* @__PURE__ */ React24.createElement(Animated.View, { style: [{ transform: [{ scale: scale2 }] }, disabled && styles23.disabled] }, /* @__PURE__ */ React24.createElement(
|
|
2049
2146
|
TouchableOpacity,
|
|
2050
2147
|
{
|
|
2051
2148
|
style: [styles23.container, cardStyle, style],
|
|
@@ -2056,8 +2153,8 @@ function ListItem({
|
|
|
2056
2153
|
activeOpacity: 1,
|
|
2057
2154
|
touchSoundDisabled: true
|
|
2058
2155
|
},
|
|
2059
|
-
effectiveLeft ? /* @__PURE__ */
|
|
2060
|
-
/* @__PURE__ */
|
|
2156
|
+
effectiveLeft ? /* @__PURE__ */ React24.createElement(View, { style: styles23.leftContainer }, effectiveLeft) : null,
|
|
2157
|
+
/* @__PURE__ */ React24.createElement(View, { style: styles23.content }, /* @__PURE__ */ React24.createElement(
|
|
2061
2158
|
Text,
|
|
2062
2159
|
{
|
|
2063
2160
|
style: [styles23.title, { color: colors.foreground }, titleStyle],
|
|
@@ -2065,7 +2162,7 @@ function ListItem({
|
|
|
2065
2162
|
allowFontScaling: true
|
|
2066
2163
|
},
|
|
2067
2164
|
title
|
|
2068
|
-
), subtitle ? /* @__PURE__ */
|
|
2165
|
+
), subtitle ? /* @__PURE__ */ React24.createElement(
|
|
2069
2166
|
Text,
|
|
2070
2167
|
{
|
|
2071
2168
|
style: [styles23.subtitle, { color: colors.mutedForeground }, subtitleStyle],
|
|
@@ -2073,7 +2170,7 @@ function ListItem({
|
|
|
2073
2170
|
allowFontScaling: true
|
|
2074
2171
|
},
|
|
2075
2172
|
subtitle
|
|
2076
|
-
) : null, caption ? /* @__PURE__ */
|
|
2173
|
+
) : null, caption ? /* @__PURE__ */ React24.createElement(
|
|
2077
2174
|
Text,
|
|
2078
2175
|
{
|
|
2079
2176
|
style: [styles23.caption, { color: colors.mutedForeground }, captionStyle],
|
|
@@ -2082,20 +2179,20 @@ function ListItem({
|
|
|
2082
2179
|
},
|
|
2083
2180
|
caption
|
|
2084
2181
|
) : null),
|
|
2085
|
-
effectiveRight !== void 0 ? /* @__PURE__ */
|
|
2182
|
+
effectiveRight !== void 0 ? /* @__PURE__ */ React24.createElement(View, { style: styles23.rightContainer }, typeof effectiveRight === "string" ? /* @__PURE__ */ React24.createElement(
|
|
2086
2183
|
Text,
|
|
2087
2184
|
{
|
|
2088
2185
|
style: [styles23.rightText, { color: colors.mutedForeground }],
|
|
2089
2186
|
allowFontScaling: true
|
|
2090
2187
|
},
|
|
2091
2188
|
effectiveRight
|
|
2092
|
-
) : effectiveRight) : showChevron ? /* @__PURE__ */
|
|
2093
|
-
), showSeparator ? /* @__PURE__ */
|
|
2189
|
+
) : effectiveRight) : showChevron ? /* @__PURE__ */ React24.createElement(Entypo$1, { name: "chevron-with-circle-right", size: 20, color: colors.mutedForeground }) : null
|
|
2190
|
+
), showSeparator ? /* @__PURE__ */ React24.createElement(
|
|
2094
2191
|
View,
|
|
2095
2192
|
{
|
|
2096
2193
|
style: [
|
|
2097
2194
|
styles23.separator,
|
|
2098
|
-
{ backgroundColor: colors.border, marginLeft: effectiveLeft ? 16 + 44 + 12 : 16 }
|
|
2195
|
+
{ backgroundColor: colors.border, marginLeft: effectiveLeft ? s(16) + s(44) + s(12) : s(16) }
|
|
2099
2196
|
]
|
|
2100
2197
|
}
|
|
2101
2198
|
) : null);
|
|
@@ -2104,61 +2201,61 @@ var styles23 = StyleSheet.create({
|
|
|
2104
2201
|
container: {
|
|
2105
2202
|
flexDirection: "row",
|
|
2106
2203
|
alignItems: "center",
|
|
2107
|
-
paddingHorizontal: 16,
|
|
2108
|
-
paddingVertical: 14,
|
|
2109
|
-
gap: 12
|
|
2204
|
+
paddingHorizontal: s(16),
|
|
2205
|
+
paddingVertical: vs(14),
|
|
2206
|
+
gap: s(12)
|
|
2110
2207
|
},
|
|
2111
2208
|
leftContainer: {
|
|
2112
|
-
width: 44,
|
|
2113
|
-
height: 44,
|
|
2209
|
+
width: s(44),
|
|
2210
|
+
height: s(44),
|
|
2114
2211
|
alignItems: "center",
|
|
2115
2212
|
justifyContent: "center",
|
|
2116
2213
|
flexShrink: 0
|
|
2117
2214
|
},
|
|
2118
2215
|
content: {
|
|
2119
2216
|
flex: 1,
|
|
2120
|
-
gap: 4
|
|
2217
|
+
gap: vs(4)
|
|
2121
2218
|
},
|
|
2122
2219
|
title: {
|
|
2123
|
-
fontSize: 17,
|
|
2220
|
+
fontSize: ms(17),
|
|
2124
2221
|
fontWeight: "500",
|
|
2125
|
-
lineHeight: 24
|
|
2222
|
+
lineHeight: mvs(24)
|
|
2126
2223
|
},
|
|
2127
2224
|
subtitle: {
|
|
2128
|
-
fontSize: 14,
|
|
2225
|
+
fontSize: ms(14),
|
|
2129
2226
|
fontWeight: "400",
|
|
2130
|
-
lineHeight: 20
|
|
2227
|
+
lineHeight: mvs(20)
|
|
2131
2228
|
},
|
|
2132
2229
|
caption: {
|
|
2133
|
-
fontSize: 12,
|
|
2230
|
+
fontSize: ms(12),
|
|
2134
2231
|
fontWeight: "400",
|
|
2135
|
-
lineHeight: 16,
|
|
2232
|
+
lineHeight: mvs(16),
|
|
2136
2233
|
opacity: 0.7
|
|
2137
2234
|
},
|
|
2138
2235
|
rightContainer: {
|
|
2139
2236
|
alignItems: "flex-end",
|
|
2140
2237
|
justifyContent: "center",
|
|
2141
2238
|
flexShrink: 0,
|
|
2142
|
-
maxWidth: 160
|
|
2239
|
+
maxWidth: s(160)
|
|
2143
2240
|
},
|
|
2144
2241
|
rightText: {
|
|
2145
|
-
fontSize: 15
|
|
2242
|
+
fontSize: ms(15)
|
|
2146
2243
|
},
|
|
2147
2244
|
chevron: {
|
|
2148
|
-
marginLeft: 4
|
|
2245
|
+
marginLeft: s(4)
|
|
2149
2246
|
},
|
|
2150
2247
|
separator: {
|
|
2151
2248
|
height: StyleSheet.hairlineWidth,
|
|
2152
|
-
marginRight: 16
|
|
2249
|
+
marginRight: s(16)
|
|
2153
2250
|
},
|
|
2154
2251
|
disabled: {
|
|
2155
2252
|
opacity: 0.45
|
|
2156
2253
|
}
|
|
2157
2254
|
});
|
|
2158
|
-
var
|
|
2255
|
+
var nativeDriver8 = Platform.OS !== "web";
|
|
2159
2256
|
function Chip({ label, selected = false, onPress, style }) {
|
|
2160
2257
|
const { colors } = useTheme();
|
|
2161
|
-
const
|
|
2258
|
+
const scale2 = useRef(new Animated.Value(1)).current;
|
|
2162
2259
|
const pressAnim = useRef(new Animated.Value(selected ? 1 : 0)).current;
|
|
2163
2260
|
useEffect(() => {
|
|
2164
2261
|
Animated.timing(pressAnim, {
|
|
@@ -2169,23 +2266,23 @@ function Chip({ label, selected = false, onPress, style }) {
|
|
|
2169
2266
|
}).start();
|
|
2170
2267
|
}, [selected, pressAnim]);
|
|
2171
2268
|
const handlePressIn = () => {
|
|
2172
|
-
Animated.spring(
|
|
2269
|
+
Animated.spring(scale2, {
|
|
2173
2270
|
toValue: 0.95,
|
|
2174
|
-
useNativeDriver:
|
|
2271
|
+
useNativeDriver: nativeDriver8,
|
|
2175
2272
|
speed: 40,
|
|
2176
2273
|
bounciness: 0
|
|
2177
2274
|
}).start();
|
|
2178
2275
|
};
|
|
2179
2276
|
const handlePressOut = () => {
|
|
2180
|
-
Animated.spring(
|
|
2277
|
+
Animated.spring(scale2, {
|
|
2181
2278
|
toValue: 1,
|
|
2182
|
-
useNativeDriver:
|
|
2279
|
+
useNativeDriver: nativeDriver8,
|
|
2183
2280
|
speed: 40,
|
|
2184
2281
|
bounciness: 4
|
|
2185
2282
|
}).start();
|
|
2186
2283
|
};
|
|
2187
2284
|
const handlePress = () => {
|
|
2188
|
-
|
|
2285
|
+
selectionAsync();
|
|
2189
2286
|
onPress?.();
|
|
2190
2287
|
};
|
|
2191
2288
|
const backgroundColor = pressAnim.interpolate({
|
|
@@ -2200,7 +2297,7 @@ function Chip({ label, selected = false, onPress, style }) {
|
|
|
2200
2297
|
inputRange: [0, 1],
|
|
2201
2298
|
outputRange: [colors.border, colors.primary]
|
|
2202
2299
|
});
|
|
2203
|
-
return /* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ React24.createElement(Animated.View, { style: [styles24.wrapper, { transform: [{ scale: scale2 }] }, style] }, /* @__PURE__ */ React24.createElement(
|
|
2204
2301
|
TouchableOpacity,
|
|
2205
2302
|
{
|
|
2206
2303
|
onPress: handlePress,
|
|
@@ -2209,7 +2306,7 @@ function Chip({ label, selected = false, onPress, style }) {
|
|
|
2209
2306
|
activeOpacity: 1,
|
|
2210
2307
|
touchSoundDisabled: true
|
|
2211
2308
|
},
|
|
2212
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ React24.createElement(Animated.View, { style: [styles24.chip, { backgroundColor, borderColor }] }, /* @__PURE__ */ React24.createElement(Animated.Text, { style: [styles24.label, { color: textColor }], allowFontScaling: true }, label))
|
|
2213
2310
|
));
|
|
2214
2311
|
}
|
|
2215
2312
|
function ChipGroup({ options, value, onValueChange, multiSelect = false, style }) {
|
|
@@ -2234,7 +2331,7 @@ function ChipGroup({ options, value, onValueChange, multiSelect = false, style }
|
|
|
2234
2331
|
}
|
|
2235
2332
|
return optionValue === value;
|
|
2236
2333
|
};
|
|
2237
|
-
return /* @__PURE__ */
|
|
2334
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles24.group, style] }, options.map((opt) => /* @__PURE__ */ React24.createElement(
|
|
2238
2335
|
Chip,
|
|
2239
2336
|
{
|
|
2240
2337
|
key: opt.value,
|
|
@@ -2248,21 +2345,21 @@ var styles24 = StyleSheet.create({
|
|
|
2248
2345
|
wrapper: {},
|
|
2249
2346
|
chip: {
|
|
2250
2347
|
borderRadius: 999,
|
|
2251
|
-
paddingHorizontal: 14,
|
|
2252
|
-
paddingVertical: 8,
|
|
2348
|
+
paddingHorizontal: s(14),
|
|
2349
|
+
paddingVertical: vs(8),
|
|
2253
2350
|
borderWidth: 1.5,
|
|
2254
2351
|
alignItems: "center",
|
|
2255
2352
|
justifyContent: "center"
|
|
2256
2353
|
},
|
|
2257
2354
|
label: {
|
|
2258
|
-
fontSize: 14,
|
|
2355
|
+
fontSize: ms(14),
|
|
2259
2356
|
fontWeight: "500",
|
|
2260
|
-
lineHeight: 20
|
|
2357
|
+
lineHeight: mvs(20)
|
|
2261
2358
|
},
|
|
2262
2359
|
group: {
|
|
2263
2360
|
flexDirection: "row",
|
|
2264
2361
|
flexWrap: "wrap",
|
|
2265
|
-
gap: 8
|
|
2362
|
+
gap: s(8)
|
|
2266
2363
|
}
|
|
2267
2364
|
});
|
|
2268
2365
|
function ConfirmDialog({
|
|
@@ -2276,15 +2373,15 @@ function ConfirmDialog({
|
|
|
2276
2373
|
onCancel
|
|
2277
2374
|
}) {
|
|
2278
2375
|
const { colors } = useTheme();
|
|
2279
|
-
return /* @__PURE__ */
|
|
2376
|
+
return /* @__PURE__ */ React24.createElement(Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onCancel }, /* @__PURE__ */ React24.createElement(TouchableOpacity, { style: styles25.overlay, activeOpacity: 1, onPress: onCancel }, /* @__PURE__ */ React24.createElement(
|
|
2280
2377
|
View,
|
|
2281
2378
|
{
|
|
2282
2379
|
style: [styles25.dialog, { backgroundColor: colors.card }],
|
|
2283
2380
|
onStartShouldSetResponder: () => true
|
|
2284
2381
|
},
|
|
2285
|
-
/* @__PURE__ */
|
|
2286
|
-
description ? /* @__PURE__ */
|
|
2287
|
-
/* @__PURE__ */
|
|
2382
|
+
/* @__PURE__ */ React24.createElement(Text, { style: [styles25.title, { color: colors.cardForeground }], allowFontScaling: true }, title),
|
|
2383
|
+
description ? /* @__PURE__ */ React24.createElement(Text, { style: [styles25.description, { color: colors.mutedForeground }], allowFontScaling: true }, description) : null,
|
|
2384
|
+
/* @__PURE__ */ React24.createElement(View, { style: styles25.actions }, /* @__PURE__ */ React24.createElement(Button, { label: cancelLabel, variant: "outline", fullWidth: true, onPress: onCancel }), /* @__PURE__ */ React24.createElement(Button, { label: confirmLabel, variant: confirmVariant, fullWidth: true, onPress: onConfirm }))
|
|
2288
2385
|
)));
|
|
2289
2386
|
}
|
|
2290
2387
|
var styles25 = StyleSheet.create({
|
|
@@ -2293,14 +2390,14 @@ var styles25 = StyleSheet.create({
|
|
|
2293
2390
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
2294
2391
|
justifyContent: "center",
|
|
2295
2392
|
alignItems: "center",
|
|
2296
|
-
padding: 24
|
|
2393
|
+
padding: s(24)
|
|
2297
2394
|
},
|
|
2298
2395
|
dialog: {
|
|
2299
2396
|
width: "100%",
|
|
2300
|
-
maxWidth: 400,
|
|
2301
|
-
borderRadius: 16,
|
|
2302
|
-
padding: 24,
|
|
2303
|
-
gap: 12,
|
|
2397
|
+
maxWidth: s(400),
|
|
2398
|
+
borderRadius: ms(16),
|
|
2399
|
+
padding: s(24),
|
|
2400
|
+
gap: vs(12),
|
|
2304
2401
|
shadowColor: "#000",
|
|
2305
2402
|
shadowOffset: { width: 0, height: 8 },
|
|
2306
2403
|
shadowOpacity: 0.15,
|
|
@@ -2308,38 +2405,38 @@ var styles25 = StyleSheet.create({
|
|
|
2308
2405
|
elevation: 8
|
|
2309
2406
|
},
|
|
2310
2407
|
title: {
|
|
2311
|
-
fontSize: 18,
|
|
2408
|
+
fontSize: ms(18),
|
|
2312
2409
|
fontWeight: "600",
|
|
2313
|
-
lineHeight: 26
|
|
2410
|
+
lineHeight: mvs(26)
|
|
2314
2411
|
},
|
|
2315
2412
|
description: {
|
|
2316
|
-
fontSize: 15,
|
|
2317
|
-
lineHeight: 22
|
|
2413
|
+
fontSize: ms(15),
|
|
2414
|
+
lineHeight: mvs(22)
|
|
2318
2415
|
},
|
|
2319
2416
|
actions: {
|
|
2320
|
-
gap: 10,
|
|
2321
|
-
marginTop: 8
|
|
2417
|
+
gap: vs(10),
|
|
2418
|
+
marginTop: vs(8)
|
|
2322
2419
|
}
|
|
2323
2420
|
});
|
|
2324
2421
|
function LabelValue({ label, value, style }) {
|
|
2325
2422
|
const { colors } = useTheme();
|
|
2326
|
-
return /* @__PURE__ */
|
|
2423
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles26.container, style] }, /* @__PURE__ */ React24.createElement(Text, { style: [styles26.label, { color: colors.mutedForeground }], allowFontScaling: true }, label), typeof value === "string" ? /* @__PURE__ */ React24.createElement(Text, { style: [styles26.value, { color: colors.foreground }], allowFontScaling: true }, value) : value);
|
|
2327
2424
|
}
|
|
2328
2425
|
var styles26 = StyleSheet.create({
|
|
2329
2426
|
container: {
|
|
2330
2427
|
flexDirection: "row",
|
|
2331
2428
|
justifyContent: "space-between",
|
|
2332
2429
|
alignItems: "center",
|
|
2333
|
-
gap: 12
|
|
2430
|
+
gap: s(12)
|
|
2334
2431
|
},
|
|
2335
2432
|
label: {
|
|
2336
|
-
fontSize: 13,
|
|
2337
|
-
lineHeight: 18
|
|
2433
|
+
fontSize: ms(13),
|
|
2434
|
+
lineHeight: mvs(18)
|
|
2338
2435
|
},
|
|
2339
2436
|
value: {
|
|
2340
|
-
fontSize: 15,
|
|
2437
|
+
fontSize: ms(15),
|
|
2341
2438
|
fontWeight: "500",
|
|
2342
|
-
lineHeight: 22,
|
|
2439
|
+
lineHeight: mvs(22),
|
|
2343
2440
|
textAlign: "right"
|
|
2344
2441
|
}
|
|
2345
2442
|
});
|
|
@@ -2360,7 +2457,7 @@ var MONTH_NAMES = [
|
|
|
2360
2457
|
function MonthPicker({ value, onChange, style }) {
|
|
2361
2458
|
const { colors } = useTheme();
|
|
2362
2459
|
const handlePrev = () => {
|
|
2363
|
-
|
|
2460
|
+
selectionAsync();
|
|
2364
2461
|
if (value.month === 1) {
|
|
2365
2462
|
onChange({ month: 12, year: value.year - 1 });
|
|
2366
2463
|
} else {
|
|
@@ -2368,14 +2465,14 @@ function MonthPicker({ value, onChange, style }) {
|
|
|
2368
2465
|
}
|
|
2369
2466
|
};
|
|
2370
2467
|
const handleNext = () => {
|
|
2371
|
-
|
|
2468
|
+
selectionAsync();
|
|
2372
2469
|
if (value.month === 12) {
|
|
2373
2470
|
onChange({ month: 1, year: value.year + 1 });
|
|
2374
2471
|
} else {
|
|
2375
2472
|
onChange({ month: value.month + 1, year: value.year });
|
|
2376
2473
|
}
|
|
2377
2474
|
};
|
|
2378
|
-
return /* @__PURE__ */
|
|
2475
|
+
return /* @__PURE__ */ React24.createElement(View, { style: [styles27.container, style] }, /* @__PURE__ */ React24.createElement(
|
|
2379
2476
|
TouchableOpacity,
|
|
2380
2477
|
{
|
|
2381
2478
|
style: styles27.arrow,
|
|
@@ -2383,8 +2480,8 @@ function MonthPicker({ value, onChange, style }) {
|
|
|
2383
2480
|
activeOpacity: 0.6,
|
|
2384
2481
|
touchSoundDisabled: true
|
|
2385
2482
|
},
|
|
2386
|
-
/* @__PURE__ */
|
|
2387
|
-
), /* @__PURE__ */
|
|
2483
|
+
/* @__PURE__ */ React24.createElement(Entypo$1, { name: "chevron-left", size: 22, color: colors.foreground })
|
|
2484
|
+
), /* @__PURE__ */ React24.createElement(Text, { style: [styles27.label, { color: colors.foreground }], allowFontScaling: true }, MONTH_NAMES[value.month - 1], " ", value.year), /* @__PURE__ */ React24.createElement(
|
|
2388
2485
|
TouchableOpacity,
|
|
2389
2486
|
{
|
|
2390
2487
|
style: styles27.arrow,
|
|
@@ -2392,7 +2489,7 @@ function MonthPicker({ value, onChange, style }) {
|
|
|
2392
2489
|
activeOpacity: 0.6,
|
|
2393
2490
|
touchSoundDisabled: true
|
|
2394
2491
|
},
|
|
2395
|
-
/* @__PURE__ */
|
|
2492
|
+
/* @__PURE__ */ React24.createElement(Entypo$1, { name: "chevron-right", size: 22, color: colors.foreground })
|
|
2396
2493
|
));
|
|
2397
2494
|
}
|
|
2398
2495
|
var styles27 = StyleSheet.create({
|
|
@@ -2402,18 +2499,18 @@ var styles27 = StyleSheet.create({
|
|
|
2402
2499
|
justifyContent: "space-between"
|
|
2403
2500
|
},
|
|
2404
2501
|
arrow: {
|
|
2405
|
-
width: 44,
|
|
2406
|
-
height: 44,
|
|
2502
|
+
width: s(44),
|
|
2503
|
+
height: s(44),
|
|
2407
2504
|
alignItems: "center",
|
|
2408
2505
|
justifyContent: "center"
|
|
2409
2506
|
},
|
|
2410
2507
|
label: {
|
|
2411
|
-
fontSize: 17,
|
|
2508
|
+
fontSize: ms(17),
|
|
2412
2509
|
fontWeight: "500",
|
|
2413
|
-
lineHeight: 24,
|
|
2510
|
+
lineHeight: mvs(24),
|
|
2414
2511
|
textAlign: "center",
|
|
2415
|
-
minWidth: 160
|
|
2512
|
+
minWidth: s(160)
|
|
2416
2513
|
}
|
|
2417
2514
|
});
|
|
2418
2515
|
|
|
2419
|
-
export { Accordion, AlertBanner, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, ChipGroup, ConfirmDialog, CurrencyDisplay, CurrencyInput, CurrencyInput as CurrencyInputLarge, EmptyState, Input, LabelValue, ListItem, MonthPicker, Progress, RadioGroup, Select, Separator, Sheet, Skeleton, Slider, Spinner, Switch, Tabs, TabsContent, Text2 as Text, Textarea, ThemeProvider, ToastProvider, Toggle, defaultDark, defaultLight, useTheme, useToast };
|
|
2516
|
+
export { Accordion, AlertBanner, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, ChipGroup, ConfirmDialog, CurrencyDisplay, CurrencyInput, CurrencyInput as CurrencyInputLarge, EmptyState, Icon, Input, LabelValue, ListItem, MonthPicker, Progress, RadioGroup, Select, Separator, Sheet, Skeleton, Slider, Spinner, Switch, Tabs, TabsContent, Text2 as Text, Textarea, ThemeProvider, ToastProvider, Toggle, defaultDark, defaultLight, renderIcon, useTheme, useToast };
|