@retray-dev/ui-kit 13.0.0 → 13.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/CONSUMER.md +24 -9
- package/README.md +9 -10
- package/{COMPONENTS.md → SKILL.md} +296 -860
- package/dist/Accordion.d.mts +2 -0
- package/dist/Accordion.d.ts +2 -0
- package/dist/Accordion.js +1 -0
- package/dist/Accordion.mjs +1 -2
- package/dist/AlertBanner.mjs +0 -1
- package/dist/AppHeader.d.mts +5 -2
- package/dist/AppHeader.d.ts +5 -2
- package/dist/AppHeader.js +8 -4
- package/dist/AppHeader.mjs +1 -2
- package/dist/Avatar.mjs +0 -1
- package/dist/Badge.mjs +0 -1
- package/dist/Button.mjs +0 -1
- package/dist/ButtonGroup.mjs +0 -1
- package/dist/Card.mjs +0 -1
- package/dist/CategoryStrip.mjs +0 -1
- package/dist/Checkbox.d.mts +2 -1
- package/dist/Checkbox.d.ts +2 -1
- package/dist/Checkbox.js +3 -1
- package/dist/Checkbox.mjs +1 -2
- package/dist/Chip.mjs +0 -1
- package/dist/ConfirmDialog.d.mts +2 -1
- package/dist/ConfirmDialog.d.ts +2 -1
- package/dist/ConfirmDialog.js +26 -14
- package/dist/ConfirmDialog.mjs +1 -2
- package/dist/CurrencyDisplay.mjs +0 -1
- package/dist/CurrencyInput.mjs +0 -1
- package/dist/DetailRow.mjs +0 -1
- package/dist/EmptyState.mjs +0 -1
- package/dist/ErrorBoundary.mjs +0 -1
- package/dist/Form.mjs +0 -1
- package/dist/HolographicCard.mjs +0 -1
- package/dist/IconButton.mjs +0 -1
- package/dist/IconPicker.mjs +0 -1
- package/dist/ImageUpload.d.mts +1 -3
- package/dist/ImageUpload.d.ts +1 -3
- package/dist/ImageUpload.js +27 -26
- package/dist/ImageUpload.mjs +1 -2
- package/dist/ImageViewer.mjs +0 -1
- package/dist/Input.mjs +0 -1
- package/dist/LabelValue.mjs +0 -1
- package/dist/ListGroup.mjs +0 -1
- package/dist/ListItem.d.mts +2 -1
- package/dist/ListItem.d.ts +2 -1
- package/dist/ListItem.js +3 -1
- package/dist/ListItem.mjs +1 -2
- package/dist/MediaCard.mjs +0 -1
- package/dist/MenuGroup.mjs +0 -1
- package/dist/MenuItem.d.mts +2 -1
- package/dist/MenuItem.d.ts +2 -1
- package/dist/MenuItem.js +3 -1
- package/dist/MenuItem.mjs +1 -2
- package/dist/MonthPicker.mjs +0 -1
- package/dist/NumberStepper.d.mts +2 -1
- package/dist/NumberStepper.d.ts +2 -1
- package/dist/NumberStepper.js +4 -1
- package/dist/NumberStepper.mjs +1 -2
- package/dist/PagerDots.mjs +0 -1
- package/dist/Pressable.mjs +0 -1
- package/dist/PricingCard.mjs +0 -1
- package/dist/Progress.mjs +0 -1
- package/dist/RadioGroup.mjs +0 -1
- package/dist/RetrayProvider.mjs +0 -1
- package/dist/Select.d.mts +2 -1
- package/dist/Select.d.ts +2 -1
- package/dist/Select.js +3 -1
- package/dist/Select.mjs +1 -2
- package/dist/SelectableCard.mjs +0 -1
- package/dist/SelectableGrid.js +0 -1
- package/dist/SelectableGrid.mjs +1 -2
- package/dist/Separator.mjs +0 -1
- package/dist/Sheet.d.mts +1 -1
- package/dist/Sheet.d.ts +1 -1
- package/dist/Sheet.js +26 -13
- package/dist/Sheet.mjs +1 -2
- package/dist/SheetSelect.mjs +0 -1
- package/dist/Skeleton.mjs +0 -1
- package/dist/Slider.d.mts +2 -1
- package/dist/Slider.d.ts +2 -1
- package/dist/Slider.js +2 -0
- package/dist/Slider.mjs +1 -2
- package/dist/Spinner.mjs +0 -1
- package/dist/Stats.mjs +0 -1
- package/dist/Switch.d.mts +2 -1
- package/dist/Switch.d.ts +2 -1
- package/dist/Switch.js +2 -1
- package/dist/Switch.mjs +1 -2
- package/dist/TabBar.mjs +0 -1
- package/dist/Tabs.mjs +0 -1
- package/dist/Text.mjs +0 -1
- package/dist/Textarea.mjs +0 -1
- package/dist/Toast.d.mts +12 -10
- package/dist/Toast.d.ts +12 -10
- package/dist/Toast.mjs +0 -1
- package/dist/Toggle.mjs +0 -1
- package/dist/{chunk-TETMEKZE.mjs → chunk-2QXJDRVU.mjs} +4 -1
- package/dist/{chunk-CBIZLRYH.mjs → chunk-422IVD3H.mjs} +1 -0
- package/dist/{chunk-4ZO5PTKF.mjs → chunk-77UOVFIS.mjs} +3 -1
- package/dist/{chunk-2QOHHBJC.mjs → chunk-7BZJRB77.mjs} +25 -15
- package/dist/{chunk-UOKFSFNJ.mjs → chunk-C5ZRMR2E.mjs} +2 -0
- package/dist/{chunk-E4EQSCKR.mjs → chunk-COA2YZOX.mjs} +3 -1
- package/dist/{chunk-6QLBHUEG.mjs → chunk-CZN6L2QU.mjs} +3 -1
- package/dist/{chunk-BTUW5LSG.mjs → chunk-E2PONRJG.mjs} +2 -1
- package/dist/{chunk-6CR4S6W2.mjs → chunk-H6MQL7PS.mjs} +9 -4
- package/dist/{chunk-EROPDCB5.mjs → chunk-HHOOFDBA.mjs} +26 -21
- package/dist/{chunk-URIH43IJ.mjs → chunk-IDVUZIVY.mjs} +3 -1
- package/dist/{chunk-MP7GLMIR.mjs → chunk-NPCBNGNE.mjs} +0 -1
- package/dist/{chunk-V2ZB2XNS.mjs → chunk-UMZTPUB3.mjs} +27 -15
- package/dist/fonts.mjs +0 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +108 -64
- package/dist/index.mjs +13 -14
- package/package.json +14 -12
- package/src/components/Accordion/Accordion.tsx +3 -0
- package/src/components/AppHeader/AppHeader.tsx +25 -10
- package/src/components/Checkbox/Checkbox.tsx +3 -0
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +30 -14
- package/src/components/ImageUpload/ImageUpload.tsx +33 -25
- package/src/components/ListItem/ListItem.tsx +3 -0
- package/src/components/MenuItem/MenuItem.tsx +3 -0
- package/src/components/NumberStepper/NumberStepper.tsx +4 -0
- package/src/components/Select/Select.tsx +3 -0
- package/src/components/SelectableGrid/SelectableGrid.tsx +0 -1
- package/src/components/Sheet/Sheet.tsx +27 -14
- package/src/components/Sheet/index.ts +2 -2
- package/src/components/Slider/Slider.tsx +3 -0
- package/src/components/Switch/Switch.tsx +3 -1
- package/src/components/Text/Text.tsx +1 -0
- package/dist/chunk-Y6FXYEAI.mjs +0 -8
|
@@ -52,6 +52,7 @@ function AccordionItemComponent({
|
|
|
52
52
|
accessibilityRole: "button",
|
|
53
53
|
accessibilityState: { expanded: isOpen },
|
|
54
54
|
accessibilityLabel: typeof item.trigger === "string" ? item.trigger : void 0,
|
|
55
|
+
accessibilityHint: item.accessibilityHint,
|
|
55
56
|
style: styles.trigger
|
|
56
57
|
},
|
|
57
58
|
/* @__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),
|
|
@@ -13,7 +13,8 @@ function Checkbox({
|
|
|
13
13
|
label,
|
|
14
14
|
disabled,
|
|
15
15
|
style,
|
|
16
|
-
accessibilityLabel
|
|
16
|
+
accessibilityLabel,
|
|
17
|
+
accessibilityHint
|
|
17
18
|
}) {
|
|
18
19
|
const { colors } = useTheme();
|
|
19
20
|
const handlePress = () => {
|
|
@@ -34,6 +35,7 @@ function Checkbox({
|
|
|
34
35
|
touchSoundDisabled: true,
|
|
35
36
|
accessibilityRole: "checkbox",
|
|
36
37
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
38
|
+
accessibilityHint,
|
|
37
39
|
accessibilityState: { checked, disabled: !!disabled }
|
|
38
40
|
},
|
|
39
41
|
/* @__PURE__ */ React.createElement(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { impactMedium } from './chunk-ARONDO7M.mjs';
|
|
2
2
|
import { useTheme } from './chunk-KSSVIFYR.mjs';
|
|
3
3
|
import { s, vs, mvs, ms } from './chunk-2CE3TQVY.mjs';
|
|
4
|
-
import React, { useRef, useId,
|
|
4
|
+
import React, { useRef, useId, useState, useEffect, useCallback } 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';
|
|
@@ -39,23 +39,33 @@ function Sheet({
|
|
|
39
39
|
const { colors } = useTheme();
|
|
40
40
|
const insets = useSafeAreaInsets();
|
|
41
41
|
const ref = useRef(null);
|
|
42
|
-
const
|
|
43
|
-
const
|
|
42
|
+
const sheetState = useRef("idle");
|
|
43
|
+
const onCloseRef = useRef(onClose);
|
|
44
44
|
const name = useId();
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
onClose
|
|
45
|
+
const [tick, setTick] = useState(0);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
onCloseRef.current = onClose;
|
|
48
48
|
}, [onClose]);
|
|
49
|
+
const handleDismiss = useCallback(() => {
|
|
50
|
+
sheetState.current = "idle";
|
|
51
|
+
onCloseRef.current?.();
|
|
52
|
+
setTick((t) => t + 1);
|
|
53
|
+
}, []);
|
|
49
54
|
useEffect(() => {
|
|
50
|
-
if (open
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
if (open) {
|
|
56
|
+
if (sheetState.current === "idle") {
|
|
57
|
+
sheetState.current = "presenting";
|
|
58
|
+
impactMedium();
|
|
59
|
+
ref.current?.present();
|
|
60
|
+
sheetState.current = "presented";
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
if (sheetState.current === "presented" || sheetState.current === "presenting") {
|
|
64
|
+
sheetState.current = "dismissing";
|
|
65
|
+
ref.current?.dismiss();
|
|
66
|
+
}
|
|
57
67
|
}
|
|
58
|
-
}, [open]);
|
|
68
|
+
}, [open, tick]);
|
|
59
69
|
const renderBackdrop = useCallback(
|
|
60
70
|
(props) => /* @__PURE__ */ React.createElement(
|
|
61
71
|
BottomSheetBackdrop,
|
|
@@ -191,4 +201,4 @@ var styles = StyleSheet.create({
|
|
|
191
201
|
}
|
|
192
202
|
});
|
|
193
203
|
|
|
194
|
-
export { Sheet };
|
|
204
|
+
export { Sheet, SheetContent, SheetFooter, SheetHeader };
|
|
@@ -16,6 +16,7 @@ function Slider({
|
|
|
16
16
|
showValue = false,
|
|
17
17
|
formatValue = (v) => v.toFixed(2),
|
|
18
18
|
accessibilityLabel,
|
|
19
|
+
accessibilityHint,
|
|
19
20
|
disabled,
|
|
20
21
|
style
|
|
21
22
|
}) {
|
|
@@ -34,6 +35,7 @@ function Slider({
|
|
|
34
35
|
style: [styles.wrapper, style],
|
|
35
36
|
accessibilityRole: "adjustable",
|
|
36
37
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
38
|
+
accessibilityHint,
|
|
37
39
|
accessibilityValue: {
|
|
38
40
|
min: minimumValue,
|
|
39
41
|
max: maximumValue,
|
|
@@ -22,7 +22,8 @@ function MenuItemBase({
|
|
|
22
22
|
showSeparator = false,
|
|
23
23
|
style,
|
|
24
24
|
labelStyle,
|
|
25
|
-
accessibilityLabel
|
|
25
|
+
accessibilityLabel,
|
|
26
|
+
accessibilityHint
|
|
26
27
|
}) {
|
|
27
28
|
const { colors } = useTheme();
|
|
28
29
|
const handlePress = () => {
|
|
@@ -53,6 +54,7 @@ function MenuItemBase({
|
|
|
53
54
|
activateOnHover: true,
|
|
54
55
|
accessibilityRole: "button",
|
|
55
56
|
accessibilityLabel: a11yLabel,
|
|
57
|
+
accessibilityHint,
|
|
56
58
|
accessibilityState: { disabled }
|
|
57
59
|
},
|
|
58
60
|
resolvedIcon ? /* @__PURE__ */ React.createElement(View, { style: styles.iconContainer }, resolvedIcon) : null,
|
|
@@ -31,7 +31,8 @@ function ListItemBase({
|
|
|
31
31
|
subtitleStyle,
|
|
32
32
|
subtitleNumberOfLines = 2,
|
|
33
33
|
captionStyle,
|
|
34
|
-
accessibilityLabel
|
|
34
|
+
accessibilityLabel,
|
|
35
|
+
accessibilityHint
|
|
35
36
|
}) {
|
|
36
37
|
const { colors } = useTheme();
|
|
37
38
|
const handlePress = () => {
|
|
@@ -96,6 +97,7 @@ function ListItemBase({
|
|
|
96
97
|
activateOnHover: true,
|
|
97
98
|
accessibilityRole: "button",
|
|
98
99
|
accessibilityLabel: a11yLabel,
|
|
100
|
+
accessibilityHint,
|
|
99
101
|
accessibilityState: { disabled: !!disabled }
|
|
100
102
|
},
|
|
101
103
|
content
|
|
@@ -15,7 +15,7 @@ var THUMB_OFFSET = s(3);
|
|
|
15
15
|
var THUMB_TRAVEL = TRACK_WIDTH - THUMB_SIZE - THUMB_OFFSET * 2;
|
|
16
16
|
var ICON_SIZE = s(13);
|
|
17
17
|
var DISABLED_OPACITY = 0.45;
|
|
18
|
-
function Switch({ checked = false, onCheckedChange, disabled, style, accessibilityLabel }) {
|
|
18
|
+
function Switch({ checked = false, onCheckedChange, disabled, style, accessibilityLabel, accessibilityHint }) {
|
|
19
19
|
const { colors } = useTheme();
|
|
20
20
|
const isDisabled = !!disabled;
|
|
21
21
|
return /* @__PURE__ */ React.createElement(View, { style: [{ alignSelf: "flex-start" }, style] }, /* @__PURE__ */ React.createElement(
|
|
@@ -30,6 +30,7 @@ function Switch({ checked = false, onCheckedChange, disabled, style, accessibili
|
|
|
30
30
|
touchSoundDisabled: true,
|
|
31
31
|
accessibilityRole: "switch",
|
|
32
32
|
accessibilityLabel,
|
|
33
|
+
accessibilityHint,
|
|
33
34
|
accessibilityState: { checked, disabled: isDisabled },
|
|
34
35
|
style: styles.touchable
|
|
35
36
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IconButton } from './chunk-ZTPYUU5C.mjs';
|
|
2
2
|
import { BREAKPOINTS } from './chunk-QY3X2UYR.mjs';
|
|
3
|
+
import { Icon } from './chunk-MZ6WRTD2.mjs';
|
|
3
4
|
import { useTheme } from './chunk-KSSVIFYR.mjs';
|
|
4
5
|
import { mvs, ms, vs, s } from './chunk-2CE3TQVY.mjs';
|
|
5
6
|
import React from 'react';
|
|
@@ -11,6 +12,7 @@ function AppHeader({
|
|
|
11
12
|
subtitle,
|
|
12
13
|
onBack,
|
|
13
14
|
backIconName = "chevron-left",
|
|
15
|
+
iconName,
|
|
14
16
|
left,
|
|
15
17
|
right,
|
|
16
18
|
titleAlign = "auto",
|
|
@@ -24,7 +26,7 @@ function AppHeader({
|
|
|
24
26
|
const { width } = useWindowDimensions();
|
|
25
27
|
const isWide = width >= BREAKPOINTS.wide;
|
|
26
28
|
const centered = titleAlign === "center" || titleAlign === "auto" && isWide;
|
|
27
|
-
const leftNode = left ?? (onBack ? /* @__PURE__ */ React.createElement(
|
|
29
|
+
const leftNode = left ?? /* @__PURE__ */ React.createElement(React.Fragment, null, onBack ? /* @__PURE__ */ React.createElement(
|
|
28
30
|
IconButton,
|
|
29
31
|
{
|
|
30
32
|
iconName: backIconName,
|
|
@@ -33,7 +35,7 @@ function AppHeader({
|
|
|
33
35
|
onPress: onBack,
|
|
34
36
|
accessibilityLabel: "Atr\xE1s"
|
|
35
37
|
}
|
|
36
|
-
) : null);
|
|
38
|
+
) : null, iconName && !left ? /* @__PURE__ */ React.createElement(Icon, { name: iconName, size: 20, color: colors.foreground }) : null);
|
|
37
39
|
const titleBlock = /* @__PURE__ */ React.createElement(View, { style: [styles.titleBlock, centered && styles.titleBlockCentered], pointerEvents: "none" }, title ? /* @__PURE__ */ React.createElement(
|
|
38
40
|
Text,
|
|
39
41
|
{
|
|
@@ -83,10 +85,13 @@ var styles = StyleSheet.create({
|
|
|
83
85
|
minWidth: s(44),
|
|
84
86
|
flexDirection: "row",
|
|
85
87
|
alignItems: "center",
|
|
86
|
-
justifyContent: "flex-start"
|
|
88
|
+
justifyContent: "flex-start",
|
|
89
|
+
paddingLeft: s(8),
|
|
90
|
+
gap: s(4)
|
|
87
91
|
},
|
|
88
92
|
sideRight: {
|
|
89
|
-
justifyContent: "flex-end"
|
|
93
|
+
justifyContent: "flex-end",
|
|
94
|
+
paddingRight: s(8)
|
|
90
95
|
},
|
|
91
96
|
titleBlock: {
|
|
92
97
|
flex: 1,
|
|
@@ -4,7 +4,6 @@ import { impactLight } from './chunk-ARONDO7M.mjs';
|
|
|
4
4
|
import { RADIUS } from './chunk-QY3X2UYR.mjs';
|
|
5
5
|
import { useTheme } from './chunk-KSSVIFYR.mjs';
|
|
6
6
|
import { s, vs, ms } from './chunk-2CE3TQVY.mjs';
|
|
7
|
-
import { __require } from './chunk-Y6FXYEAI.mjs';
|
|
8
7
|
import React, { useState } from 'react';
|
|
9
8
|
import { Image } from 'expo-image';
|
|
10
9
|
import { StyleSheet, View, Text } from 'react-native';
|
|
@@ -20,7 +19,6 @@ function ImageUpload({
|
|
|
20
19
|
height = 200,
|
|
21
20
|
borderRadius = RADIUS.lg,
|
|
22
21
|
resizeMode = "cover",
|
|
23
|
-
allowsEditing = true,
|
|
24
22
|
disabled = false,
|
|
25
23
|
style,
|
|
26
24
|
accessibilityLabel,
|
|
@@ -28,25 +26,32 @@ function ImageUpload({
|
|
|
28
26
|
}) {
|
|
29
27
|
const { colors } = useTheme();
|
|
30
28
|
const [imageLoaded, setImageLoaded] = useState(false);
|
|
29
|
+
const [isPicking, setIsPicking] = useState(false);
|
|
31
30
|
const handlePress = async () => {
|
|
32
|
-
if (disabled || loading) return;
|
|
31
|
+
if (disabled || loading || isPicking) return;
|
|
33
32
|
impactLight();
|
|
34
33
|
onPickerStarting?.();
|
|
35
|
-
|
|
34
|
+
setIsPicking(true);
|
|
36
35
|
try {
|
|
37
|
-
|
|
36
|
+
const { launchImageLibrary } = await import('react-native-image-picker');
|
|
37
|
+
const result = await new Promise((resolve) => {
|
|
38
|
+
launchImageLibrary(
|
|
39
|
+
{
|
|
40
|
+
mediaType: "photo",
|
|
41
|
+
quality: 0.8,
|
|
42
|
+
selectionLimit: 1,
|
|
43
|
+
includeBase64: false
|
|
44
|
+
},
|
|
45
|
+
resolve
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
if (!result.didCancel && !result.errorCode && result.assets?.[0]?.uri) {
|
|
49
|
+
setImageLoaded(false);
|
|
50
|
+
onChange?.(result.assets[0].uri);
|
|
51
|
+
}
|
|
38
52
|
} catch {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
const result = await picker.launchImageLibraryAsync({
|
|
43
|
-
mediaTypes: ["images"],
|
|
44
|
-
allowsEditing,
|
|
45
|
-
quality: 0.8
|
|
46
|
-
});
|
|
47
|
-
if (!result.canceled && result.assets?.[0]) {
|
|
48
|
-
setImageLoaded(false);
|
|
49
|
-
onChange?.(result.assets[0].uri);
|
|
53
|
+
} finally {
|
|
54
|
+
setIsPicking(false);
|
|
50
55
|
}
|
|
51
56
|
};
|
|
52
57
|
const containerStyle = {
|
|
@@ -89,7 +94,7 @@ function ImageUpload({
|
|
|
89
94
|
},
|
|
90
95
|
placeholder
|
|
91
96
|
) : null),
|
|
92
|
-
loading ? /* @__PURE__ */ React.createElement(View, { style: [styles.loadingOverlay, { backgroundColor: colors.overlay }] }, /* @__PURE__ */ React.createElement(Spinner, { size: "md" })) : null,
|
|
97
|
+
loading || isPicking ? /* @__PURE__ */ React.createElement(View, { style: [styles.loadingOverlay, { backgroundColor: colors.overlay }] }, /* @__PURE__ */ React.createElement(Spinner, { size: "md" })) : null,
|
|
93
98
|
value && !loading ? /* @__PURE__ */ React.createElement(View, { style: styles.editBadge, pointerEvents: "none" }, /* @__PURE__ */ React.createElement(View, { style: [styles.editBadgeInner, { backgroundColor: colors.overlay }] }, /* @__PURE__ */ React.createElement(Feather, { name: "edit-2", size: ms(12), color: "#fff" }))) : null
|
|
94
99
|
);
|
|
95
100
|
}
|
|
@@ -112,12 +117,12 @@ var styles = StyleSheet.create({
|
|
|
112
117
|
},
|
|
113
118
|
editBadge: {
|
|
114
119
|
position: "absolute",
|
|
115
|
-
bottom: vs(
|
|
116
|
-
right: s(
|
|
120
|
+
bottom: vs(14),
|
|
121
|
+
right: s(14)
|
|
117
122
|
},
|
|
118
123
|
editBadgeInner: {
|
|
119
|
-
width: s(
|
|
120
|
-
height: s(
|
|
124
|
+
width: s(24),
|
|
125
|
+
height: s(24),
|
|
121
126
|
borderRadius: 999,
|
|
122
127
|
alignItems: "center",
|
|
123
128
|
justifyContent: "center"
|
|
@@ -20,7 +20,8 @@ function Select({
|
|
|
20
20
|
error,
|
|
21
21
|
disabled,
|
|
22
22
|
style,
|
|
23
|
-
accessibilityLabel
|
|
23
|
+
accessibilityLabel,
|
|
24
|
+
accessibilityHint
|
|
24
25
|
}) {
|
|
25
26
|
const { colors } = useTheme();
|
|
26
27
|
const [pickerVisible, setPickerVisible] = useState(false);
|
|
@@ -64,6 +65,7 @@ function Select({
|
|
|
64
65
|
touchSoundDisabled: true,
|
|
65
66
|
accessibilityRole: "combobox",
|
|
66
67
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
68
|
+
accessibilityHint,
|
|
67
69
|
accessibilityValue: { text: selected?.label ?? placeholder },
|
|
68
70
|
accessibilityState: { disabled: !!disabled, expanded: pickerVisible }
|
|
69
71
|
},
|
|
@@ -2,7 +2,7 @@ import { Button } from './chunk-Y6YS33GM.mjs';
|
|
|
2
2
|
import { impactMedium, notificationSuccess, selectionAsync } from './chunk-ARONDO7M.mjs';
|
|
3
3
|
import { useTheme } from './chunk-KSSVIFYR.mjs';
|
|
4
4
|
import { vs, mvs, ms, s } from './chunk-2CE3TQVY.mjs';
|
|
5
|
-
import React, { useRef, useId,
|
|
5
|
+
import React, { useRef, useId, useState, useEffect, useCallback } 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';
|
|
@@ -18,28 +18,39 @@ function ConfirmDialog({
|
|
|
18
18
|
loading = false,
|
|
19
19
|
showCloseButton = false,
|
|
20
20
|
onConfirm,
|
|
21
|
-
onCancel
|
|
21
|
+
onCancel,
|
|
22
|
+
accessibilityHint
|
|
22
23
|
}) {
|
|
23
24
|
const { colors } = useTheme();
|
|
24
25
|
const insets = useSafeAreaInsets();
|
|
25
26
|
const ref = useRef(null);
|
|
26
|
-
const
|
|
27
|
-
const
|
|
27
|
+
const dialogState = useRef("idle");
|
|
28
|
+
const onCancelRef = useRef(onCancel);
|
|
28
29
|
const name = useId();
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
onCancel
|
|
30
|
+
const [tick, setTick] = useState(0);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
onCancelRef.current = onCancel;
|
|
32
33
|
}, [onCancel]);
|
|
34
|
+
const handleDismiss = useCallback(() => {
|
|
35
|
+
dialogState.current = "idle";
|
|
36
|
+
onCancelRef.current?.();
|
|
37
|
+
setTick((t) => t + 1);
|
|
38
|
+
}, []);
|
|
33
39
|
useEffect(() => {
|
|
34
|
-
if (visible
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
if (visible) {
|
|
41
|
+
if (dialogState.current === "idle") {
|
|
42
|
+
dialogState.current = "presenting";
|
|
43
|
+
impactMedium();
|
|
44
|
+
ref.current?.present();
|
|
45
|
+
dialogState.current = "presented";
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
if (dialogState.current === "presented" || dialogState.current === "presenting") {
|
|
49
|
+
dialogState.current = "dismissing";
|
|
50
|
+
ref.current?.dismiss();
|
|
51
|
+
}
|
|
41
52
|
}
|
|
42
|
-
}, [visible]);
|
|
53
|
+
}, [visible, tick]);
|
|
43
54
|
const renderBackdrop = useCallback(
|
|
44
55
|
(props) => /* @__PURE__ */ React.createElement(
|
|
45
56
|
BottomSheetBackdrop,
|
|
@@ -89,6 +100,7 @@ function ConfirmDialog({
|
|
|
89
100
|
notificationSuccess();
|
|
90
101
|
onConfirm();
|
|
91
102
|
},
|
|
103
|
+
accessibilityHint,
|
|
92
104
|
icon: /* @__PURE__ */ React.createElement(
|
|
93
105
|
Feather,
|
|
94
106
|
{
|
package/dist/fonts.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -23,7 +23,7 @@ export { RadioGroup, RadioGroupProps, RadioOption } from './RadioGroup.mjs';
|
|
|
23
23
|
export { TabItem, Tabs, TabsContent, TabsContentProps, TabsProps } from './Tabs.mjs';
|
|
24
24
|
export { Accordion, AccordionItem, AccordionProps } from './Accordion.mjs';
|
|
25
25
|
export { Slider, SliderProps } from './Slider.mjs';
|
|
26
|
-
export { Sheet, SheetProps } from './Sheet.mjs';
|
|
26
|
+
export { Sheet, SheetContent, SheetContentProps, SheetFooter, SheetFooterProps, SheetHeader, SheetHeaderProps, SheetProps } from './Sheet.mjs';
|
|
27
27
|
export { Select, SelectOption, SelectProps } from './Select.mjs';
|
|
28
28
|
export { ToastProvider, useToast } from './Toast.mjs';
|
|
29
29
|
export { CurrencyInput, CurrencyInputProps } from './CurrencyInput.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { RadioGroup, RadioGroupProps, RadioOption } from './RadioGroup.js';
|
|
|
23
23
|
export { TabItem, Tabs, TabsContent, TabsContentProps, TabsProps } from './Tabs.js';
|
|
24
24
|
export { Accordion, AccordionItem, AccordionProps } from './Accordion.js';
|
|
25
25
|
export { Slider, SliderProps } from './Slider.js';
|
|
26
|
-
export { Sheet, SheetProps } from './Sheet.js';
|
|
26
|
+
export { Sheet, SheetContent, SheetContentProps, SheetFooter, SheetFooterProps, SheetHeader, SheetHeaderProps, SheetProps } from './Sheet.js';
|
|
27
27
|
export { Select, SelectOption, SelectProps } from './Select.js';
|
|
28
28
|
export { ToastProvider, useToast } from './Toast.js';
|
|
29
29
|
export { CurrencyInput, CurrencyInputProps } from './CurrencyInput.js';
|