@webority-technologies/mobile 0.0.15 → 0.0.21

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.
Files changed (202) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.js +60 -19
  2. package/lib/commonjs/components/AppBar/AppBar.js +29 -20
  3. package/lib/commonjs/components/Avatar/Avatar.js +38 -8
  4. package/lib/commonjs/components/Badge/Badge.js +66 -4
  5. package/lib/commonjs/components/Banner/Banner.js +146 -66
  6. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +37 -15
  7. package/lib/commonjs/components/BottomSheet/BottomSheet.js +78 -53
  8. package/lib/commonjs/components/Button/Button.js +12 -5
  9. package/lib/commonjs/components/Card/Card.js +106 -16
  10. package/lib/commonjs/components/Carousel/Carousel.js +66 -12
  11. package/lib/commonjs/components/Checkbox/Checkbox.js +11 -7
  12. package/lib/commonjs/components/Chip/Chip.js +44 -12
  13. package/lib/commonjs/components/DatePicker/DatePicker.js +185 -76
  14. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +133 -59
  15. package/lib/commonjs/components/Dialog/Dialog.js +16 -10
  16. package/lib/commonjs/components/Drawer/Drawer.js +13 -10
  17. package/lib/commonjs/components/FieldBase/FieldBase.js +494 -0
  18. package/lib/commonjs/components/FieldBase/index.js +32 -0
  19. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +69 -44
  20. package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +8 -2
  21. package/lib/commonjs/components/FormField/FormField.js +3 -2
  22. package/lib/commonjs/components/ImageGallery/ImageGallery.js +132 -44
  23. package/lib/commonjs/components/Input/Input.js +144 -181
  24. package/lib/commonjs/components/ListItem/ListItem.js +90 -11
  25. package/lib/commonjs/components/Modal/Modal.js +55 -27
  26. package/lib/commonjs/components/NumberInput/NumberInput.js +60 -106
  27. package/lib/commonjs/components/OTPInput/OTPInput.js +65 -58
  28. package/lib/commonjs/components/PickerTrigger/PickerTrigger.js +185 -0
  29. package/lib/commonjs/components/{AppIcon → PickerTrigger}/index.js +4 -4
  30. package/lib/commonjs/components/ProgressBar/ProgressBar.js +19 -11
  31. package/lib/commonjs/components/Radio/Radio.js +11 -6
  32. package/lib/commonjs/components/Rating/Rating.js +85 -19
  33. package/lib/commonjs/components/SearchBar/SearchBar.js +90 -107
  34. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +22 -11
  35. package/lib/commonjs/components/Select/Select.js +62 -91
  36. package/lib/commonjs/components/Skeleton/Skeleton.js +131 -174
  37. package/lib/commonjs/components/Skeleton/SkeletonClock.js +117 -0
  38. package/lib/commonjs/components/Skeleton/SkeletonContent.js +164 -81
  39. package/lib/commonjs/components/Skeleton/SkeletonProvider.js +72 -10
  40. package/lib/commonjs/components/Skeleton/index.js +17 -16
  41. package/lib/commonjs/components/Slider/Slider.js +44 -25
  42. package/lib/commonjs/components/Stepper/Stepper.js +199 -29
  43. package/lib/commonjs/components/Swipeable/Swipeable.js +36 -19
  44. package/lib/commonjs/components/Switch/Switch.js +9 -2
  45. package/lib/commonjs/components/Tabs/Tabs.js +84 -21
  46. package/lib/commonjs/components/TimePicker/TimePicker.js +123 -45
  47. package/lib/commonjs/components/Toast/Toast.js +27 -16
  48. package/lib/commonjs/components/Tooltip/Tooltip.js +56 -32
  49. package/lib/commonjs/components/index.js +37 -37
  50. package/lib/commonjs/theme/tokens.js +55 -7
  51. package/lib/module/components/Accordion/Accordion.js +61 -20
  52. package/lib/module/components/AppBar/AppBar.js +29 -20
  53. package/lib/module/components/Avatar/Avatar.js +39 -9
  54. package/lib/module/components/Badge/Badge.js +67 -5
  55. package/lib/module/components/Banner/Banner.js +147 -67
  56. package/lib/module/components/BottomNavigation/BottomNavigation.js +37 -15
  57. package/lib/module/components/BottomSheet/BottomSheet.js +80 -55
  58. package/lib/module/components/Button/Button.js +12 -5
  59. package/lib/module/components/Card/Card.js +107 -17
  60. package/lib/module/components/Carousel/Carousel.js +67 -13
  61. package/lib/module/components/Checkbox/Checkbox.js +11 -7
  62. package/lib/module/components/Chip/Chip.js +45 -13
  63. package/lib/module/components/DatePicker/DatePicker.js +185 -76
  64. package/lib/module/components/DateRangePicker/DateRangePicker.js +134 -60
  65. package/lib/module/components/Dialog/Dialog.js +16 -10
  66. package/lib/module/components/Drawer/Drawer.js +13 -10
  67. package/lib/module/components/FieldBase/FieldBase.js +485 -0
  68. package/lib/module/components/FieldBase/index.js +4 -0
  69. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +69 -44
  70. package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +8 -2
  71. package/lib/module/components/FormField/FormField.js +3 -2
  72. package/lib/module/components/ImageGallery/ImageGallery.js +128 -40
  73. package/lib/module/components/Input/Input.js +144 -179
  74. package/lib/module/components/ListItem/ListItem.js +91 -12
  75. package/lib/module/components/Modal/Modal.js +55 -27
  76. package/lib/module/components/NumberInput/NumberInput.js +60 -106
  77. package/lib/module/components/OTPInput/OTPInput.js +65 -58
  78. package/lib/module/components/PickerTrigger/PickerTrigger.js +181 -0
  79. package/lib/module/components/PickerTrigger/index.js +4 -0
  80. package/lib/module/components/ProgressBar/ProgressBar.js +19 -11
  81. package/lib/module/components/Radio/Radio.js +11 -6
  82. package/lib/module/components/Rating/Rating.js +86 -20
  83. package/lib/module/components/SearchBar/SearchBar.js +90 -107
  84. package/lib/module/components/SegmentedControl/SegmentedControl.js +22 -11
  85. package/lib/module/components/Select/Select.js +62 -91
  86. package/lib/module/components/Skeleton/Skeleton.js +135 -175
  87. package/lib/module/components/Skeleton/SkeletonClock.js +110 -0
  88. package/lib/module/components/Skeleton/SkeletonContent.js +167 -84
  89. package/lib/module/components/Skeleton/SkeletonProvider.js +71 -10
  90. package/lib/module/components/Skeleton/index.js +3 -2
  91. package/lib/module/components/Slider/Slider.js +44 -25
  92. package/lib/module/components/Stepper/Stepper.js +201 -31
  93. package/lib/module/components/Swipeable/Swipeable.js +36 -19
  94. package/lib/module/components/Switch/Switch.js +9 -2
  95. package/lib/module/components/Tabs/Tabs.js +84 -21
  96. package/lib/module/components/TimePicker/TimePicker.js +123 -45
  97. package/lib/module/components/Toast/Toast.js +27 -16
  98. package/lib/module/components/Tooltip/Tooltip.js +56 -32
  99. package/lib/module/components/index.js +2 -2
  100. package/lib/module/theme/tokens.js +55 -7
  101. package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +10 -5
  102. package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +8 -0
  103. package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +12 -6
  104. package/lib/typescript/commonjs/components/Badge/Badge.d.ts +7 -6
  105. package/lib/typescript/commonjs/components/Banner/Banner.d.ts +17 -6
  106. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +7 -0
  107. package/lib/typescript/commonjs/components/Card/Card.d.ts +17 -6
  108. package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +7 -6
  109. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +9 -1
  110. package/lib/typescript/commonjs/components/Chip/Chip.d.ts +13 -6
  111. package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +38 -3
  112. package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +36 -3
  113. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +13 -1
  114. package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +172 -0
  115. package/lib/typescript/commonjs/components/FieldBase/index.d.ts +3 -0
  116. package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +8 -6
  117. package/lib/typescript/commonjs/components/FloatingActionButton/index.d.ts +1 -1
  118. package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +7 -0
  119. package/lib/typescript/commonjs/components/FormField/FormField.d.ts +7 -0
  120. package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +6 -4
  121. package/lib/typescript/commonjs/components/Input/Input.d.ts +7 -1
  122. package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +13 -6
  123. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +3 -0
  124. package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +57 -0
  125. package/lib/typescript/commonjs/components/PickerTrigger/index.d.ts +3 -0
  126. package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +2 -0
  127. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +3 -0
  128. package/lib/typescript/commonjs/components/Rating/Rating.d.ts +9 -6
  129. package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  130. package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +49 -20
  131. package/lib/typescript/commonjs/components/Skeleton/SkeletonClock.d.ts +60 -0
  132. package/lib/typescript/commonjs/components/Skeleton/SkeletonContent.d.ts +80 -19
  133. package/lib/typescript/commonjs/components/Skeleton/SkeletonProvider.d.ts +39 -5
  134. package/lib/typescript/commonjs/components/Skeleton/index.d.ts +6 -4
  135. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +12 -1
  136. package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +18 -6
  137. package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +2 -0
  138. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +1 -0
  139. package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +26 -2
  140. package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +36 -3
  141. package/lib/typescript/commonjs/components/Toast/Toast.d.ts +8 -0
  142. package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +7 -1
  143. package/lib/typescript/commonjs/components/index.d.ts +5 -5
  144. package/lib/typescript/commonjs/index.d.ts +1 -1
  145. package/lib/typescript/commonjs/theme/index.d.ts +1 -1
  146. package/lib/typescript/commonjs/theme/types.d.ts +578 -12
  147. package/lib/typescript/module/components/Accordion/Accordion.d.ts +10 -5
  148. package/lib/typescript/module/components/AppBar/AppBar.d.ts +8 -0
  149. package/lib/typescript/module/components/Avatar/Avatar.d.ts +12 -6
  150. package/lib/typescript/module/components/Badge/Badge.d.ts +7 -6
  151. package/lib/typescript/module/components/Banner/Banner.d.ts +17 -6
  152. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +7 -0
  153. package/lib/typescript/module/components/Card/Card.d.ts +17 -6
  154. package/lib/typescript/module/components/Carousel/Carousel.d.ts +7 -6
  155. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +9 -1
  156. package/lib/typescript/module/components/Chip/Chip.d.ts +13 -6
  157. package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +38 -3
  158. package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +36 -3
  159. package/lib/typescript/module/components/Dialog/Dialog.d.ts +13 -1
  160. package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +172 -0
  161. package/lib/typescript/module/components/FieldBase/index.d.ts +3 -0
  162. package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +8 -6
  163. package/lib/typescript/module/components/FloatingActionButton/index.d.ts +1 -1
  164. package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +7 -0
  165. package/lib/typescript/module/components/FormField/FormField.d.ts +7 -0
  166. package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +6 -4
  167. package/lib/typescript/module/components/Input/Input.d.ts +7 -1
  168. package/lib/typescript/module/components/ListItem/ListItem.d.ts +13 -6
  169. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +3 -0
  170. package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +57 -0
  171. package/lib/typescript/module/components/PickerTrigger/index.d.ts +3 -0
  172. package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +2 -0
  173. package/lib/typescript/module/components/Radio/Radio.d.ts +3 -0
  174. package/lib/typescript/module/components/Rating/Rating.d.ts +9 -6
  175. package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  176. package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +49 -20
  177. package/lib/typescript/module/components/Skeleton/SkeletonClock.d.ts +60 -0
  178. package/lib/typescript/module/components/Skeleton/SkeletonContent.d.ts +80 -19
  179. package/lib/typescript/module/components/Skeleton/SkeletonProvider.d.ts +39 -5
  180. package/lib/typescript/module/components/Skeleton/index.d.ts +6 -4
  181. package/lib/typescript/module/components/Slider/Slider.d.ts +12 -1
  182. package/lib/typescript/module/components/Stepper/Stepper.d.ts +18 -6
  183. package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +2 -0
  184. package/lib/typescript/module/components/Switch/Switch.d.ts +1 -0
  185. package/lib/typescript/module/components/Tabs/Tabs.d.ts +26 -2
  186. package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +36 -3
  187. package/lib/typescript/module/components/Toast/Toast.d.ts +8 -0
  188. package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +7 -1
  189. package/lib/typescript/module/components/index.d.ts +5 -5
  190. package/lib/typescript/module/index.d.ts +1 -1
  191. package/lib/typescript/module/theme/index.d.ts +1 -1
  192. package/lib/typescript/module/theme/types.d.ts +578 -12
  193. package/package.json +2 -6
  194. package/lib/commonjs/components/AppIcon/AppIcon.js +0 -120
  195. package/lib/commonjs/types/vector-icons.d.js +0 -2
  196. package/lib/module/components/AppIcon/AppIcon.js +0 -111
  197. package/lib/module/components/AppIcon/index.js +0 -4
  198. package/lib/module/types/vector-icons.d.js +0 -2
  199. package/lib/typescript/commonjs/components/AppIcon/AppIcon.d.ts +0 -20
  200. package/lib/typescript/commonjs/components/AppIcon/index.d.ts +0 -3
  201. package/lib/typescript/module/components/AppIcon/AppIcon.d.ts +0 -20
  202. package/lib/typescript/module/components/AppIcon/index.d.ts +0 -3
