@utilitywarehouse/hearth-react-native 0.2.0 → 0.3.1

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 (289) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +3 -1
  3. package/CHANGELOG.md +34 -0
  4. package/build/components/Alert/AlertCloseButton.js +25 -3
  5. package/build/components/Alert/AlertIcon.js +17 -1
  6. package/build/components/Alert/AlertIconButton.js +27 -1
  7. package/build/components/Alert/AlertLink.js +47 -1
  8. package/build/components/Alert/AlertText.d.ts +1 -1
  9. package/build/components/Alert/AlertText.js +26 -2
  10. package/build/components/Alert/AlertTitle.d.ts +1 -1
  11. package/build/components/Alert/AlertTitle.js +26 -2
  12. package/build/components/Badge/Badge.js +101 -14
  13. package/build/components/Badge/Badge.props.d.ts +2 -2
  14. package/build/components/Badge/BadgeIcon.js +27 -29
  15. package/build/components/Badge/BadgeText.js +29 -31
  16. package/build/components/Button/Button.d.ts +2 -2
  17. package/build/components/Button/ButtonGroupRoot.d.ts +3 -2
  18. package/build/components/Button/ButtonGroupRoot.js +9 -0
  19. package/build/components/Button/ButtonRoot.js +1 -0
  20. package/build/components/Card/Card.props.d.ts +2 -2
  21. package/build/components/Checkbox/Checkbox.d.ts +2 -2
  22. package/build/components/Checkbox/Checkbox.js +11 -10
  23. package/build/components/Checkbox/Checkbox.props.d.ts +3 -1
  24. package/build/components/Checkbox/CheckboxIcon.js +1 -1
  25. package/build/components/Checkbox/CheckboxImage.d.ts +6 -0
  26. package/build/components/Checkbox/CheckboxImage.js +5 -0
  27. package/build/components/Checkbox/CheckboxTileRoot.js +1 -1
  28. package/build/components/Checkbox/index.d.ts +3 -2
  29. package/build/components/Checkbox/index.js +2 -1
  30. package/build/components/CurrencyInput/CurrencyInput.d.ts +6 -0
  31. package/build/components/CurrencyInput/CurrencyInput.js +47 -0
  32. package/build/components/CurrencyInput/CurrencyInput.props.d.ts +14 -0
  33. package/build/components/CurrencyInput/CurrencyInput.props.js +1 -0
  34. package/build/components/CurrencyInput/index.d.ts +1 -0
  35. package/build/components/CurrencyInput/index.js +1 -0
  36. package/build/components/DescriptionList/DescriptionList.context.d.ts +6 -0
  37. package/build/components/DescriptionList/DescriptionList.context.js +9 -0
  38. package/build/components/DescriptionList/DescriptionList.d.ts +6 -0
  39. package/build/components/DescriptionList/DescriptionList.js +25 -0
  40. package/build/components/DescriptionList/DescriptionList.props.d.ts +18 -0
  41. package/build/components/DescriptionList/DescriptionList.props.js +1 -0
  42. package/build/components/DescriptionList/DescriptionListItem.d.ts +6 -0
  43. package/build/components/DescriptionList/DescriptionListItem.js +49 -0
  44. package/build/components/DescriptionList/DescriptionListItem.props.d.ts +17 -0
  45. package/build/components/DescriptionList/DescriptionListItem.props.js +1 -0
  46. package/build/components/DescriptionList/index.d.ts +4 -0
  47. package/build/components/DescriptionList/index.js +2 -0
  48. package/build/components/Divider/Divider.js +46 -0
  49. package/build/components/Divider/Divider.props.d.ts +2 -2
  50. package/build/components/Flex/Flex.props.d.ts +3 -2
  51. package/build/components/Grid/Grid.props.d.ts +2 -2
  52. package/build/components/IconContainer/IconContainer.d.ts +5 -0
  53. package/build/components/IconContainer/IconContainer.js +161 -0
  54. package/build/components/IconContainer/IconContainer.props.d.ts +15 -0
  55. package/build/components/IconContainer/IconContainer.props.js +1 -0
  56. package/build/components/IconContainer/index.d.ts +2 -0
  57. package/build/components/IconContainer/index.js +1 -0
  58. package/build/components/Icons/CircleIcon.js +3 -3
  59. package/build/components/Input/Input.js +2 -34
  60. package/build/components/Input/Input.props.d.ts +1 -17
  61. package/build/components/Input/InputField.js +0 -7
  62. package/build/components/Link/Link.d.ts +1 -1
  63. package/build/components/Link/Link.js +4 -4
  64. package/build/components/Link/Link.props.d.ts +3 -0
  65. package/build/components/Modal/Modal.js +17 -1
  66. package/build/components/Radio/Radio.d.ts +2 -2
  67. package/build/components/Radio/Radio.js +9 -8
  68. package/build/components/Radio/Radio.props.d.ts +3 -1
  69. package/build/components/Radio/RadioImage.d.ts +6 -0
  70. package/build/components/Radio/RadioImage.js +5 -0
  71. package/build/components/Radio/RadioTileRoot.js +1 -1
  72. package/build/components/Radio/index.d.ts +3 -2
  73. package/build/components/Radio/index.js +2 -1
  74. package/build/components/SectionHeader/SectionHeader.js +1 -0
  75. package/build/components/Select/SelectOption.js +1 -7
  76. package/build/components/Tabs/Tab.d.ts +18 -0
  77. package/build/components/Tabs/Tab.js +74 -0
  78. package/build/components/Tabs/Tab.props.d.ts +14 -0
  79. package/build/components/Tabs/Tab.props.js +1 -0
  80. package/build/components/Tabs/TabPanel.d.ts +3 -0
  81. package/build/components/Tabs/TabPanel.js +34 -0
  82. package/build/components/Tabs/TabPanel.props.d.ts +8 -0
  83. package/build/components/Tabs/TabPanel.props.js +1 -0
  84. package/build/components/Tabs/Tabs.context.d.ts +23 -0
  85. package/build/components/Tabs/Tabs.context.js +8 -0
  86. package/build/components/Tabs/Tabs.d.ts +6 -0
  87. package/build/components/Tabs/Tabs.js +114 -0
  88. package/build/components/Tabs/Tabs.props.d.ts +19 -0
  89. package/build/components/Tabs/Tabs.props.js +1 -0
  90. package/build/components/Tabs/TabsList.d.ts +6 -0
  91. package/build/components/Tabs/TabsList.js +112 -0
  92. package/build/components/Tabs/TabsList.props.d.ts +6 -0
  93. package/build/components/Tabs/TabsList.props.js +1 -0
  94. package/build/components/Tabs/index.d.ts +8 -0
  95. package/build/components/Tabs/index.js +4 -0
  96. package/build/components/UnstyledIconButton/UnstyledIconButton.d.ts +1 -1
  97. package/build/components/UnstyledIconButton/UnstyledIconButton.js +4 -4
  98. package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +2 -1
  99. package/build/components/index.d.ts +4 -0
  100. package/build/components/index.js +4 -0
  101. package/build/core/themes.d.ts +428 -160
  102. package/build/core/themes.js +57 -1
  103. package/build/tokens/color.d.ts +88 -80
  104. package/build/tokens/color.js +44 -40
  105. package/build/tokens/components/dark/alert.d.ts +13 -0
  106. package/build/tokens/components/dark/alert.js +13 -0
  107. package/build/tokens/components/dark/button.d.ts +1 -0
  108. package/build/tokens/components/dark/button.js +1 -0
  109. package/build/tokens/components/dark/checkbox.d.ts +4 -1
  110. package/build/tokens/components/dark/checkbox.js +4 -1
  111. package/build/tokens/components/dark/icon-button.d.ts +10 -3
  112. package/build/tokens/components/dark/icon-button.js +10 -3
  113. package/build/tokens/components/dark/index.d.ts +1 -0
  114. package/build/tokens/components/dark/index.js +1 -0
  115. package/build/tokens/components/dark/link.d.ts +5 -0
  116. package/build/tokens/components/dark/link.js +5 -0
  117. package/build/tokens/components/dark/progress-bar.d.ts +41 -0
  118. package/build/tokens/components/dark/progress-bar.js +40 -0
  119. package/build/tokens/components/dark/radio.d.ts +1 -1
  120. package/build/tokens/components/dark/radio.js +1 -1
  121. package/build/tokens/components/dark/tabs.d.ts +2 -0
  122. package/build/tokens/components/dark/tabs.js +2 -0
  123. package/build/tokens/components/light/alert.d.ts +13 -0
  124. package/build/tokens/components/light/alert.js +13 -0
  125. package/build/tokens/components/light/badge.d.ts +1 -1
  126. package/build/tokens/components/light/badge.js +1 -1
  127. package/build/tokens/components/light/button.d.ts +1 -0
  128. package/build/tokens/components/light/button.js +1 -0
  129. package/build/tokens/components/light/checkbox.d.ts +6 -3
  130. package/build/tokens/components/light/checkbox.js +6 -3
  131. package/build/tokens/components/light/icon-button.d.ts +8 -1
  132. package/build/tokens/components/light/icon-button.js +8 -1
  133. package/build/tokens/components/light/index.d.ts +1 -0
  134. package/build/tokens/components/light/index.js +1 -0
  135. package/build/tokens/components/light/link.d.ts +5 -0
  136. package/build/tokens/components/light/link.js +5 -0
  137. package/build/tokens/components/light/progress-bar.d.ts +41 -0
  138. package/build/tokens/components/light/progress-bar.js +40 -0
  139. package/build/tokens/components/light/radio.d.ts +3 -3
  140. package/build/tokens/components/light/radio.js +3 -3
  141. package/build/tokens/components/light/tabs.d.ts +2 -0
  142. package/build/tokens/components/light/tabs.js +2 -0
  143. package/build/tokens/index.d.ts +1 -0
  144. package/build/tokens/index.js +1 -0
  145. package/build/tokens/layout.d.ts +48 -30
  146. package/build/tokens/layout.js +24 -15
  147. package/build/tokens/motion.d.ts +23 -0
  148. package/build/tokens/motion.js +22 -0
  149. package/build/tokens/primitive.d.ts +19 -0
  150. package/build/tokens/primitive.js +19 -0
  151. package/build/tokens/semantic-dark.d.ts +26 -24
  152. package/build/tokens/semantic-dark.js +26 -24
  153. package/build/tokens/semantic-light.d.ts +18 -16
  154. package/build/tokens/semantic-light.js +18 -16
  155. package/build/types/values.d.ts +2 -1
  156. package/build/utils/formatThousands.d.ts +2 -0
  157. package/build/utils/formatThousands.js +16 -0
  158. package/build/utils/index.d.ts +1 -0
  159. package/build/utils/index.js +1 -0
  160. package/docs/assets/bank-logo.png +0 -0
  161. package/docs/assets/bank-logo1.png +0 -0
  162. package/docs/components/AllComponents.web.tsx +97 -8
  163. package/docs/components/NextPrevPage.tsx +11 -3
  164. package/docs/components/UsageWrap.tsx +2 -2
  165. package/docs/components/index.ts +6 -7
  166. package/docs/heplers/addReactNativePrefix.ts +8 -0
  167. package/docs/heplers/index.ts +1 -0
  168. package/docs/introduction.mdx +3 -3
  169. package/docs/theme-tokens.mdx +42 -0
  170. package/package.json +13 -13
  171. package/src/components/Alert/AlertCloseButton.tsx +33 -5
  172. package/src/components/Alert/AlertIcon.tsx +17 -1
  173. package/src/components/Alert/AlertIconButton.tsx +37 -4
  174. package/src/components/Alert/AlertLink.tsx +52 -1
  175. package/src/components/Alert/AlertText.tsx +28 -3
  176. package/src/components/Alert/AlertTitle.tsx +28 -3
  177. package/src/components/Badge/Badge.docs.mdx +7 -7
  178. package/src/components/Badge/Badge.props.ts +3 -2
  179. package/src/components/Badge/Badge.stories.tsx +81 -92
  180. package/src/components/Badge/Badge.tsx +101 -14
  181. package/src/components/Badge/BadgeIcon.tsx +27 -29
  182. package/src/components/Badge/BadgeText.tsx +29 -31
  183. package/src/components/Button/ButtonGroupRoot.tsx +12 -2
  184. package/src/components/Button/ButtonRoot.tsx +1 -0
  185. package/src/components/Card/Card.docs.mdx +1 -1
  186. package/src/components/Card/Card.props.ts +2 -2
  187. package/src/components/Checkbox/Checkbox.docs.mdx +45 -7
  188. package/src/components/Checkbox/Checkbox.props.ts +3 -1
  189. package/src/components/Checkbox/Checkbox.stories.tsx +37 -1
  190. package/src/components/Checkbox/Checkbox.tsx +12 -9
  191. package/src/components/Checkbox/CheckboxIcon.tsx +1 -1
  192. package/src/components/Checkbox/CheckboxImage.tsx +9 -0
  193. package/src/components/Checkbox/CheckboxTileRoot.tsx +1 -1
  194. package/src/components/Checkbox/index.ts +3 -2
  195. package/src/components/CurrencyInput/CurrencyInput.docs.mdx +120 -0
  196. package/src/components/CurrencyInput/CurrencyInput.props.ts +19 -0
  197. package/src/components/CurrencyInput/CurrencyInput.stories.tsx +116 -0
  198. package/src/components/CurrencyInput/CurrencyInput.tsx +91 -0
  199. package/src/components/CurrencyInput/index.ts +1 -0
  200. package/src/components/DescriptionList/DescriptionList.context.ts +18 -0
  201. package/src/components/DescriptionList/DescriptionList.docs.mdx +98 -0
  202. package/src/components/DescriptionList/DescriptionList.props.ts +20 -0
  203. package/src/components/DescriptionList/DescriptionList.stories.tsx +154 -0
  204. package/src/components/DescriptionList/DescriptionList.tsx +64 -0
  205. package/src/components/DescriptionList/DescriptionListItem.props.ts +19 -0
  206. package/src/components/DescriptionList/DescriptionListItem.tsx +101 -0
  207. package/src/components/DescriptionList/index.ts +4 -0
  208. package/src/components/Divider/Divider.props.ts +2 -2
  209. package/src/components/Divider/Divider.stories.tsx +3 -3
  210. package/src/components/Divider/Divider.tsx +46 -0
  211. package/src/components/Flex/Flex.docs.mdx +4 -4
  212. package/src/components/Flex/Flex.props.ts +3 -2
  213. package/src/components/Flex/Flex.stories.tsx +1 -1
  214. package/src/components/Grid/Grid.docs.mdx +12 -12
  215. package/src/components/Grid/Grid.props.ts +2 -2
  216. package/src/components/Grid/Grid.stories.tsx +2 -2
  217. package/src/components/IconContainer/IconContainer.docs.mdx +90 -0
  218. package/src/components/IconContainer/IconContainer.props.ts +17 -0
  219. package/src/components/IconContainer/IconContainer.stories.tsx +130 -0
  220. package/src/components/IconContainer/IconContainer.tsx +180 -0
  221. package/src/components/IconContainer/index.tsx +2 -0
  222. package/src/components/Icons/CircleIcon.tsx +9 -11
  223. package/src/components/Input/Input.docs.mdx +3 -3
  224. package/src/components/Input/Input.props.ts +0 -20
  225. package/src/components/Input/Input.stories.tsx +0 -6
  226. package/src/components/Input/Input.tsx +2 -49
  227. package/src/components/Input/InputField.tsx +0 -7
  228. package/src/components/Link/Link.props.ts +3 -0
  229. package/src/components/Link/Link.tsx +12 -6
  230. package/src/components/List/List.docs.mdx +24 -23
  231. package/src/components/Modal/Modal.tsx +18 -0
  232. package/src/components/Radio/Radio.docs.mdx +96 -124
  233. package/src/components/Radio/Radio.props.ts +3 -1
  234. package/src/components/Radio/Radio.stories.tsx +47 -0
  235. package/src/components/Radio/Radio.tsx +10 -7
  236. package/src/components/Radio/RadioImage.tsx +9 -0
  237. package/src/components/Radio/RadioTileRoot.tsx +1 -1
  238. package/src/components/Radio/index.ts +3 -2
  239. package/src/components/SectionHeader/SectionHeader.tsx +1 -0
  240. package/src/components/Select/Select.docs.mdx +6 -6
  241. package/src/components/Select/Select.stories.tsx +7 -7
  242. package/src/components/Select/SelectOption.tsx +4 -10
  243. package/src/components/Tabs/Tab.props.ts +16 -0
  244. package/src/components/Tabs/Tab.tsx +113 -0
  245. package/src/components/Tabs/TabPanel.props.ts +10 -0
  246. package/src/components/Tabs/TabPanel.tsx +46 -0
  247. package/src/components/Tabs/Tabs.context.ts +26 -0
  248. package/src/components/Tabs/Tabs.docs.mdx +214 -0
  249. package/src/components/Tabs/Tabs.props.ts +21 -0
  250. package/src/components/Tabs/Tabs.stories.tsx +270 -0
  251. package/src/components/Tabs/Tabs.tsx +139 -0
  252. package/src/components/Tabs/TabsList.props.ts +8 -0
  253. package/src/components/Tabs/TabsList.tsx +194 -0
  254. package/src/components/Tabs/index.ts +8 -0
  255. package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
  256. package/src/components/UnstyledIconButton/UnstyledIconButton.tsx +9 -3
  257. package/src/components/index.ts +4 -0
  258. package/src/core/themes.ts +57 -1
  259. package/src/tokens/color.ts +44 -40
  260. package/src/tokens/components/dark/alert.ts +13 -0
  261. package/src/tokens/components/dark/button.ts +1 -0
  262. package/src/tokens/components/dark/checkbox.ts +4 -1
  263. package/src/tokens/components/dark/icon-button.ts +10 -3
  264. package/src/tokens/components/dark/index.ts +1 -0
  265. package/src/tokens/components/dark/link.ts +5 -0
  266. package/src/tokens/components/dark/progress-bar.ts +41 -0
  267. package/src/tokens/components/dark/radio.ts +1 -1
  268. package/src/tokens/components/dark/tabs.ts +2 -0
  269. package/src/tokens/components/light/alert.ts +13 -0
  270. package/src/tokens/components/light/badge.ts +1 -1
  271. package/src/tokens/components/light/button.ts +1 -0
  272. package/src/tokens/components/light/checkbox.ts +6 -3
  273. package/src/tokens/components/light/icon-button.ts +8 -1
  274. package/src/tokens/components/light/index.ts +1 -0
  275. package/src/tokens/components/light/link.ts +5 -0
  276. package/src/tokens/components/light/progress-bar.ts +41 -0
  277. package/src/tokens/components/light/radio.ts +3 -3
  278. package/src/tokens/components/light/tabs.ts +2 -0
  279. package/src/tokens/index.ts +1 -0
  280. package/src/tokens/layout.ts +24 -15
  281. package/src/tokens/motion.ts +23 -0
  282. package/src/tokens/primitive.ts +19 -0
  283. package/src/tokens/semantic-dark.ts +26 -24
  284. package/src/tokens/semantic-light.ts +18 -16
  285. package/src/types/values.ts +3 -1
  286. package/src/utils/formatThousands.ts +14 -0
  287. package/src/utils/index.ts +1 -0
  288. package/docs/assets/react-native-pig.png +0 -0
  289. package/docs/components/AdvancedRadioExample.tsx +0 -126
