@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useId } from 'react'
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState, useId } from 'react'
|
|
2
2
|
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native'
|
|
3
3
|
import {
|
|
4
4
|
BottomSheetModal,
|
|
@@ -24,6 +24,7 @@ export interface ConfirmDialogProps {
|
|
|
24
24
|
showCloseButton?: boolean
|
|
25
25
|
onConfirm: () => void
|
|
26
26
|
onCancel: () => void
|
|
27
|
+
accessibilityHint?: string
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export function ConfirmDialog({
|
|
@@ -37,29 +38,43 @@ export function ConfirmDialog({
|
|
|
37
38
|
showCloseButton = false,
|
|
38
39
|
onConfirm,
|
|
39
40
|
onCancel,
|
|
41
|
+
accessibilityHint,
|
|
40
42
|
}: ConfirmDialogProps) {
|
|
43
|
+
type DialogState = 'idle' | 'presenting' | 'presented' | 'dismissing'
|
|
44
|
+
|
|
41
45
|
const { colors } = useTheme()
|
|
42
46
|
const insets = useSafeAreaInsets()
|
|
43
47
|
const ref = useRef<BottomSheetModal>(null)
|
|
44
|
-
const
|
|
45
|
-
const
|
|
48
|
+
const dialogState = useRef<DialogState>('idle')
|
|
49
|
+
const onCancelRef = useRef(onCancel)
|
|
46
50
|
const name = useId()
|
|
51
|
+
const [tick, setTick] = useState(0)
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
onCancel()
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
onCancelRef.current = onCancel
|
|
51
55
|
}, [onCancel])
|
|
52
56
|
|
|
57
|
+
const handleDismiss = useCallback(() => {
|
|
58
|
+
dialogState.current = 'idle'
|
|
59
|
+
onCancelRef.current?.()
|
|
60
|
+
setTick((t) => t + 1)
|
|
61
|
+
}, [])
|
|
62
|
+
|
|
53
63
|
useEffect(() => {
|
|
54
|
-
if (visible
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
if (visible) {
|
|
65
|
+
if (dialogState.current === 'idle') {
|
|
66
|
+
dialogState.current = 'presenting'
|
|
67
|
+
impactMedium()
|
|
68
|
+
ref.current?.present()
|
|
69
|
+
dialogState.current = 'presented'
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
if (dialogState.current === 'presented' || dialogState.current === 'presenting') {
|
|
73
|
+
dialogState.current = 'dismissing'
|
|
74
|
+
ref.current?.dismiss()
|
|
75
|
+
}
|
|
61
76
|
}
|
|
62
|
-
}, [visible])
|
|
77
|
+
}, [visible, tick])
|
|
63
78
|
|
|
64
79
|
const renderBackdrop = useCallback(
|
|
65
80
|
(props: BottomSheetBackdropProps) => (
|
|
@@ -122,6 +137,7 @@ export function ConfirmDialog({
|
|
|
122
137
|
notificationSuccess()
|
|
123
138
|
onConfirm()
|
|
124
139
|
}}
|
|
140
|
+
accessibilityHint={accessibilityHint}
|
|
125
141
|
icon={
|
|
126
142
|
<Feather
|
|
127
143
|
name={confirmVariant === 'destructive' ? 'trash-2' : 'check'}
|
|
@@ -28,8 +28,6 @@ export interface ImageUploadProps {
|
|
|
28
28
|
borderRadius?: number
|
|
29
29
|
/** Aspect ratio for the selected image. Defaults to 'cover'. */
|
|
30
30
|
resizeMode?: 'cover' | 'contain' | 'stretch'
|
|
31
|
-
/** Whether to allow the user to crop the image after selecting. Defaults to true. */
|
|
32
|
-
allowsEditing?: boolean
|
|
33
31
|
disabled?: boolean
|
|
34
32
|
style?: ViewStyle
|
|
35
33
|
accessibilityLabel?: string
|
|
@@ -47,7 +45,6 @@ export function ImageUpload({
|
|
|
47
45
|
height = 200,
|
|
48
46
|
borderRadius = RADIUS.lg,
|
|
49
47
|
resizeMode = 'cover',
|
|
50
|
-
allowsEditing = true,
|
|
51
48
|
disabled = false,
|
|
52
49
|
style,
|
|
53
50
|
accessibilityLabel,
|
|
@@ -55,32 +52,43 @@ export function ImageUpload({
|
|
|
55
52
|
}: ImageUploadProps) {
|
|
56
53
|
const { colors } = useTheme()
|
|
57
54
|
const [imageLoaded, setImageLoaded] = useState(false)
|
|
55
|
+
const [isPicking, setIsPicking] = useState(false)
|
|
58
56
|
|
|
59
57
|
const handlePress = async () => {
|
|
60
|
-
if (disabled || loading) return
|
|
58
|
+
if (disabled || loading || isPicking) return
|
|
61
59
|
impactLight()
|
|
62
60
|
|
|
63
61
|
onPickerStarting?.()
|
|
62
|
+
setIsPicking(true)
|
|
64
63
|
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
-
let picker: any
|
|
67
64
|
try {
|
|
68
|
-
|
|
69
|
-
picker = require('expo-image-picker')
|
|
70
|
-
} catch {
|
|
71
|
-
if (__DEV__) console.warn('[ImageUpload] expo-image-picker not installed.')
|
|
72
|
-
return
|
|
73
|
-
}
|
|
65
|
+
const { launchImageLibrary } = await import('react-native-image-picker')
|
|
74
66
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
const result = await new Promise<{
|
|
68
|
+
didCancel?: boolean
|
|
69
|
+
errorCode?: string
|
|
70
|
+
errorMessage?: string
|
|
71
|
+
assets?: { uri?: string }[]
|
|
72
|
+
}>((resolve) => {
|
|
73
|
+
launchImageLibrary(
|
|
74
|
+
{
|
|
75
|
+
mediaType: 'photo',
|
|
76
|
+
quality: 0.8,
|
|
77
|
+
selectionLimit: 1,
|
|
78
|
+
includeBase64: false,
|
|
79
|
+
},
|
|
80
|
+
resolve,
|
|
81
|
+
)
|
|
82
|
+
})
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
if (!result.didCancel && !result.errorCode && result.assets?.[0]?.uri) {
|
|
85
|
+
setImageLoaded(false)
|
|
86
|
+
onChange?.(result.assets[0].uri)
|
|
87
|
+
}
|
|
88
|
+
} catch {
|
|
89
|
+
// Module load failed or picker errored — silently return
|
|
90
|
+
} finally {
|
|
91
|
+
setIsPicking(false)
|
|
84
92
|
}
|
|
85
93
|
}
|
|
86
94
|
|
|
@@ -128,7 +136,7 @@ export function ImageUpload({
|
|
|
128
136
|
) : null}
|
|
129
137
|
</View>
|
|
130
138
|
)}
|
|
131
|
-
{loading ? (
|
|
139
|
+
{loading || isPicking ? (
|
|
132
140
|
<View style={[styles.loadingOverlay, { backgroundColor: colors.overlay }]}>
|
|
133
141
|
<Spinner size="md" />
|
|
134
142
|
</View>
|
|
@@ -163,12 +171,12 @@ const styles = StyleSheet.create({
|
|
|
163
171
|
},
|
|
164
172
|
editBadge: {
|
|
165
173
|
position: 'absolute',
|
|
166
|
-
bottom: vs(
|
|
167
|
-
right: s(
|
|
174
|
+
bottom: vs(14),
|
|
175
|
+
right: s(14),
|
|
168
176
|
},
|
|
169
177
|
editBadgeInner: {
|
|
170
|
-
width: s(
|
|
171
|
-
height: s(
|
|
178
|
+
width: s(24),
|
|
179
|
+
height: s(24),
|
|
172
180
|
borderRadius: 999,
|
|
173
181
|
alignItems: 'center',
|
|
174
182
|
justifyContent: 'center',
|
|
@@ -85,6 +85,7 @@ export interface ListItemProps {
|
|
|
85
85
|
captionStyle?: TextStyle
|
|
86
86
|
/** Accessibility label override. Defaults to the title. */
|
|
87
87
|
accessibilityLabel?: string
|
|
88
|
+
accessibilityHint?: string
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
function ListItemBase({
|
|
@@ -110,6 +111,7 @@ function ListItemBase({
|
|
|
110
111
|
subtitleNumberOfLines = 2,
|
|
111
112
|
captionStyle,
|
|
112
113
|
accessibilityLabel,
|
|
114
|
+
accessibilityHint,
|
|
113
115
|
}: ListItemProps) {
|
|
114
116
|
const { colors } = useTheme()
|
|
115
117
|
|
|
@@ -221,6 +223,7 @@ function ListItemBase({
|
|
|
221
223
|
activateOnHover
|
|
222
224
|
accessibilityRole="button"
|
|
223
225
|
accessibilityLabel={a11yLabel}
|
|
226
|
+
accessibilityHint={accessibilityHint}
|
|
224
227
|
accessibilityState={{ disabled: !!disabled }}
|
|
225
228
|
>
|
|
226
229
|
{content}
|
|
@@ -55,6 +55,7 @@ export interface MenuItemProps {
|
|
|
55
55
|
labelStyle?: TextStyle
|
|
56
56
|
/** Accessibility label override. Defaults to label. */
|
|
57
57
|
accessibilityLabel?: string
|
|
58
|
+
accessibilityHint?: string
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
function MenuItemBase({
|
|
@@ -72,6 +73,7 @@ function MenuItemBase({
|
|
|
72
73
|
style,
|
|
73
74
|
labelStyle,
|
|
74
75
|
accessibilityLabel,
|
|
76
|
+
accessibilityHint,
|
|
75
77
|
}: MenuItemProps) {
|
|
76
78
|
const { colors } = useTheme()
|
|
77
79
|
|
|
@@ -112,6 +114,7 @@ function MenuItemBase({
|
|
|
112
114
|
activateOnHover
|
|
113
115
|
accessibilityRole="button"
|
|
114
116
|
accessibilityLabel={a11yLabel}
|
|
117
|
+
accessibilityHint={accessibilityHint}
|
|
115
118
|
accessibilityState={{ disabled }}
|
|
116
119
|
>
|
|
117
120
|
{resolvedIcon ? (
|
|
@@ -19,6 +19,7 @@ export interface NumberStepperProps {
|
|
|
19
19
|
disabled?: boolean
|
|
20
20
|
style?: ViewStyle
|
|
21
21
|
accessibilityLabel?: string
|
|
22
|
+
accessibilityHint?: string
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const sizeConfig: Record<NumberStepperSize, { button: number; icon: number; valueFontSize: number; valueLineHeight: number; valueMinWidth: number }> = {
|
|
@@ -37,6 +38,7 @@ function NumberStepperBase({
|
|
|
37
38
|
disabled = false,
|
|
38
39
|
style,
|
|
39
40
|
accessibilityLabel,
|
|
41
|
+
accessibilityHint,
|
|
40
42
|
}: NumberStepperProps) {
|
|
41
43
|
const { colors } = useTheme()
|
|
42
44
|
|
|
@@ -78,6 +80,7 @@ function NumberStepperBase({
|
|
|
78
80
|
touchSoundDisabled
|
|
79
81
|
accessibilityRole="button"
|
|
80
82
|
accessibilityLabel={`Disminuir, valor actual ${displayValue}`}
|
|
83
|
+
accessibilityHint={accessibilityHint}
|
|
81
84
|
accessibilityState={{ disabled: !canDecrement }}
|
|
82
85
|
>
|
|
83
86
|
<Icon name="minus" size={iconSize} color={canDecrement ? colors.foreground : colors.foregroundMuted} />
|
|
@@ -115,6 +118,7 @@ function NumberStepperBase({
|
|
|
115
118
|
touchSoundDisabled
|
|
116
119
|
accessibilityRole="button"
|
|
117
120
|
accessibilityLabel={`Aumentar, valor actual ${displayValue}`}
|
|
121
|
+
accessibilityHint={accessibilityHint}
|
|
118
122
|
accessibilityState={{ disabled: !canIncrement }}
|
|
119
123
|
>
|
|
120
124
|
<Icon name="plus" size={iconSize} color={canIncrement ? colors.foreground : colors.foregroundMuted} />
|
|
@@ -28,6 +28,7 @@ export interface SelectProps {
|
|
|
28
28
|
disabled?: boolean
|
|
29
29
|
style?: ViewStyle
|
|
30
30
|
accessibilityLabel?: string
|
|
31
|
+
accessibilityHint?: string
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export function Select({
|
|
@@ -41,6 +42,7 @@ export function Select({
|
|
|
41
42
|
disabled,
|
|
42
43
|
style,
|
|
43
44
|
accessibilityLabel,
|
|
45
|
+
accessibilityHint,
|
|
44
46
|
}: SelectProps) {
|
|
45
47
|
const { colors } = useTheme()
|
|
46
48
|
const [pickerVisible, setPickerVisible] = useState(false)
|
|
@@ -93,6 +95,7 @@ export function Select({
|
|
|
93
95
|
touchSoundDisabled
|
|
94
96
|
accessibilityRole="combobox"
|
|
95
97
|
accessibilityLabel={accessibilityLabel ?? label}
|
|
98
|
+
accessibilityHint={accessibilityHint}
|
|
96
99
|
accessibilityValue={{ text: selected?.label ?? placeholder }}
|
|
97
100
|
accessibilityState={{ disabled: !!disabled, expanded: pickerVisible }}
|
|
98
101
|
>
|
|
@@ -58,7 +58,6 @@ function Cell<T extends string | number>({ item, selected, width, onPress }: Cel
|
|
|
58
58
|
{ width },
|
|
59
59
|
styles.cell,
|
|
60
60
|
{
|
|
61
|
-
backgroundColor: selected ? colors.primary + '14' : colors.surface,
|
|
62
61
|
borderColor: selected ? colors.primary : 'transparent',
|
|
63
62
|
},
|
|
64
63
|
item.disabled && styles.cellDisabled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useId } from 'react'
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState, useId } from 'react'
|
|
2
2
|
import { View, Text, TouchableOpacity, StyleSheet, ViewStyle } from 'react-native'
|
|
3
3
|
import {
|
|
4
4
|
BottomSheetModal,
|
|
@@ -95,28 +95,41 @@ export function Sheet({
|
|
|
95
95
|
footer,
|
|
96
96
|
snapPoints,
|
|
97
97
|
}: SheetProps) {
|
|
98
|
+
type SheetState = 'idle' | 'presenting' | 'presented' | 'dismissing'
|
|
99
|
+
|
|
98
100
|
const { colors } = useTheme()
|
|
99
101
|
const insets = useSafeAreaInsets()
|
|
100
102
|
const ref = useRef<BottomSheetModal>(null)
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
+
const sheetState = useRef<SheetState>('idle')
|
|
104
|
+
const onCloseRef = useRef(onClose)
|
|
103
105
|
const name = useId()
|
|
106
|
+
const [tick, setTick] = useState(0)
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
onClose?.()
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
onCloseRef.current = onClose
|
|
108
110
|
}, [onClose])
|
|
109
111
|
|
|
112
|
+
const handleDismiss = useCallback(() => {
|
|
113
|
+
sheetState.current = 'idle'
|
|
114
|
+
onCloseRef.current?.()
|
|
115
|
+
setTick((t) => t + 1)
|
|
116
|
+
}, [])
|
|
117
|
+
|
|
110
118
|
useEffect(() => {
|
|
111
|
-
if (open
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
if (open) {
|
|
120
|
+
if (sheetState.current === 'idle') {
|
|
121
|
+
sheetState.current = 'presenting'
|
|
122
|
+
impactMedium()
|
|
123
|
+
ref.current?.present()
|
|
124
|
+
sheetState.current = 'presented'
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
if (sheetState.current === 'presented' || sheetState.current === 'presenting') {
|
|
128
|
+
sheetState.current = 'dismissing'
|
|
129
|
+
ref.current?.dismiss()
|
|
130
|
+
}
|
|
118
131
|
}
|
|
119
|
-
}, [open])
|
|
132
|
+
}, [open, tick])
|
|
120
133
|
|
|
121
134
|
const renderBackdrop = useCallback(
|
|
122
135
|
(props: BottomSheetBackdropProps) => (
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Sheet, BottomSheetModalProvider, SheetTextInput } from './Sheet'
|
|
2
|
-
export type { SheetProps } from './Sheet'
|
|
1
|
+
export { Sheet, SheetHeader, SheetContent, SheetFooter, BottomSheetModalProvider, SheetTextInput } from './Sheet'
|
|
2
|
+
export type { SheetProps, SheetHeaderProps, SheetContentProps, SheetFooterProps } from './Sheet'
|
|
@@ -16,6 +16,7 @@ export interface SliderProps {
|
|
|
16
16
|
showValue?: boolean
|
|
17
17
|
formatValue?: (value: number) => string
|
|
18
18
|
accessibilityLabel?: string
|
|
19
|
+
accessibilityHint?: string
|
|
19
20
|
disabled?: boolean
|
|
20
21
|
style?: ViewStyle
|
|
21
22
|
}
|
|
@@ -31,6 +32,7 @@ export function Slider({
|
|
|
31
32
|
showValue = false,
|
|
32
33
|
formatValue = (v: number) => v.toFixed(2),
|
|
33
34
|
accessibilityLabel,
|
|
35
|
+
accessibilityHint,
|
|
34
36
|
disabled,
|
|
35
37
|
style,
|
|
36
38
|
}: SliderProps) {
|
|
@@ -50,6 +52,7 @@ export function Slider({
|
|
|
50
52
|
style={[styles.wrapper, style]}
|
|
51
53
|
accessibilityRole="adjustable"
|
|
52
54
|
accessibilityLabel={accessibilityLabel ?? label}
|
|
55
|
+
accessibilityHint={accessibilityHint}
|
|
53
56
|
accessibilityValue={{
|
|
54
57
|
min: minimumValue,
|
|
55
58
|
max: maximumValue,
|
|
@@ -23,9 +23,10 @@ export interface SwitchProps {
|
|
|
23
23
|
disabled?: boolean
|
|
24
24
|
style?: ViewStyle
|
|
25
25
|
accessibilityLabel?: string
|
|
26
|
+
accessibilityHint?: string
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
export function Switch({ checked = false, onCheckedChange, disabled, style, accessibilityLabel }: SwitchProps) {
|
|
29
|
+
export function Switch({ checked = false, onCheckedChange, disabled, style, accessibilityLabel, accessibilityHint }: SwitchProps) {
|
|
29
30
|
const { colors } = useTheme()
|
|
30
31
|
const isDisabled = !!disabled
|
|
31
32
|
|
|
@@ -41,6 +42,7 @@ export function Switch({ checked = false, onCheckedChange, disabled, style, acce
|
|
|
41
42
|
touchSoundDisabled
|
|
42
43
|
accessibilityRole="switch"
|
|
43
44
|
accessibilityLabel={accessibilityLabel}
|
|
45
|
+
accessibilityHint={accessibilityHint}
|
|
44
46
|
accessibilityState={{ checked, disabled: isDisabled }}
|
|
45
47
|
style={styles.touchable}
|
|
46
48
|
>
|
|
@@ -77,6 +77,7 @@ function warnIfFontsMissing(): void {
|
|
|
77
77
|
if (fontWarned || typeof __DEV__ === 'undefined' || !__DEV__) return
|
|
78
78
|
fontWarned = true
|
|
79
79
|
if (!expoFontIsLoaded('Sohne-Regular')) {
|
|
80
|
+
// eslint-disable-next-line no-console
|
|
80
81
|
console.warn('[retray-ui-kit] Sohne fonts not loaded — text falls back to system font.')
|
|
81
82
|
}
|
|
82
83
|
}
|
package/dist/chunk-Y6FXYEAI.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export { __require };
|