@utilitywarehouse/hearth-react-native 0.2.0 → 0.3.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 (187) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/CHANGELOG.md +22 -0
  4. package/build/components/Badge/Badge.js +101 -14
  5. package/build/components/Badge/Badge.props.d.ts +2 -2
  6. package/build/components/Badge/BadgeIcon.js +5 -79
  7. package/build/components/Badge/BadgeText.js +7 -81
  8. package/build/components/Button/Button.d.ts +2 -2
  9. package/build/components/Button/ButtonGroupRoot.d.ts +3 -2
  10. package/build/components/Button/ButtonGroupRoot.js +9 -0
  11. package/build/components/Card/Card.props.d.ts +2 -2
  12. package/build/components/CurrencyInput/CurrencyInput.d.ts +6 -0
  13. package/build/components/CurrencyInput/CurrencyInput.js +47 -0
  14. package/build/components/CurrencyInput/CurrencyInput.props.d.ts +14 -0
  15. package/build/components/CurrencyInput/CurrencyInput.props.js +1 -0
  16. package/build/components/CurrencyInput/index.d.ts +1 -0
  17. package/build/components/CurrencyInput/index.js +1 -0
  18. package/build/components/DescriptionList/DescriptionList.context.d.ts +6 -0
  19. package/build/components/DescriptionList/DescriptionList.context.js +9 -0
  20. package/build/components/DescriptionList/DescriptionList.d.ts +6 -0
  21. package/build/components/DescriptionList/DescriptionList.js +25 -0
  22. package/build/components/DescriptionList/DescriptionList.props.d.ts +18 -0
  23. package/build/components/DescriptionList/DescriptionList.props.js +1 -0
  24. package/build/components/DescriptionList/DescriptionListItem.d.ts +6 -0
  25. package/build/components/DescriptionList/DescriptionListItem.js +49 -0
  26. package/build/components/DescriptionList/DescriptionListItem.props.d.ts +17 -0
  27. package/build/components/DescriptionList/DescriptionListItem.props.js +1 -0
  28. package/build/components/DescriptionList/index.d.ts +4 -0
  29. package/build/components/DescriptionList/index.js +2 -0
  30. package/build/components/Divider/Divider.js +46 -0
  31. package/build/components/Divider/Divider.props.d.ts +2 -2
  32. package/build/components/Flex/Flex.props.d.ts +3 -2
  33. package/build/components/Grid/Grid.props.d.ts +2 -2
  34. package/build/components/IconContainer/IconContainer.d.ts +5 -0
  35. package/build/components/IconContainer/IconContainer.js +161 -0
  36. package/build/components/IconContainer/IconContainer.props.d.ts +15 -0
  37. package/build/components/IconContainer/IconContainer.props.js +1 -0
  38. package/build/components/IconContainer/index.d.ts +2 -0
  39. package/build/components/IconContainer/index.js +1 -0
  40. package/build/components/Icons/CircleIcon.js +3 -3
  41. package/build/components/Input/Input.js +2 -34
  42. package/build/components/Input/Input.props.d.ts +1 -17
  43. package/build/components/Input/InputField.js +0 -7
  44. package/build/components/Modal/Modal.js +17 -1
  45. package/build/components/SectionHeader/SectionHeader.js +1 -0
  46. package/build/components/Tabs/Tab.d.ts +18 -0
  47. package/build/components/Tabs/Tab.js +74 -0
  48. package/build/components/Tabs/Tab.props.d.ts +14 -0
  49. package/build/components/Tabs/Tab.props.js +1 -0
  50. package/build/components/Tabs/TabPanel.d.ts +3 -0
  51. package/build/components/Tabs/TabPanel.js +34 -0
  52. package/build/components/Tabs/TabPanel.props.d.ts +8 -0
  53. package/build/components/Tabs/TabPanel.props.js +1 -0
  54. package/build/components/Tabs/Tabs.context.d.ts +23 -0
  55. package/build/components/Tabs/Tabs.context.js +8 -0
  56. package/build/components/Tabs/Tabs.d.ts +6 -0
  57. package/build/components/Tabs/Tabs.js +114 -0
  58. package/build/components/Tabs/Tabs.props.d.ts +19 -0
  59. package/build/components/Tabs/Tabs.props.js +1 -0
  60. package/build/components/Tabs/TabsList.d.ts +6 -0
  61. package/build/components/Tabs/TabsList.js +112 -0
  62. package/build/components/Tabs/TabsList.props.d.ts +6 -0
  63. package/build/components/Tabs/TabsList.props.js +1 -0
  64. package/build/components/Tabs/index.d.ts +8 -0
  65. package/build/components/Tabs/index.js +4 -0
  66. package/build/components/index.d.ts +4 -0
  67. package/build/components/index.js +4 -0
  68. package/build/core/themes.d.ts +416 -148
  69. package/build/core/themes.js +57 -1
  70. package/build/tokens/color.d.ts +76 -68
  71. package/build/tokens/color.js +38 -34
  72. package/build/tokens/components/dark/button.d.ts +1 -0
  73. package/build/tokens/components/dark/button.js +1 -0
  74. package/build/tokens/components/dark/checkbox.d.ts +1 -1
  75. package/build/tokens/components/dark/checkbox.js +1 -1
  76. package/build/tokens/components/dark/icon-button.d.ts +3 -3
  77. package/build/tokens/components/dark/icon-button.js +3 -3
  78. package/build/tokens/components/dark/radio.d.ts +1 -1
  79. package/build/tokens/components/dark/radio.js +1 -1
  80. package/build/tokens/components/dark/tabs.d.ts +2 -0
  81. package/build/tokens/components/dark/tabs.js +2 -0
  82. package/build/tokens/components/light/badge.d.ts +1 -1
  83. package/build/tokens/components/light/badge.js +1 -1
  84. package/build/tokens/components/light/button.d.ts +1 -0
  85. package/build/tokens/components/light/button.js +1 -0
  86. package/build/tokens/components/light/checkbox.d.ts +3 -3
  87. package/build/tokens/components/light/checkbox.js +3 -3
  88. package/build/tokens/components/light/icon-button.d.ts +1 -1
  89. package/build/tokens/components/light/icon-button.js +1 -1
  90. package/build/tokens/components/light/radio.d.ts +3 -3
  91. package/build/tokens/components/light/radio.js +3 -3
  92. package/build/tokens/components/light/tabs.d.ts +2 -0
  93. package/build/tokens/components/light/tabs.js +2 -0
  94. package/build/tokens/layout.d.ts +48 -30
  95. package/build/tokens/layout.js +24 -15
  96. package/build/tokens/semantic-dark.d.ts +21 -19
  97. package/build/tokens/semantic-dark.js +21 -19
  98. package/build/tokens/semantic-light.d.ts +17 -15
  99. package/build/tokens/semantic-light.js +17 -15
  100. package/build/types/values.d.ts +2 -1
  101. package/build/utils/formatThousands.d.ts +2 -0
  102. package/build/utils/formatThousands.js +16 -0
  103. package/build/utils/index.d.ts +1 -0
  104. package/build/utils/index.js +1 -0
  105. package/docs/components/AllComponents.web.tsx +97 -8
  106. package/docs/components/NextPrevPage.tsx +11 -3
  107. package/docs/components/UsageWrap.tsx +2 -2
  108. package/docs/heplers/addReactNativePrefix.ts +8 -0
  109. package/docs/heplers/index.ts +1 -0
  110. package/docs/theme-tokens.mdx +42 -0
  111. package/package.json +2 -3
  112. package/src/components/Badge/Badge.docs.mdx +7 -7
  113. package/src/components/Badge/Badge.props.ts +3 -2
  114. package/src/components/Badge/Badge.stories.tsx +81 -92
  115. package/src/components/Badge/Badge.tsx +101 -14
  116. package/src/components/Badge/BadgeIcon.tsx +5 -79
  117. package/src/components/Badge/BadgeText.tsx +7 -81
  118. package/src/components/Button/ButtonGroupRoot.tsx +12 -2
  119. package/src/components/Card/Card.docs.mdx +1 -1
  120. package/src/components/Card/Card.props.ts +2 -2
  121. package/src/components/CurrencyInput/CurrencyInput.docs.mdx +120 -0
  122. package/src/components/CurrencyInput/CurrencyInput.props.ts +19 -0
  123. package/src/components/CurrencyInput/CurrencyInput.stories.tsx +116 -0
  124. package/src/components/CurrencyInput/CurrencyInput.tsx +91 -0
  125. package/src/components/CurrencyInput/index.ts +1 -0
  126. package/src/components/DescriptionList/DescriptionList.context.ts +18 -0
  127. package/src/components/DescriptionList/DescriptionList.docs.mdx +98 -0
  128. package/src/components/DescriptionList/DescriptionList.props.ts +20 -0
  129. package/src/components/DescriptionList/DescriptionList.stories.tsx +154 -0
  130. package/src/components/DescriptionList/DescriptionList.tsx +64 -0
  131. package/src/components/DescriptionList/DescriptionListItem.props.ts +19 -0
  132. package/src/components/DescriptionList/DescriptionListItem.tsx +101 -0
  133. package/src/components/DescriptionList/index.ts +4 -0
  134. package/src/components/Divider/Divider.props.ts +2 -2
  135. package/src/components/Divider/Divider.stories.tsx +3 -3
  136. package/src/components/Divider/Divider.tsx +46 -0
  137. package/src/components/Flex/Flex.docs.mdx +4 -4
  138. package/src/components/Flex/Flex.props.ts +3 -2
  139. package/src/components/Flex/Flex.stories.tsx +1 -1
  140. package/src/components/Grid/Grid.docs.mdx +12 -12
  141. package/src/components/Grid/Grid.props.ts +2 -2
  142. package/src/components/Grid/Grid.stories.tsx +2 -2
  143. package/src/components/IconContainer/IconContainer.docs.mdx +90 -0
  144. package/src/components/IconContainer/IconContainer.props.ts +17 -0
  145. package/src/components/IconContainer/IconContainer.stories.tsx +130 -0
  146. package/src/components/IconContainer/IconContainer.tsx +180 -0
  147. package/src/components/IconContainer/index.tsx +2 -0
  148. package/src/components/Icons/CircleIcon.tsx +9 -11
  149. package/src/components/Input/Input.docs.mdx +3 -3
  150. package/src/components/Input/Input.props.ts +0 -20
  151. package/src/components/Input/Input.stories.tsx +0 -6
  152. package/src/components/Input/Input.tsx +2 -49
  153. package/src/components/Input/InputField.tsx +0 -7
  154. package/src/components/Modal/Modal.tsx +18 -0
  155. package/src/components/SectionHeader/SectionHeader.tsx +1 -0
  156. package/src/components/Tabs/Tab.props.ts +16 -0
  157. package/src/components/Tabs/Tab.tsx +113 -0
  158. package/src/components/Tabs/TabPanel.props.ts +10 -0
  159. package/src/components/Tabs/TabPanel.tsx +46 -0
  160. package/src/components/Tabs/Tabs.context.ts +26 -0
  161. package/src/components/Tabs/Tabs.docs.mdx +214 -0
  162. package/src/components/Tabs/Tabs.props.ts +21 -0
  163. package/src/components/Tabs/Tabs.stories.tsx +270 -0
  164. package/src/components/Tabs/Tabs.tsx +139 -0
  165. package/src/components/Tabs/TabsList.props.ts +8 -0
  166. package/src/components/Tabs/TabsList.tsx +194 -0
  167. package/src/components/Tabs/index.ts +8 -0
  168. package/src/components/index.ts +4 -0
  169. package/src/core/themes.ts +57 -1
  170. package/src/tokens/color.ts +38 -34
  171. package/src/tokens/components/dark/button.ts +1 -0
  172. package/src/tokens/components/dark/checkbox.ts +1 -1
  173. package/src/tokens/components/dark/icon-button.ts +3 -3
  174. package/src/tokens/components/dark/radio.ts +1 -1
  175. package/src/tokens/components/dark/tabs.ts +2 -0
  176. package/src/tokens/components/light/badge.ts +1 -1
  177. package/src/tokens/components/light/button.ts +1 -0
  178. package/src/tokens/components/light/checkbox.ts +3 -3
  179. package/src/tokens/components/light/icon-button.ts +1 -1
  180. package/src/tokens/components/light/radio.ts +3 -3
  181. package/src/tokens/components/light/tabs.ts +2 -0
  182. package/src/tokens/layout.ts +24 -15
  183. package/src/tokens/semantic-dark.ts +21 -19
  184. package/src/tokens/semantic-light.ts +17 -15
  185. package/src/types/values.ts +3 -1
  186. package/src/utils/formatThousands.ts +14 -0
  187. package/src/utils/index.ts +1 -0