@@ -0,0 +1,4 @@
1
+ export { default as DescriptionList } from './DescriptionList';
2
+ export type { default as DescriptionListProps } from './DescriptionList.props';
3
+ export { default as DescriptionListItem } from './DescriptionListItem';
4
+ export type { default as DescriptionListItemProps } from './DescriptionListItem.props';
@@ -1,9 +1,9 @@
1
1
  import type { DimensionValue, ViewProps } from 'react-native';
2
- import type { ColorValue } from '../../types';
2
+ import type { ColorValue, SpacingValues } from '../../types';
3
3
 
4
4
  interface DividerProps extends Omit<ViewProps, 'children'> {
5
5
  color?: ColorValue;
6
- space?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ space?: SpacingValues;
7
7
  orientation?: 'horizontal' | 'vertical';
8
8
  height?: DimensionValue;
9
9
  width?: DimensionValue;
@@ -1,7 +1,7 @@
1
- import { Divider } from '.';
2
1
  import { Meta, StoryObj } from '@storybook/react-vite';
3
- import { Box } from '../Box';
2
+ import { Divider } from '.';
4
3
  import { coloursAsArray } from '../../utils';
4
+ import { Box } from '../Box';
5
5
 
6
6
  const meta = {
7
7
  title: 'Stories / Divider',
@@ -21,7 +21,7 @@ const meta = {
21
21
  description: 'Color of the divider',
22
22
  },
23
23
  space: {
24
- options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
24
+ options: ['none', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl'],
25
25
  control: 'select',
26
26
  description: 'Space between the divider',
27
27
  },
@@ -44,11 +44,13 @@ const styles = StyleSheet.create(theme => ({
44
44
  },
45
45
  space: {
46
46
  none: {},
47
+ '2xs': {},
47
48
  xs: {},
48
49
  sm: {},
49
50
  md: {},
50
51
  lg: {},
51
52
  xl: {},
53
+ '2xl': {},
52
54
  },
53
55
  flexItem: {
54
56
  true: {
@@ -64,6 +66,17 @@ const styles = StyleSheet.create(theme => ({
64
66
  marginVertical: 0,
65
67
  },
66
68
  },
69
+ {
70
+ orientation: 'horizontal',
71
+ space: '2xs',
72
+ styles: {
73
+ marginVertical: {
74
+ base: theme.layout.mobile.spacing['2xs'],
75
+ md: theme.layout.tablet.spacing['2xs'],
76
+ lg: theme.layout.desktop.spacing['2xs'],
77
+ },
78
+ },
79
+ },
67
80
  {
68
81
  orientation: 'horizontal',
69
82
  space: 'xs',
@@ -119,6 +132,17 @@ const styles = StyleSheet.create(theme => ({
119
132
  },
120
133
  },
121
134
  },
135
+ {
136
+ orientation: 'horizontal',
137
+ space: '2xl',
138
+ styles: {
139
+ marginVertical: {
140
+ base: theme.layout.mobile.spacing['2xl'],
141
+ md: theme.layout.tablet.spacing['2xl'],
142
+ lg: theme.layout.desktop.spacing['2xl'],
143
+ },
144
+ },
145
+ },
122
146
  {
123
147
  orientation: 'vertical',
124
148
  space: 'none',
@@ -126,6 +150,17 @@ const styles = StyleSheet.create(theme => ({
126
150
  marginHorizontal: 0,
127
151
  },
128
152
  },
153
+ {
154
+ orientation: 'vertical',
155
+ space: '2xs',
156
+ styles: {
157
+ marginHorizontal: {
158
+ base: theme.layout.mobile.spacing['2xs'],
159
+ md: theme.layout.tablet.spacing['2xs'],
160
+ lg: theme.layout.desktop.spacing['2xs'],
161
+ },
162
+ },
163
+ },
129
164
  {
130
165
  orientation: 'vertical',
131
166
  space: 'xs',
@@ -181,6 +216,17 @@ const styles = StyleSheet.create(theme => ({
181
216
  },
182
217
  },
183
218
  },
219
+ {
220
+ orientation: 'vertical',
221
+ space: '2xl',
222
+ styles: {
223
+ marginHorizontal: {
224
+ base: theme.layout.mobile.spacing['2xl'],
225
+ md: theme.layout.tablet.spacing['2xl'],
226
+ lg: theme.layout.desktop.spacing['2xl'],
227
+ },
228
+ },
229
+ },
184
230
  ],
185
231
  },
186
232
  extraStyles: (color, width, height) => ({
@@ -1,7 +1,7 @@
1
- import { Meta, Canvas, Story, Controls, Primary } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta, Primary, Story } from '@storybook/addon-docs/blocks';
2
+ import { BodyText, Center, Flex, Pressable } from '../..';
3
+ import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
2
4
  import * as Stories from './Flex.stories';
3
- import { Center, Pressable, Flex, BodyText } from '../..';
4
- import { UsageWrap, BackToTopButton, ViewFigmaButton } from '../../../docs/components';
5
5
 
6
6
  <Meta title="Primitives / Flex" />
7
7
 
@@ -57,4 +57,4 @@ const MyComponent = () => (
57
57
  | `wrap` | `'wrap' \| 'nowrap' \| 'wrap-reverse'` | `nowrap` | The wrap of the flex container. |
58
58
  | `justify` | `'flex-start' \| 'flex-end' \| 'center' \| `<br />`'space-between' \| 'space-around' \| 'space-evenly'` | `flex-start` | The justify content of the flex container. |
59
59
  | `align` | `'flex-start' \| 'flex-end' \| 'center' \| 'stretch' \| 'baseline'` | `flex-start` | The align items of the flex container. |
60
- | `space` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `md` | The space between the content. |
60
+ | `space` | `'none' \| '2xs' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` | `md` | The space between the content. |
@@ -1,11 +1,12 @@
1
- import type { ViewProps, ViewStyle, FlexAlignType } from 'react-native';
1
+ import type { FlexAlignType, ViewProps, ViewStyle } from 'react-native';
2
+ import { SpacingValues } from '../../types';
2
3
 
3
4
  interface FlexProps extends ViewProps {
4
5
  direction?: ViewStyle['flexDirection'];
5
6
  align?: FlexAlignType;
6
7
  justify?: ViewStyle['justifyContent'];
7
8
  wrap?: ViewStyle['flexWrap'];
8
- space?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
+ space?: SpacingValues;
9
10
  }
10
11
 
11
12
  export default FlexProps;
@@ -40,7 +40,7 @@ const meta = {
40
40
  description: 'The justify of the flex container.',
41
41
  },
42
42
  space: {
43
- options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
43
+ options: ['none', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl'],
44
44
  control: 'radio',
45
45
  description: 'The space of the flex container.',
46
46
  },
@@ -1,7 +1,7 @@
1
- import { Meta, Canvas, Story, Controls, Primary } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta, Primary, Story } from '@storybook/addon-docs/blocks';
2
+ import { BodyText, Box, Center, Grid } from '../..';
3
+ import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
2
4
  import * as Stories from './Grid.stories';
3
- import { Center, Grid, Box, BodyText } from '../..';
4
- import { UsageWrap, BackToTopButton, ViewFigmaButton } from '../../../docs/components';
5
5
 
6
6
  <Meta title="Primitives / Grid" />
7
7
 
@@ -173,15 +173,15 @@ const MyComponent = () => (
173
173
 
174
174
  The Grid component extends all the props from the [View component](https://reactnative.dev/docs/view), and adds the following:
175
175
 
176
- | Name | Type | Default | Description |
177
- | ---------------- | ------------------------------------------------ | ------- | ------------------------------------------------------------- |
178
- | `columns` | `number` or `GridColumns` | 2 | Number of columns or responsive object with breakpoint values |
179
- | `space` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | - | Spacing between grid items (both rows and columns) |
180
- | `columnGap` | `number` | - | Gap between columns (overrides spacing if provided) |
181
- | `rowGap` | `number` | - | Gap between rows (overrides spacing if provided) |
182
- | `containerStyle` | `StyleProp\<ViewStyle\>` | - | Style for the grid container |
183
- | `itemStyle` | `StyleProp\<ViewStyle\>` | - | Style applied to each grid item |
184
- | `rowStyle` | `StyleProp\<ViewStyle\>` | - | Style applied to each row |
176
+ | Name | Type | Default | Description |
177
+ | ---------------- | ------------------------------------------------------------------ | ------- | ------------------------------------------------------------- |
178
+ | `columns` | `number` or `GridColumns` | 2 | Number of columns or responsive object with breakpoint values |
179
+ | `space` | `'none' \| '2xs' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` | - | Spacing between grid items (both rows and columns) |
180
+ | `columnGap` | `number` | - | Gap between columns (overrides spacing if provided) |
181
+ | `rowGap` | `number` | - | Gap between rows (overrides spacing if provided) |
182
+ | `containerStyle` | `StyleProp\<ViewStyle\>` | - | Style for the grid container |
183
+ | `itemStyle` | `StyleProp\<ViewStyle\>` | - | Style applied to each grid item |
184
+ | `rowStyle` | `StyleProp\<ViewStyle\>` | - | Style applied to each row |
185
185
 
186
186
  Where `GridColumns` is defined as:
187
187
 
@@ -1,6 +1,6 @@
1
1
  import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
2
  import { UnistylesBreakpoints } from 'react-native-unistyles';
3
- import { SpaceValue } from '../../types';
3
+ import { SpaceValue, SpacingValues } from '../../types';
4
4
 
5
5
  // Create a type that uses the keys from our breakpoints object
6
6
  export type GridColumns = {
@@ -17,7 +17,7 @@ export interface GridProps extends ViewProps {
17
17
  /**
18
18
  * Spacing between grid items (applies to both rows and columns)
19
19
  */
20
- space?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
20
+ space?: SpacingValues;
21
21
 
22
22
  /**
23
23
  * Gap between items (overrides spacing if provided)
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { View, Text } from 'react-native';
2
+ import { Text, View } from 'react-native';
3
3
  import { Grid } from '.';
4
4
 
5
5
  const meta = {
@@ -14,7 +14,7 @@ const meta = {
14
14
  description: 'Number of columns or responsive object with breakpoints',
15
15
  },
16
16
  space: {
17
- options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
17
+ options: ['none', '2xs', 'xs', 'sm', 'md', 'lg', 'xl', '2xl'],
18
18
  control: 'radio',
19
19
  description: 'Responsive spacing between grid items (applied to both rows and columns).',
20
20
  },
@@ -0,0 +1,90 @@
1
+ import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
2
+ import {
3
+ BroadbandMediumIcon,
4
+ CashbackCardMediumIcon,
5
+ ElectricityMediumIcon,
6
+ EmailMediumIcon,
7
+ InsuranceMediumIcon,
8
+ MobileMediumIcon,
9
+ } from '@utilitywarehouse/hearth-react-native-icons';
10
+ import { Center, Flex, IconContainer } from '../../';
11
+ import { BackToTopButton, UsageWrap } from '../../../docs/components';
12
+ import * as Stories from './IconContainer.stories';
13
+
14
+ <BackToTopButton />
15
+
16
+ <Meta title="Components / Icon Container" />
17
+
18
+ # Icon Container
19
+
20
+ The `IconContainer` component provides a consistent background and sizing (via component tokens) for any standalone icon, with semantic colour families and subtle/emphasis variants.
21
+
22
+ - [Playground](#playground)
23
+ - [Usage](#usage)
24
+ - [Props](#props)
25
+ - [Variants](#variants)
26
+
27
+ ## Playground
28
+
29
+ <Canvas of={Stories.Playground} />
30
+
31
+ <Controls of={Stories.Playground} />
32
+
33
+ ## Usage
34
+
35
+ Wrap an icon with the `IconContainer` to apply sizing + background styles without repeating layout code.
36
+
37
+ <UsageWrap>
38
+ <Center>
39
+ <Flex direction="row" space="lg" alignItems="center">
40
+ <IconContainer icon={ElectricityMediumIcon} size="md" variant="emphasis" color="energy" />
41
+ <IconContainer icon={BroadbandMediumIcon} size="md" variant="emphasis" color="broadband" />
42
+ <IconContainer icon={MobileMediumIcon} size="md" variant="emphasis" color="mobile" />
43
+ <IconContainer icon={InsuranceMediumIcon} size="md" variant="emphasis" color="insurance" />
44
+ <IconContainer icon={CashbackCardMediumIcon} size="md" variant="emphasis" color="cashback" />
45
+ <IconContainer icon={EmailMediumIcon} size="md" variant="emphasis" color="pig" />
46
+ </Flex>
47
+ </Center>
48
+ </UsageWrap>
49
+
50
+ ```jsx
51
+ import { IconContainer } from '@utilitywarehouse/hearth-react-native';
52
+ import {
53
+ ElectricityMediumIcon,
54
+ BroadbandMediumIcon,
55
+ MobileMediumIcon,
56
+ InsuranceMediumIcon,
57
+ CashbackCardMediumIcon,
58
+ ,
59
+ } from '@utilitywarehouse/hearth-react-native-icons';
60
+
61
+ const MyComponent = () => (
62
+ <>
63
+ <IconContainer icon={ElectricityMediumIcon} size="md" variant="emphasis" color="energy" />
64
+ <IconContainer icon={BroadbandMediumIcon} size="md" variant="emphasis" color="broadband" />
65
+ <IconContainer icon={MobileMediumIcon} size="md" variant="emphasis" color="mobile" />
66
+ <IconContainer icon={InsuranceMediumIcon} size="md" variant="emphasis" color="insurance" />
67
+ <IconContainer icon={CashbackCardMediumIcon} size="md" variant="emphasis" color="cashback" />
68
+ <IconContainer icon={EmailMediumIcon} size="md" variant="emphasis" color="pig" />
69
+ </>
70
+ );
71
+ ```
72
+
73
+ ## Props
74
+
75
+ | Name | Type | Description | Default |
76
+ | ------------ | -------------------------------------------------------------------------------------------------- | ----------------------------------------------- | ---------- |
77
+ | `icon` | `React.ComponentType` | Icon component rendered inside the container | (required) |
78
+ | `size` | `'sm' \| 'md' \| 'lg'` | Size variant (token-based width/height/padding) | `md` |
79
+ | `radiusNone` | `boolean` | Remove border radius (square container) | `false` |
80
+ | `variant` | `'subtle' \| 'emphasis'` | Background emphasis level | `subtle` |
81
+ | `color` | `'pig' \| 'energy' \| 'broadband' \| 'mobile' \|` <br />`'insurance' \| 'cashback' \| 'highlight'` | Semantic colour family for surface tokens | `pig` |
82
+ | `...View` | React Native `ViewProps` | Any additional View props | - |
83
+
84
+ > Colours resolve to `theme.color.surface.<family>.{subtle|default}` depending on variant.
85
+
86
+ ## Variants
87
+
88
+ Use the matrix below to compare every combination of size, variant, and color.
89
+
90
+ <Canvas of={Stories.KitchenSink} />
@@ -0,0 +1,17 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { ViewProps } from 'react-native';
3
+
4
+ export interface IconContainerProps extends ViewProps {
5
+ /** Icon component to render inside the container */
6
+ icon: ComponentType;
7
+ /** Size of the container */
8
+ size?: 'sm' | 'md' | 'lg';
9
+ /** If true, removes border radius from the container */
10
+ radiusNone?: boolean;
11
+ /** Background style of the container */
12
+ variant?: 'subtle' | 'emphasis';
13
+ /** Background color token of the container */
14
+ color?: 'pig' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'highlight';
15
+ }
16
+
17
+ export default IconContainerProps;
@@ -0,0 +1,130 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import * as Icons from '@utilitywarehouse/hearth-react-native-icons';
3
+ import { IconContainer } from '.';
4
+ import { VariantTitle } from '../../../docs/components';
5
+ import { Box } from '../Box';
6
+ import { Flex } from '../Flex';
7
+
8
+ type IconKey = keyof typeof Icons;
9
+
10
+ const meta: Meta<typeof IconContainer> = {
11
+ title: 'Stories / IconContainer',
12
+ component: IconContainer,
13
+ parameters: {
14
+ layout: 'centered',
15
+ },
16
+ argTypes: {
17
+ icon: {
18
+ control: 'select',
19
+ options: Object.keys(Icons),
20
+ mapping: Icons,
21
+ description: 'Icon component rendered inside the container',
22
+ },
23
+ size: {
24
+ control: 'select',
25
+ options: ['sm', 'md', 'lg'],
26
+ description: 'Size variant',
27
+ },
28
+ radiusNone: {
29
+ control: 'boolean',
30
+ description: 'Remove border radius (square edges)',
31
+ },
32
+ variant: {
33
+ control: 'select',
34
+ options: ['subtle', 'emphasis'],
35
+ description: 'Background emphasis style',
36
+ },
37
+ color: {
38
+ control: 'select',
39
+ options: ['pig', 'energy', 'broadband', 'mobile', 'insurance', 'cashback', 'highlight'],
40
+ description: 'Semantic color surface family',
41
+ },
42
+ },
43
+ args: {
44
+ icon: Icons[Object.keys(Icons)[0] as IconKey],
45
+ size: 'md',
46
+ radiusNone: false,
47
+ variant: 'subtle',
48
+ color: 'pig',
49
+ },
50
+ };
51
+
52
+ export default meta;
53
+
54
+ type Story = StoryObj<typeof meta>;
55
+
56
+ export const Playground: Story = { render: args => <IconContainer {...args} /> };
57
+
58
+ export const Subtle: Story = {
59
+ parameters: {
60
+ controls: { exclude: ['variant'] },
61
+ },
62
+ args: {
63
+ variant: 'subtle',
64
+ },
65
+ };
66
+
67
+ export const Emphasis: Story = {
68
+ parameters: {
69
+ controls: { exclude: ['variant'] },
70
+ },
71
+ args: {
72
+ variant: 'emphasis',
73
+ },
74
+ };
75
+
76
+ export const RadiusNone: Story = {
77
+ parameters: {
78
+ controls: { exclude: ['radiusNone'] },
79
+ },
80
+ args: {
81
+ radiusNone: true,
82
+ },
83
+ };
84
+
85
+ export const KitchenSink: Story = {
86
+ parameters: {
87
+ controls: { exclude: ['radiusNone', 'variant', 'color', 'size'] },
88
+ },
89
+ render: ({ icon }) => {
90
+ const sizes: Array<'sm' | 'md' | 'lg'> = ['sm', 'md', 'lg'];
91
+ const colors: Array<
92
+ 'pig' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'highlight'
93
+ > = ['pig', 'energy', 'broadband', 'mobile', 'insurance', 'cashback', 'highlight'];
94
+ return (
95
+ <Flex direction="column" space="lg">
96
+ {sizes.map(size => (
97
+ <Box key={size} gap="300">
98
+ <VariantTitle title={`Size: ${size.toUpperCase()} / Subtle`}> </VariantTitle>
99
+ <Flex direction="row" wrap="wrap" space="md">
100
+ {colors.map(color => (
101
+ <IconContainer
102
+ key={`${size}-subtle-${color}`}
103
+ icon={icon}
104
+ size={size}
105
+ variant="subtle"
106
+ color={color}
107
+ />
108
+ ))}
109
+ </Flex>
110
+ <VariantTitle title={`Size: ${size.toUpperCase()} / Emphasis`}> </VariantTitle>
111
+ <Flex direction="row" wrap="wrap" space="md">
112
+ {colors.map(
113
+ color =>
114
+ color !== 'highlight' && (
115
+ <IconContainer
116
+ key={`${size}-emphasis-${color}`}
117
+ icon={icon}
118
+ size={size}
119
+ variant="emphasis"
120
+ color={color}
121
+ />
122
+ )
123
+ )}
124
+ </Flex>
125
+ </Box>
126
+ ))}
127
+ </Flex>
128
+ );
129
+ },
130
+ };
@@ -0,0 +1,180 @@
1
+ import { View } from 'react-native';
2
+ import { StyleSheet, withUnistyles } from 'react-native-unistyles';
3
+ import { Icon } from '../Icon';
4
+ import type IconContainerProps from './IconContainer.props';
5
+
6
+ const IconContainer = withUnistyles(
7
+ ({
8
+ icon: IconComp,
9
+ size = 'md',
10
+ radiusNone = false,
11
+ variant = 'subtle',
12
+ color = 'pig',
13
+ style,
14
+ ...props
15
+ }: IconContainerProps) => {
16
+ styles.useVariants({ size, radiusNone, variant, color });
17
+
18
+ return (
19
+ <View style={[styles.container, style]} {...props}>
20
+ {IconComp ? <Icon as={IconComp} style={styles.icon} /> : null}
21
+ </View>
22
+ );
23
+ }
24
+ );
25
+
26
+ IconContainer.displayName = 'IconContainer';
27
+
28
+ const styles = StyleSheet.create(theme => ({
29
+ container: {
30
+ alignItems: 'center',
31
+ justifyContent: 'center',
32
+ overflow: 'hidden',
33
+ variants: {
34
+ size: {
35
+ sm: {
36
+ width: theme.components.iconContainer.sm.width,
37
+ height: theme.components.iconContainer.sm.height,
38
+ padding: theme.components.iconContainer.sm.padding,
39
+ borderRadius: theme.components.iconContainer.sm.borderRadiusRounded,
40
+ },
41
+ md: {
42
+ width: theme.components.iconContainer.md.width,
43
+ height: theme.components.iconContainer.md.height,
44
+ padding: theme.components.iconContainer.md.padding,
45
+ borderRadius: theme.components.iconContainer.md.borderRadiusRounded,
46
+ },
47
+ lg: {
48
+ width: theme.components.iconContainer.lg.width,
49
+ height: theme.components.iconContainer.lg.height,
50
+ padding: theme.components.iconContainer.lg.padding,
51
+ borderRadius: theme.components.iconContainer.lg.borderRadiusRounded,
52
+ },
53
+ },
54
+ radiusNone: {
55
+ true: {
56
+ borderRadius: 0,
57
+ },
58
+ false: {},
59
+ },
60
+ variant: {
61
+ subtle: {},
62
+ emphasis: {},
63
+ },
64
+ color: {
65
+ pig: {},
66
+ energy: {},
67
+ broadband: {},
68
+ mobile: {},
69
+ insurance: {},
70
+ cashback: {},
71
+ highlight: {},
72
+ },
73
+ },
74
+ compoundVariants: [
75
+ {
76
+ variant: 'emphasis',
77
+ color: 'pig',
78
+ styles: {
79
+ backgroundColor: theme.color.surface.pig.default,
80
+ },
81
+ },
82
+ {
83
+ variant: 'subtle',
84
+ color: 'pig',
85
+ styles: {
86
+ backgroundColor: theme.color.surface.pig.subtle,
87
+ },
88
+ },
89
+ {
90
+ variant: 'emphasis',
91
+ color: 'energy',
92
+ styles: {
93
+ backgroundColor: theme.color.surface.energy.default,
94
+ },
95
+ },
96
+ {
97
+ variant: 'subtle',
98
+ color: 'energy',
99
+ styles: {
100
+ backgroundColor: theme.color.surface.energy.subtle,
101
+ },
102
+ },
103
+ {
104
+ variant: 'emphasis',
105
+ color: 'broadband',
106
+ styles: {
107
+ backgroundColor: theme.color.surface.broadband.default,
108
+ },
109
+ },
110
+ {
111
+ variant: 'subtle',
112
+ color: 'broadband',
113
+ styles: {
114
+ backgroundColor: theme.color.surface.broadband.subtle,
115
+ },
116
+ },
117
+ {
118
+ variant: 'emphasis',
119
+ color: 'mobile',
120
+ styles: {
121
+ backgroundColor: theme.color.surface.mobile.default,
122
+ },
123
+ },
124
+ {
125
+ variant: 'subtle',
126
+ color: 'mobile',
127
+ styles: {
128
+ backgroundColor: theme.color.surface.mobile.subtle,
129
+ },
130
+ },
131
+ {
132
+ variant: 'emphasis',
133
+ color: 'insurance',
134
+ styles: {
135
+ backgroundColor: theme.color.surface.insurance.default,
136
+ },
137
+ },
138
+ {
139
+ variant: 'subtle',
140
+ color: 'insurance',
141
+ styles: {
142
+ backgroundColor: theme.color.surface.insurance.subtle,
143
+ },
144
+ },
145
+ {
146
+ variant: 'emphasis',
147
+ color: 'cashback',
148
+ styles: {
149
+ backgroundColor: theme.color.surface.cashback.default,
150
+ },
151
+ },
152
+ {
153
+ variant: 'subtle',
154
+ color: 'cashback',
155
+ styles: {
156
+ backgroundColor: theme.color.surface.cashback.subtle,
157
+ },
158
+ },
159
+ {
160
+ variant: 'emphasis',
161
+ color: 'highlight',
162
+ styles: {
163
+ backgroundColor: theme.color.surface.highlight.default,
164
+ },
165
+ },
166
+ {
167
+ variant: 'subtle',
168
+ color: 'highlight',
169
+ styles: {
170
+ backgroundColor: theme.color.surface.highlight.subtle,
171
+ },
172
+ },
173
+ ],
174
+ },
175
+ icon: {
176
+ color: theme.color.icon.primary,
177
+ },
178
+ }));
179
+
180
+ export default IconContainer;
@@ -0,0 +1,2 @@
1
+ export { default as IconContainer } from './IconContainer';
2
+ export type { default as IconContainerProps } from './IconContainer.props';