@utilitywarehouse/hearth-react-native 0.3.0 → 0.4.0

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 (313) hide show
  1. package/.storybook/preview.tsx +3 -0
  2. package/.turbo/turbo-build.log +1 -1
  3. package/.turbo/turbo-lint.log +3 -1
  4. package/CHANGELOG.md +22 -0
  5. package/build/components/Alert/AlertCloseButton.js +25 -3
  6. package/build/components/Alert/AlertIcon.js +17 -1
  7. package/build/components/Alert/AlertIconButton.js +27 -1
  8. package/build/components/Alert/AlertLink.js +47 -1
  9. package/build/components/Alert/AlertText.d.ts +1 -1
  10. package/build/components/Alert/AlertText.js +26 -2
  11. package/build/components/Alert/AlertTitle.d.ts +1 -1
  12. package/build/components/Alert/AlertTitle.js +26 -2
  13. package/build/components/Badge/BadgeIcon.js +72 -0
  14. package/build/components/Badge/BadgeText.js +72 -0
  15. package/build/components/Button/ButtonRoot.js +1 -0
  16. package/build/components/Checkbox/Checkbox.d.ts +2 -2
  17. package/build/components/Checkbox/Checkbox.js +11 -10
  18. package/build/components/Checkbox/Checkbox.props.d.ts +3 -1
  19. package/build/components/Checkbox/CheckboxIcon.js +1 -1
  20. package/build/components/Checkbox/CheckboxImage.d.ts +6 -0
  21. package/build/components/Checkbox/CheckboxImage.js +5 -0
  22. package/build/components/Checkbox/CheckboxTileRoot.js +1 -1
  23. package/build/components/Checkbox/index.d.ts +3 -2
  24. package/build/components/Checkbox/index.js +2 -1
  25. package/build/components/CurrencyInput/CurrencyInput.js +1 -1
  26. package/build/components/DatePicker/DatePicker.context.d.ts +19 -0
  27. package/build/components/DatePicker/DatePicker.context.js +3 -0
  28. package/build/components/DatePicker/DatePicker.d.ts +19 -0
  29. package/build/components/DatePicker/DatePicker.js +479 -0
  30. package/build/components/DatePicker/DatePicker.props.d.ts +125 -0
  31. package/build/components/DatePicker/DatePicker.props.js +1 -0
  32. package/build/components/DatePicker/DatePickerCalendar.d.ts +2 -0
  33. package/build/components/DatePicker/DatePickerCalendar.js +28 -0
  34. package/build/components/DatePicker/DatePickerDay.d.ts +11 -0
  35. package/build/components/DatePicker/DatePickerDay.js +242 -0
  36. package/build/components/DatePicker/DatePickerDays.d.ts +2 -0
  37. package/build/components/DatePicker/DatePickerDays.js +157 -0
  38. package/build/components/DatePicker/DatePickerFooter.d.ts +2 -0
  39. package/build/components/DatePicker/DatePickerFooter.js +23 -0
  40. package/build/components/DatePicker/DatePickerHeader/DatePickerHeader.props.d.ts +8 -0
  41. package/build/components/DatePicker/DatePickerHeader/DatePickerHeader.props.js +1 -0
  42. package/build/components/DatePicker/DatePickerHeader/DatePickerMonthButton.d.ts +2 -0
  43. package/build/components/DatePicker/DatePickerHeader/DatePickerMonthButton.js +14 -0
  44. package/build/components/DatePicker/DatePickerHeader/DatePickerNextButton.d.ts +2 -0
  45. package/build/components/DatePicker/DatePickerHeader/DatePickerNextButton.js +32 -0
  46. package/build/components/DatePicker/DatePickerHeader/DatePickerPrevButton.d.ts +2 -0
  47. package/build/components/DatePicker/DatePickerHeader/DatePickerPrevButton.js +32 -0
  48. package/build/components/DatePicker/DatePickerHeader/DatePickerSelectors.d.ts +6 -0
  49. package/build/components/DatePicker/DatePickerHeader/DatePickerSelectors.js +64 -0
  50. package/build/components/DatePicker/DatePickerHeader/DatePickerTimeButton.d.ts +1 -0
  51. package/build/components/DatePicker/DatePickerHeader/DatePickerTimeButton.js +22 -0
  52. package/build/components/DatePicker/DatePickerHeader/DatePickerYearButton.d.ts +2 -0
  53. package/build/components/DatePicker/DatePickerHeader/DatePickerYearButton.js +25 -0
  54. package/build/components/DatePicker/DatePickerHeader/index.d.ts +3 -0
  55. package/build/components/DatePicker/DatePickerHeader/index.js +30 -0
  56. package/build/components/DatePicker/DatePickerMonths.d.ts +2 -0
  57. package/build/components/DatePicker/DatePickerMonths.js +69 -0
  58. package/build/components/DatePicker/DatePickerWeekdays.d.ts +8 -0
  59. package/build/components/DatePicker/DatePickerWeekdays.js +26 -0
  60. package/build/components/DatePicker/DatePickerYears.d.ts +2 -0
  61. package/build/components/DatePicker/DatePickerYears.js +83 -0
  62. package/build/components/DatePicker/TimePicker.d.ts +3 -0
  63. package/build/components/DatePicker/TimePicker.js +84 -0
  64. package/build/components/DatePicker/enums.d.ts +12 -0
  65. package/build/components/DatePicker/enums.js +12 -0
  66. package/build/components/DatePicker/index.d.ts +4 -0
  67. package/build/components/DatePicker/index.js +3 -0
  68. package/build/components/DatePicker/polyfill.d.ts +0 -0
  69. package/build/components/DatePicker/polyfill.js +22 -0
  70. package/build/components/DatePicker/time-picker/animated-math.d.ts +4 -0
  71. package/build/components/DatePicker/time-picker/animated-math.js +19 -0
  72. package/build/components/DatePicker/time-picker/period-native.d.ts +6 -0
  73. package/build/components/DatePicker/time-picker/period-native.js +17 -0
  74. package/build/components/DatePicker/time-picker/period-picker.d.ts +6 -0
  75. package/build/components/DatePicker/time-picker/period-picker.js +10 -0
  76. package/build/components/DatePicker/time-picker/period-web.d.ts +6 -0
  77. package/build/components/DatePicker/time-picker/period-web.js +21 -0
  78. package/build/components/DatePicker/time-picker/wheel-native.d.ts +8 -0
  79. package/build/components/DatePicker/time-picker/wheel-native.js +19 -0
  80. package/build/components/DatePicker/time-picker/wheel-picker/index.d.ts +2 -0
  81. package/build/components/DatePicker/time-picker/wheel-picker/index.js +2 -0
  82. package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker-item.d.ts +16 -0
  83. package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker-item.js +97 -0
  84. package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker.d.ts +21 -0
  85. package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker.js +88 -0
  86. package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker.style.d.ts +23 -0
  87. package/build/components/DatePicker/time-picker/wheel-picker/wheel-picker.style.js +21 -0
  88. package/build/components/DatePicker/time-picker/wheel-web.d.ts +8 -0
  89. package/build/components/DatePicker/time-picker/wheel-web.js +148 -0
  90. package/build/components/DatePicker/time-picker/wheel.d.ts +8 -0
  91. package/build/components/DatePicker/time-picker/wheel.js +10 -0
  92. package/build/components/DatePicker/utils.d.ts +212 -0
  93. package/build/components/DatePicker/utils.js +391 -0
  94. package/build/components/DatePickerInput/DatePickerInput.d.ts +6 -0
  95. package/build/components/DatePickerInput/DatePickerInput.js +126 -0
  96. package/build/components/DatePickerInput/DatePickerInput.props.d.ts +47 -0
  97. package/build/components/DatePickerInput/DatePickerInput.props.js +1 -0
  98. package/build/components/DatePickerInput/DatePickerInputDoneButton.d.ts +8 -0
  99. package/build/components/DatePickerInput/DatePickerInputDoneButton.js +19 -0
  100. package/build/components/DatePickerInput/DatePickerInputDoneButton.web.d.ts +5 -0
  101. package/build/components/DatePickerInput/DatePickerInputDoneButton.web.js +5 -0
  102. package/build/components/DatePickerInput/index.d.ts +2 -0
  103. package/build/components/DatePickerInput/index.js +1 -0
  104. package/build/components/Input/InputField.d.ts +1 -1
  105. package/build/components/Input/InputField.js +1 -1
  106. package/build/components/Input/InputSlot.d.ts +1 -1
  107. package/build/components/Input/InputSlot.js +3 -3
  108. package/build/components/Link/Link.d.ts +1 -1
  109. package/build/components/Link/Link.js +4 -4
  110. package/build/components/Link/Link.props.d.ts +3 -0
  111. package/build/components/Radio/Radio.d.ts +2 -2
  112. package/build/components/Radio/Radio.js +9 -8
  113. package/build/components/Radio/Radio.props.d.ts +3 -1
  114. package/build/components/Radio/RadioImage.d.ts +6 -0
  115. package/build/components/Radio/RadioImage.js +5 -0
  116. package/build/components/Radio/RadioTileRoot.js +1 -1
  117. package/build/components/Radio/index.d.ts +3 -2
  118. package/build/components/Radio/index.js +2 -1
  119. package/build/components/Select/SelectOption.js +1 -7
  120. package/build/components/UnstyledIconButton/UnstyledIconButton.d.ts +1 -1
  121. package/build/components/UnstyledIconButton/UnstyledIconButton.js +5 -5
  122. package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +2 -1
  123. package/build/components/UnstyledIconButton/UnstyledIconButtonRoot.js +1 -1
  124. package/build/components/index.d.ts +2 -0
  125. package/build/components/index.js +2 -0
  126. package/build/core/themes.d.ts +12 -12
  127. package/build/hooks/index.d.ts +4 -3
  128. package/build/hooks/index.js +4 -3
  129. package/build/hooks/usePrevious.d.ts +1 -0
  130. package/build/hooks/usePrevious.js +8 -0
  131. package/build/hooks/useTheme.d.ts +2 -1
  132. package/build/hooks/useTheme.js +2 -2
  133. package/build/tokens/color.d.ts +12 -12
  134. package/build/tokens/color.js +6 -6
  135. package/build/tokens/components/dark/alert.d.ts +13 -0
  136. package/build/tokens/components/dark/alert.js +13 -0
  137. package/build/tokens/components/dark/checkbox.d.ts +3 -0
  138. package/build/tokens/components/dark/checkbox.js +3 -0
  139. package/build/tokens/components/dark/date-picker.d.ts +1 -0
  140. package/build/tokens/components/dark/date-picker.js +1 -0
  141. package/build/tokens/components/dark/icon-button.d.ts +7 -0
  142. package/build/tokens/components/dark/icon-button.js +7 -0
  143. package/build/tokens/components/dark/illustrations.d.ts +7 -0
  144. package/build/tokens/components/dark/illustrations.js +6 -0
  145. package/build/tokens/components/dark/index.d.ts +2 -0
  146. package/build/tokens/components/dark/index.js +2 -0
  147. package/build/tokens/components/dark/link.d.ts +5 -0
  148. package/build/tokens/components/dark/link.js +5 -0
  149. package/build/tokens/components/dark/progress-bar.d.ts +41 -0
  150. package/build/tokens/components/dark/progress-bar.js +40 -0
  151. package/build/tokens/components/dark/segmented-control.d.ts +2 -2
  152. package/build/tokens/components/dark/segmented-control.js +2 -2
  153. package/build/tokens/components/dark/table.d.ts +3 -0
  154. package/build/tokens/components/dark/table.js +3 -0
  155. package/build/tokens/components/light/alert.d.ts +13 -0
  156. package/build/tokens/components/light/alert.js +13 -0
  157. package/build/tokens/components/light/checkbox.d.ts +3 -0
  158. package/build/tokens/components/light/checkbox.js +3 -0
  159. package/build/tokens/components/light/date-picker.d.ts +1 -0
  160. package/build/tokens/components/light/date-picker.js +1 -0
  161. package/build/tokens/components/light/icon-button.d.ts +7 -0
  162. package/build/tokens/components/light/icon-button.js +7 -0
  163. package/build/tokens/components/light/illustrations.d.ts +7 -0
  164. package/build/tokens/components/light/illustrations.js +6 -0
  165. package/build/tokens/components/light/index.d.ts +2 -0
  166. package/build/tokens/components/light/index.js +2 -0
  167. package/build/tokens/components/light/link.d.ts +5 -0
  168. package/build/tokens/components/light/link.js +5 -0
  169. package/build/tokens/components/light/progress-bar.d.ts +41 -0
  170. package/build/tokens/components/light/progress-bar.js +40 -0
  171. package/build/tokens/components/light/segmented-control.d.ts +2 -2
  172. package/build/tokens/components/light/segmented-control.js +2 -2
  173. package/build/tokens/components/light/table.d.ts +3 -0
  174. package/build/tokens/components/light/table.js +3 -0
  175. package/build/tokens/index.d.ts +1 -0
  176. package/build/tokens/index.js +1 -0
  177. package/build/tokens/motion.d.ts +23 -0
  178. package/build/tokens/motion.js +22 -0
  179. package/build/tokens/primitive.d.ts +19 -0
  180. package/build/tokens/primitive.js +19 -0
  181. package/build/tokens/semantic-dark.d.ts +5 -5
  182. package/build/tokens/semantic-dark.js +5 -5
  183. package/build/tokens/semantic-light.d.ts +1 -1
  184. package/build/tokens/semantic-light.js +1 -1
  185. package/build/utils/index.d.ts +1 -0
  186. package/build/utils/index.js +1 -0
  187. package/build/utils/isEqual.d.ts +2 -0
  188. package/build/utils/isEqual.js +29 -0
  189. package/chromatic.config.json +6 -0
  190. package/docs/assets/bank-logo.png +0 -0
  191. package/docs/assets/bank-logo1.png +0 -0
  192. package/docs/components/AllComponents.web.tsx +43 -1
  193. package/docs/components/ViewWrap.tsx +32 -0
  194. package/docs/components/index.ts +7 -7
  195. package/docs/getting-started.mdx +6 -6
  196. package/docs/introduction.mdx +3 -3
  197. package/package.json +16 -12
  198. package/src/components/Alert/AlertCloseButton.tsx +33 -5
  199. package/src/components/Alert/AlertIcon.tsx +17 -1
  200. package/src/components/Alert/AlertIconButton.tsx +37 -4
  201. package/src/components/Alert/AlertLink.tsx +52 -1
  202. package/src/components/Alert/AlertText.tsx +28 -3
  203. package/src/components/Alert/AlertTitle.tsx +28 -3
  204. package/src/components/Badge/BadgeIcon.tsx +72 -0
  205. package/src/components/Badge/BadgeText.tsx +72 -0
  206. package/src/components/Button/ButtonRoot.tsx +1 -0
  207. package/src/components/Checkbox/Checkbox.docs.mdx +45 -7
  208. package/src/components/Checkbox/Checkbox.props.ts +3 -1
  209. package/src/components/Checkbox/Checkbox.stories.tsx +37 -1
  210. package/src/components/Checkbox/Checkbox.tsx +12 -9
  211. package/src/components/Checkbox/CheckboxIcon.tsx +1 -1
  212. package/src/components/Checkbox/CheckboxImage.tsx +9 -0
  213. package/src/components/Checkbox/CheckboxTileRoot.tsx +1 -1
  214. package/src/components/Checkbox/index.ts +3 -2
  215. package/src/components/CurrencyInput/CurrencyInput.tsx +2 -1
  216. package/src/components/DatePicker/DatePicker.context.ts +23 -0
  217. package/src/components/DatePicker/DatePicker.docs.mdx +239 -0
  218. package/src/components/DatePicker/DatePicker.props.ts +139 -0
  219. package/src/components/DatePicker/DatePicker.stories.tsx +98 -0
  220. package/src/components/DatePicker/DatePicker.tsx +669 -0
  221. package/src/components/DatePicker/DatePickerCalendar.tsx +41 -0
  222. package/src/components/DatePicker/DatePickerDay.tsx +302 -0
  223. package/src/components/DatePicker/DatePickerDays.tsx +241 -0
  224. package/src/components/DatePicker/DatePickerFooter.tsx +35 -0
  225. package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.props.ts +10 -0
  226. package/src/components/DatePicker/DatePickerHeader/DatePickerMonthButton.tsx +29 -0
  227. package/src/components/DatePicker/DatePickerHeader/DatePickerNextButton.tsx +46 -0
  228. package/src/components/DatePicker/DatePickerHeader/DatePickerPrevButton.tsx +46 -0
  229. package/src/components/DatePicker/DatePickerHeader/DatePickerSelectors.tsx +96 -0
  230. package/src/components/DatePicker/DatePickerHeader/DatePickerTimeButton.tsx +48 -0
  231. package/src/components/DatePicker/DatePickerHeader/DatePickerYearButton.tsx +50 -0
  232. package/src/components/DatePicker/DatePickerHeader/index.tsx +64 -0
  233. package/src/components/DatePicker/DatePickerMonths.tsx +101 -0
  234. package/src/components/DatePicker/DatePickerWeekdays.tsx +49 -0
  235. package/src/components/DatePicker/DatePickerYears.tsx +119 -0
  236. package/src/components/DatePicker/TimePicker.tsx +141 -0
  237. package/src/components/DatePicker/enums.ts +14 -0
  238. package/src/components/DatePicker/index.ts +13 -0
  239. package/src/components/DatePicker/polyfill.ts +21 -0
  240. package/src/components/DatePicker/time-picker/animated-math.ts +33 -0
  241. package/src/components/DatePicker/time-picker/period-native.tsx +34 -0
  242. package/src/components/DatePicker/time-picker/period-picker.tsx +16 -0
  243. package/src/components/DatePicker/time-picker/period-web.tsx +36 -0
  244. package/src/components/DatePicker/time-picker/wheel-native.tsx +37 -0
  245. package/src/components/DatePicker/time-picker/wheel-picker/index.ts +3 -0
  246. package/src/components/DatePicker/time-picker/wheel-picker/wheel-picker-item.tsx +132 -0
  247. package/src/components/DatePicker/time-picker/wheel-picker/wheel-picker.style.ts +22 -0
  248. package/src/components/DatePicker/time-picker/wheel-picker/wheel-picker.tsx +200 -0
  249. package/src/components/DatePicker/time-picker/wheel-web.tsx +181 -0
  250. package/src/components/DatePicker/time-picker/wheel.tsx +18 -0
  251. package/src/components/DatePicker/utils.ts +549 -0
  252. package/src/components/DatePickerInput/DatePickerInput.docs.mdx +237 -0
  253. package/src/components/DatePickerInput/DatePickerInput.props.ts +50 -0
  254. package/src/components/DatePickerInput/DatePickerInput.stories.tsx +178 -0
  255. package/src/components/DatePickerInput/DatePickerInput.tsx +265 -0
  256. package/src/components/DatePickerInput/DatePickerInputDoneButton.tsx +42 -0
  257. package/src/components/DatePickerInput/DatePickerInputDoneButton.web.tsx +7 -0
  258. package/src/components/DatePickerInput/index.ts +2 -0
  259. package/src/components/Icon/Icon.stories.tsx +4 -3
  260. package/src/components/IconContainer/IconContainer.docs.mdx +4 -4
  261. package/src/components/Input/InputField.tsx +0 -2
  262. package/src/components/Input/InputSlot.tsx +14 -3
  263. package/src/components/Link/Link.props.ts +3 -0
  264. package/src/components/Link/Link.tsx +12 -6
  265. package/src/components/List/List.docs.mdx +24 -23
  266. package/src/components/Modal/Modal.stories.tsx +2 -30
  267. package/src/components/Radio/Radio.docs.mdx +96 -124
  268. package/src/components/Radio/Radio.props.ts +3 -1
  269. package/src/components/Radio/Radio.stories.tsx +47 -0
  270. package/src/components/Radio/Radio.tsx +10 -7
  271. package/src/components/Radio/RadioImage.tsx +9 -0
  272. package/src/components/Radio/RadioTileRoot.tsx +1 -1
  273. package/src/components/Radio/index.ts +3 -2
  274. package/src/components/Select/Select.docs.mdx +6 -6
  275. package/src/components/Select/Select.stories.tsx +7 -7
  276. package/src/components/Select/SelectOption.tsx +4 -10
  277. package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
  278. package/src/components/UnstyledIconButton/UnstyledIconButton.tsx +23 -5
  279. package/src/components/UnstyledIconButton/UnstyledIconButtonRoot.tsx +7 -3
  280. package/src/components/index.ts +2 -0
  281. package/src/hooks/index.ts +4 -3
  282. package/src/hooks/usePrevious.ts +9 -0
  283. package/src/hooks/useTheme.ts +4 -3
  284. package/src/tokens/color.ts +6 -6
  285. package/src/tokens/components/dark/alert.ts +13 -0
  286. package/src/tokens/components/dark/checkbox.ts +3 -0
  287. package/src/tokens/components/dark/date-picker.ts +1 -0
  288. package/src/tokens/components/dark/icon-button.ts +7 -0
  289. package/src/tokens/components/dark/illustrations.ts +7 -0
  290. package/src/tokens/components/dark/index.ts +2 -0
  291. package/src/tokens/components/dark/link.ts +5 -0
  292. package/src/tokens/components/dark/progress-bar.ts +41 -0
  293. package/src/tokens/components/dark/segmented-control.ts +2 -2
  294. package/src/tokens/components/dark/table.ts +3 -0
  295. package/src/tokens/components/light/alert.ts +13 -0
  296. package/src/tokens/components/light/checkbox.ts +3 -0
  297. package/src/tokens/components/light/date-picker.ts +1 -0
  298. package/src/tokens/components/light/icon-button.ts +7 -0
  299. package/src/tokens/components/light/illustrations.ts +7 -0
  300. package/src/tokens/components/light/index.ts +2 -0
  301. package/src/tokens/components/light/link.ts +5 -0
  302. package/src/tokens/components/light/progress-bar.ts +41 -0
  303. package/src/tokens/components/light/segmented-control.ts +2 -2
  304. package/src/tokens/components/light/table.ts +3 -0
  305. package/src/tokens/index.ts +1 -0
  306. package/src/tokens/motion.ts +23 -0
  307. package/src/tokens/primitive.ts +19 -0
  308. package/src/tokens/semantic-dark.ts +5 -5
  309. package/src/tokens/semantic-light.ts +1 -1
  310. package/src/utils/index.ts +1 -0
  311. package/src/utils/isEqual.ts +30 -0
  312. package/docs/assets/react-native-pig.png +0 -0
  313. package/docs/components/AdvancedRadioExample.tsx +0 -126
