@retray-dev/ui-kit 7.0.1 → 9.1.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 +567 -14
- package/EXAMPLES.md +21 -14
- 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,15 +1,14 @@
|
|
|
1
|
+
import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
2
|
+
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
1
3
|
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
2
|
-
import { usePressScale } from './chunk-QCNARS3X.mjs';
|
|
3
|
-
import { impactLight } from './chunk-RTC3CFXF.mjs';
|
|
4
|
-
import { PRESS_SCALE } from './chunk-5IKW3VNC.mjs';
|
|
5
4
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
5
|
import { s, ms } from './chunk-2CE3TQVY.mjs';
|
|
7
6
|
import React from 'react';
|
|
8
|
-
import { StyleSheet,
|
|
9
|
-
import Animated from 'react-native-reanimated';
|
|
7
|
+
import { StyleSheet, View, ActivityIndicator, Text } from 'react-native';
|
|
10
8
|
|
|
11
9
|
var sizeMap = {
|
|
12
|
-
|
|
10
|
+
// AUDIT FIX: sm was 32pt — below Apple HIG 44pt minimum touch target.
|
|
11
|
+
sm: { container: s(44), icon: 18 },
|
|
13
12
|
md: { container: s(44), icon: 20 },
|
|
14
13
|
lg: { container: s(52), icon: 24 }
|
|
15
14
|
};
|
|
@@ -25,18 +24,13 @@ function IconButtonBase({
|
|
|
25
24
|
style,
|
|
26
25
|
onPress,
|
|
27
26
|
accessibilityLabel,
|
|
28
|
-
accessibilityHint
|
|
29
|
-
...props
|
|
27
|
+
accessibilityHint
|
|
30
28
|
}) {
|
|
31
29
|
const { colors } = useTheme();
|
|
32
30
|
const isDisabled = disabled || loading;
|
|
33
|
-
const
|
|
34
|
-
pressScale: PRESS_SCALE.button,
|
|
35
|
-
disabled: isDisabled
|
|
36
|
-
});
|
|
37
|
-
const handlePress = (e) => {
|
|
31
|
+
const handlePress = () => {
|
|
38
32
|
impactLight();
|
|
39
|
-
onPress?.(
|
|
33
|
+
onPress?.();
|
|
40
34
|
};
|
|
41
35
|
const containerVariantStyle = {
|
|
42
36
|
primary: { backgroundColor: colors.primary },
|
|
@@ -58,42 +52,32 @@ function IconButtonBase({
|
|
|
58
52
|
const showBadge = badge !== void 0 && badge !== false && badge !== 0;
|
|
59
53
|
const badgeCount = typeof badge === "number" ? Math.min(badge, 99) : null;
|
|
60
54
|
const showCount = typeof badge === "number" && badge > 0;
|
|
61
|
-
return /* @__PURE__ */ React.createElement(
|
|
62
|
-
|
|
55
|
+
return /* @__PURE__ */ React.createElement(View, { style: styles.wrapper }, /* @__PURE__ */ React.createElement(
|
|
56
|
+
PressableButton,
|
|
63
57
|
{
|
|
64
|
-
style: [
|
|
65
|
-
|
|
58
|
+
style: [
|
|
59
|
+
styles.base,
|
|
60
|
+
containerVariantStyle,
|
|
61
|
+
{ width: containerSize, height: containerSize },
|
|
62
|
+
isDisabled && styles.disabled,
|
|
63
|
+
style
|
|
64
|
+
],
|
|
65
|
+
enabled: !isDisabled,
|
|
66
|
+
onPress: handlePress,
|
|
67
|
+
rippleColor: "transparent",
|
|
68
|
+
touchSoundDisabled: true,
|
|
69
|
+
activateOnHover: true,
|
|
70
|
+
accessibilityRole: "button",
|
|
71
|
+
accessibilityLabel: accessibilityLabel ?? iconName ?? "icon button",
|
|
72
|
+
accessibilityHint,
|
|
73
|
+
accessibilityState: { disabled: isDisabled, busy: loading }
|
|
66
74
|
},
|
|
67
|
-
/* @__PURE__ */ React.createElement(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{ width: containerSize, height: containerSize },
|
|
74
|
-
isDisabled && styles.disabled,
|
|
75
|
-
style
|
|
76
|
-
],
|
|
77
|
-
disabled: isDisabled,
|
|
78
|
-
activeOpacity: 1,
|
|
79
|
-
touchSoundDisabled: true,
|
|
80
|
-
onPress: handlePress,
|
|
81
|
-
onPressIn,
|
|
82
|
-
onPressOut,
|
|
83
|
-
accessibilityRole: "button",
|
|
84
|
-
accessibilityLabel: accessibilityLabel ?? iconName ?? "icon button",
|
|
85
|
-
accessibilityHint,
|
|
86
|
-
accessibilityState: { disabled: isDisabled, busy: loading },
|
|
87
|
-
...props
|
|
88
|
-
},
|
|
89
|
-
loading ? /* @__PURE__ */ React.createElement(ActivityIndicator, { size: "small", color: spinnerColor }) : resolvedIcon
|
|
90
|
-
),
|
|
91
|
-
showBadge && /* @__PURE__ */ React.createElement(View, { style: [
|
|
92
|
-
styles.badge,
|
|
93
|
-
{ backgroundColor: colors.primary },
|
|
94
|
-
showCount ? styles.badgeCount : styles.badgeDot
|
|
95
|
-
] }, showCount && /* @__PURE__ */ React.createElement(Text, { style: [styles.badgeText, { color: colors.primaryForeground }] }, badgeCount))
|
|
96
|
-
);
|
|
75
|
+
loading ? /* @__PURE__ */ React.createElement(ActivityIndicator, { size: "small", color: spinnerColor }) : resolvedIcon
|
|
76
|
+
), showBadge && /* @__PURE__ */ React.createElement(View, { style: [
|
|
77
|
+
styles.badge,
|
|
78
|
+
{ backgroundColor: colors.primary },
|
|
79
|
+
showCount ? styles.badgeCount : styles.badgeDot
|
|
80
|
+
] }, showCount && /* @__PURE__ */ React.createElement(Text, { style: [styles.badgeText, { color: colors.primaryForeground }] }, badgeCount)));
|
|
97
81
|
}
|
|
98
82
|
var IconButton = React.memo(IconButtonBase);
|
|
99
83
|
var styles = StyleSheet.create({
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Badge } from './chunk-TERDKCLE.mjs';
|
|
2
|
+
import { Button } from './chunk-2TFTAWVJ.mjs';
|
|
3
|
+
import { RADIUS, SHADOWS } from './chunk-QY3X2UYR.mjs';
|
|
4
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
5
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
|
+
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
9
|
+
|
|
10
|
+
var normalize = (f) => typeof f === "string" ? { label: f, included: true } : { included: true, ...f };
|
|
11
|
+
function PricingCard({
|
|
12
|
+
name,
|
|
13
|
+
price,
|
|
14
|
+
period,
|
|
15
|
+
description,
|
|
16
|
+
features = [],
|
|
17
|
+
ctaLabel,
|
|
18
|
+
onCtaPress,
|
|
19
|
+
badge,
|
|
20
|
+
highlighted = false,
|
|
21
|
+
footnote,
|
|
22
|
+
style
|
|
23
|
+
}) {
|
|
24
|
+
const { colors } = useTheme();
|
|
25
|
+
return /* @__PURE__ */ React.createElement(
|
|
26
|
+
View,
|
|
27
|
+
{
|
|
28
|
+
style: [
|
|
29
|
+
styles.card,
|
|
30
|
+
{
|
|
31
|
+
backgroundColor: colors.card,
|
|
32
|
+
borderColor: highlighted ? colors.primary : colors.border,
|
|
33
|
+
borderWidth: highlighted ? 2 : StyleSheet.hairlineWidth
|
|
34
|
+
},
|
|
35
|
+
highlighted && SHADOWS.md,
|
|
36
|
+
style
|
|
37
|
+
],
|
|
38
|
+
accessibilityRole: "summary"
|
|
39
|
+
},
|
|
40
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.header }, /* @__PURE__ */ React.createElement(Text, { style: [styles.name, { color: colors.foreground }], allowFontScaling: true }, name), badge ? /* @__PURE__ */ React.createElement(Badge, { label: badge, variant: highlighted ? "default" : "secondary", size: "sm" }) : null),
|
|
41
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.priceRow }, /* @__PURE__ */ React.createElement(Text, { style: [styles.price, { color: colors.foreground }], allowFontScaling: true }, price), period ? /* @__PURE__ */ React.createElement(Text, { style: [styles.period, { color: colors.foregroundMuted }], allowFontScaling: true }, period) : null),
|
|
42
|
+
description ? /* @__PURE__ */ React.createElement(Text, { style: [styles.description, { color: colors.foregroundMuted }], allowFontScaling: true }, description) : null,
|
|
43
|
+
features.length > 0 ? /* @__PURE__ */ React.createElement(View, { style: styles.features }, features.map(normalize).map((f, i) => /* @__PURE__ */ React.createElement(View, { key: i, style: styles.featureRow }, renderIcon(
|
|
44
|
+
f.included ? "check" : "minus",
|
|
45
|
+
ms(16),
|
|
46
|
+
f.included ? colors.success : colors.foregroundMuted
|
|
47
|
+
), /* @__PURE__ */ React.createElement(
|
|
48
|
+
Text,
|
|
49
|
+
{
|
|
50
|
+
style: [
|
|
51
|
+
styles.featureLabel,
|
|
52
|
+
{ color: f.included ? colors.foreground : colors.foregroundMuted },
|
|
53
|
+
!f.included && styles.featureExcluded
|
|
54
|
+
],
|
|
55
|
+
allowFontScaling: true
|
|
56
|
+
},
|
|
57
|
+
f.label
|
|
58
|
+
)))) : null,
|
|
59
|
+
ctaLabel ? /* @__PURE__ */ React.createElement(
|
|
60
|
+
Button,
|
|
61
|
+
{
|
|
62
|
+
label: ctaLabel,
|
|
63
|
+
variant: highlighted ? "primary" : "secondary",
|
|
64
|
+
fullWidth: true,
|
|
65
|
+
onPress: onCtaPress,
|
|
66
|
+
style: styles.cta
|
|
67
|
+
}
|
|
68
|
+
) : null,
|
|
69
|
+
footnote ? /* @__PURE__ */ React.createElement(Text, { style: [styles.footnote, { color: colors.foregroundMuted }], allowFontScaling: true }, footnote) : null
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
var styles = StyleSheet.create({
|
|
73
|
+
card: {
|
|
74
|
+
borderRadius: RADIUS.md,
|
|
75
|
+
padding: s(16),
|
|
76
|
+
gap: vs(8)
|
|
77
|
+
},
|
|
78
|
+
header: {
|
|
79
|
+
flexDirection: "row",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
justifyContent: "space-between",
|
|
82
|
+
gap: s(8)
|
|
83
|
+
},
|
|
84
|
+
name: {
|
|
85
|
+
fontFamily: "Sohne-SemiBold",
|
|
86
|
+
fontSize: ms(16),
|
|
87
|
+
lineHeight: mvs(20)
|
|
88
|
+
},
|
|
89
|
+
priceRow: {
|
|
90
|
+
flexDirection: "row",
|
|
91
|
+
alignItems: "baseline",
|
|
92
|
+
gap: s(3)
|
|
93
|
+
},
|
|
94
|
+
price: {
|
|
95
|
+
fontFamily: "Sohne-Bold",
|
|
96
|
+
fontSize: ms(28),
|
|
97
|
+
lineHeight: mvs(32),
|
|
98
|
+
letterSpacing: -0.5
|
|
99
|
+
},
|
|
100
|
+
period: {
|
|
101
|
+
fontFamily: "Sohne-Regular",
|
|
102
|
+
fontSize: ms(13),
|
|
103
|
+
lineHeight: mvs(16)
|
|
104
|
+
},
|
|
105
|
+
description: {
|
|
106
|
+
fontFamily: "Sohne-Regular",
|
|
107
|
+
fontSize: ms(13),
|
|
108
|
+
lineHeight: mvs(18)
|
|
109
|
+
},
|
|
110
|
+
features: {
|
|
111
|
+
gap: vs(6),
|
|
112
|
+
marginTop: vs(2)
|
|
113
|
+
},
|
|
114
|
+
featureRow: {
|
|
115
|
+
flexDirection: "row",
|
|
116
|
+
alignItems: "center",
|
|
117
|
+
gap: s(6)
|
|
118
|
+
},
|
|
119
|
+
featureLabel: {
|
|
120
|
+
flex: 1,
|
|
121
|
+
fontFamily: "Sohne-Regular",
|
|
122
|
+
fontSize: ms(13),
|
|
123
|
+
lineHeight: mvs(18)
|
|
124
|
+
},
|
|
125
|
+
featureExcluded: {
|
|
126
|
+
textDecorationLine: "line-through"
|
|
127
|
+
},
|
|
128
|
+
cta: {
|
|
129
|
+
marginTop: vs(2)
|
|
130
|
+
},
|
|
131
|
+
footnote: {
|
|
132
|
+
fontFamily: "Sohne-Regular",
|
|
133
|
+
fontSize: ms(11),
|
|
134
|
+
lineHeight: mvs(14),
|
|
135
|
+
textAlign: "center"
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export { PricingCard };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
+
import { SPRINGS } from './chunk-DVK4G2GT.mjs';
|
|
3
|
+
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
4
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
5
|
+
import { s } from './chunk-2CE3TQVY.mjs';
|
|
6
|
+
import React, { useEffect } from 'react';
|
|
7
|
+
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
8
|
+
import Animated, { useSharedValue, withSpring, useAnimatedStyle, interpolateColor } from 'react-native-reanimated';
|
|
9
|
+
|
|
10
|
+
function Dot({ active, size, activeColor, inactiveColor, onPress, index, total }) {
|
|
11
|
+
const progress = useSharedValue(active ? 1 : 0);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
progress.value = withSpring(active ? 1 : 0, SPRINGS.glide);
|
|
14
|
+
}, [active, progress]);
|
|
15
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
16
|
+
width: size + progress.value * size * 1.5,
|
|
17
|
+
backgroundColor: interpolateColor(progress.value, [0, 1], [inactiveColor, activeColor])
|
|
18
|
+
}));
|
|
19
|
+
const dot = /* @__PURE__ */ React.createElement(Animated.View, { style: [{ height: size, borderRadius: size / 2 }, animatedStyle] });
|
|
20
|
+
if (!onPress) return dot;
|
|
21
|
+
const handlePress = () => {
|
|
22
|
+
selectionAsync();
|
|
23
|
+
onPress();
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ React.createElement(
|
|
26
|
+
TouchableOpacity,
|
|
27
|
+
{
|
|
28
|
+
onPress: handlePress,
|
|
29
|
+
activeOpacity: 0.7,
|
|
30
|
+
touchSoundDisabled: true,
|
|
31
|
+
accessibilityRole: "button",
|
|
32
|
+
accessibilityLabel: `Page ${index + 1} of ${total}${active ? ", current page" : ""}`,
|
|
33
|
+
hitSlop: { top: 8, bottom: 8, left: 4, right: 4 }
|
|
34
|
+
},
|
|
35
|
+
dot
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function PagerDots({
|
|
39
|
+
count,
|
|
40
|
+
activeIndex,
|
|
41
|
+
onDotPress,
|
|
42
|
+
showControls = false,
|
|
43
|
+
dotSize = 8,
|
|
44
|
+
spacing = 8,
|
|
45
|
+
activeColor,
|
|
46
|
+
inactiveColor,
|
|
47
|
+
style
|
|
48
|
+
}) {
|
|
49
|
+
const { colors } = useTheme();
|
|
50
|
+
const resolvedActive = activeColor ?? colors.primary;
|
|
51
|
+
const resolvedInactive = inactiveColor ?? colors.border;
|
|
52
|
+
const size = s(dotSize);
|
|
53
|
+
const hasControls = showControls !== false;
|
|
54
|
+
const canGoPrev = activeIndex > 0;
|
|
55
|
+
const canGoNext = activeIndex < count - 1;
|
|
56
|
+
const handlePrevious = () => {
|
|
57
|
+
if (!canGoPrev) return;
|
|
58
|
+
selectionAsync();
|
|
59
|
+
if (typeof showControls === "object" && showControls.onPrevious) {
|
|
60
|
+
showControls.onPrevious();
|
|
61
|
+
} else if (onDotPress) {
|
|
62
|
+
onDotPress(activeIndex - 1);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const handleNext = () => {
|
|
66
|
+
if (!canGoNext) return;
|
|
67
|
+
selectionAsync();
|
|
68
|
+
if (typeof showControls === "object" && showControls.onNext) {
|
|
69
|
+
showControls.onNext();
|
|
70
|
+
} else if (onDotPress) {
|
|
71
|
+
onDotPress(activeIndex + 1);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ React.createElement(
|
|
75
|
+
View,
|
|
76
|
+
{
|
|
77
|
+
style: [styles.container, { gap: s(spacing) }, style],
|
|
78
|
+
accessibilityRole: "adjustable",
|
|
79
|
+
accessibilityLabel: `Page ${activeIndex + 1} of ${count}`
|
|
80
|
+
},
|
|
81
|
+
hasControls && /* @__PURE__ */ React.createElement(
|
|
82
|
+
TouchableOpacity,
|
|
83
|
+
{
|
|
84
|
+
onPress: handlePrevious,
|
|
85
|
+
disabled: !canGoPrev,
|
|
86
|
+
activeOpacity: 0.7,
|
|
87
|
+
touchSoundDisabled: true,
|
|
88
|
+
accessibilityRole: "button",
|
|
89
|
+
accessibilityLabel: "Previous page",
|
|
90
|
+
hitSlop: { top: 8, bottom: 8, left: 8, right: 8 },
|
|
91
|
+
style: [styles.controlBtn, !canGoPrev && styles.controlBtnDisabled]
|
|
92
|
+
},
|
|
93
|
+
renderIcon("chevron-left", s(18), canGoPrev ? colors.foreground : colors.foregroundMuted)
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ React.createElement(View, { style: [styles.dotsRow, { gap: s(spacing) }] }, Array.from({ length: count }).map((_, i) => /* @__PURE__ */ React.createElement(
|
|
96
|
+
Dot,
|
|
97
|
+
{
|
|
98
|
+
key: i,
|
|
99
|
+
active: i === activeIndex,
|
|
100
|
+
size,
|
|
101
|
+
activeColor: resolvedActive,
|
|
102
|
+
inactiveColor: resolvedInactive,
|
|
103
|
+
index: i,
|
|
104
|
+
total: count,
|
|
105
|
+
onPress: onDotPress ? () => onDotPress(i) : void 0
|
|
106
|
+
}
|
|
107
|
+
))),
|
|
108
|
+
hasControls && /* @__PURE__ */ React.createElement(
|
|
109
|
+
TouchableOpacity,
|
|
110
|
+
{
|
|
111
|
+
onPress: handleNext,
|
|
112
|
+
disabled: !canGoNext,
|
|
113
|
+
activeOpacity: 0.7,
|
|
114
|
+
touchSoundDisabled: true,
|
|
115
|
+
accessibilityRole: "button",
|
|
116
|
+
accessibilityLabel: "Next page",
|
|
117
|
+
hitSlop: { top: 8, bottom: 8, left: 8, right: 8 },
|
|
118
|
+
style: [styles.controlBtn, !canGoNext && styles.controlBtnDisabled]
|
|
119
|
+
},
|
|
120
|
+
renderIcon("chevron-right", s(18), canGoNext ? colors.foreground : colors.foregroundMuted)
|
|
121
|
+
)
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
var styles = StyleSheet.create({
|
|
125
|
+
container: {
|
|
126
|
+
flexDirection: "row",
|
|
127
|
+
alignItems: "center",
|
|
128
|
+
justifyContent: "center"
|
|
129
|
+
},
|
|
130
|
+
dotsRow: {
|
|
131
|
+
flexDirection: "row",
|
|
132
|
+
alignItems: "center"
|
|
133
|
+
},
|
|
134
|
+
controlBtn: {
|
|
135
|
+
padding: s(4)
|
|
136
|
+
},
|
|
137
|
+
controlBtnDisabled: {
|
|
138
|
+
opacity: 0.3
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
export { PagerDots };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
1
|
+
import { Button } from './chunk-2TFTAWVJ.mjs';
|
|
2
2
|
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
3
3
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import { s, vs, mvs, ms } from './chunk-2CE3TQVY.mjs';
|
|
@@ -47,9 +47,12 @@ var styles = StyleSheet.create({
|
|
|
47
47
|
justifyContent: "center",
|
|
48
48
|
borderWidth: 1,
|
|
49
49
|
borderStyle: "dashed",
|
|
50
|
-
borderRadius: ms(12)
|
|
50
|
+
borderRadius: ms(12),
|
|
51
|
+
paddingBottom: vs(32)
|
|
52
|
+
},
|
|
53
|
+
containerCompact: {
|
|
54
|
+
paddingBottom: vs(20)
|
|
51
55
|
},
|
|
52
|
-
containerCompact: {},
|
|
53
56
|
iconWrapper: {
|
|
54
57
|
width: s(80),
|
|
55
58
|
height: s(80),
|
|
@@ -88,7 +91,6 @@ var styles = StyleSheet.create({
|
|
|
88
91
|
},
|
|
89
92
|
action: {
|
|
90
93
|
marginTop: vs(8),
|
|
91
|
-
marginBottom: s(32),
|
|
92
94
|
paddingHorizontal: s(32)
|
|
93
95
|
}
|
|
94
96
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useColorTransition } from './chunk-
|
|
1
|
+
import { useColorTransition } from './chunk-26BCI223.mjs';
|
|
2
|
+
import { TIMINGS } from './chunk-DVK4G2GT.mjs';
|
|
2
3
|
import { renderIcon } from './chunk-T7XZ7H7Y.mjs';
|
|
3
|
-
import { TIMINGS } from './chunk-5IKW3VNC.mjs';
|
|
4
4
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
5
5
|
import { ms, s, vs } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React, { useState } from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
2
|
-
import { impactMedium, notificationSuccess, selectionAsync } from './chunk-
|
|
1
|
+
import { Button } from './chunk-2TFTAWVJ.mjs';
|
|
2
|
+
import { impactMedium, notificationSuccess, selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
4
|
import { vs, mvs, ms, s } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React, { useRef, useEffect } from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { usePressScale } from './chunk-
|
|
2
|
-
import { selectionAsync } from './chunk-
|
|
3
|
-
import { PRESS_SCALE } from './chunk-
|
|
1
|
+
import { usePressScale } from './chunk-YNROWHQJ.mjs';
|
|
2
|
+
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
|
+
import { PRESS_SCALE } from './chunk-DVK4G2GT.mjs';
|
|
4
4
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
5
5
|
import { ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React, { useState, useRef } from 'react';
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { TIMINGS } from './chunk-DVK4G2GT.mjs';
|
|
2
|
+
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
3
|
+
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
4
|
+
import { vs, s } from './chunk-2CE3TQVY.mjs';
|
|
5
|
+
import React, { useState, useEffect } from 'react';
|
|
6
|
+
import { StyleSheet, View } from 'react-native';
|
|
7
|
+
import Animated, { useSharedValue, withRepeat, withTiming, Easing, useAnimatedStyle } from 'react-native-reanimated';
|
|
8
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
9
|
+
|
|
10
|
+
function Skeleton({
|
|
11
|
+
width = "100%",
|
|
12
|
+
height = 16,
|
|
13
|
+
borderRadius = 6,
|
|
14
|
+
preset = "base",
|
|
15
|
+
diameter = 40,
|
|
16
|
+
style
|
|
17
|
+
}) {
|
|
18
|
+
const { colors, colorScheme } = useTheme();
|
|
19
|
+
const shimmer = useSharedValue(0);
|
|
20
|
+
const [containerWidth, setContainerWidth] = useState(300);
|
|
21
|
+
const shimmerHighlight = colorScheme === "dark" ? "rgba(255,255,255,0.08)" : "rgba(255,255,255,0.7)";
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
shimmer.value = withRepeat(
|
|
24
|
+
withTiming(1, { duration: TIMINGS.shimmer.duration, easing: Easing.linear }),
|
|
25
|
+
-1,
|
|
26
|
+
false
|
|
27
|
+
);
|
|
28
|
+
}, [shimmer]);
|
|
29
|
+
const shimmerStyle = useAnimatedStyle(() => ({
|
|
30
|
+
transform: [{ translateX: -containerWidth + shimmer.value * (containerWidth * 2) }]
|
|
31
|
+
}));
|
|
32
|
+
const resolvedWidth = preset === "circle" ? s(diameter) : preset === "text" ? "60%" : width;
|
|
33
|
+
const resolvedHeight = preset === "circle" ? s(diameter) : preset === "text" ? 14 : height;
|
|
34
|
+
const resolvedRadius = preset === "circle" ? 9999 : preset === "text" ? 4 : borderRadius;
|
|
35
|
+
return /* @__PURE__ */ React.createElement(
|
|
36
|
+
View,
|
|
37
|
+
{
|
|
38
|
+
style: [
|
|
39
|
+
styles.base,
|
|
40
|
+
{ width: resolvedWidth, height: resolvedHeight, borderRadius: resolvedRadius, backgroundColor: colors.surface },
|
|
41
|
+
style
|
|
42
|
+
],
|
|
43
|
+
onLayout: (e) => setContainerWidth(e.nativeEvent.layout.width),
|
|
44
|
+
accessibilityRole: "progressbar",
|
|
45
|
+
accessibilityLabel: "Loading",
|
|
46
|
+
accessibilityState: { busy: true }
|
|
47
|
+
},
|
|
48
|
+
/* @__PURE__ */ React.createElement(Animated.View, { style: [StyleSheet.absoluteFill, shimmerStyle] }, /* @__PURE__ */ React.createElement(
|
|
49
|
+
LinearGradient,
|
|
50
|
+
{
|
|
51
|
+
colors: ["transparent", shimmerHighlight, "transparent"],
|
|
52
|
+
start: { x: 0, y: 0 },
|
|
53
|
+
end: { x: 1, y: 0 },
|
|
54
|
+
style: StyleSheet.absoluteFill
|
|
55
|
+
}
|
|
56
|
+
))
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
var aspectRatioMap = {
|
|
60
|
+
"1:1": 1,
|
|
61
|
+
"4:3": 3 / 4,
|
|
62
|
+
"16:9": 9 / 16,
|
|
63
|
+
"4:5": 5 / 4,
|
|
64
|
+
"3:2": 2 / 3
|
|
65
|
+
};
|
|
66
|
+
function MediaCardSkeleton({ aspectRatio = "4:3", showSubtitle = true, style }) {
|
|
67
|
+
const ratio = aspectRatioMap[aspectRatio];
|
|
68
|
+
return /* @__PURE__ */ React.createElement(View, { style }, /* @__PURE__ */ React.createElement(View, { style: { paddingTop: `${ratio * 100}%` } }, /* @__PURE__ */ React.createElement(View, { style: StyleSheet.absoluteFill }, /* @__PURE__ */ React.createElement(Skeleton, { width: "100%", height: void 0, style: skeletonStyles.fill, borderRadius: RADIUS.md }))), /* @__PURE__ */ React.createElement(View, { style: skeletonStyles.meta }, /* @__PURE__ */ React.createElement(Skeleton, { width: "70%", height: vs(14), borderRadius: RADIUS.xs }), showSubtitle ? /* @__PURE__ */ React.createElement(Skeleton, { width: "45%", height: vs(12), borderRadius: RADIUS.xs }) : null));
|
|
69
|
+
}
|
|
70
|
+
function ListItemSkeleton({ showAvatar = true, showSubtitle = true, style }) {
|
|
71
|
+
return /* @__PURE__ */ React.createElement(View, { style: [skeletonStyles.row, style] }, showAvatar ? /* @__PURE__ */ React.createElement(Skeleton, { preset: "circle", diameter: 40 }) : null, /* @__PURE__ */ React.createElement(View, { style: skeletonStyles.rowText }, /* @__PURE__ */ React.createElement(Skeleton, { width: "60%", height: vs(14), borderRadius: RADIUS.xs }), showSubtitle ? /* @__PURE__ */ React.createElement(Skeleton, { width: "40%", height: vs(12), borderRadius: RADIUS.xs }) : null));
|
|
72
|
+
}
|
|
73
|
+
function ListSkeleton({
|
|
74
|
+
count = 6,
|
|
75
|
+
columns = 1,
|
|
76
|
+
gap = 12,
|
|
77
|
+
aspectRatio = "4:3",
|
|
78
|
+
showAvatar = true,
|
|
79
|
+
style
|
|
80
|
+
}) {
|
|
81
|
+
if (columns <= 1) {
|
|
82
|
+
return /* @__PURE__ */ React.createElement(View, { style: [{ gap: vs(gap) }, style] }, Array.from({ length: count }).map((_, i) => /* @__PURE__ */ React.createElement(ListItemSkeleton, { key: i, showAvatar })));
|
|
83
|
+
}
|
|
84
|
+
const widthPct = `${100 / columns}%`;
|
|
85
|
+
return /* @__PURE__ */ React.createElement(View, { style: [skeletonStyles.grid, { marginHorizontal: -s(gap) / 2 }, style] }, Array.from({ length: count }).map((_, i) => /* @__PURE__ */ React.createElement(View, { key: i, style: { width: widthPct, paddingHorizontal: s(gap) / 2, marginBottom: vs(gap) } }, /* @__PURE__ */ React.createElement(MediaCardSkeleton, { aspectRatio }))));
|
|
86
|
+
}
|
|
87
|
+
Skeleton.MediaCard = MediaCardSkeleton;
|
|
88
|
+
Skeleton.ListItem = ListItemSkeleton;
|
|
89
|
+
Skeleton.List = ListSkeleton;
|
|
90
|
+
var styles = StyleSheet.create({
|
|
91
|
+
base: {
|
|
92
|
+
overflow: "hidden"
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
var skeletonStyles = StyleSheet.create({
|
|
96
|
+
grid: {
|
|
97
|
+
flexDirection: "row",
|
|
98
|
+
flexWrap: "wrap"
|
|
99
|
+
},
|
|
100
|
+
fill: {
|
|
101
|
+
width: "100%",
|
|
102
|
+
height: "100%"
|
|
103
|
+
},
|
|
104
|
+
meta: {
|
|
105
|
+
paddingTop: vs(8),
|
|
106
|
+
gap: vs(6)
|
|
107
|
+
},
|
|
108
|
+
row: {
|
|
109
|
+
flexDirection: "row",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
gap: s(12),
|
|
112
|
+
paddingVertical: vs(8)
|
|
113
|
+
},
|
|
114
|
+
rowText: {
|
|
115
|
+
flex: 1,
|
|
116
|
+
gap: vs(6)
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export { Skeleton };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { PRESS_SCALE, EASINGS, TIMINGS } from './chunk-5IKW3VNC.mjs';
|
|
1
|
+
import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
2
|
+
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
|
+
import { COLOR_TRANSITION, OPACITY_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
5
4
|
import { useTheme } from './chunk-SOYNZDVY.mjs';
|
|
6
5
|
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
7
6
|
import React from 'react';
|
|
8
|
-
import { StyleSheet,
|
|
9
|
-
import
|
|
7
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
8
|
+
import { EaseView } from 'react-native-ease';
|
|
10
9
|
|
|
11
10
|
function Checkbox({
|
|
12
11
|
checked = false,
|
|
@@ -17,40 +16,38 @@ function Checkbox({
|
|
|
17
16
|
accessibilityLabel
|
|
18
17
|
}) {
|
|
19
18
|
const { colors } = useTheme();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const progress = useColorTransition(checked);
|
|
25
|
-
const boxStyle = useAnimatedStyle(() => ({
|
|
26
|
-
borderColor: interpolateColor(progress.value, [0, 1], [colors.border, colors.primary]),
|
|
27
|
-
backgroundColor: interpolateColor(progress.value, [0, 1], ["transparent", colors.primary])
|
|
28
|
-
}));
|
|
29
|
-
const checkStyle = useAnimatedStyle(() => ({
|
|
30
|
-
opacity: withTiming(checked ? 1 : 0, { duration: TIMINGS.state.duration, easing: EASINGS.standard })
|
|
31
|
-
}));
|
|
19
|
+
const handlePress = () => {
|
|
20
|
+
selectionAsync();
|
|
21
|
+
onCheckedChange?.(!checked);
|
|
22
|
+
};
|
|
32
23
|
return (
|
|
33
24
|
// AUDIT FIX: opacity was applied only to the box, leaving the label at full
|
|
34
25
|
// opacity when disabled — a contradictory visual signal. Now the entire row
|
|
35
26
|
// dims uniformly so label and control communicate the same disabled state.
|
|
36
27
|
/* @__PURE__ */ React.createElement(
|
|
37
|
-
|
|
28
|
+
PressableButton,
|
|
38
29
|
{
|
|
39
30
|
style: [styles.row, disabled && styles.rowDisabled, style],
|
|
40
|
-
onPress:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
onPressIn,
|
|
45
|
-
onPressOut,
|
|
46
|
-
disabled,
|
|
47
|
-
activeOpacity: 1,
|
|
31
|
+
onPress: handlePress,
|
|
32
|
+
enabled: !disabled,
|
|
33
|
+
rippleColor: "transparent",
|
|
48
34
|
touchSoundDisabled: true,
|
|
49
35
|
accessibilityRole: "checkbox",
|
|
50
36
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
51
37
|
accessibilityState: { checked, disabled: !!disabled }
|
|
52
38
|
},
|
|
53
|
-
/* @__PURE__ */ React.createElement(
|
|
39
|
+
/* @__PURE__ */ React.createElement(
|
|
40
|
+
EaseView,
|
|
41
|
+
{
|
|
42
|
+
style: styles.box,
|
|
43
|
+
animate: {
|
|
44
|
+
borderColor: checked ? colors.primary : colors.border,
|
|
45
|
+
backgroundColor: checked ? colors.primary : "transparent"
|
|
46
|
+
},
|
|
47
|
+
transition: COLOR_TRANSITION
|
|
48
|
+
},
|
|
49
|
+
/* @__PURE__ */ React.createElement(EaseView, { animate: { opacity: checked ? 1 : 0 }, transition: OPACITY_TRANSITION }, /* @__PURE__ */ React.createElement(View, { style: [styles.checkmark, { borderColor: colors.primaryForeground }] }))
|
|
50
|
+
),
|
|
54
51
|
label ? /* @__PURE__ */ React.createElement(
|
|
55
52
|
Text,
|
|
56
53
|
{
|