@retray-dev/ui-kit 7.0.1 → 9.0.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 +554 -11
- package/EXAMPLES.md +2 -2
- package/README.md +14 -8
- package/dist/Accordion.js +57 -5
- package/dist/Accordion.mjs +4 -3
- package/dist/AlertBanner.js +4 -1
- package/dist/AlertBanner.mjs +3 -2
- package/dist/AppHeader.d.mts +40 -0
- package/dist/AppHeader.d.ts +40 -0
- package/dist/AppHeader.js +515 -0
- package/dist/AppHeader.mjs +10 -0
- package/dist/Avatar.js +39 -29
- package/dist/Avatar.mjs +2 -1
- package/dist/Badge.js +11 -1
- package/dist/Badge.mjs +2 -1
- package/dist/Button.d.mts +8 -3
- package/dist/Button.d.ts +8 -3
- package/dist/Button.js +126 -108
- package/dist/Button.mjs +6 -5
- package/dist/ButtonGroup.mjs +1 -0
- package/dist/Card.js +90 -70
- package/dist/Card.mjs +5 -4
- package/dist/CategoryStrip.js +79 -22
- package/dist/CategoryStrip.mjs +6 -6
- package/dist/Checkbox.js +118 -86
- package/dist/Checkbox.mjs +5 -5
- package/dist/Chip.js +113 -80
- package/dist/Chip.mjs +5 -5
- package/dist/ConfirmDialog.js +140 -110
- package/dist/ConfirmDialog.mjs +7 -6
- package/dist/CurrencyDisplay.mjs +1 -0
- package/dist/CurrencyInput.d.mts +1 -1
- package/dist/CurrencyInput.d.ts +1 -1
- package/dist/CurrencyInput.js +9 -5
- package/dist/CurrencyInput.mjs +5 -4
- package/dist/DetailRow.mjs +1 -0
- package/dist/EmptyState.js +131 -111
- package/dist/EmptyState.mjs +7 -6
- package/dist/ErrorBoundary.d.mts +42 -0
- package/dist/ErrorBoundary.d.ts +42 -0
- package/dist/ErrorBoundary.js +351 -0
- package/dist/ErrorBoundary.mjs +7 -0
- package/dist/Form.mjs +1 -0
- package/dist/HolographicCard.d.mts +55 -0
- package/dist/HolographicCard.d.ts +55 -0
- package/dist/HolographicCard.js +316 -0
- package/dist/HolographicCard.mjs +191 -0
- package/dist/IconButton.d.mts +8 -3
- package/dist/IconButton.d.ts +8 -3
- package/dist/IconButton.js +115 -98
- package/dist/IconButton.mjs +5 -4
- package/dist/ImageViewer.d.mts +23 -0
- package/dist/ImageViewer.d.ts +23 -0
- package/dist/ImageViewer.js +582 -0
- package/dist/ImageViewer.mjs +8 -0
- package/dist/Input.mjs +4 -3
- package/dist/LabelValue.mjs +1 -0
- package/dist/ListGroup.mjs +1 -0
- package/dist/ListItem.js +131 -117
- package/dist/ListItem.mjs +6 -5
- package/dist/MediaCard.js +54 -6
- package/dist/MediaCard.mjs +6 -5
- package/dist/MenuGroup.mjs +1 -0
- package/dist/MenuItem.js +91 -79
- package/dist/MenuItem.mjs +6 -5
- package/dist/MonthPicker.d.mts +10 -2
- package/dist/MonthPicker.d.ts +10 -2
- package/dist/MonthPicker.js +80 -17
- package/dist/MonthPicker.mjs +3 -2
- package/dist/PagerDots.d.mts +35 -0
- package/dist/PagerDots.d.ts +35 -0
- package/dist/PagerDots.js +392 -0
- package/dist/PagerDots.mjs +7 -0
- package/dist/Pressable.d.mts +5 -5
- package/dist/Pressable.d.ts +5 -5
- package/dist/Pressable.js +97 -86
- package/dist/Pressable.mjs +5 -4
- package/dist/PricingCard.d.mts +50 -0
- package/dist/PricingCard.d.ts +50 -0
- package/dist/PricingCard.js +636 -0
- package/dist/PricingCard.mjs +11 -0
- package/dist/Progress.mjs +3 -2
- package/dist/RadioGroup.js +81 -30
- package/dist/RadioGroup.mjs +5 -5
- package/dist/RetrayProvider.d.mts +2 -0
- package/dist/RetrayProvider.d.ts +2 -0
- package/dist/RetrayProvider.js +214 -0
- package/dist/RetrayProvider.mjs +5 -0
- package/dist/Select.js +51 -4
- package/dist/Select.mjs +5 -4
- package/dist/SelectableGrid.d.mts +44 -0
- package/dist/SelectableGrid.d.ts +44 -0
- package/dist/SelectableGrid.js +448 -0
- package/dist/SelectableGrid.mjs +9 -0
- package/dist/Separator.mjs +1 -0
- package/dist/Sheet.d.mts +13 -1
- package/dist/Sheet.d.ts +13 -1
- package/dist/Sheet.js +115 -5
- package/dist/Sheet.mjs +4 -2
- package/dist/Skeleton.d.mts +50 -0
- package/dist/Skeleton.d.ts +50 -0
- package/dist/Skeleton.js +61 -0
- package/dist/Skeleton.mjs +4 -2
- package/dist/Slider.js +51 -4
- package/dist/Slider.mjs +3 -2
- package/dist/Spinner.js +28 -7
- package/dist/Spinner.mjs +2 -1
- package/dist/Switch.js +98 -48
- package/dist/Switch.mjs +4 -3
- package/dist/TabBar.d.mts +42 -0
- package/dist/TabBar.d.ts +42 -0
- package/dist/TabBar.js +361 -0
- package/dist/TabBar.mjs +6 -0
- package/dist/Tabs.js +92 -62
- package/dist/Tabs.mjs +5 -4
- package/dist/Text.js +16 -0
- package/dist/Text.mjs +2 -1
- package/dist/Textarea.mjs +4 -3
- package/dist/Toast.d.mts +7 -7
- package/dist/Toast.d.ts +7 -7
- package/dist/Toast.mjs +1 -0
- package/dist/Toggle.d.mts +6 -3
- package/dist/Toggle.d.ts +6 -3
- package/dist/Toggle.js +135 -120
- package/dist/Toggle.mjs +5 -5
- package/dist/VirtualList.mjs +1 -0
- package/dist/{chunk-7H2OR44A.mjs → chunk-26BCI223.mjs} +1 -1
- package/dist/{chunk-CRYBX2CM.mjs → chunk-2TFTAWVJ.mjs} +44 -59
- package/dist/chunk-3DKJ2GIC.mjs +30 -0
- package/dist/{chunk-KWCPOM6W.mjs → chunk-3U4SSNWP.mjs} +32 -48
- package/dist/chunk-4I7D47FH.mjs +139 -0
- package/dist/chunk-4K625MVM.mjs +142 -0
- package/dist/{chunk-MN7OG7IY.mjs → chunk-6OAZJ577.mjs} +6 -4
- package/dist/{chunk-L7E7TVEZ.mjs → chunk-756RAKE4.mjs} +2 -2
- package/dist/{chunk-HSPSMN6U.mjs → chunk-7QHVVCB3.mjs} +2 -2
- package/dist/{chunk-URLL5JBR.mjs → chunk-A3A6KNQN.mjs} +3 -3
- package/dist/chunk-AJ7ZDNBT.mjs +120 -0
- package/dist/{chunk-FTLJOUOQ.mjs → chunk-AV4EMIRH.mjs} +25 -28
- package/dist/chunk-AZJF2BLK.mjs +115 -0
- package/dist/chunk-BNP626TY.mjs +159 -0
- package/dist/{chunk-5IKW3VNC.mjs → chunk-DVK4G2GT.mjs} +17 -1
- package/dist/{chunk-6LQYY7HC.mjs → chunk-EH745HE5.mjs} +2 -2
- package/dist/chunk-EJ7ZPXOH.mjs +163 -0
- package/dist/{chunk-RKLHUDZS.mjs → chunk-GD6KXMG5.mjs} +29 -15
- package/dist/{chunk-RR2VQLKE.mjs → chunk-GQYFLP3D.mjs} +14 -17
- package/dist/{chunk-Y6MXOREN.mjs → chunk-ID72TK46.mjs} +8 -17
- package/dist/{chunk-NQGVLMWG.mjs → chunk-JMOZEC77.mjs} +1 -1
- package/dist/{chunk-GCWOGZYL.mjs → chunk-JT7HKXRB.mjs} +39 -29
- package/dist/{chunk-LWG526VX.mjs → chunk-KIHCWCWL.mjs} +47 -62
- package/dist/chunk-LXJIIOYQ.mjs +104 -0
- package/dist/{chunk-SBZYEV4S.mjs → chunk-M6ZXVBTK.mjs} +5 -2
- package/dist/{chunk-XDMN67KV.mjs → chunk-MAC465BB.mjs} +10 -8
- package/dist/chunk-MBMXYJJV.mjs +36 -0
- package/dist/chunk-MLF3EZFW.mjs +119 -0
- package/dist/chunk-NA7PARID.mjs +147 -0
- package/dist/{chunk-QXGYKWI7.mjs → chunk-O3HA6TYM.mjs} +9 -4
- package/dist/{chunk-63357L2X.mjs → chunk-OB4JUQ3O.mjs} +1 -1
- package/dist/{chunk-AU2VDY4P.mjs → chunk-PFZTM6D5.mjs} +52 -4
- package/dist/chunk-QKH5ZOD5.mjs +97 -0
- package/dist/{chunk-KZJRQOIU.mjs → chunk-TERDKCLE.mjs} +11 -1
- package/dist/{chunk-U4N7WF4Z.mjs → chunk-UREA2GYY.mjs} +28 -23
- package/dist/{chunk-TAJ2PQ2O.mjs → chunk-VGTDN7SW.mjs} +7 -6
- package/dist/{chunk-URDE3EUU.mjs → chunk-VQ57HWPL.mjs} +27 -15
- package/dist/chunk-WBOOUHSS.mjs +62 -0
- package/dist/{chunk-GNGLDL6Z.mjs → chunk-WJLKJMKR.mjs} +18 -0
- package/dist/{chunk-YZJAFS4P.mjs → chunk-X4G6APW6.mjs} +22 -19
- package/dist/chunk-Y6FXYEAI.mjs +8 -0
- package/dist/chunk-YFZ3ELX5.mjs +16 -0
- package/dist/{chunk-QCNARS3X.mjs → chunk-YNROWHQJ.mjs} +1 -1
- package/dist/chunk-Z4BVUWW6.mjs +196 -0
- package/dist/{chunk-GPOUINK5.mjs → chunk-ZJKGQMYH.mjs} +10 -27
- package/dist/index-wt-orHUi.d.mts +85 -0
- package/dist/index-wt-orHUi.d.ts +85 -0
- package/dist/index.d.mts +59 -51
- package/dist/index.d.ts +59 -51
- package/dist/index.js +1940 -744
- package/dist/index.mjs +49 -39
- package/package.json +35 -5
- package/src/components/Accordion/Accordion.tsx +12 -1
- package/src/components/AlertBanner/AlertBanner.tsx +5 -0
- package/src/components/AppHeader/AppHeader.tsx +172 -0
- package/src/components/AppHeader/index.ts +1 -0
- package/src/components/Avatar/Avatar.tsx +10 -2
- package/src/components/Badge/Badge.tsx +8 -1
- package/src/components/Button/Button.tsx +20 -27
- package/src/components/Card/Card.tsx +12 -23
- package/src/components/CategoryStrip/CategoryStrip.tsx +17 -21
- package/src/components/Checkbox/Checkbox.tsx +26 -40
- package/src/components/Chip/Chip.tsx +24 -33
- package/src/components/CurrencyInput/CurrencyInput.tsx +10 -8
- package/src/components/EmptyState/EmptyState.tsx +2 -1
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +153 -0
- package/src/components/ErrorBoundary/index.ts +1 -0
- package/src/components/HolographicCard/HolographicCard.tsx +315 -0
- package/src/components/HolographicCard/index.ts +1 -0
- package/src/components/IconButton/IconButton.tsx +19 -27
- package/src/components/ImageViewer/ImageViewer.tsx +290 -0
- package/src/components/ImageViewer/index.ts +1 -0
- package/src/components/ListItem/ListItem.tsx +70 -67
- package/src/components/MediaCard/MediaCard.tsx +8 -2
- package/src/components/MenuItem/MenuItem.tsx +10 -25
- package/src/components/MonthPicker/MonthPicker.tsx +39 -13
- package/src/components/MonthPicker/index.ts +1 -1
- package/src/components/PagerDots/PagerDots.tsx +200 -0
- package/src/components/PagerDots/index.ts +1 -0
- package/src/components/Pressable/Pressable.tsx +19 -35
- package/src/components/PricingCard/PricingCard.tsx +220 -0
- package/src/components/PricingCard/index.ts +1 -0
- package/src/components/RadioGroup/RadioGroup.tsx +14 -27
- package/src/components/RetrayProvider/RetrayProvider.tsx +59 -0
- package/src/components/RetrayProvider/index.ts +1 -0
- package/src/components/SelectableGrid/SelectableGrid.tsx +205 -0
- package/src/components/SelectableGrid/index.ts +1 -0
- package/src/components/Sheet/Sheet.tsx +65 -1
- package/src/components/Skeleton/Skeleton.tsx +142 -1
- package/src/components/Spinner/Spinner.tsx +17 -2
- package/src/components/Switch/Switch.tsx +30 -58
- package/src/components/TabBar/TabBar.tsx +169 -0
- package/src/components/TabBar/index.ts +1 -0
- package/src/components/Tabs/Tabs.tsx +23 -26
- package/src/components/Text/Text.tsx +2 -0
- package/src/components/Toggle/Toggle.tsx +35 -51
- package/src/fonts.ts +4 -1
- package/src/index.ts +23 -2
- package/src/utils/animations.ts +29 -1
- package/src/utils/fontGuard.ts +34 -0
- package/src/utils/haptics.ts +211 -9
- package/src/utils/pressable.ts +66 -0
- package/dist/chunk-76PFOSM2.mjs +0 -41
- package/dist/chunk-DITNP6PL.mjs +0 -106
- package/dist/chunk-JBLL7U3U.mjs +0 -64
- package/dist/chunk-LG4DO3DK.mjs +0 -174
- package/dist/chunk-RMMK64W5.mjs +0 -54
- package/dist/chunk-RTC3CFXF.mjs +0 -29
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { impactLight } from './chunk-
|
|
3
|
-
import { SPRINGS, PRESS_SCALE } from './chunk-5IKW3VNC.mjs';
|
|
1
|
+
import { PressableCard } from './chunk-3DKJ2GIC.mjs';
|
|
2
|
+
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
4
3
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
5
4
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
5
|
import { vs, s, mvs, ms } from './chunk-2CE3TQVY.mjs';
|
|
7
6
|
import React from 'react';
|
|
8
|
-
import { StyleSheet, View,
|
|
9
|
-
import Animated from 'react-native-reanimated';
|
|
7
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
10
8
|
|
|
11
9
|
function Card({ children, variant = "elevated", onPress, style, accessibilityLabel }) {
|
|
12
10
|
const { colors } = useTheme();
|
|
13
|
-
const { animatedStyle, onPressIn, onPressOut, hoverHandlers } = usePressScale({
|
|
14
|
-
pressScale: PRESS_SCALE.card,
|
|
15
|
-
pressInSpring: SPRINGS.surfacePressIn,
|
|
16
|
-
pressOutSpring: SPRINGS.surfacePressOut,
|
|
17
|
-
disabled: !onPress
|
|
18
|
-
});
|
|
19
11
|
const handlePress = () => {
|
|
20
12
|
if (!onPress) return;
|
|
21
13
|
impactLight();
|
|
@@ -49,19 +41,18 @@ function Card({ children, variant = "elevated", onPress, style, accessibilityLab
|
|
|
49
41
|
}[variant];
|
|
50
42
|
const cardContent = /* @__PURE__ */ React.createElement(View, { style: [styles.card, variantStyle, style] }, children);
|
|
51
43
|
if (onPress) {
|
|
52
|
-
return /* @__PURE__ */ React.createElement(
|
|
53
|
-
|
|
44
|
+
return /* @__PURE__ */ React.createElement(
|
|
45
|
+
PressableCard,
|
|
54
46
|
{
|
|
55
47
|
onPress: handlePress,
|
|
56
|
-
|
|
57
|
-
onPressOut,
|
|
58
|
-
activeOpacity: 1,
|
|
48
|
+
rippleColor: "transparent",
|
|
59
49
|
touchSoundDisabled: true,
|
|
50
|
+
activateOnHover: true,
|
|
60
51
|
accessibilityRole: "button",
|
|
61
52
|
accessibilityLabel
|
|
62
53
|
},
|
|
63
54
|
cardContent
|
|
64
|
-
)
|
|
55
|
+
);
|
|
65
56
|
}
|
|
66
57
|
return cardContent;
|
|
67
58
|
}
|
|
@@ -38,7 +38,7 @@ function AvatarBase({ src, fallback, fallbackText, size = "md", status, style })
|
|
|
38
38
|
const showFallback = !src || imageError;
|
|
39
39
|
const statusSize = typeof size === "number" ? size * 0.25 : statusSizeMap[size];
|
|
40
40
|
const statusColor = {
|
|
41
|
-
online:
|
|
41
|
+
online: colors.success,
|
|
42
42
|
offline: "transparent",
|
|
43
43
|
busy: colors.destructive,
|
|
44
44
|
away: colors.warning
|
|
@@ -50,36 +50,46 @@ function AvatarBase({ src, fallback, fallbackText, size = "md", status, style })
|
|
|
50
50
|
backgroundColor: colors.surface,
|
|
51
51
|
overflow: "hidden"
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
source: { uri: src },
|
|
57
|
-
style: { width: dimension, height: dimension },
|
|
58
|
-
onError: () => setImageError(true)
|
|
59
|
-
}
|
|
60
|
-
) : /* @__PURE__ */ React.createElement(
|
|
61
|
-
Text,
|
|
62
|
-
{
|
|
63
|
-
style: [styles.fallback, { color: colors.foregroundMuted, fontSize }],
|
|
64
|
-
allowFontScaling: true
|
|
65
|
-
},
|
|
66
|
-
getInitials(fallback, fallbackText)
|
|
67
|
-
)), status && /* @__PURE__ */ React.createElement(
|
|
53
|
+
const a11yLabel = fallbackText || fallback || "Avatar";
|
|
54
|
+
return /* @__PURE__ */ React.createElement(
|
|
68
55
|
View,
|
|
69
56
|
{
|
|
70
|
-
style: [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
57
|
+
style: [styles.wrapper, style],
|
|
58
|
+
accessibilityRole: "image",
|
|
59
|
+
accessibilityLabel: a11yLabel
|
|
60
|
+
},
|
|
61
|
+
/* @__PURE__ */ React.createElement(View, { style: [styles.base, containerStyle] }, !showFallback ? /* @__PURE__ */ React.createElement(
|
|
62
|
+
Image,
|
|
63
|
+
{
|
|
64
|
+
source: { uri: src },
|
|
65
|
+
style: { width: dimension, height: dimension },
|
|
66
|
+
onError: () => setImageError(true)
|
|
67
|
+
}
|
|
68
|
+
) : /* @__PURE__ */ React.createElement(
|
|
69
|
+
Text,
|
|
70
|
+
{
|
|
71
|
+
style: [styles.fallback, { color: colors.foregroundMuted, fontSize }],
|
|
72
|
+
allowFontScaling: true
|
|
73
|
+
},
|
|
74
|
+
getInitials(fallback, fallbackText)
|
|
75
|
+
)),
|
|
76
|
+
status && /* @__PURE__ */ React.createElement(
|
|
77
|
+
View,
|
|
78
|
+
{
|
|
79
|
+
style: [
|
|
80
|
+
styles.statusDot,
|
|
81
|
+
{
|
|
82
|
+
width: statusSize,
|
|
83
|
+
height: statusSize,
|
|
84
|
+
borderRadius: statusSize / 2,
|
|
85
|
+
backgroundColor: statusColor[status],
|
|
86
|
+
borderWidth: status === "offline" ? 2 : 1.5,
|
|
87
|
+
borderColor: status === "offline" ? colors.border : colors.background
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
);
|
|
83
93
|
}
|
|
84
94
|
var Avatar = React.memo(AvatarBase);
|
|
85
95
|
var styles = StyleSheet.create({
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
2
|
+
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
|
+
import { COLOR_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
2
4
|
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
3
|
-
import { usePressScale } from './chunk-QCNARS3X.mjs';
|
|
4
|
-
import { selectionAsync } from './chunk-RTC3CFXF.mjs';
|
|
5
|
-
import { PRESS_SCALE } from './chunk-5IKW3VNC.mjs';
|
|
6
5
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
7
6
|
import { vs, s, ms } from './chunk-2CE3TQVY.mjs';
|
|
8
7
|
import React from 'react';
|
|
9
|
-
import { StyleSheet,
|
|
10
|
-
import
|
|
8
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
9
|
+
import { EaseView } from 'react-native-ease';
|
|
11
10
|
import { FontAwesome5 } from '@expo/vector-icons';
|
|
12
11
|
|
|
13
12
|
function ToggleIcon({ pressed, iconName, activeIconName, icon, activeIcon, iconColor, activeIconColor, iconSize, primaryColor, mutedColor }) {
|
|
@@ -47,75 +46,61 @@ function Toggle({
|
|
|
47
46
|
activeIconColor,
|
|
48
47
|
disabled,
|
|
49
48
|
style,
|
|
50
|
-
accessibilityLabel
|
|
51
|
-
...props
|
|
49
|
+
accessibilityLabel
|
|
52
50
|
}) {
|
|
53
51
|
const { colors } = useTheme();
|
|
54
|
-
const { animatedStyle: scaleStyle, onPressIn, onPressOut, hoverHandlers } = usePressScale({
|
|
55
|
-
pressScale: PRESS_SCALE.button,
|
|
56
|
-
disabled
|
|
57
|
-
});
|
|
58
|
-
const progress = useColorTransition(pressed);
|
|
59
52
|
const inactiveBorder = variant === "outline" ? colors.border : "transparent";
|
|
60
|
-
const surfaceStyle = useAnimatedStyle(() => ({
|
|
61
|
-
borderColor: interpolateColor(progress.value, [0, 1], [inactiveBorder, colors.primary]),
|
|
62
|
-
backgroundColor: interpolateColor(progress.value, [0, 1], ["transparent", colors.surfaceStrong])
|
|
63
|
-
}));
|
|
64
|
-
const textStyle = useAnimatedStyle(() => ({
|
|
65
|
-
color: interpolateColor(progress.value, [0, 1], [colors.foreground, colors.primary])
|
|
66
|
-
}));
|
|
67
53
|
const iconSize = iconSizeMap[size];
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
const handlePress = () => {
|
|
55
|
+
selectionAsync();
|
|
56
|
+
onPressedChange?.(!pressed);
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ React.createElement(View, { style: [disabled && styles.disabled, style] }, /* @__PURE__ */ React.createElement(
|
|
59
|
+
PressableButton,
|
|
70
60
|
{
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
onPress: handlePress,
|
|
62
|
+
enabled: !disabled,
|
|
63
|
+
rippleColor: "transparent",
|
|
64
|
+
touchSoundDisabled: true,
|
|
65
|
+
activateOnHover: true,
|
|
66
|
+
accessibilityRole: "button",
|
|
67
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
68
|
+
accessibilityState: { selected: pressed, disabled: !!disabled }
|
|
73
69
|
},
|
|
74
70
|
/* @__PURE__ */ React.createElement(
|
|
75
|
-
|
|
71
|
+
EaseView,
|
|
76
72
|
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
style: [styles.base, sizeStyles[size], { borderWidth: 2 }],
|
|
74
|
+
animate: {
|
|
75
|
+
borderColor: pressed ? colors.primary : inactiveBorder,
|
|
76
|
+
backgroundColor: pressed ? colors.surfaceStrong : "transparent"
|
|
80
77
|
},
|
|
81
|
-
|
|
82
|
-
onPressOut,
|
|
83
|
-
disabled,
|
|
84
|
-
activeOpacity: 1,
|
|
85
|
-
touchSoundDisabled: true,
|
|
86
|
-
accessibilityRole: "button",
|
|
87
|
-
accessibilityLabel: accessibilityLabel ?? label,
|
|
88
|
-
accessibilityState: { selected: pressed, disabled: !!disabled },
|
|
89
|
-
...props
|
|
78
|
+
transition: COLOR_TRANSITION
|
|
90
79
|
},
|
|
91
|
-
/* @__PURE__ */ React.createElement(
|
|
92
|
-
|
|
80
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.inner }, /* @__PURE__ */ React.createElement(
|
|
81
|
+
ToggleIcon,
|
|
82
|
+
{
|
|
83
|
+
pressed,
|
|
84
|
+
iconName,
|
|
85
|
+
activeIconName,
|
|
86
|
+
icon,
|
|
87
|
+
activeIcon,
|
|
88
|
+
iconColor,
|
|
89
|
+
activeIconColor,
|
|
90
|
+
iconSize,
|
|
91
|
+
primaryColor: colors.primary,
|
|
92
|
+
mutedColor: colors.foregroundMuted
|
|
93
|
+
}
|
|
94
|
+
), label ? /* @__PURE__ */ React.createElement(
|
|
95
|
+
Text,
|
|
93
96
|
{
|
|
94
|
-
style: [
|
|
95
|
-
|
|
96
|
-
sizeStyles[size],
|
|
97
|
-
{ borderWidth: 2 },
|
|
98
|
-
surfaceStyle
|
|
99
|
-
]
|
|
97
|
+
style: [styles.label, { color: pressed ? colors.primary : colors.foreground }],
|
|
98
|
+
allowFontScaling: true
|
|
100
99
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
pressed,
|
|
105
|
-
iconName,
|
|
106
|
-
activeIconName,
|
|
107
|
-
icon,
|
|
108
|
-
activeIcon,
|
|
109
|
-
iconColor,
|
|
110
|
-
activeIconColor,
|
|
111
|
-
iconSize,
|
|
112
|
-
primaryColor: colors.primary,
|
|
113
|
-
mutedColor: colors.foregroundMuted
|
|
114
|
-
}
|
|
115
|
-
), label ? /* @__PURE__ */ React.createElement(Animated.Text, { style: [styles.label, textStyle], allowFontScaling: true }, label) : null)
|
|
116
|
-
)
|
|
100
|
+
label
|
|
101
|
+
) : null)
|
|
117
102
|
)
|
|
118
|
-
);
|
|
103
|
+
));
|
|
119
104
|
}
|
|
120
105
|
var styles = StyleSheet.create({
|
|
121
106
|
base: {
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
+
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
3
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
4
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
5
|
+
import { ms, vs, s, mvs } from './chunk-2CE3TQVY.mjs';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
|
|
8
|
+
|
|
9
|
+
function DefaultErrorFallback({
|
|
10
|
+
error,
|
|
11
|
+
reset,
|
|
12
|
+
title = "Something went wrong",
|
|
13
|
+
message
|
|
14
|
+
}) {
|
|
15
|
+
const { colors } = useTheme();
|
|
16
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.container, { backgroundColor: colors.background }], accessibilityRole: "alert" }, /* @__PURE__ */ React.createElement(View, { style: [styles.iconCircle, { backgroundColor: colors.destructiveTint }] }, renderIcon("alert-triangle", ms(28), colors.destructive)), /* @__PURE__ */ React.createElement(Text, { style: [styles.title, { color: colors.foreground }], allowFontScaling: true }, title), /* @__PURE__ */ React.createElement(Text, { style: [styles.message, { color: colors.foregroundMuted }], allowFontScaling: true }, message ?? error.message ?? "An unexpected error occurred."), /* @__PURE__ */ React.createElement(
|
|
17
|
+
TouchableOpacity,
|
|
18
|
+
{
|
|
19
|
+
style: [styles.button, { backgroundColor: colors.primary }],
|
|
20
|
+
onPress: () => {
|
|
21
|
+
impactLight();
|
|
22
|
+
reset();
|
|
23
|
+
},
|
|
24
|
+
activeOpacity: 0.85,
|
|
25
|
+
touchSoundDisabled: true,
|
|
26
|
+
accessibilityRole: "button",
|
|
27
|
+
accessibilityLabel: "Try again"
|
|
28
|
+
},
|
|
29
|
+
/* @__PURE__ */ React.createElement(Text, { style: [styles.buttonLabel, { color: colors.primaryForeground }], allowFontScaling: true }, "Try again")
|
|
30
|
+
));
|
|
31
|
+
}
|
|
32
|
+
var ErrorBoundary = class extends React.Component {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.state = { error: null };
|
|
36
|
+
this.reset = () => {
|
|
37
|
+
this.setState({ error: null });
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static getDerivedStateFromError(error) {
|
|
41
|
+
return { error };
|
|
42
|
+
}
|
|
43
|
+
componentDidCatch(error, info) {
|
|
44
|
+
this.props.onError?.(error, info);
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
const { error } = this.state;
|
|
48
|
+
if (error) {
|
|
49
|
+
const { fallback, title, message } = this.props;
|
|
50
|
+
if (typeof fallback === "function") {
|
|
51
|
+
return fallback({ error, reset: this.reset });
|
|
52
|
+
}
|
|
53
|
+
if (fallback !== void 0) {
|
|
54
|
+
return fallback;
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ React.createElement(DefaultErrorFallback, { error, reset: this.reset, title, message });
|
|
57
|
+
}
|
|
58
|
+
return this.props.children;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var styles = StyleSheet.create({
|
|
62
|
+
container: {
|
|
63
|
+
flex: 1,
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
justifyContent: "center",
|
|
66
|
+
paddingHorizontal: s(32),
|
|
67
|
+
gap: vs(12)
|
|
68
|
+
},
|
|
69
|
+
iconCircle: {
|
|
70
|
+
width: s(64),
|
|
71
|
+
height: s(64),
|
|
72
|
+
borderRadius: RADIUS.full,
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
justifyContent: "center",
|
|
75
|
+
marginBottom: vs(4)
|
|
76
|
+
},
|
|
77
|
+
title: {
|
|
78
|
+
fontFamily: "Sohne-SemiBold",
|
|
79
|
+
fontSize: ms(18),
|
|
80
|
+
lineHeight: mvs(24),
|
|
81
|
+
textAlign: "center"
|
|
82
|
+
},
|
|
83
|
+
message: {
|
|
84
|
+
fontFamily: "Sohne-Regular",
|
|
85
|
+
fontSize: ms(14),
|
|
86
|
+
lineHeight: mvs(20),
|
|
87
|
+
textAlign: "center"
|
|
88
|
+
},
|
|
89
|
+
button: {
|
|
90
|
+
marginTop: vs(8),
|
|
91
|
+
paddingHorizontal: s(20),
|
|
92
|
+
paddingVertical: vs(10),
|
|
93
|
+
borderRadius: RADIUS.md,
|
|
94
|
+
minHeight: vs(44),
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
justifyContent: "center"
|
|
97
|
+
},
|
|
98
|
+
buttonLabel: {
|
|
99
|
+
fontFamily: "Sohne-Medium",
|
|
100
|
+
fontSize: ms(15)
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export { ErrorBoundary };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
2
1
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
2
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
3
3
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import { ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React from 'react';
|
|
@@ -19,6 +19,7 @@ function AlertBanner({ title, description, variant = "default", icon, iconName,
|
|
|
19
19
|
/* @__PURE__ */ React.createElement(Entypo, { name: "info-with-circle", size: ms(16), color: accentColor })
|
|
20
20
|
);
|
|
21
21
|
const effectiveIcon = iconName ? renderIcon(iconName, ms(16), iconColor ?? accentColor) : icon ?? defaultIcon;
|
|
22
|
+
const a11yLabel = description ? `${title}. ${description}` : title;
|
|
22
23
|
return /* @__PURE__ */ React.createElement(
|
|
23
24
|
View,
|
|
24
25
|
{
|
|
@@ -26,7 +27,9 @@ function AlertBanner({ title, description, variant = "default", icon, iconName,
|
|
|
26
27
|
styles.container,
|
|
27
28
|
{ backgroundColor: bgColor, borderWidth: 1, borderColor },
|
|
28
29
|
style
|
|
29
|
-
]
|
|
30
|
+
],
|
|
31
|
+
accessibilityRole: "alert",
|
|
32
|
+
accessibilityLabel: a11yLabel
|
|
30
33
|
},
|
|
31
34
|
/* @__PURE__ */ React.createElement(View, { style: styles.iconSlot }, effectiveIcon),
|
|
32
35
|
/* @__PURE__ */ React.createElement(View, { style: styles.content }, /* @__PURE__ */ React.createElement(Text, { style: [styles.title, { color: colors.foreground }], allowFontScaling: true }, title), description ? /* @__PURE__ */ React.createElement(Text, { style: [styles.description, { color: colors.foreground, opacity: 0.85 }], allowFontScaling: true }, description) : null)
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Input } from './chunk-
|
|
2
|
-
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
3
|
-
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
1
|
+
import { Input } from './chunk-756RAKE4.mjs';
|
|
4
2
|
import { ms, vs } from './chunk-2CE3TQVY.mjs';
|
|
5
3
|
import React from 'react';
|
|
6
4
|
|
|
@@ -24,7 +22,6 @@ function CurrencyInput({
|
|
|
24
22
|
containerStyle,
|
|
25
23
|
style
|
|
26
24
|
}) {
|
|
27
|
-
const { colors } = useTheme();
|
|
28
25
|
const handleChange = (text) => {
|
|
29
26
|
const withoutPrefix = prefix && text.startsWith(prefix) ? text.slice(prefix.length) : text;
|
|
30
27
|
const formatted = formatCurrency(withoutPrefix, thousandsSeparator);
|
|
@@ -34,8 +31,12 @@ function CurrencyInput({
|
|
|
34
31
|
const raw = parseFloat(formatted.replace(separatorRegex, "") || "0");
|
|
35
32
|
onChangeValue?.(isNaN(raw) ? 0 : raw);
|
|
36
33
|
};
|
|
37
|
-
const
|
|
38
|
-
const
|
|
34
|
+
const isLarge = size === "large";
|
|
35
|
+
const inputStyle = isLarge ? { fontFamily: "Sohne-Regular", fontSize: ms(36) } : { fontFamily: "Sohne-Regular" };
|
|
36
|
+
const prefixStyle = {
|
|
37
|
+
fontFamily: "Sohne-Regular",
|
|
38
|
+
fontSize: isLarge ? ms(32) : ms(17)
|
|
39
|
+
};
|
|
39
40
|
const displayValue = value && prefix && value.startsWith(prefix) ? value.slice(prefix.length) : value;
|
|
40
41
|
return /* @__PURE__ */ React.createElement(
|
|
41
42
|
Input,
|
|
@@ -48,9 +49,10 @@ function CurrencyInput({
|
|
|
48
49
|
hint,
|
|
49
50
|
placeholder: placeholder ?? "0",
|
|
50
51
|
editable,
|
|
51
|
-
prefix
|
|
52
|
+
prefix,
|
|
53
|
+
prefixStyle,
|
|
52
54
|
containerStyle,
|
|
53
|
-
inputWrapperStyle:
|
|
55
|
+
inputWrapperStyle: isLarge ? { paddingVertical: vs(16), minHeight: 72 } : void 0,
|
|
54
56
|
style: [inputStyle, style]
|
|
55
57
|
}
|
|
56
58
|
);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PressableCard } from './chunk-3DKJ2GIC.mjs';
|
|
2
|
+
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
3
|
+
import { PRESS_SCALE } from './chunk-DVK4G2GT.mjs';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
function Pressable({
|
|
7
|
+
children,
|
|
8
|
+
onPress,
|
|
9
|
+
pressScale: _pressScale = PRESS_SCALE.card,
|
|
10
|
+
haptics = true,
|
|
11
|
+
style,
|
|
12
|
+
disabled,
|
|
13
|
+
hoverScale: _hoverScale = 1.02
|
|
14
|
+
}) {
|
|
15
|
+
const handlePress = () => {
|
|
16
|
+
if (disabled || !onPress) return;
|
|
17
|
+
if (haptics) impactLight();
|
|
18
|
+
onPress();
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ React.createElement(
|
|
21
|
+
PressableCard,
|
|
22
|
+
{
|
|
23
|
+
style,
|
|
24
|
+
onPress: handlePress,
|
|
25
|
+
enabled: !disabled,
|
|
26
|
+
rippleColor: "transparent",
|
|
27
|
+
touchSoundDisabled: true,
|
|
28
|
+
activateOnHover: true,
|
|
29
|
+
accessibilityRole: "button",
|
|
30
|
+
accessibilityState: { disabled: !!disabled }
|
|
31
|
+
},
|
|
32
|
+
children
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { Pressable };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
3
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
|
+
import { ms, s, vs, mvs } from './chunk-2CE3TQVY.mjs';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { StyleSheet, View, TouchableOpacity, Text } from 'react-native';
|
|
7
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
8
|
+
|
|
9
|
+
function TabBar({
|
|
10
|
+
items,
|
|
11
|
+
activeKey,
|
|
12
|
+
onTabPress,
|
|
13
|
+
activeColor,
|
|
14
|
+
inactiveColor,
|
|
15
|
+
withSafeArea = true,
|
|
16
|
+
style
|
|
17
|
+
}) {
|
|
18
|
+
const { colors } = useTheme();
|
|
19
|
+
const insets = useSafeAreaInsets();
|
|
20
|
+
const resolvedActive = activeColor ?? colors.primary;
|
|
21
|
+
const resolvedInactive = inactiveColor ?? colors.foregroundMuted;
|
|
22
|
+
return /* @__PURE__ */ React.createElement(
|
|
23
|
+
View,
|
|
24
|
+
{
|
|
25
|
+
style: [
|
|
26
|
+
styles.container,
|
|
27
|
+
{
|
|
28
|
+
backgroundColor: colors.card,
|
|
29
|
+
borderTopColor: colors.border,
|
|
30
|
+
paddingBottom: withSafeArea ? insets.bottom : 0
|
|
31
|
+
},
|
|
32
|
+
style
|
|
33
|
+
],
|
|
34
|
+
accessibilityRole: "tablist"
|
|
35
|
+
},
|
|
36
|
+
items.map((item) => {
|
|
37
|
+
const active = item.key === activeKey;
|
|
38
|
+
const tint = active ? resolvedActive : resolvedInactive;
|
|
39
|
+
const iconNode = item.icon ?? (item.iconName ? renderIcon(item.iconName, ms(24), tint) : null);
|
|
40
|
+
const showBadge = item.badge !== void 0 && item.badge !== false;
|
|
41
|
+
const badgeCount = typeof item.badge === "number" ? item.badge : void 0;
|
|
42
|
+
return /* @__PURE__ */ React.createElement(
|
|
43
|
+
TouchableOpacity,
|
|
44
|
+
{
|
|
45
|
+
key: item.key,
|
|
46
|
+
style: styles.tab,
|
|
47
|
+
onPress: () => {
|
|
48
|
+
if (!active) selectionAsync();
|
|
49
|
+
onTabPress(item.key);
|
|
50
|
+
},
|
|
51
|
+
activeOpacity: 0.7,
|
|
52
|
+
touchSoundDisabled: true,
|
|
53
|
+
accessibilityRole: "tab",
|
|
54
|
+
accessibilityState: { selected: active },
|
|
55
|
+
accessibilityLabel: item.label ?? item.key
|
|
56
|
+
},
|
|
57
|
+
/* @__PURE__ */ React.createElement(View, null, iconNode, showBadge ? /* @__PURE__ */ React.createElement(
|
|
58
|
+
View,
|
|
59
|
+
{
|
|
60
|
+
style: [
|
|
61
|
+
styles.badge,
|
|
62
|
+
{ backgroundColor: colors.destructive, borderColor: colors.card },
|
|
63
|
+
badgeCount === void 0 && styles.badgeDot
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
badgeCount !== void 0 ? /* @__PURE__ */ React.createElement(Text, { style: [styles.badgeText, { color: colors.destructiveForeground }], allowFontScaling: false }, badgeCount > 99 ? "99+" : badgeCount) : null
|
|
67
|
+
) : null),
|
|
68
|
+
item.label ? /* @__PURE__ */ React.createElement(Text, { style: [styles.label, { color: tint }], numberOfLines: 1, allowFontScaling: true }, item.label) : null
|
|
69
|
+
);
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
var styles = StyleSheet.create({
|
|
74
|
+
container: {
|
|
75
|
+
flexDirection: "row",
|
|
76
|
+
borderTopWidth: StyleSheet.hairlineWidth
|
|
77
|
+
},
|
|
78
|
+
tab: {
|
|
79
|
+
flex: 1,
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
justifyContent: "center",
|
|
82
|
+
paddingTop: vs(8),
|
|
83
|
+
paddingBottom: vs(6),
|
|
84
|
+
gap: vs(2),
|
|
85
|
+
minHeight: vs(48)
|
|
86
|
+
},
|
|
87
|
+
label: {
|
|
88
|
+
fontFamily: "Sohne-Medium",
|
|
89
|
+
fontSize: ms(11),
|
|
90
|
+
lineHeight: mvs(14)
|
|
91
|
+
},
|
|
92
|
+
badge: {
|
|
93
|
+
position: "absolute",
|
|
94
|
+
top: -vs(4),
|
|
95
|
+
right: -s(10),
|
|
96
|
+
minWidth: s(16),
|
|
97
|
+
height: s(16),
|
|
98
|
+
borderRadius: s(8),
|
|
99
|
+
borderWidth: 1.5,
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
justifyContent: "center",
|
|
102
|
+
paddingHorizontal: s(3)
|
|
103
|
+
},
|
|
104
|
+
badgeDot: {
|
|
105
|
+
minWidth: s(10),
|
|
106
|
+
height: s(10),
|
|
107
|
+
borderRadius: s(5),
|
|
108
|
+
top: -vs(2),
|
|
109
|
+
right: -s(6),
|
|
110
|
+
paddingHorizontal: 0
|
|
111
|
+
},
|
|
112
|
+
badgeText: {
|
|
113
|
+
fontFamily: "Sohne-SemiBold",
|
|
114
|
+
fontSize: ms(9),
|
|
115
|
+
lineHeight: ms(11)
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export { TabBar };
|