@@ -15,56 +15,56 @@ export default {
15
15
  danger: {
16
16
  border: '#ff7964',
17
17
  foreground: {
18
- default: '#fcfbf2',
18
+ default: '#101010',
19
19
  subtle: '#ff7964',
20
20
  },
21
21
  surface: {
22
- default: '#de2612',
23
- subtle: '#521a16',
22
+ default: '#ff634a',
23
+ subtle: '#ffa89d',
24
24
  },
25
25
  },
26
26
  functional: {
27
27
  border: '#b2afae',
28
28
  foreground: {
29
- default: '#fcfbf2',
29
+ default: '#101010',
30
30
  subtle: '#b2afae',
31
31
  },
32
32
  surface: {
33
- default: '#888888',
34
- subtle: '#232323',
33
+ default: '#919191',
34
+ subtle: '#d3d3d3',
35
35
  },
36
36
  },
37
37
  info: {
38
38
  border: '#6bb0ff',
39
39
  foreground: {
40
- default: '#fcfbf2',
40
+ default: '#101010',
41
41
  subtle: '#6bb0ff',
42
42
  },
43
43
  surface: {
44
- default: '#1c6cd4',
45
- subtle: '#042455',
44
+ default: '#6bb0ff',
45
+ subtle: '#bcddff',
46
46
  },
47
47
  },
48
48
  positive: {
49
49
  border: '#58ca93',
50
50
  foreground: {
51
- default: '#fcfbf2',
51
+ default: '#101010',
52
52
  subtle: '#58ca93',
53
53
  },
54
54
  surface: {
55
- default: '#0f834a',
56
- subtle: '#033d21',
55
+ default: '#36bf7d',
56
+ subtle: '#a2e2c3',
57
57
  },
58
58
  },
59
59
  warning: {
60
60
  border: '#ff9639',
61
61
  foreground: {
62
- default: '#fcfbf2',
62
+ default: '#101010',
63
63
  subtle: '#ff9639',
64
64
  },
65
65
  surface: {
66
- default: '#cb5b00',
67
- subtle: '#6b2d00',
66
+ default: '#ff8010',
67
+ subtle: '#ffcca8',
68
68
  },
69
69
  },
70
70
  },