@@ -3,7 +3,7 @@
3
3
  import React, { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
4
4
  import { Animated, Pressable, StyleSheet, Text, View } from 'react-native';
5
5
  import { useTheme, createAnimatedValue } from "../../theme/index.js";
6
- import { SkeletonContent } from "../Skeleton/index.js";
6
+ import { Skeleton, SkeletonText } from "../Skeleton/index.js";
7
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
8
  const Banner = /*#__PURE__*/forwardRef((props, ref) => {
9
9
  const {
@@ -19,6 +19,11 @@ const Banner = /*#__PURE__*/forwardRef((props, ref) => {
19
19
  loading = false,
20
20
  accessibilityLabel,
21
21
  style,
22
+ containerStyle,
23
+ iconCircleStyle,
24
+ tintBarStyle,
25
+ closeButtonStyle,
26
+ actionButtonStyle,
22
27
  testID
23
28
  } = props;
24
29
  const theme = useTheme();
@@ -72,7 +77,7 @@ const Banner = /*#__PURE__*/forwardRef((props, ref) => {
72
77
  return /*#__PURE__*/_jsx(View, {
73
78
  style: [styles.iconCircle, {
74
79
  backgroundColor: tint.bar + '22'
75
- }],
80
+ }, iconCircleStyle],
76
81
  children: /*#__PURE__*/_jsx(Text, {
77
82
  style: [styles.iconGlyph, {
78
83
  color: tint.glyphColor
@@ -99,11 +104,11 @@ const Banner = /*#__PURE__*/forwardRef((props, ref) => {
99
104
  transform: [{
100
105
  translateY
101
106
  }]
102
- }, style],
107
+ }, style, containerStyle],
103
108
  children: [/*#__PURE__*/_jsx(View, {
104
109
  style: [styles.tintBar, {
105
110
  backgroundColor: tint.bar
106
- }]
111
+ }, tintBarStyle]
107
112
  }), /*#__PURE__*/_jsxs(View, {
108
113
  style: styles.row,
109
114
  children: [renderIcon(), /*#__PURE__*/_jsxs(View, {
@@ -140,11 +145,11 @@ const Banner = /*#__PURE__*/forwardRef((props, ref) => {
140
145
  pressed
141
146
  }) => [styles.closeBtn, {
142
147
  backgroundColor: pressed ? theme.colors.surface.pressed : 'transparent'
143
- }],
148
+ }, closeButtonStyle],
144
149
  children: /*#__PURE__*/_jsx(Text, {
145
150
  style: {
146
151
  color: theme.colors.text.secondary,
147
- fontSize: 18,
152
+ fontSize: theme.components.banner?.closeGlyphFontSize ?? 18,
148
153
  fontWeight: theme.typography.fontWeight.bold,
149
154
  lineHeight: 18
150
155
  },
@@ -164,7 +169,7 @@ const Banner = /*#__PURE__*/forwardRef((props, ref) => {
164
169
  pressed
165
170
  }) => [styles.actionBtn, {
166
171
  backgroundColor: pressed ? theme.colors.surface.pressed : 'transparent'
167
- }],
172
+ }, actionButtonStyle],
168
173
  children: /*#__PURE__*/_jsx(Text, {
169
174
  style: {
170
175
  color: isPrimary ? tint.glyphColor : theme.colors.text.secondary,
@@ -179,15 +184,86 @@ const Banner = /*#__PURE__*/forwardRef((props, ref) => {
179
184
  }) : null]
180
185
  });
181
186
  if (loading) {
182
- return /*#__PURE__*/_jsx(SkeletonContent, {
183
- loading: true,
184
- mode: "auto",
185
- children: rendered
187
+ return /*#__PURE__*/_jsx(BannerSkeleton, {
188
+ ...props
186
189
  });
187
190
  }
188
191
  return rendered;
189
192
  });
190
193
  Banner.displayName = 'Banner';
194
+
195
+ /**
196
+ * Placeholder shape for `<Banner>`. Keeps the icon circle on the left and
197
+ * shows title + 1-2 message lines + optional action button row. Outer
198
+ * container retains the elevated background so the banner footprint
199
+ * doesn't shift when it loads.
200
+ */
201
+ const BannerSkeleton = ({
202
+ title,
203
+ actions,
204
+ icon,
205
+ containerStyle,
206
+ style
207
+ }) => {
208
+ const theme = useTheme();
209
+ const showIcon = icon !== false;
210
+ return /*#__PURE__*/_jsxs(View, {
211
+ style: [{
212
+ flexDirection: 'row',
213
+ alignItems: 'flex-start',
214
+ backgroundColor: theme.colors.background.elevated,
215
+ borderRadius: theme.radius.md,
216
+ padding: theme.spacing.md,
217
+ borderWidth: 1,
218
+ borderColor: theme.colors.border.primary
219
+ }, containerStyle, style],
220
+ accessibilityRole: "progressbar",
221
+ accessibilityState: {
222
+ busy: true
223
+ },
224
+ children: [showIcon ? /*#__PURE__*/_jsx(View, {
225
+ style: {
226
+ marginRight: theme.spacing.sm
227
+ },
228
+ children: /*#__PURE__*/_jsx(Skeleton, {
229
+ shape: "circle",
230
+ width: 32,
231
+ height: 32
232
+ })
233
+ }) : null, /*#__PURE__*/_jsxs(View, {
234
+ style: {
235
+ flex: 1
236
+ },
237
+ children: [title !== undefined ? /*#__PURE__*/_jsx(Skeleton, {
238
+ shape: "text",
239
+ width: "55%",
240
+ height: 16,
241
+ style: {
242
+ marginBottom: theme.spacing.xs
243
+ }
244
+ }) : null, /*#__PURE__*/_jsx(SkeletonText, {
245
+ lines: 2,
246
+ fontSize: 13,
247
+ lastLineWidth: "70%"
248
+ }), actions && actions.length > 0 ? /*#__PURE__*/_jsx(View, {
249
+ style: {
250
+ flexDirection: 'row',
251
+ marginTop: theme.spacing.sm
252
+ },
253
+ children: actions.map((_, i) => /*#__PURE__*/_jsx(Skeleton, {
254
+ width: 72,
255
+ height: 28,
256
+ shape: "rounded",
257
+ style: {
258
+ marginRight: theme.spacing.sm
259
+ }
260
+ }, `sk-banner-action-${i}`))
261
+ }) : null]
262
+ })]
263
+ });
264
+ };
265
+ BannerSkeleton.displayName = 'BannerSkeleton';
266
+ Banner.Skeleton = BannerSkeleton;
191
267
  const tintFor = (theme, variant) => {
192
268
  switch (variant) {
193
269
  case 'success':
@@ -223,62 +299,66 @@ const tintFor = (theme, variant) => {
223
299
  };
224
300
  }
225
301
  };
226
- const buildStyles = _theme => StyleSheet.create({
227
- container: {
228
- overflow: 'hidden',
229
- paddingLeft: 16
230
- },
231
- tintBar: {
232
- position: 'absolute',
233
- left: 0,
234
- top: 0,
235
- bottom: 0,
236
- width: 4
237
- },
238
- row: {
239
- flexDirection: 'row',
240
- alignItems: 'flex-start'
241
- },
242
- iconWrap: {
243
- marginRight: 12
244
- },
245
- iconCircle: {
246
- width: 28,
247
- height: 28,
248
- borderRadius: 14,
249
- alignItems: 'center',
250
- justifyContent: 'center',
251
- marginRight: 12
252
- },
253
- iconGlyph: {
254
- fontSize: 15,
255
- fontWeight: '700',
256
- lineHeight: 17
257
- },
258
- textBlock: {
259
- flex: 1,
260
- paddingRight: 8
261
- },
262
- closeBtn: {
263
- width: 28,
264
- height: 28,
265
- borderRadius: 14,
266
- alignItems: 'center',
267
- justifyContent: 'center',
268
- marginLeft: 4
269
- },
270
- actionsRow: {
271
- flexDirection: 'row',
272
- justifyContent: 'flex-end',
273
- marginTop: 8,
274
- gap: 4
275
- },
276
- actionBtn: {
277
- paddingHorizontal: 10,
278
- paddingVertical: 6,
279
- borderRadius: 8
280
- }
281
- });
302
+ const buildStyles = theme => {
303
+ const iconCircleSize = theme.components.banner?.iconCircleSize ?? 28;
304
+ const closeButtonSize = theme.components.banner?.closeButtonSize ?? 28;
305
+ return StyleSheet.create({
306
+ container: {
307
+ overflow: 'hidden',
308
+ paddingLeft: theme.components.banner?.containerPaddingLeft ?? theme.spacing.md
309
+ },
310
+ tintBar: {
311
+ position: 'absolute',
312
+ left: 0,
313
+ top: 0,
314
+ bottom: 0,
315
+ width: theme.components.banner?.tintBarWidth ?? 4
316
+ },
317
+ row: {
318
+ flexDirection: 'row',
319
+ alignItems: 'flex-start'
320
+ },
321
+ iconWrap: {
322
+ marginRight: theme.components.banner?.iconGap ?? theme.spacing.sm
323
+ },
324
+ iconCircle: {
325
+ width: iconCircleSize,
326
+ height: iconCircleSize,
327
+ borderRadius: theme.components.banner?.iconCircleRadius ?? iconCircleSize / 2,
328
+ alignItems: 'center',
329
+ justifyContent: 'center',
330
+ marginRight: theme.components.banner?.iconGap ?? theme.spacing.sm
331
+ },
332
+ iconGlyph: {
333
+ fontSize: theme.components.banner?.iconGlyphFontSize ?? 15,
334
+ fontWeight: '700',
335
+ lineHeight: theme.components.banner?.iconGlyphLineHeight ?? 17
336
+ },
337
+ textBlock: {
338
+ flex: 1,
339
+ paddingRight: theme.components.banner?.textBlockPaddingRight ?? theme.spacing.xs
340
+ },
341
+ closeBtn: {
342
+ width: closeButtonSize,
343
+ height: closeButtonSize,
344
+ borderRadius: theme.components.banner?.closeButtonRadius ?? closeButtonSize / 2,
345
+ alignItems: 'center',
346
+ justifyContent: 'center',
347
+ marginLeft: theme.components.banner?.closeButtonMarginLeft ?? theme.spacing.xxs ?? 4
348
+ },
349
+ actionsRow: {
350
+ flexDirection: 'row',
351
+ justifyContent: 'flex-end',
352
+ marginTop: theme.components.banner?.actionsRowMarginTop ?? theme.spacing.xs,
353
+ gap: theme.components.banner?.actionsRowGap ?? 4
354
+ },
355
+ actionBtn: {
356
+ paddingHorizontal: theme.components.banner?.actionButtonPaddingHorizontal ?? theme.spacing.sm,
357
+ paddingVertical: theme.components.banner?.actionButtonPaddingVertical ?? 6,
358
+ borderRadius: theme.components.banner?.actionButtonRadius ?? theme.radius.sm
359
+ }
360
+ });
361
+ };
282
362
  export { Banner };
283
363
  export default Banner;
284
364
  //# sourceMappingURL=Banner.js.map
@@ -6,9 +6,11 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
6
  import { useTheme, createAnimatedValue } from "../../theme/index.js";
7
7
  import { triggerHaptic } from "../../utils/index.js";
8
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
- const ICON_SIZE = 24;
10
- const PILL_HEIGHT = 36;
11
- const UNDERLINE_HEIGHT = 3;
9
+ const DEFAULT_ICON_SIZE = 24;
10
+ const DEFAULT_PILL_HEIGHT = 36;
11
+ const DEFAULT_PILL_MAX_WIDTH = 120;
12
+ const DEFAULT_PILL_INSET = 16;
13
+ const DEFAULT_UNDERLINE_HEIGHT = 3;
12
14
  const formatBadge = value => {
13
15
  if (value === null || value === undefined || value === false) return null;
14
16
  if (value === true || value === '·') return {
@@ -57,8 +59,19 @@ const BottomNavigation = /*#__PURE__*/forwardRef((props, ref) => {
57
59
  const theme = useTheme();
58
60
  const insets = useSafeAreaInsets();
59
61
  const styles = useMemo(() => buildStyles(theme), [theme]);
62
+ const tokens = theme.components.bottomNavigation;
63
+ const iconSize = tokens?.iconSize ?? DEFAULT_ICON_SIZE;
64
+ const pillHeight = tokens?.pillHeight ?? DEFAULT_PILL_HEIGHT;
65
+ const pillMaxWidth = tokens?.pillMaxWidth ?? DEFAULT_PILL_MAX_WIDTH;
66
+ const pillInset = tokens?.pillInset ?? DEFAULT_PILL_INSET;
60
67
  const activeIndex = Math.max(0, tabs.findIndex(tab => tab.key === activeTab));
61
68
  const [tabWidth, setTabWidth] = React.useState(0);
69
+
70
+ // Single Animated.Value holds the pill's absolute pixel offset (active index
71
+ // × tab width + half the gap between tab edge and pill edge). Folding the
72
+ // offset into the same value avoids creating a fresh Animated.Value +
73
+ // Animated.add node on every render — earlier code did that and slowly
74
+ // leaked addition nodes as the user pressed tabs.
62
75
  const indicatorTranslateX = useRef(createAnimatedValue(0)).current;
63
76
  const iconScales = useRef({});
64
77
 
@@ -69,7 +82,17 @@ const BottomNavigation = /*#__PURE__*/forwardRef((props, ref) => {
69
82
  }
70
83
  });
71
84
 
72
- // Animate indicator when active tab changes or layout settles
85
+ // Pill width is intrinsic; we compute its rendered offset to keep it
86
+ // centered within each tab cell. The offset is applied to the pill itself
87
+ // (NOT folded into the shared indicatorTranslateX) so the underline indicator
88
+ // — which spans the full tab cell — stays aligned with the tab boundary
89
+ // instead of being shifted by the pill-centering math.
90
+ const pillWidth = tabWidth > 0 ? Math.min(tabWidth - pillInset, pillMaxWidth) : 0;
91
+ const pillOffset = tabWidth > 0 ? (tabWidth - pillWidth) / 2 : 0;
92
+
93
+ // Animate indicator to the active tab's cell edge. Pill mode applies the
94
+ // centering offset via a static `left` style below; underline mode uses
95
+ // this value directly.
73
96
  useEffect(() => {
74
97
  if (tabWidth <= 0) return;
75
98
  Animated.spring(indicatorTranslateX, {
@@ -105,11 +128,6 @@ const BottomNavigation = /*#__PURE__*/forwardRef((props, ref) => {
105
128
  onTabPress(tab.key);
106
129
  };
107
130
  const paddingBottom = Math.max(8, insets.bottom);
108
-
109
- // Pill width is intrinsic; we compute its rendered offset to keep it centered
110
- // within each tab cell when it animates.
111
- const pillWidth = tabWidth > 0 ? Math.min(tabWidth - 16, 120) : 0;
112
- const pillOffset = tabWidth > 0 ? (tabWidth - pillWidth) / 2 : 0;
113
131
  return /*#__PURE__*/_jsx(View, {
114
132
  ref: ref,
115
133
  testID: testID,
@@ -126,11 +144,12 @@ const BottomNavigation = /*#__PURE__*/forwardRef((props, ref) => {
126
144
  pointerEvents: "none",
127
145
  style: [styles.pill, {
128
146
  width: pillWidth,
129
- height: PILL_HEIGHT,
147
+ height: pillHeight,
148
+ left: pillOffset,
130
149
  backgroundColor: theme.colors.primaryMuted,
131
150
  borderRadius: theme.radius.full,
132
151
  transform: [{
133
- translateX: Animated.add(indicatorTranslateX, new Animated.Value(pillOffset))
152
+ translateX: indicatorTranslateX
134
153
  }]
135
154
  }, indicatorStyle]
136
155
  }) : null, tabs.map((tab, index) => {
@@ -162,13 +181,15 @@ const BottomNavigation = /*#__PURE__*/forwardRef((props, ref) => {
162
181
  testID: testID ? `${testID}-tab-${tab.key}` : undefined,
163
182
  children: [/*#__PURE__*/_jsxs(Animated.View, {
164
183
  style: [styles.iconWrap, {
184
+ width: iconSize + 8,
185
+ height: iconSize + 8,
165
186
  transform: [{
166
187
  scale
167
188
  }]
168
189
  }],
169
190
  children: [renderIcon({
170
191
  color,
171
- size: ICON_SIZE,
192
+ size: iconSize,
172
193
  focused: isActive
173
194
  }), badge ? /*#__PURE__*/_jsx(View, {
174
195
  style: [badge.isDot ? styles.badgeDot : styles.badgePill, {
@@ -196,6 +217,7 @@ const BottomNavigation = /*#__PURE__*/forwardRef((props, ref) => {
196
217
  pointerEvents: "none",
197
218
  style: [styles.underline, indicatorPosition === 'top' ? styles.underlineTop : styles.underlineBottom, {
198
219
  width: tabWidth,
220
+ height: tokens?.underlineHeight ?? DEFAULT_UNDERLINE_HEIGHT,
199
221
  backgroundColor: theme.colors.primary,
200
222
  transform: [{
201
223
  translateX: indicatorTranslateX
@@ -226,8 +248,8 @@ const buildStyles = theme => StyleSheet.create({
226
248
  gap: 2
227
249
  },
228
250
  iconWrap: {
229
- width: ICON_SIZE + 8,
230
- height: ICON_SIZE + 8,
251
+ width: DEFAULT_ICON_SIZE + 8,
252
+ height: DEFAULT_ICON_SIZE + 8,
231
253
  alignItems: 'center',
232
254
  justifyContent: 'center',
233
255
  position: 'relative'
@@ -245,7 +267,7 @@ const buildStyles = theme => StyleSheet.create({
245
267
  underline: {
246
268
  position: 'absolute',
247
269
  left: 0,
248
- height: UNDERLINE_HEIGHT
270
+ height: DEFAULT_UNDERLINE_HEIGHT
249
271
  },
250
272
  underlineBottom: {
251
273
  bottom: -6,
@@ -20,9 +20,9 @@
20
20
  */
21
21
 
22
22
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
23
- import { Dimensions, Keyboard, Modal, Platform, Pressable, StyleSheet, View } from 'react-native';
23
+ import { Dimensions, Keyboard, Modal, Platform, StyleSheet, View } from 'react-native';
24
24
  import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';
25
- import Animated, { Extrapolation, interpolate, runOnJS, useAnimatedStyle, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
25
+ import Animated, { runOnJS, useAnimatedStyle, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
26
26
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
27
27
  import { useTheme } from "../../theme/index.js";
28
28
  import { triggerHaptic } from "../../utils/index.js";
@@ -42,7 +42,6 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
42
42
  onAnimate,
43
43
  enablePanDownToClose = true,
44
44
  enableBackdropPress = true,
45
- backdropOpacity = 0.5,
46
45
  keyboardBehavior = 'none',
47
46
  mode = 'modal',
48
47
  handleIndicatorStyle,
@@ -84,6 +83,11 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
84
83
  // synchronously on open and unmount only after the close animation finishes
85
84
  // so the slide-down stays visible.
86
85
  const [modalVisible, setModalVisible] = useState(false);
86
+ // Inline-mode mirror of modalVisible: gates the absoluteFill backdrop +
87
+ // sheet tree so a closed inline sheet doesn't sit over the parent dimming
88
+ // it and swallowing touches. Set true on expand, cleared in
89
+ // markAnimationDone once the close animation completes.
90
+ const [inlineMounted, setInlineMounted] = useState(false);
87
91
 
88
92
  // Convert a snap-point index → translateY position. -1 = closed.
89
93
  const yForIndex = useCallback(idx => {
@@ -111,18 +115,20 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
111
115
  }, [onAnimate, translateY]);
112
116
  const markAnimationDone = useCallback(() => {
113
117
  isAnimatingRef.current = false;
114
- // If we just finished a close animation, unmount the modal wrapper.
115
- if (mode === 'modal' && currentIndexShared.value < 0) {
116
- setModalVisible(false);
118
+ // If we just finished a close animation, unmount the sheet wrapper.
119
+ if (currentIndexShared.value < 0) {
120
+ if (mode === 'modal') setModalVisible(false);else setInlineMounted(false);
117
121
  }
118
122
  }, [mode, currentIndexShared]);
119
123
  const expand = useCallback(idx => {
120
124
  const target = typeof idx === 'number' ? clamp(idx, 0, resolvedSnapPoints.length - 1) : currentIndex >= 0 ? currentIndex : 0;
121
125
  const fromIndex = currentIndexShared.value;
122
126
  const to = yForIndex(target);
123
- // Mount the Modal before kicking off the spring so the sheet has a
124
- // host to animate into.
125
- if (mode === 'modal') setModalVisible(true);
127
+ // Mount the host (Modal in modal mode, inline overlay in inline mode)
128
+ // before kicking off the spring so the sheet has somewhere to animate
129
+ // into. Inline mode also gates the backdrop on this so a closed sheet
130
+ // doesn't dim the parent.
131
+ if (mode === 'modal') setModalVisible(true);else setInlineMounted(true);
126
132
  // Reset translateY to the closed position so the first open animates
127
133
  // up from off-screen rather than snapping in place.
128
134
  if (fromIndex < 0) {
@@ -291,23 +297,22 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
291
297
  // status bar / notch.
292
298
  const lowerBound = keyboardOffset.value < 0 ? safeAreaTop : minTopY;
293
299
  const clamped = yWithKb < lowerBound ? lowerBound : yWithKb;
300
+ // Animate `top` (layout prop) instead of `transform: translateY`
301
+ // (visual only). Layout-prop animation under Reanimated still runs on
302
+ // the UI thread, but crucially the sheet's *hit-test box* moves with
303
+ // its visual position. With translateY the layout box stayed parked
304
+ // at top:0..maxSnap regardless of visual offset, so:
305
+ // (a) the empty top half intercepted backdrop taps (worked around
306
+ // previously via pointerEvents="box-none"), and
307
+ // (b) drag gestures on the handle could be claimed by sibling
308
+ // gesture handlers because the actual sheet view was effectively
309
+ // hidden from the responder chain.
310
+ // Animating `top` collapses both problems into nothing — visible area
311
+ // == hit area — so we can drop the box-none hack too.
294
312
  return {
295
- transform: [{
296
- translateY: clamped
297
- }]
313
+ top: clamped
298
314
  };
299
315
  });
300
- const backdropStyle = useAnimatedStyle(() => {
301
- // 0 opacity when sheet is closed, full backdropOpacity at minSnap height (and above).
302
- const closedAt = screenHeight;
303
- const openAt = screenHeight - minSnapPoint;
304
- const opacity = interpolate(translateY.value, [closedAt, openAt], [0, backdropOpacity], Extrapolation.CLAMP);
305
- return {
306
- opacity,
307
- // Disable hit-test entirely when fully closed so it doesn't swallow taps.
308
- pointerEvents: translateY.value >= closedAt - 0.5 ? 'none' : 'auto'
309
- };
310
- }, [backdropOpacity, minSnapPoint, screenHeight]);
311
316
  const isExpanded = currentIndex >= 0;
312
317
  const styles = useMemo(() => buildStyles(theme), [theme]);
313
318
  const handleBackdropPress = useCallback(() => {
@@ -316,46 +321,51 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
316
321
  close();
317
322
  }, [enableBackdropPress, close]);
318
323
 
319
- // Don't render the heavy gesture tree at all when nothing's been opened yet.
320
- // For inline mode we keep the legacy "mount on first open" behavior; modal
321
- // mode is gated entirely by `modalVisible`.
322
- const everOpenedRef = useRef(false);
323
- if (isExpanded || controlledIndex !== undefined) {
324
- everOpenedRef.current = true;
325
- }
326
- if (mode === 'inline' && !everOpenedRef.current) {
324
+ // RNGH Tap gesture for the backdrop. Plain RN Pressable on a sibling of a
325
+ // gesture-handler/reanimated sheet doesn't fire reliably on RN 0.85 / Fabric
326
+ // (the gesture system swallows the touch sequence). gorhom/bottom-sheet uses
327
+ // the same Gesture.Tap() pattern for the same reason.
328
+ const backdropTapGesture = useMemo(() => Gesture.Tap().maxDuration(250).onEnd((_e, success) => {
329
+ 'worklet';
330
+
331
+ if (!success) return;
332
+ runOnJS(handleBackdropPress)();
333
+ }), [handleBackdropPress]);
334
+
335
+ // Don't render the backdrop / sheet tree when the sheet is fully closed.
336
+ // Inline: gated by `inlineMounted` (set in expand, cleared in
337
+ // markAnimationDone after close animation) — keeps an idle inline sheet
338
+ // from sitting over the parent and swallowing touches.
339
+ // Modal: gated by `modalVisible` for the same reason.
340
+ if (mode === 'inline' && !inlineMounted) {
327
341
  return null;
328
342
  }
329
343
  if (mode === 'modal' && !modalVisible) {
330
344
  return null;
331
345
  }
332
346
  const sheetTree = /*#__PURE__*/_jsxs(View, {
333
- style: StyleSheet.absoluteFill,
334
- pointerEvents: "box-none",
347
+ collapsable: false
348
+ // Modal mode: the backdrop is the modal's root, so it fills via flex.
349
+ // Inline mode: the backdrop overlays the parent, so it positions absolute.
350
+ ,
351
+ style: [mode === 'modal' ? styles.backdropModal : styles.backdropInline, {
352
+ backgroundColor: theme.colors.background.overlay
353
+ }],
335
354
  testID: testID,
336
355
  accessibilityViewIsModal: accessibilityViewIsModal ?? isExpanded,
337
- children: [/*#__PURE__*/_jsx(Animated.View, {
338
- style: [styles.backdrop,
339
- // Solid scrim — the theme `background.overlay` token bakes in alpha
340
- // and double-multiplies with `backdropOpacity`, leaving the backdrop
341
- // looking washed out. Standard modal scrims are solid black so the
342
- // prop controls the actual final opacity.
343
- {
344
- backgroundColor: '#000'
345
- }, backdropStyle],
346
- children: /*#__PURE__*/_jsx(Pressable, {
347
- style: StyleSheet.absoluteFill,
348
- onPress: handleBackdropPress,
356
+ children: [/*#__PURE__*/_jsx(GestureDetector, {
357
+ gesture: backdropTapGesture,
358
+ children: /*#__PURE__*/_jsx(Animated.View, {
359
+ style: StyleSheet.absoluteFillObject,
349
360
  accessibilityRole: "button",
350
- accessibilityLabel: "Close bottom sheet",
351
- disabled: !enableBackdropPress || !isExpanded
361
+ accessibilityLabel: "Close bottom sheet"
352
362
  })
353
363
  }), /*#__PURE__*/_jsx(GestureDetector, {
354
364
  gesture: panGesture,
355
365
  children: /*#__PURE__*/_jsxs(Animated.View, {
356
366
  // 'dialog' is a valid platform role on web/iOS; RN's typings list it as a string union
357
367
  // that varies by platform — cast keeps strict-mode happy.
358
- accessibilityRole: 'dialog',
368
+ accessibilityRole: "alert",
359
369
  accessibilityLabel: accessibilityLabel,
360
370
  accessibilityViewIsModal: accessibilityViewIsModal ?? isExpanded,
361
371
  style: [styles.sheet, {
@@ -371,7 +381,7 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
371
381
  pointerEvents: "box-none",
372
382
  children: /*#__PURE__*/_jsx(View, {
373
383
  style: [styles.handle, {
374
- backgroundColor: theme.colors.border.primary
384
+ backgroundColor: theme.components.bottomSheet?.handleColor ?? theme.colors.border.primary
375
385
  }, handleIndicatorStyle]
376
386
  })
377
387
  }), /*#__PURE__*/_jsx(View, {
@@ -386,14 +396,17 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
386
396
  transparent: true,
387
397
  visible: modalVisible,
388
398
  onRequestClose: close,
389
- statusBarTranslucent: true,
390
- presentationStyle: "overFullScreen",
399
+ statusBarTranslucent: true
400
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
401
+ // @ts-ignore — typed in RN 0.73+, the runtime prop exists on 0.71+
402
+ ,
403
+ navigationBarTranslucent: true,
391
404
  animationType: "none",
392
405
  supportedOrientations: ['portrait', 'landscape'],
393
- children: /*#__PURE__*/_jsx(GestureHandlerRootView, {
406
+ children: Platform.OS === 'android' ? /*#__PURE__*/_jsx(GestureHandlerRootView, {
394
407
  style: styles.modalRoot,
395
408
  children: sheetTree
396
- })
409
+ }) : sheetTree
397
410
  });
398
411
  }
399
412
  return sheetTree;
@@ -413,14 +426,26 @@ const resolveSnapPoints = (points, screenH) => {
413
426
  };
414
427
  const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
415
428
  const buildStyles = _theme => StyleSheet.create({
416
- backdrop: {
429
+ backdropModal: {
430
+ // The backdrop is the modal's root View. On Fabric, an absolute-
431
+ // positioned root inside RNModal has no positioned ancestor and
432
+ // collapses to zero size, taking the scrim with it. `flex: 1` fills
433
+ // the modal content area reliably.
434
+ flex: 1
435
+ },
436
+ backdropInline: {
437
+ // Inline mode: overlay the parent. Parent must be positioned for this
438
+ // to take effect (the consumer is expected to render BottomSheet inside
439
+ // a relatively-positioned container).
417
440
  ...StyleSheet.absoluteFillObject
418
441
  },
419
442
  sheet: {
420
443
  position: 'absolute',
421
444
  left: 0,
422
445
  right: 0,
423
- top: 0,
446
+ // `top` is driven by the animated style (see sheetStyle). Omitted
447
+ // here so the static `0` doesn't fight the animated value during
448
+ // initial paint.
424
449
  overflow: 'hidden'
425
450
  },
426
451
  handleRow: {