@@ -0,0 +1,265 @@
1
+ import type { BottomSheetModalMethods } from '@gorhom/bottom-sheet/lib/typescript/types';
2
+ import { CalendarSmallIcon, CloseSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
3
+ import dayjs from 'dayjs';
4
+ import customParseFormat from 'dayjs/plugin/customParseFormat';
5
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
6
+ import { Keyboard, Platform, TextInputFocusEvent } from 'react-native';
7
+ import { StyleSheet } from 'react-native-unistyles';
8
+ import { DatePicker } from '../DatePicker';
9
+ import type { DateType } from '../DatePicker/DatePicker.props';
10
+ import { useFormFieldContext } from '../FormField';
11
+ import { Input, InputField, InputSlot } from '../Input';
12
+ import { UnstyledIconButton } from '../UnstyledIconButton';
13
+ import type DatePickerInputProps from './DatePickerInput.props';
14
+ import DatePickerInputDoneButton from './DatePickerInputDoneButton';
15
+
16
+ dayjs.extend(customParseFormat);
17
+
18
+ const DEFAULT_FORMAT = 'DD/MM/YYYY';
19
+
20
+ const maskDefaultFormat = (value: string) => {
21
+ const digitsOnly = value.replace(/\D/g, '').slice(0, 8);
22
+ const day = digitsOnly.slice(0, 2);
23
+ const month = digitsOnly.slice(2, 4);
24
+ const year = digitsOnly.slice(4, 8);
25
+
26
+ return [day, month, year].filter(Boolean).join('/');
27
+ };
28
+
29
+ const DatePickerInput = ({
30
+ validationStatus = 'initial',
31
+ disabled,
32
+ focused,
33
+ readonly,
34
+ placeholder,
35
+ inBottomSheet = false,
36
+ format = DEFAULT_FORMAT,
37
+ openButtonLabel = 'Open date picker',
38
+ autoCloseOnSelect = true,
39
+ onChange,
40
+ onChangeText,
41
+ onBlur,
42
+ onFocus,
43
+ value,
44
+ datePickerProps,
45
+ onClear,
46
+ ...rest
47
+ }: DatePickerInputProps) => {
48
+ const formFieldContext = useFormFieldContext();
49
+ const validationStatusFromContext = formFieldContext?.validationStatus ?? validationStatus;
50
+ const isDisabled = formFieldContext?.disabled ?? disabled;
51
+ const isReadonly = formFieldContext?.readonly ?? readonly;
52
+
53
+ const pickerRef = useRef<BottomSheetModalMethods | null>(null);
54
+ const accessoryViewID = useMemo(() => {
55
+ if (Platform.OS !== 'ios') return undefined;
56
+ return `datepicker-input-${Math.random().toString(36).slice(2)}`;
57
+ }, []);
58
+
59
+ const formatDate = useCallback(
60
+ (dateValue?: DateType) => {
61
+ if (!dateValue) return '';
62
+ const parsed = dayjs(dateValue);
63
+ return parsed.isValid() ? parsed.format(format) : '';
64
+ },
65
+ [format]
66
+ );
67
+
68
+ const isDefaultFormat = format === DEFAULT_FORMAT;
69
+
70
+ const [inputValue, setInputValue] = useState(() => formatDate(value));
71
+
72
+ useEffect(() => {
73
+ setInputValue(formatDate(value));
74
+ }, [value, formatDate]);
75
+
76
+ const handleTextChange = useCallback(
77
+ (text: string) => {
78
+ const nextValue = isDefaultFormat ? maskDefaultFormat(text) : text;
79
+
80
+ setInputValue(nextValue);
81
+ onChangeText?.(nextValue);
82
+
83
+ if (!nextValue) {
84
+ onChange?.({ date: undefined });
85
+ return;
86
+ }
87
+
88
+ const parsed = dayjs(nextValue, format, true);
89
+
90
+ if (parsed.isValid()) {
91
+ onChange?.({ date: parsed.toDate() });
92
+ } else {
93
+ onChange?.({ date: undefined });
94
+ }
95
+ },
96
+ [format, isDefaultFormat, onChange, onChangeText]
97
+ );
98
+
99
+ const handleClear = useCallback(() => {
100
+ setInputValue('');
101
+ onChange?.({ date: undefined });
102
+ onClear?.();
103
+ }, [onChange, onClear]);
104
+
105
+ const closeKeyboard = useCallback(() => {
106
+ Keyboard.dismiss();
107
+ }, []);
108
+
109
+ const openPicker = useCallback(() => {
110
+ if (isDisabled || isReadonly) return;
111
+ closeKeyboard();
112
+ pickerRef.current?.present();
113
+ }, [closeKeyboard, isDisabled, isReadonly]);
114
+
115
+ const selectedDate = useMemo(() => {
116
+ if (value) {
117
+ return value;
118
+ }
119
+
120
+ const parsed = dayjs(inputValue, format, true);
121
+ return parsed.isValid() ? parsed.toDate() : undefined;
122
+ }, [value, inputValue, format]);
123
+
124
+ const handlePickerChange = useCallback(
125
+ ({ date }: { date: DateType }) => {
126
+ if (!date) {
127
+ handleClear();
128
+ return;
129
+ }
130
+
131
+ const formatted = formatDate(date);
132
+ setInputValue(formatted);
133
+ onChange?.({ date });
134
+
135
+ if (autoCloseOnSelect) {
136
+ pickerRef.current?.close?.();
137
+ }
138
+ },
139
+ [autoCloseOnSelect, formatDate, handleClear, onChange]
140
+ );
141
+
142
+ const handleBlur = useCallback(
143
+ (event: TextInputFocusEvent) => {
144
+ onBlur?.(event);
145
+ },
146
+ [onBlur]
147
+ );
148
+
149
+ const handleFocus = useCallback(
150
+ (event: TextInputFocusEvent) => {
151
+ onFocus?.(event);
152
+ },
153
+ [onFocus]
154
+ );
155
+
156
+ const { onCancel: pickerOnCancel, ...restDatePickerProps } = datePickerProps ?? {};
157
+ const {
158
+ style: inputStyle,
159
+ keyboardType: keyboardTypeProp,
160
+ inputMode: inputModeProp,
161
+ accessibilityHint: accessibilityHintProp,
162
+ accessibilityLabel: accessibilityLabelProp,
163
+ accessible: accessibleProp,
164
+ accessibilityRole: accessibilityRoleProp,
165
+ importantForAccessibility: importantForAccessibilityProp,
166
+ ...textInputProps
167
+ } = rest;
168
+
169
+ const resolvedKeyboardType = keyboardTypeProp ?? (isDefaultFormat ? 'number-pad' : undefined);
170
+ const resolvedInputMode = inputModeProp ?? (isDefaultFormat ? 'numeric' : undefined);
171
+ const resolvedAccessibilityHint = accessibilityHintProp ?? `Enter the date in ${format} format`;
172
+ const resolvedAccessibilityLabel = accessibilityLabelProp ?? 'Date input';
173
+ const resolvedAccessible = accessibleProp ?? true;
174
+ const resolvedImportantForAccessibility = importantForAccessibilityProp ?? 'yes';
175
+
176
+ const handleCancel = useCallback(() => {
177
+ pickerOnCancel?.();
178
+ pickerRef.current?.close?.();
179
+ }, [pickerOnCancel]);
180
+
181
+ const placeholderValue = placeholder ?? format;
182
+
183
+ return (
184
+ <>
185
+ <Input
186
+ validationStatus={validationStatusFromContext}
187
+ disabled={isDisabled}
188
+ readonly={isReadonly}
189
+ focused={focused}
190
+ style={styles.wrap}
191
+ accessible={false}
192
+ >
193
+ <InputField
194
+ editable={!isReadonly && !isDisabled}
195
+ value={inputValue}
196
+ placeholder={placeholderValue}
197
+ onChangeText={handleTextChange}
198
+ onBlur={handleBlur}
199
+ onFocus={handleFocus}
200
+ inBottomSheet={inBottomSheet}
201
+ keyboardType={resolvedKeyboardType}
202
+ inputMode={resolvedInputMode}
203
+ accessibilityHint={resolvedAccessibilityHint}
204
+ aria-label="Date input"
205
+ accessibilityLabel={resolvedAccessibilityLabel}
206
+ accessible={resolvedAccessible}
207
+ accessibilityState={{
208
+ disabled: isDisabled || isReadonly,
209
+ }}
210
+ importantForAccessibility={resolvedImportantForAccessibility}
211
+ inputAccessoryViewID={Platform.OS === 'ios' ? accessoryViewID : undefined}
212
+ {...textInputProps}
213
+ style={[styles.input, inputStyle]}
214
+ />
215
+ {!!inputValue && onClear && !isReadonly && !isDisabled && (
216
+ <InputSlot accessibilityElementsHidden={false}>
217
+ <UnstyledIconButton
218
+ accessibilityLabel="Clear date"
219
+ accessibilityHint="Removes the current date"
220
+ icon={CloseSmallIcon}
221
+ onPress={handleClear}
222
+ />
223
+ </InputSlot>
224
+ )}
225
+ <InputSlot accessibilityElementsHidden={false}>
226
+ <UnstyledIconButton
227
+ accessibilityLabel={openButtonLabel}
228
+ accessibilityHint="Opens the date picker calendar"
229
+ icon={CalendarSmallIcon}
230
+ onPress={openPicker}
231
+ disabled={isDisabled || isReadonly}
232
+ />
233
+ </InputSlot>
234
+ </Input>
235
+ <DatePicker
236
+ ref={pickerRef}
237
+ mode="single"
238
+ date={selectedDate}
239
+ onChange={handlePickerChange}
240
+ onCancel={handleCancel}
241
+ {...restDatePickerProps}
242
+ />
243
+ {Platform.OS === 'ios' && accessoryViewID && (
244
+ <DatePickerInputDoneButton
245
+ accessoryViewID={accessoryViewID}
246
+ closeKeyboard={closeKeyboard}
247
+ />
248
+ )}
249
+ </>
250
+ );
251
+ };
252
+
253
+ DatePickerInput.displayName = 'DatePickerInput';
254
+
255
+ const styles = StyleSheet.create(theme => ({
256
+ wrap: {
257
+ gap: theme.components.input.date.gap,
258
+ },
259
+ input: {
260
+ paddingLeft: 0,
261
+ paddingRight: 0,
262
+ },
263
+ }));
264
+
265
+ export default DatePickerInput;
@@ -0,0 +1,42 @@
1
+ import { InputAccessoryView, View } from 'react-native';
2
+ import { StyleSheet } from 'react-native-unistyles';
3
+ import { Button } from '../Button';
4
+
5
+ const DatePickerInputDoneButton = ({
6
+ accessoryViewID,
7
+ closeKeyboard,
8
+ }: {
9
+ accessoryViewID: string;
10
+ closeKeyboard: () => void;
11
+ }) => {
12
+ return (
13
+ <InputAccessoryView nativeID={accessoryViewID}>
14
+ <View style={styles.accessory}>
15
+ <Button
16
+ accessibilityRole="button"
17
+ accessibilityLabel="Done"
18
+ onPress={closeKeyboard}
19
+ variant="ghost"
20
+ colorScheme="functional"
21
+ >
22
+ Done
23
+ </Button>
24
+ </View>
25
+ </InputAccessoryView>
26
+ );
27
+ };
28
+
29
+ const styles = StyleSheet.create(theme => ({
30
+ accessory: {
31
+ paddingHorizontal: 16,
32
+ paddingVertical: 2,
33
+ alignItems: 'flex-end',
34
+ backgroundColor: theme.color.surface.neutral.strong,
35
+ borderTopWidth: theme.borderWidth[1],
36
+ borderTopColor: theme.color.border.subtle,
37
+ },
38
+ }));
39
+
40
+ DatePickerInputDoneButton.DisplayName = 'DatePickerInputDoneButton';
41
+
42
+ export default DatePickerInputDoneButton;
@@ -0,0 +1,7 @@
1
+ const DatePickerInputDoneButton = () => {
2
+ return null;
3
+ };
4
+
5
+ DatePickerInputDoneButton.DisplayName = 'DatePickerInputDoneButton';
6
+
7
+ export default DatePickerInputDoneButton;
@@ -0,0 +1,2 @@
1
+ export { default as DatePickerInput } from './DatePickerInput';
2
+ export type { default as DatePickerInputProps } from './DatePickerInput.props';
@@ -1,6 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import * as Icons from '@utilitywarehouse/hearth-react-native-icons';
3
- import { ComponentType } from 'react';
4
3
  import { Icon } from '.';
5
4
  import { ColorValue } from '../../types';
6
5
  import { coloursAsArray } from '../../utils';
@@ -25,7 +24,8 @@ const meta = {
25
24
  },
26
25
  },
