@webority-technologies/mobile 0.0.24 → 0.0.25
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/lib/commonjs/components/Autocomplete/Autocomplete.js +204 -0
- package/lib/commonjs/components/Autocomplete/index.js +13 -0
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/commonjs/components/Confetti/Confetti.js +170 -0
- package/lib/commonjs/components/Confetti/index.js +13 -0
- package/lib/commonjs/components/FieldBase/FieldBase.js +0 -2
- package/lib/commonjs/components/IconButton/IconButton.js +176 -0
- package/lib/commonjs/components/IconButton/index.js +13 -0
- package/lib/commonjs/components/Modal/Modal.js +0 -1
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +32 -4
- package/lib/commonjs/components/SlideToConfirm/SlideToConfirm.js +224 -0
- package/lib/commonjs/components/SlideToConfirm/index.js +13 -0
- package/lib/commonjs/components/index.js +142 -114
- package/lib/commonjs/hooks/usePressAnimation.js +0 -1
- package/lib/module/components/Autocomplete/Autocomplete.js +199 -0
- package/lib/module/components/Autocomplete/index.js +4 -0
- package/lib/module/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/module/components/Confetti/Confetti.js +166 -0
- package/lib/module/components/Confetti/index.js +4 -0
- package/lib/module/components/FieldBase/FieldBase.js +0 -2
- package/lib/module/components/IconButton/IconButton.js +172 -0
- package/lib/module/components/IconButton/index.js +4 -0
- package/lib/module/components/Modal/Modal.js +0 -1
- package/lib/module/components/ProgressBar/ProgressBar.js +33 -5
- package/lib/module/components/SlideToConfirm/SlideToConfirm.js +220 -0
- package/lib/module/components/SlideToConfirm/index.js +4 -0
- package/lib/module/components/index.js +4 -0
- package/lib/module/hooks/usePressAnimation.js +0 -1
- package/lib/typescript/commonjs/components/Autocomplete/Autocomplete.d.ts +53 -0
- package/lib/typescript/commonjs/components/Autocomplete/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Confetti/Confetti.d.ts +41 -0
- package/lib/typescript/commonjs/components/Confetti/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/IconButton/IconButton.d.ts +34 -0
- package/lib/typescript/commonjs/components/IconButton/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +12 -0
- package/lib/typescript/commonjs/components/ProgressBar/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/SlideToConfirm/SlideToConfirm.d.ts +34 -0
- package/lib/typescript/commonjs/components/SlideToConfirm/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts +9 -1
- package/lib/typescript/commonjs/hooks/usePressAnimation.d.ts +1 -2
- package/lib/typescript/module/components/Autocomplete/Autocomplete.d.ts +53 -0
- package/lib/typescript/module/components/Autocomplete/index.d.ts +3 -0
- package/lib/typescript/module/components/Confetti/Confetti.d.ts +41 -0
- package/lib/typescript/module/components/Confetti/index.d.ts +3 -0
- package/lib/typescript/module/components/IconButton/IconButton.d.ts +34 -0
- package/lib/typescript/module/components/IconButton/index.d.ts +3 -0
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +12 -0
- package/lib/typescript/module/components/ProgressBar/index.d.ts +1 -1
- package/lib/typescript/module/components/SlideToConfirm/SlideToConfirm.d.ts +34 -0
- package/lib/typescript/module/components/SlideToConfirm/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts +9 -1
- package/lib/typescript/module/hooks/usePressAnimation.d.ts +1 -2
- package/package.json +1 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef, useCallback, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
6
|
+
import Animated, { Easing, cancelAnimation, runOnJS, useAnimatedStyle, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
|
|
7
|
+
import { useTheme } from "../../theme/index.js";
|
|
8
|
+
import { resolveHaptic, triggerHaptic } from "../../utils/index.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const SIZE_MAP = {
|
|
11
|
+
sm: {
|
|
12
|
+
height: 44,
|
|
13
|
+
pad: 4
|
|
14
|
+
},
|
|
15
|
+
md: {
|
|
16
|
+
height: 56,
|
|
17
|
+
pad: 5
|
|
18
|
+
},
|
|
19
|
+
lg: {
|
|
20
|
+
height: 64,
|
|
21
|
+
pad: 6
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const Chevron = ({
|
|
25
|
+
color,
|
|
26
|
+
size
|
|
27
|
+
}) => /*#__PURE__*/_jsx(View, {
|
|
28
|
+
style: {
|
|
29
|
+
width: 0,
|
|
30
|
+
height: 0,
|
|
31
|
+
borderTopWidth: size * 0.4,
|
|
32
|
+
borderBottomWidth: size * 0.4,
|
|
33
|
+
borderLeftWidth: size * 0.55,
|
|
34
|
+
borderTopColor: 'transparent',
|
|
35
|
+
borderBottomColor: 'transparent',
|
|
36
|
+
borderLeftColor: color,
|
|
37
|
+
marginLeft: size * 0.2
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const SlideToConfirm = /*#__PURE__*/forwardRef((props, ref) => {
|
|
41
|
+
const {
|
|
42
|
+
onConfirm,
|
|
43
|
+
label = 'Slide to confirm',
|
|
44
|
+
confirmedLabel = 'Confirmed',
|
|
45
|
+
tone = 'primary',
|
|
46
|
+
size = 'md',
|
|
47
|
+
disabled = false,
|
|
48
|
+
threshold = 0.9,
|
|
49
|
+
resetAfter = false,
|
|
50
|
+
haptic,
|
|
51
|
+
icon,
|
|
52
|
+
style,
|
|
53
|
+
trackStyle,
|
|
54
|
+
handleStyle,
|
|
55
|
+
labelStyle,
|
|
56
|
+
testID
|
|
57
|
+
} = props;
|
|
58
|
+
const theme = useTheme();
|
|
59
|
+
const sizeCfg = SIZE_MAP[size];
|
|
60
|
+
const handleSize = sizeCfg.height - sizeCfg.pad * 2;
|
|
61
|
+
const styles = useMemo(() => buildStyles(theme, sizeCfg), [theme, sizeCfg]);
|
|
62
|
+
const toneColor = theme.colors[tone];
|
|
63
|
+
const [confirmed, setConfirmed] = useState(false);
|
|
64
|
+
const x = useSharedValue(0);
|
|
65
|
+
const maxX = useSharedValue(0);
|
|
66
|
+
const dragStart = useSharedValue(0);
|
|
67
|
+
const resetTimer = useRef(null);
|
|
68
|
+
const fireHaptic = useCallback(() => {
|
|
69
|
+
const h = resolveHaptic(haptic, 'notificationSuccess');
|
|
70
|
+
if (h) triggerHaptic(h);
|
|
71
|
+
}, [haptic]);
|
|
72
|
+
const reset = useCallback(() => {
|
|
73
|
+
setConfirmed(false);
|
|
74
|
+
x.value = withSpring(0, {
|
|
75
|
+
damping: 18,
|
|
76
|
+
stiffness: 160,
|
|
77
|
+
mass: 1
|
|
78
|
+
});
|
|
79
|
+
}, [x]);
|
|
80
|
+
const handleConfirm = useCallback(() => {
|
|
81
|
+
setConfirmed(true);
|
|
82
|
+
fireHaptic();
|
|
83
|
+
onConfirm();
|
|
84
|
+
if (resetAfter !== false) {
|
|
85
|
+
if (resetTimer.current) clearTimeout(resetTimer.current);
|
|
86
|
+
resetTimer.current = setTimeout(reset, resetAfter);
|
|
87
|
+
}
|
|
88
|
+
}, [fireHaptic, onConfirm, resetAfter, reset]);
|
|
89
|
+
React.useEffect(() => () => {
|
|
90
|
+
cancelAnimation(x);
|
|
91
|
+
if (resetTimer.current) clearTimeout(resetTimer.current);
|
|
92
|
+
}, [x]);
|
|
93
|
+
const onLayout = useCallback(e => {
|
|
94
|
+
maxX.value = Math.max(0, e.nativeEvent.layout.width - handleSize - sizeCfg.pad * 2);
|
|
95
|
+
}, [maxX, handleSize, sizeCfg.pad]);
|
|
96
|
+
const pan = useMemo(() => {
|
|
97
|
+
const thresholdFrac = threshold;
|
|
98
|
+
const springCfg = {
|
|
99
|
+
damping: 18,
|
|
100
|
+
stiffness: 160,
|
|
101
|
+
mass: 1
|
|
102
|
+
};
|
|
103
|
+
const timingCfg = {
|
|
104
|
+
duration: theme.motion.duration.fast,
|
|
105
|
+
easing: Easing.out(Easing.cubic)
|
|
106
|
+
};
|
|
107
|
+
return Gesture.Pan().enabled(!disabled && !confirmed).minDistance(0).onStart(() => {
|
|
108
|
+
'worklet';
|
|
109
|
+
|
|
110
|
+
dragStart.value = x.value;
|
|
111
|
+
}).onUpdate(event => {
|
|
112
|
+
'worklet';
|
|
113
|
+
|
|
114
|
+
x.value = Math.min(Math.max(dragStart.value + event.translationX, 0), maxX.value);
|
|
115
|
+
}).onEnd(() => {
|
|
116
|
+
'worklet';
|
|
117
|
+
|
|
118
|
+
if (maxX.value > 0 && x.value >= maxX.value * thresholdFrac) {
|
|
119
|
+
x.value = withTiming(maxX.value, timingCfg);
|
|
120
|
+
runOnJS(handleConfirm)();
|
|
121
|
+
} else {
|
|
122
|
+
x.value = withSpring(0, springCfg);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}, [disabled, confirmed, threshold, x, maxX, dragStart, handleConfirm, theme.motion.duration.fast]);
|
|
126
|
+
const handleAnim = useAnimatedStyle(() => ({
|
|
127
|
+
transform: [{
|
|
128
|
+
translateX: x.value
|
|
129
|
+
}]
|
|
130
|
+
}));
|
|
131
|
+
const fillAnim = useAnimatedStyle(() => ({
|
|
132
|
+
width: x.value + handleSize + sizeCfg.pad
|
|
133
|
+
}));
|
|
134
|
+
const labelAnim = useAnimatedStyle(() => {
|
|
135
|
+
const max = maxX.value > 0 ? maxX.value : 1;
|
|
136
|
+
return {
|
|
137
|
+
opacity: Math.max(0, 1 - x.value / (max * 0.6))
|
|
138
|
+
};
|
|
139
|
+
});
|
|
140
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
141
|
+
ref: ref,
|
|
142
|
+
style: [styles.track, {
|
|
143
|
+
backgroundColor: theme.colors.background.secondary
|
|
144
|
+
}, trackStyle, style],
|
|
145
|
+
onLayout: onLayout,
|
|
146
|
+
testID: testID,
|
|
147
|
+
accessibilityRole: "adjustable",
|
|
148
|
+
accessibilityLabel: confirmed ? confirmedLabel : label,
|
|
149
|
+
accessibilityState: {
|
|
150
|
+
disabled
|
|
151
|
+
},
|
|
152
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
153
|
+
style: [styles.fill, {
|
|
154
|
+
backgroundColor: toneColor,
|
|
155
|
+
opacity: disabled ? 0.5 : 1
|
|
156
|
+
}, fillAnim],
|
|
157
|
+
pointerEvents: "none"
|
|
158
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
159
|
+
style: [styles.labelWrap, labelAnim],
|
|
160
|
+
pointerEvents: "none",
|
|
161
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
162
|
+
style: [styles.label, {
|
|
163
|
+
color: theme.colors.text.secondary,
|
|
164
|
+
fontSize: theme.typography.fontSize.base
|
|
165
|
+
}, labelStyle],
|
|
166
|
+
numberOfLines: 1,
|
|
167
|
+
children: confirmed ? confirmedLabel : label
|
|
168
|
+
})
|
|
169
|
+
}), /*#__PURE__*/_jsx(GestureDetector, {
|
|
170
|
+
gesture: pan,
|
|
171
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
172
|
+
style: [styles.handle, {
|
|
173
|
+
width: handleSize,
|
|
174
|
+
height: handleSize,
|
|
175
|
+
borderRadius: handleSize / 2,
|
|
176
|
+
backgroundColor: theme.colors.background.elevated,
|
|
177
|
+
opacity: disabled ? 0.5 : 1,
|
|
178
|
+
...theme.shadows.sm
|
|
179
|
+
}, handleStyle, handleAnim],
|
|
180
|
+
children: icon ?? /*#__PURE__*/_jsx(Chevron, {
|
|
181
|
+
color: toneColor,
|
|
182
|
+
size: handleSize * 0.5
|
|
183
|
+
})
|
|
184
|
+
})
|
|
185
|
+
})]
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
SlideToConfirm.displayName = 'SlideToConfirm';
|
|
189
|
+
const buildStyles = (theme, sizeCfg) => StyleSheet.create({
|
|
190
|
+
track: {
|
|
191
|
+
height: sizeCfg.height,
|
|
192
|
+
borderRadius: sizeCfg.height / 2,
|
|
193
|
+
justifyContent: 'center',
|
|
194
|
+
overflow: 'hidden',
|
|
195
|
+
padding: sizeCfg.pad
|
|
196
|
+
},
|
|
197
|
+
fill: {
|
|
198
|
+
position: 'absolute',
|
|
199
|
+
left: 0,
|
|
200
|
+
top: 0,
|
|
201
|
+
bottom: 0,
|
|
202
|
+
borderRadius: sizeCfg.height / 2
|
|
203
|
+
},
|
|
204
|
+
labelWrap: {
|
|
205
|
+
position: 'absolute',
|
|
206
|
+
left: sizeCfg.height,
|
|
207
|
+
right: sizeCfg.height
|
|
208
|
+
},
|
|
209
|
+
label: {
|
|
210
|
+
textAlign: 'center',
|
|
211
|
+
includeFontPadding: false
|
|
212
|
+
},
|
|
213
|
+
handle: {
|
|
214
|
+
alignItems: 'center',
|
|
215
|
+
justifyContent: 'center'
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
export { SlideToConfirm };
|
|
219
|
+
export default SlideToConfirm;
|
|
220
|
+
//# sourceMappingURL=SlideToConfirm.js.map
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
export { Accordion, AccordionGroup } from "./Accordion/index.js";
|
|
4
4
|
export { AnimatePresence } from "./AnimatePresence/index.js";
|
|
5
|
+
export { Autocomplete } from "./Autocomplete/index.js";
|
|
5
6
|
export { Avatar, AvatarGroup } from "./Avatar/index.js";
|
|
6
7
|
export { Badge } from "./Badge/index.js";
|
|
7
8
|
export { Banner } from "./Banner/index.js";
|
|
8
9
|
export { BottomNavigation } from "./BottomNavigation/index.js";
|
|
9
10
|
export { BottomSheet, useBottomSheet } from "./BottomSheet/index.js";
|
|
10
11
|
export { Button } from "./Button/index.js";
|
|
12
|
+
export { IconButton } from "./IconButton/index.js";
|
|
11
13
|
export { Box, Stack, Row, Spacer } from "./Box/index.js";
|
|
12
14
|
export { Text } from "./Text/index.js";
|
|
13
15
|
export { KeyboardAwareScrollView } from "./KeyboardAwareScrollView/index.js";
|
|
@@ -16,6 +18,7 @@ export { Card } from "./Card/index.js";
|
|
|
16
18
|
export { Carousel } from "./Carousel/index.js";
|
|
17
19
|
export { Checkbox } from "./Checkbox/index.js";
|
|
18
20
|
export { Chip } from "./Chip/index.js";
|
|
21
|
+
export { Confetti } from "./Confetti/index.js";
|
|
19
22
|
export { DatePicker } from "./DatePicker/index.js";
|
|
20
23
|
export { DateRangePicker } from "./DateRangePicker/index.js";
|
|
21
24
|
export { Dialog } from "./Dialog/index.js";
|
|
@@ -42,6 +45,7 @@ export { SegmentedControl } from "./SegmentedControl/index.js";
|
|
|
42
45
|
export { Select } from "./Select/index.js";
|
|
43
46
|
export { Stepper } from "./Stepper/index.js";
|
|
44
47
|
export { Skeleton, SkeletonCircle, SkeletonClockProvider, SkeletonContent, SkeletonList, SkeletonProvider, SkeletonSkip, SkeletonText, useReduceMotion, useSkeletonClock, useSkeletonDefaults } from "./Skeleton/index.js";
|
|
48
|
+
export { SlideToConfirm } from "./SlideToConfirm/index.js";
|
|
45
49
|
export { Slider } from "./Slider/index.js";
|
|
46
50
|
export { Swipeable } from "./Swipeable/index.js";
|
|
47
51
|
export { Switch } from "./Switch/index.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils';
|
|
4
|
+
import type { InputSize, InputVariant } from '../Input';
|
|
5
|
+
export interface AutocompleteProps<T = string> {
|
|
6
|
+
/** Candidate options to filter. */
|
|
7
|
+
options: ReadonlyArray<T>;
|
|
8
|
+
/** Controlled input text. */
|
|
9
|
+
value?: string;
|
|
10
|
+
/** Uncontrolled initial text. */
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChangeText?: (text: string) => void;
|
|
13
|
+
/** Fired when a suggestion is chosen. */
|
|
14
|
+
onSelect: (option: T) => void;
|
|
15
|
+
/** Read a display label from an option. Defaults to the option itself for strings. */
|
|
16
|
+
getOptionLabel?: (option: T) => string;
|
|
17
|
+
/** Stable React key per option. Defaults to label + index. */
|
|
18
|
+
getOptionKey?: (option: T) => string;
|
|
19
|
+
/** Custom match predicate. Defaults to a case-insensitive substring match on the label. */
|
|
20
|
+
filter?: (option: T, query: string) => boolean;
|
|
21
|
+
/** Minimum characters before suggestions appear. Default 1. */
|
|
22
|
+
minChars?: number;
|
|
23
|
+
/** Cap the number of suggestions shown. Default 8. */
|
|
24
|
+
maxResults?: number;
|
|
25
|
+
/** Text shown when nothing matches. Default "No matches". */
|
|
26
|
+
emptyText?: string;
|
|
27
|
+
/** Show a loading spinner in the dropdown — e.g. while fetching remote results. */
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
/** `'client'` filters `options` locally; `'none'` shows them as-is (for server-side search). Default `'client'`. */
|
|
30
|
+
filterMode?: 'client' | 'none';
|
|
31
|
+
/** Text beside the loading spinner. Default "Searching…". */
|
|
32
|
+
loadingText?: string;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
label?: string;
|
|
35
|
+
error?: string;
|
|
36
|
+
helperText?: string;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
size?: InputSize;
|
|
39
|
+
variant?: InputVariant;
|
|
40
|
+
/** Haptic on select. Default `'selection'`. */
|
|
41
|
+
haptic?: HapticType | false;
|
|
42
|
+
style?: StyleProp<ViewStyle>;
|
|
43
|
+
listStyle?: StyleProp<ViewStyle>;
|
|
44
|
+
optionTextStyle?: StyleProp<TextStyle>;
|
|
45
|
+
testID?: string;
|
|
46
|
+
}
|
|
47
|
+
declare function Autocomplete<T = string>(props: AutocompleteProps<T>): React.JSX.Element;
|
|
48
|
+
declare namespace Autocomplete {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
export { Autocomplete };
|
|
52
|
+
export default Autocomplete;
|
|
53
|
+
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export type ConfettiMode = 'rain' | 'cannon';
|
|
4
|
+
export interface ConfettiOrigin {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ConfettiHandle {
|
|
9
|
+
/** Fire a burst. Re-seeds the pieces so each call looks different. */
|
|
10
|
+
start: () => void;
|
|
11
|
+
/** Stop and clear immediately. */
|
|
12
|
+
stop: () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface ConfettiProps {
|
|
15
|
+
/** Number of pieces. Default 80. */
|
|
16
|
+
count?: number;
|
|
17
|
+
/** Piece colours. Defaults to a vibrant set drawn from the theme palette. */
|
|
18
|
+
colors?: string[];
|
|
19
|
+
/** `'rain'` falls from the top edge; `'cannon'` bursts up/out from `origin`. Default `'rain'`. */
|
|
20
|
+
mode?: ConfettiMode;
|
|
21
|
+
/** Burst origin for `'cannon'` (defaults to the bottom-centre of the container). */
|
|
22
|
+
origin?: ConfettiOrigin;
|
|
23
|
+
/** Full animation duration in ms. Default 2800. */
|
|
24
|
+
duration?: number;
|
|
25
|
+
/** Fade pieces out near the end. Default true. */
|
|
26
|
+
fadeOut?: boolean;
|
|
27
|
+
/** Fire automatically on mount. Default false. */
|
|
28
|
+
autoStart?: boolean;
|
|
29
|
+
/** Loop continuously (ongoing celebration). Default false. */
|
|
30
|
+
recycle?: boolean;
|
|
31
|
+
/** Base piece size in px (varied ±40% per piece). Default 10. */
|
|
32
|
+
size?: number;
|
|
33
|
+
/** Called once when a non-recycling burst finishes (or immediately if reduce-motion is on). */
|
|
34
|
+
onComplete?: () => void;
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
testID?: string;
|
|
37
|
+
}
|
|
38
|
+
declare const Confetti: React.ForwardRefExoticComponent<ConfettiProps & React.RefAttributes<ConfettiHandle>>;
|
|
39
|
+
export { Confetti };
|
|
40
|
+
export default Confetti;
|
|
41
|
+
//# sourceMappingURL=Confetti.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { GestureResponderEvent, StyleProp, View as RNView, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils';
|
|
4
|
+
export type IconButtonTone = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'neutral';
|
|
5
|
+
export type IconButtonVariant = 'solid' | 'soft' | 'outline' | 'ghost';
|
|
6
|
+
export type IconButtonSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
export type IconButtonShape = 'circle' | 'rounded';
|
|
8
|
+
interface IconRenderProps {
|
|
9
|
+
color: string;
|
|
10
|
+
size: number;
|
|
11
|
+
}
|
|
12
|
+
export interface IconButtonProps {
|
|
13
|
+
/** Icon node, or a render fn `({ color, size }) => node` so IconButton can theme + size it. */
|
|
14
|
+
icon: React.ReactNode | ((props: IconRenderProps) => React.ReactNode);
|
|
15
|
+
onPress?: (e: GestureResponderEvent) => void;
|
|
16
|
+
/** Required — icon-only controls need an accessible name. */
|
|
17
|
+
accessibilityLabel: string;
|
|
18
|
+
tone?: IconButtonTone;
|
|
19
|
+
variant?: IconButtonVariant;
|
|
20
|
+
size?: IconButtonSize;
|
|
21
|
+
shape?: IconButtonShape;
|
|
22
|
+
/** Selected/active — renders filled (solid) regardless of `variant` (e.g. an active nav tile). */
|
|
23
|
+
active?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
/** Press haptic. Default `'selection'`. */
|
|
27
|
+
haptic?: HapticType | false;
|
|
28
|
+
style?: StyleProp<ViewStyle>;
|
|
29
|
+
testID?: string;
|
|
30
|
+
}
|
|
31
|
+
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<RNView>>;
|
|
32
|
+
export { IconButton };
|
|
33
|
+
export default IconButton;
|
|
34
|
+
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
import type { GradientDefinition } from '../../theme/types';
|
|
4
5
|
export type ProgressBarTone = 'primary' | 'success' | 'warning' | 'error';
|
|
6
|
+
export interface ProgressBarSegment {
|
|
7
|
+
/** Fraction of the full track (0–1). */
|
|
8
|
+
value: number;
|
|
9
|
+
/** Explicit colour; falls back to `tone`. */
|
|
10
|
+
color?: string;
|
|
11
|
+
tone?: ProgressBarTone;
|
|
12
|
+
}
|
|
5
13
|
export interface ProgressBarProps {
|
|
6
14
|
progress?: number;
|
|
7
15
|
indeterminate?: boolean;
|
|
@@ -10,6 +18,10 @@ export interface ProgressBarProps {
|
|
|
10
18
|
tone?: ProgressBarTone;
|
|
11
19
|
trackColor?: string;
|
|
12
20
|
barColor?: string;
|
|
21
|
+
/** Gradient fill for the determinate bar — a `GradientDefinition` or a theme gradient token name. */
|
|
22
|
+
gradient?: GradientDefinition | string;
|
|
23
|
+
/** Render a multi-colour breakdown bar (usage split) instead of a single progress fill. */
|
|
24
|
+
segments?: ProgressBarSegment[];
|
|
13
25
|
animated?: boolean;
|
|
14
26
|
style?: StyleProp<ViewStyle>;
|
|
15
27
|
containerStyle?: StyleProp<ViewStyle>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
4
|
+
import type { HapticType } from '../../utils';
|
|
5
|
+
export type SlideToConfirmTone = 'primary' | 'success' | 'warning' | 'error';
|
|
6
|
+
export type SlideToConfirmSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
export interface SlideToConfirmProps {
|
|
8
|
+
/** Fired once the handle is dragged past the threshold. */
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
/** Resting label (centred). Default "Slide to confirm". */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Label shown after confirming. Default "Confirmed". */
|
|
13
|
+
confirmedLabel?: string;
|
|
14
|
+
tone?: SlideToConfirmTone;
|
|
15
|
+
size?: SlideToConfirmSize;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Fraction of the track (0–1) the handle must cross to confirm. Default 0.9. */
|
|
18
|
+
threshold?: number;
|
|
19
|
+
/** Auto-reset this many ms after confirm, or `false` to stay confirmed. Default `false`. */
|
|
20
|
+
resetAfter?: number | false;
|
|
21
|
+
/** Haptic on confirm. Pass `false` to disable or a `HapticType` to override. Default `'notificationSuccess'`. */
|
|
22
|
+
haptic?: HapticType | false;
|
|
23
|
+
/** Handle glyph. Defaults to a right-chevron. */
|
|
24
|
+
icon?: React.ReactNode;
|
|
25
|
+
style?: StyleProp<ViewStyle>;
|
|
26
|
+
trackStyle?: StyleProp<ViewStyle>;
|
|
27
|
+
handleStyle?: StyleProp<ViewStyle>;
|
|
28
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
29
|
+
testID?: string;
|
|
30
|
+
}
|
|
31
|
+
declare const SlideToConfirm: React.ForwardRefExoticComponent<SlideToConfirmProps & React.RefAttributes<View>>;
|
|
32
|
+
export { SlideToConfirm };
|
|
33
|
+
export default SlideToConfirm;
|
|
34
|
+
//# sourceMappingURL=SlideToConfirm.d.ts.map
|
|
@@ -2,6 +2,8 @@ export { Accordion, AccordionGroup } from './Accordion';
|
|
|
2
2
|
export type { AccordionProps, AccordionGroupProps, AccordionVariant } from './Accordion';
|
|
3
3
|
export { AnimatePresence } from './AnimatePresence';
|
|
4
4
|
export type { AnimatePresenceProps, PresencePreset } from './AnimatePresence';
|
|
5
|
+
export { Autocomplete } from './Autocomplete';
|
|
6
|
+
export type { AutocompleteProps } from './Autocomplete';
|
|
5
7
|
export { Avatar, AvatarGroup } from './Avatar';
|
|
6
8
|
export type { AvatarProps, AvatarShape, AvatarSize, AvatarStatus, AvatarGroupProps, AvatarGroupSpacing, AvatarGroupOverflowVariant } from './Avatar';
|
|
7
9
|
export { Badge } from './Badge';
|
|
@@ -14,6 +16,8 @@ export { BottomSheet, useBottomSheet } from './BottomSheet';
|
|
|
14
16
|
export type { BottomSheetContextValue, BottomSheetProps, BottomSheetRef } from './BottomSheet';
|
|
15
17
|
export { Button } from './Button';
|
|
16
18
|
export type { ButtonProps, ButtonVariant, ButtonTone, ButtonSize } from './Button';
|
|
19
|
+
export { IconButton } from './IconButton';
|
|
20
|
+
export type { IconButtonProps, IconButtonTone, IconButtonVariant, IconButtonSize, IconButtonShape } from './IconButton';
|
|
17
21
|
export { Box, Stack, Row, Spacer } from './Box';
|
|
18
22
|
export type { BoxProps, StackProps, RowProps, SpacerProps } from './Box';
|
|
19
23
|
export { Text } from './Text';
|
|
@@ -30,6 +34,8 @@ export { Checkbox } from './Checkbox';
|
|
|
30
34
|
export type { CheckboxProps, CheckboxSize, CheckboxTone } from './Checkbox';
|
|
31
35
|
export { Chip } from './Chip';
|
|
32
36
|
export type { ChipProps, ChipSize, ChipTone, ChipVariant } from './Chip';
|
|
37
|
+
export { Confetti } from './Confetti';
|
|
38
|
+
export type { ConfettiProps, ConfettiHandle, ConfettiMode, ConfettiOrigin } from './Confetti';
|
|
33
39
|
export { DatePicker } from './DatePicker';
|
|
34
40
|
export type { DatePickerProps, DatePickerMode } from './DatePicker';
|
|
35
41
|
export { DateRangePicker } from './DateRangePicker';
|
|
@@ -67,7 +73,7 @@ export type { OTPInputProps, OTPInputRef, OTPInputSize } from './OTPInput';
|
|
|
67
73
|
export { PickerTrigger } from './PickerTrigger';
|
|
68
74
|
export type { PickerTriggerProps, PickerTriggerSize, PickerTriggerVariant } from './PickerTrigger';
|
|
69
75
|
export { ProgressBar } from './ProgressBar';
|
|
70
|
-
export type { ProgressBarProps, ProgressBarTone } from './ProgressBar';
|
|
76
|
+
export type { ProgressBarProps, ProgressBarTone, ProgressBarSegment } from './ProgressBar';
|
|
71
77
|
export { Radio, RadioGroup } from './Radio';
|
|
72
78
|
export type { RadioProps, RadioGroupProps, RadioSize, RadioTone } from './Radio';
|
|
73
79
|
export { Rating } from './Rating';
|
|
@@ -82,6 +88,8 @@ export { Stepper } from './Stepper';
|
|
|
82
88
|
export type { StepperProps, StepperVariant, StepperStep, StepperTone } from './Stepper';
|
|
83
89
|
export { Skeleton, SkeletonCircle, SkeletonClockProvider, SkeletonContent, SkeletonList, SkeletonProvider, SkeletonSkip, SkeletonText, useReduceMotion, useSkeletonClock, useSkeletonDefaults } from './Skeleton';
|
|
84
90
|
export type { SkeletonCircleProps, SkeletonClockProviderProps, SkeletonClockValue, SkeletonColors, SkeletonContentProps, SkeletonListProps, SkeletonProps, SkeletonProviderDefaults, SkeletonProviderProps, SkeletonRadius, SkeletonShape, SkeletonSkipProps, SkeletonSpeed, SkeletonStaticOf, SkeletonTextProps, SkeletonVariant, SkeletonWidth } from './Skeleton';
|
|
91
|
+
export { SlideToConfirm } from './SlideToConfirm';
|
|
92
|
+
export type { SlideToConfirmProps, SlideToConfirmTone, SlideToConfirmSize } from './SlideToConfirm';
|
|
85
93
|
export { Slider } from './Slider';
|
|
86
94
|
export type { SliderProps, SliderTone, SliderSize } from './Slider';
|
|
87
95
|
export { Swipeable } from './Swipeable';
|
|
@@ -2,7 +2,6 @@ import { Animated } from 'react-native';
|
|
|
2
2
|
export interface UsePressAnimationOptions {
|
|
3
3
|
scaleTo?: number;
|
|
4
4
|
pressDuration?: number;
|
|
5
|
-
releaseDuration?: number;
|
|
6
5
|
enabled?: boolean;
|
|
7
6
|
}
|
|
8
7
|
export interface UsePressAnimationResult {
|
|
@@ -10,5 +9,5 @@ export interface UsePressAnimationResult {
|
|
|
10
9
|
pressIn: () => void;
|
|
11
10
|
pressOut: () => void;
|
|
12
11
|
}
|
|
13
|
-
export declare const usePressAnimation: ({ scaleTo, pressDuration,
|
|
12
|
+
export declare const usePressAnimation: ({ scaleTo, pressDuration, enabled }?: UsePressAnimationOptions) => UsePressAnimationResult;
|
|
14
13
|
//# sourceMappingURL=usePressAnimation.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils';
|
|
4
|
+
import type { InputSize, InputVariant } from '../Input';
|
|
5
|
+
export interface AutocompleteProps<T = string> {
|
|
6
|
+
/** Candidate options to filter. */
|
|
7
|
+
options: ReadonlyArray<T>;
|
|
8
|
+
/** Controlled input text. */
|
|
9
|
+
value?: string;
|
|
10
|
+
/** Uncontrolled initial text. */
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChangeText?: (text: string) => void;
|
|
13
|
+
/** Fired when a suggestion is chosen. */
|
|
14
|
+
onSelect: (option: T) => void;
|
|
15
|
+
/** Read a display label from an option. Defaults to the option itself for strings. */
|
|
16
|
+
getOptionLabel?: (option: T) => string;
|
|
17
|
+
/** Stable React key per option. Defaults to label + index. */
|
|
18
|
+
getOptionKey?: (option: T) => string;
|
|
19
|
+
/** Custom match predicate. Defaults to a case-insensitive substring match on the label. */
|
|
20
|
+
filter?: (option: T, query: string) => boolean;
|
|
21
|
+
/** Minimum characters before suggestions appear. Default 1. */
|
|
22
|
+
minChars?: number;
|
|
23
|
+
/** Cap the number of suggestions shown. Default 8. */
|
|
24
|
+
maxResults?: number;
|
|
25
|
+
/** Text shown when nothing matches. Default "No matches". */
|
|
26
|
+
emptyText?: string;
|
|
27
|
+
/** Show a loading spinner in the dropdown — e.g. while fetching remote results. */
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
/** `'client'` filters `options` locally; `'none'` shows them as-is (for server-side search). Default `'client'`. */
|
|
30
|
+
filterMode?: 'client' | 'none';
|
|
31
|
+
/** Text beside the loading spinner. Default "Searching…". */
|
|
32
|
+
loadingText?: string;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
label?: string;
|
|
35
|
+
error?: string;
|
|
36
|
+
helperText?: string;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
size?: InputSize;
|
|
39
|
+
variant?: InputVariant;
|
|
40
|
+
/** Haptic on select. Default `'selection'`. */
|
|
41
|
+
haptic?: HapticType | false;
|
|
42
|
+
style?: StyleProp<ViewStyle>;
|
|
43
|
+
listStyle?: StyleProp<ViewStyle>;
|
|
44
|
+
optionTextStyle?: StyleProp<TextStyle>;
|
|
45
|
+
testID?: string;
|
|
46
|
+
}
|
|
47
|
+
declare function Autocomplete<T = string>(props: AutocompleteProps<T>): React.JSX.Element;
|
|
48
|
+
declare namespace Autocomplete {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
export { Autocomplete };
|
|
52
|
+
export default Autocomplete;
|
|
53
|
+
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export type ConfettiMode = 'rain' | 'cannon';
|
|
4
|
+
export interface ConfettiOrigin {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ConfettiHandle {
|
|
9
|
+
/** Fire a burst. Re-seeds the pieces so each call looks different. */
|
|
10
|
+
start: () => void;
|
|
11
|
+
/** Stop and clear immediately. */
|
|
12
|
+
stop: () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface ConfettiProps {
|
|
15
|
+
/** Number of pieces. Default 80. */
|
|
16
|
+
count?: number;
|
|
17
|
+
/** Piece colours. Defaults to a vibrant set drawn from the theme palette. */
|
|
18
|
+
colors?: string[];
|
|
19
|
+
/** `'rain'` falls from the top edge; `'cannon'` bursts up/out from `origin`. Default `'rain'`. */
|
|
20
|
+
mode?: ConfettiMode;
|
|
21
|
+
/** Burst origin for `'cannon'` (defaults to the bottom-centre of the container). */
|
|
22
|
+
origin?: ConfettiOrigin;
|
|
23
|
+
/** Full animation duration in ms. Default 2800. */
|
|
24
|
+
duration?: number;
|
|
25
|
+
/** Fade pieces out near the end. Default true. */
|
|
26
|
+
fadeOut?: boolean;
|
|
27
|
+
/** Fire automatically on mount. Default false. */
|
|
28
|
+
autoStart?: boolean;
|
|
29
|
+
/** Loop continuously (ongoing celebration). Default false. */
|
|
30
|
+
recycle?: boolean;
|
|
31
|
+
/** Base piece size in px (varied ±40% per piece). Default 10. */
|
|
32
|
+
size?: number;
|
|
33
|
+
/** Called once when a non-recycling burst finishes (or immediately if reduce-motion is on). */
|
|
34
|
+
onComplete?: () => void;
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
testID?: string;
|
|
37
|
+
}
|
|
38
|
+
declare const Confetti: React.ForwardRefExoticComponent<ConfettiProps & React.RefAttributes<ConfettiHandle>>;
|
|
39
|
+
export { Confetti };
|
|
40
|
+
export default Confetti;
|
|
41
|
+
//# sourceMappingURL=Confetti.d.ts.map
|