@@ -136,14 +136,14 @@ export default {
136
136
  },
137
137
  functional: {
138
138
  border: {
139
+ inverted: '#f7f7f7',
139
140
  strong: '#ebebeb',
140
141
  subtle: '#ebebeb',
141
- inverted: '#f7f7f7',
142
142
  },
143
143
  foreground: {
144
+ inverted: '#f7f7f7',
144
145
  strong: '#fcfbf2',
145
146
  subtle: '#ebebeb',
146
- inverted: '#f7f7f7',
147
147
  },
148
148
  surface: {
149
149
  strong: {
@@ -155,8 +155,8 @@ export default {
155
155
  active: '#4c4c4c',
156
156
  hover: '#3a3837',
157
157
  inverted: {
158
- active: '#d3d3d3',
159
- hover: '#ebebeb',
158
+ active: '#3a3837',
159
+ hover: '#3f3f3f',
160
160
  },
161
161
  },
162
162
  },
@@ -244,6 +244,8 @@ export default {
244
244
  },
245
245
  },
246
246
  text: {
247
+ affirmative: '#58ca93',
248
+ brand: '#af90de',
247
249
  inverted: '#191917',
248
250
  primary: '#ebebeb',
249
251
  secondary: '#b2afae',
@@ -15,55 +15,55 @@ declare const _default: {
15
15
  readonly danger: {
16
16
  readonly border: "#de2612";
17
17
  readonly foreground: {
18
- readonly default: "#fcfbf2";
18
+ readonly default: "#101010";
19
19
  readonly subtle: "#de2612";
20
20
  };
21
21
  readonly surface: {
22
- readonly default: "#de2612";
23
- readonly subtle: "#ffccc5";
22
+ readonly default: "#ff634a";
23
+ readonly subtle: "#ffa89d";
24
24
  };
25
25
  };
26
26
  readonly functional: {
27
- readonly border: "#888888";
27
+ readonly border: "#5b5b5b";
28
28
  readonly foreground: {
29
- readonly default: "#fcfbf2";
30
- readonly subtle: "#888888";
29
+ readonly default: "#101010";
30
+ readonly subtle: "#5b5b5b";
31
31
  };
32
32
  readonly surface: {
33
- readonly default: "#888888";
33
+ readonly default: "#919191";
34
34
  readonly subtle: "#d3d3d3";
35
35
  };
36
36
  };
37
37
  readonly info: {
38
38
  readonly border: "#1c6cd4";
39
39
  readonly foreground: {
40
- readonly default: "#fcfbf2";
40
+ readonly default: "#101010";
41
41
  readonly subtle: "#1c6cd4";
42
42
  };
43
43
  readonly surface: {
44
- readonly default: "#1c6cd4";
44
+ readonly default: "#6bb0ff";
45
45
  readonly subtle: "#bcddff";
46
46
  };
47
47
  };
48
48
  readonly positive: {
49
49
  readonly border: "#0f834a";
50
50
  readonly foreground: {
51
- readonly default: "#fcfbf2";
51
+ readonly default: "#101010";
52
52
  readonly subtle: "#0f834a";
53
53
  };
54
54
  readonly surface: {
55
- readonly default: "#0f834a";
55
+ readonly default: "#36bf7d";
56
56
  readonly subtle: "#a2e2c3";
57
57
  };
58
58
  };
59
59
  readonly warning: {
60
60
  readonly border: "#be5400";
61
61
  readonly foreground: {
62
- readonly default: "#fcfbf2";
62
+ readonly default: "#101010";
63
63
  readonly subtle: "#be5400";
64
64
  };
65
65
  readonly surface: {
66
- readonly default: "#be5400";
66
+ readonly default: "#ff8010";
67
67
  readonly subtle: "#ffcca8";
68
68
  };
69
69
  };
@@ -136,14 +136,14 @@ declare const _default: {
136
136
  };
137
137
  readonly functional: {
138
138
  readonly border: {
139
+ readonly inverted: "#f7f7f7";
139
140
  readonly strong: "#101010";
140
141
  readonly subtle: "#101010";
141
- readonly inverted: "#f7f7f7";
142
142
  };
143
143
  readonly foreground: {
144
+ readonly inverted: "#f7f7f7";
144
145
  readonly strong: "#fcfbf2";
145
146
  readonly subtle: "#101010";
146
- readonly inverted: "#f7f7f7";
147
147
  };
148
148
  readonly surface: {
149
149
  readonly strong: {
@@ -244,6 +244,8 @@ declare const _default: {
244
244
  };
245
245
  };
246
246
  readonly text: {
247
+ readonly affirmative: "#0f834a";
248
+ readonly brand: "#7a42c8";
247
249
  readonly inverted: "#fcfbf2";
248
250
  readonly primary: "#101010";
249
251
  readonly secondary: "#888888";
@@ -15,55 +15,55 @@ export default {
15
15
  danger: {
16
16
  border: '#de2612',
17
17
  foreground: {
18
- default: '#fcfbf2',
18
+ default: '#101010',
19
19
  subtle: '#de2612',
20
20
  },
21
21
  surface: {
22
- default: '#de2612',
23
- subtle: '#ffccc5',
22
+ default: '#ff634a',
23
+ subtle: '#ffa89d',
24
24
  },
25
25
  },
26
26
  functional: {
27
- border: '#888888',
27
+ border: '#5b5b5b',
28
28
  foreground: {
29
- default: '#fcfbf2',
30
- subtle: '#888888',
29
+ default: '#101010',
30
+ subtle: '#5b5b5b',
31
31
  },
32
32
  surface: {
33
- default: '#888888',
33
+ default: '#919191',
34
34
  subtle: '#d3d3d3',
35
35
  },
36
36
  },
37
37
  info: {
38
38
  border: '#1c6cd4',
39
39
  foreground: {
40
- default: '#fcfbf2',
40
+ default: '#101010',
41
41
  subtle: '#1c6cd4',
42
42
  },
43
43
  surface: {
44
- default: '#1c6cd4',
44
+ default: '#6bb0ff',
45
45
  subtle: '#bcddff',
46
46
  },
47
47
  },
48
48
  positive: {
49
49
  border: '#0f834a',
50
50
  foreground: {
51
- default: '#fcfbf2',
51
+ default: '#101010',
52
52
  subtle: '#0f834a',
53
53
  },
54
54
  surface: {
55
- default: '#0f834a',
55
+ default: '#36bf7d',
56
56
  subtle: '#a2e2c3',
57
57
  },
58
58
  },
59
59
  warning: {
60
60
  border: '#be5400',
61
61
  foreground: {
62
- default: '#fcfbf2',
62
+ default: '#101010',
63
63
  subtle: '#be5400',
64
64
  },
65
65
  surface: {
66
- default: '#be5400',
66
+ default: '#ff8010',
67
67
  subtle: '#ffcca8',
68
68
  },
69
69
  },
@@ -136,14 +136,14 @@ export default {
136
136
  },
137
137
  functional: {
138
138
  border: {
139
+ inverted: '#f7f7f7',
139
140
  strong: '#101010',
140
141
  subtle: '#101010',
141
- inverted: '#f7f7f7',
142
142
  },
143
143
  foreground: {
144
+ inverted: '#f7f7f7',
144
145
  strong: '#fcfbf2',
145
146
  subtle: '#101010',
146
- inverted: '#f7f7f7',
147
147
  },
148
148
  surface: {
149
149
  strong: {
@@ -244,6 +244,8 @@ export default {
244
244
  },
245
245
  },
246
246
  text: {
247
+ affirmative: '#0f834a',
248
+ brand: '#7a42c8',
247
249
  inverted: '#fcfbf2',
248
250
  primary: '#101010',
249
251
  secondary: '#888888',
@@ -1,5 +1,5 @@
1
1
  import { AnimatableNumericValue, DimensionValue } from 'react-native';
2
- import { lightTheme } from '../core/themes';
2
+ import { lightTheme, themes } from '../core/themes';
3
3
  import color from '../tokens/color';
4
4
  export type addPrefixToObject<T, P extends string> = {
5
5
  [K in keyof T as K extends string | number ? `${P}${K}` : never]: T[K];
@@ -26,4 +26,5 @@ export type ColorValue = 'currentColor' | 'transparent' | FlattenColorKeys<Omit<
26
26
  export type BorderRadiusValue = `${keyof (typeof lightTheme)['borderRadius'] & (string | number)}` | AnimatableNumericValue | undefined;
27
27
  export type BordeWidthValue = `${keyof (typeof lightTheme)['borderWidth'] & (string | number)}` | number | undefined;
28
28
  export type OpacityValue = AnimatableNumericValue | undefined;
29
+ export type SpacingValues = keyof (typeof themes)['light']['globalStyle']['variants']['space'];
29
30
  export {};
@@ -0,0 +1,2 @@
1
+ declare const formatThousands: (value: string) => string;
2
+ export default formatThousands;
@@ -0,0 +1,16 @@
1
+ const formatThousands = (value) => {
2
+ if (!value)
3
+ return value;
4
+ // Remove existing commas first
5
+ const cleaned = value.replace(/,/g, '');
6
+ // Allow leading minus, digits, optional decimal part
7
+ const match = cleaned.match(/^(-)?(\d*)(\.\d*)?$/);
8
+ if (!match)
9
+ return value; // If it doesn't match a numeric pattern, return original (lets user continue typing)
10
+ const [, sign = '', intPart = '', decimalPart = ''] = match;
11
+ if (!intPart)
12
+ return sign + intPart + decimalPart; // nothing to format yet
13
+ const withCommas = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
14
+ return sign + withCommas + (decimalPart || '');
15
+ };
16
+ export default formatThousands;
@@ -1,4 +1,5 @@
1
1
  export { default as coloursAsArray, extractLightColorValues } from './coloursAsArray';
2
+ export { default as formatThousands } from './formatThousands';
2
3
  export { default as getFlattenedColorValue } from './getFlattenedColorValue';
3
4
  export { default as getStyleValue } from './getStyleValue';
4
5
  export { default as hexWithOpacity } from './hexWithOpacity';
@@ -1,4 +1,5 @@
1
1
  export { default as coloursAsArray, extractLightColorValues } from './coloursAsArray';
2
+ export { default as formatThousands } from './formatThousands';
2
3
  export { default as getFlattenedColorValue } from './getFlattenedColorValue';
3
4
  export { default as getStyleValue } from './getStyleValue';
4
5
  export { default as hexWithOpacity } from './hexWithOpacity';
@@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useRef } from 'react';
3
3
  import { BottomSheetModalMethods } from '@gorhom/bottom-sheet/lib/typescript/types';
4
4
  import {
5
5
  BroadbandMediumIcon,
6
+ CashbackCardMediumIcon,
6
7
  ChevronRightMediumIcon,
7
8
  ElectricityMediumIcon,
8
9
  InsuranceMediumIcon,
@@ -24,6 +25,9 @@ import {
24
25
  Card,
25
26
  Center,
26
27
  Checkbox,
28
+ CurrencyInput,
29
+ DescriptionList,
30
+ DescriptionListItem,
27
31
  DetailText,
28
32
  Divider,
29
33
  Flex,
@@ -32,6 +36,7 @@ import {
32
36
  Heading,
33
37
  Icon,
34
38
  IconButton,
39
+ IconContainer,
35
40
  InlineLink,
36
41
  Input,
37
42
  LI,
@@ -49,12 +54,17 @@ import {
49
54
  Skeleton,
50
55
  Spinner,
51
56
  Switch,
57
+ Tab,
58
+ TabPanel,
59
+ Tabs,
60
+ TabsList,
52
61
  Textarea,
53
62
  ToggleButtonCard,
54
63
  ToggleButtonCardGroup,
55
64
  UL,
56
65
  useColorMode,
57
66
  } from '../../src';
67
+ import { addReactNativePrefix } from '../heplers';
58
68
 
59
69
  const ComponentWrapper = ({
60
70
  name,
@@ -66,8 +76,15 @@ const ComponentWrapper = ({
66
76
  children?: ViewProps['children'];
67
77
  }) => {
68
78
  const navigate = () => {
79
+ let target = link;
80
+ if (
81
+ typeof window !== 'undefined' &&
82
+ window.top?.location.href.includes('hearth.prod.uw.systems/?path=')
83
+ ) {
84
+ target = addReactNativePrefix(link);
85
+ }
69
86
  if (window.top) {
70
- window.top.location.href = link;
87
+ window.top.location.href = target;
71
88
  }
72
89
  };
73
90
  return (
@@ -203,6 +220,22 @@ const AllComponents: React.FC = () => {
203
220
  </View>
204
221
  </Center>
205
222
  </ComponentWrapper>
223
+ <ComponentWrapper name="Currency Input" link="/?path=/docs/forms-currency-input--docs">
224
+ <Center flex={1} padding="200">
225
+ <CurrencyInput />
226
+ </Center>
227
+ </ComponentWrapper>
228
+ <ComponentWrapper
229
+ name="Description List"
230
+ link="/?path=/docs/components-description-list--docs"
231
+ >
232
+ <Center flex={1} padding="200">
233
+ <DescriptionList>
234
+ <DescriptionListItem heading="This is a" description="Description list" />
235
+ <DescriptionListItem heading="So is this" description="12-34-56" />
236
+ </DescriptionList>
237
+ </Center>
238
+ </ComponentWrapper>
206
239
  <ComponentWrapper name="Detail Text" link="/?path=/docs/typography-detail-text--docs">
207
240
  <Center flex={1}>
208
241
  <DetailText>This is some Detail Text</DetailText>
@@ -255,11 +288,51 @@ const AllComponents: React.FC = () => {
255
288
  <Heading>This is a Heading</Heading>
256
289
  </Center>
257
290
  </ComponentWrapper>
258
- <ComponentWrapper name="Icon Button" link="/?path=/docs/components-iconbutton--docs">
291
+ <ComponentWrapper name="Icon Button" link="/?path=/docs/components-icon-button--docs">
259
292
  <Center flex={1}>
260
293
  <IconButton icon={ChevronRightMediumIcon} size="md" onPress={() => null} />
261
294
  </Center>
262
295
  </ComponentWrapper>
296
+ <ComponentWrapper
297
+ name="Icon Container"
298
+ link="/?path=/docs/components-icon-container--docs"
299
+ >
300
+ <Center flex={1}>
301
+ <Flex direction="row" space="sm">
302
+ <IconContainer
303
+ icon={ElectricityMediumIcon}
304
+ size="sm"
305
+ variant="emphasis"
306
+ color="energy"
307
+ />
308
+ <IconContainer
309
+ icon={BroadbandMediumIcon}
310
+ size="sm"
311
+ variant="emphasis"
312
+ color="broadband"
313
+ />
314
+ <IconContainer
315
+ icon={MobileMediumIcon}
316
+ size="sm"
317
+ variant="emphasis"
318
+ color="mobile"
319
+ />
320
+ <IconContainer
321
+ icon={InsuranceMediumIcon}
322
+ size="sm"
323
+ variant="emphasis"
324
+ color="insurance"
325
+ />
326
+ <IconContainer
327
+ icon={CashbackCardMediumIcon}
328
+ size="sm"
329
+ variant="emphasis"
330
+ color="cashback"
331
+ />
332
+ </Flex>
333
+ </Center>
334
+ </ComponentWrapper>
335
+
263
336
  <ComponentWrapper name="Icons" link="/?path=/docs/components-icons--docs">
264
337
  <Center flex={1}>
265
338
  <Flex direction="row" space="lg">
@@ -353,7 +426,7 @@ const AllComponents: React.FC = () => {
353
426
  name="Section Header"
354
427
  link="/?path=/docs/components-section-header--docs"
355
428
  >
356
- <Center flex={1}>
429
+ <Center flex={1} p="300">
357
430
  <SectionHeader heading="Heading" helperText="Supporting text" linkText="More" />
358
431
  </Center>
359
432
  </ComponentWrapper>
@@ -395,7 +468,26 @@ const AllComponents: React.FC = () => {
395
468
  <Switch value={switchEnabled} onValueChange={toggleSwitch} />
396
469
  </Center>
397
470
  </ComponentWrapper>
398
-
471
+ <ComponentWrapper name="Tabs" link="/?path=/docs/components-tabs--docs">
472
+ <Center flex={1}>
473
+ <Tabs defaultValue="tab-1">
474
+ <TabsList>
475
+ <Tab value="tab-1">Tab 1</Tab>
476
+ <Tab value="tab-2">Tab 2</Tab>
477
+ <Tab value="tab-3">Tab 3</Tab>
478
+ </TabsList>
479
+ <TabPanel value="tab-1">
480
+ <BodyText>I'm the first tab's content</BodyText>
481
+ </TabPanel>
482
+ <TabPanel value="tab-2">
483
+ <BodyText>I'm the second tab's content</BodyText>
484
+ </TabPanel>
485
+ <TabPanel value="tab-3">
486
+ <BodyText>I'm the third tab's content</BodyText>
487
+ </TabPanel>
488
+ </Tabs>
489
+ </Center>
490
+ </ComponentWrapper>
399
491
  <ComponentWrapper name="Textarea" link="/?path=/docs/forms-textarea--docs">
400
492
  <Center flex={1}>
401
493
  <Textarea numberOfLines={3} placeholder="This is a textarea" />
@@ -441,9 +533,7 @@ const AllComponents: React.FC = () => {
441
533
  };
442
534
 
443
535
  const styles = StyleSheet.create(theme => ({
444
- container: {
445
- gap: theme.space['2'],
446
- },
536
+ container: {},
447
537
  component: {
448
538
  borderColor: theme.color.warmWhite[300],
449
539
  borderWidth: theme.borderWidth['1'],
@@ -457,7 +547,6 @@ const styles = StyleSheet.create(theme => ({
457
547
  },
458
548
  },
459
549
  componentWrap: {
460
- padding: theme.space['4'],
461
550
  flexGrow: 1,
462
551
  flex: 1,
463
552
  },
@@ -1,6 +1,7 @@
1
- import { View, StyleSheet } from 'react-native';
2
- import { Card, CardAction, Heading, Link } from '../../src';
3
1
  import { ChevronLeftSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import { Card, CardAction, Heading, Link } from '../../src';
4
+ import { addReactNativePrefix } from '../heplers';
4
5
 
5
6
  type NextPrevPageProps = {
6
7
  nextLink?: string;
@@ -16,8 +17,15 @@ const NextPrevPage: React.FC<NextPrevPageProps> = ({
16
17
  prevTitle,
17
18
  }) => {
18
19
  const openLink = (link: string) => {
20
+ let target = link;
21
+ if (
22
+ typeof window !== 'undefined' &&
23
+ window.top?.location.href.includes('hearth.prod.uw.systems/?path=')
24
+ ) {
25
+ target = addReactNativePrefix(link);
26
+ }
19
27
  if (window.top) {
20
- window.top.location.href = link;
28
+ window.top.location.href = target;
21
29
  }
22
30
  };
23
31
  return (
@@ -8,10 +8,10 @@ const UsageWrap: FC<PropsWithChildren> = ({ children }) => {
8
8
  <Box
9
9
  mt="300"
10
10
  p="200"
11
- bg={colorMode === 'dark' ? 'background' : 'white'}
11
+ bg="backgroundPrimary"
12
12
  borderRadius="md"
13
13
  borderWidth="1"
14
- borderColor="grey1000"
14
+ borderColor="borderSubtle"
15
15
  width="100%"
16
16
  position="relative"
17
17
  >
@@ -0,0 +1,8 @@
1
+ const addReactNativePrefix = (url: string) => {
2
+ if (!url.startsWith('/?path=/docs/')) return url;
3
+ return url.replace(/(\/\?path=\/docs\/)([^/]+)/, (full, prefix, slug) => {
4
+ if (slug.startsWith('react-native_')) return full; // already prefixed
5
+ return `${prefix}react-native_${slug}`;
6
+ });
7
+ };
8
+ export default addReactNativePrefix;
@@ -0,0 +1 @@
1
+ export { default as addReactNativePrefix } from './addReactNativePrefix';
@@ -429,6 +429,48 @@ Available spacing values:
429
429
  | `900` | 72px | Maximum spacing |
430
430
  | `1000` | 80px | Hero spacing |
431
431
 
432
+ There is also responsive layout spacing for different screen sizes:
433
+
434
+ | Token | Mobile (base) | Tablet (md) | Desktop (lg) | Usage (guideline) |
435
+ | ------ | ------------- | ----------- | ------------ | ------------------------------------- |
436
+ | `none` | 0px | 0px | 0px | Reset / collapse spacing |
437
+ | `2xs` | 2px | 2px | 2px | Hairline gaps, separators |
438
+ | `xs` | 4px | 4px | 4px | Tight padding, icon nudge |
439
+ | `sm` | 8px | 8px | 8px | Compact component gap |
440
+ | `md` | 12px | 12px | 12px | Dense layouts, inline stacks |
441
+ | `lg` | 16px | 16px | 16px | Base section spacing |
442
+ | `xl` | 20px | 24px | 24px | Larger grouping / outer padding |
443
+ | `2xl` | 28px | 28px | 40px | Major vertical rhythm / page sections |
444
+
445
+ There are built in responsive layout spacings for mobile, tablet and desktop. They live under `theme.space.xs` etc,
446
+ which are responsive values that adapt based on screen size. For example, `theme.space.xl` is `20px` on mobile, and `24px` on tablet and desktop.
447
+
448
+ These responsive layout spacings live under `theme.layout.[mobile|tablet|desktop].spacing` and are intended for macro
449
+ layout structure (page/frame scaffolding) rather than component-level internal spacing (which should prefer the core `space` scale).
450
+
451
+ ```tsx
452
+ const styles = StyleSheet.create(theme => ({
453
+ pageSection: {
454
+ padding: theme.space.xl, // 20px on mobile, 24px on tablet/desktop
455
+ },
456
+ }));
457
+
458
+ // or using the layout tokens directly:
459
+ const styles = StyleSheet.create(theme => ({
460
+ pageSection: {
461
+ // Example: use responsive spacing tokens
462
+ paddingHorizontal: theme.layout.mobile.spacing.lg,
463
+ paddingTop: theme.layout.mobile.spacing.xl,
464
+ // Or use responsive object syntax
465
+ gap: {
466
+ base: theme.layout.mobile.spacing.md,
467
+ md: theme.layout.tablet.spacing.lg,
468
+ lg: theme.layout.desktop.spacing.xl,
469
+ },
470
+ },
471
+ }));
472
+ ```
473
+
432
474
  Percentage-based spacing is also available:
433
475
 
434
476
  - `1/2`, `1/3`, `2/3`, `1/4`, `3/4`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilitywarehouse/hearth-react-native",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -75,11 +75,10 @@
75
75
  "lint": "TIMING=1 eslint --max-warnings 0",
76
76
  "build": "tsc",
77
77
  "watch": "tsc --watch",
78
- "watch:lab": "tsc --p tsconfig.lab.json --watch",
79
78
  "figma:create": "figma connect create",
80
79
  "figma:publish": "figma connect publish",
81
80
  "test": "echo \"Error: no test specified\" && exit 1",
82
- "storybook": "storybook dev -p 6006",
81
+ "dev": "storybook dev -p 6006",
83
82
  "build:storybook": "storybook build"
84
83
  }
85
84
  }