27
26
  args: {
28
- as: Object.keys(Icons)[0] as ComponentType,
27
+ // @ts-expect-error - This is a playground
28
+ as: Object.keys(Icons)[0],
29
29
  color: 'grey1000' as ColorValue,
30
30
  },
31
31
  } satisfies Meta<typeof Icon>;
@@ -37,7 +37,8 @@ type Story = StoryObj<typeof meta>;
37
37
  export const Playground: Story = {
38
38
  // @ts-expect-error - This is a playground
39
39
  render: ({ as: icon, color }) => {
40
+ // @ts-expect-error - This is a playground
40
41
  const as = icon === 'none' ? undefined : Icons[icon];
41
- return <Icon as={as} color={colors[color]} />;
42
+ return <Icon as={as} color={color} />;
42
43
  },
43
44
  };
@@ -2,8 +2,8 @@ import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
2
2
  import {
3
3
  BroadbandMediumIcon,
4
4
  CashbackCardMediumIcon,
5
- ConfettiMediumIcon,
6
5
  ElectricityMediumIcon,
6
+ EmailMediumIcon,
7
7
  InsuranceMediumIcon,
8
8
  MobileMediumIcon,
9
9
  } from '@utilitywarehouse/hearth-react-native-icons';
@@ -42,7 +42,7 @@ Wrap an icon with the `IconContainer` to apply sizing + background styles withou
42
42
  <IconContainer icon={MobileMediumIcon} size="md" variant="emphasis" color="mobile" />
