@webority-technologies/mobile 0.0.23 → 0.0.24
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/Accordion/Accordion.js +5 -5
- package/lib/commonjs/components/AnimatePresence/AnimatePresence.js +69 -0
- package/lib/commonjs/components/AnimatePresence/index.js +13 -0
- package/lib/commonjs/components/AppBar/AppBar.js +9 -6
- package/lib/commonjs/components/Banner/Banner.js +12 -2
- package/lib/commonjs/components/Card/Card.js +3 -3
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -2
- package/lib/commonjs/components/Chip/Chip.js +4 -2
- package/lib/commonjs/components/DatePicker/DatePicker.js +23 -18
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +11 -9
- package/lib/commonjs/components/Dialog/Dialog.js +4 -2
- package/lib/commonjs/components/Drawer/Drawer.js +4 -2
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +10 -8
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +17 -15
- package/lib/commonjs/components/ListItem/ListItem.js +4 -3
- package/lib/commonjs/components/Modal/Modal.js +4 -3
- package/lib/commonjs/components/NumberInput/NumberInput.js +7 -5
- package/lib/commonjs/components/OTPInput/OTPInput.js +7 -7
- package/lib/commonjs/components/Radio/Radio.js +2 -3
- package/lib/commonjs/components/Rating/Rating.js +4 -3
- package/lib/commonjs/components/SearchBar/SearchBar.js +7 -4
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +4 -3
- package/lib/commonjs/components/Select/Select.js +7 -4
- package/lib/commonjs/components/Slider/Slider.js +228 -228
- package/lib/commonjs/components/Stepper/Stepper.js +6 -5
- package/lib/commonjs/components/Swipeable/Swipeable.js +8 -9
- package/lib/commonjs/components/Tabs/Tabs.js +4 -3
- package/lib/commonjs/components/TimePicker/TimePicker.js +14 -9
- package/lib/commonjs/components/index.js +121 -114
- package/lib/commonjs/utils/hapticUtils.js +11 -1
- package/lib/commonjs/utils/index.js +6 -0
- package/lib/module/components/Accordion/Accordion.js +6 -6
- package/lib/module/components/AnimatePresence/AnimatePresence.js +63 -0
- package/lib/module/components/AnimatePresence/index.js +4 -0
- package/lib/module/components/AppBar/AppBar.js +10 -7
- package/lib/module/components/Banner/Banner.js +12 -2
- package/lib/module/components/Card/Card.js +4 -4
- package/lib/module/components/Checkbox/Checkbox.js +4 -3
- package/lib/module/components/Chip/Chip.js +5 -3
- package/lib/module/components/DatePicker/DatePicker.js +24 -19
- package/lib/module/components/DateRangePicker/DateRangePicker.js +12 -10
- package/lib/module/components/Dialog/Dialog.js +5 -3
- package/lib/module/components/Drawer/Drawer.js +5 -3
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +11 -9
- package/lib/module/components/ImageGallery/ImageGallery.js +18 -16
- package/lib/module/components/ListItem/ListItem.js +5 -4
- package/lib/module/components/Modal/Modal.js +5 -4
- package/lib/module/components/NumberInput/NumberInput.js +8 -6
- package/lib/module/components/OTPInput/OTPInput.js +8 -8
- package/lib/module/components/Radio/Radio.js +3 -4
- package/lib/module/components/Rating/Rating.js +5 -4
- package/lib/module/components/SearchBar/SearchBar.js +8 -5
- package/lib/module/components/SegmentedControl/SegmentedControl.js +5 -4
- package/lib/module/components/Select/Select.js +8 -5
- package/lib/module/components/Slider/Slider.js +231 -231
- package/lib/module/components/Stepper/Stepper.js +7 -6
- package/lib/module/components/Swipeable/Swipeable.js +9 -10
- package/lib/module/components/Tabs/Tabs.js +5 -4
- package/lib/module/components/TimePicker/TimePicker.js +15 -10
- package/lib/module/components/index.js +1 -0
- package/lib/module/utils/hapticUtils.js +9 -0
- package/lib/module/utils/index.js +1 -1
- package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +3 -0
- package/lib/typescript/commonjs/components/AnimatePresence/AnimatePresence.d.ts +30 -0
- package/lib/typescript/commonjs/components/AnimatePresence/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +6 -0
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +3 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +3 -0
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +1 -0
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +3 -0
- package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +3 -0
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +6 -0
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +3 -0
- package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +3 -0
- package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +5 -0
- package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +6 -0
- package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +3 -0
- package/lib/typescript/commonjs/components/Modal/Modal.d.ts +6 -0
- package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +3 -0
- package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +6 -0
- package/lib/typescript/commonjs/components/Rating/Rating.d.ts +6 -0
- package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +3 -0
- package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/lib/typescript/commonjs/components/Select/Select.d.ts +6 -0
- package/lib/typescript/commonjs/components/Slider/Slider.d.ts +3 -0
- package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +6 -0
- package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +3 -0
- package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +3 -0
- package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts +2 -0
- package/lib/typescript/commonjs/theme/types.d.ts +2 -67
- package/lib/typescript/commonjs/utils/hapticUtils.d.ts +8 -0
- package/lib/typescript/commonjs/utils/index.d.ts +1 -1
- package/lib/typescript/module/components/Accordion/Accordion.d.ts +3 -0
- package/lib/typescript/module/components/AnimatePresence/AnimatePresence.d.ts +30 -0
- package/lib/typescript/module/components/AnimatePresence/index.d.ts +3 -0
- package/lib/typescript/module/components/AppBar/AppBar.d.ts +6 -0
- package/lib/typescript/module/components/Banner/Banner.d.ts +3 -0
- package/lib/typescript/module/components/Card/Card.d.ts +3 -0
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +1 -0
- package/lib/typescript/module/components/Chip/Chip.d.ts +3 -0
- package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +3 -0
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +6 -0
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +3 -0
- package/lib/typescript/module/components/Drawer/Drawer.d.ts +3 -0
- package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +5 -0
- package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +6 -0
- package/lib/typescript/module/components/ListItem/ListItem.d.ts +3 -0
- package/lib/typescript/module/components/Modal/Modal.d.ts +6 -0
- package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +3 -0
- package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +6 -0
- package/lib/typescript/module/components/Rating/Rating.d.ts +6 -0
- package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +3 -0
- package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/lib/typescript/module/components/Select/Select.d.ts +6 -0
- package/lib/typescript/module/components/Slider/Slider.d.ts +3 -0
- package/lib/typescript/module/components/Stepper/Stepper.d.ts +6 -0
- package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +3 -0
- package/lib/typescript/module/components/Tabs/Tabs.d.ts +3 -0
- package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts +2 -0
- package/lib/typescript/module/theme/types.d.ts +2 -67
- package/lib/typescript/module/utils/hapticUtils.d.ts +8 -0
- package/lib/typescript/module/utils/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ import { Dimensions, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
|
22
22
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
23
23
|
import Animated, { cancelAnimation, runOnJS, useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
|
|
24
24
|
import { useTheme } from "../../theme/index.js";
|
|
25
|
-
import { triggerHaptic } from "../../utils/index.js";
|
|
25
|
+
import { resolveHaptic, triggerHaptic } from "../../utils/index.js";
|
|
26
26
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
27
|
const SPRING_CONFIG = {
|
|
28
28
|
damping: 22,
|
|
@@ -57,6 +57,7 @@ const Swipeable = props => {
|
|
|
57
57
|
onSwipeOpen,
|
|
58
58
|
onSwipeClose,
|
|
59
59
|
disabled = false,
|
|
60
|
+
haptic,
|
|
60
61
|
containerStyle,
|
|
61
62
|
contentStyle: contentSlotStyle,
|
|
62
63
|
actionStyle,
|
|
@@ -75,9 +76,6 @@ const Swipeable = props => {
|
|
|
75
76
|
stiffness: swipeTheme?.springStiffness ?? SPRING_CONFIG.stiffness,
|
|
76
77
|
mass: swipeTheme?.springMass ?? SPRING_CONFIG.mass
|
|
77
78
|
};
|
|
78
|
-
const fullSwipeHapticEnabled = swipeTheme?.fullSwipeHaptic ?? true;
|
|
79
|
-
const actionPressHapticEnabled = swipeTheme?.actionPressHaptic ?? true;
|
|
80
|
-
const a11yActionHapticEnabled = swipeTheme?.a11yActionHaptic ?? true;
|
|
81
79
|
const styles = useMemo(() => buildStyles(theme), [theme]);
|
|
82
80
|
const hasLeft = !!leftActions && leftActions.length > 0;
|
|
83
81
|
const hasRight = !!rightActions && rightActions.length > 0;
|
|
@@ -117,22 +115,23 @@ const Swipeable = props => {
|
|
|
117
115
|
const list = side === 'left' ? leftActions : rightActions;
|
|
118
116
|
const first = list?.[0];
|
|
119
117
|
if (!first) return;
|
|
120
|
-
if (
|
|
118
|
+
if (haptic !== false) triggerHaptic('notificationSuccess');
|
|
121
119
|
first.onPress();
|
|
122
120
|
// After the off-screen slide, snap back to 0 silently.
|
|
123
121
|
translateX.value = withSpring(0, springConfig);
|
|
124
122
|
openSideRef.current = null;
|
|
125
123
|
onSwipeClose?.();
|
|
126
|
-
}, [leftActions, rightActions, translateX, onSwipeClose, springConfig,
|
|
124
|
+
}, [leftActions, rightActions, translateX, onSwipeClose, springConfig, haptic]);
|
|
127
125
|
const close = useCallback(() => {
|
|
128
126
|
translateX.value = withSpring(0, springConfig);
|
|
129
127
|
notifyClose();
|
|
130
128
|
}, [translateX, notifyClose, springConfig]);
|
|
131
129
|
const handleActionPress = useCallback(action => {
|
|
132
|
-
|
|
130
|
+
const h = resolveHaptic(haptic, 'selection');
|
|
131
|
+
if (h) triggerHaptic(h);
|
|
133
132
|
action.onPress();
|
|
134
133
|
close();
|
|
135
|
-
}, [close,
|
|
134
|
+
}, [close, haptic]);
|
|
136
135
|
|
|
137
136
|
// ───────── Pan gesture (UI thread) ─────────
|
|
138
137
|
const panGesture = useMemo(() => {
|
|
@@ -238,10 +237,10 @@ const Swipeable = props => {
|
|
|
238
237
|
const all = [...(leftActions ?? []), ...(rightActions ?? [])];
|
|
239
238
|
const match = all.find(a => a.key === name);
|
|
240
239
|
if (match) {
|
|
241
|
-
if (
|
|
240
|
+
if (haptic !== false) triggerHaptic('selection');
|
|
242
241
|
match.onPress();
|
|
243
242
|
}
|
|
244
|
-
}, [leftActions, rightActions,
|
|
243
|
+
}, [leftActions, rightActions, haptic]);
|
|
245
244
|
|
|
246
245
|
// ───────── Render ─────────
|
|
247
246
|
// No actions configured → render children directly; zero gesture overhead.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15
15
|
import { Animated, Pressable, ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
16
16
|
import { useTheme, createAnimatedValue } from "../../theme/index.js";
|
|
17
|
-
import { triggerHaptic } from "../../utils/index.js";
|
|
17
|
+
import { triggerHaptic, resolveHaptic } from "../../utils/index.js";
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
19
|
const Tabs = /*#__PURE__*/forwardRef((props, ref) => {
|
|
20
20
|
const {
|
|
@@ -33,6 +33,7 @@ const Tabs = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
33
33
|
dividerStyle,
|
|
34
34
|
indicatorStyle,
|
|
35
35
|
progress,
|
|
36
|
+
haptic,
|
|
36
37
|
accessibilityLabel,
|
|
37
38
|
testID
|
|
38
39
|
} = props;
|
|
@@ -46,7 +47,6 @@ const Tabs = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
46
47
|
const pillInset = tabsTokens?.pillInset ?? 4;
|
|
47
48
|
const disabledOpacity = tabsTokens?.disabledOpacity ?? 0.45;
|
|
48
49
|
const badgeGap = tabsTokens?.badgeGap ?? 6;
|
|
49
|
-
const hapticOnPress = tabsTokens?.hapticOnPress ?? false;
|
|
50
50
|
|
|
51
51
|
// Per-tab measured layouts (key → {x, width}).
|
|
52
52
|
const [layouts, setLayouts] = useState({});
|
|
@@ -122,9 +122,10 @@ const Tabs = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
122
122
|
const handlePress = useCallback(tab => {
|
|
123
123
|
if (tab.disabled) return;
|
|
124
124
|
if (tab.key === activeKey) return;
|
|
125
|
-
|
|
125
|
+
const h = resolveHaptic(haptic, 'selection');
|
|
126
|
+
if (h) triggerHaptic(h);
|
|
126
127
|
onChange(tab.key);
|
|
127
|
-
}, [activeKey, onChange,
|
|
128
|
+
}, [activeKey, onChange, haptic]);
|
|
128
129
|
const indicatorIsPill = variant === 'pills';
|
|
129
130
|
|
|
130
131
|
// Indicator visual.
|
|
@@ -4,7 +4,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
|
4
4
|
import { AccessibilityInfo, Animated, Easing, FlatList, Modal, Platform, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { useTheme, createAnimatedValue, setNativeValue } from "../../theme/index.js";
|
|
7
|
-
import { triggerHaptic } from "../../utils/hapticUtils.js";
|
|
7
|
+
import { resolveHaptic, triggerHaptic } from "../../utils/hapticUtils.js";
|
|
8
8
|
import Button from "../Button/Button.js";
|
|
9
9
|
import { PickerTrigger } from "../PickerTrigger/PickerTrigger.js";
|
|
10
10
|
|
|
@@ -70,6 +70,7 @@ const Wheel = ({
|
|
|
70
70
|
onIndexChange,
|
|
71
71
|
formatItem,
|
|
72
72
|
theme,
|
|
73
|
+
haptic,
|
|
73
74
|
testID
|
|
74
75
|
}) => {
|
|
75
76
|
const listRef = useRef(null);
|
|
@@ -92,7 +93,6 @@ const Wheel = ({
|
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
}, [selectedIndex, scrollY]);
|
|
95
|
-
const hapticEnabled = theme.components.timePicker?.haptic ?? false;
|
|
96
96
|
const hapticDebounceMs = theme.components.timePicker?.hapticDebounceMs ?? HAPTIC_DEBOUNCE_MS;
|
|
97
97
|
const onScroll = useMemo(() => Animated.event([{
|
|
98
98
|
nativeEvent: {
|
|
@@ -107,14 +107,15 @@ const Wheel = ({
|
|
|
107
107
|
const idx = Math.round(y / ITEM_HEIGHT);
|
|
108
108
|
if (idx !== lastIndexRef.current && idx >= 0 && idx < data.length) {
|
|
109
109
|
const now = Date.now();
|
|
110
|
-
if (
|
|
111
|
-
|
|
110
|
+
if (now - lastHapticAtRef.current >= hapticDebounceMs) {
|
|
111
|
+
const h = resolveHaptic(haptic, 'selection');
|
|
112
|
+
if (h) triggerHaptic(h);
|
|
112
113
|
lastHapticAtRef.current = now;
|
|
113
114
|
}
|
|
114
115
|
lastIndexRef.current = idx;
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
|
-
}), [scrollY, data.length,
|
|
118
|
+
}), [scrollY, data.length, haptic, hapticDebounceMs]);
|
|
118
119
|
const onMomentumScrollEnd = useCallback(event => {
|
|
119
120
|
const y = event.nativeEvent.contentOffset.y;
|
|
120
121
|
const idx = Math.max(0, Math.min(data.length - 1, Math.round(y / ITEM_HEIGHT)));
|
|
@@ -240,7 +241,8 @@ const TimePicker = props => {
|
|
|
240
241
|
clearable,
|
|
241
242
|
onClear,
|
|
242
243
|
formatValue,
|
|
243
|
-
triggerStyle
|
|
244
|
+
triggerStyle,
|
|
245
|
+
haptic
|
|
244
246
|
} = props;
|
|
245
247
|
const isControlled = props.visible !== undefined;
|
|
246
248
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
@@ -345,21 +347,21 @@ const TimePicker = props => {
|
|
|
345
347
|
announce(periods[idx] ?? '');
|
|
346
348
|
}, [periods, announce]);
|
|
347
349
|
const handleCancel = useCallback(() => {
|
|
348
|
-
if (
|
|
350
|
+
if (haptic !== false) triggerHaptic('selection');
|
|
349
351
|
handleCloseModal();
|
|
350
|
-
}, [handleCloseModal,
|
|
352
|
+
}, [handleCloseModal, haptic]);
|
|
351
353
|
const handleConfirm = useCallback(() => {
|
|
352
354
|
const displayHour = hours[hourIndex] ?? 0;
|
|
353
355
|
const period = periods[periodIndex] ?? 'AM';
|
|
354
356
|
const hour24 = to24h(displayHour, period, format);
|
|
355
357
|
const minute = minutes[minuteIndex] ?? 0;
|
|
356
|
-
if (
|
|
358
|
+
if (haptic !== false) triggerHaptic('notificationSuccess');
|
|
357
359
|
onChange?.({
|
|
358
360
|
hour: hour24,
|
|
359
361
|
minute
|
|
360
362
|
});
|
|
361
363
|
handleCloseModal();
|
|
362
|
-
}, [hours, hourIndex, periods, periodIndex, minutes, minuteIndex, format, onChange, handleCloseModal,
|
|
364
|
+
}, [hours, hourIndex, periods, periodIndex, minutes, minuteIndex, format, onChange, handleCloseModal, haptic]);
|
|
363
365
|
const summary = useMemo(() => {
|
|
364
366
|
const displayHour = hours[hourIndex] ?? 0;
|
|
365
367
|
const minute = minutes[minuteIndex] ?? 0;
|
|
@@ -443,6 +445,7 @@ const TimePicker = props => {
|
|
|
443
445
|
onIndexChange: handleHourIndex,
|
|
444
446
|
formatItem: formatHourItem,
|
|
445
447
|
theme: theme,
|
|
448
|
+
haptic: haptic,
|
|
446
449
|
testID: "time-picker-hour"
|
|
447
450
|
}), /*#__PURE__*/_jsx(Text, {
|
|
448
451
|
style: styles.separator,
|
|
@@ -455,6 +458,7 @@ const TimePicker = props => {
|
|
|
455
458
|
onIndexChange: handleMinuteIndex,
|
|
456
459
|
formatItem: formatMinuteItem,
|
|
457
460
|
theme: theme,
|
|
461
|
+
haptic: haptic,
|
|
458
462
|
testID: "time-picker-minute"
|
|
459
463
|
}), format === '12h' ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
460
464
|
children: [/*#__PURE__*/_jsx(View, {
|
|
@@ -467,6 +471,7 @@ const TimePicker = props => {
|
|
|
467
471
|
onIndexChange: handlePeriodIndex,
|
|
468
472
|
formatItem: formatPeriodItem,
|
|
469
473
|
theme: theme,
|
|
474
|
+
haptic: haptic,
|
|
470
475
|
testID: "time-picker-period"
|
|
471
476
|
})]
|
|
472
477
|
}) : null]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export { Accordion, AccordionGroup } from "./Accordion/index.js";
|
|
4
|
+
export { AnimatePresence } from "./AnimatePresence/index.js";
|
|
4
5
|
export { Avatar, AvatarGroup } from "./Avatar/index.js";
|
|
5
6
|
export { Badge } from "./Badge/index.js";
|
|
6
7
|
export { Banner } from "./Banner/index.js";
|
|
@@ -48,4 +48,13 @@ export const triggerHaptic = (type = 'selection') => {
|
|
|
48
48
|
export const setHapticImplementation = impl => {
|
|
49
49
|
hapticImpl = impl;
|
|
50
50
|
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Resolves a component's `haptic` prop to the type that should fire, or null
|
|
54
|
+
* when haptics are off. `false` disables; a `HapticType` overrides; `undefined`
|
|
55
|
+
* falls back to the component's sensible default. Pair with `triggerHaptic`:
|
|
56
|
+
* const h = resolveHaptic(haptic, 'selection');
|
|
57
|
+
* if (h) triggerHaptic(h);
|
|
58
|
+
*/
|
|
59
|
+
export const resolveHaptic = (haptic, fallbackType) => haptic === false ? null : haptic ?? fallbackType;
|
|
51
60
|
//# sourceMappingURL=hapticUtils.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
export { ScreenDimensions, Breakpoints, Responsive, isScreenSize, isTablet } from "./responsive.js";
|
|
4
4
|
export { Spacing, Padding, Margin } from "./spacing.js";
|
|
5
|
-
export { triggerHaptic, setHapticImplementation } from "./hapticUtils.js";
|
|
5
|
+
export { triggerHaptic, setHapticImplementation, resolveHaptic } from "./hapticUtils.js";
|
|
6
6
|
export { shadowStyle } from "./shadows.js";
|
|
7
7
|
export { compressImage } from "./imageCompression.js";
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
3
4
|
export type AccordionVariant = 'plain' | 'card';
|
|
4
5
|
export interface AccordionProps {
|
|
5
6
|
title: string;
|
|
@@ -26,6 +27,8 @@ export interface AccordionProps {
|
|
|
26
27
|
* accordion so the layout doesn't shift when data arrives.
|
|
27
28
|
*/
|
|
28
29
|
loading?: boolean;
|
|
30
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
31
|
+
haptic?: HapticType | false;
|
|
29
32
|
}
|
|
30
33
|
export interface AccordionGroupProps {
|
|
31
34
|
children: React.ReactNode;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export type PresencePreset = 'fade' | 'scale' | 'slide-up' | 'slide-down';
|
|
4
|
+
export interface AnimatePresenceProps {
|
|
5
|
+
/**
|
|
6
|
+
* Render conditionally. When this goes null / undefined / false the exit
|
|
7
|
+
* animation plays before the content unmounts; when it returns the enter
|
|
8
|
+
* animation plays. Drive it like `{visible ? <Panel /> : null}`.
|
|
9
|
+
*/
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/** Enter/exit preset. Default `'fade'`. */
|
|
12
|
+
preset?: PresencePreset;
|
|
13
|
+
/** Animation duration (ms). Defaults to `theme.motion.duration.base`. */
|
|
14
|
+
duration?: number;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
testID?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Animates a single child in on mount and out on unmount. Thin, theme-aware
|
|
20
|
+
* wrapper over Reanimated's `entering`/`exiting` — Reanimated keeps the view
|
|
21
|
+
* alive to play the exit, so the parent only toggles a condition. Honors the OS
|
|
22
|
+
* Reduce Motion setting (renders instantly when reduced).
|
|
23
|
+
*
|
|
24
|
+
* For animating items inside a list, use Reanimated's `itemLayoutAnimation`
|
|
25
|
+
* on `Animated.FlatList` instead — this wrapper targets single conditional nodes.
|
|
26
|
+
*/
|
|
27
|
+
declare const AnimatePresence: React.FC<AnimatePresenceProps>;
|
|
28
|
+
export { AnimatePresence };
|
|
29
|
+
export default AnimatePresence;
|
|
30
|
+
//# sourceMappingURL=AnimatePresence.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Animated, View } from 'react-native';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
4
5
|
export type AppBarVariant = 'default' | 'large' | 'compact';
|
|
5
6
|
export type AppBarTitleAlignment = 'left' | 'center';
|
|
6
7
|
export interface AppBarAction {
|
|
@@ -36,6 +37,11 @@ export interface AppBarProps {
|
|
|
36
37
|
subtitleStyle?: StyleProp<ViewStyle>;
|
|
37
38
|
/** Style applied to the right-action badge bubble. */
|
|
38
39
|
badgeStyle?: StyleProp<ViewStyle>;
|
|
40
|
+
/**
|
|
41
|
+
* Haptic feedback for interactions. Pass false to disable; pass a HapticType
|
|
42
|
+
* to override the default.
|
|
43
|
+
*/
|
|
44
|
+
haptic?: HapticType | false;
|
|
39
45
|
testID?: string;
|
|
40
46
|
}
|
|
41
47
|
declare const AppBar: React.ForwardRefExoticComponent<AppBarProps & React.RefAttributes<View>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, View as RNView, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
3
4
|
export type BannerVariant = 'info' | 'success' | 'warning' | 'error' | 'neutral';
|
|
4
5
|
export interface BannerAction {
|
|
5
6
|
label: string;
|
|
@@ -14,6 +15,8 @@ export interface BannerProps {
|
|
|
14
15
|
actions?: BannerAction[];
|
|
15
16
|
dismissible?: boolean;
|
|
16
17
|
onDismiss?: () => void;
|
|
18
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
19
|
+
haptic?: HapticType | false;
|
|
17
20
|
visible?: boolean;
|
|
18
21
|
animateMount?: boolean;
|
|
19
22
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { GestureResponderEvent, ImageSourcePropType, PressableProps, StyleProp, View as RNView, ViewStyle } from 'react-native';
|
|
3
3
|
import type { GradientDefinition } from '../../theme/types';
|
|
4
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
4
5
|
export type CardVariant = 'elevated' | 'outlined' | 'filled';
|
|
5
6
|
export type CardElevation = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
6
7
|
export type CardRadius = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
@@ -32,6 +33,8 @@ export interface CardProps extends Omit<PressableProps, 'style' | 'children'> {
|
|
|
32
33
|
*/
|
|
33
34
|
gradient?: string | GradientDefinition;
|
|
34
35
|
onPress?: (event: GestureResponderEvent) => void;
|
|
36
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
37
|
+
haptic?: HapticType | false;
|
|
35
38
|
accessibilityLabel?: string;
|
|
36
39
|
style?: StyleProp<ViewStyle>;
|
|
37
40
|
/** Alias for `style` — applied to the outer card element. */
|
|
@@ -14,6 +14,7 @@ export interface CheckboxProps extends Omit<PressableProps, 'style' | 'children'
|
|
|
14
14
|
size?: CheckboxSize;
|
|
15
15
|
tone?: CheckboxTone;
|
|
16
16
|
accessibilityLabel?: string;
|
|
17
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
17
18
|
haptic?: HapticType | false;
|
|
18
19
|
style?: StyleProp<ViewStyle>;
|
|
19
20
|
boxStyle?: StyleProp<ViewStyle>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, TextStyle, View as RNView, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
3
4
|
export type ChipVariant = 'filled' | 'outlined';
|
|
4
5
|
export type ChipTone = 'primary' | 'neutral' | 'success' | 'warning' | 'error' | 'info';
|
|
5
6
|
export type ChipSize = 'sm' | 'md';
|
|
@@ -20,6 +21,8 @@ export interface ChipProps {
|
|
|
20
21
|
*/
|
|
21
22
|
loading?: boolean;
|
|
22
23
|
accessibilityLabel?: string;
|
|
24
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
25
|
+
haptic?: HapticType | false;
|
|
23
26
|
style?: StyleProp<ViewStyle>;
|
|
24
27
|
textStyle?: StyleProp<TextStyle>;
|
|
25
28
|
/** Style override for the chip outer container (alias to style, applied after). */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils';
|
|
3
4
|
import type { PickerTriggerSize, PickerTriggerVariant } from '../PickerTrigger';
|
|
4
5
|
export type DatePickerMode = 'modal' | 'inline';
|
|
5
6
|
export type WeekStart = 0 | 1 | 6;
|
|
@@ -40,6 +41,8 @@ export interface DatePickerProps {
|
|
|
40
41
|
navButtonStyle?: StyleProp<ViewStyle>;
|
|
41
42
|
/** Style override for the cancel/confirm footer buttons. */
|
|
42
43
|
footerButtonStyle?: StyleProp<ViewStyle>;
|
|
44
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
45
|
+
haptic?: HapticType | false;
|
|
43
46
|
testID?: string;
|
|
44
47
|
label?: string;
|
|
45
48
|
placeholder?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
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 { HapticType } from '../../utils';
|
|
4
5
|
import type { PickerTriggerSize, PickerTriggerVariant } from '../PickerTrigger';
|
|
5
6
|
export type WeekStart = 0 | 1 | 6;
|
|
6
7
|
export interface DateRange {
|
|
@@ -48,6 +49,11 @@ export interface DateRangePickerProps {
|
|
|
48
49
|
confirmLabel?: string;
|
|
49
50
|
cancelLabel?: string;
|
|
50
51
|
maxRange?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Haptic feedback for interactions. Pass false to disable; pass a HapticType
|
|
54
|
+
* to override the default.
|
|
55
|
+
*/
|
|
56
|
+
haptic?: HapticType | false;
|
|
51
57
|
style?: StyleProp<ViewStyle>;
|
|
52
58
|
/** Outer container style applied to the calendar card. */
|
|
53
59
|
containerStyle?: StyleProp<ViewStyle>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
3
4
|
export type DialogVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
4
5
|
export type DialogActionTone = 'primary' | 'neutral' | 'error';
|
|
5
6
|
export interface DialogAction {
|
|
@@ -34,6 +35,8 @@ export interface DialogProps {
|
|
|
34
35
|
actionButtonStyle?: StyleProp<ViewStyle>;
|
|
35
36
|
/** Style override applied to every action button label text. */
|
|
36
37
|
actionTextStyle?: StyleProp<TextStyle>;
|
|
38
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
39
|
+
haptic?: HapticType | false;
|
|
37
40
|
testID?: string;
|
|
38
41
|
}
|
|
39
42
|
declare const Dialog: React.FC<DialogProps>;
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
22
|
+
import type { HapticType } from '../../utils';
|
|
22
23
|
export type DrawerSide = 'left' | 'right' | 'top' | 'bottom';
|
|
23
24
|
export interface DrawerProps {
|
|
24
25
|
/** Controlled visibility. Omit to use internal state. */
|
|
@@ -37,6 +38,8 @@ export interface DrawerProps {
|
|
|
37
38
|
enableBackdropPress?: boolean;
|
|
38
39
|
/** Backdrop opacity at fully-open state (0..1). */
|
|
39
40
|
backdropOpacity?: number;
|
|
41
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
42
|
+
haptic?: HapticType | false;
|
|
40
43
|
containerStyle?: StyleProp<ViewStyle>;
|
|
41
44
|
children?: React.ReactNode;
|
|
42
45
|
accessibilityLabel?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
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 { HapticType } from '../../utils/hapticUtils';
|
|
4
5
|
export type FloatingActionButtonSize = 'sm' | 'md' | 'lg';
|
|
5
6
|
export type FloatingActionButtonTone = 'primary' | 'success' | 'warning' | 'error' | 'neutral';
|
|
6
7
|
export type FloatingActionButtonPosition = 'bottomRight' | 'bottomLeft' | 'bottomCenter';
|
|
@@ -18,6 +19,8 @@ export interface FloatingActionButtonProps {
|
|
|
18
19
|
isScrolling?: boolean;
|
|
19
20
|
accessibilityLabel: string;
|
|
20
21
|
accessibilityHint?: string;
|
|
22
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
23
|
+
haptic?: HapticType | false;
|
|
21
24
|
style?: StyleProp<ViewStyle>;
|
|
22
25
|
containerStyle?: StyleProp<ViewStyle>;
|
|
23
26
|
labelStyle?: StyleProp<ViewStyle>;
|
|
@@ -43,6 +46,8 @@ export interface FloatingActionButtonGroupProps {
|
|
|
43
46
|
bottomOffset?: number;
|
|
44
47
|
size?: FloatingActionButtonSize;
|
|
45
48
|
accessibilityLabel?: string;
|
|
49
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
50
|
+
haptic?: HapticType | false;
|
|
46
51
|
containerStyle?: StyleProp<ViewStyle>;
|
|
47
52
|
secondaryActionStyle?: StyleProp<ViewStyle>;
|
|
48
53
|
labelPillStyle?: StyleProp<ViewStyle>;
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import React from 'react';
|
|
20
20
|
import type { ImageSourcePropType, StyleProp, ViewStyle } from 'react-native';
|
|
21
|
+
import type { HapticType } from '../../utils';
|
|
21
22
|
export interface GalleryImage {
|
|
22
23
|
source: ImageSourcePropType;
|
|
23
24
|
caption?: string;
|
|
@@ -31,6 +32,11 @@ export interface ImageGalleryProps {
|
|
|
31
32
|
enableLightbox?: boolean;
|
|
32
33
|
enablePinchZoom?: boolean;
|
|
33
34
|
onIndexChange?: (idx: number) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Haptic feedback for interactions. Pass false to disable; pass a HapticType
|
|
37
|
+
* to override the default.
|
|
38
|
+
*/
|
|
39
|
+
haptic?: HapticType | false;
|
|
34
40
|
/**
|
|
35
41
|
* When true, renders the component as its authored skeleton placeholder shape.
|
|
36
42
|
* The placeholder mirrors the real layout's footprint so the UI doesn't reflow
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { GestureResponderEvent, StyleProp, TextStyle, View as RNView, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
3
4
|
import type { SwipeableAction } from '../Swipeable';
|
|
4
5
|
export type ListItemSize = 'sm' | 'md' | 'lg';
|
|
5
6
|
export interface ListItemProps {
|
|
@@ -15,6 +16,8 @@ export interface ListItemProps {
|
|
|
15
16
|
left?: React.ReactNode;
|
|
16
17
|
right?: React.ReactNode;
|
|
17
18
|
onPress?: (event: GestureResponderEvent) => void;
|
|
19
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
20
|
+
haptic?: HapticType | false;
|
|
18
21
|
selected?: boolean;
|
|
19
22
|
disabled?: boolean;
|
|
20
23
|
size?: ListItemSize;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { StyleProp, View as RNView, ViewStyle } from 'react-native';
|
|
4
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
4
5
|
export type ModalPresentation = 'centered' | 'bottom' | 'fullScreen';
|
|
5
6
|
export interface ModalProps {
|
|
6
7
|
visible: boolean;
|
|
@@ -21,6 +22,11 @@ export interface ModalProps {
|
|
|
21
22
|
* Opt-in: when undefined, focus behaviour is unchanged.
|
|
22
23
|
*/
|
|
23
24
|
restoreFocusRef?: React.RefObject<RNView | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Haptic feedback for interactions. Pass false to disable; pass a HapticType
|
|
27
|
+
* to override the default.
|
|
28
|
+
*/
|
|
29
|
+
haptic?: HapticType | false;
|
|
24
30
|
testID?: string;
|
|
25
31
|
}
|
|
26
32
|
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<View>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, TextInputProps, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils';
|
|
3
4
|
export type NumberInputSize = 'sm' | 'md' | 'lg';
|
|
4
5
|
export type NumberInputVariant = 'inline' | 'horizontal' | 'stacked';
|
|
5
6
|
export interface NumberInputRef {
|
|
@@ -23,6 +24,8 @@ export interface NumberInputProps {
|
|
|
23
24
|
size?: NumberInputSize;
|
|
24
25
|
variant?: NumberInputVariant;
|
|
25
26
|
unit?: string;
|
|
27
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
28
|
+
haptic?: HapticType | false;
|
|
26
29
|
accessibilityLabel?: string;
|
|
27
30
|
style?: StyleProp<ViewStyle>;
|
|
28
31
|
containerStyle?: StyleProp<ViewStyle>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils';
|
|
3
4
|
export type OTPInputSize = 'sm' | 'md' | 'lg';
|
|
4
5
|
export interface OTPInputRef {
|
|
5
6
|
focus: () => void;
|
|
@@ -18,6 +19,11 @@ export interface OTPInputProps {
|
|
|
18
19
|
error?: boolean | string;
|
|
19
20
|
size?: OTPInputSize;
|
|
20
21
|
secure?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Haptic feedback for interactions. Pass false to disable; pass a HapticType
|
|
24
|
+
* to override the default.
|
|
25
|
+
*/
|
|
26
|
+
haptic?: HapticType | false;
|
|
21
27
|
accessibilityLabel?: string;
|
|
22
28
|
style?: StyleProp<ViewStyle>;
|
|
23
29
|
cellStyle?: StyleProp<ViewStyle>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, View as RNView, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
3
4
|
export type RatingTone = 'primary' | 'warning';
|
|
4
5
|
export type RatingSize = 'sm' | 'md' | 'lg' | number;
|
|
5
6
|
export interface RatingProps {
|
|
@@ -17,6 +18,11 @@ export interface RatingProps {
|
|
|
17
18
|
* when data arrives. Use this while the data driving the component is being fetched.
|
|
18
19
|
*/
|
|
19
20
|
loading?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Haptic feedback for interactions. Pass false to disable; pass a HapticType
|
|
23
|
+
* to override the default.
|
|
24
|
+
*/
|
|
25
|
+
haptic?: HapticType | false;
|
|
20
26
|
accessibilityLabel?: string;
|
|
21
27
|
style?: StyleProp<ViewStyle>;
|
|
22
28
|
containerStyle?: StyleProp<ViewStyle>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInput } from 'react-native';
|
|
3
3
|
import type { StyleProp, TextInputProps, ViewStyle } from 'react-native';
|
|
4
|
+
import type { HapticType } from '../../utils/hapticUtils';
|
|
4
5
|
export type SearchBarSize = 'sm' | 'md' | 'lg';
|
|
5
6
|
export type SearchBarVariant = 'filled' | 'outlined';
|
|
6
7
|
export interface SearchBarProps extends Omit<TextInputProps, 'style' | 'value' | 'onChangeText'> {
|
|
@@ -19,6 +20,8 @@ export interface SearchBarProps extends Omit<TextInputProps, 'style' | 'value' |
|
|
|
19
20
|
size?: SearchBarSize;
|
|
20
21
|
variant?: SearchBarVariant;
|
|
21
22
|
cancelLabel?: string;
|
|
23
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
24
|
+
haptic?: HapticType | false;
|
|
22
25
|
style?: StyleProp<ViewStyle>;
|
|
23
26
|
accessibilityLabel?: string;
|
|
24
27
|
testID?: string;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { View } from 'react-native';
|
|
10
10
|
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
11
|
+
import type { HapticType } from '../../utils';
|
|
11
12
|
export type SegmentedControlSize = 'sm' | 'md';
|
|
12
13
|
export type SegmentedControlTone = 'primary' | 'neutral';
|
|
13
14
|
export type SegmentValue = string | number;
|
|
@@ -25,6 +26,8 @@ export interface SegmentedControlProps {
|
|
|
25
26
|
fullWidth?: boolean;
|
|
26
27
|
disabled?: boolean;
|
|
27
28
|
tone?: SegmentedControlTone;
|
|
29
|
+
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
30
|
+
haptic?: HapticType | false;
|
|
28
31
|
accessibilityLabel?: string;
|
|
29
32
|
style?: StyleProp<ViewStyle>;
|
|
30
33
|
containerStyle?: StyleProp<ViewStyle>;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { View } from 'react-native';
|
|
10
10
|
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
11
|
+
import type { HapticType } from '../../utils';
|
|
11
12
|
export type SelectSize = 'sm' | 'md' | 'lg';
|
|
12
13
|
export type SelectValue = string | number;
|
|
13
14
|
export interface SelectOption {
|
|
@@ -38,6 +39,11 @@ interface BaseSelectProps<T = SelectOption> {
|
|
|
38
39
|
getOptionIcon?: (option: T) => React.ReactNode;
|
|
39
40
|
placeholder?: string;
|
|
40
41
|
searchable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Haptic feedback for interactions. Pass false to disable; pass a HapticType
|
|
44
|
+
* to override the default.
|
|
45
|
+
*/
|
|
46
|
+
haptic?: HapticType | false;
|
|
41
47
|
label?: string;
|
|
42
48
|
error?: string;
|
|
43
49
|
disabled?: boolean;
|