@retray-dev/ui-kit 12.1.0 → 12.2.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 +98 -4
- package/README.md +4 -4
- package/dist/Accordion.d.mts +6 -0
- package/dist/Accordion.d.ts +6 -0
- package/dist/Accordion.js +16 -0
- package/dist/Accordion.mjs +2 -2
- package/dist/AlertBanner.js +2 -0
- package/dist/AlertBanner.mjs +2 -2
- package/dist/AppHeader.js +2 -0
- package/dist/AppHeader.mjs +3 -3
- package/dist/Avatar.js +2 -0
- package/dist/Avatar.mjs +2 -2
- package/dist/Badge.js +2 -0
- package/dist/Badge.mjs +2 -2
- package/dist/Button.js +17 -17
- package/dist/Button.mjs +2 -2
- package/dist/Card.js +2 -0
- package/dist/Card.mjs +2 -2
- package/dist/CategoryStrip.js +2 -0
- package/dist/CategoryStrip.mjs +2 -2
- package/dist/Checkbox.js +2 -0
- package/dist/Checkbox.mjs +2 -2
- package/dist/Chip.js +2 -0
- package/dist/Chip.mjs +2 -2
- package/dist/ConfirmDialog.js +26 -20
- package/dist/ConfirmDialog.mjs +3 -3
- package/dist/CurrencyDisplay.js +2 -0
- package/dist/CurrencyDisplay.mjs +2 -2
- package/dist/CurrencyInput.js +2 -0
- package/dist/CurrencyInput.mjs +3 -3
- package/dist/DetailRow.js +2 -0
- package/dist/DetailRow.mjs +2 -2
- package/dist/EmptyState.js +17 -17
- package/dist/EmptyState.mjs +3 -3
- package/dist/ErrorBoundary.js +2 -0
- package/dist/ErrorBoundary.mjs +2 -2
- package/dist/Form.js +2 -0
- package/dist/Form.mjs +2 -2
- package/dist/IconButton.js +2 -0
- package/dist/IconButton.mjs +2 -2
- package/dist/IconPicker.js +2 -0
- package/dist/IconPicker.mjs +3 -3
- package/dist/ImageUpload.d.mts +3 -1
- package/dist/ImageUpload.d.ts +3 -1
- package/dist/ImageUpload.js +10 -3
- package/dist/ImageUpload.mjs +3 -3
- package/dist/ImageViewer.js +2 -0
- package/dist/ImageViewer.mjs +4 -4
- package/dist/Input.js +2 -0
- package/dist/Input.mjs +2 -2
- package/dist/LabelValue.js +2 -0
- package/dist/LabelValue.mjs +2 -2
- package/dist/ListGroup.js +2 -0
- package/dist/ListGroup.mjs +2 -2
- package/dist/ListItem.js +2 -0
- package/dist/ListItem.mjs +2 -2
- package/dist/MediaCard.js +2 -0
- package/dist/MediaCard.mjs +2 -2
- package/dist/MenuGroup.js +2 -0
- package/dist/MenuGroup.mjs +2 -2
- package/dist/MenuItem.js +2 -0
- package/dist/MenuItem.mjs +2 -2
- package/dist/MonthPicker.js +2 -0
- package/dist/MonthPicker.mjs +2 -2
- package/dist/NumberStepper.js +2 -0
- package/dist/NumberStepper.mjs +2 -2
- package/dist/PagerDots.js +2 -0
- package/dist/PagerDots.mjs +2 -2
- package/dist/PricingCard.js +17 -17
- package/dist/PricingCard.mjs +4 -4
- package/dist/Progress.js +2 -0
- package/dist/Progress.mjs +2 -2
- package/dist/RadioGroup.js +2 -0
- package/dist/RadioGroup.mjs +2 -2
- package/dist/RetrayProvider.d.mts +1 -1
- package/dist/RetrayProvider.d.ts +1 -1
- package/dist/RetrayProvider.js +2 -0
- package/dist/RetrayProvider.mjs +3 -3
- package/dist/Select.js +2 -0
- package/dist/Select.mjs +2 -2
- package/dist/SelectableCard.d.mts +27 -0
- package/dist/SelectableCard.d.ts +27 -0
- package/dist/SelectableCard.js +511 -0
- package/dist/SelectableCard.mjs +8 -0
- package/dist/SelectableGrid.js +2 -0
- package/dist/SelectableGrid.mjs +2 -2
- package/dist/Separator.js +2 -0
- package/dist/Separator.mjs +2 -2
- package/dist/Sheet.js +11 -3
- package/dist/Sheet.mjs +2 -2
- package/dist/SheetSelect.js +2 -0
- package/dist/SheetSelect.mjs +2 -2
- package/dist/Skeleton.d.mts +3 -1
- package/dist/Skeleton.d.ts +3 -1
- package/dist/Skeleton.js +5 -2
- package/dist/Skeleton.mjs +2 -2
- package/dist/Slider.js +2 -0
- package/dist/Slider.mjs +2 -2
- package/dist/Spinner.js +2 -0
- package/dist/Spinner.mjs +2 -2
- package/dist/Stats.d.mts +4 -1
- package/dist/Stats.d.ts +4 -1
- package/dist/Stats.js +27 -3
- package/dist/Stats.mjs +2 -2
- package/dist/Switch.js +2 -0
- package/dist/Switch.mjs +2 -2
- package/dist/TabBar.js +2 -0
- package/dist/TabBar.mjs +2 -2
- package/dist/Tabs.js +2 -0
- package/dist/Tabs.mjs +2 -2
- package/dist/Text.js +2 -0
- package/dist/Text.mjs +2 -2
- package/dist/Textarea.js +2 -0
- package/dist/Textarea.mjs +2 -2
- package/dist/Toast.js +2 -0
- package/dist/Toast.mjs +2 -2
- package/dist/Toggle.js +2 -0
- package/dist/Toggle.mjs +2 -2
- package/dist/{chunk-JNVAIDLK.mjs → chunk-2BA3JMKK.mjs} +1 -1
- package/dist/{chunk-X26S5EVZ.mjs → chunk-2HFD4IHU.mjs} +1 -1
- package/dist/{chunk-ZHMSAYLT.mjs → chunk-2LG326TT.mjs} +1 -1
- package/dist/chunk-2P2CB235.mjs +236 -0
- package/dist/{chunk-MYZ2EDYU.mjs → chunk-3XCFYSX4.mjs} +1 -1
- package/dist/{chunk-DOGIPOF5.mjs → chunk-4J2PXL36.mjs} +16 -18
- package/dist/{chunk-V6NFJXKO.mjs → chunk-4OORJ2DY.mjs} +1 -1
- package/dist/{chunk-5OLNXP3S.mjs → chunk-4XOB5TTD.mjs} +26 -4
- package/dist/{chunk-P64WHW4A.mjs → chunk-57V2LXCK.mjs} +1 -1
- package/dist/{chunk-HJ46DTJE.mjs → chunk-7AFZWSCI.mjs} +1 -1
- package/dist/{chunk-AQEVCEXV.mjs → chunk-7ELGZ66G.mjs} +1 -1
- package/dist/{chunk-I4V5XZPS.mjs → chunk-AENAVIKT.mjs} +1 -1
- package/dist/{chunk-2CBQKU7H.mjs → chunk-BXF4AMHY.mjs} +1 -1
- package/dist/{chunk-JULSIZDM.mjs → chunk-C43HRKXH.mjs} +1 -1
- package/dist/{chunk-GK4VRMNE.mjs → chunk-CF27NBXO.mjs} +11 -6
- package/dist/{chunk-PGERH3P7.mjs → chunk-DF7JA72E.mjs} +1 -1
- package/dist/{chunk-F4V6XLP4.mjs → chunk-E5UKLSJZ.mjs} +3 -3
- package/dist/{chunk-FUVYSVGR.mjs → chunk-EDLCGYIO.mjs} +1 -1
- package/dist/{chunk-N4ZPVCJH.mjs → chunk-ELGEOM7I.mjs} +1 -1
- package/dist/{chunk-FA2KMTH5.mjs → chunk-F3YTWO3T.mjs} +1 -1
- package/dist/{chunk-3UYAZ7I4.mjs → chunk-GH67YXG6.mjs} +1 -1
- package/dist/{chunk-357YO24D.mjs → chunk-GUTDFUNF.mjs} +1 -1
- package/dist/{chunk-7HSILTC4.mjs → chunk-HC4VVCWY.mjs} +2 -2
- package/dist/{chunk-WOEWGSTU.mjs → chunk-HEDQPK4I.mjs} +1 -1
- package/dist/{chunk-3GEYJ7I5.mjs → chunk-IVSRW4HS.mjs} +1 -1
- package/dist/{chunk-P73V2EKS.mjs → chunk-KSUWPU2F.mjs} +1 -1
- package/dist/{chunk-BCWEHE34.mjs → chunk-LIS6I5UP.mjs} +1 -1
- package/dist/{chunk-J6Q2YJEV.mjs → chunk-LNPKGWBG.mjs} +1 -1
- package/dist/{chunk-DF6DU42P.mjs → chunk-LOBLCFMN.mjs} +1 -1
- package/dist/{chunk-2A2LEFZG.mjs → chunk-LPV4NJJK.mjs} +2 -2
- package/dist/{chunk-FFTYLPSB.mjs → chunk-M3C7XM2M.mjs} +11 -5
- package/dist/{chunk-BQZE3HAW.mjs → chunk-MEPSKGBO.mjs} +1 -1
- package/dist/{chunk-ISY26JQJ.mjs → chunk-MVMGPZN6.mjs} +2 -2
- package/dist/{chunk-265G6A46.mjs → chunk-NHDI3VQB.mjs} +15 -1
- package/dist/{chunk-D3Y2T42P.mjs → chunk-NJG7DHVF.mjs} +1 -1
- package/dist/{chunk-LRM4AVYY.mjs → chunk-NLZY4TXU.mjs} +1 -1
- package/dist/{chunk-OULVKTWL.mjs → chunk-OLVJFKXS.mjs} +1 -1
- package/dist/{chunk-BOVUP27T.mjs → chunk-QDAZGZUF.mjs} +4 -3
- package/dist/{chunk-S3KJCPEJ.mjs → chunk-QOLWA2PW.mjs} +1 -1
- package/dist/{chunk-JCZQOY4O.mjs → chunk-QXDGGOLC.mjs} +12 -6
- package/dist/{chunk-4WFMPFZB.mjs → chunk-RJNLAH76.mjs} +1 -1
- package/dist/{chunk-HLMPMUK2.mjs → chunk-RMRS44MQ.mjs} +1 -1
- package/dist/{chunk-KHYX4IOM.mjs → chunk-SAWUXP3A.mjs} +2 -2
- package/dist/{chunk-2I2AYECM.mjs → chunk-TS7DGUIR.mjs} +1 -1
- package/dist/{chunk-3N2M3WZL.mjs → chunk-UBUXUMER.mjs} +1 -1
- package/dist/{chunk-AKM4EPOT.mjs → chunk-ULGNQPNE.mjs} +1 -1
- package/dist/{chunk-FVTVCJAH.mjs → chunk-UNNRUJTM.mjs} +1 -1
- package/dist/{chunk-DI7CBDL6.mjs → chunk-UQ4742ET.mjs} +1 -1
- package/dist/{chunk-EFLFRAHD.mjs → chunk-VJBUCITV.mjs} +1 -1
- package/dist/{chunk-QSFV2P7O.mjs → chunk-YMYIEVZP.mjs} +1 -1
- package/dist/{chunk-EMUWGDWC.mjs → chunk-YTXRIXNZ.mjs} +2 -0
- package/dist/{chunk-XBAGGKLW.mjs → chunk-ZIMY2QUM.mjs} +2 -2
- package/dist/{chunk-NXI4YDZ2.mjs → chunk-ZR6HSEAB.mjs} +1 -1
- package/dist/{index-wt-orHUi.d.ts → index-CY34hxPN.d.mts} +1 -0
- package/dist/{index-wt-orHUi.d.mts → index-CY34hxPN.d.ts} +1 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +733 -453
- package/dist/index.mjs +53 -52
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.tsx +20 -0
- package/src/components/Button/Button.tsx +29 -26
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +10 -3
- package/src/components/ImageUpload/ImageUpload.tsx +10 -3
- package/src/components/SelectableCard/SelectableCard.tsx +304 -0
- package/src/components/SelectableCard/index.ts +1 -0
- package/src/components/Sheet/Sheet.tsx +10 -3
- package/src/components/Skeleton/Skeleton.tsx +5 -2
- package/src/components/Stats/Stats.tsx +35 -7
- package/src/index.ts +1 -0
- package/src/theme/colors.ts +7 -0
- package/src/theme/types.ts +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PagerDots } from './chunk-
|
|
2
|
-
import { IconButton } from './chunk-
|
|
1
|
+
import { PagerDots } from './chunk-OLVJFKXS.mjs';
|
|
2
|
+
import { IconButton } from './chunk-LOBLCFMN.mjs';
|
|
3
3
|
import { s, vs } from './chunk-2CE3TQVY.mjs';
|
|
4
4
|
import React, { useState, useCallback } from 'react';
|
|
5
5
|
import { StyleSheet, useWindowDimensions, Dimensions, Modal, View, ScrollView, Image } from 'react-native';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { impactMedium } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
-
import { useTheme } from './chunk-
|
|
2
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
3
3
|
import { s, vs, mvs, ms } from './chunk-2CE3TQVY.mjs';
|
|
4
|
-
import React, { useRef, useId,
|
|
4
|
+
import React, { useRef, useId, useCallback, useEffect } from 'react';
|
|
5
5
|
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
|
|
6
6
|
import { BottomSheetBackdrop, BottomSheetFooter, BottomSheetModal, BottomSheetScrollView, BottomSheetView } from '@gorhom/bottom-sheet';
|
|
7
7
|
export { BottomSheetModalProvider, BottomSheetTextInput } from '@gorhom/bottom-sheet';
|
|
@@ -40,13 +40,19 @@ function Sheet({
|
|
|
40
40
|
const insets = useSafeAreaInsets();
|
|
41
41
|
const ref = useRef(null);
|
|
42
42
|
const wasOpened = useRef(false);
|
|
43
|
+
const isPresentedRef = useRef(false);
|
|
43
44
|
const name = useId();
|
|
45
|
+
const handleDismiss = useCallback(() => {
|
|
46
|
+
isPresentedRef.current = false;
|
|
47
|
+
onClose?.();
|
|
48
|
+
}, [onClose]);
|
|
44
49
|
useEffect(() => {
|
|
45
|
-
if (open) {
|
|
50
|
+
if (open && !isPresentedRef.current) {
|
|
46
51
|
impactMedium();
|
|
47
52
|
ref.current?.present();
|
|
48
53
|
wasOpened.current = true;
|
|
49
|
-
|
|
54
|
+
isPresentedRef.current = true;
|
|
55
|
+
} else if (!open && wasOpened.current && isPresentedRef.current) {
|
|
50
56
|
ref.current?.dismiss();
|
|
51
57
|
}
|
|
52
58
|
}, [open]);
|
|
@@ -98,7 +104,7 @@ function Sheet({
|
|
|
98
104
|
{
|
|
99
105
|
ref,
|
|
100
106
|
name,
|
|
101
|
-
onDismiss:
|
|
107
|
+
onDismiss: handleDismiss,
|
|
102
108
|
enableDynamicSizing: useDynamicSizing,
|
|
103
109
|
snapPoints,
|
|
104
110
|
maxDynamicContentSize: useDynamicSizing && maxHeight ? maxHeight : void 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IconButton } from './chunk-
|
|
1
|
+
import { IconButton } from './chunk-LOBLCFMN.mjs';
|
|
2
2
|
import { BREAKPOINTS } from './chunk-QY3X2UYR.mjs';
|
|
3
|
-
import { useTheme } from './chunk-
|
|
3
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
4
4
|
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { StyleSheet, useWindowDimensions, View, Text } from 'react-native';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
2
|
import { EASINGS, TIMINGS } from './chunk-DVK4G2GT.mjs';
|
|
3
3
|
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
4
|
-
import { useTheme } from './chunk-
|
|
4
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
5
5
|
import { ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
import { StyleSheet, View, Pressable, Text } from 'react-native';
|
|
@@ -52,6 +52,14 @@ function AccordionItemComponent({
|
|
|
52
52
|
accessibilityLabel: typeof item.trigger === "string" ? item.trigger : void 0
|
|
53
53
|
},
|
|
54
54
|
/* @__PURE__ */ React.createElement(View, { style: styles.triggerContent }, resolvedIcon ? /* @__PURE__ */ React.createElement(View, { style: styles.icon }, resolvedIcon) : null, typeof item.trigger === "string" ? /* @__PURE__ */ React.createElement(Text, { style: [styles.triggerText, { color: colors.foreground }], allowFontScaling: true }, item.trigger) : item.trigger),
|
|
55
|
+
item.triggerActions ? /* @__PURE__ */ React.createElement(
|
|
56
|
+
View,
|
|
57
|
+
{
|
|
58
|
+
style: styles.triggerActions,
|
|
59
|
+
onTouchEnd: (e) => e.stopPropagation()
|
|
60
|
+
},
|
|
61
|
+
item.triggerActions
|
|
62
|
+
) : null,
|
|
55
63
|
/* @__PURE__ */ React.createElement(Animated.View, { style: [styles.chevron, rotationStyle] }, /* @__PURE__ */ React.createElement(Entypo, { name: "chevron-down", size: 18, color: colors.foregroundMuted }))
|
|
56
64
|
), /* @__PURE__ */ React.createElement(Animated.View, { style: bodyStyle }, /* @__PURE__ */ React.createElement(
|
|
57
65
|
View,
|
|
@@ -121,6 +129,12 @@ var styles = StyleSheet.create({
|
|
|
121
129
|
chevron: {
|
|
122
130
|
marginLeft: s(8)
|
|
123
131
|
},
|
|
132
|
+
triggerActions: {
|
|
133
|
+
flexDirection: "row",
|
|
134
|
+
alignItems: "center",
|
|
135
|
+
gap: s(4),
|
|
136
|
+
marginLeft: s(8)
|
|
137
|
+
},
|
|
124
138
|
// position:'absolute' is the key — the inner View escapes the animated wrapper's
|
|
125
139
|
// clipped height so onLayout always reports the true content height.
|
|
126
140
|
content: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
2
|
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
3
|
-
import { useTheme } from './chunk-
|
|
3
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
4
4
|
import { ms, s, vs, mvs } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { StyleSheet, View, TouchableOpacity, Text } from 'react-native';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { impactLight } from './chunk-EJ7ZPXOH.mjs';
|
|
2
2
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
3
3
|
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
4
|
-
import { useTheme } from './chunk-
|
|
4
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
5
5
|
import { ms, vs, s, mvs } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
2
|
import { SPRINGS } from './chunk-DVK4G2GT.mjs';
|
|
3
3
|
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
4
|
-
import { useTheme } from './chunk-
|
|
4
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
5
5
|
import { s } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React, { useEffect } from 'react';
|
|
7
7
|
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TIMINGS } from './chunk-DVK4G2GT.mjs';
|
|
2
2
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
3
|
-
import { useTheme } from './chunk-
|
|
3
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
4
4
|
import { vs, s } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React, { useState, useEffect } from 'react';
|
|
6
6
|
import { StyleSheet, View } from 'react-native';
|
|
@@ -13,12 +13,13 @@ function Skeleton({
|
|
|
13
13
|
borderRadius = 6,
|
|
14
14
|
preset = "base",
|
|
15
15
|
diameter = 40,
|
|
16
|
+
backgroundColor,
|
|
16
17
|
style
|
|
17
18
|
}) {
|
|
18
19
|
const { colors, colorScheme } = useTheme();
|
|
19
20
|
const shimmer = useSharedValue(0);
|
|
20
21
|
const [containerWidth, setContainerWidth] = useState(300);
|
|
21
|
-
const shimmerHighlight = colorScheme === "dark" ? "rgba(255,255,255,0.08)" : "rgba(
|
|
22
|
+
const shimmerHighlight = colorScheme === "dark" ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.07)";
|
|
22
23
|
useEffect(() => {
|
|
23
24
|
shimmer.value = withRepeat(
|
|
24
25
|
withTiming(1, { duration: TIMINGS.shimmer.duration, easing: Easing.linear }),
|
|
@@ -37,7 +38,7 @@ function Skeleton({
|
|
|
37
38
|
{
|
|
38
39
|
style: [
|
|
39
40
|
styles.base,
|
|
40
|
-
{ width: resolvedWidth, height: resolvedHeight, borderRadius: resolvedRadius, backgroundColor: colors.
|
|
41
|
+
{ width: resolvedWidth, height: resolvedHeight, borderRadius: resolvedRadius, backgroundColor: backgroundColor ?? colors.skeleton },
|
|
41
42
|
style
|
|
42
43
|
],
|
|
43
44
|
onLayout: (e) => setContainerWidth(e.nativeEvent.layout.width),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
1
|
+
import { Button } from './chunk-4J2PXL36.mjs';
|
|
2
2
|
import { impactMedium, notificationSuccess, selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
|
-
import { useTheme } from './chunk-
|
|
3
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
4
4
|
import { vs, mvs, ms, s } from './chunk-2CE3TQVY.mjs';
|
|
5
|
-
import React, { useRef, useId,
|
|
5
|
+
import React, { useRef, useId, useCallback, useEffect } from 'react';
|
|
6
6
|
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
|
|
7
7
|
import { BottomSheetBackdrop, BottomSheetModal, BottomSheetView } from '@gorhom/bottom-sheet';
|
|
8
8
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
@@ -24,13 +24,19 @@ function ConfirmDialog({
|
|
|
24
24
|
const insets = useSafeAreaInsets();
|
|
25
25
|
const ref = useRef(null);
|
|
26
26
|
const wasOpened = useRef(false);
|
|
27
|
+
const isPresentedRef = useRef(false);
|
|
27
28
|
const name = useId();
|
|
29
|
+
const handleDismiss = useCallback(() => {
|
|
30
|
+
isPresentedRef.current = false;
|
|
31
|
+
onCancel();
|
|
32
|
+
}, [onCancel]);
|
|
28
33
|
useEffect(() => {
|
|
29
|
-
if (visible) {
|
|
34
|
+
if (visible && !isPresentedRef.current) {
|
|
30
35
|
impactMedium();
|
|
31
36
|
ref.current?.present();
|
|
32
37
|
wasOpened.current = true;
|
|
33
|
-
|
|
38
|
+
isPresentedRef.current = true;
|
|
39
|
+
} else if (!visible && wasOpened.current && isPresentedRef.current) {
|
|
34
40
|
ref.current?.dismiss();
|
|
35
41
|
}
|
|
36
42
|
}, [visible]);
|
|
@@ -51,7 +57,7 @@ function ConfirmDialog({
|
|
|
51
57
|
{
|
|
52
58
|
ref,
|
|
53
59
|
name,
|
|
54
|
-
onDismiss:
|
|
60
|
+
onDismiss: handleDismiss,
|
|
55
61
|
enableDynamicSizing: true,
|
|
56
62
|
backdropComponent: renderBackdrop,
|
|
57
63
|
backgroundStyle: { ...styles.background, backgroundColor: colors.card },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
|
-
import { useTheme } from './chunk-
|
|
2
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
3
3
|
import { vs, ms } from './chunk-2CE3TQVY.mjs';
|
|
4
4
|
import React, { useRef } from 'react';
|
|
5
5
|
import { StyleSheet, View, Text } from 'react-native';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
2
2
|
import { COLOR_TRANSITION, SPRING_ELASTIC, OPACITY_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
3
|
-
import { useTheme } from './chunk-
|
|
3
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
4
4
|
import { s } from './chunk-2CE3TQVY.mjs';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Spinner } from './chunk-
|
|
1
|
+
import { Spinner } from './chunk-LIS6I5UP.mjs';
|
|
2
2
|
import { selectionAsync, impactMedium } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
4
4
|
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
|
-
import { useTheme } from './chunk-
|
|
5
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
6
6
|
import { s, vs, ms } from './chunk-2CE3TQVY.mjs';
|
|
7
7
|
import React, { useRef, useState, useId, useMemo, useCallback } from 'react';
|
|
8
8
|
import { Dimensions, StyleSheet, TouchableOpacity, View, Text } from 'react-native';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SPRINGS } from './chunk-DVK4G2GT.mjs';
|
|
2
|
-
import { useTheme } from './chunk-
|
|
2
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
3
3
|
import { vs } from './chunk-2CE3TQVY.mjs';
|
|
4
4
|
import React, { useState, useEffect } from 'react';
|
|
5
5
|
import { StyleSheet, View } from 'react-native';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { COLOR_TRANSITION, OPACITY_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
4
|
-
import { useTheme } from './chunk-
|
|
4
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
5
5
|
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { StyleSheet, View, Text } from 'react-native';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
2
|
-
import { useTheme } from './chunk-
|
|
2
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
3
3
|
import { vs, s } from './chunk-2CE3TQVY.mjs';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { StyleSheet, View, Text } from 'react-native';
|
|
@@ -2,7 +2,7 @@ import { PressableButton } from './chunk-3DKJ2GIC.mjs';
|
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { COLOR_TRANSITION } from './chunk-DVK4G2GT.mjs';
|
|
4
4
|
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
|
-
import { useTheme } from './chunk-
|
|
5
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
6
6
|
import { vs, s, ms } from './chunk-2CE3TQVY.mjs';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { StyleSheet, View, Text } from 'react-native';
|
|
@@ -2,7 +2,7 @@ import { PressableRow } from './chunk-3DKJ2GIC.mjs';
|
|
|
2
2
|
import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
3
3
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
4
4
|
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
5
|
-
import { useTheme } from './chunk-
|
|
5
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
6
6
|
import { vs, ms, s } from './chunk-2CE3TQVY.mjs';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { StyleSheet, View, Text } from 'react-native';
|
|
@@ -104,6 +104,7 @@ function deriveColors(t, scheme) {
|
|
|
104
104
|
const foregroundMuted = mixWithBackground(t.foreground, bg, 0.62);
|
|
105
105
|
const surface = dark ? lighten(bg, -0.06) : darken(bg, 0.04);
|
|
106
106
|
const surfaceStrong = dark ? lighten(bg, -0.12) : darken(bg, 0.08);
|
|
107
|
+
const skeleton = dark ? lighten(bg, -0.1) : darken(bg, 0.1);
|
|
107
108
|
const destructiveTint = dark ? withAlphaOnDark(t.destructive, 0.15, bg) : withAlphaOnWhite(t.destructive, 0.08);
|
|
108
109
|
const destructiveBorder = dark ? withAlphaOnDark(t.destructive, 0.45, bg) : withAlphaOnWhite(t.destructive, 0.3);
|
|
109
110
|
const successTint = dark ? withAlphaOnDark(t.success, 0.15, bg) : withAlphaOnWhite(t.success, 0.08);
|
|
@@ -116,6 +117,7 @@ function deriveColors(t, scheme) {
|
|
|
116
117
|
foregroundMuted,
|
|
117
118
|
surface,
|
|
118
119
|
surfaceStrong,
|
|
120
|
+
skeleton,
|
|
119
121
|
destructiveTint,
|
|
120
122
|
destructiveBorder,
|
|
121
123
|
successTint,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ToastProvider } from './chunk-
|
|
2
|
-
import { ThemeProvider } from './chunk-
|
|
1
|
+
import { ToastProvider } from './chunk-YMYIEVZP.mjs';
|
|
2
|
+
import { ThemeProvider } from './chunk-YTXRIXNZ.mjs';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { StyleSheet } from 'react-native';
|
|
5
5
|
import { SafeAreaProvider, initialWindowMetrics } from 'react-native-safe-area-context';
|
|
@@ -3,7 +3,7 @@ import { selectionAsync } from './chunk-EJ7ZPXOH.mjs';
|
|
|
3
3
|
import { PRESS_SCALE } from './chunk-DVK4G2GT.mjs';
|
|
4
4
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
5
5
|
import { renderIcon } from './chunk-KA7LTET3.mjs';
|
|
6
|
-
import { useTheme } from './chunk-
|
|
6
|
+
import { useTheme } from './chunk-YTXRIXNZ.mjs';
|
|
7
7
|
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
import { StyleSheet, ScrollView, View, TouchableOpacity, Text } from 'react-native';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { T as Theme, C as ColorScheme, a as ThemeContextValue, b as ThemeColors, R as ResolvedColors } from './index-
|
|
3
|
-
export { c as RetrayProvider, d as RetrayProviderProps } from './index-
|
|
2
|
+
import { T as Theme, C as ColorScheme, a as ThemeContextValue, b as ThemeColors, R as ResolvedColors } from './index-CY34hxPN.mjs';
|
|
3
|
+
export { c as RetrayProvider, d as RetrayProviderProps } from './index-CY34hxPN.mjs';
|
|
4
4
|
export { Button, ButtonProps, ButtonSize, ButtonVariant } from './Button.mjs';
|
|
5
5
|
export { ButtonGroup, ButtonGroupProps } from './ButtonGroup.mjs';
|
|
6
6
|
export { IconButton, IconButtonProps, IconButtonSize, IconButtonVariant } from './IconButton.mjs';
|
|
@@ -46,6 +46,7 @@ export { ErrorBoundary, ErrorBoundaryProps, ErrorFallbackProps } from './ErrorBo
|
|
|
46
46
|
export { PagerDots, PagerDotsProps } from './PagerDots.mjs';
|
|
47
47
|
export { AppHeader, AppHeaderProps } from './AppHeader.mjs';
|
|
48
48
|
export { SelectableGrid, SelectableGridItem, SelectableGridProps } from './SelectableGrid.mjs';
|
|
49
|
+
export { SelectableCard, SelectableCardGroup, SelectableCardGroupProps, SelectableCardProps } from './SelectableCard.mjs';
|
|
49
50
|
export { PricingCard, PricingCardProps, PricingFeature } from './PricingCard.mjs';
|
|
50
51
|
export { TabBar, TabBarItem, TabBarProps } from './TabBar.mjs';
|
|
51
52
|
export { ImageViewer, ImageViewerProps } from './ImageViewer.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { T as Theme, C as ColorScheme, a as ThemeContextValue, b as ThemeColors, R as ResolvedColors } from './index-
|
|
3
|
-
export { c as RetrayProvider, d as RetrayProviderProps } from './index-
|
|
2
|
+
import { T as Theme, C as ColorScheme, a as ThemeContextValue, b as ThemeColors, R as ResolvedColors } from './index-CY34hxPN.js';
|
|
3
|
+
export { c as RetrayProvider, d as RetrayProviderProps } from './index-CY34hxPN.js';
|
|
4
4
|
export { Button, ButtonProps, ButtonSize, ButtonVariant } from './Button.js';
|
|
5
5
|
export { ButtonGroup, ButtonGroupProps } from './ButtonGroup.js';
|
|
6
6
|
export { IconButton, IconButtonProps, IconButtonSize, IconButtonVariant } from './IconButton.js';
|
|
@@ -46,6 +46,7 @@ export { ErrorBoundary, ErrorBoundaryProps, ErrorFallbackProps } from './ErrorBo
|
|
|
46
46
|
export { PagerDots, PagerDotsProps } from './PagerDots.js';
|
|
47
47
|
export { AppHeader, AppHeaderProps } from './AppHeader.js';
|
|
48
48
|
export { SelectableGrid, SelectableGridItem, SelectableGridProps } from './SelectableGrid.js';
|
|
49
|
+
export { SelectableCard, SelectableCardGroup, SelectableCardGroupProps, SelectableCardProps } from './SelectableCard.js';
|
|
49
50
|
export { PricingCard, PricingCardProps, PricingFeature } from './PricingCard.js';
|
|
50
51
|
export { TabBar, TabBarItem, TabBarProps } from './TabBar.js';
|
|
51
52
|
export { ImageViewer, ImageViewerProps } from './ImageViewer.js';
|