@webority-technologies/mobile 0.0.22 → 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 +9 -7
- 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/Avatar/Avatar.js +4 -2
- package/lib/commonjs/components/Badge/Badge.js +5 -5
- package/lib/commonjs/components/Banner/Banner.js +20 -6
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +6 -4
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +8 -9
- package/lib/commonjs/components/Box/Box.js +162 -0
- package/lib/commonjs/components/Box/index.js +37 -0
- package/lib/commonjs/components/Button/Button.js +7 -7
- package/lib/commonjs/components/Card/Card.js +3 -3
- package/lib/commonjs/components/Carousel/Carousel.js +4 -2
- package/lib/commonjs/components/Checkbox/Checkbox.js +17 -7
- package/lib/commonjs/components/Chip/Chip.js +4 -2
- package/lib/commonjs/components/DatePicker/DatePicker.js +31 -24
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +16 -11
- package/lib/commonjs/components/Dialog/Dialog.js +6 -4
- package/lib/commonjs/components/Drawer/Drawer.js +4 -2
- package/lib/commonjs/components/FieldBase/FieldBase.js +8 -4
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +23 -13
- package/lib/commonjs/components/FormField/FormField.js +61 -25
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +17 -15
- package/lib/commonjs/components/Input/Input.js +41 -29
- package/lib/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +102 -0
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +13 -0
- package/lib/commonjs/components/KeyboardToolbar/KeyboardToolbar.js +130 -0
- package/lib/commonjs/components/KeyboardToolbar/index.js +13 -0
- package/lib/commonjs/components/ListItem/ListItem.js +4 -3
- package/lib/commonjs/components/Modal/Modal.js +21 -9
- package/lib/commonjs/components/NumberInput/NumberInput.js +38 -29
- package/lib/commonjs/components/OTPInput/OTPInput.js +37 -22
- package/lib/commonjs/components/Radio/Radio.js +9 -8
- package/lib/commonjs/components/Radio/RadioGroup.js +10 -3
- package/lib/commonjs/components/Rating/Rating.js +4 -3
- package/lib/commonjs/components/SearchBar/SearchBar.js +11 -6
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +23 -12
- package/lib/commonjs/components/Select/Select.js +40 -36
- package/lib/commonjs/components/Skeleton/SkeletonContent.js +5 -2
- package/lib/commonjs/components/Slider/Slider.js +241 -225
- package/lib/commonjs/components/Spinner/Spinner.js +5 -5
- package/lib/commonjs/components/Stepper/Stepper.js +6 -5
- package/lib/commonjs/components/Swipeable/Swipeable.js +8 -9
- package/lib/commonjs/components/Switch/Switch.js +29 -16
- package/lib/commonjs/components/Tabs/Tabs.js +8 -5
- package/lib/commonjs/components/Text/Text.js +142 -0
- package/lib/commonjs/components/Text/index.js +13 -0
- package/lib/commonjs/components/TimePicker/TimePicker.js +23 -15
- package/lib/commonjs/components/Toast/Toast.js +22 -10
- package/lib/commonjs/components/Tooltip/Tooltip.js +6 -2
- package/lib/commonjs/components/index.js +156 -103
- package/lib/commonjs/form/FormContext.js +40 -0
- package/lib/commonjs/form/index.js +68 -0
- package/lib/commonjs/form/path.js +79 -0
- package/lib/commonjs/form/rules.js +67 -0
- package/lib/commonjs/form/types.js +2 -0
- package/lib/commonjs/form/useField.js +54 -0
- package/lib/commonjs/form/useForm.js +316 -0
- package/lib/commonjs/hooks/index.js +14 -0
- package/lib/commonjs/hooks/useControllableState.js +30 -0
- package/lib/commonjs/hooks/useReducedMotion.js +31 -0
- package/lib/commonjs/index.js +96 -11
- package/lib/commonjs/theme/ThemeContext.js +30 -2
- package/lib/commonjs/theme/tokens.js +12 -0
- package/lib/commonjs/utils/hapticUtils.js +11 -1
- package/lib/commonjs/utils/index.js +6 -0
- package/lib/module/components/Accordion/Accordion.js +10 -8
- 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/Avatar/Avatar.js +4 -2
- package/lib/module/components/Badge/Badge.js +5 -5
- package/lib/module/components/Banner/Banner.js +20 -6
- package/lib/module/components/BottomNavigation/BottomNavigation.js +6 -4
- package/lib/module/components/BottomSheet/BottomSheet.js +8 -9
- package/lib/module/components/Box/Box.js +156 -0
- package/lib/module/components/Box/index.js +4 -0
- package/lib/module/components/Button/Button.js +7 -7
- package/lib/module/components/Card/Card.js +4 -4
- package/lib/module/components/Carousel/Carousel.js +4 -2
- package/lib/module/components/Checkbox/Checkbox.js +18 -8
- package/lib/module/components/Chip/Chip.js +5 -3
- package/lib/module/components/DatePicker/DatePicker.js +32 -25
- package/lib/module/components/DateRangePicker/DateRangePicker.js +17 -12
- package/lib/module/components/Dialog/Dialog.js +7 -5
- package/lib/module/components/Drawer/Drawer.js +5 -3
- package/lib/module/components/FieldBase/FieldBase.js +8 -4
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +24 -14
- package/lib/module/components/FormField/FormField.js +62 -26
- package/lib/module/components/ImageGallery/ImageGallery.js +18 -16
- package/lib/module/components/Input/Input.js +41 -29
- package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +98 -0
- package/lib/module/components/KeyboardAwareScrollView/index.js +4 -0
- package/lib/module/components/KeyboardToolbar/KeyboardToolbar.js +125 -0
- package/lib/module/components/KeyboardToolbar/index.js +4 -0
- package/lib/module/components/ListItem/ListItem.js +5 -4
- package/lib/module/components/Modal/Modal.js +22 -10
- package/lib/module/components/NumberInput/NumberInput.js +36 -27
- package/lib/module/components/OTPInput/OTPInput.js +37 -22
- package/lib/module/components/Radio/Radio.js +10 -9
- package/lib/module/components/Radio/RadioGroup.js +10 -3
- package/lib/module/components/Rating/Rating.js +5 -4
- package/lib/module/components/SearchBar/SearchBar.js +12 -7
- package/lib/module/components/SegmentedControl/SegmentedControl.js +24 -13
- package/lib/module/components/Select/Select.js +41 -37
- package/lib/module/components/Skeleton/SkeletonContent.js +5 -2
- package/lib/module/components/Slider/Slider.js +244 -228
- package/lib/module/components/Spinner/Spinner.js +5 -5
- package/lib/module/components/Stepper/Stepper.js +7 -6
- package/lib/module/components/Swipeable/Swipeable.js +9 -10
- package/lib/module/components/Switch/Switch.js +29 -16
- package/lib/module/components/Tabs/Tabs.js +9 -6
- package/lib/module/components/Text/Text.js +138 -0
- package/lib/module/components/Text/index.js +4 -0
- package/lib/module/components/TimePicker/TimePicker.js +24 -16
- package/lib/module/components/Toast/Toast.js +22 -10
- package/lib/module/components/Tooltip/Tooltip.js +6 -2
- package/lib/module/components/index.js +5 -0
- package/lib/module/form/FormContext.js +32 -0
- package/lib/module/form/index.js +12 -0
- package/lib/module/form/path.js +72 -0
- package/lib/module/form/rules.js +52 -0
- package/lib/module/form/types.js +2 -0
- package/lib/module/form/useField.js +49 -0
- package/lib/module/form/useForm.js +312 -0
- package/lib/module/hooks/index.js +2 -0
- package/lib/module/hooks/useControllableState.js +26 -0
- package/lib/module/hooks/useReducedMotion.js +27 -0
- package/lib/module/index.js +3 -1
- package/lib/module/theme/ThemeContext.js +30 -2
- package/lib/module/theme/tokens.js +12 -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/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/typescript/commonjs/components/Box/Box.d.ts +60 -0
- package/lib/typescript/commonjs/components/Box/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts +1 -1
- package/lib/typescript/commonjs/components/Card/Card.d.ts +3 -0
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +4 -2
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +3 -0
- package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +6 -3
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +6 -0
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +5 -2
- 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/FormField/FormField.d.ts +13 -2
- package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +6 -0
- package/lib/typescript/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
- package/lib/typescript/commonjs/components/KeyboardAwareScrollView/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
- package/lib/typescript/commonjs/components/KeyboardToolbar/index.d.ts +3 -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 +6 -2
- package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +9 -2
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts +2 -2
- package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +3 -2
- 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 +6 -2
- package/lib/typescript/commonjs/components/Select/Select.d.ts +6 -0
- package/lib/typescript/commonjs/components/Slider/Slider.d.ts +9 -4
- package/lib/typescript/commonjs/components/Spinner/Spinner.d.ts +1 -1
- 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/Switch/Switch.d.ts +3 -2
- package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +3 -0
- package/lib/typescript/commonjs/components/Text/Text.d.ts +25 -0
- package/lib/typescript/commonjs/components/Text/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +6 -3
- package/lib/typescript/commonjs/components/index.d.ts +10 -0
- package/lib/typescript/commonjs/form/FormContext.d.ts +17 -0
- package/lib/typescript/commonjs/form/index.d.ts +9 -0
- package/lib/typescript/commonjs/form/path.d.ts +10 -0
- package/lib/typescript/commonjs/form/rules.d.ts +31 -0
- package/lib/typescript/commonjs/form/types.d.ts +94 -0
- package/lib/typescript/commonjs/form/useField.d.ts +27 -0
- package/lib/typescript/commonjs/form/useForm.d.ts +10 -0
- package/lib/typescript/commonjs/hooks/index.d.ts +3 -0
- package/lib/typescript/commonjs/hooks/useControllableState.d.ts +17 -0
- package/lib/typescript/commonjs/hooks/useReducedMotion.d.ts +8 -0
- package/lib/typescript/commonjs/index.d.ts +4 -2
- package/lib/typescript/commonjs/theme/types.d.ts +17 -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/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/typescript/module/components/Box/Box.d.ts +60 -0
- package/lib/typescript/module/components/Box/index.d.ts +3 -0
- package/lib/typescript/module/components/Button/Button.d.ts +1 -1
- package/lib/typescript/module/components/Card/Card.d.ts +3 -0
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +4 -2
- package/lib/typescript/module/components/Chip/Chip.d.ts +3 -0
- package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +6 -3
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +6 -0
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +5 -2
- 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/FormField/FormField.d.ts +13 -2
- package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +6 -0
- package/lib/typescript/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
- package/lib/typescript/module/components/KeyboardAwareScrollView/index.d.ts +3 -0
- package/lib/typescript/module/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
- package/lib/typescript/module/components/KeyboardToolbar/index.d.ts +3 -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 +6 -2
- package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +9 -2
- package/lib/typescript/module/components/Radio/Radio.d.ts +2 -2
- package/lib/typescript/module/components/Radio/RadioGroup.d.ts +3 -2
- 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 +6 -2
- package/lib/typescript/module/components/Select/Select.d.ts +6 -0
- package/lib/typescript/module/components/Slider/Slider.d.ts +9 -4
- package/lib/typescript/module/components/Spinner/Spinner.d.ts +1 -1
- 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/Switch/Switch.d.ts +3 -2
- package/lib/typescript/module/components/Tabs/Tabs.d.ts +3 -0
- package/lib/typescript/module/components/Text/Text.d.ts +25 -0
- package/lib/typescript/module/components/Text/index.d.ts +3 -0
- package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +6 -3
- package/lib/typescript/module/components/index.d.ts +10 -0
- package/lib/typescript/module/form/FormContext.d.ts +17 -0
- package/lib/typescript/module/form/index.d.ts +9 -0
- package/lib/typescript/module/form/path.d.ts +10 -0
- package/lib/typescript/module/form/rules.d.ts +31 -0
- package/lib/typescript/module/form/types.d.ts +94 -0
- package/lib/typescript/module/form/useField.d.ts +27 -0
- package/lib/typescript/module/form/useForm.d.ts +10 -0
- package/lib/typescript/module/hooks/index.d.ts +3 -0
- package/lib/typescript/module/hooks/useControllableState.d.ts +17 -0
- package/lib/typescript/module/hooks/useReducedMotion.d.ts +8 -0
- package/lib/typescript/module/index.d.ts +4 -2
- package/lib/typescript/module/theme/types.d.ts +17 -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
|
@@ -96,7 +96,8 @@ const Accordion = props => {
|
|
|
96
96
|
contentWrapperStyle,
|
|
97
97
|
containerStyle,
|
|
98
98
|
testID,
|
|
99
|
-
loading = false
|
|
99
|
+
loading = false,
|
|
100
|
+
haptic
|
|
100
101
|
} = props;
|
|
101
102
|
const theme = (0, _index.useTheme)();
|
|
102
103
|
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
@@ -114,7 +115,7 @@ const Accordion = props => {
|
|
|
114
115
|
// Skip animation when state matches the previous value (e.g. on mount).
|
|
115
116
|
if (lastExpandedRef.current === expanded) return;
|
|
116
117
|
lastExpandedRef.current = expanded;
|
|
117
|
-
_reactNative.Animated.parallel([_reactNative.Animated.timing(heightAnim, {
|
|
118
|
+
const anim = _reactNative.Animated.parallel([_reactNative.Animated.timing(heightAnim, {
|
|
118
119
|
toValue: expanded ? 1 : 0,
|
|
119
120
|
duration: theme.motion.duration.normal,
|
|
120
121
|
easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
|
|
@@ -133,7 +134,9 @@ const Accordion = props => {
|
|
|
133
134
|
duration: theme.motion.duration.normal,
|
|
134
135
|
easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
|
|
135
136
|
useNativeDriver: false
|
|
136
|
-
})])
|
|
137
|
+
})]);
|
|
138
|
+
anim.start();
|
|
139
|
+
return () => anim.stop();
|
|
137
140
|
}, [expanded, heightAnim, opacityAnim, rotateAnim, theme.motion]);
|
|
138
141
|
const onContentLayout = (0, _react.useCallback)(e => {
|
|
139
142
|
const h = e.nativeEvent.layout.height;
|
|
@@ -141,9 +144,8 @@ const Accordion = props => {
|
|
|
141
144
|
}, [measuredHeight]);
|
|
142
145
|
const handlePress = (0, _react.useCallback)(() => {
|
|
143
146
|
if (disabled) return;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
+
const h = (0, _hapticUtils.resolveHaptic)(haptic, 'selection');
|
|
148
|
+
if (h) (0, _hapticUtils.triggerHaptic)(h);
|
|
147
149
|
if (group && id) {
|
|
148
150
|
group.toggle(id);
|
|
149
151
|
onChange?.(!expanded);
|
|
@@ -151,7 +153,7 @@ const Accordion = props => {
|
|
|
151
153
|
}
|
|
152
154
|
if (!isControlled) setInternalExpanded(!expanded);
|
|
153
155
|
onChange?.(!expanded);
|
|
154
|
-
}, [disabled, group, id, expanded, isControlled, onChange,
|
|
156
|
+
}, [disabled, group, id, expanded, isControlled, onChange, haptic]);
|
|
155
157
|
const rotate = rotateAnim.interpolate({
|
|
156
158
|
inputRange: [0, 1],
|
|
157
159
|
outputRange: ['0deg', '180deg']
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.AnimatePresence = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
9
|
+
var _index = require("../../theme/index.js");
|
|
10
|
+
var _index2 = require("../../hooks/index.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/**
|
|
15
|
+
* Animates a single child in on mount and out on unmount. Thin, theme-aware
|
|
16
|
+
* wrapper over Reanimated's `entering`/`exiting` — Reanimated keeps the view
|
|
17
|
+
* alive to play the exit, so the parent only toggles a condition. Honors the OS
|
|
18
|
+
* Reduce Motion setting (renders instantly when reduced).
|
|
19
|
+
*
|
|
20
|
+
* For animating items inside a list, use Reanimated's `itemLayoutAnimation`
|
|
21
|
+
* on `Animated.FlatList` instead — this wrapper targets single conditional nodes.
|
|
22
|
+
*/
|
|
23
|
+
const AnimatePresence = ({
|
|
24
|
+
children,
|
|
25
|
+
preset = 'fade',
|
|
26
|
+
duration,
|
|
27
|
+
style,
|
|
28
|
+
testID
|
|
29
|
+
}) => {
|
|
30
|
+
const theme = (0, _index.useTheme)();
|
|
31
|
+
const reduceMotion = (0, _index2.useReducedMotion)();
|
|
32
|
+
const visible = children !== null && children !== undefined && children !== false;
|
|
33
|
+
if (!visible) return null;
|
|
34
|
+
const dur = duration ?? theme.motion.duration.normal;
|
|
35
|
+
let entering;
|
|
36
|
+
let exiting;
|
|
37
|
+
if (!reduceMotion) {
|
|
38
|
+
switch (preset) {
|
|
39
|
+
case 'scale':
|
|
40
|
+
entering = _reactNativeReanimated.ZoomIn.duration(dur);
|
|
41
|
+
exiting = _reactNativeReanimated.ZoomOut.duration(dur);
|
|
42
|
+
break;
|
|
43
|
+
case 'slide-up':
|
|
44
|
+
entering = _reactNativeReanimated.FadeInUp.duration(dur);
|
|
45
|
+
exiting = _reactNativeReanimated.FadeOutDown.duration(dur);
|
|
46
|
+
break;
|
|
47
|
+
case 'slide-down':
|
|
48
|
+
entering = _reactNativeReanimated.FadeInDown.duration(dur);
|
|
49
|
+
exiting = _reactNativeReanimated.FadeOutUp.duration(dur);
|
|
50
|
+
break;
|
|
51
|
+
case 'fade':
|
|
52
|
+
default:
|
|
53
|
+
entering = _reactNativeReanimated.FadeIn.duration(dur);
|
|
54
|
+
exiting = _reactNativeReanimated.FadeOut.duration(dur);
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
59
|
+
entering: entering,
|
|
60
|
+
exiting: exiting,
|
|
61
|
+
style: style,
|
|
62
|
+
testID: testID,
|
|
63
|
+
children: children
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
exports.AnimatePresence = AnimatePresence;
|
|
67
|
+
AnimatePresence.displayName = 'AnimatePresence';
|
|
68
|
+
var _default = exports.default = AnimatePresence;
|
|
69
|
+
//# sourceMappingURL=AnimatePresence.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AnimatePresence", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AnimatePresence.AnimatePresence;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _AnimatePresence = require("./AnimatePresence.js");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -41,7 +41,8 @@ const variantSize = (theme, variant) => {
|
|
|
41
41
|
const ActionButton = ({
|
|
42
42
|
action,
|
|
43
43
|
side,
|
|
44
|
-
badgeStyle
|
|
44
|
+
badgeStyle,
|
|
45
|
+
haptic
|
|
45
46
|
}) => {
|
|
46
47
|
const theme = (0, _index.useTheme)();
|
|
47
48
|
const {
|
|
@@ -53,9 +54,8 @@ const ActionButton = ({
|
|
|
53
54
|
});
|
|
54
55
|
const styles = (0, _react.useMemo)(() => buildActionStyles(theme), [theme]);
|
|
55
56
|
const onPress = () => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
57
|
+
const h = (0, _hapticUtils.resolveHaptic)(haptic, 'selection');
|
|
58
|
+
if (h) (0, _hapticUtils.triggerHaptic)(h);
|
|
59
59
|
action.onPress();
|
|
60
60
|
};
|
|
61
61
|
const badgeValue = action.badge;
|
|
@@ -113,6 +113,7 @@ const AppBar = exports.AppBar = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
113
113
|
titleStyle,
|
|
114
114
|
subtitleStyle,
|
|
115
115
|
badgeStyle,
|
|
116
|
+
haptic,
|
|
116
117
|
testID
|
|
117
118
|
} = props;
|
|
118
119
|
const theme = (0, _index.useTheme)();
|
|
@@ -230,7 +231,8 @@ const AppBar = exports.AppBar = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
230
231
|
style: styles.sideSlot,
|
|
231
232
|
children: leftAction ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
232
233
|
action: leftAction,
|
|
233
|
-
side: "left"
|
|
234
|
+
side: "left",
|
|
235
|
+
haptic: haptic
|
|
234
236
|
}) : null
|
|
235
237
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
236
238
|
style: [styles.center, titleAlignment === 'center' ? styles.centerAligned : styles.centerLeft],
|
|
@@ -240,7 +242,8 @@ const AppBar = exports.AppBar = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
240
242
|
children: rightActions?.map((action, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
241
243
|
action: action,
|
|
242
244
|
side: "right",
|
|
243
|
-
badgeStyle: badgeStyle
|
|
245
|
+
badgeStyle: badgeStyle,
|
|
246
|
+
haptic: haptic
|
|
244
247
|
}, `appbar-right-${index}`))
|
|
245
248
|
})]
|
|
246
249
|
})]
|
|
@@ -213,13 +213,15 @@ const AvatarGroupItem = ({
|
|
|
213
213
|
}) => {
|
|
214
214
|
const opacity = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
|
|
215
215
|
(0, _react.useEffect)(() => {
|
|
216
|
-
_reactNative.Animated.timing(opacity, {
|
|
216
|
+
const anim = _reactNative.Animated.timing(opacity, {
|
|
217
217
|
toValue: 1,
|
|
218
218
|
duration: ENTRANCE_DURATION_MS,
|
|
219
219
|
delay,
|
|
220
220
|
easing: _reactNative.Easing.out(_reactNative.Easing.cubic),
|
|
221
221
|
useNativeDriver: true
|
|
222
|
-
})
|
|
222
|
+
});
|
|
223
|
+
anim.start();
|
|
224
|
+
return () => anim.stop();
|
|
223
225
|
}, [delay, opacity]);
|
|
224
226
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
225
227
|
style: [groupStyles.item, {
|
|
@@ -15,22 +15,22 @@ const toneFor = (theme, tone) => {
|
|
|
15
15
|
case 'primary':
|
|
16
16
|
return {
|
|
17
17
|
background: theme.colors.primary,
|
|
18
|
-
text: theme.colors.
|
|
18
|
+
text: theme.colors.onPrimary
|
|
19
19
|
};
|
|
20
20
|
case 'success':
|
|
21
21
|
return {
|
|
22
22
|
background: theme.colors.success,
|
|
23
|
-
text: theme.colors.
|
|
23
|
+
text: theme.colors.onSuccess
|
|
24
24
|
};
|
|
25
25
|
case 'warning':
|
|
26
26
|
return {
|
|
27
27
|
background: theme.colors.warning,
|
|
28
|
-
text: theme.colors.
|
|
28
|
+
text: theme.colors.onWarning
|
|
29
29
|
};
|
|
30
30
|
case 'info':
|
|
31
31
|
return {
|
|
32
32
|
background: theme.colors.info,
|
|
33
|
-
text: theme.colors.
|
|
33
|
+
text: theme.colors.onInfo
|
|
34
34
|
};
|
|
35
35
|
case 'neutral':
|
|
36
36
|
return {
|
|
@@ -41,7 +41,7 @@ const toneFor = (theme, tone) => {
|
|
|
41
41
|
default:
|
|
42
42
|
return {
|
|
43
43
|
background: theme.colors.error,
|
|
44
|
-
text: theme.colors.
|
|
44
|
+
text: theme.colors.onError
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -7,6 +7,7 @@ exports.default = exports.Banner = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _index = require("../../theme/index.js");
|
|
10
|
+
var _hapticUtils = require("../../utils/hapticUtils.js");
|
|
10
11
|
var _index2 = require("../Skeleton/index.js");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
@@ -19,6 +20,7 @@ const Banner = exports.Banner = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
19
20
|
actions,
|
|
20
21
|
dismissible = false,
|
|
21
22
|
onDismiss,
|
|
23
|
+
haptic,
|
|
22
24
|
visible = true,
|
|
23
25
|
animateMount = true,
|
|
24
26
|
loading = false,
|
|
@@ -44,9 +46,10 @@ const Banner = exports.Banner = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
44
46
|
isFirstRun.current = false;
|
|
45
47
|
if (!animateMount) return;
|
|
46
48
|
}
|
|
49
|
+
let anim;
|
|
47
50
|
if (visible) {
|
|
48
51
|
setMounted(true);
|
|
49
|
-
_reactNative.Animated.parallel([_reactNative.Animated.timing(translateY, {
|
|
52
|
+
anim = _reactNative.Animated.parallel([_reactNative.Animated.timing(translateY, {
|
|
50
53
|
toValue: 0,
|
|
51
54
|
duration: theme.motion.duration.normal,
|
|
52
55
|
useNativeDriver: true
|
|
@@ -54,9 +57,10 @@ const Banner = exports.Banner = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
54
57
|
toValue: 1,
|
|
55
58
|
duration: theme.motion.duration.normal,
|
|
56
59
|
useNativeDriver: true
|
|
57
|
-
})])
|
|
60
|
+
})]);
|
|
61
|
+
anim.start();
|
|
58
62
|
} else if (mounted) {
|
|
59
|
-
_reactNative.Animated.parallel([_reactNative.Animated.timing(translateY, {
|
|
63
|
+
anim = _reactNative.Animated.parallel([_reactNative.Animated.timing(translateY, {
|
|
60
64
|
toValue: -20,
|
|
61
65
|
duration: theme.motion.duration.fast,
|
|
62
66
|
useNativeDriver: true
|
|
@@ -64,10 +68,12 @@ const Banner = exports.Banner = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
64
68
|
toValue: 0,
|
|
65
69
|
duration: theme.motion.duration.fast,
|
|
66
70
|
useNativeDriver: true
|
|
67
|
-
})])
|
|
71
|
+
})]);
|
|
72
|
+
anim.start(() => {
|
|
68
73
|
setMounted(false);
|
|
69
74
|
});
|
|
70
75
|
}
|
|
76
|
+
return () => anim?.stop();
|
|
71
77
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
78
|
}, [visible]);
|
|
73
79
|
if (!mounted) return null;
|
|
@@ -144,7 +150,11 @@ const Banner = exports.Banner = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
144
150
|
}), dismissible ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
145
151
|
accessibilityRole: "button",
|
|
146
152
|
accessibilityLabel: "Dismiss banner",
|
|
147
|
-
onPress:
|
|
153
|
+
onPress: () => {
|
|
154
|
+
const h = (0, _hapticUtils.resolveHaptic)(haptic, 'selection');
|
|
155
|
+
if (h) (0, _hapticUtils.triggerHaptic)(h);
|
|
156
|
+
onDismiss?.();
|
|
157
|
+
},
|
|
148
158
|
hitSlop: 8,
|
|
149
159
|
style: ({
|
|
150
160
|
pressed
|
|
@@ -169,7 +179,11 @@ const Banner = exports.Banner = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
169
179
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
170
180
|
accessibilityRole: "button",
|
|
171
181
|
accessibilityLabel: action.label,
|
|
172
|
-
onPress:
|
|
182
|
+
onPress: () => {
|
|
183
|
+
const h = (0, _hapticUtils.resolveHaptic)(haptic, 'selection');
|
|
184
|
+
if (h) (0, _hapticUtils.triggerHaptic)(h);
|
|
185
|
+
action.onPress();
|
|
186
|
+
},
|
|
173
187
|
style: ({
|
|
174
188
|
pressed
|
|
175
189
|
}) => [styles.actionBtn, {
|
|
@@ -51,7 +51,7 @@ const BottomNavigation = exports.BottomNavigation = /*#__PURE__*/(0, _react.forw
|
|
|
51
51
|
const {
|
|
52
52
|
tabs,
|
|
53
53
|
activeTab,
|
|
54
|
-
|
|
54
|
+
onChange,
|
|
55
55
|
haptic = 'selection',
|
|
56
56
|
showLabels = true,
|
|
57
57
|
variant = 'pill',
|
|
@@ -100,12 +100,14 @@ const BottomNavigation = exports.BottomNavigation = /*#__PURE__*/(0, _react.forw
|
|
|
100
100
|
// this value directly.
|
|
101
101
|
(0, _react.useEffect)(() => {
|
|
102
102
|
if (tabWidth <= 0) return;
|
|
103
|
-
_reactNative.Animated.spring(indicatorTranslateX, {
|
|
103
|
+
const anim = _reactNative.Animated.spring(indicatorTranslateX, {
|
|
104
104
|
toValue: activeIndex * tabWidth,
|
|
105
105
|
tension: 120,
|
|
106
106
|
friction: 14,
|
|
107
107
|
useNativeDriver: true
|
|
108
|
-
})
|
|
108
|
+
});
|
|
109
|
+
anim.start();
|
|
110
|
+
return () => anim.stop();
|
|
109
111
|
}, [activeIndex, tabWidth, indicatorTranslateX]);
|
|
110
112
|
const handleLayout = e => {
|
|
111
113
|
const total = e.nativeEvent.layout.width;
|
|
@@ -130,7 +132,7 @@ const BottomNavigation = exports.BottomNavigation = /*#__PURE__*/(0, _react.forw
|
|
|
130
132
|
useNativeDriver: true
|
|
131
133
|
})]).start();
|
|
132
134
|
}
|
|
133
|
-
|
|
135
|
+
onChange(tab.key);
|
|
134
136
|
};
|
|
135
137
|
const paddingBottom = Math.max(8, insets.bottom);
|
|
136
138
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
@@ -104,7 +104,6 @@ const BottomSheet = exports.BottomSheet = /*#__PURE__*/(0, _react.forwardRef)((p
|
|
|
104
104
|
return () => sub.remove();
|
|
105
105
|
}, []);
|
|
106
106
|
const closedY = screenHeight; // fully off-screen
|
|
107
|
-
const minSnapPoint = resolvedSnapPoints[0] ?? 0;
|
|
108
107
|
const maxSnapPoint = resolvedSnapPoints[resolvedSnapPoints.length - 1] ?? 0;
|
|
109
108
|
|
|
110
109
|
// translateY: 0 = top of screen, screenHeight = fully closed.
|
|
@@ -138,6 +137,13 @@ const BottomSheet = exports.BottomSheet = /*#__PURE__*/(0, _react.forwardRef)((p
|
|
|
138
137
|
currentIndexShared.value = next;
|
|
139
138
|
onChange?.(next);
|
|
140
139
|
}, [currentIndex, currentIndexShared, onChange]);
|
|
140
|
+
const markAnimationDone = (0, _react.useCallback)(() => {
|
|
141
|
+
isAnimatingRef.current = false;
|
|
142
|
+
// If we just finished a close animation, unmount the sheet wrapper.
|
|
143
|
+
if (currentIndexShared.value < 0) {
|
|
144
|
+
if (mode === 'modal') setModalVisible(false);else setInlineMounted(false);
|
|
145
|
+
}
|
|
146
|
+
}, [mode, currentIndexShared]);
|
|
141
147
|
const animateTo = (0, _react.useCallback)((to, fromIndex, toIndex) => {
|
|
142
148
|
isAnimatingRef.current = true;
|
|
143
149
|
onAnimate?.(fromIndex, toIndex);
|
|
@@ -148,14 +154,7 @@ const BottomSheet = exports.BottomSheet = /*#__PURE__*/(0, _react.forwardRef)((p
|
|
|
148
154
|
(0, _reactNativeReanimated.runOnJS)(markAnimationDone)();
|
|
149
155
|
}
|
|
150
156
|
});
|
|
151
|
-
}, [onAnimate, translateY]);
|
|
152
|
-
const markAnimationDone = (0, _react.useCallback)(() => {
|
|
153
|
-
isAnimatingRef.current = false;
|
|
154
|
-
// If we just finished a close animation, unmount the sheet wrapper.
|
|
155
|
-
if (currentIndexShared.value < 0) {
|
|
156
|
-
if (mode === 'modal') setModalVisible(false);else setInlineMounted(false);
|
|
157
|
-
}
|
|
158
|
-
}, [mode, currentIndexShared]);
|
|
157
|
+
}, [onAnimate, translateY, markAnimationDone]);
|
|
159
158
|
const expand = (0, _react.useCallback)(idx => {
|
|
160
159
|
const target = typeof idx === 'number' ? clamp(idx, 0, resolvedSnapPoints.length - 1) : currentIndex >= 0 ? currentIndex : 0;
|
|
161
160
|
const fromIndex = currentIndexShared.value;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resolveBoxStyle = exports.default = exports.Stack = exports.Spacer = exports.Row = exports.Box = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _index = require("../../theme/index.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
const space = (theme, token) => token == null ? undefined : theme.spacing[token];
|
|
13
|
+
const resolveBoxStyle = (theme, p) => {
|
|
14
|
+
const style = {};
|
|
15
|
+
if (p.p != null) style.padding = space(theme, p.p);
|
|
16
|
+
if (p.px != null) style.paddingHorizontal = space(theme, p.px);
|
|
17
|
+
if (p.py != null) style.paddingVertical = space(theme, p.py);
|
|
18
|
+
if (p.pt != null) style.paddingTop = space(theme, p.pt);
|
|
19
|
+
if (p.pr != null) style.paddingRight = space(theme, p.pr);
|
|
20
|
+
if (p.pb != null) style.paddingBottom = space(theme, p.pb);
|
|
21
|
+
if (p.pl != null) style.paddingLeft = space(theme, p.pl);
|
|
22
|
+
if (p.m != null) style.margin = space(theme, p.m);
|
|
23
|
+
if (p.mx != null) style.marginHorizontal = space(theme, p.mx);
|
|
24
|
+
if (p.my != null) style.marginVertical = space(theme, p.my);
|
|
25
|
+
if (p.mt != null) style.marginTop = space(theme, p.mt);
|
|
26
|
+
if (p.mr != null) style.marginRight = space(theme, p.mr);
|
|
27
|
+
if (p.mb != null) style.marginBottom = space(theme, p.mb);
|
|
28
|
+
if (p.ml != null) style.marginLeft = space(theme, p.ml);
|
|
29
|
+
if (p.gap != null) style.gap = space(theme, p.gap);
|
|
30
|
+
if (p.bg != null) {
|
|
31
|
+
const bgTokens = theme.colors.background;
|
|
32
|
+
style.backgroundColor = bgTokens[p.bg] ?? p.bg;
|
|
33
|
+
}
|
|
34
|
+
if (p.radius != null) style.borderRadius = theme.radius[p.radius];
|
|
35
|
+
if (p.border) {
|
|
36
|
+
style.borderWidth = theme.colors.border.width;
|
|
37
|
+
style.borderColor = theme.colors.border.primary;
|
|
38
|
+
}
|
|
39
|
+
if (p.flex != null) style.flex = p.flex;
|
|
40
|
+
if (p.align != null) style.alignItems = p.align;
|
|
41
|
+
if (p.justify != null) style.justifyContent = p.justify;
|
|
42
|
+
if (p.direction != null) style.flexDirection = p.direction;
|
|
43
|
+
if (p.wrap) style.flexWrap = 'wrap';
|
|
44
|
+
return style;
|
|
45
|
+
};
|
|
46
|
+
exports.resolveBoxStyle = resolveBoxStyle;
|
|
47
|
+
const Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
48
|
+
const theme = (0, _index.useTheme)();
|
|
49
|
+
const {
|
|
50
|
+
// layout props consumed by the resolver — kept out of the View spread
|
|
51
|
+
p,
|
|
52
|
+
px,
|
|
53
|
+
py,
|
|
54
|
+
pt,
|
|
55
|
+
pr,
|
|
56
|
+
pb,
|
|
57
|
+
pl,
|
|
58
|
+
m,
|
|
59
|
+
mx,
|
|
60
|
+
my,
|
|
61
|
+
mt,
|
|
62
|
+
mr,
|
|
63
|
+
mb,
|
|
64
|
+
ml,
|
|
65
|
+
gap,
|
|
66
|
+
bg,
|
|
67
|
+
radius,
|
|
68
|
+
border,
|
|
69
|
+
flex,
|
|
70
|
+
align,
|
|
71
|
+
justify,
|
|
72
|
+
direction,
|
|
73
|
+
wrap,
|
|
74
|
+
style,
|
|
75
|
+
children,
|
|
76
|
+
...viewProps
|
|
77
|
+
} = props;
|
|
78
|
+
const boxStyle = resolveBoxStyle(theme, {
|
|
79
|
+
p,
|
|
80
|
+
px,
|
|
81
|
+
py,
|
|
82
|
+
pt,
|
|
83
|
+
pr,
|
|
84
|
+
pb,
|
|
85
|
+
pl,
|
|
86
|
+
m,
|
|
87
|
+
mx,
|
|
88
|
+
my,
|
|
89
|
+
mt,
|
|
90
|
+
mr,
|
|
91
|
+
mb,
|
|
92
|
+
ml,
|
|
93
|
+
gap,
|
|
94
|
+
bg,
|
|
95
|
+
radius,
|
|
96
|
+
border,
|
|
97
|
+
flex,
|
|
98
|
+
align,
|
|
99
|
+
justify,
|
|
100
|
+
direction,
|
|
101
|
+
wrap
|
|
102
|
+
});
|
|
103
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
104
|
+
ref: ref,
|
|
105
|
+
style: [boxStyle, style],
|
|
106
|
+
...viewProps,
|
|
107
|
+
children: children
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
Box.displayName = 'Box';
|
|
111
|
+
/** Vertical flex container with token spacing between children (default gap `md`). */
|
|
112
|
+
const Stack = exports.Stack = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
113
|
+
gap = 'md',
|
|
114
|
+
...rest
|
|
115
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
|
|
116
|
+
ref: ref,
|
|
117
|
+
direction: "column",
|
|
118
|
+
gap: gap,
|
|
119
|
+
...rest
|
|
120
|
+
}));
|
|
121
|
+
Stack.displayName = 'Stack';
|
|
122
|
+
/** Horizontal flex container (default `align="center"`, gap `sm`). */
|
|
123
|
+
const Row = exports.Row = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
124
|
+
gap = 'sm',
|
|
125
|
+
align = 'center',
|
|
126
|
+
...rest
|
|
127
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Box, {
|
|
128
|
+
ref: ref,
|
|
129
|
+
direction: "row",
|
|
130
|
+
gap: gap,
|
|
131
|
+
align: align,
|
|
132
|
+
...rest
|
|
133
|
+
}));
|
|
134
|
+
Row.displayName = 'Row';
|
|
135
|
+
/** Fixed gap (`size`) or a flexible push (`flex: 1`) between siblings. */
|
|
136
|
+
const Spacer = ({
|
|
137
|
+
size,
|
|
138
|
+
style,
|
|
139
|
+
testID
|
|
140
|
+
}) => {
|
|
141
|
+
const theme = (0, _index.useTheme)();
|
|
142
|
+
if (size != null) {
|
|
143
|
+
const value = theme.spacing[size];
|
|
144
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
145
|
+
testID: testID,
|
|
146
|
+
style: [{
|
|
147
|
+
width: value,
|
|
148
|
+
height: value
|
|
149
|
+
}, style]
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
153
|
+
testID: testID,
|
|
154
|
+
style: [{
|
|
155
|
+
flex: 1
|
|
156
|
+
}, style]
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
exports.Spacer = Spacer;
|
|
160
|
+
Spacer.displayName = 'Spacer';
|
|
161
|
+
var _default = exports.default = Box;
|
|
162
|
+
//# sourceMappingURL=Box.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Box", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Box.Box;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Row", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Box.Row;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "Spacer", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _Box.Spacer;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "Stack", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _Box.Stack;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "resolveBoxStyle", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _Box.resolveBoxStyle;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var _Box = require("./Box.js");
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -72,7 +72,7 @@ const Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
72
72
|
style: styles.contentRow,
|
|
73
73
|
children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Spinner, {
|
|
74
74
|
variant: "circular",
|
|
75
|
-
size: "
|
|
75
|
+
size: "sm",
|
|
76
76
|
color: variantStyles.textColor,
|
|
77
77
|
accessibilityLabel: "Loading"
|
|
78
78
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -189,7 +189,7 @@ const toneFor = (theme, tone) => {
|
|
|
189
189
|
base: theme.colors.primary,
|
|
190
190
|
hover: theme.colors.primaryHover,
|
|
191
191
|
pressed: theme.colors.primaryPressed,
|
|
192
|
-
on: theme.colors.
|
|
192
|
+
on: theme.colors.onPrimary,
|
|
193
193
|
muted: theme.colors.primaryMuted
|
|
194
194
|
};
|
|
195
195
|
case 'secondary':
|
|
@@ -197,7 +197,7 @@ const toneFor = (theme, tone) => {
|
|
|
197
197
|
base: theme.colors.secondary,
|
|
198
198
|
hover: theme.colors.secondaryHover,
|
|
199
199
|
pressed: theme.colors.secondaryHover,
|
|
200
|
-
on: theme.colors.
|
|
200
|
+
on: theme.colors.onSecondary,
|
|
201
201
|
muted: theme.colors.secondary
|
|
202
202
|
};
|
|
203
203
|
case 'success':
|
|
@@ -205,7 +205,7 @@ const toneFor = (theme, tone) => {
|
|
|
205
205
|
base: theme.colors.success,
|
|
206
206
|
hover: theme.colors.success,
|
|
207
207
|
pressed: theme.colors.success,
|
|
208
|
-
on: theme.colors.
|
|
208
|
+
on: theme.colors.onSuccess,
|
|
209
209
|
muted: theme.colors.background.secondary
|
|
210
210
|
};
|
|
211
211
|
case 'warning':
|
|
@@ -213,15 +213,15 @@ const toneFor = (theme, tone) => {
|
|
|
213
213
|
base: theme.colors.warning,
|
|
214
214
|
hover: theme.colors.warning,
|
|
215
215
|
pressed: theme.colors.warning,
|
|
216
|
-
on: theme.colors.
|
|
216
|
+
on: theme.colors.onWarning,
|
|
217
217
|
muted: theme.colors.background.secondary
|
|
218
218
|
};
|
|
219
|
-
case '
|
|
219
|
+
case 'error':
|
|
220
220
|
return {
|
|
221
221
|
base: theme.colors.error,
|
|
222
222
|
hover: theme.colors.error,
|
|
223
223
|
pressed: theme.colors.error,
|
|
224
|
-
on: theme.colors.
|
|
224
|
+
on: theme.colors.onError,
|
|
225
225
|
muted: theme.colors.background.secondary
|
|
226
226
|
};
|
|
227
227
|
case 'neutral':
|
|
@@ -36,6 +36,7 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
36
36
|
loading = false,
|
|
37
37
|
gradient,
|
|
38
38
|
onPress,
|
|
39
|
+
haptic,
|
|
39
40
|
accessibilityLabel,
|
|
40
41
|
accessibilityHint,
|
|
41
42
|
accessibilityRole,
|
|
@@ -155,9 +156,8 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
155
156
|
let rendered;
|
|
156
157
|
if (isInteractive) {
|
|
157
158
|
const handlePress = event => {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
159
|
+
const h = (0, _hapticUtils.resolveHaptic)(haptic, 'selection');
|
|
160
|
+
if (h) (0, _hapticUtils.triggerHaptic)(h);
|
|
161
161
|
onPress?.(event);
|
|
162
162
|
};
|
|
163
163
|
rendered = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|