@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
@@ -1,22 +1,20 @@
1
- import { Meta, Canvas, Story, Controls } from '@storybook/addon-docs/blocks';
2
- import * as Stories from './Radio.stories';
1
+ import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
2
+ import { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
3
3
  import {
4
+ Box,
5
+ Center,
4
6
  Radio,
5
7
  RadioGroup,
6
- RadioIndicator,
7
8
  RadioIcon,
9
+ RadioImage,
10
+ RadioIndicator,
8
11
  RadioLabel,
9
- Center,
10
- Box,
11
12
  RadioTile,
12
13
  } from '../../';
13
- import { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
14
- import {
15
- ViewFigmaButton,
16
- BackToTopButton,
17
- UsageWrap,
18
- AdvancedRadioExample,
19
- } from '../../../docs/components';
14
+ import mastercardLogo from '../../../docs/assets/bank-logo.png';
15
+ import visaLogo from '../../../docs/assets/bank-logo1.png';
16
+ import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
17
+ import * as Stories from './Radio.stories';
20
18
 
21
19
  <Meta title="Forms / Radio" />
22
20
 
@@ -38,10 +36,12 @@ The Radio component presents users with predefined choices and enables them to s
38
36
  - [`RadioIcon`](#radioicon)
39
37
  - [`RadioLabel`](#radiolabel)
40
38
  - [`RadioGroup`](#radiogroup)
39
+ - [`RadioImage`](#radioimage)
41
40
  - [Variants](#variants)
42
41
  - [Advanced Usage](#advanced-usage)
43
42
  - [Examples](#examples)
44
43
  - [`RadioTile` component](#radiotile-component)
44
+ - [`RadioImage` component](#radioimage-component)
45
45
  - [`RadioGroup` component](#radiogroup-component)
46
46
 
47
47
  ## Playground
@@ -104,6 +104,7 @@ const MyComponent = () => {
104
104
  | `validText` | `string` | - | The valid text to be displayed below the radio. |
105
105
  | `showValidationIcon` | `boolean` | `true` | Whether to show the validation icon. |
106
106
  | `type` | `'default' \| 'tile'` | `default` | The type of the radio. |
107
+ | `image` | `ImageProps` | - | The image to be displayed next to the label. |
107
108
 
108
109
  ## Components
109
110
 
@@ -147,6 +148,10 @@ Contains all Group related layout style props and actions. It inherits all the p
147
148
  | `direction` | `'row' \| 'column'` | `column` | The direction of the radio group. |
148
149
  | `gap` | `string` | - | The gap between the radio group items. |
149
150
 
151
+ ### `RadioImage`
152
+
153
+ Contains all Image related layout style props and actions. It inherits all the properties of React Native's [Image component](https://reactnative.dev/docs/image).
154
+
150
155
  ## Variants
151
156
 
152
157
  <Canvas of={Stories.Variants} />
@@ -158,133 +163,65 @@ In this example, we will create a custom Radio component with a badge and bullet
158
163
 
159
164
  <UsageWrap>
160
165
  <Center>
161
- <AdvancedRadioExample />
166
+ <RadioGroup type="tile" aria-label="Radio Group" nativeID="Radio-group">
167
+ <Radio value="option-1" aria-label="Label 1">
168
+ <RadioIndicator>
169
+ <RadioIcon />
170
+ </RadioIndicator>
171
+ <RadioImage source={visaLogo} style={{ width: 40, height: 24, resizeMode: 'contain' }} />
172
+ <RadioLabel>Visa</RadioLabel>
173
+ </Radio>
174
+ <Radio value="option-2" aria-label="Label 2">
175
+ <RadioIndicator>
176
+ <RadioIcon />
177
+ </RadioIndicator>
178
+ <RadioImage
179
+ source={mastercardLogo}
180
+ style={{ width: 40, height: 24, resizeMode: 'contain' }}
181
+ />
182
+ <RadioLabel>Mastercard</RadioLabel>
183
+ </Radio>
184
+ </RadioGroup>
162
185
  </Center>
163
186
  </UsageWrap>
164
187
 
165
188
  ```tsx
166
189
  import {
167
- Badge,
168
- Heading,
169
190
  Radio,
170
191
  RadioGroup,
171
- RadioIcon,
192
+ RadioLabel,
172
193
  RadioIndicator,
173
- BodyText,
174
- Box,
175
- type RadioProps as NativeUIRadioProps,
176
- } from '../../src';
194
+ RadioIcon,
195
+ RadioImage,
196
+ } from '@utilitywarehouse/native-ui';
177
197
  import { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
198
+ import visaLogo from '../../assets/bank-logo1.png';
199
+ import mastercardLogo from '../../assets/bank-logo.png';
178
200
 
179
- import { StyleSheet } from 'react-native-unistyles';
180
-
181
- interface RadioProps {
182
- currentValue: string;
183
- }
184
-
185
- const styles = StyleSheet.create(({ colorMode, color, borderRadius, borderWidth, space }) => ({
186
- radio: {
187
- borderWidth: borderWidth[2],
188
- borderColor: colorMode === 'light' ? color.grey[500] : color.grey[700],
189
- borderRadius: borderRadius.xl,
190
- padding: space[200],
191
- variants: {
192
- checked: {
193
- true: {
194
- borderColor: colorMode === 'light' ? color.green[500] : color.green[700],
195
- },
196
- },
197
- },
198
- },
199
- indicator: {
200
- variants: {
201
- checked: {
202
- true: {
203
- backgroundColor: colorMode === 'light' ? color.green[500] : color.green[700],
204
- borderColor: colorMode === 'light' ? color.green[500] : color.green[700],
205
- },
206
- },
207
- },
208
- },
209
- heading: {
210
- marginBottom: space[100],
211
- },
212
- badge: {
213
- marginRight: space[200],
214
- alignSelf: 'flex-end',
215
- },
216
- }));
217
-
218
- const CustomRadio: React.FC<
219
- RadioProps &
220
- Omit<
221
- NativeUIRadioProps,
222
- 'label' | 'helperText' | 'helperIcon' | 'invalidText' | 'validText' | 'showValidationIcon'
223
- >
224
- > = ({ children, currentValue, ...props }) => {
225
- styles.useVariants({ checked: currentValue === props.value });
201
+ const AdvancedExample = () => {
202
+ const [value, setValue] = React.useState('option-1');
226
203
  return (
227
- <Radio style={styles.radio} {...props}>
228
- <Box flexDirection="row" flex={1}>
229
- <Box pr="200" flex={1}>
230
- {children}
231
- </Box>
232
- <RadioIndicator style={styles.indicator}>
233
- <RadioIcon as={TickSmallIcon} color="white" />
204
+ <RadioGroup value={value} onChange={setValue} aria-label="Card type" type="tile">
205
+ <Radio value="option-1" aria-label="Visa">
206
+ <RadioIndicator>
207
+ <RadioIcon />
234
208
  </RadioIndicator>
235
- </Box>
236
- </Radio>
237
- );
238
- };
239
-
240
- const BulletListItem = ({ children }: { children: React.ReactNode }) => (
241
- <BodyText>
242
- {'\u2022'} {children}
243
- </BodyText>
244
- );
245
-
246
- const BulletList = ({ children }: { children: React.ReactNode }) => (
247
- <Box pl="200" gap="100">
248
- {children}
249
- </Box>
250
- );
251
-
252
- const AdvancedRadioExample: React.FC = () => {
253
- const [value, setValue] = React.useState('Option 1');
254
-
255
- const handleChange = (val: string) => setValue(val);
256
-
257
- return (
258
- <RadioGroup onChange={handleChange} value={value} gap="200">
259
- <Box>
260
- <Badge colorScheme={value === 'Option 1' ? 'green' : 'grey'} flatBase style={styles.badge}>
261
- Recommended
262
- </Badge>
263
- <CustomRadio value="Option 1" currentValue={value}>
264
- <Heading size="md" style={styles.heading}>
265
- Instant bank transfer
266
- </Heading>
267
- <BulletList>
268
- <BulletListItem>Receive your money instantly</BulletListItem>
269
- <BulletListItem>No fees</BulletListItem>
270
- <BulletListItem>Available 24/7</BulletListItem>
271
- </BulletList>
272
- </CustomRadio>
273
- </Box>
274
- <CustomRadio value="Option 2" currentValue={value}>
275
- <Heading size="md" style={styles.heading}>
276
- Debit card payment
277
- </Heading>
278
- <BulletList>
279
- <BulletListItem>£0.35 fee</BulletListItem>
280
- <BulletListItem>Available 24/7</BulletListItem>
281
- </BulletList>
282
- </CustomRadio>
209
+ <RadioImage source={visaLogo} style={{ width: 40, height: 24, resizeMode: 'contain' }} />
210
+ <RadioLabel>Visa</RadioLabel>
211
+ </Radio>
212
+ <Radio value="option-2" aria-label="Mastercard">
213
+ <RadioIndicator>
214
+ <RadioIcon />
215
+ </RadioIndicator>
216
+ <RadioImage
217
+ source={mastercardLogo}
218
+ style={{ width: 40, height: 24, resizeMode: 'contain' }}
219
+ />
220
+ <RadioLabel>Mastercard</RadioLabel>
221
+ </Radio>
283
222
  </RadioGroup>
284
223
  );
285
224
  };
286
-
287
- export default AdvancedRadioExample;
288
225
  ```
289
226
 
290
227
  ## Examples
@@ -317,6 +254,41 @@ const MyComponent = () => {
317
254
  };
318
255
  ```
319
256
 
257
+ ### `RadioImage` component
258
+
259
+ The `RadioImage` component is used to display an image next to the radio button.
260
+
261
+ <Canvas of={Stories.WithImage} />
262
+
263
+ ```tsx
264
+ import { Radio, RadioGroup } from '@utilitywarehouse/native-ui';
265
+ import visaLogo from './visa-logo.png';
266
+ import mastarcardLogo from './mastercard-logo.png';
267
+
268
+ const MyComponent = () => {
269
+ const [value, setValue] = React.useState('Option 1');
270
+ return (
271
+ <RadioGroup value={value} onChange={setValue} aria-label="Radio Group" nativeID="Radio-group">
272
+ <Radio
273
+ value="visa"
274
+ aria-label="Visa"
275
+ label="Visa"
276
+ image={{ source: visaLogo, style: { width: 40, height: 24, resizeMode: 'contain' } }}
277
+ />
278
+ <Radio
279
+ value="mastercard"
280
+ aria-label="Mastercard"
281
+ label="Mastercard"
282
+ image={{
283
+ source: mastarcardLogo,
284
+ style: { width: 40, height: 24, resizeMode: 'contain' },
285
+ }}
286
+ />
287
+ </RadioGroup>
288
+ );
289
+ };
290
+ ```
291
+
320
292
  ### `RadioGroup` component
321
293
 
322
294
  The `RadioGroup` component is used to group multiple `Radio` components together.
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from 'react';
2
- import type { PressableProps, ViewProps } from 'react-native';
2
+ import type { ImageProps, PressableProps, ViewProps } from 'react-native';
3
3
 
4
4
  interface RadioBaseProps extends Omit<PressableProps, 'children'> {
5
5
  value: string;
@@ -17,6 +17,7 @@ interface RadioWithChildrenProps extends RadioBaseProps {
17
17
  invalidText?: never;
18
18
  validText?: never;
19
19
  showValidationIcon?: never;
20
+ image?: never;
20
21
  }
21
22
 
22
23
  interface RadioWithoutChildrenProps extends RadioBaseProps {
@@ -27,6 +28,7 @@ interface RadioWithoutChildrenProps extends RadioBaseProps {
27
28
  invalidText?: string;
28
29
  validText?: string;
29
30
  showValidationIcon?: boolean;
31
+ image?: ImageProps;
30
32
  }
31
33
 
32
34
  type RadioProps = RadioWithChildrenProps | RadioWithoutChildrenProps;
@@ -1,6 +1,9 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { useState } from 'react';
3
+ import { ImageSourcePropType } from 'react-native';
3
4
  import { Radio, RadioGroup } from '.';
5
+ import bankLogo from '../../../docs/assets/bank-logo.png';
6
+ import bankLogo1 from '../../../docs/assets/bank-logo1.png';
4
7
  import { VariantTitle } from '../../../docs/components';
5
8
  import { Flex } from '../Flex';
6
9
 
@@ -84,6 +87,50 @@ export const Playground: Story = {
84
87
  ),
85
88
  };
86
89
 
90
+ export const WithImage: Story = {
91
+ parameters: {
92
+ controls: { exclude: ['image'] },
93
+ },
94
+ args: {
95
+ value: 'Option 1',
96
+ label: 'Label',
97
+ },
98
+ render: ({ children, ...args }) => (
99
+ <RadioGroup>
100
+ <Radio
101
+ aria-label="Label 1"
102
+ onChange={(checked: boolean) => {
103
+ console.log(checked, '###');
104
+ }}
105
+ nativeID="Radio-1"
106
+ {...args}
107
+ label="Visa"
108
+ value="Option 1"
109
+ image={{
110
+ source: bankLogo1 as ImageSourcePropType,
111
+ style: { width: 48, height: 32 },
112
+ resizeMode: 'cover',
113
+ }}
114
+ />
115
+ <Radio
116
+ aria-label="Label 2"
117
+ onChange={(checked: boolean) => {
118
+ console.log(checked, '###');
119
+ }}
120
+ nativeID="Radio-2"
121
+ {...args}
122
+ label="Mastercard"
123
+ value="Option 2"
124
+ image={{
125
+ source: bankLogo as ImageSourcePropType,
126
+ style: { width: 48, height: 32 },
127
+ resizeMode: 'cover',
128
+ }}
129
+ />
130
+ </RadioGroup>
131
+ ),
132
+ };
133
+
87
134
  export const Variants: Story = {
88
135
  parameters: {
89
136
  controls: { exclude: ['value', 'label', 'disabled'] },
@@ -1,16 +1,17 @@
1
1
  import { createRadio } from '@gluestack-ui/radio';
2
- import StyledRadio from './RadioRoot';
3
- import StyledRadioIndicator from './RadioIndicator';
2
+ import RadioProps from './Radio.props';
3
+ import StyledRadioGroup from './RadioGroupRoot';
4
4
  import StyledRadioIcon from './RadioIcon';
5
+ import StyledRadioIndicator from './RadioIndicator';
5
6
  import StyledRadioLabel from './RadioLabel';
6
- import StyledRadioGroup from './RadioGroupRoot';
7
- import RadioProps from './Radio.props';
7
+ import StyledRadio from './RadioRoot';
8
8
 
9
+ import { useFormFieldContext } from '../FormField';
9
10
  import { Helper } from '../Helper';
10
11
  import { useRadioGroupContext } from './RadioGroup.context';
11
- import { useFormFieldContext } from '../FormField';
12
- import RadioTileRoot from './RadioTileRoot';
12
+ import RadioImage from './RadioImage';
13
13
  import RadioTextContent from './RadioTextContent';
14
+ import RadioTileRoot from './RadioTileRoot';
14
15
 
15
16
  const RadioComponent = createRadio({
16
17
  Root: StyledRadio,
@@ -41,6 +42,7 @@ const Radio = ({
41
42
  validationStatus: validation,
42
43
  showValidationIcon,
43
44
  type = 'default',
45
+ image,
44
46
  ...props
45
47
  }: RadioProps) => {
46
48
  const { validationStatus: fieldValidationStatus } = useFormFieldContext();
@@ -55,6 +57,7 @@ const Radio = ({
55
57
  <RadioIndicator>
56
58
  <RadioIcon />
57
59
  </RadioIndicator>
60
+ {image ? <RadioImage {...image} /> : null}
58
61
  <RadioTextContent>
59
62
  {!!label && <RadioLabel>{label}</RadioLabel>}
60
63
  {!!helperText && <Helper disabled={disabled} icon={helperIcon} text={helperText} />}
@@ -89,6 +92,6 @@ const RadioTile = ({ type = 'tile', ...props }: RadioProps) => <Radio {...props}
89
92
  RadioTile.displayName = 'RadioTile';
90
93
  Radio.displayName = 'Radio';
91
94
 
92
- export { Radio, RadioGroup, RadioIndicator, RadioIcon, RadioLabel, RadioTile };
95
+ export { Radio, RadioGroup, RadioIcon, RadioIndicator, RadioLabel, RadioTile };
93
96
 
94
97
  export default Radio;
@@ -0,0 +1,9 @@
1
+ import { Image, ImageProps } from 'react-native';
2
+
3
+ const RadioImage = ({ source, style, ...props }: ImageProps) => (
4
+ <Image source={source} style={style} {...props} />
5
+ );
6
+
7
+ RadioImage.displayName = 'RadioImage';
8
+
9
+ export default RadioImage;
@@ -19,7 +19,7 @@ const styles = StyleSheet.create(theme => ({
19
19
  gap: theme.components.radio.gap,
20
20
  padding: theme.components.radio.tile.padding,
21
21
  borderWidth: theme.components.radio.tile.borderWidth,
22
- borderColor: theme.color.border.subtle,
22
+ borderColor: theme.color.border.strong,
23
23
  borderRadius: theme.components.radio.tile.borderRadius,
24
24
  backgroundColor: theme.color.surface.neutral.strong,
25
25
  variants: {
@@ -1,5 +1,6 @@
1
- export { default as Radio, RadioIndicator, RadioLabel, RadioIcon, RadioTile } from './Radio';
1
+ export { default as Radio, RadioIcon, RadioIndicator, RadioLabel, RadioTile } from './Radio';
2
+ export type { default as RadioProps } from './Radio.props';
2
3
  export { default as RadioGroup } from './RadioGroup';
3
4
  export { default as RadioGroupTextContent } from './RadioGroupTextContent';
5
+ export { default as RadioImage } from './RadioImage';
4
6
  export { default as RadioTextContent } from './RadioTextContent';
5
- export type { default as RadioProps } from './Radio.props';
@@ -1,8 +1,8 @@
1
- import { Meta, Controls, Story, Canvas } from '@storybook/addon-docs/blocks';
2
- import * as Stories from './Select.stories';
3
- import { Select, SelectOption, FormField, Center } from '../../';
1
+ import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
4
2
  import { UserSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
5
- import { ViewFigmaButton, BackToTopButton, UsageWrap } from '../../../docs/components';
3
+ import { Center, FormField, Select, SelectOption } from '../../';
4
+ import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
5
+ import * as Stories from './Select.stories';
6
6
 
7
7
  <Meta title="Forms / Select" />
8
8
 
@@ -195,7 +195,7 @@ import { Select, SelectOption } from '@utilitywarehouse/hearth-react-native';
195
195
  import {
196
196
  UserSmallIcon,
197
197
  HeartSmallIcon,
198
- StarSmallIcon,
198
+ EyeSmallIcon,
199
199
  } from '@utilitywarehouse/hearth-react-native-icons';
200
200
  import { useState } from 'react';
201
201
 
@@ -211,7 +211,7 @@ const MyComponent = () => {
211
211
  >
212
212
  <SelectOption label="Home option" value="home" leadingIcon={UserSmallIcon} />
213
213
  <SelectOption label="Car option" value="car" leadingIcon={HeartSmallIcon} />
214
- <SelectOption label="World option" value="world" leadingIcon={StarSmallIcon} />
214
+ <SelectOption label="World option" value="world" leadingIcon={EyeSmallIcon} />
215
215
  </Select>
216
216
  );
217
217
  };
@@ -1,15 +1,15 @@
1
1
  import type { Meta } from '@storybook/react-vite';
2
- import React, { useState } from 'react';
3
- import Select from './Select';
4
- import SelectOption from './SelectOption';
5
- import { FormField } from '../FormField';
6
2
  import {
7
- UserSmallIcon,
3
+ EyeSmallIcon,
8
4
  HeartSmallIcon,
9
- StarSmallIcon,
5
+ UserSmallIcon,
10
6
  } from '@utilitywarehouse/hearth-react-native-icons';
7
+ import { useState } from 'react';
11
8
  import { Box } from '../Box';
12
9
  import { Button } from '../Button';
10
+ import { FormField } from '../FormField';
11
+ import Select from './Select';
12
+ import SelectOption from './SelectOption';
13
13
 
14
14
  const meta = {
15
15
  title: 'Stories / Select',
@@ -269,7 +269,7 @@ export const WithInlineOptions = () => {
269
269
  >
270
270
  <SelectOption label="Home option" value="home" leadingIcon={UserSmallIcon} />
271
271
  <SelectOption label="Car option" value="car" leadingIcon={HeartSmallIcon} />
272
- <SelectOption label="World option" value="world" leadingIcon={StarSmallIcon} />
272
+ <SelectOption label="World option" value="world" leadingIcon={EyeSmallIcon} />
273
273
  </Select>
274
274
  );
275
275
  };
@@ -1,5 +1,5 @@
1
1
  import { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
2
- import { Pressable, View, ViewStyle } from 'react-native';
2
+ import { Pressable, View } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
4
  import { BodyText } from '../BodyText';
5
5
  import { Icon } from '../Icon';
@@ -42,10 +42,7 @@ const SelectOption = ({
42
42
  >
43
43
  {!!LeftIcon && (
44
44
  <View>
45
- {(() => {
46
- const IconAny = Icon as any;
47
- return <IconAny style={styles.icon as ViewStyle} as={LeftIcon} />;
48
- })()}
45
+ <Icon as={LeftIcon} style={styles.icon} />
49
46
  </View>
50
47
  )}
51
48
 
@@ -55,15 +52,12 @@ const SelectOption = ({
55
52
 
56
53
  {isSelected && (
57
54
  <View>
58
- <TickSmallIcon style={styles.icon as ViewStyle} />
55
+ <Icon as={TickSmallIcon} style={styles.icon} />
59
56
  </View>
60
57
  )}
61
58
  {!!RightIcon && !isSelected && (
62
59
  <View>
63
- {(() => {
64
- const IconAny = Icon as any;
65
- return <IconAny style={styles.icon as ViewStyle} as={RightIcon} />;
66
- })()}
60
+ <Icon as={RightIcon} style={styles.icon} />
67
61
  </View>
68
62
  )}
69
63
  </Pressable>
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from 'react';
2
- import type { PressableProps } from 'react-native';
2
+ import type { PressableProps, ViewProps } from 'react-native';
3
3
 
4
4
  export type UnstyledIconButtonProps = {
5
5
  /*
@@ -29,4 +29,5 @@ export type UnstyledIconButtonProps = {
29
29
  */
30
30
  inverted?: boolean;
31
31
  children?: React.ReactNode;
32
+ iconStyle?: ViewProps['style'];
32
33
  } & PressableProps;
@@ -1,9 +1,10 @@
1
1
  import { createButton } from '@gluestack-ui/button';
2
+ import { ViewStyle } from 'react-native';
3
+ import { useButtonGroupContext } from '../Button/ButtonGroup.context';
2
4
  import { UnstyledIconButtonProps } from './UnstyledIconButton.props';
3
- import UnstyledIconButtonRootComponent from './UnstyledIconButtonRoot';
4
5
  import UnstyledIconButtonIconComponent from './UnstyledIconButtonIcon';
6
+ import UnstyledIconButtonRootComponent from './UnstyledIconButtonRoot';
5
7
  import UnstyledIconButtonSpinerComponent from './UnstyledIconButtonSpinner';
6
- import { useButtonGroupContext } from '../Button/ButtonGroup.context';
7
8
 
8
9
  const UnstyledIconButtonComponent = createButton({
9
10
  Root: UnstyledIconButtonRootComponent,
@@ -25,23 +26,40 @@ const UnstyledIconButton = ({
25
26
  pressed,
26
27
  size = 'md',
27
28
  inverted = false,
29
+ iconStyle,
28
30
  ...props
29
31
  }: UnstyledIconButtonProps) => {
30
32
  const { disabled: groupDisabled, loading: groupLoading } = useButtonGroupContext();
31
- const { loading } = props;
33
+ const {
34
+ loading,
35
+ accessibilityRole = 'button',
36
+ accessible = true,
37
+ focusable = true,
38
+ importantForAccessibility = 'yes',
39
+ ...restProps
40
+ } = props;
41
+
32
42
  const isLoading = loading ?? groupLoading;
33
43
  const buttonDisabled = isLoading || (disabled ?? groupDisabled);
34
44
 
35
45
  return (
36
46
  <UnstyledIconButtonComponent
37
- {...props}
47
+ {...restProps}
38
48
  size={size}
39
49
  inverted={inverted}
40
50
  isDisabled={buttonDisabled}
41
51
  isPressed={pressed}
52
+ accessibilityRole={accessibilityRole}
53
+ accessible={accessible}
54
+ focusable={focusable}
55
+ importantForAccessibility={importantForAccessibility}
42
56
  icon={icon}
43
57
  >
44
- {loading ? <UnstyledIconButtonSpinner /> : <UnstyledIconButtonIcon as={icon} />}
58
+ {loading ? (
59
+ <UnstyledIconButtonSpinner />
60
+ ) : (
61
+ <UnstyledIconButtonIcon as={icon} style={iconStyle as ViewStyle} />
62
+ )}
45
63
  </UnstyledIconButtonComponent>
46
64
  );
47
65
  };
@@ -1,8 +1,8 @@
1
- import React, { useMemo } from 'react';
2
- import type { UnstyledIconButtonProps } from './UnstyledIconButton.props';
1
+ import { useMemo } from 'react';
3
2
  import { Pressable, ViewStyle } from 'react-native';
4
3
  import { StyleSheet } from 'react-native-unistyles';
5
4
  import { UnstyledIconButtonContext } from './UnstyledIconButton.context';
5
+ import type { UnstyledIconButtonProps } from './UnstyledIconButton.props';
6
6
 
7
7
  const UnstyledIconButtonRoot = ({
8
8
  size,
@@ -18,7 +18,11 @@ const UnstyledIconButtonRoot = ({
18
18
  );
19
19
  return (
20
20
  <UnstyledIconButtonContext.Provider value={value}>
21
- <Pressable {...props} style={[styles.container, props.style as ViewStyle]} />
21
+ <Pressable
22
+ {...props}
23
+ accessibilityState={{ disabled: !!disabled, ...props.accessibilityState }}
24
+ style={[styles.container, props.style as ViewStyle]}
25
+ />
22
26
  </UnstyledIconButtonContext.Provider>
23
27
  );
24
28
  };
@@ -10,6 +10,8 @@ export * from './Card';
10
10
  export * from './Center';
11
11
  export * from './Checkbox';
12
12
  export * from './CurrencyInput';
13
+ export * from './DatePicker';
14
+ export * from './DatePickerInput';
13
15
  export * from './DescriptionList';
14
16
  export * from './DetailText';
15
17
  export * from './Divider';
@@ -1,6 +1,7 @@
1
- export { default as useColorMode } from './useColorMode';
2
1
  export { default as useBreakpointValue } from './useBreakpointValue';
3
- export { default as useTheme } from './useTheme';
2
+ export { default as useColorMode } from './useColorMode';
4
3
  export { default as useMedia } from './useMedia';
5
- export { default as useToken } from './useToken';
4
+ export { usePrevious } from './usePrevious';
6
5
  export { useStyleProps } from './useStyleProps';
6
+ export { default as useTheme } from './useTheme';
7
+ export { default as useToken } from './useToken';
@@ -0,0 +1,9 @@
1
+ import { useEffect, useRef } from 'react';
2
+
3
+ export const usePrevious = (value: any) => {
4
+ const ref = useRef(null);
5
+ useEffect(() => {
6
+ ref.current = value;
7
+ });
8
+ return ref.current;
9
+ };