@retray-dev/ui-kit 1.6.0 → 1.8.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 +264 -15
- package/README.md +7 -6
- package/dist/index.d.mts +114 -11
- package/dist/index.d.ts +114 -11
- package/dist/index.js +660 -134
- package/dist/index.mjs +656 -138
- package/package.json +8 -8
- package/src/components/Accordion/Accordion.tsx +4 -4
- package/src/components/Alert/Alert.tsx +32 -8
- package/src/components/Alert/index.ts +2 -2
- package/src/components/Avatar/Avatar.tsx +8 -8
- package/src/components/Badge/Badge.tsx +4 -4
- package/src/components/Button/Button.tsx +21 -14
- package/src/components/Card/Card.tsx +9 -9
- package/src/components/Checkbox/Checkbox.tsx +8 -8
- package/src/components/Chip/Chip.tsx +142 -0
- package/src/components/Chip/index.ts +2 -0
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +87 -0
- package/src/components/ConfirmDialog/index.ts +2 -0
- package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +48 -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/EmptyState/EmptyState.tsx +40 -6
- package/src/components/Input/Input.tsx +8 -8
- package/src/components/LabelValue/LabelValue.tsx +47 -0
- package/src/components/LabelValue/index.ts +2 -0
- package/src/components/ListItem/ListItem.tsx +121 -0
- package/src/components/ListItem/index.ts +2 -0
- package/src/components/MonthPicker/MonthPicker.tsx +92 -0
- package/src/components/MonthPicker/index.ts +2 -0
- package/src/components/Select/Select.tsx +19 -19
- package/src/components/Switch/Switch.tsx +12 -7
- 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 +7 -0
package/dist/index.js
CHANGED
|
@@ -98,14 +98,15 @@ function ThemeProvider({ children, theme, colorScheme = "system" }) {
|
|
|
98
98
|
function useTheme() {
|
|
99
99
|
return React23.useContext(ThemeContext);
|
|
100
100
|
}
|
|
101
|
+
var nativeDriver = reactNative.Platform.OS !== "web";
|
|
101
102
|
var containerSizeStyles = {
|
|
102
|
-
sm: { paddingHorizontal:
|
|
103
|
-
md: { paddingHorizontal:
|
|
104
|
-
lg: { paddingHorizontal:
|
|
103
|
+
sm: { paddingHorizontal: 20, paddingVertical: 12 },
|
|
104
|
+
md: { paddingHorizontal: 24, paddingVertical: 16 },
|
|
105
|
+
lg: { paddingHorizontal: 32, paddingVertical: 20 }
|
|
105
106
|
};
|
|
106
107
|
var labelSizeStyles = {
|
|
107
|
-
sm: { fontSize:
|
|
108
|
-
md: { fontSize:
|
|
108
|
+
sm: { fontSize: 15 },
|
|
109
|
+
md: { fontSize: 17 },
|
|
109
110
|
lg: { fontSize: 18 }
|
|
110
111
|
};
|
|
111
112
|
function Button({
|
|
@@ -128,13 +129,13 @@ function Button({
|
|
|
128
129
|
if (isDisabled) return;
|
|
129
130
|
reactNative.Animated.spring(scale, {
|
|
130
131
|
toValue: 0.95,
|
|
131
|
-
useNativeDriver:
|
|
132
|
+
useNativeDriver: nativeDriver,
|
|
132
133
|
speed: 40,
|
|
133
134
|
bounciness: 0
|
|
134
135
|
}).start();
|
|
135
136
|
};
|
|
136
137
|
const handlePressOut = () => {
|
|
137
|
-
reactNative.Animated.spring(scale, { toValue: 1, useNativeDriver:
|
|
138
|
+
reactNative.Animated.spring(scale, { toValue: 1, useNativeDriver: nativeDriver, speed: 40, bounciness: 4 }).start();
|
|
138
139
|
};
|
|
139
140
|
const handlePress = (e) => {
|
|
140
141
|
Haptics11__namespace.impactAsync(Haptics11__namespace.ImpactFeedbackStyle.Light);
|
|
@@ -144,15 +145,17 @@ function Button({
|
|
|
144
145
|
primary: { backgroundColor: colors.primary },
|
|
145
146
|
secondary: { backgroundColor: colors.secondary },
|
|
146
147
|
outline: { backgroundColor: "transparent", borderWidth: 1.5, borderColor: colors.border },
|
|
147
|
-
ghost: { backgroundColor: "transparent" }
|
|
148
|
+
ghost: { backgroundColor: "transparent" },
|
|
149
|
+
destructive: { backgroundColor: colors.destructive }
|
|
148
150
|
}[variant];
|
|
149
151
|
const labelVariantStyle = {
|
|
150
152
|
primary: { color: colors.primaryForeground },
|
|
151
153
|
secondary: { color: colors.secondaryForeground },
|
|
152
154
|
outline: { color: colors.foreground },
|
|
153
|
-
ghost: { color: colors.foreground }
|
|
155
|
+
ghost: { color: colors.foreground },
|
|
156
|
+
destructive: { color: colors.destructiveForeground }
|
|
154
157
|
}[variant];
|
|
155
|
-
const spinnerColor = variant === "primary" || variant === "secondary" ? colors.primaryForeground : colors.foreground;
|
|
158
|
+
const spinnerColor = variant === "destructive" ? colors.destructiveForeground : variant === "primary" || variant === "secondary" ? colors.primaryForeground : colors.foreground;
|
|
156
159
|
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: [fullWidth && styles.fullWidth, { transform: [{ scale }] }] }, /* @__PURE__ */ React23__default.default.createElement(
|
|
157
160
|
reactNative.TouchableOpacity,
|
|
158
161
|
{
|
|
@@ -172,12 +175,12 @@ function Button({
|
|
|
172
175
|
onPressOut: handlePressOut,
|
|
173
176
|
...props
|
|
174
177
|
},
|
|
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))
|
|
178
|
+
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
179
|
));
|
|
177
180
|
}
|
|
178
181
|
var styles = reactNative.StyleSheet.create({
|
|
179
182
|
base: {
|
|
180
|
-
borderRadius:
|
|
183
|
+
borderRadius: 999,
|
|
181
184
|
alignItems: "center",
|
|
182
185
|
justifyContent: "center",
|
|
183
186
|
flexDirection: "row"
|
|
@@ -196,12 +199,12 @@ var styles = reactNative.StyleSheet.create({
|
|
|
196
199
|
}
|
|
197
200
|
});
|
|
198
201
|
var variantStyles = {
|
|
199
|
-
h1: { fontSize:
|
|
200
|
-
h2: { fontSize:
|
|
201
|
-
h3: { fontSize:
|
|
202
|
-
body: { fontSize:
|
|
203
|
-
caption: { fontSize:
|
|
204
|
-
label: { fontSize:
|
|
202
|
+
h1: { fontSize: 40, fontWeight: "700", lineHeight: 52 },
|
|
203
|
+
h2: { fontSize: 28, fontWeight: "700", lineHeight: 36 },
|
|
204
|
+
h3: { fontSize: 22, fontWeight: "600", lineHeight: 30 },
|
|
205
|
+
body: { fontSize: 17, fontWeight: "400", lineHeight: 26 },
|
|
206
|
+
caption: { fontSize: 13, fontWeight: "400", lineHeight: 20 },
|
|
207
|
+
label: { fontSize: 15, fontWeight: "500", lineHeight: 22 }
|
|
205
208
|
};
|
|
206
209
|
function Text2({ variant = "body", color, style, children, ...props }) {
|
|
207
210
|
const { colors } = useTheme();
|
|
@@ -247,22 +250,22 @@ function Input({ label, error, hint, containerStyle, style, onFocus, onBlur, ...
|
|
|
247
250
|
}
|
|
248
251
|
var styles2 = reactNative.StyleSheet.create({
|
|
249
252
|
container: {
|
|
250
|
-
gap:
|
|
253
|
+
gap: 6
|
|
251
254
|
},
|
|
252
255
|
label: {
|
|
253
|
-
fontSize:
|
|
256
|
+
fontSize: 15,
|
|
254
257
|
fontWeight: "500",
|
|
255
|
-
marginBottom:
|
|
258
|
+
marginBottom: 6
|
|
256
259
|
},
|
|
257
260
|
input: {
|
|
258
261
|
borderWidth: 1.5,
|
|
259
|
-
borderRadius:
|
|
260
|
-
paddingHorizontal:
|
|
261
|
-
paddingVertical:
|
|
262
|
-
fontSize:
|
|
262
|
+
borderRadius: 14,
|
|
263
|
+
paddingHorizontal: 20,
|
|
264
|
+
paddingVertical: 16,
|
|
265
|
+
fontSize: 17
|
|
263
266
|
},
|
|
264
267
|
helperText: {
|
|
265
|
-
fontSize:
|
|
268
|
+
fontSize: 13
|
|
266
269
|
}
|
|
267
270
|
});
|
|
268
271
|
function Badge({ label, variant = "default", style }) {
|
|
@@ -283,13 +286,13 @@ function Badge({ label, variant = "default", style }) {
|
|
|
283
286
|
}
|
|
284
287
|
var styles3 = reactNative.StyleSheet.create({
|
|
285
288
|
container: {
|
|
286
|
-
borderRadius:
|
|
287
|
-
paddingHorizontal:
|
|
288
|
-
paddingVertical:
|
|
289
|
+
borderRadius: 8,
|
|
290
|
+
paddingHorizontal: 10,
|
|
291
|
+
paddingVertical: 4,
|
|
289
292
|
alignSelf: "flex-start"
|
|
290
293
|
},
|
|
291
294
|
label: {
|
|
292
|
-
fontSize:
|
|
295
|
+
fontSize: 13,
|
|
293
296
|
fontWeight: "500"
|
|
294
297
|
}
|
|
295
298
|
});
|
|
@@ -322,7 +325,7 @@ function CardFooter({ children, style }) {
|
|
|
322
325
|
}
|
|
323
326
|
var styles4 = reactNative.StyleSheet.create({
|
|
324
327
|
card: {
|
|
325
|
-
borderRadius:
|
|
328
|
+
borderRadius: 20,
|
|
326
329
|
borderWidth: 1,
|
|
327
330
|
shadowColor: "#000",
|
|
328
331
|
shadowOffset: { width: 0, height: 1 },
|
|
@@ -331,24 +334,24 @@ var styles4 = reactNative.StyleSheet.create({
|
|
|
331
334
|
elevation: 1
|
|
332
335
|
},
|
|
333
336
|
header: {
|
|
334
|
-
padding:
|
|
337
|
+
padding: 28,
|
|
335
338
|
paddingBottom: 0,
|
|
336
|
-
gap:
|
|
339
|
+
gap: 8
|
|
337
340
|
},
|
|
338
341
|
title: {
|
|
339
|
-
fontSize:
|
|
342
|
+
fontSize: 20,
|
|
340
343
|
fontWeight: "600",
|
|
341
|
-
lineHeight:
|
|
344
|
+
lineHeight: 28
|
|
342
345
|
},
|
|
343
346
|
description: {
|
|
344
|
-
fontSize:
|
|
345
|
-
lineHeight:
|
|
347
|
+
fontSize: 15,
|
|
348
|
+
lineHeight: 22
|
|
346
349
|
},
|
|
347
350
|
content: {
|
|
348
|
-
padding:
|
|
351
|
+
padding: 28
|
|
349
352
|
},
|
|
350
353
|
footer: {
|
|
351
|
-
padding:
|
|
354
|
+
padding: 28,
|
|
352
355
|
paddingTop: 0,
|
|
353
356
|
flexDirection: "row",
|
|
354
357
|
alignItems: "center"
|
|
@@ -433,16 +436,16 @@ var styles6 = reactNative.StyleSheet.create({
|
|
|
433
436
|
}
|
|
434
437
|
});
|
|
435
438
|
var sizeMap2 = {
|
|
436
|
-
sm:
|
|
437
|
-
md:
|
|
438
|
-
lg:
|
|
439
|
-
xl:
|
|
439
|
+
sm: 28,
|
|
440
|
+
md: 40,
|
|
441
|
+
lg: 56,
|
|
442
|
+
xl: 72
|
|
440
443
|
};
|
|
441
444
|
var fontSizeMap = {
|
|
442
|
-
sm:
|
|
443
|
-
md:
|
|
444
|
-
lg:
|
|
445
|
-
xl:
|
|
445
|
+
sm: 12,
|
|
446
|
+
md: 16,
|
|
447
|
+
lg: 22,
|
|
448
|
+
xl: 28
|
|
446
449
|
};
|
|
447
450
|
function Avatar({ src, fallback, size = "md", style }) {
|
|
448
451
|
const { colors } = useTheme();
|
|
@@ -480,12 +483,13 @@ var styles7 = reactNative.StyleSheet.create({
|
|
|
480
483
|
fontWeight: "500"
|
|
481
484
|
}
|
|
482
485
|
});
|
|
483
|
-
function
|
|
486
|
+
function AlertBanner({ title, description, variant = "default", icon, style }) {
|
|
484
487
|
const { colors } = useTheme();
|
|
485
|
-
const borderColor = variant === "destructive" ? colors.destructive : colors.border;
|
|
486
|
-
const titleColor = variant === "destructive" ? colors.destructive : colors.foreground;
|
|
487
|
-
const descColor = variant === "destructive" ? colors.destructive : colors.mutedForeground;
|
|
488
|
-
|
|
488
|
+
const borderColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : colors.border;
|
|
489
|
+
const titleColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : colors.foreground;
|
|
490
|
+
const descColor = variant === "destructive" ? colors.destructive : variant === "success" ? colors.success : colors.mutedForeground;
|
|
491
|
+
const defaultIcon = variant === "destructive" ? "\u26A0" : variant === "success" ? "\u2713" : "\u2139";
|
|
492
|
+
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 }] }, defaultIcon)), /* @__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
493
|
}
|
|
490
494
|
var styles8 = reactNative.StyleSheet.create({
|
|
491
495
|
container: {
|
|
@@ -510,6 +514,10 @@ var styles8 = reactNative.StyleSheet.create({
|
|
|
510
514
|
description: {
|
|
511
515
|
fontSize: 14,
|
|
512
516
|
lineHeight: 20
|
|
517
|
+
},
|
|
518
|
+
defaultIcon: {
|
|
519
|
+
fontSize: 18,
|
|
520
|
+
fontWeight: "700"
|
|
513
521
|
}
|
|
514
522
|
});
|
|
515
523
|
function Progress({ value = 0, max = 100, style }) {
|
|
@@ -552,9 +560,39 @@ var styles9 = reactNative.StyleSheet.create({
|
|
|
552
560
|
borderRadius: 999
|
|
553
561
|
}
|
|
554
562
|
});
|
|
555
|
-
function EmptyState({ icon, title, description, action, style }) {
|
|
563
|
+
function EmptyState({ icon, title, description, action, size = "default", style }) {
|
|
556
564
|
const { colors } = useTheme();
|
|
557
|
-
|
|
565
|
+
const isCompact = size === "compact";
|
|
566
|
+
return /* @__PURE__ */ React23__default.default.createElement(
|
|
567
|
+
reactNative.View,
|
|
568
|
+
{
|
|
569
|
+
style: [
|
|
570
|
+
styles10.container,
|
|
571
|
+
isCompact && styles10.containerCompact,
|
|
572
|
+
{ borderColor: colors.border },
|
|
573
|
+
style
|
|
574
|
+
]
|
|
575
|
+
},
|
|
576
|
+
icon ? /* @__PURE__ */ React23__default.default.createElement(
|
|
577
|
+
reactNative.View,
|
|
578
|
+
{
|
|
579
|
+
style: [
|
|
580
|
+
styles10.iconWrapper,
|
|
581
|
+
isCompact && styles10.iconWrapperCompact,
|
|
582
|
+
{ backgroundColor: colors.muted }
|
|
583
|
+
]
|
|
584
|
+
},
|
|
585
|
+
icon
|
|
586
|
+
) : null,
|
|
587
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles10.textWrapper }, /* @__PURE__ */ React23__default.default.createElement(
|
|
588
|
+
reactNative.Text,
|
|
589
|
+
{
|
|
590
|
+
style: [styles10.title, isCompact && styles10.titleCompact, { color: colors.foreground }]
|
|
591
|
+
},
|
|
592
|
+
title
|
|
593
|
+
), description && !isCompact ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles10.description, { color: colors.mutedForeground }] }, description) : null),
|
|
594
|
+
action && !isCompact ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles10.action }, action) : null
|
|
595
|
+
);
|
|
558
596
|
}
|
|
559
597
|
var styles10 = reactNative.StyleSheet.create({
|
|
560
598
|
container: {
|
|
@@ -566,6 +604,10 @@ var styles10 = reactNative.StyleSheet.create({
|
|
|
566
604
|
padding: 32,
|
|
567
605
|
gap: 16
|
|
568
606
|
},
|
|
607
|
+
containerCompact: {
|
|
608
|
+
padding: 20,
|
|
609
|
+
gap: 10
|
|
610
|
+
},
|
|
569
611
|
iconWrapper: {
|
|
570
612
|
width: 48,
|
|
571
613
|
height: 48,
|
|
@@ -573,6 +615,11 @@ var styles10 = reactNative.StyleSheet.create({
|
|
|
573
615
|
alignItems: "center",
|
|
574
616
|
justifyContent: "center"
|
|
575
617
|
},
|
|
618
|
+
iconWrapperCompact: {
|
|
619
|
+
width: 36,
|
|
620
|
+
height: 36,
|
|
621
|
+
borderRadius: 8
|
|
622
|
+
},
|
|
576
623
|
textWrapper: {
|
|
577
624
|
alignItems: "center",
|
|
578
625
|
gap: 8,
|
|
@@ -583,6 +630,9 @@ var styles10 = reactNative.StyleSheet.create({
|
|
|
583
630
|
fontWeight: "500",
|
|
584
631
|
textAlign: "center"
|
|
585
632
|
},
|
|
633
|
+
titleCompact: {
|
|
634
|
+
fontSize: 15
|
|
635
|
+
},
|
|
586
636
|
description: {
|
|
587
637
|
fontSize: 14,
|
|
588
638
|
lineHeight: 20,
|
|
@@ -617,7 +667,7 @@ function Textarea({
|
|
|
617
667
|
borderColor: error ? colors.destructive : focused ? colors.ring : colors.border,
|
|
618
668
|
color: colors.foreground,
|
|
619
669
|
backgroundColor: colors.background,
|
|
620
|
-
minHeight: rows *
|
|
670
|
+
minHeight: rows * 30
|
|
621
671
|
},
|
|
622
672
|
style
|
|
623
673
|
],
|
|
@@ -637,22 +687,22 @@ function Textarea({
|
|
|
637
687
|
}
|
|
638
688
|
var styles11 = reactNative.StyleSheet.create({
|
|
639
689
|
container: {
|
|
640
|
-
gap:
|
|
690
|
+
gap: 6
|
|
641
691
|
},
|
|
642
692
|
label: {
|
|
643
|
-
fontSize:
|
|
693
|
+
fontSize: 15,
|
|
644
694
|
fontWeight: "500",
|
|
645
|
-
marginBottom:
|
|
695
|
+
marginBottom: 6
|
|
646
696
|
},
|
|
647
697
|
input: {
|
|
648
698
|
borderWidth: 1.5,
|
|
649
|
-
borderRadius:
|
|
650
|
-
paddingHorizontal:
|
|
651
|
-
paddingVertical:
|
|
652
|
-
fontSize:
|
|
699
|
+
borderRadius: 14,
|
|
700
|
+
paddingHorizontal: 20,
|
|
701
|
+
paddingVertical: 16,
|
|
702
|
+
fontSize: 17
|
|
653
703
|
},
|
|
654
704
|
helperText: {
|
|
655
|
-
fontSize:
|
|
705
|
+
fontSize: 13
|
|
656
706
|
}
|
|
657
707
|
});
|
|
658
708
|
function Checkbox({
|
|
@@ -712,31 +762,32 @@ var styles12 = reactNative.StyleSheet.create({
|
|
|
712
762
|
row: {
|
|
713
763
|
flexDirection: "row",
|
|
714
764
|
alignItems: "center",
|
|
715
|
-
gap:
|
|
765
|
+
gap: 12
|
|
716
766
|
},
|
|
717
767
|
box: {
|
|
718
|
-
width:
|
|
719
|
-
height:
|
|
720
|
-
borderRadius:
|
|
768
|
+
width: 28,
|
|
769
|
+
height: 28,
|
|
770
|
+
borderRadius: 8,
|
|
721
771
|
borderWidth: 1.5,
|
|
722
772
|
alignItems: "center",
|
|
723
773
|
justifyContent: "center"
|
|
724
774
|
},
|
|
725
775
|
checkmark: {
|
|
726
|
-
width:
|
|
727
|
-
height:
|
|
776
|
+
width: 15,
|
|
777
|
+
height: 9,
|
|
728
778
|
borderLeftWidth: 2,
|
|
729
779
|
borderBottomWidth: 2,
|
|
730
780
|
transform: [{ rotate: "-45deg" }, { translateY: -1 }]
|
|
731
781
|
},
|
|
732
782
|
label: {
|
|
733
|
-
fontSize:
|
|
734
|
-
lineHeight:
|
|
783
|
+
fontSize: 15,
|
|
784
|
+
lineHeight: 22
|
|
735
785
|
}
|
|
736
786
|
});
|
|
737
|
-
var
|
|
738
|
-
var
|
|
739
|
-
var
|
|
787
|
+
var nativeDriver2 = reactNative.Platform.OS !== "web";
|
|
788
|
+
var TRACK_WIDTH = 60;
|
|
789
|
+
var TRACK_HEIGHT = 36;
|
|
790
|
+
var THUMB_SIZE = 28;
|
|
740
791
|
var THUMB_OFFSET = 4;
|
|
741
792
|
var THUMB_TRAVEL = TRACK_WIDTH - THUMB_SIZE - THUMB_OFFSET * 2;
|
|
742
793
|
function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
@@ -747,7 +798,7 @@ function Switch({ checked = false, onCheckedChange, disabled, style }) {
|
|
|
747
798
|
reactNative.Animated.parallel([
|
|
748
799
|
reactNative.Animated.spring(translateX, {
|
|
749
800
|
toValue: checked ? THUMB_TRAVEL : 0,
|
|
750
|
-
useNativeDriver:
|
|
801
|
+
useNativeDriver: nativeDriver2,
|
|
751
802
|
bounciness: 4
|
|
752
803
|
}),
|
|
753
804
|
reactNative.Animated.timing(trackOpacity, {
|
|
@@ -789,11 +840,14 @@ var styles13 = reactNative.StyleSheet.create({
|
|
|
789
840
|
track: {
|
|
790
841
|
width: TRACK_WIDTH,
|
|
791
842
|
height: TRACK_HEIGHT,
|
|
792
|
-
borderRadius: TRACK_HEIGHT / 2
|
|
793
|
-
justifyContent
|
|
794
|
-
|
|
843
|
+
borderRadius: TRACK_HEIGHT / 2
|
|
844
|
+
// No justifyContent/alignItems — thumb uses absolute positioning
|
|
845
|
+
// so the track's flex layout doesn't interfere with translateX animation
|
|
795
846
|
},
|
|
796
847
|
thumb: {
|
|
848
|
+
position: "absolute",
|
|
849
|
+
top: THUMB_OFFSET,
|
|
850
|
+
left: THUMB_OFFSET,
|
|
797
851
|
width: THUMB_SIZE,
|
|
798
852
|
height: THUMB_SIZE,
|
|
799
853
|
borderRadius: THUMB_SIZE / 2,
|
|
@@ -816,12 +870,22 @@ function Toggle({
|
|
|
816
870
|
size = "md",
|
|
817
871
|
label,
|
|
818
872
|
icon,
|
|
873
|
+
activeIcon,
|
|
819
874
|
disabled,
|
|
820
875
|
style,
|
|
821
876
|
...props
|
|
822
877
|
}) {
|
|
823
878
|
const { colors } = useTheme();
|
|
824
879
|
const scale = React23.useRef(new reactNative.Animated.Value(1)).current;
|
|
880
|
+
const pressAnim = React23.useRef(new reactNative.Animated.Value(pressed ? 1 : 0)).current;
|
|
881
|
+
React23.useEffect(() => {
|
|
882
|
+
reactNative.Animated.timing(pressAnim, {
|
|
883
|
+
toValue: pressed ? 1 : 0,
|
|
884
|
+
duration: 150,
|
|
885
|
+
easing: reactNative.Easing.out(reactNative.Easing.ease),
|
|
886
|
+
useNativeDriver: false
|
|
887
|
+
}).start();
|
|
888
|
+
}, [pressed, pressAnim]);
|
|
825
889
|
const handlePressIn = () => {
|
|
826
890
|
if (disabled) return;
|
|
827
891
|
reactNative.Animated.spring(scale, { toValue: 0.95, useNativeDriver: true, speed: 40, bounciness: 0 }).start();
|
|
@@ -829,34 +893,71 @@ function Toggle({
|
|
|
829
893
|
const handlePressOut = () => {
|
|
830
894
|
reactNative.Animated.spring(scale, { toValue: 1, useNativeDriver: true, speed: 40, bounciness: 4 }).start();
|
|
831
895
|
};
|
|
832
|
-
const
|
|
833
|
-
|
|
896
|
+
const borderColor = pressAnim.interpolate({
|
|
897
|
+
inputRange: [0, 1],
|
|
898
|
+
outputRange: [variant === "outline" ? colors.border : "transparent", colors.primary]
|
|
899
|
+
});
|
|
900
|
+
const backgroundColor = pressAnim.interpolate({
|
|
901
|
+
inputRange: [0, 1],
|
|
902
|
+
outputRange: ["transparent", colors.accent]
|
|
903
|
+
});
|
|
904
|
+
const textColor = pressAnim.interpolate({
|
|
905
|
+
inputRange: [0, 1],
|
|
906
|
+
outputRange: [colors.foreground, colors.primary]
|
|
907
|
+
});
|
|
908
|
+
const LeftIcon = () => {
|
|
909
|
+
const renderProp = (prop) => {
|
|
910
|
+
if (!prop) return null;
|
|
911
|
+
if (typeof prop === "function") return prop(pressed);
|
|
912
|
+
return prop;
|
|
913
|
+
};
|
|
914
|
+
if (!pressed) return renderProp(icon);
|
|
915
|
+
const active = renderProp(activeIcon);
|
|
916
|
+
if (active) return /* @__PURE__ */ React23__default.default.createElement(React23__default.default.Fragment, null, active);
|
|
917
|
+
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"));
|
|
918
|
+
};
|
|
834
919
|
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23__default.default.createElement(
|
|
835
|
-
reactNative.
|
|
920
|
+
reactNative.Animated.View,
|
|
836
921
|
{
|
|
837
|
-
style: [
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
disabled,
|
|
845
|
-
activeOpacity: 1,
|
|
846
|
-
touchSoundDisabled: true,
|
|
847
|
-
...props
|
|
922
|
+
style: [
|
|
923
|
+
styles14.base,
|
|
924
|
+
sizeStyles[size],
|
|
925
|
+
{ borderColor, backgroundColor, borderWidth: 2 },
|
|
926
|
+
disabled && styles14.disabled,
|
|
927
|
+
style
|
|
928
|
+
]
|
|
848
929
|
},
|
|
849
|
-
|
|
850
|
-
|
|
930
|
+
/* @__PURE__ */ React23__default.default.createElement(
|
|
931
|
+
reactNative.TouchableOpacity,
|
|
932
|
+
{
|
|
933
|
+
style: styles14.touchable,
|
|
934
|
+
onPress: () => {
|
|
935
|
+
Haptics11__namespace.selectionAsync();
|
|
936
|
+
onPressedChange?.(!pressed);
|
|
937
|
+
},
|
|
938
|
+
onPressIn: handlePressIn,
|
|
939
|
+
onPressOut: handlePressOut,
|
|
940
|
+
disabled,
|
|
941
|
+
activeOpacity: 1,
|
|
942
|
+
touchSoundDisabled: true,
|
|
943
|
+
...props
|
|
944
|
+
},
|
|
945
|
+
/* @__PURE__ */ React23__default.default.createElement(LeftIcon, null),
|
|
946
|
+
label ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.Text, { style: [styles14.label, { color: textColor }] }, label) : null
|
|
947
|
+
)
|
|
851
948
|
));
|
|
852
949
|
}
|
|
853
950
|
var styles14 = reactNative.StyleSheet.create({
|
|
854
951
|
base: {
|
|
855
952
|
borderRadius: 8,
|
|
953
|
+
overflow: "hidden"
|
|
954
|
+
},
|
|
955
|
+
touchable: {
|
|
856
956
|
flexDirection: "row",
|
|
857
957
|
alignItems: "center",
|
|
858
958
|
justifyContent: "center",
|
|
859
|
-
gap: 8
|
|
959
|
+
gap: 8,
|
|
960
|
+
flex: 1
|
|
860
961
|
},
|
|
861
962
|
disabled: {
|
|
862
963
|
opacity: 0.45
|
|
@@ -864,6 +965,18 @@ var styles14 = reactNative.StyleSheet.create({
|
|
|
864
965
|
label: {
|
|
865
966
|
fontSize: 14,
|
|
866
967
|
fontWeight: "500"
|
|
968
|
+
},
|
|
969
|
+
checkContainer: {
|
|
970
|
+
width: 24,
|
|
971
|
+
height: 24,
|
|
972
|
+
borderRadius: 12,
|
|
973
|
+
borderWidth: 2,
|
|
974
|
+
alignItems: "center",
|
|
975
|
+
justifyContent: "center"
|
|
976
|
+
},
|
|
977
|
+
checkMark: {
|
|
978
|
+
fontSize: 14,
|
|
979
|
+
fontWeight: "700"
|
|
867
980
|
}
|
|
868
981
|
});
|
|
869
982
|
function RadioItem({
|
|
@@ -994,7 +1107,7 @@ function TabTrigger({
|
|
|
994
1107
|
activeOpacity: 1,
|
|
995
1108
|
touchSoundDisabled: true
|
|
996
1109
|
},
|
|
997
|
-
/* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: { transform: [{ scale }] } }, /* @__PURE__ */ React23__default.default.createElement(
|
|
1110
|
+
/* @__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
1111
|
reactNative.Text,
|
|
999
1112
|
{
|
|
1000
1113
|
style: [
|
|
@@ -1004,7 +1117,7 @@ function TabTrigger({
|
|
|
1004
1117
|
]
|
|
1005
1118
|
},
|
|
1006
1119
|
tab.label
|
|
1007
|
-
))
|
|
1120
|
+
)))
|
|
1008
1121
|
);
|
|
1009
1122
|
}
|
|
1010
1123
|
function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
@@ -1060,7 +1173,7 @@ function Tabs({ tabs, value, onValueChange, children, style }) {
|
|
|
1060
1173
|
bottom: 4,
|
|
1061
1174
|
left: pillX,
|
|
1062
1175
|
width: pillWidth,
|
|
1063
|
-
borderRadius:
|
|
1176
|
+
borderRadius: 8,
|
|
1064
1177
|
shadowColor: "#000",
|
|
1065
1178
|
shadowOffset: { width: 0, height: 1 },
|
|
1066
1179
|
shadowOpacity: 0.1,
|
|
@@ -1094,22 +1207,33 @@ function TabsContent({ value, activeValue, children, style }) {
|
|
|
1094
1207
|
var styles16 = reactNative.StyleSheet.create({
|
|
1095
1208
|
list: {
|
|
1096
1209
|
flexDirection: "row",
|
|
1097
|
-
borderRadius:
|
|
1210
|
+
borderRadius: 12,
|
|
1098
1211
|
padding: 4,
|
|
1099
1212
|
gap: 4
|
|
1100
1213
|
},
|
|
1101
1214
|
pill: {},
|
|
1102
1215
|
trigger: {
|
|
1103
1216
|
flex: 1,
|
|
1104
|
-
paddingVertical:
|
|
1105
|
-
paddingHorizontal:
|
|
1106
|
-
borderRadius:
|
|
1217
|
+
paddingVertical: 12,
|
|
1218
|
+
paddingHorizontal: 16,
|
|
1219
|
+
borderRadius: 8,
|
|
1107
1220
|
alignItems: "center",
|
|
1108
1221
|
justifyContent: "center",
|
|
1109
1222
|
zIndex: 1
|
|
1110
1223
|
},
|
|
1224
|
+
triggerInner: {
|
|
1225
|
+
flexDirection: "row",
|
|
1226
|
+
alignItems: "center",
|
|
1227
|
+
justifyContent: "center",
|
|
1228
|
+
gap: 8
|
|
1229
|
+
},
|
|
1230
|
+
triggerIcon: {
|
|
1231
|
+
marginRight: 6,
|
|
1232
|
+
alignItems: "center",
|
|
1233
|
+
justifyContent: "center"
|
|
1234
|
+
},
|
|
1111
1235
|
triggerLabel: {
|
|
1112
|
-
fontSize:
|
|
1236
|
+
fontSize: 15,
|
|
1113
1237
|
fontWeight: "400"
|
|
1114
1238
|
},
|
|
1115
1239
|
activeTriggerLabel: {
|
|
@@ -1208,19 +1332,19 @@ var styles17 = reactNative.StyleSheet.create({
|
|
|
1208
1332
|
flexDirection: "row",
|
|
1209
1333
|
justifyContent: "space-between",
|
|
1210
1334
|
alignItems: "center",
|
|
1211
|
-
paddingVertical:
|
|
1335
|
+
paddingVertical: 20
|
|
1212
1336
|
},
|
|
1213
1337
|
triggerText: {
|
|
1214
|
-
fontSize:
|
|
1338
|
+
fontSize: 17,
|
|
1215
1339
|
fontWeight: "500",
|
|
1216
1340
|
flex: 1
|
|
1217
1341
|
},
|
|
1218
1342
|
chevron: {
|
|
1219
|
-
fontSize:
|
|
1343
|
+
fontSize: 18,
|
|
1220
1344
|
marginLeft: 8
|
|
1221
1345
|
},
|
|
1222
1346
|
content: {
|
|
1223
|
-
paddingBottom:
|
|
1347
|
+
paddingBottom: 20,
|
|
1224
1348
|
position: "absolute",
|
|
1225
1349
|
width: "100%"
|
|
1226
1350
|
}
|
|
@@ -1529,10 +1653,10 @@ function Select({
|
|
|
1529
1653
|
}
|
|
1530
1654
|
var styles20 = reactNative.StyleSheet.create({
|
|
1531
1655
|
container: {
|
|
1532
|
-
gap:
|
|
1656
|
+
gap: 6
|
|
1533
1657
|
},
|
|
1534
1658
|
label: {
|
|
1535
|
-
fontSize:
|
|
1659
|
+
fontSize: 15,
|
|
1536
1660
|
fontWeight: "500",
|
|
1537
1661
|
marginBottom: 2
|
|
1538
1662
|
},
|
|
@@ -1541,24 +1665,24 @@ var styles20 = reactNative.StyleSheet.create({
|
|
|
1541
1665
|
alignItems: "center",
|
|
1542
1666
|
justifyContent: "space-between",
|
|
1543
1667
|
borderWidth: 1.5,
|
|
1544
|
-
borderRadius:
|
|
1545
|
-
paddingHorizontal:
|
|
1546
|
-
paddingVertical:
|
|
1668
|
+
borderRadius: 14,
|
|
1669
|
+
paddingHorizontal: 20,
|
|
1670
|
+
paddingVertical: 16
|
|
1547
1671
|
},
|
|
1548
1672
|
triggerText: {
|
|
1549
|
-
fontSize:
|
|
1673
|
+
fontSize: 17,
|
|
1550
1674
|
flex: 1
|
|
1551
1675
|
},
|
|
1552
1676
|
chevron: {
|
|
1553
|
-
fontSize:
|
|
1677
|
+
fontSize: 16,
|
|
1554
1678
|
marginLeft: 8
|
|
1555
1679
|
},
|
|
1556
1680
|
helperText: {
|
|
1557
|
-
fontSize:
|
|
1681
|
+
fontSize: 13
|
|
1558
1682
|
},
|
|
1559
1683
|
sheetBackground: {
|
|
1560
|
-
borderTopLeftRadius:
|
|
1561
|
-
borderTopRightRadius:
|
|
1684
|
+
borderTopLeftRadius: 24,
|
|
1685
|
+
borderTopRightRadius: 24
|
|
1562
1686
|
},
|
|
1563
1687
|
sheetHandle: {
|
|
1564
1688
|
width: 36,
|
|
@@ -1566,32 +1690,32 @@ var styles20 = reactNative.StyleSheet.create({
|
|
|
1566
1690
|
borderRadius: 2
|
|
1567
1691
|
},
|
|
1568
1692
|
sheetContent: {
|
|
1569
|
-
paddingHorizontal:
|
|
1570
|
-
paddingBottom:
|
|
1693
|
+
paddingHorizontal: 20,
|
|
1694
|
+
paddingBottom: 36
|
|
1571
1695
|
},
|
|
1572
1696
|
sheetTitle: {
|
|
1573
|
-
fontSize:
|
|
1697
|
+
fontSize: 17,
|
|
1574
1698
|
fontWeight: "600",
|
|
1575
|
-
paddingVertical:
|
|
1699
|
+
paddingVertical: 16,
|
|
1576
1700
|
paddingHorizontal: 4
|
|
1577
1701
|
},
|
|
1578
1702
|
option: {
|
|
1579
1703
|
flexDirection: "row",
|
|
1580
1704
|
alignItems: "center",
|
|
1581
1705
|
justifyContent: "space-between",
|
|
1582
|
-
paddingHorizontal:
|
|
1583
|
-
paddingVertical:
|
|
1584
|
-
borderRadius:
|
|
1706
|
+
paddingHorizontal: 16,
|
|
1707
|
+
paddingVertical: 16,
|
|
1708
|
+
borderRadius: 12
|
|
1585
1709
|
},
|
|
1586
1710
|
optionText: {
|
|
1587
|
-
fontSize:
|
|
1711
|
+
fontSize: 17,
|
|
1588
1712
|
flex: 1
|
|
1589
1713
|
},
|
|
1590
1714
|
disabledOption: {
|
|
1591
1715
|
opacity: 0.45
|
|
1592
1716
|
},
|
|
1593
1717
|
checkmark: {
|
|
1594
|
-
fontSize:
|
|
1718
|
+
fontSize: 16,
|
|
1595
1719
|
fontWeight: "600",
|
|
1596
1720
|
marginLeft: 8
|
|
1597
1721
|
}
|
|
@@ -1651,7 +1775,8 @@ function ToastNotification({ item, onDismiss }) {
|
|
|
1651
1775
|
destructive: colors.destructiveForeground,
|
|
1652
1776
|
success: colors.successForeground
|
|
1653
1777
|
}[item.variant ?? "default"];
|
|
1654
|
-
|
|
1778
|
+
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");
|
|
1779
|
+
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
1780
|
}
|
|
1656
1781
|
function ToastProvider({ children }) {
|
|
1657
1782
|
const [toasts, setToasts] = React23.useState([]);
|
|
@@ -1683,9 +1808,9 @@ var styles21 = reactNative.StyleSheet.create({
|
|
|
1683
1808
|
toast: {
|
|
1684
1809
|
flexDirection: "row",
|
|
1685
1810
|
alignItems: "center",
|
|
1686
|
-
borderRadius:
|
|
1687
|
-
paddingHorizontal:
|
|
1688
|
-
paddingVertical:
|
|
1811
|
+
borderRadius: 16,
|
|
1812
|
+
paddingHorizontal: 20,
|
|
1813
|
+
paddingVertical: 14,
|
|
1689
1814
|
shadowColor: "#000",
|
|
1690
1815
|
shadowOffset: { width: 0, height: 4 },
|
|
1691
1816
|
shadowOpacity: 0.15,
|
|
@@ -1696,19 +1821,29 @@ var styles21 = reactNative.StyleSheet.create({
|
|
|
1696
1821
|
flex: 1,
|
|
1697
1822
|
gap: 4
|
|
1698
1823
|
},
|
|
1824
|
+
leftIconContainer: {
|
|
1825
|
+
width: 36,
|
|
1826
|
+
alignItems: "center",
|
|
1827
|
+
justifyContent: "center",
|
|
1828
|
+
marginRight: 8
|
|
1829
|
+
},
|
|
1830
|
+
defaultIcon: {
|
|
1831
|
+
fontSize: 22,
|
|
1832
|
+
fontWeight: "700"
|
|
1833
|
+
},
|
|
1699
1834
|
toastTitle: {
|
|
1700
|
-
fontSize:
|
|
1835
|
+
fontSize: 15,
|
|
1701
1836
|
fontWeight: "600"
|
|
1702
1837
|
},
|
|
1703
1838
|
toastDescription: {
|
|
1704
|
-
fontSize:
|
|
1839
|
+
fontSize: 14
|
|
1705
1840
|
},
|
|
1706
1841
|
dismissButton: {
|
|
1707
1842
|
padding: 12,
|
|
1708
1843
|
marginLeft: 4
|
|
1709
1844
|
},
|
|
1710
1845
|
dismissIcon: {
|
|
1711
|
-
fontSize:
|
|
1846
|
+
fontSize: 14
|
|
1712
1847
|
}
|
|
1713
1848
|
});
|
|
1714
1849
|
function formatCurrency(raw, separator) {
|
|
@@ -1753,13 +1888,396 @@ function CurrencyInput({
|
|
|
1753
1888
|
}
|
|
1754
1889
|
);
|
|
1755
1890
|
}
|
|
1891
|
+
function formatValue(value, prefix, showDecimals) {
|
|
1892
|
+
const num = typeof value === "string" ? parseFloat(value.replace(/[^0-9.-]/g, "")) : value;
|
|
1893
|
+
if (isNaN(num)) return `${prefix}0`;
|
|
1894
|
+
const abs = Math.abs(num);
|
|
1895
|
+
const sign = num < 0 ? "-" : "";
|
|
1896
|
+
const intPart = Math.floor(abs).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
1897
|
+
if (showDecimals) {
|
|
1898
|
+
const decStr = (abs % 1).toFixed(2).slice(2);
|
|
1899
|
+
return `${sign}${prefix}${intPart},${decStr}`;
|
|
1900
|
+
}
|
|
1901
|
+
return `${sign}${prefix}${intPart}`;
|
|
1902
|
+
}
|
|
1903
|
+
function CurrencyDisplay({ value, prefix = "$", showDecimals = false, textColor, style }) {
|
|
1904
|
+
const { colors } = useTheme();
|
|
1905
|
+
const formatted = formatValue(value, prefix, showDecimals);
|
|
1906
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles22.container, style] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles22.amount, { color: textColor ?? colors.foreground }], allowFontScaling: true }, formatted));
|
|
1907
|
+
}
|
|
1908
|
+
var styles22 = reactNative.StyleSheet.create({
|
|
1909
|
+
container: {},
|
|
1910
|
+
amount: {
|
|
1911
|
+
fontSize: 56,
|
|
1912
|
+
fontWeight: "700"
|
|
1913
|
+
}
|
|
1914
|
+
});
|
|
1915
|
+
function formatCurrency2(raw, separator) {
|
|
1916
|
+
const digits = raw.replace(/\D/g, "");
|
|
1917
|
+
if (!digits) return "";
|
|
1918
|
+
return digits.replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
1919
|
+
}
|
|
1920
|
+
function CurrencyInputLarge({
|
|
1921
|
+
value,
|
|
1922
|
+
onChangeText,
|
|
1923
|
+
onChangeValue,
|
|
1924
|
+
prefix = "$",
|
|
1925
|
+
thousandsSeparator = ".",
|
|
1926
|
+
label,
|
|
1927
|
+
error,
|
|
1928
|
+
hint,
|
|
1929
|
+
placeholder,
|
|
1930
|
+
editable,
|
|
1931
|
+
containerStyle
|
|
1932
|
+
}) {
|
|
1933
|
+
const handleChange = (text) => {
|
|
1934
|
+
const withoutPrefix = prefix && text.startsWith(prefix) ? text.slice(prefix.length) : text;
|
|
1935
|
+
const formatted = formatCurrency2(withoutPrefix, thousandsSeparator);
|
|
1936
|
+
const display = formatted ? `${prefix}${formatted}` : "";
|
|
1937
|
+
onChangeText?.(display);
|
|
1938
|
+
const separatorRegex = new RegExp(`\\${thousandsSeparator}`, "g");
|
|
1939
|
+
const raw = parseFloat(formatted.replace(separatorRegex, "") || "0");
|
|
1940
|
+
onChangeValue?.(isNaN(raw) ? 0 : raw);
|
|
1941
|
+
};
|
|
1942
|
+
return /* @__PURE__ */ React23__default.default.createElement(
|
|
1943
|
+
Input,
|
|
1944
|
+
{
|
|
1945
|
+
value,
|
|
1946
|
+
onChangeText: handleChange,
|
|
1947
|
+
keyboardType: "numeric",
|
|
1948
|
+
label,
|
|
1949
|
+
error,
|
|
1950
|
+
hint,
|
|
1951
|
+
placeholder: placeholder ?? `${prefix}0`,
|
|
1952
|
+
editable,
|
|
1953
|
+
containerStyle,
|
|
1954
|
+
style: { fontSize: 36 }
|
|
1955
|
+
}
|
|
1956
|
+
);
|
|
1957
|
+
}
|
|
1958
|
+
var nativeDriver3 = reactNative.Platform.OS !== "web";
|
|
1959
|
+
function ListItem({ icon, title, subtitle, trailing, onPress, disabled, style }) {
|
|
1960
|
+
const { colors } = useTheme();
|
|
1961
|
+
const scale = React23.useRef(new reactNative.Animated.Value(1)).current;
|
|
1962
|
+
const handlePressIn = () => {
|
|
1963
|
+
if (!onPress || disabled) return;
|
|
1964
|
+
reactNative.Animated.spring(scale, {
|
|
1965
|
+
toValue: 0.97,
|
|
1966
|
+
useNativeDriver: nativeDriver3,
|
|
1967
|
+
speed: 40,
|
|
1968
|
+
bounciness: 0
|
|
1969
|
+
}).start();
|
|
1970
|
+
};
|
|
1971
|
+
const handlePressOut = () => {
|
|
1972
|
+
reactNative.Animated.spring(scale, {
|
|
1973
|
+
toValue: 1,
|
|
1974
|
+
useNativeDriver: nativeDriver3,
|
|
1975
|
+
speed: 40,
|
|
1976
|
+
bounciness: 4
|
|
1977
|
+
}).start();
|
|
1978
|
+
};
|
|
1979
|
+
const handlePress = () => {
|
|
1980
|
+
Haptics11__namespace.selectionAsync();
|
|
1981
|
+
onPress?.();
|
|
1982
|
+
};
|
|
1983
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: [{ transform: [{ scale }] }, disabled && styles23.disabled] }, /* @__PURE__ */ React23__default.default.createElement(
|
|
1984
|
+
reactNative.TouchableOpacity,
|
|
1985
|
+
{
|
|
1986
|
+
style: [styles23.container, style],
|
|
1987
|
+
onPress: onPress ? handlePress : void 0,
|
|
1988
|
+
onPressIn: handlePressIn,
|
|
1989
|
+
onPressOut: handlePressOut,
|
|
1990
|
+
disabled,
|
|
1991
|
+
activeOpacity: 1,
|
|
1992
|
+
touchSoundDisabled: true
|
|
1993
|
+
},
|
|
1994
|
+
icon ? /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles23.iconWrapper }, icon) : null,
|
|
1995
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles23.content }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles23.title, { color: colors.foreground }], allowFontScaling: true }, title), subtitle ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles23.subtitle, { color: colors.mutedForeground }], allowFontScaling: true }, subtitle) : null),
|
|
1996
|
+
trailing !== void 0 ? typeof trailing === "string" ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles23.trailing, { color: colors.mutedForeground }], allowFontScaling: true }, trailing) : trailing : null
|
|
1997
|
+
));
|
|
1998
|
+
}
|
|
1999
|
+
var styles23 = reactNative.StyleSheet.create({
|
|
2000
|
+
container: {
|
|
2001
|
+
flexDirection: "row",
|
|
2002
|
+
alignItems: "center",
|
|
2003
|
+
paddingHorizontal: 16,
|
|
2004
|
+
paddingVertical: 14,
|
|
2005
|
+
gap: 12
|
|
2006
|
+
},
|
|
2007
|
+
iconWrapper: {
|
|
2008
|
+
alignItems: "center",
|
|
2009
|
+
justifyContent: "center"
|
|
2010
|
+
},
|
|
2011
|
+
content: {
|
|
2012
|
+
flex: 1,
|
|
2013
|
+
gap: 3
|
|
2014
|
+
},
|
|
2015
|
+
title: {
|
|
2016
|
+
fontSize: 16,
|
|
2017
|
+
fontWeight: "500",
|
|
2018
|
+
lineHeight: 22
|
|
2019
|
+
},
|
|
2020
|
+
subtitle: {
|
|
2021
|
+
fontSize: 13,
|
|
2022
|
+
lineHeight: 18
|
|
2023
|
+
},
|
|
2024
|
+
trailing: {
|
|
2025
|
+
fontSize: 15
|
|
2026
|
+
},
|
|
2027
|
+
disabled: {
|
|
2028
|
+
opacity: 0.45
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
var nativeDriver4 = reactNative.Platform.OS !== "web";
|
|
2032
|
+
function Chip({ label, selected = false, onPress, style }) {
|
|
2033
|
+
const { colors } = useTheme();
|
|
2034
|
+
const scale = React23.useRef(new reactNative.Animated.Value(1)).current;
|
|
2035
|
+
const pressAnim = React23.useRef(new reactNative.Animated.Value(selected ? 1 : 0)).current;
|
|
2036
|
+
React23.useEffect(() => {
|
|
2037
|
+
reactNative.Animated.timing(pressAnim, {
|
|
2038
|
+
toValue: selected ? 1 : 0,
|
|
2039
|
+
duration: 150,
|
|
2040
|
+
easing: reactNative.Easing.out(reactNative.Easing.ease),
|
|
2041
|
+
useNativeDriver: false
|
|
2042
|
+
}).start();
|
|
2043
|
+
}, [selected, pressAnim]);
|
|
2044
|
+
const handlePressIn = () => {
|
|
2045
|
+
reactNative.Animated.spring(scale, {
|
|
2046
|
+
toValue: 0.95,
|
|
2047
|
+
useNativeDriver: nativeDriver4,
|
|
2048
|
+
speed: 40,
|
|
2049
|
+
bounciness: 0
|
|
2050
|
+
}).start();
|
|
2051
|
+
};
|
|
2052
|
+
const handlePressOut = () => {
|
|
2053
|
+
reactNative.Animated.spring(scale, {
|
|
2054
|
+
toValue: 1,
|
|
2055
|
+
useNativeDriver: nativeDriver4,
|
|
2056
|
+
speed: 40,
|
|
2057
|
+
bounciness: 4
|
|
2058
|
+
}).start();
|
|
2059
|
+
};
|
|
2060
|
+
const handlePress = () => {
|
|
2061
|
+
Haptics11__namespace.selectionAsync();
|
|
2062
|
+
onPress?.();
|
|
2063
|
+
};
|
|
2064
|
+
const backgroundColor = pressAnim.interpolate({
|
|
2065
|
+
inputRange: [0, 1],
|
|
2066
|
+
outputRange: [colors.secondary, colors.primary]
|
|
2067
|
+
});
|
|
2068
|
+
const textColor = pressAnim.interpolate({
|
|
2069
|
+
inputRange: [0, 1],
|
|
2070
|
+
outputRange: [colors.foreground, colors.primaryForeground]
|
|
2071
|
+
});
|
|
2072
|
+
const borderColor = pressAnim.interpolate({
|
|
2073
|
+
inputRange: [0, 1],
|
|
2074
|
+
outputRange: [colors.border, colors.primary]
|
|
2075
|
+
});
|
|
2076
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: [styles24.wrapper, { transform: [{ scale }] }, style] }, /* @__PURE__ */ React23__default.default.createElement(
|
|
2077
|
+
reactNative.TouchableOpacity,
|
|
2078
|
+
{
|
|
2079
|
+
onPress: handlePress,
|
|
2080
|
+
onPressIn: handlePressIn,
|
|
2081
|
+
onPressOut: handlePressOut,
|
|
2082
|
+
activeOpacity: 1,
|
|
2083
|
+
touchSoundDisabled: true
|
|
2084
|
+
},
|
|
2085
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.View, { style: [styles24.chip, { backgroundColor, borderColor }] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Animated.Text, { style: [styles24.label, { color: textColor }], allowFontScaling: true }, label))
|
|
2086
|
+
));
|
|
2087
|
+
}
|
|
2088
|
+
function ChipGroup({ options, value, onValueChange, style }) {
|
|
2089
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles24.group, style] }, options.map((opt) => /* @__PURE__ */ React23__default.default.createElement(
|
|
2090
|
+
Chip,
|
|
2091
|
+
{
|
|
2092
|
+
key: opt.value,
|
|
2093
|
+
label: opt.label,
|
|
2094
|
+
selected: opt.value === value,
|
|
2095
|
+
onPress: () => onValueChange?.(opt.value)
|
|
2096
|
+
}
|
|
2097
|
+
)));
|
|
2098
|
+
}
|
|
2099
|
+
var styles24 = reactNative.StyleSheet.create({
|
|
2100
|
+
wrapper: {},
|
|
2101
|
+
chip: {
|
|
2102
|
+
borderRadius: 999,
|
|
2103
|
+
paddingHorizontal: 14,
|
|
2104
|
+
paddingVertical: 8,
|
|
2105
|
+
borderWidth: 1.5,
|
|
2106
|
+
alignItems: "center",
|
|
2107
|
+
justifyContent: "center"
|
|
2108
|
+
},
|
|
2109
|
+
label: {
|
|
2110
|
+
fontSize: 14,
|
|
2111
|
+
fontWeight: "500",
|
|
2112
|
+
lineHeight: 20
|
|
2113
|
+
},
|
|
2114
|
+
group: {
|
|
2115
|
+
flexDirection: "row",
|
|
2116
|
+
flexWrap: "wrap",
|
|
2117
|
+
gap: 8
|
|
2118
|
+
}
|
|
2119
|
+
});
|
|
2120
|
+
function ConfirmDialog({
|
|
2121
|
+
visible,
|
|
2122
|
+
title,
|
|
2123
|
+
description,
|
|
2124
|
+
confirmLabel = "Confirm",
|
|
2125
|
+
cancelLabel = "Cancel",
|
|
2126
|
+
confirmVariant = "primary",
|
|
2127
|
+
onConfirm,
|
|
2128
|
+
onCancel
|
|
2129
|
+
}) {
|
|
2130
|
+
const { colors } = useTheme();
|
|
2131
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onCancel }, /* @__PURE__ */ React23__default.default.createElement(reactNative.TouchableOpacity, { style: styles25.overlay, activeOpacity: 1, onPress: onCancel }, /* @__PURE__ */ React23__default.default.createElement(
|
|
2132
|
+
reactNative.View,
|
|
2133
|
+
{
|
|
2134
|
+
style: [styles25.dialog, { backgroundColor: colors.card }],
|
|
2135
|
+
onStartShouldSetResponder: () => true
|
|
2136
|
+
},
|
|
2137
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles25.title, { color: colors.cardForeground }], allowFontScaling: true }, title),
|
|
2138
|
+
description ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles25.description, { color: colors.mutedForeground }], allowFontScaling: true }, description) : null,
|
|
2139
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: styles25.actions }, /* @__PURE__ */ React23__default.default.createElement(Button, { label: cancelLabel, variant: "outline", fullWidth: true, onPress: onCancel }), /* @__PURE__ */ React23__default.default.createElement(Button, { label: confirmLabel, variant: confirmVariant, fullWidth: true, onPress: onConfirm }))
|
|
2140
|
+
)));
|
|
2141
|
+
}
|
|
2142
|
+
var styles25 = reactNative.StyleSheet.create({
|
|
2143
|
+
overlay: {
|
|
2144
|
+
flex: 1,
|
|
2145
|
+
backgroundColor: "rgba(0,0,0,0.5)",
|
|
2146
|
+
justifyContent: "center",
|
|
2147
|
+
alignItems: "center",
|
|
2148
|
+
padding: 24
|
|
2149
|
+
},
|
|
2150
|
+
dialog: {
|
|
2151
|
+
width: "100%",
|
|
2152
|
+
maxWidth: 400,
|
|
2153
|
+
borderRadius: 16,
|
|
2154
|
+
padding: 24,
|
|
2155
|
+
gap: 12,
|
|
2156
|
+
shadowColor: "#000",
|
|
2157
|
+
shadowOffset: { width: 0, height: 8 },
|
|
2158
|
+
shadowOpacity: 0.15,
|
|
2159
|
+
shadowRadius: 16,
|
|
2160
|
+
elevation: 8
|
|
2161
|
+
},
|
|
2162
|
+
title: {
|
|
2163
|
+
fontSize: 18,
|
|
2164
|
+
fontWeight: "600",
|
|
2165
|
+
lineHeight: 26
|
|
2166
|
+
},
|
|
2167
|
+
description: {
|
|
2168
|
+
fontSize: 15,
|
|
2169
|
+
lineHeight: 22
|
|
2170
|
+
},
|
|
2171
|
+
actions: {
|
|
2172
|
+
gap: 10,
|
|
2173
|
+
marginTop: 8
|
|
2174
|
+
}
|
|
2175
|
+
});
|
|
2176
|
+
function LabelValue({ label, value, style }) {
|
|
2177
|
+
const { colors } = useTheme();
|
|
2178
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles26.container, style] }, /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles26.label, { color: colors.mutedForeground }], allowFontScaling: true }, label), typeof value === "string" ? /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles26.value, { color: colors.foreground }], allowFontScaling: true }, value) : value);
|
|
2179
|
+
}
|
|
2180
|
+
var styles26 = reactNative.StyleSheet.create({
|
|
2181
|
+
container: {
|
|
2182
|
+
flexDirection: "row",
|
|
2183
|
+
justifyContent: "space-between",
|
|
2184
|
+
alignItems: "center",
|
|
2185
|
+
gap: 12
|
|
2186
|
+
},
|
|
2187
|
+
label: {
|
|
2188
|
+
fontSize: 13,
|
|
2189
|
+
lineHeight: 18
|
|
2190
|
+
},
|
|
2191
|
+
value: {
|
|
2192
|
+
fontSize: 15,
|
|
2193
|
+
fontWeight: "500",
|
|
2194
|
+
lineHeight: 22,
|
|
2195
|
+
textAlign: "right"
|
|
2196
|
+
}
|
|
2197
|
+
});
|
|
2198
|
+
var MONTH_NAMES = [
|
|
2199
|
+
"January",
|
|
2200
|
+
"February",
|
|
2201
|
+
"March",
|
|
2202
|
+
"April",
|
|
2203
|
+
"May",
|
|
2204
|
+
"June",
|
|
2205
|
+
"July",
|
|
2206
|
+
"August",
|
|
2207
|
+
"September",
|
|
2208
|
+
"October",
|
|
2209
|
+
"November",
|
|
2210
|
+
"December"
|
|
2211
|
+
];
|
|
2212
|
+
function MonthPicker({ value, onChange, style }) {
|
|
2213
|
+
const { colors } = useTheme();
|
|
2214
|
+
const handlePrev = () => {
|
|
2215
|
+
Haptics11__namespace.selectionAsync();
|
|
2216
|
+
if (value.month === 1) {
|
|
2217
|
+
onChange({ month: 12, year: value.year - 1 });
|
|
2218
|
+
} else {
|
|
2219
|
+
onChange({ month: value.month - 1, year: value.year });
|
|
2220
|
+
}
|
|
2221
|
+
};
|
|
2222
|
+
const handleNext = () => {
|
|
2223
|
+
Haptics11__namespace.selectionAsync();
|
|
2224
|
+
if (value.month === 12) {
|
|
2225
|
+
onChange({ month: 1, year: value.year + 1 });
|
|
2226
|
+
} else {
|
|
2227
|
+
onChange({ month: value.month + 1, year: value.year });
|
|
2228
|
+
}
|
|
2229
|
+
};
|
|
2230
|
+
return /* @__PURE__ */ React23__default.default.createElement(reactNative.View, { style: [styles27.container, style] }, /* @__PURE__ */ React23__default.default.createElement(
|
|
2231
|
+
reactNative.TouchableOpacity,
|
|
2232
|
+
{
|
|
2233
|
+
style: styles27.arrow,
|
|
2234
|
+
onPress: handlePrev,
|
|
2235
|
+
activeOpacity: 0.6,
|
|
2236
|
+
touchSoundDisabled: true
|
|
2237
|
+
},
|
|
2238
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles27.arrowText, { color: colors.foreground }] }, "\u2039")
|
|
2239
|
+
), /* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles27.label, { color: colors.foreground }], allowFontScaling: true }, MONTH_NAMES[value.month - 1], " ", value.year), /* @__PURE__ */ React23__default.default.createElement(
|
|
2240
|
+
reactNative.TouchableOpacity,
|
|
2241
|
+
{
|
|
2242
|
+
style: styles27.arrow,
|
|
2243
|
+
onPress: handleNext,
|
|
2244
|
+
activeOpacity: 0.6,
|
|
2245
|
+
touchSoundDisabled: true
|
|
2246
|
+
},
|
|
2247
|
+
/* @__PURE__ */ React23__default.default.createElement(reactNative.Text, { style: [styles27.arrowText, { color: colors.foreground }] }, "\u203A")
|
|
2248
|
+
));
|
|
2249
|
+
}
|
|
2250
|
+
var styles27 = reactNative.StyleSheet.create({
|
|
2251
|
+
container: {
|
|
2252
|
+
flexDirection: "row",
|
|
2253
|
+
alignItems: "center",
|
|
2254
|
+
justifyContent: "space-between"
|
|
2255
|
+
},
|
|
2256
|
+
arrow: {
|
|
2257
|
+
width: 44,
|
|
2258
|
+
height: 44,
|
|
2259
|
+
alignItems: "center",
|
|
2260
|
+
justifyContent: "center"
|
|
2261
|
+
},
|
|
2262
|
+
arrowText: {
|
|
2263
|
+
fontSize: 24,
|
|
2264
|
+
lineHeight: 30
|
|
2265
|
+
},
|
|
2266
|
+
label: {
|
|
2267
|
+
fontSize: 17,
|
|
2268
|
+
fontWeight: "500",
|
|
2269
|
+
lineHeight: 24,
|
|
2270
|
+
textAlign: "center",
|
|
2271
|
+
minWidth: 160
|
|
2272
|
+
}
|
|
2273
|
+
});
|
|
1756
2274
|
|
|
1757
2275
|
Object.defineProperty(exports, "BottomSheetModalProvider", {
|
|
1758
2276
|
enumerable: true,
|
|
1759
2277
|
get: function () { return bottomSheet.BottomSheetModalProvider; }
|
|
1760
2278
|
});
|
|
1761
2279
|
exports.Accordion = Accordion;
|
|
1762
|
-
exports.
|
|
2280
|
+
exports.AlertBanner = AlertBanner;
|
|
1763
2281
|
exports.Avatar = Avatar;
|
|
1764
2282
|
exports.Badge = Badge;
|
|
1765
2283
|
exports.Button = Button;
|
|
@@ -1770,9 +2288,17 @@ exports.CardFooter = CardFooter;
|
|
|
1770
2288
|
exports.CardHeader = CardHeader;
|
|
1771
2289
|
exports.CardTitle = CardTitle;
|
|
1772
2290
|
exports.Checkbox = Checkbox;
|
|
2291
|
+
exports.Chip = Chip;
|
|
2292
|
+
exports.ChipGroup = ChipGroup;
|
|
2293
|
+
exports.ConfirmDialog = ConfirmDialog;
|
|
2294
|
+
exports.CurrencyDisplay = CurrencyDisplay;
|
|
1773
2295
|
exports.CurrencyInput = CurrencyInput;
|
|
2296
|
+
exports.CurrencyInputLarge = CurrencyInputLarge;
|
|
1774
2297
|
exports.EmptyState = EmptyState;
|
|
1775
2298
|
exports.Input = Input;
|
|
2299
|
+
exports.LabelValue = LabelValue;
|
|
2300
|
+
exports.ListItem = ListItem;
|
|
2301
|
+
exports.MonthPicker = MonthPicker;
|
|
1776
2302
|
exports.Progress = Progress;
|
|
1777
2303
|
exports.RadioGroup = RadioGroup;
|
|
1778
2304
|
exports.Select = Select;
|