@retray-dev/ui-kit 1.6.0 → 1.7.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 +108 -6
- package/README.md +3 -3
- package/dist/index.d.mts +43 -5
- package/dist/index.d.ts +43 -5
- package/dist/index.js +278 -121
- package/dist/index.mjs +281 -126
- package/package.json +8 -8
- package/src/components/Accordion/Accordion.tsx +4 -4
- package/src/components/Alert/Alert.tsx +13 -1
- package/src/components/Avatar/Avatar.tsx +8 -8
- package/src/components/Badge/Badge.tsx +4 -4
- package/src/components/Button/Button.tsx +10 -10
- package/src/components/Card/Card.tsx +9 -9
- package/src/components/Checkbox/Checkbox.tsx +8 -8
- package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +46 -0
- package/src/components/CurrencyDisplay/index.ts +1 -0
- package/src/components/CurrencyInputLarge/CurrencyInputLarge.tsx +66 -0
- package/src/components/CurrencyInputLarge/index.ts +1 -0
- package/src/components/Input/Input.tsx +8 -8
- package/src/components/Select/Select.tsx +19 -19
- package/src/components/Switch/Switch.tsx +8 -5
- package/src/components/Tabs/Tabs.tsx +34 -15
- package/src/components/Text/Text.tsx +6 -6
- package/src/components/Textarea/Textarea.tsx +9 -9
- package/src/components/Toast/Toast.tsx +25 -7
- package/src/components/Toggle/Toggle.tsx +93 -24
- package/src/index.ts +2 -0
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React23, { createContext, useMemo, useContext, useRef, useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { StyleSheet, useColorScheme, Animated, TouchableOpacity, ActivityIndicator, Text, View, TextInput, Image, PanResponder } from 'react-native';
|
|
2
|
+
import { StyleSheet, useColorScheme, Animated, TouchableOpacity, ActivityIndicator, Text, View, TextInput, Image, Easing, PanResponder } from 'react-native';
|
|
3
3
|
import * as Haptics11 from 'expo-haptics';
|
|
4
4
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
5
|
-
import ReanimatedAnimated, { useSharedValue, useAnimatedStyle, withTiming, Easing, withSpring } from 'react-native-reanimated';
|
|
5
|
+
import ReanimatedAnimated, { useSharedValue, useAnimatedStyle, withTiming, Easing as Easing$1, withSpring } from 'react-native-reanimated';
|
|
6
6
|
import { BottomSheetModal, BottomSheetView, BottomSheetBackdrop } from '@gorhom/bottom-sheet';
|
|
7
7
|
export { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
8
8
|
import { scheduleOnRN } from 'react-native-worklets';
|
|
@@ -74,13 +74,13 @@ function useTheme() {
|
|
|
74
74
|
return useContext(ThemeContext);
|
|
75
75
|
}
|
|
76
76
|
var containerSizeStyles = {
|
|
77
|
-
sm: { paddingHorizontal:
|
|
78
|
-
md: { paddingHorizontal:
|
|
79
|
-
lg: { paddingHorizontal:
|
|
77
|
+
sm: { paddingHorizontal: 20, paddingVertical: 12 },
|
|
78
|
+
md: { paddingHorizontal: 24, paddingVertical: 16 },
|
|
79
|
+
lg: { paddingHorizontal: 32, paddingVertical: 20 }
|
|
80
80
|
};
|
|
81
81
|
var labelSizeStyles = {
|
|
82
|
-
sm: { fontSize:
|
|
83
|
-
md: { fontSize:
|
|
82
|
+
sm: { fontSize: 15 },
|
|
83
|
+
md: { fontSize: 17 },
|
|
84
84
|
lg: { fontSize: 18 }
|
|
85
85
|
};
|
|
86
86
|
function Button({
|
|
@@ -147,12 +147,12 @@ function Button({
|
|
|
147
147
|
onPressOut: handlePressOut,
|
|
148
148
|
...props
|
|
149
149
|
},
|
|
150
|
-
loading ? /* @__PURE__ */ React23.createElement(ActivityIndicator, { size: "small", color: spinnerColor }) : /* @__PURE__ */ React23.createElement(React23.Fragment, null, icon && iconPosition === "left" && /* @__PURE__ */ React23.createElement(React23.Fragment, null, icon), /* @__PURE__ */ React23.createElement(Text, { style: [styles.label, labelVariantStyle, labelSizeStyles[size], icon ? styles.labelWithIcon : void 0] }, label), icon && iconPosition === "right" && /* @__PURE__ */ React23.createElement(React23.Fragment, null, icon))
|
|
150
|
+
loading ? /* @__PURE__ */ React23.createElement(ActivityIndicator, { size: "small", color: spinnerColor }) : /* @__PURE__ */ React23.createElement(React23.Fragment, null, icon && iconPosition === "left" && /* @__PURE__ */ React23.createElement(React23.Fragment, null, typeof icon === "function" ? icon({ label, size, variant }) : icon), /* @__PURE__ */ React23.createElement(Text, { style: [styles.label, labelVariantStyle, labelSizeStyles[size], icon ? styles.labelWithIcon : void 0] }, label), icon && iconPosition === "right" && /* @__PURE__ */ React23.createElement(React23.Fragment, null, typeof icon === "function" ? icon({ label, size, variant }) : icon))
|
|
151
151
|
));
|
|
152
152
|
}
|
|
153
153
|
var styles = StyleSheet.create({
|
|
154
154
|
base: {
|
|
155
|
-
borderRadius:
|
|
155
|
+
borderRadius: 999,
|
|
156
156
|
alignItems: "center",
|
|
157
157
|
justifyContent: "center",
|
|
158
158
|
flexDirection: "row"
|
|
@@ -171,12 +171,12 @@ var styles = StyleSheet.create({
|
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
var variantStyles = {
|
|
174
|
-
h1: { fontSize:
|
|
175
|
-
h2: { fontSize:
|
|
176
|
-
h3: { fontSize:
|
|
177
|
-
body: { fontSize:
|
|
178
|
-
caption: { fontSize:
|
|
179
|
-
label: { fontSize:
|
|
174
|
+
h1: { fontSize: 40, fontWeight: "700", lineHeight: 52 },
|
|
175
|
+
h2: { fontSize: 28, fontWeight: "700", lineHeight: 36 },
|
|
176
|
+
h3: { fontSize: 22, fontWeight: "600", lineHeight: 30 },
|
|
177
|
+
body: { fontSize: 17, fontWeight: "400", lineHeight: 26 },
|
|
178
|
+
caption: { fontSize: 13, fontWeight: "400", lineHeight: 20 },
|
|
179
|
+
label: { fontSize: 15, fontWeight: "500", lineHeight: 22 }
|
|
180
180
|
};
|
|
181
181
|
function Text2({ variant = "body", color, style, children, ...props }) {
|
|
182
182
|
const { colors } = useTheme();
|
|
@@ -222,22 +222,22 @@ function Input({ label, error, hint, containerStyle, style, onFocus, onBlur, ...
|
|
|
222
222
|
}
|
|
223
223
|
var styles2 = StyleSheet.create({
|
|
224
224
|
container: {
|
|
225
|
-
gap:
|
|
225
|
+
gap: 6
|
|
226
226
|
},
|
|
227
227
|
label: {
|
|
228
|
-
fontSize:
|
|
228
|
+
fontSize: 15,
|
|
229
229
|
fontWeight: "500",
|
|
230
|
-
marginBottom:
|
|
230
|
+
marginBottom: 6
|
|
231
231
|
},
|
|
232
232
|
input: {
|
|
233
233
|
borderWidth: 1.5,
|
|
234
|
-
borderRadius:
|
|
235
|
-
paddingHorizontal:
|
|
236
|
-
paddingVertical:
|
|
237
|
-
fontSize:
|
|
234
|
+
borderRadius: 14,
|
|
235
|
+
paddingHorizontal: 20,
|
|
236
|
+
paddingVertical: 16,
|
|
237
|
+
fontSize: 17
|
|
238
238
|
},
|
|
239
239
|
helperText: {
|
|
240
|
-
fontSize:
|
|
240
|
+
fontSize: 13
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
243
|
function Badge({ label, variant = "default", style }) {
|
|
@@ -258,13 +258,13 @@ function Badge({ label, variant = "default", style }) {
|
|
|
258
258
|
}
|
|
259
259
|
var styles3 = StyleSheet.create({
|
|
260
260
|
container: {
|
|
261
|
-
borderRadius:
|
|
262
|
-
paddingHorizontal:
|
|
263
|
-
paddingVertical:
|
|
261
|
+
borderRadius: 8,
|
|
262
|
+
paddingHorizontal: 10,
|
|
263
|
+
paddingVertical: 4,
|
|
264
264
|
alignSelf: "flex-start"
|
|
265
265
|
},
|
|
266
266
|
label: {
|
|
267
|
-
fontSize:
|
|
267
|
+
fontSize: 13,
|
|
268
268
|
fontWeight: "500"
|
|
269
269
|
}
|
|
270
270
|
});
|
|
@@ -297,7 +297,7 @@ function CardFooter({ children, style }) {
|
|
|
297
297
|
}
|
|
298
298
|
var styles4 = StyleSheet.create({
|
|
299
299
|
card: {
|
|
300
|
-
borderRadius:
|
|
300
|
+
borderRadius: 20,
|
|
301
301
|
borderWidth: 1,
|
|
302
302
|
shadowColor: "#000",
|
|
303
303
|
shadowOffset: { width: 0, height: 1 },
|
|
@@ -306,24 +306,24 @@ var styles4 = StyleSheet.create({
|
|
|
306
306
|
elevation: 1
|
|
307
307
|
},
|
|
308
308
|
header: {
|
|
309
|
-
padding:
|
|
309
|
+
padding: 28,
|
|
310
310
|
paddingBottom: 0,
|
|
311
|
-
gap:
|
|
311
|
+
gap: 8
|
|
312
312
|
},
|
|
313
313
|
title: {
|
|
314
|
-
fontSize:
|
|
314
|
+
fontSize: 20,
|
|
315
315
|
fontWeight: "600",
|
|
316
|
-
lineHeight:
|
|
316
|
+
lineHeight: 28
|
|
317
317
|
},
|
|
318
318
|
description: {
|
|
319
|
-
fontSize:
|
|
320
|
-
lineHeight:
|
|
319
|
+
fontSize: 15,
|
|
320
|
+
lineHeight: 22
|
|
321
321
|
},
|
|
322
322
|
content: {
|
|
323
|
-
padding:
|
|
323
|
+
padding: 28
|
|
324
324
|
},
|
|
325
325
|
footer: {
|
|
326
|
-
padding:
|
|
326
|
+
padding: 28,
|
|
327
327
|
paddingTop: 0,
|
|
328
328
|
flexDirection: "row",
|
|
329
329
|
alignItems: "center"
|
|
@@ -408,16 +408,16 @@ var styles6 = StyleSheet.create({
|
|
|
408
408
|
}
|
|
409
409
|
});
|
|
410
410
|
var sizeMap2 = {
|
|
411
|
-
sm:
|
|
412
|
-
md:
|
|
413
|
-
lg:
|
|
414
|
-
xl:
|
|
411
|
+
sm: 28,
|
|
412
|
+
md: 40,
|
|
413
|
+
lg: 56,
|
|
414
|
+
xl: 72
|
|
415
415
|
};
|
|
416
416
|
var fontSizeMap = {
|
|
417
|
-
sm:
|
|
418
|
-
md:
|
|
419
|
-
lg:
|
|
420
|
-
xl:
|
|
417
|
+
sm: 12,
|
|
418
|
+
md: 16,
|
|
419
|
+
lg: 22,
|
|
420
|
+
xl: 28
|
|
421
421
|
};
|
|
422
422
|
function Avatar({ src, fallback, size = "md", style }) {
|
|
423
423
|
const { colors } = useTheme();
|
|
@@ -460,7 +460,7 @@ function Alert({ title, description, variant = "default", icon, style }) {
|
|
|
460
460
|
const borderColor = variant === "destructive" ? colors.destructive : colors.border;
|
|
461
461
|
const titleColor = variant === "destructive" ? colors.destructive : colors.foreground;
|
|
462
462
|
const descColor = variant === "destructive" ? colors.destructive : colors.mutedForeground;
|
|
463
|
-
return /* @__PURE__ */ React23.createElement(View, { style: [styles8.container, { backgroundColor: colors.card, borderColor }, style] }, icon ? /* @__PURE__ */ React23.createElement(View, { style: styles8.icon }, icon) :
|
|
463
|
+
return /* @__PURE__ */ React23.createElement(View, { style: [styles8.container, { backgroundColor: colors.card, borderColor }, style] }, icon ? /* @__PURE__ */ React23.createElement(View, { style: styles8.icon }, icon) : /* @__PURE__ */ React23.createElement(View, { style: styles8.icon }, /* @__PURE__ */ React23.createElement(Text, { style: [styles8.defaultIcon, { color: titleColor }] }, variant === "destructive" ? "\u26A0" : "\u2139")), /* @__PURE__ */ React23.createElement(View, { style: styles8.content }, title ? /* @__PURE__ */ React23.createElement(Text, { style: [styles8.title, { color: titleColor }] }, title) : null, description ? /* @__PURE__ */ React23.createElement(Text, { style: [styles8.description, { color: descColor }] }, description) : null));
|
|
464
464
|
}
|
|
465
465
|
var styles8 = StyleSheet.create({
|
|
466
466
|
container: {
|
|
@@ -485,6 +485,10 @@ var styles8 = StyleSheet.create({
|
|
|
485
485
|
description: {
|
|
486
486
|
fontSize: 14,
|
|
487
487
|
lineHeight: 20
|
|
488
|
+
},
|
|
489
|
+
defaultIcon: {
|
|
490
|
+
fontSize: 18,
|
|
491
|
+
fontWeight: "700"
|
|
488
492
|
}
|
|
489
493
|
});
|
|
490
494
|
function Progress({ value = 0, max = 100, style }) {
|
|
@@ -592,7 +596,7 @@ function Textarea({
|
|
|
592
596
|
borderColor: error ? colors.destructive : focused ? colors.ring : colors.border,
|
|
593
597
|
color: colors.foreground,
|
|
594
598
|
backgroundColor: colors.background,
|
|
595
|
-
minHeight: rows *
|
|
599
|
+
minHeight: rows * 30
|
|
596
600
|
},
|
|
597
601
|
style
|
|
598
602
|
],
|
|
@@ -612,22 +616,22 @@ function Textarea({
|
|
|
612
616
|
}
|
|
613
617
|
var styles11 = StyleSheet.create({
|
|
614
618
|
container: {
|
|
615
|
-
gap:
|
|
619
|
+
gap: 6
|
|
616
620
|
},
|
|
617
621
|
label: {
|
|
618
|
-
fontSize:
|
|
622
|
+
fontSize: 15,
|
|
619
623
|
fontWeight: "500",
|
|
620
|
-
marginBottom:
|
|
624
|
+
marginBottom: 6
|
|
621
625
|
},
|
|
622
626
|
input: {
|
|
623
627
|
borderWidth: 1.5,
|
|
624
|
-
borderRadius:
|
|
625
|
-
paddingHorizontal:
|
|
626
|
-
paddingVertical:
|
|
627
|
-
fontSize:
|
|
628
|
+
borderRadius: 14,
|
|
629
|
+
paddingHorizontal: 20,
|
|
630
|
+
paddingVertical: 16,
|
|
631
|
+
fontSize: 17
|
|
628
632
|
},
|
|
629
633
|
helperText: {
|
|
630
|
-
fontSize:
|
|
634
|
+
fontSize: 13
|
|
631
635
|
}
|
|
632
636
|
});
|
|
633
637
|
function Checkbox({
|
|
@@ -687,31 +691,31 @@ var styles12 = StyleSheet.create({
|
|
|
687
691
|
row: {
|
|
688
692
|
flexDirection: "row",
|
|
689
693
|
alignItems: "center",
|
|
690
|
-
gap:
|
|
694
|
+
gap: 12
|
|
691
695
|
},
|
|
692
696
|
box: {
|
|
693
|
-
width:
|
|
694
|
-
height:
|
|
695
|
-
borderRadius:
|
|
697
|
+
width: 28,
|
|
698
|
+
height: 28,
|
|
699
|
+
borderRadius: 8,
|
|
696
700
|
borderWidth: 1.5,
|
|
697
701
|
alignItems: "center",
|
|
698
702
|
justifyContent: "center"
|
|
699
703
|
},
|
|
700
704
|
checkmark: {
|
|
701
|
-
width:
|
|
702
|
-
height:
|
|
705
|
+
width: 15,
|
|
706
|
+
height: 9,
|
|
703
707
|
borderLeftWidth: 2,
|
|
704
708
|
borderBottomWidth: 2,
|
|
705
709
|
transform: [{ rotate: "-45deg" }, { translateY: -1 }]
|
|
706
710
|
},
|
|
707
711
|
label: {
|
|
708
|
-
fontSize:
|
|
709
|
-
lineHeight:
|
|
712
|
+
fontSize: 15,
|
|
713
|
+
lineHeight: 22
|
|
710
714
|
}
|
|
711
715
|
});
|
|
712
|
-
var TRACK_WIDTH =
|
|
713
|
-
var TRACK_HEIGHT =
|
|
714
|
-
var THUMB_SIZE =
|
|
716
|
+
var TRACK_WIDTH = 60;
|
|
717
|
+
var TRACK_HEIGHT = 36;
|
|
718
|
+
var THUMB_SIZE = 28;
|
|
715
719
|
var THUMB_OFFSET = 4;
|
|
716
720
|
var THUMB_TRAVEL = TRACK_WIDTH - THUMB_SIZE - THUMB_OFFSET * 2;
|
|
717
721
|
function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
@@ -764,11 +768,14 @@ var styles13 = StyleSheet.create({
|
|
|
764
768
|
track: {
|
|
765
769
|
width: TRACK_WIDTH,
|
|
766
770
|
height: TRACK_HEIGHT,
|
|
767
|
-
borderRadius: TRACK_HEIGHT / 2
|
|
768
|
-
justifyContent
|
|
769
|
-
|
|
771
|
+
borderRadius: TRACK_HEIGHT / 2
|
|
772
|
+
// No justifyContent/alignItems — thumb uses absolute positioning
|
|
773
|
+
// so the track's flex layout doesn't interfere with translateX animation
|
|
770
774
|
},
|
|
771
775
|
thumb: {
|
|
776
|
+
position: "absolute",
|
|
777
|
+
top: THUMB_OFFSET,
|
|
778
|
+
left: THUMB_OFFSET,
|
|
772
779
|
width: THUMB_SIZE,
|
|
773
780
|
height: THUMB_SIZE,
|
|
774
781
|
borderRadius: THUMB_SIZE / 2,
|
|
@@ -791,12 +798,22 @@ function Toggle({
|
|
|
791
798
|
size = "md",
|
|
792
799
|
label,
|
|
793
800
|
icon,
|
|
801
|
+
activeIcon,
|
|
794
802
|
disabled,
|
|
795
803
|
style,
|
|
796
804
|
...props
|
|
797
805
|
}) {
|
|
798
806
|
const { colors } = useTheme();
|
|
799
807
|
const scale = useRef(new Animated.Value(1)).current;
|
|
808
|
+
const pressAnim = useRef(new Animated.Value(pressed ? 1 : 0)).current;
|
|
809
|
+
useEffect(() => {
|
|
810
|
+
Animated.timing(pressAnim, {
|
|
811
|
+
toValue: pressed ? 1 : 0,
|
|
812
|
+
duration: 150,
|
|
813
|
+
easing: Easing.out(Easing.ease),
|
|
814
|
+
useNativeDriver: false
|
|
815
|
+
}).start();
|
|
816
|
+
}, [pressed, pressAnim]);
|
|
800
817
|
const handlePressIn = () => {
|
|
801
818
|
if (disabled) return;
|
|
802
819
|
Animated.spring(scale, { toValue: 0.95, useNativeDriver: true, speed: 40, bounciness: 0 }).start();
|
|
@@ -804,34 +821,71 @@ function Toggle({
|
|
|
804
821
|
const handlePressOut = () => {
|
|
805
822
|
Animated.spring(scale, { toValue: 1, useNativeDriver: true, speed: 40, bounciness: 4 }).start();
|
|
806
823
|
};
|
|
807
|
-
const
|
|
808
|
-
|
|
824
|
+
const borderColor = pressAnim.interpolate({
|
|
825
|
+
inputRange: [0, 1],
|
|
826
|
+
outputRange: [variant === "outline" ? colors.border : "transparent", colors.primary]
|
|
827
|
+
});
|
|
828
|
+
const backgroundColor = pressAnim.interpolate({
|
|
829
|
+
inputRange: [0, 1],
|
|
830
|
+
outputRange: ["transparent", colors.accent]
|
|
831
|
+
});
|
|
832
|
+
const textColor = pressAnim.interpolate({
|
|
833
|
+
inputRange: [0, 1],
|
|
834
|
+
outputRange: [colors.foreground, colors.primary]
|
|
835
|
+
});
|
|
836
|
+
const LeftIcon = () => {
|
|
837
|
+
const renderProp = (prop) => {
|
|
838
|
+
if (!prop) return null;
|
|
839
|
+
if (typeof prop === "function") return prop(pressed);
|
|
840
|
+
return prop;
|
|
841
|
+
};
|
|
842
|
+
if (!pressed) return renderProp(icon);
|
|
843
|
+
const active = renderProp(activeIcon);
|
|
844
|
+
if (active) return /* @__PURE__ */ React23.createElement(React23.Fragment, null, active);
|
|
845
|
+
return /* @__PURE__ */ React23.createElement(View, { style: [styles14.checkContainer, { borderColor: colors.primary }] }, /* @__PURE__ */ React23.createElement(Text, { style: [styles14.checkMark, { color: colors.primary }] }, "\u2713"));
|
|
846
|
+
};
|
|
809
847
|
return /* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23.createElement(
|
|
810
|
-
|
|
848
|
+
Animated.View,
|
|
811
849
|
{
|
|
812
|
-
style: [
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
disabled,
|
|
820
|
-
activeOpacity: 1,
|
|
821
|
-
touchSoundDisabled: true,
|
|
822
|
-
...props
|
|
850
|
+
style: [
|
|
851
|
+
styles14.base,
|
|
852
|
+
sizeStyles[size],
|
|
853
|
+
{ borderColor, backgroundColor, borderWidth: 2 },
|
|
854
|
+
disabled && styles14.disabled,
|
|
855
|
+
style
|
|
856
|
+
]
|
|
823
857
|
},
|
|
824
|
-
|
|
825
|
-
|
|
858
|
+
/* @__PURE__ */ React23.createElement(
|
|
859
|
+
TouchableOpacity,
|
|
860
|
+
{
|
|
861
|
+
style: styles14.touchable,
|
|
862
|
+
onPress: () => {
|
|
863
|
+
Haptics11.selectionAsync();
|
|
864
|
+
onPressedChange?.(!pressed);
|
|
865
|
+
},
|
|
866
|
+
onPressIn: handlePressIn,
|
|
867
|
+
onPressOut: handlePressOut,
|
|
868
|
+
disabled,
|
|
869
|
+
activeOpacity: 1,
|
|
870
|
+
touchSoundDisabled: true,
|
|
871
|
+
...props
|
|
872
|
+
},
|
|
873
|
+
/* @__PURE__ */ React23.createElement(LeftIcon, null),
|
|
874
|
+
label ? /* @__PURE__ */ React23.createElement(Animated.Text, { style: [styles14.label, { color: textColor }] }, label) : null
|
|
875
|
+
)
|
|
826
876
|
));
|
|
827
877
|
}
|
|
828
878
|
var styles14 = StyleSheet.create({
|
|
829
879
|
base: {
|
|
830
880
|
borderRadius: 8,
|
|
881
|
+
overflow: "hidden"
|
|
882
|
+
},
|
|
883
|
+
touchable: {
|
|
831
884
|
flexDirection: "row",
|
|
832
885
|
alignItems: "center",
|
|
833
886
|
justifyContent: "center",
|
|
834
|
-
gap: 8
|
|
887
|
+
gap: 8,
|
|
888
|
+
flex: 1
|
|
835
889
|
},
|
|
836
890
|
disabled: {
|
|
837
891
|
opacity: 0.45
|
|
@@ -839,6 +893,18 @@ var styles14 = StyleSheet.create({
|
|
|
839
893
|
label: {
|
|
840
894
|
fontSize: 14,
|
|
841
895
|
fontWeight: "500"
|
|
896
|
+
},
|
|
897
|
+
checkContainer: {
|
|
898
|
+
width: 24,
|
|
899
|
+
height: 24,
|
|
900
|
+
borderRadius: 12,
|
|
901
|
+
borderWidth: 2,
|
|
902
|
+
alignItems: "center",
|
|
903
|
+
justifyContent: "center"
|
|
904
|
+
},
|
|
905
|
+
checkMark: {
|
|
906
|
+
fontSize: 14,
|
|
907
|
+
fontWeight: "700"
|
|
842
908
|
}
|
|
843
909
|
});
|
|
844
910
|
function RadioItem({
|
|
@@ -969,7 +1035,7 @@ function TabTrigger({
|
|
|
969
1035
|
activeOpacity: 1,
|
|
970
1036
|
touchSoundDisabled: true
|
|
971
1037
|
},
|
|
972
|
-
/* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23.createElement(
|
|
1038
|
+
/* @__PURE__ */ React23.createElement(Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23.createElement(View, { style: styles16.triggerInner }, tab.icon ? /* @__PURE__ */ React23.createElement(View, { style: styles16.triggerIcon }, typeof tab.icon === "function" ? tab.icon(isActive) : tab.icon) : null, /* @__PURE__ */ React23.createElement(
|
|
973
1039
|
Text,
|
|
974
1040
|
{
|
|
975
1041
|
style: [
|
|
@@ -979,7 +1045,7 @@ function TabTrigger({
|
|
|
979
1045
|
]
|
|
980
1046
|
},
|
|
981
1047
|
tab.label
|
|
982
|
-
))
|
|
1048
|
+
)))
|
|
983
1049
|
);
|
|
984
1050
|
}
|
|
985
1051
|
function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
@@ -1035,7 +1101,7 @@ function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
|
1035
1101
|
bottom: 4,
|
|
1036
1102
|
left: pillX,
|
|
1037
1103
|
width: pillWidth,
|
|
1038
|
-
borderRadius:
|
|
1104
|
+
borderRadius: 8,
|
|
1039
1105
|
shadowColor: "#000",
|
|
1040
1106
|
shadowOffset: { width: 0, height: 1 },
|
|
1041
1107
|
shadowOpacity: 0.1,
|
|
@@ -1069,22 +1135,33 @@ function TabsContent({ value, activeValue, children, style }) {
|
|
|
1069
1135
|
var styles16 = StyleSheet.create({
|
|
1070
1136
|
list: {
|
|
1071
1137
|
flexDirection: "row",
|
|
1072
|
-
borderRadius:
|
|
1138
|
+
borderRadius: 12,
|
|
1073
1139
|
padding: 4,
|
|
1074
1140
|
gap: 4
|
|
1075
1141
|
},
|
|
1076
1142
|
pill: {},
|
|
1077
1143
|
trigger: {
|
|
1078
1144
|
flex: 1,
|
|
1079
|
-
paddingVertical:
|
|
1080
|
-
paddingHorizontal:
|
|
1081
|
-
borderRadius:
|
|
1145
|
+
paddingVertical: 12,
|
|
1146
|
+
paddingHorizontal: 16,
|
|
1147
|
+
borderRadius: 8,
|
|
1082
1148
|
alignItems: "center",
|
|
1083
1149
|
justifyContent: "center",
|
|
1084
1150
|
zIndex: 1
|
|
1085
1151
|
},
|
|
1152
|
+
triggerInner: {
|
|
1153
|
+
flexDirection: "row",
|
|
1154
|
+
alignItems: "center",
|
|
1155
|
+
justifyContent: "center",
|
|
1156
|
+
gap: 8
|
|
1157
|
+
},
|
|
1158
|
+
triggerIcon: {
|
|
1159
|
+
marginRight: 6,
|
|
1160
|
+
alignItems: "center",
|
|
1161
|
+
justifyContent: "center"
|
|
1162
|
+
},
|
|
1086
1163
|
triggerLabel: {
|
|
1087
|
-
fontSize:
|
|
1164
|
+
fontSize: 15,
|
|
1088
1165
|
fontWeight: "400"
|
|
1089
1166
|
},
|
|
1090
1167
|
activeTriggerLabel: {
|
|
@@ -1102,7 +1179,7 @@ function AccordionItemComponent({
|
|
|
1102
1179
|
const contentHeight = useRef(0);
|
|
1103
1180
|
const scale = useRef(new Animated.Value(1)).current;
|
|
1104
1181
|
const toggle = (open) => {
|
|
1105
|
-
const easing = open ? Easing.out(Easing.ease) : Easing.in(Easing.ease);
|
|
1182
|
+
const easing = open ? Easing$1.out(Easing$1.ease) : Easing$1.in(Easing$1.ease);
|
|
1106
1183
|
animatedHeight.value = withTiming(open ? contentHeight.current : 0, { duration: 220, easing });
|
|
1107
1184
|
animatedRotation.value = withTiming(open ? 1 : 0, { duration: 220, easing });
|
|
1108
1185
|
};
|
|
@@ -1183,19 +1260,19 @@ var styles17 = StyleSheet.create({
|
|
|
1183
1260
|
flexDirection: "row",
|
|
1184
1261
|
justifyContent: "space-between",
|
|
1185
1262
|
alignItems: "center",
|
|
1186
|
-
paddingVertical:
|
|
1263
|
+
paddingVertical: 20
|
|
1187
1264
|
},
|
|
1188
1265
|
triggerText: {
|
|
1189
|
-
fontSize:
|
|
1266
|
+
fontSize: 17,
|
|
1190
1267
|
fontWeight: "500",
|
|
1191
1268
|
flex: 1
|
|
1192
1269
|
},
|
|
1193
1270
|
chevron: {
|
|
1194
|
-
fontSize:
|
|
1271
|
+
fontSize: 18,
|
|
1195
1272
|
marginLeft: 8
|
|
1196
1273
|
},
|
|
1197
1274
|
content: {
|
|
1198
|
-
paddingBottom:
|
|
1275
|
+
paddingBottom: 20,
|
|
1199
1276
|
position: "absolute",
|
|
1200
1277
|
width: "100%"
|
|
1201
1278
|
}
|
|
@@ -1504,10 +1581,10 @@ function Select({
|
|
|
1504
1581
|
}
|
|
1505
1582
|
var styles20 = StyleSheet.create({
|
|
1506
1583
|
container: {
|
|
1507
|
-
gap:
|
|
1584
|
+
gap: 6
|
|
1508
1585
|
},
|
|
1509
1586
|
label: {
|
|
1510
|
-
fontSize:
|
|
1587
|
+
fontSize: 15,
|
|
1511
1588
|
fontWeight: "500",
|
|
1512
1589
|
marginBottom: 2
|
|
1513
1590
|
},
|
|
@@ -1516,24 +1593,24 @@ var styles20 = StyleSheet.create({
|
|
|
1516
1593
|
alignItems: "center",
|
|
1517
1594
|
justifyContent: "space-between",
|
|
1518
1595
|
borderWidth: 1.5,
|
|
1519
|
-
borderRadius:
|
|
1520
|
-
paddingHorizontal:
|
|
1521
|
-
paddingVertical:
|
|
1596
|
+
borderRadius: 14,
|
|
1597
|
+
paddingHorizontal: 20,
|
|
1598
|
+
paddingVertical: 16
|
|
1522
1599
|
},
|
|
1523
1600
|
triggerText: {
|
|
1524
|
-
fontSize:
|
|
1601
|
+
fontSize: 17,
|
|
1525
1602
|
flex: 1
|
|
1526
1603
|
},
|
|
1527
1604
|
chevron: {
|
|
1528
|
-
fontSize:
|
|
1605
|
+
fontSize: 16,
|
|
1529
1606
|
marginLeft: 8
|
|
1530
1607
|
},
|
|
1531
1608
|
helperText: {
|
|
1532
|
-
fontSize:
|
|
1609
|
+
fontSize: 13
|
|
1533
1610
|
},
|
|
1534
1611
|
sheetBackground: {
|
|
1535
|
-
borderTopLeftRadius:
|
|
1536
|
-
borderTopRightRadius:
|
|
1612
|
+
borderTopLeftRadius: 24,
|
|
1613
|
+
borderTopRightRadius: 24
|
|
1537
1614
|
},
|
|
1538
1615
|
sheetHandle: {
|
|
1539
1616
|
width: 36,
|
|
@@ -1541,32 +1618,32 @@ var styles20 = StyleSheet.create({
|
|
|
1541
1618
|
borderRadius: 2
|
|
1542
1619
|
},
|
|
1543
1620
|
sheetContent: {
|
|
1544
|
-
paddingHorizontal:
|
|
1545
|
-
paddingBottom:
|
|
1621
|
+
paddingHorizontal: 20,
|
|
1622
|
+
paddingBottom: 36
|
|
1546
1623
|
},
|
|
1547
1624
|
sheetTitle: {
|
|
1548
|
-
fontSize:
|
|
1625
|
+
fontSize: 17,
|
|
1549
1626
|
fontWeight: "600",
|
|
1550
|
-
paddingVertical:
|
|
1627
|
+
paddingVertical: 16,
|
|
1551
1628
|
paddingHorizontal: 4
|
|
1552
1629
|
},
|
|
1553
1630
|
option: {
|
|
1554
1631
|
flexDirection: "row",
|
|
1555
1632
|
alignItems: "center",
|
|
1556
1633
|
justifyContent: "space-between",
|
|
1557
|
-
paddingHorizontal:
|
|
1558
|
-
paddingVertical:
|
|
1559
|
-
borderRadius:
|
|
1634
|
+
paddingHorizontal: 16,
|
|
1635
|
+
paddingVertical: 16,
|
|
1636
|
+
borderRadius: 12
|
|
1560
1637
|
},
|
|
1561
1638
|
optionText: {
|
|
1562
|
-
fontSize:
|
|
1639
|
+
fontSize: 17,
|
|
1563
1640
|
flex: 1
|
|
1564
1641
|
},
|
|
1565
1642
|
disabledOption: {
|
|
1566
1643
|
opacity: 0.45
|
|
1567
1644
|
},
|
|
1568
1645
|
checkmark: {
|
|
1569
|
-
fontSize:
|
|
1646
|
+
fontSize: 16,
|
|
1570
1647
|
fontWeight: "600",
|
|
1571
1648
|
marginLeft: 8
|
|
1572
1649
|
}
|
|
@@ -1588,7 +1665,7 @@ function ToastNotification({ item, onDismiss }) {
|
|
|
1588
1665
|
const translateX = useSharedValue(0);
|
|
1589
1666
|
const opacity = useSharedValue(0);
|
|
1590
1667
|
useEffect(() => {
|
|
1591
|
-
translateY.value = withTiming(0, { duration: 120, easing: Easing.out(Easing.exp) });
|
|
1668
|
+
translateY.value = withTiming(0, { duration: 120, easing: Easing$1.out(Easing$1.exp) });
|
|
1592
1669
|
opacity.value = withTiming(1, { duration: 100 });
|
|
1593
1670
|
const timer = setTimeout(() => {
|
|
1594
1671
|
translateY.value = withTiming(-80, { duration: 200 });
|
|
@@ -1626,7 +1703,8 @@ function ToastNotification({ item, onDismiss }) {
|
|
|
1626
1703
|
destructive: colors.destructiveForeground,
|
|
1627
1704
|
success: colors.successForeground
|
|
1628
1705
|
}[item.variant ?? "default"];
|
|
1629
|
-
|
|
1706
|
+
const leftIcon = item.icon ?? /* @__PURE__ */ React23.createElement(Text, { style: [styles21.defaultIcon, { color: textColor }] }, item.variant === "success" ? "\u2713" : item.variant === "destructive" ? "\u2716" : "\u2139");
|
|
1707
|
+
return /* @__PURE__ */ React23.createElement(GestureDetector, { gesture: panGesture }, /* @__PURE__ */ React23.createElement(ReanimatedAnimated.View, { style: [styles21.toast, { backgroundColor: bgColor }, animatedStyle] }, /* @__PURE__ */ React23.createElement(View, { style: styles21.leftIconContainer }, leftIcon), /* @__PURE__ */ React23.createElement(View, { style: styles21.toastContent }, item.title ? /* @__PURE__ */ React23.createElement(Text, { style: [styles21.toastTitle, { color: textColor }] }, item.title) : null, item.description ? /* @__PURE__ */ React23.createElement(Text, { style: [styles21.toastDescription, { color: textColor, opacity: 0.85 }] }, item.description) : null), /* @__PURE__ */ React23.createElement(TouchableOpacity, { onPress: onDismiss, style: styles21.dismissButton, touchSoundDisabled: true }, /* @__PURE__ */ React23.createElement(Text, { style: [styles21.dismissIcon, { color: textColor }] }, "\u2715"))));
|
|
1630
1708
|
}
|
|
1631
1709
|
function ToastProvider({ children }) {
|
|
1632
1710
|
const [toasts, setToasts] = useState([]);
|
|
@@ -1658,9 +1736,9 @@ var styles21 = StyleSheet.create({
|
|
|
1658
1736
|
toast: {
|
|
1659
1737
|
flexDirection: "row",
|
|
1660
1738
|
alignItems: "center",
|
|
1661
|
-
borderRadius:
|
|
1662
|
-
paddingHorizontal:
|
|
1663
|
-
paddingVertical:
|
|
1739
|
+
borderRadius: 16,
|
|
1740
|
+
paddingHorizontal: 20,
|
|
1741
|
+
paddingVertical: 14,
|
|
1664
1742
|
shadowColor: "#000",
|
|
1665
1743
|
shadowOffset: { width: 0, height: 4 },
|
|
1666
1744
|
shadowOpacity: 0.15,
|
|
@@ -1671,19 +1749,29 @@ var styles21 = StyleSheet.create({
|
|
|
1671
1749
|
flex: 1,
|
|
1672
1750
|
gap: 4
|
|
1673
1751
|
},
|
|
1752
|
+
leftIconContainer: {
|
|
1753
|
+
width: 36,
|
|
1754
|
+
alignItems: "center",
|
|
1755
|
+
justifyContent: "center",
|
|
1756
|
+
marginRight: 8
|
|
1757
|
+
},
|
|
1758
|
+
defaultIcon: {
|
|
1759
|
+
fontSize: 22,
|
|
1760
|
+
fontWeight: "700"
|
|
1761
|
+
},
|
|
1674
1762
|
toastTitle: {
|
|
1675
|
-
fontSize:
|
|
1763
|
+
fontSize: 15,
|
|
1676
1764
|
fontWeight: "600"
|
|
1677
1765
|
},
|
|
1678
1766
|
toastDescription: {
|
|
1679
|
-
fontSize:
|
|
1767
|
+
fontSize: 14
|
|
1680
1768
|
},
|
|
1681
1769
|
dismissButton: {
|
|
1682
1770
|
padding: 12,
|
|
1683
1771
|
marginLeft: 4
|
|
1684
1772
|
},
|
|
1685
1773
|
dismissIcon: {
|
|
1686
|
-
fontSize:
|
|
1774
|
+
fontSize: 14
|
|
1687
1775
|
}
|
|
1688
1776
|
});
|
|
1689
1777
|
function formatCurrency(raw, separator) {
|
|
@@ -1728,5 +1816,72 @@ function CurrencyInput({
|
|
|
1728
1816
|
}
|
|
1729
1817
|
);
|
|
1730
1818
|
}
|
|
1819
|
+
function formatValue(value, prefix, showDecimals) {
|
|
1820
|
+
const num = typeof value === "string" ? parseFloat(value.replace(/[^0-9.-]/g, "")) : value;
|
|
1821
|
+
if (isNaN(num)) return `${prefix}0`;
|
|
1822
|
+
const abs = Math.abs(num);
|
|
1823
|
+
const sign = num < 0 ? "-" : "";
|
|
1824
|
+
const intPart = Math.floor(abs).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
1825
|
+
if (showDecimals) {
|
|
1826
|
+
const decStr = (abs % 1).toFixed(2).slice(2);
|
|
1827
|
+
return `${sign}${prefix}${intPart},${decStr}`;
|
|
1828
|
+
}
|
|
1829
|
+
return `${sign}${prefix}${intPart}`;
|
|
1830
|
+
}
|
|
1831
|
+
function CurrencyDisplay({ value, prefix = "$", showDecimals = false, style }) {
|
|
1832
|
+
const { colors } = useTheme();
|
|
1833
|
+
const formatted = formatValue(value, prefix, showDecimals);
|
|
1834
|
+
return /* @__PURE__ */ React23.createElement(View, { style: [styles22.container, style] }, /* @__PURE__ */ React23.createElement(Text, { style: [styles22.amount, { color: colors.foreground }], allowFontScaling: true }, formatted));
|
|
1835
|
+
}
|
|
1836
|
+
var styles22 = StyleSheet.create({
|
|
1837
|
+
container: {},
|
|
1838
|
+
amount: {
|
|
1839
|
+
fontSize: 56,
|
|
1840
|
+
fontWeight: "700"
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
function formatCurrency2(raw, separator) {
|
|
1844
|
+
const digits = raw.replace(/\D/g, "");
|
|
1845
|
+
if (!digits) return "";
|
|
1846
|
+
return digits.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
1847
|
+
}
|
|
1848
|
+
function CurrencyInputLarge({
|
|
1849
|
+
value,
|
|
1850
|
+
onChangeText,
|
|
1851
|
+
onChangeValue,
|
|
1852
|
+
prefix = "$",
|
|
1853
|
+
thousandsSeparator = ".",
|
|
1854
|
+
label,
|
|
1855
|
+
error,
|
|
1856
|
+
hint,
|
|
1857
|
+
placeholder,
|
|
1858
|
+
editable,
|
|
1859
|
+
containerStyle
|
|
1860
|
+
}) {
|
|
1861
|
+
const handleChange = (text) => {
|
|
1862
|
+
const withoutPrefix = prefix && text.startsWith(prefix) ? text.slice(prefix.length) : text;
|
|
1863
|
+
const formatted = formatCurrency2(withoutPrefix, thousandsSeparator);
|
|
1864
|
+
const display = formatted ? `${prefix}${formatted}` : "";
|
|
1865
|
+
onChangeText?.(display);
|
|
1866
|
+
const separatorRegex = new RegExp(`\\${thousandsSeparator}`, "g");
|
|
1867
|
+
const raw = parseFloat(formatted.replace(separatorRegex, "") || "0");
|
|
1868
|
+
onChangeValue?.(isNaN(raw) ? 0 : raw);
|
|
1869
|
+
};
|
|
1870
|
+
return /* @__PURE__ */ React23.createElement(
|
|
1871
|
+
Input,
|
|
1872
|
+
{
|
|
1873
|
+
value,
|
|
1874
|
+
onChangeText: handleChange,
|
|
1875
|
+
keyboardType: "numeric",
|
|
1876
|
+
label,
|
|
1877
|
+
error,
|
|
1878
|
+
hint,
|
|
1879
|
+
placeholder: placeholder ?? `${prefix}0`,
|
|
1880
|
+
editable,
|
|
1881
|
+
containerStyle,
|
|
1882
|
+
style: { fontSize: 36 }
|
|
1883
|
+
}
|
|
1884
|
+
);
|
|
1885
|
+
}
|
|
1731
1886
|
|
|
1732
|
-
export { Accordion, Alert, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CurrencyInput, EmptyState, Input, Progress, RadioGroup, Select, Separator, Sheet, Skeleton, Slider, Spinner, Switch, Tabs, TabsContent, Text2 as Text, Textarea, ThemeProvider, ToastProvider, Toggle, defaultDark, defaultLight, useTheme, useToast };
|
|
1887
|
+
export { Accordion, Alert, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CurrencyDisplay, CurrencyInput, CurrencyInputLarge, EmptyState, Input, Progress, RadioGroup, Select, Separator, Sheet, Skeleton, Slider, Spinner, Switch, Tabs, TabsContent, Text2 as Text, Textarea, ThemeProvider, ToastProvider, Toggle, defaultDark, defaultLight, useTheme, useToast };
|