@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.js
CHANGED
|
@@ -99,13 +99,13 @@ function useTheme() {
|
|
|
99
99
|
return React23.useContext(ThemeContext);
|
|
100
100
|
}
|
|
101
101
|
var containerSizeStyles = {
|
|
102
|
-
sm: { paddingHorizontal:
|
|
103
|
-
md: { paddingHorizontal:
|
|
104
|
-
lg: { paddingHorizontal:
|
|
102
|
+
sm: { paddingHorizontal: 20, paddingVertical: 12 },
|
|
103
|
+
md: { paddingHorizontal: 24, paddingVertical: 16 },
|
|
104
|
+
lg: { paddingHorizontal: 32, paddingVertical: 20 }
|
|
105
105
|
};
|
|
106
106
|
var labelSizeStyles = {
|
|
107
|
-
sm: { fontSize:
|
|
108
|
-
md: { fontSize:
|
|
107
|
+
sm: { fontSize: 15 },
|
|
108
|
+
md: { fontSize: 17 },
|
|
109
109
|
lg: { fontSize: 18 }
|
|
110
110
|
};
|
|
111
111
|
function Button({
|
|
@@ -172,12 +172,12 @@ function Button({
|
|
|
172
172
|
onPressOut: handlePressOut,
|
|
173
173
|
...props
|
|
174
174
|
},
|
|
175
|
-
loading ? /* @__PURE__ */ React23__default.default.createElement(reactNative.ActivityIndicator, { size: "small", color: spinnerColor }) : /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, icon && iconPosition === "left" && /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, icon), /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles.label, labelVariantStyle, labelSizeStyles[size], icon ? styles.labelWithIcon : void 0] }, label), icon && iconPosition === "right" && /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, icon))
|
|
175
|
+
loading ? /* @__PURE__ */ React23__default.default.createElement(reactNative.ActivityIndicator, { size: "small", color: spinnerColor }) : /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, icon && iconPosition === "left" && /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, typeof icon === "function" ? icon({ label, size, variant }) : icon), /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles.label, labelVariantStyle, labelSizeStyles[size], icon ? styles.labelWithIcon : void 0] }, label), icon && iconPosition === "right" && /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, typeof icon === "function" ? icon({ label, size, variant }) : icon))
|
|
176
176
|
));
|
|
177
177
|
}
|
|
178
178
|
var styles = reactNative.StyleSheet.create({
|
|
179
179
|
base: {
|
|
180
|
-
borderRadius:
|
|
180
|
+
borderRadius: 999,
|
|
181
181
|
alignItems: "center",
|
|
182
182
|
justifyContent: "center",
|
|
183
183
|
flexDirection: "row"
|
|
@@ -196,12 +196,12 @@ var styles = reactNative.StyleSheet.create({
|
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
198
|
var variantStyles = {
|
|
199
|
-
h1: { fontSize:
|
|
200
|
-
h2: { fontSize:
|
|
201
|
-
h3: { fontSize:
|
|
202
|
-
body: { fontSize:
|
|
203
|
-
caption: { fontSize:
|
|
204
|
-
label: { fontSize:
|
|
199
|
+
h1: { fontSize: 40, fontWeight: "700", lineHeight: 52 },
|
|
200
|
+
h2: { fontSize: 28, fontWeight: "700", lineHeight: 36 },
|
|
201
|
+
h3: { fontSize: 22, fontWeight: "600", lineHeight: 30 },
|
|
202
|
+
body: { fontSize: 17, fontWeight: "400", lineHeight: 26 },
|
|
203
|
+
caption: { fontSize: 13, fontWeight: "400", lineHeight: 20 },
|
|
204
|
+
label: { fontSize: 15, fontWeight: "500", lineHeight: 22 }
|
|
205
205
|
};
|
|
206
206
|
function Text2({ variant = "body", color, style, children, ...props }) {
|
|
207
207
|
const { colors } = useTheme();
|
|
@@ -247,22 +247,22 @@ function Input({ label, error, hint, containerStyle, style, onFocus, onBlur, ...
|
|
|
247
247
|
}
|
|
248
248
|
var styles2 = reactNative.StyleSheet.create({
|
|
249
249
|
container: {
|
|
250
|
-
gap:
|
|
250
|
+
gap: 6
|
|
251
251
|
},
|
|
252
252
|
label: {
|
|
253
|
-
fontSize:
|
|
253
|
+
fontSize: 15,
|
|
254
254
|
fontWeight: "500",
|
|
255
|
-
marginBottom:
|
|
255
|
+
marginBottom: 6
|
|
256
256
|
},
|
|
257
257
|
input: {
|
|
258
258
|
borderWidth: 1.5,
|
|
259
|
-
borderRadius:
|
|
260
|
-
paddingHorizontal:
|
|
261
|
-
paddingVertical:
|
|
262
|
-
fontSize:
|
|
259
|
+
borderRadius: 14,
|
|
260
|
+
paddingHorizontal: 20,
|
|
261
|
+
paddingVertical: 16,
|
|
262
|
+
fontSize: 17
|
|
263
263
|
},
|
|
264
264
|
helperText: {
|
|
265
|
-
fontSize:
|
|
265
|
+
fontSize: 13
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
268
|
function Badge({ label, variant = "default", style }) {
|
|
@@ -283,13 +283,13 @@ function Badge({ label, variant = "default", style }) {
|
|
|
283
283
|
}
|
|
284
284
|
var styles3 = reactNative.StyleSheet.create({
|
|
285
285
|
container: {
|
|
286
|
-
borderRadius:
|
|
287
|
-
paddingHorizontal:
|
|
288
|
-
paddingVertical:
|
|
286
|
+
borderRadius: 8,
|
|
287
|
+
paddingHorizontal: 10,
|
|
288
|
+
paddingVertical: 4,
|
|
289
289
|
alignSelf: "flex-start"
|
|
290
290
|
},
|
|
291
291
|
label: {
|
|
292
|
-
fontSize:
|
|
292
|
+
fontSize: 13,
|
|
293
293
|
fontWeight: "500"
|
|
294
294
|
}
|
|
295
295
|
});
|
|
@@ -322,7 +322,7 @@ function CardFooter({ children, style }) {
|
|
|
322
322
|
}
|
|
323
323
|
var styles4 = reactNative.StyleSheet.create({
|
|
324
324
|
card: {
|
|
325
|
-
borderRadius:
|
|
325
|
+
borderRadius: 20,
|
|
326
326
|
borderWidth: 1,
|
|
327
327
|
shadowColor: "#000",
|
|
328
328
|
shadowOffset: { width: 0, height: 1 },
|
|
@@ -331,24 +331,24 @@ var styles4 = reactNative.StyleSheet.create({
|
|
|
331
331
|
elevation: 1
|
|
332
332
|
},
|
|
333
333
|
header: {
|
|
334
|
-
padding:
|
|
334
|
+
padding: 28,
|
|
335
335
|
paddingBottom: 0,
|
|
336
|
-
gap:
|
|
336
|
+
gap: 8
|
|
337
337
|
},
|
|
338
338
|
title: {
|
|
339
|
-
fontSize:
|
|
339
|
+
fontSize: 20,
|
|
340
340
|
fontWeight: "600",
|
|
341
|
-
lineHeight:
|
|
341
|
+
lineHeight: 28
|
|
342
342
|
},
|
|
343
343
|
description: {
|
|
344
|
-
fontSize:
|
|
345
|
-
lineHeight:
|
|
344
|
+
fontSize: 15,
|
|
345
|
+
lineHeight: 22
|
|
346
346
|
},
|
|
347
347
|
content: {
|
|
348
|
-
padding:
|
|
348
|
+
padding: 28
|
|
349
349
|
},
|
|
350
350
|
footer: {
|
|
351
|
-
padding:
|
|
351
|
+
padding: 28,
|
|
352
352
|
paddingTop: 0,
|
|
353
353
|
flexDirection: "row",
|
|
354
354
|
alignItems: "center"
|
|
@@ -433,16 +433,16 @@ var styles6 = reactNative.StyleSheet.create({
|
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
435
|
var sizeMap2 = {
|
|
436
|
-
sm:
|
|
437
|
-
md:
|
|
438
|
-
lg:
|
|
439
|
-
xl:
|
|
436
|
+
sm: 28,
|
|
437
|
+
md: 40,
|
|
438
|
+
lg: 56,
|
|
439
|
+
xl: 72
|
|
440
440
|
};
|
|
441
441
|
var fontSizeMap = {
|
|
442
|
-
sm:
|
|
443
|
-
md:
|
|
444
|
-
lg:
|
|
445
|
-
xl:
|
|
442
|
+
sm: 12,
|
|
443
|
+
md: 16,
|
|
444
|
+
lg: 22,
|
|
445
|
+
xl: 28
|
|
446
446
|
};
|
|
447
447
|
function Avatar({ src, fallback, size = "md", style }) {
|
|
448
448
|
const { colors } = useTheme();
|
|
@@ -485,7 +485,7 @@ function Alert({ title, description, variant = "default", icon, style }) {
|
|
|
485
485
|
const borderColor = variant === "destructive" ? colors.destructive : colors.border;
|
|
486
486
|
const titleColor = variant === "destructive" ? colors.destructive : colors.foreground;
|
|
487
487
|
const descColor = variant === "destructive" ? colors.destructive : colors.mutedForeground;
|
|
488
|
-
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles8.container, { backgroundColor: colors.card, borderColor }, style] }, icon ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles8.icon }, icon) :
|
|
488
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles8.container, { backgroundColor: colors.card, borderColor }, style] }, icon ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles8.icon }, icon) : /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles8.icon }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles8.defaultIcon, { color: titleColor }] }, variant === "destructive" ? "\u26A0" : "\u2139")), /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles8.content }, title ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles8.title, { color: titleColor }] }, title) : null, description ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles8.description, { color: descColor }] }, description) : null));
|
|
489
489
|
}
|
|
490
490
|
var styles8 = reactNative.StyleSheet.create({
|
|
491
491
|
container: {
|
|
@@ -510,6 +510,10 @@ var styles8 = reactNative.StyleSheet.create({
|
|
|
510
510
|
description: {
|
|
511
511
|
fontSize: 14,
|
|
512
512
|
lineHeight: 20
|
|
513
|
+
},
|
|
514
|
+
defaultIcon: {
|
|
515
|
+
fontSize: 18,
|
|
516
|
+
fontWeight: "700"
|
|
513
517
|
}
|
|
514
518
|
});
|
|
515
519
|
function Progress({ value = 0, max = 100, style }) {
|
|
@@ -617,7 +621,7 @@ function Textarea({
|
|
|
617
621
|
borderColor: error ? colors.destructive : focused ? colors.ring : colors.border,
|
|
618
622
|
color: colors.foreground,
|
|
619
623
|
backgroundColor: colors.background,
|
|
620
|
-
minHeight: rows *
|
|
624
|
+
minHeight: rows * 30
|
|
621
625
|
},
|
|
622
626
|
style
|
|
623
627
|
],
|
|
@@ -637,22 +641,22 @@ function Textarea({
|
|
|
637
641
|
}
|
|
638
642
|
var styles11 = reactNative.StyleSheet.create({
|
|
639
643
|
container: {
|
|
640
|
-
gap:
|
|
644
|
+
gap: 6
|
|
641
645
|
},
|
|
642
646
|
label: {
|
|
643
|
-
fontSize:
|
|
647
|
+
fontSize: 15,
|
|
644
648
|
fontWeight: "500",
|
|
645
|
-
marginBottom:
|
|
649
|
+
marginBottom: 6
|
|
646
650
|
},
|
|
647
651
|
input: {
|
|
648
652
|
borderWidth: 1.5,
|
|
649
|
-
borderRadius:
|
|
650
|
-
paddingHorizontal:
|
|
651
|
-
paddingVertical:
|
|
652
|
-
fontSize:
|
|
653
|
+
borderRadius: 14,
|
|
654
|
+
paddingHorizontal: 20,
|
|
655
|
+
paddingVertical: 16,
|
|
656
|
+
fontSize: 17
|
|
653
657
|
},
|
|
654
658
|
helperText: {
|
|
655
|
-
fontSize:
|
|
659
|
+
fontSize: 13
|
|
656
660
|
}
|
|
657
661
|
});
|
|
658
662
|
function Checkbox({
|
|
@@ -712,31 +716,31 @@ var styles12 = reactNative.StyleSheet.create({
|
|
|
712
716
|
row: {
|
|
713
717
|
flexDirection: "row",
|
|
714
718
|
alignItems: "center",
|
|
715
|
-
gap:
|
|
719
|
+
gap: 12
|
|
716
720
|
},
|
|
717
721
|
box: {
|
|
718
|
-
width:
|
|
719
|
-
height:
|
|
720
|
-
borderRadius:
|
|
722
|
+
width: 28,
|
|
723
|
+
height: 28,
|
|
724
|
+
borderRadius: 8,
|
|
721
725
|
borderWidth: 1.5,
|
|
722
726
|
alignItems: "center",
|
|
723
727
|
justifyContent: "center"
|
|
724
728
|
},
|
|
725
729
|
checkmark: {
|
|
726
|
-
width:
|
|
727
|
-
height:
|
|
730
|
+
width: 15,
|
|
731
|
+
height: 9,
|
|
728
732
|
borderLeftWidth: 2,
|
|
729
733
|
borderBottomWidth: 2,
|
|
730
734
|
transform: [{ rotate: "-45deg" }, { translateY: -1 }]
|
|
731
735
|
},
|
|
732
736
|
label: {
|
|
733
|
-
fontSize:
|
|
734
|
-
lineHeight:
|
|
737
|
+
fontSize: 15,
|
|
738
|
+
lineHeight: 22
|
|
735
739
|
}
|
|
736
740
|
});
|
|
737
|
-
var TRACK_WIDTH =
|
|
738
|
-
var TRACK_HEIGHT =
|
|
739
|
-
var THUMB_SIZE =
|
|
741
|
+
var TRACK_WIDTH = 60;
|
|
742
|
+
var TRACK_HEIGHT = 36;
|
|
743
|
+
var THUMB_SIZE = 28;
|
|
740
744
|
var THUMB_OFFSET = 4;
|
|
741
745
|
var THUMB_TRAVEL = TRACK_WIDTH - THUMB_SIZE - THUMB_OFFSET * 2;
|
|
742
746
|
function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
@@ -789,11 +793,14 @@ var styles13 = reactNative.StyleSheet.create({
|
|
|
789
793
|
track: {
|
|
790
794
|
width: TRACK_WIDTH,
|
|
791
795
|
height: TRACK_HEIGHT,
|
|
792
|
-
borderRadius: TRACK_HEIGHT / 2
|
|
793
|
-
justifyContent
|
|
794
|
-
|
|
796
|
+
borderRadius: TRACK_HEIGHT / 2
|
|
797
|
+
// No justifyContent/alignItems — thumb uses absolute positioning
|
|
798
|
+
// so the track's flex layout doesn't interfere with translateX animation
|
|
795
799
|
},
|
|
796
800
|
thumb: {
|
|
801
|
+
position: "absolute",
|
|
802
|
+
top: THUMB_OFFSET,
|
|
803
|
+
left: THUMB_OFFSET,
|
|
797
804
|
width: THUMB_SIZE,
|
|
798
805
|
height: THUMB_SIZE,
|
|
799
806
|
borderRadius: THUMB_SIZE / 2,
|
|
@@ -816,12 +823,22 @@ function Toggle({
|
|
|
816
823
|
size = "md",
|
|
817
824
|
label,
|
|
818
825
|
icon,
|
|
826
|
+
activeIcon,
|
|
819
827
|
disabled,
|
|
820
828
|
style,
|
|
821
829
|
...props
|
|
822
830
|
}) {
|
|
823
831
|
const { colors } = useTheme();
|
|
824
832
|
const scale = React23.useRef(new reactNative.Animated.Value(1)).current;
|
|
833
|
+
const pressAnim = React23.useRef(new reactNative.Animated.Value(pressed ? 1 : 0)).current;
|
|
834
|
+
React23.useEffect(() => {
|
|
835
|
+
reactNative.Animated.timing(pressAnim, {
|
|
836
|
+
toValue: pressed ? 1 : 0,
|
|
837
|
+
duration: 150,
|
|
838
|
+
easing: reactNative.Easing.out(reactNative.Easing.ease),
|
|
839
|
+
useNativeDriver: false
|
|
840
|
+
}).start();
|
|
841
|
+
}, [pressed, pressAnim]);
|
|
825
842
|
const handlePressIn = () => {
|
|
826
843
|
if (disabled) return;
|
|
827
844
|
reactNative.Animated.spring(scale, { toValue: 0.95, useNativeDriver: true, speed: 40, bounciness: 0 }).start();
|
|
@@ -829,34 +846,71 @@ function Toggle({
|
|
|
829
846
|
const handlePressOut = () => {
|
|
830
847
|
reactNative.Animated.spring(scale, { toValue: 1, useNativeDriver: true, speed: 40, bounciness: 4 }).start();
|
|
831
848
|
};
|
|
832
|
-
const
|
|
833
|
-
|
|
849
|
+
const borderColor = pressAnim.interpolate({
|
|
850
|
+
inputRange: [0, 1],
|
|
851
|
+
outputRange: [variant === "outline" ? colors.border : "transparent", colors.primary]
|
|
852
|
+
});
|
|
853
|
+
const backgroundColor = pressAnim.interpolate({
|
|
854
|
+
inputRange: [0, 1],
|
|
855
|
+
outputRange: ["transparent", colors.accent]
|
|
856
|
+
});
|
|
857
|
+
const textColor = pressAnim.interpolate({
|
|
858
|
+
inputRange: [0, 1],
|
|
859
|
+
outputRange: [colors.foreground, colors.primary]
|
|
860
|
+
});
|
|
861
|
+
const LeftIcon = () => {
|
|
862
|
+
const renderProp = (prop) => {
|
|
863
|
+
if (!prop) return null;
|
|
864
|
+
if (typeof prop === "function") return prop(pressed);
|
|
865
|
+
return prop;
|
|
866
|
+
};
|
|
867
|
+
if (!pressed) return renderProp(icon);
|
|
868
|
+
const active = renderProp(activeIcon);
|
|
869
|
+
if (active) return /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, active);
|
|
870
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles14.checkContainer, { borderColor: colors.primary }] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles14.checkMark, { color: colors.primary }] }, "\u2713"));
|
|
871
|
+
};
|
|
834
872
|
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23__default.default.createElement(
|
|
835
|
-
reactNative.
|
|
873
|
+
reactNative.Animated.View,
|
|
836
874
|
{
|
|
837
|
-
style: [
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
disabled,
|
|
845
|
-
activeOpacity: 1,
|
|
846
|
-
touchSoundDisabled: true,
|
|
847
|
-
...props
|
|
875
|
+
style: [
|
|
876
|
+
styles14.base,
|
|
877
|
+
sizeStyles[size],
|
|
878
|
+
{ borderColor, backgroundColor, borderWidth: 2 },
|
|
879
|
+
disabled && styles14.disabled,
|
|
880
|
+
style
|
|
881
|
+
]
|
|
848
882
|
},
|
|
849
|
-
|
|
850
|
-
|
|
883
|
+
/* @__PURE__ */ React23__default.default.createElement(
|
|
884
|
+
reactNative.TouchableOpacity,
|
|
885
|
+
{
|
|
886
|
+
style: styles14.touchable,
|
|
887
|
+
onPress: () => {
|
|
888
|
+
Haptics11__namespace.selectionAsync();
|
|
889
|
+
onPressedChange?.(!pressed);
|
|
890
|
+
},
|
|
891
|
+
onPressIn: handlePressIn,
|
|
892
|
+
onPressOut: handlePressOut,
|
|
893
|
+
disabled,
|
|
894
|
+
activeOpacity: 1,
|
|
895
|
+
touchSoundDisabled: true,
|
|
896
|
+
...props
|
|
897
|
+
},
|
|
898
|
+
/* @__PURE__ */ React23__default.default.createElement(LeftIcon, null),
|
|
899
|
+
label ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.Text, { style: [styles14.label, { color: textColor }] }, label) : null
|
|
900
|
+
)
|
|
851
901
|
));
|
|
852
902
|
}
|
|
853
903
|
var styles14 = reactNative.StyleSheet.create({
|
|
854
904
|
base: {
|
|
855
905
|
borderRadius: 8,
|
|
906
|
+
overflow: "hidden"
|
|
907
|
+
},
|
|
908
|
+
touchable: {
|
|
856
909
|
flexDirection: "row",
|
|
857
910
|
alignItems: "center",
|
|
858
911
|
justifyContent: "center",
|
|
859
|
-
gap: 8
|
|
912
|
+
gap: 8,
|
|
913
|
+
flex: 1
|
|
860
914
|
},
|
|
861
915
|
disabled: {
|
|
862
916
|
opacity: 0.45
|
|
@@ -864,6 +918,18 @@ var styles14 = reactNative.StyleSheet.create({
|
|
|
864
918
|
label: {
|
|
865
919
|
fontSize: 14,
|
|
866
920
|
fontWeight: "500"
|
|
921
|
+
},
|
|
922
|
+
checkContainer: {
|
|
923
|
+
width: 24,
|
|
924
|
+
height: 24,
|
|
925
|
+
borderRadius: 12,
|
|
926
|
+
borderWidth: 2,
|
|
927
|
+
alignItems: "center",
|
|
928
|
+
justifyContent: "center"
|
|
929
|
+
},
|
|
930
|
+
checkMark: {
|
|
931
|
+
fontSize: 14,
|
|
932
|
+
fontWeight: "700"
|
|
867
933
|
}
|
|
868
934
|
});
|
|
869
935
|
function RadioItem({
|
|
@@ -994,7 +1060,7 @@ function TabTrigger({
|
|
|
994
1060
|
activeOpacity: 1,
|
|
995
1061
|
touchSoundDisabled: true
|
|
996
1062
|
},
|
|
997
|
-
/* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23__default.default.createElement(
|
|
1063
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles16.triggerInner }, tab.icon ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles16.triggerIcon }, typeof tab.icon === "function" ? tab.icon(isActive) : tab.icon) : null, /* @__PURE__ */ React23__default.default.createElement(
|
|
998
1064
|
reactNative.Text,
|
|
999
1065
|
{
|
|
1000
1066
|
style: [
|
|
@@ -1004,7 +1070,7 @@ function TabTrigger({
|
|
|
1004
1070
|
]
|
|
1005
1071
|
},
|
|
1006
1072
|
tab.label
|
|
1007
|
-
))
|
|
1073
|
+
)))
|
|
1008
1074
|
);
|
|
1009
1075
|
}
|
|
1010
1076
|
function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
@@ -1060,7 +1126,7 @@ function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
|
1060
1126
|
bottom: 4,
|
|
1061
1127
|
left: pillX,
|
|
1062
1128
|
width: pillWidth,
|
|
1063
|
-
borderRadius:
|
|
1129
|
+
borderRadius: 8,
|
|
1064
1130
|
shadowColor: "#000",
|
|
1065
1131
|
shadowOffset: { width: 0, height: 1 },
|
|
1066
1132
|
shadowOpacity: 0.1,
|
|
@@ -1094,22 +1160,33 @@ function TabsContent({ value, activeValue, children, style }) {
|
|
|
1094
1160
|
var styles16 = reactNative.StyleSheet.create({
|
|
1095
1161
|
list: {
|
|
1096
1162
|
flexDirection: "row",
|
|
1097
|
-
borderRadius:
|
|
1163
|
+
borderRadius: 12,
|
|
1098
1164
|
padding: 4,
|
|
1099
1165
|
gap: 4
|
|
1100
1166
|
},
|
|
1101
1167
|
pill: {},
|
|
1102
1168
|
trigger: {
|
|
1103
1169
|
flex: 1,
|
|
1104
|
-
paddingVertical:
|
|
1105
|
-
paddingHorizontal:
|
|
1106
|
-
borderRadius:
|
|
1170
|
+
paddingVertical: 12,
|
|
1171
|
+
paddingHorizontal: 16,
|
|
1172
|
+
borderRadius: 8,
|
|
1107
1173
|
alignItems: "center",
|
|
1108
1174
|
justifyContent: "center",
|
|
1109
1175
|
zIndex: 1
|
|
1110
1176
|
},
|
|
1177
|
+
triggerInner: {
|
|
1178
|
+
flexDirection: "row",
|
|
1179
|
+
alignItems: "center",
|
|
1180
|
+
justifyContent: "center",
|
|
1181
|
+
gap: 8
|
|
1182
|
+
},
|
|
1183
|
+
triggerIcon: {
|
|
1184
|
+
marginRight: 6,
|
|
1185
|
+
alignItems: "center",
|
|
1186
|
+
justifyContent: "center"
|
|
1187
|
+
},
|
|
1111
1188
|
triggerLabel: {
|
|
1112
|
-
fontSize:
|
|
1189
|
+
fontSize: 15,
|
|
1113
1190
|
fontWeight: "400"
|
|
1114
1191
|
},
|
|
1115
1192
|
activeTriggerLabel: {
|
|
@@ -1208,19 +1285,19 @@ var styles17 = reactNative.StyleSheet.create({
|
|
|
1208
1285
|
flexDirection: "row",
|
|
1209
1286
|
justifyContent: "space-between",
|
|
1210
1287
|
alignItems: "center",
|
|
1211
|
-
paddingVertical:
|
|
1288
|
+
paddingVertical: 20
|
|
1212
1289
|
},
|
|
1213
1290
|
triggerText: {
|
|
1214
|
-
fontSize:
|
|
1291
|
+
fontSize: 17,
|
|
1215
1292
|
fontWeight: "500",
|
|
1216
1293
|
flex: 1
|
|
1217
1294
|
},
|
|
1218
1295
|
chevron: {
|
|
1219
|
-
fontSize:
|
|
1296
|
+
fontSize: 18,
|
|
1220
1297
|
marginLeft: 8
|
|
1221
1298
|
},
|
|
1222
1299
|
content: {
|
|
1223
|
-
paddingBottom:
|
|
1300
|
+
paddingBottom: 20,
|
|
1224
1301
|
position: "absolute",
|
|
1225
1302
|
width: "100%"
|
|
1226
1303
|
}
|
|
@@ -1529,10 +1606,10 @@ function Select({
|
|
|
1529
1606
|
}
|
|
1530
1607
|
var styles20 = reactNative.StyleSheet.create({
|
|
1531
1608
|
container: {
|
|
1532
|
-
gap:
|
|
1609
|
+
gap: 6
|
|
1533
1610
|
},
|
|
1534
1611
|
label: {
|
|
1535
|
-
fontSize:
|
|
1612
|
+
fontSize: 15,
|
|
1536
1613
|
fontWeight: "500",
|
|
1537
1614
|
marginBottom: 2
|
|
1538
1615
|
},
|
|
@@ -1541,24 +1618,24 @@ var styles20 = reactNative.StyleSheet.create({
|
|
|
1541
1618
|
alignItems: "center",
|
|
1542
1619
|
justifyContent: "space-between",
|
|
1543
1620
|
borderWidth: 1.5,
|
|
1544
|
-
borderRadius:
|
|
1545
|
-
paddingHorizontal:
|
|
1546
|
-
paddingVertical:
|
|
1621
|
+
borderRadius: 14,
|
|
1622
|
+
paddingHorizontal: 20,
|
|
1623
|
+
paddingVertical: 16
|
|
1547
1624
|
},
|
|
1548
1625
|
triggerText: {
|
|
1549
|
-
fontSize:
|
|
1626
|
+
fontSize: 17,
|
|
1550
1627
|
flex: 1
|
|
1551
1628
|
},
|
|
1552
1629
|
chevron: {
|
|
1553
|
-
fontSize:
|
|
1630
|
+
fontSize: 16,
|
|
1554
1631
|
marginLeft: 8
|
|
1555
1632
|
},
|
|
1556
1633
|
helperText: {
|
|
1557
|
-
fontSize:
|
|
1634
|
+
fontSize: 13
|
|
1558
1635
|
},
|
|
1559
1636
|
sheetBackground: {
|
|
1560
|
-
borderTopLeftRadius:
|
|
1561
|
-
borderTopRightRadius:
|
|
1637
|
+
borderTopLeftRadius: 24,
|
|
1638
|
+
borderTopRightRadius: 24
|
|
1562
1639
|
},
|
|
1563
1640
|
sheetHandle: {
|
|
1564
1641
|
width: 36,
|
|
@@ -1566,32 +1643,32 @@ var styles20 = reactNative.StyleSheet.create({
|
|
|
1566
1643
|
borderRadius: 2
|
|
1567
1644
|
},
|
|
1568
1645
|
sheetContent: {
|
|
1569
|
-
paddingHorizontal:
|
|
1570
|
-
paddingBottom:
|
|
1646
|
+
paddingHorizontal: 20,
|
|
1647
|
+
paddingBottom: 36
|
|
1571
1648
|
},
|
|
1572
1649
|
sheetTitle: {
|
|
1573
|
-
fontSize:
|
|
1650
|
+
fontSize: 17,
|
|
1574
1651
|
fontWeight: "600",
|
|
1575
|
-
paddingVertical:
|
|
1652
|
+
paddingVertical: 16,
|
|
1576
1653
|
paddingHorizontal: 4
|
|
1577
1654
|
},
|
|
1578
1655
|
option: {
|
|
1579
1656
|
flexDirection: "row",
|
|
1580
1657
|
alignItems: "center",
|
|
1581
1658
|
justifyContent: "space-between",
|
|
1582
|
-
paddingHorizontal:
|
|
1583
|
-
paddingVertical:
|
|
1584
|
-
borderRadius:
|
|
1659
|
+
paddingHorizontal: 16,
|
|
1660
|
+
paddingVertical: 16,
|
|
1661
|
+
borderRadius: 12
|
|
1585
1662
|
},
|
|
1586
1663
|
optionText: {
|
|
1587
|
-
fontSize:
|
|
1664
|
+
fontSize: 17,
|
|
1588
1665
|
flex: 1
|
|
1589
1666
|
},
|
|
1590
1667
|
disabledOption: {
|
|
1591
1668
|
opacity: 0.45
|
|
1592
1669
|
},
|
|
1593
1670
|
checkmark: {
|
|
1594
|
-
fontSize:
|
|
1671
|
+
fontSize: 16,
|
|
1595
1672
|
fontWeight: "600",
|
|
1596
1673
|
marginLeft: 8
|
|
1597
1674
|
}
|
|
@@ -1651,7 +1728,8 @@ function ToastNotification({ item, onDismiss }) {
|
|
|
1651
1728
|
destructive: colors.destructiveForeground,
|
|
1652
1729
|
success: colors.successForeground
|
|
1653
1730
|
}[item.variant ?? "default"];
|
|
1654
|
-
|
|
1731
|
+
const leftIcon = item.icon ?? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles21.defaultIcon, { color: textColor }] }, item.variant === "success" ? "\u2713" : item.variant === "destructive" ? "\u2716" : "\u2139");
|
|
1732
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNativeGestureHandler.GestureDetector, { gesture: panGesture }, /* @__PURE__ */ React23__default.default.createElement(ReanimatedAnimated__default.default.View, { style: [styles21.toast, { backgroundColor: bgColor }, animatedStyle] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles21.leftIconContainer }, leftIcon), /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles21.toastContent }, item.title ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles21.toastTitle, { color: textColor }] }, item.title) : null, item.description ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles21.toastDescription, { color: textColor, opacity: 0.85 }] }, item.description) : null), /* @__PURE__ */ React23__default.default.createElement(reactNative.TouchableOpacity, { onPress: onDismiss, style: styles21.dismissButton, touchSoundDisabled: true }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles21.dismissIcon, { color: textColor }] }, "\u2715"))));
|
|
1655
1733
|
}
|
|
1656
1734
|
function ToastProvider({ children }) {
|
|
1657
1735
|
const [toasts, setToasts] = React23.useState([]);
|
|
@@ -1683,9 +1761,9 @@ var styles21 = reactNative.StyleSheet.create({
|
|
|
1683
1761
|
toast: {
|
|
1684
1762
|
flexDirection: "row",
|
|
1685
1763
|
alignItems: "center",
|
|
1686
|
-
borderRadius:
|
|
1687
|
-
paddingHorizontal:
|
|
1688
|
-
paddingVertical:
|
|
1764
|
+
borderRadius: 16,
|
|
1765
|
+
paddingHorizontal: 20,
|
|
1766
|
+
paddingVertical: 14,
|
|
1689
1767
|
shadowColor: "#000",
|
|
1690
1768
|
shadowOffset: { width: 0, height: 4 },
|
|
1691
1769
|
shadowOpacity: 0.15,
|
|
@@ -1696,19 +1774,29 @@ var styles21 = reactNative.StyleSheet.create({
|
|
|
1696
1774
|
flex: 1,
|
|
1697
1775
|
gap: 4
|
|
1698
1776
|
},
|
|
1777
|
+
leftIconContainer: {
|
|
1778
|
+
width: 36,
|
|
1779
|
+
alignItems: "center",
|
|
1780
|
+
justifyContent: "center",
|
|
1781
|
+
marginRight: 8
|
|
1782
|
+
},
|
|
1783
|
+
defaultIcon: {
|
|
1784
|
+
fontSize: 22,
|
|
1785
|
+
fontWeight: "700"
|
|
1786
|
+
},
|
|
1699
1787
|
toastTitle: {
|
|
1700
|
-
fontSize:
|
|
1788
|
+
fontSize: 15,
|
|
1701
1789
|
fontWeight: "600"
|
|
1702
1790
|
},
|
|
1703
1791
|
toastDescription: {
|
|
1704
|
-
fontSize:
|
|
1792
|
+
fontSize: 14
|
|
1705
1793
|
},
|
|
1706
1794
|
dismissButton: {
|
|
1707
1795
|
padding: 12,
|
|
1708
1796
|
marginLeft: 4
|
|
1709
1797
|
},
|
|
1710
1798
|
dismissIcon: {
|
|
1711
|
-
fontSize:
|
|
1799
|
+
fontSize: 14
|
|
1712
1800
|
}
|
|
1713
1801
|
});
|
|
1714
1802
|
function formatCurrency(raw, separator) {
|
|
@@ -1753,6 +1841,73 @@ function CurrencyInput({
|
|
|
1753
1841
|
}
|
|
1754
1842
|
);
|
|
1755
1843
|
}
|
|
1844
|
+
function formatValue(value, prefix, showDecimals) {
|
|
1845
|
+
const num = typeof value === "string" ? parseFloat(value.replace(/[^0-9.-]/g, "")) : value;
|
|
1846
|
+
if (isNaN(num)) return `${prefix}0`;
|
|
1847
|
+
const abs = Math.abs(num);
|
|
1848
|
+
const sign = num < 0 ? "-" : "";
|
|
1849
|
+
const intPart = Math.floor(abs).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
1850
|
+
if (showDecimals) {
|
|
1851
|
+
const decStr = (abs % 1).toFixed(2).slice(2);
|
|
1852
|
+
return `${sign}${prefix}${intPart},${decStr}`;
|
|
1853
|
+
}
|
|
1854
|
+
return `${sign}${prefix}${intPart}`;
|
|
1855
|
+
}
|
|
1856
|
+
function CurrencyDisplay({ value, prefix = "$", showDecimals = false, style }) {
|
|
1857
|
+
const { colors } = useTheme();
|
|
1858
|
+
const formatted = formatValue(value, prefix, showDecimals);
|
|
1859
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles22.container, style] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles22.amount, { color: colors.foreground }], allowFontScaling: true }, formatted));
|
|
1860
|
+
}
|
|
1861
|
+
var styles22 = reactNative.StyleSheet.create({
|
|
1862
|
+
container: {},
|
|
1863
|
+
amount: {
|
|
1864
|
+
fontSize: 56,
|
|
1865
|
+
fontWeight: "700"
|
|
1866
|
+
}
|
|
1867
|
+
});
|
|
1868
|
+
function formatCurrency2(raw, separator) {
|
|
1869
|
+
const digits = raw.replace(/\D/g, "");
|
|
1870
|
+
if (!digits) return "";
|
|
1871
|
+
return digits.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
1872
|
+
}
|
|
1873
|
+
function CurrencyInputLarge({
|
|
1874
|
+
value,
|
|
1875
|
+
onChangeText,
|
|
1876
|
+
onChangeValue,
|
|
1877
|
+
prefix = "$",
|
|
1878
|
+
thousandsSeparator = ".",
|
|
1879
|
+
label,
|
|
1880
|
+
error,
|
|
1881
|
+
hint,
|
|
1882
|
+
placeholder,
|
|
1883
|
+
editable,
|
|
1884
|
+
containerStyle
|
|
1885
|
+
}) {
|
|
1886
|
+
const handleChange = (text) => {
|
|
1887
|
+
const withoutPrefix = prefix && text.startsWith(prefix) ? text.slice(prefix.length) : text;
|
|
1888
|
+
const formatted = formatCurrency2(withoutPrefix, thousandsSeparator);
|
|
1889
|
+
const display = formatted ? `${prefix}${formatted}` : "";
|
|
1890
|
+
onChangeText?.(display);
|
|
1891
|
+
const separatorRegex = new RegExp(`\\${thousandsSeparator}`, "g");
|
|
1892
|
+
const raw = parseFloat(formatted.replace(separatorRegex, "") || "0");
|
|
1893
|
+
onChangeValue?.(isNaN(raw) ? 0 : raw);
|
|
1894
|
+
};
|
|
1895
|
+
return /* @__PURE__ */ React23__default.default.createElement(
|
|
1896
|
+
Input,
|
|
1897
|
+
{
|
|
1898
|
+
value,
|
|
1899
|
+
onChangeText: handleChange,
|
|
1900
|
+
keyboardType: "numeric",
|
|
1901
|
+
label,
|
|
1902
|
+
error,
|
|
1903
|
+
hint,
|
|
1904
|
+
placeholder: placeholder ?? `${prefix}0`,
|
|
1905
|
+
editable,
|
|
1906
|
+
containerStyle,
|
|
1907
|
+
style: { fontSize: 36 }
|
|
1908
|
+
}
|
|
1909
|
+
);
|
|
1910
|
+
}
|
|
1756
1911
|
|
|
1757
1912
|
Object.defineProperty(exports, "BottomSheetModalProvider", {
|
|
1758
1913
|
enumerable: true,
|
|
@@ -1770,7 +1925,9 @@ exports.CardFooter = CardFooter;
|
|
|
1770
1925
|
exports.CardHeader = CardHeader;
|
|
1771
1926
|
exports.CardTitle = CardTitle;
|
|
1772
1927
|
exports.Checkbox = Checkbox;
|
|
1928
|
+
exports.CurrencyDisplay = CurrencyDisplay;
|
|
1773
1929
|
exports.CurrencyInput = CurrencyInput;
|
|
1930
|
+
exports.CurrencyInputLarge = CurrencyInputLarge;
|
|
1774
1931
|
exports.EmptyState = EmptyState;
|
|
1775
1932
|
exports.Input = Input;
|
|
1776
1933
|
exports.Progress = Progress;
|