@webority-technologies/mobile 0.0.14 → 0.0.20
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 +60 -19
- package/lib/commonjs/components/AppBar/AppBar.js +29 -20
- package/lib/commonjs/components/Avatar/Avatar.js +38 -8
- package/lib/commonjs/components/Badge/Badge.js +66 -4
- package/lib/commonjs/components/Banner/Banner.js +146 -66
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +37 -15
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +85 -50
- package/lib/commonjs/components/Button/Button.js +12 -5
- package/lib/commonjs/components/Card/Card.js +106 -16
- package/lib/commonjs/components/Carousel/Carousel.js +66 -12
- package/lib/commonjs/components/Checkbox/Checkbox.js +11 -7
- package/lib/commonjs/components/Chip/Chip.js +44 -12
- package/lib/commonjs/components/DatePicker/DatePicker.js +185 -76
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +133 -59
- package/lib/commonjs/components/Dialog/Dialog.js +16 -10
- package/lib/commonjs/components/Drawer/Drawer.js +13 -10
- package/lib/commonjs/components/FieldBase/FieldBase.js +306 -0
- package/lib/commonjs/components/FieldBase/index.js +32 -0
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +69 -44
- package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +8 -2
- package/lib/commonjs/components/FormField/FormField.js +3 -2
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +132 -44
- package/lib/commonjs/components/Input/Input.js +144 -181
- package/lib/commonjs/components/ListItem/ListItem.js +90 -11
- package/lib/commonjs/components/Modal/Modal.js +55 -27
- package/lib/commonjs/components/NumberInput/NumberInput.js +60 -106
- package/lib/commonjs/components/OTPInput/OTPInput.js +65 -58
- package/lib/commonjs/components/PickerTrigger/PickerTrigger.js +185 -0
- package/lib/commonjs/components/{AppIcon → PickerTrigger}/index.js +4 -4
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +19 -11
- package/lib/commonjs/components/Radio/Radio.js +11 -6
- package/lib/commonjs/components/Rating/Rating.js +85 -19
- package/lib/commonjs/components/SearchBar/SearchBar.js +84 -107
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +22 -11
- package/lib/commonjs/components/Select/Select.js +62 -91
- package/lib/commonjs/components/Skeleton/Skeleton.js +131 -174
- package/lib/commonjs/components/Skeleton/SkeletonClock.js +117 -0
- package/lib/commonjs/components/Skeleton/SkeletonContent.js +164 -81
- package/lib/commonjs/components/Skeleton/SkeletonProvider.js +72 -10
- package/lib/commonjs/components/Skeleton/index.js +17 -16
- package/lib/commonjs/components/Slider/Slider.js +44 -25
- package/lib/commonjs/components/Stepper/Stepper.js +199 -29
- package/lib/commonjs/components/Swipeable/Swipeable.js +36 -19
- package/lib/commonjs/components/Switch/Switch.js +9 -2
- package/lib/commonjs/components/Tabs/Tabs.js +84 -21
- package/lib/commonjs/components/TimePicker/TimePicker.js +123 -45
- package/lib/commonjs/components/Toast/Toast.js +27 -16
- package/lib/commonjs/components/Tooltip/Tooltip.js +56 -32
- package/lib/commonjs/components/index.js +37 -37
- package/lib/commonjs/theme/tokens.js +55 -7
- package/lib/module/components/Accordion/Accordion.js +61 -20
- package/lib/module/components/AppBar/AppBar.js +29 -20
- package/lib/module/components/Avatar/Avatar.js +39 -9
- package/lib/module/components/Badge/Badge.js +67 -5
- package/lib/module/components/Banner/Banner.js +147 -67
- package/lib/module/components/BottomNavigation/BottomNavigation.js +37 -15
- package/lib/module/components/BottomSheet/BottomSheet.js +87 -52
- package/lib/module/components/Button/Button.js +12 -5
- package/lib/module/components/Card/Card.js +107 -17
- package/lib/module/components/Carousel/Carousel.js +67 -13
- package/lib/module/components/Checkbox/Checkbox.js +11 -7
- package/lib/module/components/Chip/Chip.js +45 -13
- package/lib/module/components/DatePicker/DatePicker.js +185 -76
- package/lib/module/components/DateRangePicker/DateRangePicker.js +134 -60
- package/lib/module/components/Dialog/Dialog.js +16 -10
- package/lib/module/components/Drawer/Drawer.js +13 -10
- package/lib/module/components/FieldBase/FieldBase.js +297 -0
- package/lib/module/components/FieldBase/index.js +4 -0
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +69 -44
- package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +8 -2
- package/lib/module/components/FormField/FormField.js +3 -2
- package/lib/module/components/ImageGallery/ImageGallery.js +128 -40
- package/lib/module/components/Input/Input.js +144 -179
- package/lib/module/components/ListItem/ListItem.js +91 -12
- package/lib/module/components/Modal/Modal.js +55 -27
- package/lib/module/components/NumberInput/NumberInput.js +60 -106
- package/lib/module/components/OTPInput/OTPInput.js +65 -58
- package/lib/module/components/PickerTrigger/PickerTrigger.js +181 -0
- package/lib/module/components/PickerTrigger/index.js +4 -0
- package/lib/module/components/ProgressBar/ProgressBar.js +19 -11
- package/lib/module/components/Radio/Radio.js +11 -6
- package/lib/module/components/Rating/Rating.js +86 -20
- package/lib/module/components/SearchBar/SearchBar.js +84 -107
- package/lib/module/components/SegmentedControl/SegmentedControl.js +22 -11
- package/lib/module/components/Select/Select.js +62 -91
- package/lib/module/components/Skeleton/Skeleton.js +135 -175
- package/lib/module/components/Skeleton/SkeletonClock.js +110 -0
- package/lib/module/components/Skeleton/SkeletonContent.js +167 -84
- package/lib/module/components/Skeleton/SkeletonProvider.js +71 -10
- package/lib/module/components/Skeleton/index.js +3 -2
- package/lib/module/components/Slider/Slider.js +44 -25
- package/lib/module/components/Stepper/Stepper.js +201 -31
- package/lib/module/components/Swipeable/Swipeable.js +36 -19
- package/lib/module/components/Switch/Switch.js +9 -2
- package/lib/module/components/Tabs/Tabs.js +84 -21
- package/lib/module/components/TimePicker/TimePicker.js +123 -45
- package/lib/module/components/Toast/Toast.js +27 -16
- package/lib/module/components/Tooltip/Tooltip.js +56 -32
- package/lib/module/components/index.js +2 -2
- package/lib/module/theme/tokens.js +55 -7
- package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +10 -5
- package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +8 -0
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +12 -6
- package/lib/typescript/commonjs/components/Badge/Badge.d.ts +7 -6
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +17 -6
- package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +7 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +17 -6
- package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +7 -6
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +9 -1
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +13 -6
- package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +38 -3
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +36 -3
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +13 -1
- package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +141 -0
- package/lib/typescript/commonjs/components/FieldBase/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +8 -6
- package/lib/typescript/commonjs/components/FloatingActionButton/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +7 -0
- package/lib/typescript/commonjs/components/FormField/FormField.d.ts +7 -0
- package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +6 -4
- package/lib/typescript/commonjs/components/Input/Input.d.ts +6 -0
- package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +13 -6
- package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +3 -0
- package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +57 -0
- package/lib/typescript/commonjs/components/PickerTrigger/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +2 -0
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts +3 -0
- package/lib/typescript/commonjs/components/Rating/Rating.d.ts +9 -6
- package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +49 -20
- package/lib/typescript/commonjs/components/Skeleton/SkeletonClock.d.ts +60 -0
- package/lib/typescript/commonjs/components/Skeleton/SkeletonContent.d.ts +80 -19
- package/lib/typescript/commonjs/components/Skeleton/SkeletonProvider.d.ts +39 -5
- package/lib/typescript/commonjs/components/Skeleton/index.d.ts +6 -4
- package/lib/typescript/commonjs/components/Slider/Slider.d.ts +12 -1
- package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +18 -6
- package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +2 -0
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts +1 -0
- package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +26 -2
- package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +36 -3
- package/lib/typescript/commonjs/components/Toast/Toast.d.ts +8 -0
- package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +7 -1
- package/lib/typescript/commonjs/components/index.d.ts +5 -5
- package/lib/typescript/commonjs/index.d.ts +1 -1
- package/lib/typescript/commonjs/theme/index.d.ts +1 -1
- package/lib/typescript/commonjs/theme/types.d.ts +553 -11
- package/lib/typescript/module/components/Accordion/Accordion.d.ts +10 -5
- package/lib/typescript/module/components/AppBar/AppBar.d.ts +8 -0
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +12 -6
- package/lib/typescript/module/components/Badge/Badge.d.ts +7 -6
- package/lib/typescript/module/components/Banner/Banner.d.ts +17 -6
- package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +7 -0
- package/lib/typescript/module/components/Card/Card.d.ts +17 -6
- package/lib/typescript/module/components/Carousel/Carousel.d.ts +7 -6
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +9 -1
- package/lib/typescript/module/components/Chip/Chip.d.ts +13 -6
- package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +38 -3
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +36 -3
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +13 -1
- package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +141 -0
- package/lib/typescript/module/components/FieldBase/index.d.ts +3 -0
- package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +8 -6
- package/lib/typescript/module/components/FloatingActionButton/index.d.ts +1 -1
- package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +7 -0
- package/lib/typescript/module/components/FormField/FormField.d.ts +7 -0
- package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +6 -4
- package/lib/typescript/module/components/Input/Input.d.ts +6 -0
- package/lib/typescript/module/components/ListItem/ListItem.d.ts +13 -6
- package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +3 -0
- package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +57 -0
- package/lib/typescript/module/components/PickerTrigger/index.d.ts +3 -0
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +2 -0
- package/lib/typescript/module/components/Radio/Radio.d.ts +3 -0
- package/lib/typescript/module/components/Rating/Rating.d.ts +9 -6
- package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +49 -20
- package/lib/typescript/module/components/Skeleton/SkeletonClock.d.ts +60 -0
- package/lib/typescript/module/components/Skeleton/SkeletonContent.d.ts +80 -19
- package/lib/typescript/module/components/Skeleton/SkeletonProvider.d.ts +39 -5
- package/lib/typescript/module/components/Skeleton/index.d.ts +6 -4
- package/lib/typescript/module/components/Slider/Slider.d.ts +12 -1
- package/lib/typescript/module/components/Stepper/Stepper.d.ts +18 -6
- package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +2 -0
- package/lib/typescript/module/components/Switch/Switch.d.ts +1 -0
- package/lib/typescript/module/components/Tabs/Tabs.d.ts +26 -2
- package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +36 -3
- package/lib/typescript/module/components/Toast/Toast.d.ts +8 -0
- package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +7 -1
- package/lib/typescript/module/components/index.d.ts +5 -5
- package/lib/typescript/module/index.d.ts +1 -1
- package/lib/typescript/module/theme/index.d.ts +1 -1
- package/lib/typescript/module/theme/types.d.ts +553 -11
- package/package.json +2 -6
- package/lib/commonjs/components/AppIcon/AppIcon.js +0 -120
- package/lib/commonjs/types/vector-icons.d.js +0 -2
- package/lib/module/components/AppIcon/AppIcon.js +0 -111
- package/lib/module/components/AppIcon/index.js +0 -4
- package/lib/module/types/vector-icons.d.js +0 -2
- package/lib/typescript/commonjs/components/AppIcon/AppIcon.d.ts +0 -20
- package/lib/typescript/commonjs/components/AppIcon/index.d.ts +0 -3
- package/lib/typescript/module/components/AppIcon/AppIcon.d.ts +0 -20
- package/lib/typescript/module/components/AppIcon/index.d.ts +0 -3
|
@@ -235,41 +235,48 @@ const toneFor = (theme, tone) => {
|
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
237
|
};
|
|
238
|
+
// Every variant carries the SAME borderWidth (with a transparent colour on
|
|
239
|
+
// the non-outline ones). RN's layout treats border as part of the outer box,
|
|
240
|
+
// so a 1-px border on outline-only would make outline buttons 2 px wider /
|
|
241
|
+
// taller than solid / ghost buttons of identical content. Painting a
|
|
242
|
+
// transparent border on the others equalises the geometry without visible
|
|
243
|
+
// effect. Match the value with `BUTTON_BORDER_WIDTH` everywhere.
|
|
244
|
+
const BUTTON_BORDER_WIDTH = 1;
|
|
238
245
|
const variantFor = (theme, variant, toneSet, disabled) => {
|
|
239
246
|
switch (variant) {
|
|
240
247
|
case 'solid':
|
|
241
248
|
return {
|
|
242
249
|
backgroundColor: disabled ? theme.colors.surface.disabled : toneSet.base,
|
|
243
250
|
borderColor: 'transparent',
|
|
244
|
-
borderWidth:
|
|
251
|
+
borderWidth: BUTTON_BORDER_WIDTH,
|
|
245
252
|
textColor: disabled ? theme.colors.text.disabled : toneSet.on
|
|
246
253
|
};
|
|
247
254
|
case 'outline':
|
|
248
255
|
return {
|
|
249
256
|
backgroundColor: 'transparent',
|
|
250
257
|
borderColor: disabled ? theme.colors.border.primary : toneSet.base,
|
|
251
|
-
borderWidth:
|
|
258
|
+
borderWidth: BUTTON_BORDER_WIDTH,
|
|
252
259
|
textColor: disabled ? theme.colors.text.disabled : toneSet.base
|
|
253
260
|
};
|
|
254
261
|
case 'ghost':
|
|
255
262
|
return {
|
|
256
263
|
backgroundColor: 'transparent',
|
|
257
264
|
borderColor: 'transparent',
|
|
258
|
-
borderWidth:
|
|
265
|
+
borderWidth: BUTTON_BORDER_WIDTH,
|
|
259
266
|
textColor: disabled ? theme.colors.text.disabled : toneSet.base
|
|
260
267
|
};
|
|
261
268
|
case 'link':
|
|
262
269
|
return {
|
|
263
270
|
backgroundColor: 'transparent',
|
|
264
271
|
borderColor: 'transparent',
|
|
265
|
-
borderWidth:
|
|
272
|
+
borderWidth: BUTTON_BORDER_WIDTH,
|
|
266
273
|
textColor: disabled ? theme.colors.text.disabled : theme.colors.text.link
|
|
267
274
|
};
|
|
268
275
|
default:
|
|
269
276
|
return {
|
|
270
277
|
backgroundColor: toneSet.base,
|
|
271
278
|
borderColor: 'transparent',
|
|
272
|
-
borderWidth:
|
|
279
|
+
borderWidth: BUTTON_BORDER_WIDTH,
|
|
273
280
|
textColor: toneSet.on
|
|
274
281
|
};
|
|
275
282
|
}
|
|
@@ -40,6 +40,11 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
40
40
|
accessibilityHint,
|
|
41
41
|
accessibilityRole,
|
|
42
42
|
style,
|
|
43
|
+
containerStyle,
|
|
44
|
+
headerStyle,
|
|
45
|
+
bodyStyle,
|
|
46
|
+
footerStyle,
|
|
47
|
+
borderRadius,
|
|
43
48
|
testID,
|
|
44
49
|
...rest
|
|
45
50
|
} = props;
|
|
@@ -60,9 +65,10 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
60
65
|
if (typeof gradient === 'string') return theme.gradients[gradient] ?? null;
|
|
61
66
|
return gradient;
|
|
62
67
|
}, [gradient, theme.gradients]);
|
|
63
|
-
const
|
|
68
|
+
const resolvedBorderRadius = borderRadius ?? theme.radius[radius];
|
|
69
|
+
const computedContainerStyle = (0, _react.useMemo)(() => {
|
|
64
70
|
const base = {
|
|
65
|
-
borderRadius:
|
|
71
|
+
borderRadius: resolvedBorderRadius,
|
|
66
72
|
// When an image header is present we move padding to the inner content
|
|
67
73
|
// wrapper so the image can occupy the card's full top edge.
|
|
68
74
|
padding: hasImage ? 0 : contentPadding,
|
|
@@ -73,7 +79,7 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
73
79
|
return {
|
|
74
80
|
...base,
|
|
75
81
|
backgroundColor: theme.colors.background.elevated,
|
|
76
|
-
borderWidth:
|
|
82
|
+
borderWidth: theme.colors.border.width,
|
|
77
83
|
borderColor: theme.colors.border.primary
|
|
78
84
|
};
|
|
79
85
|
case 'filled':
|
|
@@ -89,9 +95,9 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
89
95
|
...theme.shadows[elevation]
|
|
90
96
|
};
|
|
91
97
|
}
|
|
92
|
-
}, [theme, variant, elevation,
|
|
98
|
+
}, [theme, variant, elevation, resolvedBorderRadius, padding, hasImage, contentPadding]);
|
|
93
99
|
const imageStyle = (0, _react.useMemo)(() => {
|
|
94
|
-
const topRadius =
|
|
100
|
+
const topRadius = resolvedBorderRadius;
|
|
95
101
|
const dimensions = typeof imageAspectRatio === 'number' ? {
|
|
96
102
|
width: '100%',
|
|
97
103
|
aspectRatio: imageAspectRatio
|
|
@@ -106,16 +112,16 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
106
112
|
borderBottomLeftRadius: 0,
|
|
107
113
|
borderBottomRightRadius: 0
|
|
108
114
|
};
|
|
109
|
-
}, [
|
|
115
|
+
}, [resolvedBorderRadius, imageAspectRatio, imageHeight]);
|
|
110
116
|
const innerContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
111
117
|
children: [header ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
112
|
-
style: styles.header,
|
|
118
|
+
style: [styles.header, headerStyle],
|
|
113
119
|
children: header
|
|
114
120
|
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
115
|
-
style: header || footer ? styles.body : null,
|
|
121
|
+
style: [header || footer ? styles.body : null, bodyStyle],
|
|
116
122
|
children: children
|
|
117
123
|
}), footer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
118
|
-
style: styles.footer,
|
|
124
|
+
style: [styles.footer, footerStyle],
|
|
119
125
|
children: footer
|
|
120
126
|
}) : null]
|
|
121
127
|
});
|
|
@@ -149,7 +155,9 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
149
155
|
let rendered;
|
|
150
156
|
if (isInteractive) {
|
|
151
157
|
const handlePress = event => {
|
|
152
|
-
(
|
|
158
|
+
if (theme.components.card?.pressHaptic ?? false) {
|
|
159
|
+
(0, _hapticUtils.triggerHaptic)('selection');
|
|
160
|
+
}
|
|
153
161
|
onPress?.(event);
|
|
154
162
|
};
|
|
155
163
|
rendered = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
@@ -171,7 +179,7 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
171
179
|
accessibilityLabel: accessibilityLabel,
|
|
172
180
|
accessibilityHint: accessibilityHint,
|
|
173
181
|
testID: testID,
|
|
174
|
-
style: [
|
|
182
|
+
style: [computedContainerStyle, style, containerStyle],
|
|
175
183
|
...rest,
|
|
176
184
|
children: content
|
|
177
185
|
})
|
|
@@ -183,20 +191,102 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
183
191
|
accessibilityHint: accessibilityHint,
|
|
184
192
|
accessibilityRole: accessibilityRole,
|
|
185
193
|
testID: testID,
|
|
186
|
-
style: [
|
|
194
|
+
style: [computedContainerStyle, style, containerStyle],
|
|
187
195
|
children: content
|
|
188
196
|
});
|
|
189
197
|
}
|
|
190
198
|
if (loading) {
|
|
191
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
192
|
-
|
|
193
|
-
mode: "auto",
|
|
194
|
-
children: rendered
|
|
199
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardSkeleton, {
|
|
200
|
+
...props
|
|
195
201
|
});
|
|
196
202
|
}
|
|
197
203
|
return rendered;
|
|
198
204
|
});
|
|
199
205
|
Card.displayName = 'Card';
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Placeholder shape for `<Card>`. Preserves outer chrome (variant, radius,
|
|
209
|
+
* padding, image area) and fills the interior with header / body / footer
|
|
210
|
+
* skeletons proportional to whichever slots the consumer actually uses.
|
|
211
|
+
*/
|
|
212
|
+
const CardSkeleton = ({
|
|
213
|
+
variant = 'elevated',
|
|
214
|
+
elevation: _elevation,
|
|
215
|
+
radius = 'lg',
|
|
216
|
+
padding = 'md',
|
|
217
|
+
header,
|
|
218
|
+
footer,
|
|
219
|
+
imageSource,
|
|
220
|
+
imageHeight = 160,
|
|
221
|
+
imageAspectRatio,
|
|
222
|
+
borderRadius,
|
|
223
|
+
containerStyle,
|
|
224
|
+
headerStyle,
|
|
225
|
+
bodyStyle,
|
|
226
|
+
footerStyle,
|
|
227
|
+
style
|
|
228
|
+
}) => {
|
|
229
|
+
const theme = (0, _index.useTheme)();
|
|
230
|
+
const padToken = paddingMap[padding];
|
|
231
|
+
const padValue = theme.spacing[padToken];
|
|
232
|
+
const cornerRadius = borderRadius ?? theme.radius[radius];
|
|
233
|
+
const backgroundColor = variant === 'outlined' || variant === 'filled' ? theme.colors.background.elevated : theme.colors.background.elevated;
|
|
234
|
+
const borderWidth = variant === 'outlined' ? 1 : 0;
|
|
235
|
+
const borderColor = variant === 'outlined' ? theme.colors.border.primary : undefined;
|
|
236
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
237
|
+
style: [{
|
|
238
|
+
backgroundColor,
|
|
239
|
+
borderRadius: cornerRadius,
|
|
240
|
+
borderWidth,
|
|
241
|
+
borderColor,
|
|
242
|
+
overflow: 'hidden'
|
|
243
|
+
}, containerStyle, style],
|
|
244
|
+
accessibilityRole: "progressbar",
|
|
245
|
+
accessibilityState: {
|
|
246
|
+
busy: true
|
|
247
|
+
},
|
|
248
|
+
children: [imageSource !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Skeleton, {
|
|
249
|
+
width: "100%",
|
|
250
|
+
height: imageAspectRatio ? undefined : imageHeight,
|
|
251
|
+
style: imageAspectRatio ? {
|
|
252
|
+
aspectRatio: imageAspectRatio,
|
|
253
|
+
width: '100%'
|
|
254
|
+
} : undefined
|
|
255
|
+
}) : null, header !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
256
|
+
style: [{
|
|
257
|
+
padding: padValue,
|
|
258
|
+
paddingBottom: theme.spacing.sm
|
|
259
|
+
}, headerStyle],
|
|
260
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Skeleton, {
|
|
261
|
+
shape: "text",
|
|
262
|
+
width: "60%",
|
|
263
|
+
height: 18
|
|
264
|
+
})
|
|
265
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
266
|
+
style: [{
|
|
267
|
+
padding: padValue
|
|
268
|
+
}, bodyStyle],
|
|
269
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.SkeletonText, {
|
|
270
|
+
lines: 3,
|
|
271
|
+
fontSize: 14,
|
|
272
|
+
lastLineWidth: "55%"
|
|
273
|
+
})
|
|
274
|
+
}), footer !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
275
|
+
style: [{
|
|
276
|
+
padding: padValue,
|
|
277
|
+
paddingTop: theme.spacing.sm,
|
|
278
|
+
flexDirection: 'row'
|
|
279
|
+
}, footerStyle],
|
|
280
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Skeleton, {
|
|
281
|
+
width: 88,
|
|
282
|
+
height: 32,
|
|
283
|
+
shape: "rounded"
|
|
284
|
+
})
|
|
285
|
+
}) : null]
|
|
286
|
+
});
|
|
287
|
+
};
|
|
288
|
+
CardSkeleton.displayName = 'CardSkeleton';
|
|
289
|
+
Card.Skeleton = CardSkeleton;
|
|
200
290
|
const buildStyles = theme => _reactNative.StyleSheet.create({
|
|
201
291
|
header: {
|
|
202
292
|
marginBottom: theme.spacing.md
|
|
@@ -218,18 +218,9 @@ const CarouselInner = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
218
218
|
index: i
|
|
219
219
|
}), [slideStride]);
|
|
220
220
|
if (loading) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
mode: "auto",
|
|
225
|
-
style: [styles.container, containerStyle],
|
|
226
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
227
|
-
style: {
|
|
228
|
-
width: slideWidth,
|
|
229
|
-
height: 160,
|
|
230
|
-
borderRadius: 12
|
|
231
|
-
}
|
|
232
|
-
})
|
|
221
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CarouselSkeleton, {
|
|
222
|
+
...props,
|
|
223
|
+
containerWidth: containerWidth
|
|
233
224
|
});
|
|
234
225
|
}
|
|
235
226
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
@@ -290,8 +281,71 @@ const CarouselInner = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
290
281
|
});
|
|
291
282
|
CarouselInner.displayName = 'Carousel';
|
|
292
283
|
|
|
284
|
+
/**
|
|
285
|
+
* Placeholder shape for `<Carousel>`. Renders one full-width slide skeleton
|
|
286
|
+
* plus pagination dots underneath, so the visual footprint matches the
|
|
287
|
+
* loaded state. `containerWidth` is forwarded from the live component when
|
|
288
|
+
* known; otherwise falls back to a 320 default.
|
|
289
|
+
*/
|
|
290
|
+
const CarouselSkeleton = ({
|
|
291
|
+
itemWidth = 'screen',
|
|
292
|
+
showPagination = true,
|
|
293
|
+
paginationStyle = 'dots',
|
|
294
|
+
containerStyle,
|
|
295
|
+
containerWidth
|
|
296
|
+
}) => {
|
|
297
|
+
const slideWidth = itemWidth === 'screen' ? containerWidth || 320 : itemWidth;
|
|
298
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
299
|
+
style: [carouselSkeletonStyles.container, containerStyle],
|
|
300
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Skeleton, {
|
|
301
|
+
width: slideWidth,
|
|
302
|
+
height: 160,
|
|
303
|
+
radius: "md"
|
|
304
|
+
}), showPagination ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
305
|
+
style: [carouselSkeletonStyles.paginationRow, {
|
|
306
|
+
marginTop: 12
|
|
307
|
+
}],
|
|
308
|
+
children: Array.from({
|
|
309
|
+
length: 3
|
|
310
|
+
}).map((_, i) => paginationStyle === 'numbers' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Skeleton, {
|
|
311
|
+
width: 24,
|
|
312
|
+
height: 16,
|
|
313
|
+
radius: "sm",
|
|
314
|
+
style: {
|
|
315
|
+
marginHorizontal: 4
|
|
316
|
+
}
|
|
317
|
+
}, `sk-pg-${i}`) : paginationStyle === 'bars' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Skeleton, {
|
|
318
|
+
width: 20,
|
|
319
|
+
height: 4,
|
|
320
|
+
radius: 2,
|
|
321
|
+
style: {
|
|
322
|
+
marginHorizontal: 3
|
|
323
|
+
}
|
|
324
|
+
}, `sk-pg-${i}`) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Skeleton, {
|
|
325
|
+
shape: "circle",
|
|
326
|
+
width: 8,
|
|
327
|
+
height: 8,
|
|
328
|
+
style: {
|
|
329
|
+
marginHorizontal: 4
|
|
330
|
+
}
|
|
331
|
+
}, `sk-pg-${i}`))
|
|
332
|
+
}) : null]
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
CarouselSkeleton.displayName = 'CarouselSkeleton';
|
|
336
|
+
const carouselSkeletonStyles = _reactNative.StyleSheet.create({
|
|
337
|
+
container: {
|
|
338
|
+
alignItems: 'center'
|
|
339
|
+
},
|
|
340
|
+
paginationRow: {
|
|
341
|
+
flexDirection: 'row',
|
|
342
|
+
justifyContent: 'center'
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
|
|
293
346
|
// Public typed factory — preserves the generic signature.
|
|
294
347
|
const Carousel = exports.Carousel = CarouselInner;
|
|
348
|
+
Carousel.Skeleton = CarouselSkeleton;
|
|
295
349
|
|
|
296
350
|
// ───────── Pagination ─────────
|
|
297
351
|
|
|
@@ -41,13 +41,17 @@ const Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)((props,
|
|
|
41
41
|
haptic = 'selection',
|
|
42
42
|
style,
|
|
43
43
|
boxStyle,
|
|
44
|
+
checkIconStyle,
|
|
45
|
+
indeterminateBarStyle,
|
|
46
|
+
containerStyle,
|
|
47
|
+
labelStyle,
|
|
44
48
|
testID,
|
|
45
49
|
...rest
|
|
46
50
|
} = props;
|
|
47
51
|
const theme = (0, _index.useTheme)();
|
|
48
52
|
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
49
53
|
const boxSize = theme.components.checkbox?.[size]?.boxSize ?? sizeMap[size];
|
|
50
|
-
const checkboxBorderWidth = theme.
|
|
54
|
+
const checkboxBorderWidth = theme.colors.border.width;
|
|
51
55
|
const checkboxLabelGap = theme.components.checkbox?.labelGap ?? 10;
|
|
52
56
|
const fillColor = toneColor(theme, tone);
|
|
53
57
|
const isActive = checked || indeterminate;
|
|
@@ -67,7 +71,7 @@ const Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)((props,
|
|
|
67
71
|
});
|
|
68
72
|
const handlePress = event => {
|
|
69
73
|
if (disabled) return;
|
|
70
|
-
if (haptic !== false) (0, _hapticUtils.triggerHaptic)(haptic);
|
|
74
|
+
if (haptic !== false && theme.components.checkbox?.pressHaptic) (0, _hapticUtils.triggerHaptic)(haptic);
|
|
71
75
|
onChange(!checked);
|
|
72
76
|
rest.onPressOut?.(event);
|
|
73
77
|
};
|
|
@@ -95,7 +99,7 @@ const Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)((props,
|
|
|
95
99
|
pressed
|
|
96
100
|
}) => [styles.row, {
|
|
97
101
|
opacity: disabled ? 0.55 : pressed ? 0.85 : 1
|
|
98
|
-
}, style],
|
|
102
|
+
}, containerStyle, style],
|
|
99
103
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
100
104
|
style: [styles.box, {
|
|
101
105
|
width: boxSize,
|
|
@@ -113,18 +117,18 @@ const Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)((props,
|
|
|
113
117
|
}]
|
|
114
118
|
}],
|
|
115
119
|
children: indeterminate ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
116
|
-
style: {
|
|
120
|
+
style: [{
|
|
117
121
|
width: indeterminateBarWidth,
|
|
118
122
|
height: indeterminateBarHeight,
|
|
119
123
|
borderRadius: indeterminateBarHeight / 2,
|
|
120
124
|
backgroundColor: glyphColor
|
|
121
|
-
}
|
|
125
|
+
}, indeterminateBarStyle]
|
|
122
126
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
123
127
|
style: [styles.check, {
|
|
124
128
|
color: glyphColor,
|
|
125
129
|
fontSize: glyphFontSize,
|
|
126
130
|
lineHeight: glyphFontSize + 2
|
|
127
|
-
}],
|
|
131
|
+
}, checkIconStyle],
|
|
128
132
|
allowFontScaling: false,
|
|
129
133
|
children: '✓'
|
|
130
134
|
})
|
|
@@ -134,7 +138,7 @@ const Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)((props,
|
|
|
134
138
|
marginLeft: checkboxLabelGap,
|
|
135
139
|
color: disabled ? theme.colors.text.disabled : theme.colors.text.primary,
|
|
136
140
|
fontSize: theme.typography.fontSize.base
|
|
137
|
-
}],
|
|
141
|
+
}, labelStyle],
|
|
138
142
|
numberOfLines: 2,
|
|
139
143
|
children: label
|
|
140
144
|
}) : null]
|
|
@@ -106,6 +106,9 @@ const Chip = exports.Chip = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
106
106
|
accessibilityLabel,
|
|
107
107
|
style,
|
|
108
108
|
textStyle,
|
|
109
|
+
containerStyle,
|
|
110
|
+
closeButtonStyle,
|
|
111
|
+
closeIconStyle,
|
|
109
112
|
testID
|
|
110
113
|
} = props;
|
|
111
114
|
const theme = (0, _index.useTheme)();
|
|
@@ -144,15 +147,15 @@ const Chip = exports.Chip = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
144
147
|
if (selected) return tones.selectedOn;
|
|
145
148
|
return tones.on;
|
|
146
149
|
})();
|
|
147
|
-
const borderWidth = isFilled ?
|
|
150
|
+
const borderWidth = isFilled ? 0 : theme.colors.border.width;
|
|
148
151
|
const handlePress = () => {
|
|
149
152
|
if (!isPressable) return;
|
|
150
|
-
(0, _hapticUtils.triggerHaptic)('selection');
|
|
153
|
+
if (theme.components.chip?.pressHaptic) (0, _hapticUtils.triggerHaptic)('selection');
|
|
151
154
|
onPress?.();
|
|
152
155
|
};
|
|
153
156
|
const handleClose = () => {
|
|
154
157
|
if (disabled) return;
|
|
155
|
-
(0, _hapticUtils.triggerHaptic)('impactLight');
|
|
158
|
+
if (theme.components.chip?.closeHaptic) (0, _hapticUtils.triggerHaptic)('impactLight');
|
|
156
159
|
onClose?.();
|
|
157
160
|
};
|
|
158
161
|
const a11yLabel = accessibilityLabel ?? label;
|
|
@@ -188,14 +191,14 @@ const Chip = exports.Chip = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
188
191
|
borderRadius: sz.closeSize / 2,
|
|
189
192
|
marginLeft: sz.gap,
|
|
190
193
|
backgroundColor: pressed ? theme.colors.surface.pressed : theme.colors.surface.hovered
|
|
191
|
-
}],
|
|
194
|
+
}, closeButtonStyle],
|
|
192
195
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
193
|
-
style: {
|
|
196
|
+
style: [{
|
|
194
197
|
color: textColor,
|
|
195
198
|
fontSize: sz.closeFont,
|
|
196
199
|
...(0, _index.fontFor)(theme, 'bold'),
|
|
197
200
|
lineHeight: sz.closeFont + 2
|
|
198
|
-
},
|
|
201
|
+
}, closeIconStyle],
|
|
199
202
|
allowFontScaling: false,
|
|
200
203
|
children: '×'
|
|
201
204
|
})
|
|
@@ -241,14 +244,14 @@ const Chip = exports.Chip = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
241
244
|
pressed
|
|
242
245
|
}) => [styles.base, baseStyle, pressed && !isFilled ? {
|
|
243
246
|
backgroundColor: theme.colors.surface.pressed
|
|
244
|
-
} : null, style],
|
|
247
|
+
} : null, containerStyle, style],
|
|
245
248
|
children: content
|
|
246
249
|
})
|
|
247
250
|
});
|
|
248
251
|
} else {
|
|
249
252
|
rendered = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
250
253
|
ref: ref,
|
|
251
|
-
style: [styles.base, baseStyle, style],
|
|
254
|
+
style: [styles.base, baseStyle, containerStyle, style],
|
|
252
255
|
accessible: true,
|
|
253
256
|
accessibilityRole: "text",
|
|
254
257
|
accessibilityLabel: a11yLabel,
|
|
@@ -261,15 +264,44 @@ const Chip = exports.Chip = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
261
264
|
});
|
|
262
265
|
}
|
|
263
266
|
if (loading) {
|
|
264
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
265
|
-
|
|
266
|
-
mode: "auto",
|
|
267
|
-
children: rendered
|
|
267
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ChipSkeleton, {
|
|
268
|
+
...props
|
|
268
269
|
});
|
|
269
270
|
}
|
|
270
271
|
return rendered;
|
|
271
272
|
});
|
|
272
273
|
Chip.displayName = 'Chip';
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Placeholder shape for `<Chip>`. Pill of the configured size with a label
|
|
277
|
+
* skeleton inside; leading icon and close button are reserved when the
|
|
278
|
+
* consumer would normally provide them, so the chip width matches what it
|
|
279
|
+
* would be when loaded.
|
|
280
|
+
*/
|
|
281
|
+
const ChipSkeleton = ({
|
|
282
|
+
label,
|
|
283
|
+
size = 'md',
|
|
284
|
+
leftIcon,
|
|
285
|
+
onClose,
|
|
286
|
+
style,
|
|
287
|
+
containerStyle
|
|
288
|
+
}) => {
|
|
289
|
+
const sz = sizeMap[size];
|
|
290
|
+
const labelWidth = Math.max(40, Math.min(120, (label ?? '').length * 7));
|
|
291
|
+
const pillHeight = sz.minHeight;
|
|
292
|
+
const pillRadius = pillHeight / 2;
|
|
293
|
+
const totalWidth = labelWidth + sz.paddingH * 2 + (leftIcon !== undefined ? sz.gap + 14 : 0) + (onClose !== undefined ? sz.gap + sz.closeSize : 0);
|
|
294
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Skeleton, {
|
|
295
|
+
width: totalWidth,
|
|
296
|
+
height: pillHeight,
|
|
297
|
+
radius: pillRadius,
|
|
298
|
+
style: [{
|
|
299
|
+
alignSelf: 'flex-start'
|
|
300
|
+
}, containerStyle, style]
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
ChipSkeleton.displayName = 'ChipSkeleton';
|
|
304
|
+
Chip.Skeleton = ChipSkeleton;
|
|
273
305
|
const styles = _reactNative.StyleSheet.create({
|
|
274
306
|
base: {
|
|
275
307
|
alignSelf: 'flex-start',
|