43
43
  <IconContainer icon={InsuranceMediumIcon} size="md" variant="emphasis" color="insurance" />
44
44
  <IconContainer icon={CashbackCardMediumIcon} size="md" variant="emphasis" color="cashback" />
45
- <IconContainer icon={ConfettiMediumIcon} size="md" variant="emphasis" color="pig" />
45
+ <IconContainer icon={EmailMediumIcon} size="md" variant="emphasis" color="pig" />
46
46
  </Flex>
47
47
  </Center>
48
48
  </UsageWrap>
@@ -55,7 +55,7 @@ import {
55
55
  MobileMediumIcon,
56
56
  InsuranceMediumIcon,
57
57
  CashbackCardMediumIcon,
58
- ConfettiMediumIcon,
58
+ ,
59
59
  } from '@utilitywarehouse/hearth-react-native-icons';
60
60
 
61
61
  const MyComponent = () => (
@@ -65,7 +65,7 @@ const MyComponent = () => (
65
65
  <IconContainer icon={MobileMediumIcon} size="md" variant="emphasis" color="mobile" />
66
66
  <IconContainer icon={InsuranceMediumIcon} size="md" variant="emphasis" color="insurance" />
67
67
  <IconContainer icon={CashbackCardMediumIcon} size="md" variant="emphasis" color="cashback" />
68
- <IconContainer icon={ConfettiMediumIcon} size="md" variant="emphasis" color="pig" />
68
+ <IconContainer icon={EmailMediumIcon} size="md" variant="emphasis" color="pig" />
69
69
  </>
70
70
  );
71
71
  ```
@@ -6,8 +6,6 @@ import { useInputContext } from './Input.context';
6
6
 
7
7
  const InputField = ({
8
8
  style,
9
- onFocus,
10
- onBlur,
11
9
  inBottomSheet = false,
12
10
  ...props
13
11
  }: TextInputProps & { inBottomSheet?: boolean }) => {
@@ -1,9 +1,20 @@
1
- import { StyleSheet } from 'react-native-unistyles';
2
1
  import { View, ViewProps } from 'react-native';
2
+ import { StyleSheet } from 'react-native-unistyles';
3
3
 
4
- const InputSlot = ({ children, style, ...props }: ViewProps) => {
4
+ const InputSlot = ({
5
+ children,
6
+ style,
7
+ accessible,
8
+ importantForAccessibility,
9
+ ...props
10
+ }: ViewProps) => {
5
11
  return (
6
- <View {...props} style={[styles.container, style]}>
12
+ <View
13
+ {...props}
14
+ accessible={accessible ?? false}
15
+ importantForAccessibility={importantForAccessibility ?? 'auto'}
16
+ style={[styles.container, style]}
17
+ >
7
18
  {children}
8
19
  </View>
9
20
  );
@@ -1,5 +1,6 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { PressableProps, TextProps } from 'react-native';
3
+ import { IconProps } from '../Icon';
3
4
 
4
5
  export interface LinkProps extends Omit<PressableProps, 'children'> {
5
6
  children: TextProps['children'];
@@ -10,6 +11,8 @@ export interface LinkProps extends Omit<PressableProps, 'children'> {
10
11
  icon?: ComponentType;
11
12
  iconPosition?: 'left' | 'right';
12
13
  showIcon?: boolean;
14
+ textStyle?: TextProps['style'];
15
+ iconStyle?: IconProps['style'];
13
16
  }
14
17
 
15
18
  export default LinkProps;
@@ -1,9 +1,9 @@
1
- import type { LinkProps } from './Link.props';
2
1
  import { createLink } from '@gluestack-ui/link';
2
+ import { ChevronRightSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
3
+ import type { LinkProps } from './Link.props';
4
+ import LinkIcon from './LinkIcon';
3
5
  import LinkRoot from './LinkRoot';
4
6
  import LinkTextComponent from './LinkText';
5
- import LinkIcon from './LinkIcon';
6
- import { ChevronRightSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
7
7
 
8
8
  const LinkComponent = createLink({
9
9
  Root: LinkRoot,
@@ -21,14 +21,20 @@ const Link = ({
21
21
  target = '_self',
22
22
  iconPosition = 'right',
23
23
  showIcon = true,
24
+ textStyle,
25
+ iconStyle,
24
26
  ...props
25
27
  }: LinkProps) => {
26
28
  const LinkAny = LinkComponent as any;
27
29
  return (
28
30
  <LinkAny {...props} isDisabled={disabled} isExternal={target === '_blank'}>
29
- {showIcon && icon && iconPosition === 'left' ? <LinkIcon as={icon} /> : null}
30
- <LinkText>{children}</LinkText>
31
- {showIcon && icon && iconPosition === 'right' ? <LinkIcon as={icon} /> : null}
31
+ {showIcon && icon && iconPosition === 'left' ? (
32
+ <LinkIcon as={icon} style={iconStyle} />
33
+ ) : null}
34
+ <LinkText style={textStyle}>{children}</LinkText>
35
+ {showIcon && icon && iconPosition === 'right' ? (
36
+ <LinkIcon as={icon} style={iconStyle} />
37
+ ) : null}
32
38
  </LinkAny>
33
39
  );
34
40
  };
@@ -4,7 +4,8 @@ import {
4
4
  ChevronRightSmallIcon,
5
5
  ElectricityMediumIcon,
6
6
  GasMediumIcon,
7
- HomeFilledMediumIcon,
7
+ InfoMediumIcon as HomeMediumIcon,
8
+ // HomeMediumIcon,
8
9
  PaymentMediumIcon,
9
10
  UserMediumIcon,
10
11
  } from '@utilitywarehouse/hearth-react-native-icons';
@@ -15,7 +16,6 @@ import {
15
16
  FlatList,
16
17
  Image,
17
18
  List,
18
- SectionHeader,
19
19
  ListItem,
20
20
  ListItemContent,
21
21
  ListItemHelperText,
@@ -24,6 +24,7 @@ import {
24
24
  ListItemText,
25
25
  ListItemTrailingContent,
26
26
  ListItemTrailingIcon,
27
+ SectionHeader,
27
28
  } from '../../';
28
29
  import { BackToTopButton, BadgeList, UsageWrap, ViewFigmaButton } from '../../../docs/components';
29
30
  import * as Stories from './List.stories';
@@ -87,21 +88,21 @@ const MyComponent = () => (
87
88
 
88
89
  ### `List`
89
90
 
90
- | Name | Type | Default | Description |
91
- | ----------------------- | ------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------- |
92
- | container | `'none' \| 'subtleWhite' \| 'emphasisWhite' \|` <br /> `'subtleWarmWhite' \| 'emphasisWarmWhite'` | `'none'` | The container style of the list. |
93
- | heading | `string` | | The text to display in the heading of the list. |
94
- | helperText | `string` | | The supporting text to display in the heading of the list. |
95
- | linkText | `string` | | The text for the link in the heading. |
96
- | linkHref | `string` | | The href for the link in the heading. |
97
- | linkOnPress | `() => void` | | Callback function when the heading link is pressed. |
98
- | linkTarget | `'_blank' \| '_self' \| '_parent' \| '_top'` | | Target for the link in the heading. | |
99
- | linkIcon | `ComponentType` | | Icon for the heading link. |
100
- | linkIconPosition | `'left' \| 'right'` | `'right'` | Position of the icon in the heading link. |
101
- | linkShowIcon | `boolean` | `true` | Whether to show the icon in the heading link. |
102
- | divider | `boolean` | `false` | Whether to display a divider below the list items. |
103
- | loading | `boolean` | `false` | Whether to show the list items in loading state. |
104
- | disabled | `boolean` | `false` | Whether to disable the list. |
91
+ | Name | Type | Default | Description |
92
+ | ---------------- | ------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------- | --- |
93
+ | container | `'none' \| 'subtleWhite' \| 'emphasisWhite' \|` <br /> `'subtleWarmWhite' \| 'emphasisWarmWhite'` | `'none'` | The container style of the list. |
94
+ | heading | `string` | | The text to display in the heading of the list. |
95
+ | helperText | `string` | | The supporting text to display in the heading of the list. |
96
+ | linkText | `string` | | The text for the link in the heading. |
97
+ | linkHref | `string` | | The href for the link in the heading. |
98
+ | linkOnPress | `() => void` | | Callback function when the heading link is pressed. |
99
+ | linkTarget | `'_blank' \| '_self' \| '_parent' \| '_top'` | | Target for the link in the heading. | |
100
+ | linkIcon | `ComponentType` | | Icon for the heading link. |
101
+ | linkIconPosition | `'left' \| 'right'` | `'right'` | Position of the icon in the heading link. |
102
+ | linkShowIcon | `boolean` | `true` | Whether to show the icon in the heading link. |
103
+ | divider | `boolean` | `false` | Whether to display a divider below the list items. |
104
+ | loading | `boolean` | `false` | Whether to show the list items in loading state. |
105
+ | disabled | `boolean` | `false` | Whether to disable the list. |
105
106
 
106
107
  ### `ListItem`
107
108
 
@@ -172,7 +173,7 @@ If you need to use the List component in a more advanced way, you can use the pa
172
173
  </ListItem>
173
174
  <ListItem onPress={() => console.log('pressed')}>
174
175
  <ListItemLeadingContent>
175
- <ListItemIcon as={HomeFilledMediumIcon} />
176
+ <ListItemIcon as={HomeMediumIcon} />
176
177
  </ListItemLeadingContent>
177
178
  <ListItemContent>
178
179
  <ListItemText>Moving home</ListItemText>
@@ -214,7 +215,7 @@ import {
214
215
  BillMediumIcon,
215
216
  ChevronRightSmallIcon,
216
217
  PaymentMediumIcon,
217
- HomeFilledMediumIcon,
218
+ HomeMediumIcon,
218
219
  UserMediumIcon,
219
220
  } from '@utilitywarehouse/hearth-react-native-icons';
220
221
 
@@ -247,7 +248,7 @@ const MyComponent = () => (
247
248
  </ListItem>
248
249
  <ListItem onPress={() => console.log('pressed')}>
249
250
  <ListItemLeadingContent>
250
- <ListItemIcon as={HomeFilledMediumIcon} />
251
+ <ListItemIcon as={HomeMediumIcon} />
251
252
  </ListItemLeadingContent>
252
253
  <ListItemContent>
253
254
  <ListItemText>Moving home</ListItemText>
@@ -302,7 +303,7 @@ the `Card` and child `ListItem` components.
302
303
  onPress={() => console.log('item pressed')}
303
304
  />
304
305
  <ListItem
305
- leadingContent={<HomeFilledMediumIcon />}
306
+ leadingContent={<HomeMediumIcon />}
306
307
  text="Moving Home"
307
308
  onPress={() => console.log('item pressed')}
308
309
  />
@@ -314,7 +315,7 @@ import { List, ListItem, Card } from '@utilitywarehouse/hearth-react-native';
314
315
  import {
315
316
  BillMediumIcon,
316
317
  PaymentMediumIcon,
317
- HomeFilledMediumIcon,
318
+ HomeMediumIcon,
318
319
  } from '@utilitywarehouse/hearth-react-native-icons';
319
320
 
320
321
  const MyComponent = () => (
@@ -332,7 +333,7 @@ const MyComponent = () => (
332
333
  onPress={() => console.log('item pressed')}
333
334
  />
334
335
  <ListItem
335
- leadingContent={<HomeFilledMediumIcon />}
336
+ leadingContent={<HomeMediumIcon />}
336
337
  text="Moving Home"
337
338
  onPress={() => console.log('item pressed')}
338
339
  />
@@ -1,9 +1,9 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { useRef } from 'react';
3
- import { Dimensions, ImageSourcePropType, Platform, View, ViewProps } from 'react-native';
4
- import { UnistylesRuntime } from 'react-native-unistyles';
3
+ import { ImageSourcePropType, Platform, View } from 'react-native';
5
4
  import { Modal } from '.';
6
5
  import pigs from '../../../docs/assets/pigs.png';
6
+ import { ViewWrap } from '../../../docs/components';
7
7
  import { BodyText } from '../BodyText';
8
8
  import { BottomSheetModal } from '../BottomSheet';
9
9
  import { Box } from '../Box';
@@ -61,34 +61,6 @@ const meta = {
61
61
  export default meta;
62
62
  type Story = StoryObj<typeof meta>;
63
63
 
64
- const ViewWrap = ({ children }: { children: ViewProps['children'] }) => (
65
- <View
66
- style={{
67
- width: Platform.OS === 'web' ? '100%' : Dimensions.get('window').width,
68
- height:
69
- Platform.OS === 'web'
70
- ? '100%'
71
- : Dimensions.get('window').height -
72
- UnistylesRuntime.insets.top -
73
- UnistylesRuntime.insets.bottom -
74
- 33,
75
-
76
- position: 'absolute',
77
- top: 0,
78
- left: 0,
79
- right: 0,
80
- bottom: 0,
81
- flex: 1,
82
- marginVertical: Platform.OS === 'web' ? 0 : -8,
83
- justifyContent: 'center',
84
- alignItems: 'center',
85
- padding: 16,
86
- }}
87
- >
88
- {children}
89
- </View>
90
- );
91
-
92
64
  export const Playground: Story = {
93
65
  args: {
94
66
  children: [],