@utilitywarehouse/hearth-react-native 0.15.3 → 0.16.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 (160) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +67 -6
  3. package/CHANGELOG.md +73 -6
  4. package/build/components/Avatar/Avatar.js +0 -2
  5. package/build/components/Banner/Banner.d.ts +1 -1
  6. package/build/components/Banner/Banner.js +3 -1
  7. package/build/components/Carousel/Carousel.js +1 -1
  8. package/build/components/Checkbox/CheckboxGroup.d.ts +1 -1
  9. package/build/components/Checkbox/CheckboxGroup.js +2 -2
  10. package/build/components/Checkbox/CheckboxGroup.props.d.ts +2 -1
  11. package/build/components/CurrencyInput/CurrencyInput.d.ts +1 -1
  12. package/build/components/CurrencyInput/CurrencyInput.js +2 -6
  13. package/build/components/CurrencyInput/CurrencyInput.props.d.ts +6 -0
  14. package/build/components/DateInput/DateInput.js +1 -0
  15. package/build/components/DateInput/DateInputSegment.js +2 -3
  16. package/build/components/DatePicker/DatePicker.js +8 -4
  17. package/build/components/DatePicker/DatePickerHeader/DatePickerHeader.props.d.ts +0 -1
  18. package/build/components/DatePicker/DatePickerHeader/index.js +1 -1
  19. package/build/components/DatePicker/index.d.ts +1 -0
  20. package/build/components/DatePicker/polyfill.js +3 -3
  21. package/build/components/DatePicker/time-picker/wheel-web.js +1 -3
  22. package/build/components/DatePickerInput/DatePickerInput.d.ts +1 -1
  23. package/build/components/DatePickerInput/DatePickerInput.js +3 -4
  24. package/build/components/DatePickerInput/DatePickerInput.props.d.ts +6 -0
  25. package/build/components/DescriptionList/DescriptionList.d.ts +1 -1
  26. package/build/components/DescriptionList/DescriptionList.js +2 -2
  27. package/build/components/DescriptionList/DescriptionList.props.d.ts +1 -0
  28. package/build/components/DescriptionList/DescriptionListItem.d.ts +1 -1
  29. package/build/components/DescriptionList/DescriptionListItem.js +3 -2
  30. package/build/components/DescriptionList/DescriptionListItem.props.d.ts +1 -0
  31. package/build/components/FormField/FormField.context.d.ts +8 -2
  32. package/build/components/FormField/FormField.d.ts +1 -1
  33. package/build/components/FormField/FormField.js +24 -4
  34. package/build/components/FormField/FormField.props.d.ts +2 -0
  35. package/build/components/FormField/FormFieldLabel.d.ts +1 -1
  36. package/build/components/FormField/FormFieldLabel.js +3 -3
  37. package/build/components/FormField/FormFieldValid.js +2 -2
  38. package/build/components/Input/Input.js +48 -10
  39. package/build/components/Input/Input.props.d.ts +7 -1
  40. package/build/components/Label/Label.d.ts +1 -1
  41. package/build/components/Label/Label.js +5 -1
  42. package/build/components/Label/Label.props.d.ts +3 -2
  43. package/build/components/Radio/RadioGroup.d.ts +1 -1
  44. package/build/components/Radio/RadioGroup.js +2 -2
  45. package/build/components/Radio/RadioGroup.props.d.ts +1 -0
  46. package/build/components/RadioCard/RadioCard.d.ts +1 -1
  47. package/build/components/RadioCard/RadioCard.js +2 -2
  48. package/build/components/RadioCard/RadioCard.props.d.ts +1 -0
  49. package/build/components/Select/Select.d.ts +1 -1
  50. package/build/components/Select/Select.js +2 -2
  51. package/build/components/Select/Select.props.d.ts +10 -0
  52. package/build/components/Switch/Switch.js +1 -1
  53. package/build/components/Tabs/Tabs.d.ts +1 -1
  54. package/build/components/Tabs/Tabs.js +1 -1
  55. package/build/components/Textarea/Textarea.d.ts +1 -1
  56. package/build/components/Textarea/Textarea.js +46 -6
  57. package/build/components/Textarea/Textarea.props.d.ts +8 -0
  58. package/build/components/Toast/ToastItem.js +1 -1
  59. package/build/components/ToggleButton/ToggleButtonIcon.js +1 -1
  60. package/build/components/ToggleButton/ToggleButtonRoot.js +0 -2
  61. package/build/components/UnstyledIconButton/UnstyledIconButtonIcon.js +1 -1
  62. package/build/components/VerificationInput/VerificationInput.d.ts +1 -1
  63. package/build/components/VerificationInput/VerificationInput.js +2 -2
  64. package/build/components/VerificationInput/VerificationInput.props.d.ts +4 -0
  65. package/build/utils/coloursAsArray.js +1 -1
  66. package/docs/components/AllComponents.web.tsx +19 -20
  67. package/docs/components/UsageWrap.tsx +17 -20
  68. package/docs/theme-tokens.mdx +390 -2
  69. package/eslint.config.js +5 -1
  70. package/package.json +12 -12
  71. package/src/components/Accordion/Accordion.figma.tsx +15 -17
  72. package/src/components/Accordion/AccordionItem.figma.tsx +27 -0
  73. package/src/components/Avatar/Avatar.figma.tsx +11 -21
  74. package/src/components/Avatar/Avatar.tsx +0 -2
  75. package/src/components/Badge/Badge.figma.tsx +45 -54
  76. package/src/components/Banner/Banner.figma.tsx +21 -13
  77. package/src/components/Banner/Banner.stories.tsx +4 -4
  78. package/src/components/Banner/Banner.tsx +2 -1
  79. package/src/components/Button/Button.figma.tsx +118 -46
  80. package/src/components/Card/Card.figma.tsx +27 -43
  81. package/src/components/Card/Card.stories.tsx +1 -1
  82. package/src/components/Carousel/Carousel.figma.tsx +20 -17
  83. package/src/components/Carousel/Carousel.tsx +1 -1
  84. package/src/components/Checkbox/Checkbox.docs.mdx +32 -31
  85. package/src/components/Checkbox/Checkbox.figma.tsx +15 -18
  86. package/src/components/Checkbox/Checkbox.stories.tsx +2 -2
  87. package/src/components/Checkbox/CheckboxGroup.figma.tsx +48 -15
  88. package/src/components/Checkbox/CheckboxGroup.props.ts +2 -1
  89. package/src/components/Checkbox/CheckboxGroup.tsx +6 -1
  90. package/src/components/Checkbox/CheckboxTileRoot.figma.tsx +24 -27
  91. package/src/components/CurrencyInput/CurrencyInput.docs.mdx +52 -9
  92. package/src/components/CurrencyInput/CurrencyInput.figma.tsx +65 -49
  93. package/src/components/CurrencyInput/CurrencyInput.props.ts +6 -0
  94. package/src/components/CurrencyInput/CurrencyInput.stories.tsx +30 -1
  95. package/src/components/CurrencyInput/CurrencyInput.tsx +16 -8
  96. package/src/components/DateInput/DateInput.figma.tsx +58 -45
  97. package/src/components/DateInput/DateInput.tsx +1 -0
  98. package/src/components/DateInput/DateInputSegment.tsx +2 -3
  99. package/src/components/DatePicker/DatePicker.figma.tsx +47 -0
  100. package/src/components/DatePicker/DatePicker.tsx +8 -4
  101. package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.props.ts +0 -2
  102. package/src/components/DatePicker/DatePickerHeader/index.tsx +2 -2
  103. package/src/components/DatePicker/index.ts +2 -0
  104. package/src/components/DatePicker/polyfill.ts +3 -3
  105. package/src/components/DatePicker/time-picker/wheel-web.tsx +0 -1
  106. package/src/components/DatePickerInput/DatePickerInput.docs.mdx +22 -0
  107. package/src/components/DatePickerInput/DatePickerInput.figma.tsx +18 -46
  108. package/src/components/DatePickerInput/DatePickerInput.props.ts +6 -0
  109. package/src/components/DatePickerInput/DatePickerInput.tsx +17 -5
  110. package/src/components/DescriptionList/DescriptionList.docs.mdx +16 -14
  111. package/src/components/DescriptionList/DescriptionList.figma.tsx +41 -17
  112. package/src/components/DescriptionList/DescriptionList.props.ts +1 -0
  113. package/src/components/DescriptionList/DescriptionList.stories.tsx +24 -0
  114. package/src/components/DescriptionList/DescriptionList.tsx +2 -0
  115. package/src/components/DescriptionList/DescriptionListItem.figma.tsx +42 -0
  116. package/src/components/DescriptionList/DescriptionListItem.props.ts +1 -0
  117. package/src/components/DescriptionList/DescriptionListItem.tsx +7 -0
  118. package/src/components/Divider/Divider.figma.tsx +10 -23
  119. package/src/components/FormField/FormField.context.ts +6 -1
  120. package/src/components/FormField/FormField.docs.mdx +30 -30
  121. package/src/components/FormField/FormField.props.ts +2 -0
  122. package/src/components/FormField/FormField.stories.tsx +8 -2
  123. package/src/components/FormField/FormField.tsx +38 -4
  124. package/src/components/FormField/FormFieldLabel.tsx +7 -3
  125. package/src/components/FormField/FormFieldValid.tsx +2 -2
  126. package/src/components/Input/Input.docs.mdx +67 -22
  127. package/src/components/Input/Input.props.ts +7 -1
  128. package/src/components/Input/Input.stories.tsx +9 -1
  129. package/src/components/Input/Input.tsx +124 -60
  130. package/src/components/Label/Label.props.ts +3 -2
  131. package/src/components/Label/Label.tsx +11 -1
  132. package/src/components/List/List.stories.tsx +1 -4
  133. package/src/components/Radio/Radio.docs.mdx +31 -30
  134. package/src/components/Radio/Radio.stories.tsx +1 -1
  135. package/src/components/Radio/RadioGroup.props.ts +1 -0
  136. package/src/components/Radio/RadioGroup.stories.tsx +6 -0
  137. package/src/components/Radio/RadioGroup.tsx +6 -1
  138. package/src/components/RadioCard/RadioCard.docs.mdx +31 -30
  139. package/src/components/RadioCard/RadioCard.props.ts +1 -0
  140. package/src/components/RadioCard/RadioCard.tsx +8 -2
  141. package/src/components/Select/Select.props.ts +10 -0
  142. package/src/components/Select/Select.tsx +3 -2
  143. package/src/components/Switch/Switch.tsx +1 -1
  144. package/src/components/Tabs/Tabs.tsx +0 -1
  145. package/src/components/Textarea/Textarea.docs.mdx +65 -17
  146. package/src/components/Textarea/Textarea.props.ts +8 -0
  147. package/src/components/Textarea/Textarea.stories.tsx +23 -2
  148. package/src/components/Textarea/Textarea.tsx +87 -19
  149. package/src/components/ThemedImage/ThemedImage.stories.tsx +14 -14
  150. package/src/components/Toast/ToastItem.tsx +1 -1
  151. package/src/components/ToggleButton/ToggleButtonIcon.tsx +1 -1
  152. package/src/components/ToggleButton/ToggleButtonRoot.tsx +0 -2
  153. package/src/components/UnstyledIconButton/UnstyledIconButtonIcon.tsx +1 -1
  154. package/src/components/VerificationInput/VerificationInput.docs.mdx +1 -0
  155. package/src/components/VerificationInput/VerificationInput.props.ts +4 -1
  156. package/src/components/VerificationInput/VerificationInput.tsx +2 -0
  157. package/src/utils/coloursAsArray.ts +1 -1
  158. package/tsconfig.eslint.json +13 -0
  159. package/src/components/Accordion/AccordionItemRoot.figma.tsx +0 -47
  160. package/src/components/DatePicker/DatePickerCalendar.figma.tsx +0 -34
@@ -13,11 +13,11 @@ import {
13
13
  ShareSmallIcon,
14
14
  TrashSmallIcon,
15
15
  } from '@utilitywarehouse/hearth-react-native-icons';
16
- // @ts-ignore
16
+ // @ts-expect-error - Module missing type declarations
17
17
  import SpotBillingDark from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-dark.svg';
18
- // @ts-ignore
18
+ // @ts-expect-error - Module missing type declarations
19
19
  import SpotBillingLight from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-light.svg';
20
- import { Image, Pressable, ScrollView, View, ViewProps } from 'react-native';
20
+ import { Pressable, ScrollView, View, ViewProps } from 'react-native';
21
21
  import { StyleSheet } from 'react-native-unistyles';
22
22
  import {
23
23
  Accordion,
@@ -55,6 +55,7 @@ import {
55
55
  Grid,
56
56
  Heading,
57
57
  HighlightBanner,
58
+ HighlightBannerImage,
58
59
  Icon,
59
60
  IconButton,
60
61
  IconContainer,
@@ -175,6 +176,7 @@ const AllComponents: React.FC = () => {
175
176
  const handleMenuOpenPress = useCallback(() => {
176
177
  menuRef.current?.present();
177
178
  }, []);
179
+ const [pillValue, setPillValue] = React.useState<string[]>(['energy', 'mobile']);
178
180
 
179
181
  const [colorMode] = useColorMode();
180
182
  const isDark = colorMode === 'dark';
@@ -489,7 +491,7 @@ const AllComponents: React.FC = () => {
489
491
  headingColor="energy"
490
492
  imageContainerHeight={40}
491
493
  image={
492
- <Image
494
+ <HighlightBannerImage
493
495
  source={{
494
496
  uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=800&q=80',
495
497
  }}
@@ -647,22 +649,19 @@ const AllComponents: React.FC = () => {
647
649
  </ComponentWrapper>
648
650
  <ComponentWrapper name="Pill Group" link="/?path=/docs/components-pill-group--docs">
649
651
  <Center flex={1} p="200">
650
- {(() => {
651
- const [pillValue, setPillValue] = React.useState<string[]>(['energy', 'mobile']);
652
- return (
653
- <PillGroup
654
- value={pillValue}
655
- onChange={v => setPillValue(v as string[])}
656
- wrap={false}
657
- multiple
658
- >
659
- <Pill value="all" label="All" />
660
- <Pill value="energy" label="Energy" icon={ElectricityMediumIcon} />
661
- <Pill value="broadband" label="Broadband" icon={BroadbandMediumIcon} />
662
- <Pill value="mobile" label="Mobile" icon={MobileMediumIcon} />
663
- </PillGroup>
664
- );
665
- })()}
652
+ (
653
+ <PillGroup
654
+ value={pillValue}
655
+ onChange={v => setPillValue(v as string[])}
656
+ wrap={false}
657
+ multiple
658
+ >
659
+ <Pill value="all" label="All" />
660
+ <Pill value="energy" label="Energy" icon={ElectricityMediumIcon} />
661
+ <Pill value="broadband" label="Broadband" icon={BroadbandMediumIcon} />
662
+ <Pill value="mobile" label="Mobile" icon={MobileMediumIcon} />
663
+ </PillGroup>
664
+ );
666
665
  </Center>
667
666
  </ComponentWrapper>
668
667
  <ComponentWrapper
@@ -1,24 +1,21 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
- import { BottomSheetModalProvider, Box, useColorMode } from '../../src';
2
+ import { BottomSheetModalProvider, Box } from '../../src';
3
3
 
4
- const UsageWrap: FC<PropsWithChildren> = ({ children }) => {
5
- const [colorMode] = useColorMode();
6
- return (
7
- <div className="sb-unstyled">
8
- <Box
9
- mt="300"
10
- p="200"
11
- bg="backgroundPrimary"
12
- borderRadius="md"
13
- borderWidth="1"
14
- borderColor="borderSubtle"
15
- width="100%"
16
- position="relative"
17
- >
18
- <BottomSheetModalProvider>{children}</BottomSheetModalProvider>
19
- </Box>
20
- </div>
21
- );
22
- };
4
+ const UsageWrap: FC<PropsWithChildren> = ({ children }) => (
5
+ <div className="sb-unstyled">
6
+ <Box
7
+ mt="300"
8
+ p="200"
9
+ bg="backgroundPrimary"
10
+ borderRadius="md"
11
+ borderWidth="1"
12
+ borderColor="borderSubtle"
13
+ width="100%"
14
+ position="relative"
15
+ >
16
+ <BottomSheetModalProvider>{children}</BottomSheetModalProvider>
17
+ </Box>
18
+ </div>
19
+ );
23
20
 
24
21
  export default UsageWrap;
@@ -1,4 +1,6 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { ColorItem, ColorPalette, Meta } from '@storybook/addon-docs/blocks';
2
+ import { color } from '@utilitywarehouse/hearth-tokens/js';
3
+ import { Box, Link } from '../src/components';
2
4
  import { BackToTopButton, NextPrevPage } from './components';
3
5
 
4
6
  <Meta title="Theme Tokens" />
@@ -13,7 +15,10 @@ Hearth React Native provides a comprehensive set of design tokens that ensure co
13
15
  - [Colors](#colors)
14
16
  - [Brand and Service Colors](#brand-and-service-colors)
15
17
  - [Semantic Colors](#semantic-colors)
18
+ - [Light Theme Colors](#light-theme-colors)
19
+ - [Dark Theme Colors](#dark-theme-colors)
16
20
  - [Primitive Color Palette](#primitive-color-palette)
21
+ - [Color Scales](#color-scales)
17
22
  - [Typography](#typography)
18
23
  - [Font Family](#font-family)
19
24
  - [Font Size](#font-size)
@@ -111,7 +116,52 @@ const styles = StyleSheet.create(theme => ({
111
116
 
112
117
  The color system provides both semantic and primitive color tokens that automatically adapt to light and dark themes.
113
118
 
114
- You can view the full color palette in the [Hearth Tokens documentation](https://hearth.prod.uw.systems/?path=/docs/tokens_colours--docs#available-colour-tokens).
119
+ You can view the full color scales below.
120
+
121
+ <Box
122
+ style={{
123
+ position: 'sticky',
124
+ top: 0,
125
+ width: 240,
126
+ padding: 8,
127
+ height: 16,
128
+ overflow: 'visible',
129
+ marginLeft: '-260px !important',
130
+ zIndex: 1,
131
+ }}
132
+ >
133
+ <ul
134
+ style={{
135
+ listStyleType: 'none',
136
+ paddingLeft: 0,
137
+ marginLeft: 0,
138
+ }}
139
+ >
140
+ <li>[Colors](#colors)</li>
141
+ <ul style={{ marginTop: 0, marginBottom: 0 }}>
142
+ <li>[Brand and Service Colors](#brand-and-service-colors)</li>
143
+ <li>[Semantic Colors](#semantic-colors)</li>
144
+ <li>[Light Theme Colors](#light-theme-colors)</li>
145
+ <li>[Dark Theme Colors](#dark-theme-colors)</li>
146
+ <li>[Primitive Color Palette](#primitive-color-palette)</li>
147
+ <li>[Color Scales](#color-scales)</li>
148
+ </ul>
149
+ <li>[Typography](#typography)</li>
150
+ <ul style={{ marginTop: 0, marginBottom: 0 }}>
151
+ <li>[Font Family](#font-family)</li>
152
+ <li>[Font Size](#font-size)</li>
153
+ <li>[Font Weight](#font-weight)</li>
154
+ <li>[Letter Spacing](#letter-spacing)</li>
155
+ <li>[Line Height](#line-height)</li>
156
+ </ul>
157
+ <li>[Spacing](#spacing)</li>
158
+ <li>[Border](#border)</li>
159
+ <ul style={{ marginTop: 0, marginBottom: 0 }}>
160
+ <li>[Border Width](#border-width)</li>
161
+ <li>[Border Radius](#border-radius)</li>
162
+ </ul>
163
+ </ul>
164
+ </Box>
115
165
 
116
166
  ### Brand and Service Colors
117
167
 
@@ -245,6 +295,296 @@ const styles = StyleSheet.create(theme => ({
245
295
  }));
246
296
  ```
247
297
 
298
+ #### Light Theme Colors
299
+
300
+ <ColorPalette>
301
+ <ColorItem
302
+ title="Background"
303
+ subtitle="Background colors"
304
+ colors={{
305
+ 'background.brand': color.light.background.brand,
306
+ 'background.primary': color.light.background.primary,
307
+ 'background.secondary': color.light.background.secondary,
308
+ }}
309
+ />
310
+ <ColorItem
311
+ title="Text"
312
+ subtitle="Text colors"
313
+ colors={{
314
+ 'text.primary': color.light.text.primary,
315
+ 'text.secondary': color.light.text.secondary,
316
+ 'text.inverted': color.light.text.inverted,
317
+ }}
318
+ />
319
+ <ColorItem
320
+ title="Border"
321
+ subtitle="Border colors"
322
+ colors={{
323
+ 'border.strong': color.light.border.strong,
324
+ 'border.subtle': color.light.border.subtle,
325
+ }}
326
+ />
327
+ <ColorItem
328
+ title="Focus"
329
+ subtitle="Focus indicator colors"
330
+ colors={{
331
+ 'focus.primary': color.light.focus.primary,
332
+ 'focus.inverted': color.light.focus.inverted,
333
+ }}
334
+ />
335
+ <ColorItem
336
+ title="Feedback - Danger"
337
+ subtitle="Error and danger states"
338
+ colors={{
339
+ 'feedback.danger.\nsurface.default': color.light.feedback.danger.surface.default,
340
+ 'feedback.danger.\nsurface.subtle': color.light.feedback.danger.surface.subtle,
341
+ 'feedback.danger.\nborder': color.light.feedback.danger.border,
342
+ }}
343
+ />
344
+ <ColorItem
345
+ title="Feedback - Functional"
346
+ subtitle="Neutral functional states"
347
+ colors={{
348
+ 'feedback.functional.\nsurface.default': color.light.feedback.functional.surface.default,
349
+ 'feedback.functional.\nsurface.subtle': color.light.feedback.functional.surface.subtle,
350
+ 'feedback.functional.\nborder': color.light.feedback.functional.border,
351
+ }}
352
+ />
353
+ <ColorItem
354
+ title="Feedback - Info"
355
+ subtitle="Information states"
356
+ colors={{
357
+ 'feedback.info.\nsurface.default': color.light.feedback.info.surface.default,
358
+ 'feedback.info.\nsurface.subtle': color.light.feedback.info.surface.subtle,
359
+ 'feedback.info.\nborder': color.light.feedback.info.border,
360
+ }}
361
+ />
362
+ <ColorItem
363
+ title="Feedback - Positive"
364
+ subtitle="Success and positive states"
365
+ colors={{
366
+ 'feedback.positive.\nsurface.default': color.light.feedback.positive.surface.default,
367
+ 'feedback.positive.\nsurface.subtle': color.light.feedback.positive.surface.subtle,
368
+ 'feedback.positive.\nborder': color.light.feedback.positive.border,
369
+ }}
370
+ />
371
+ <ColorItem
372
+ title="Feedback - Warning"
373
+ subtitle="Warning and caution states"
374
+ colors={{
375
+ 'feedback.warning.\nsurface.default': color.light.feedback.warning.surface.default,
376
+ 'feedback.warning.\nsurface.subtle': color.light.feedback.warning.surface.subtle,
377
+ 'feedback.warning.\nborder': color.light.feedback.warning.border,
378
+ }}
379
+ />
380
+ <ColorItem
381
+ title="Surface - Brand"
382
+ subtitle="Brand surface colors"
383
+ colors={{
384
+ 'surface.brand.default': color.light.surface.brand.default,
385
+ 'surface.brand.strong': color.light.surface.brand.strong,
386
+ 'surface.brand.subtle': color.light.surface.brand.subtle,
387
+ }}
388
+ />
389
+ <ColorItem
390
+ title="Surface - Service Colors"
391
+ subtitle="Service-specific surface colors"
392
+ colors={{
393
+ 'surface.\nbroadband.default': color.light.surface.broadband.default,
394
+ 'surface.\nbroadband.subtle': color.light.surface.broadband.subtle,
395
+ 'surface.\ncashback.default': color.light.surface.cashback.default,
396
+ 'surface.\ncashback.subtle': color.light.surface.cashback.subtle,
397
+ 'surface.\nenergy.default': color.light.surface.energy.default,
398
+ 'surface.\nenergy.subtle': color.light.surface.energy.subtle,
399
+ }}
400
+ />
401
+ <ColorItem
402
+ title="Surface - Other Services"
403
+ subtitle="Additional service surface colors"
404
+ colors={{
405
+ 'surface.\nhighlight.default': color.light.surface.highlight.default,
406
+ 'surface.\nhighlight.subtle': color.light.surface.highlight.subtle,
407
+ 'surface.\ninsurance.default': color.light.surface.insurance.default,
408
+ 'surface.\ninsurance.subtle': color.light.surface.insurance.subtle,
409
+ 'surface.\nmobile.default': color.light.surface.mobile.default,
410
+ 'surface.\nmobile.subtle': color.light.surface.mobile.subtle,
411
+ }}
412
+ />
413
+ <ColorItem
414
+ title="Surface - Pig"
415
+ subtitle="Pig service surface colors"
416
+ colors={{
417
+ 'surface.pig.default': color.light.surface.pig.default,
418
+ 'surface.pig.subtle': color.light.surface.pig.subtle,
419
+ }}
420
+ />
421
+ <ColorItem
422
+ title="Shadow Colors"
423
+ subtitle="Shadow and elevation colors"
424
+ colors={{
425
+ 'shadow.default': color.light.shadow.default,
426
+ 'shadow.brand': color.light.shadow.brand,
427
+ 'shadow.broadband': color.light.shadow.broadband,
428
+ 'shadow.cashback': color.light.shadow.cashback,
429
+ 'shadow.energy': color.light.shadow.energy,
430
+ 'shadow.insurance': color.light.shadow.insurance,
431
+ }}
432
+ />
433
+ <ColorItem
434
+ title="Shadow Colors (Cont.)"
435
+ subtitle="Additional shadow colors"
436
+ colors={{
437
+ 'shadow.mobile': color.light.shadow.mobile,
438
+ 'shadow.pig': color.light.shadow.pig,
439
+ }}
440
+ />
441
+ </ColorPalette>
442
+
443
+ #### Dark Theme Colors
444
+
445
+ <ColorPalette>
446
+ <ColorItem
447
+ title="Background"
448
+ subtitle="Background colors"
449
+ colors={{
450
+ 'background.brand': color.dark.background.brand,
451
+ 'background.primary': color.dark.background.primary,
452
+ 'background.secondary': color.dark.background.secondary,
453
+ }}
454
+ />
455
+ <ColorItem
456
+ title="Text"
457
+ subtitle="Text colors"
458
+ colors={{
459
+ 'text.primary': color.dark.text.primary,
460
+ 'text.secondary': color.dark.text.secondary,
461
+ 'text.inverted': color.dark.text.inverted,
462
+ }}
463
+ />
464
+ <ColorItem
465
+ title="Border"
466
+ subtitle="Border colors"
467
+ colors={{
468
+ 'border.strong': color.dark.border.strong,
469
+ 'border.subtle': color.dark.border.subtle,
470
+ }}
471
+ />
472
+ <ColorItem
473
+ title="Focus"
474
+ subtitle="Focus indicator colors"
475
+ colors={{
476
+ 'focus.primary': color.dark.focus.primary,
477
+ 'focus.inverted': color.dark.focus.inverted,
478
+ }}
479
+ />
480
+ <ColorItem
481
+ title="Feedback - Danger"
482
+ subtitle="Error and danger states"
483
+ colors={{
484
+ 'feedback.danger.\nsurface.default': color.dark.feedback.danger.surface.default,
485
+ 'feedback.danger.\nsurface.subtle': color.dark.feedback.danger.surface.subtle,
486
+ 'feedback.danger.\nborder': color.dark.feedback.danger.border,
487
+ }}
488
+ />
489
+ <ColorItem
490
+ title="Feedback - Functional"
491
+ subtitle="Neutral functional states"
492
+ colors={{
493
+ 'feedback.functional.\nsurface.default': color.dark.feedback.functional.surface.default,
494
+ 'feedback.functional.\nsurface.subtle': color.dark.feedback.functional.surface.subtle,
495
+ 'feedback.functional.\nborder': color.dark.feedback.functional.border,
496
+ }}
497
+ />
498
+ <ColorItem
499
+ title="Feedback - Info"
500
+ subtitle="Information states"
501
+ colors={{
502
+ 'feedback.info.surface.\ndefault': color.dark.feedback.info.surface.default,
503
+ 'feedback.info.surface.\nsubtle': color.dark.feedback.info.surface.subtle,
504
+ 'feedback.info.border': color.dark.feedback.info.border,
505
+ }}
506
+ />
507
+ <ColorItem
508
+ title="Feedback - Positive"
509
+ subtitle="Success and positive states"
510
+ colors={{
511
+ 'feedback.positive.\nsurface.default': color.dark.feedback.positive.surface.default,
512
+ 'feedback.positive.\nsurface.subtle': color.dark.feedback.positive.surface.subtle,
513
+ 'feedback.positive.\nborder': color.dark.feedback.positive.border,
514
+ }}
515
+ />
516
+ <ColorItem
517
+ title="Feedback - Warning"
518
+ subtitle="Warning and caution states"
519
+ colors={{
520
+ 'feedback.warning.\nsurface.default': color.dark.feedback.warning.surface.default,
521
+ 'feedback.warning.\nsurface.subtle': color.dark.feedback.warning.surface.subtle,
522
+ 'feedback.warning.\nborder': color.dark.feedback.warning.border,
523
+ }}
524
+ />
525
+ <ColorItem
526
+ title="Surface - Brand"
527
+ subtitle="Brand surface colors"
528
+ colors={{
529
+ 'surface.brand.default': color.dark.surface.brand.default,
530
+ 'surface.brand.strong': color.dark.surface.brand.strong,
531
+ 'surface.brand.subtle': color.dark.surface.brand.subtle,
532
+ }}
533
+ />
534
+ <ColorItem
535
+ title="Surface - Service Colors"
536
+ subtitle="Service-specific surface colors"
537
+ colors={{
538
+ 'surface.\nbroadband.default': color.dark.surface.broadband.default,
539
+ 'surface.\nbroadband.subtle': color.dark.surface.broadband.subtle,
540
+ 'surface.\ncashback.default': color.dark.surface.cashback.default,
541
+ 'surface.\ncashback.subtle': color.dark.surface.cashback.subtle,
542
+ 'surface.\nenergy.default': color.dark.surface.energy.default,
543
+ 'surface.\nenergy.subtle': color.dark.surface.energy.subtle,
544
+ }}
545
+ />
546
+ <ColorItem
547
+ title="Surface - Other Services"
548
+ subtitle="Additional service surface colors"
549
+ colors={{
550
+ 'surface.\nhighlight.default': color.dark.surface.highlight.default,
551
+ 'surface.\nhighlight.subtle': color.dark.surface.highlight.subtle,
552
+ 'surface.\ninsurance.default': color.dark.surface.insurance.default,
553
+ 'surface.\ninsurance.subtle': color.dark.surface.insurance.subtle,
554
+ 'surface.\nmobile.default': color.dark.surface.mobile.default,
555
+ 'surface.\nmobile.subtle': color.dark.surface.mobile.subtle,
556
+ }}
557
+ />
558
+ <ColorItem
559
+ title="Surface - Pig"
560
+ subtitle="Pig service surface colors"
561
+ colors={{
562
+ 'surface.pig.default': color.dark.surface.pig.default,
563
+ 'surface.pig.subtle': color.dark.surface.pig.subtle,
564
+ }}
565
+ />
566
+ <ColorItem
567
+ title="Shadow Colors"
568
+ subtitle="Shadow and elevation colors"
569
+ colors={{
570
+ 'shadow.default': color.dark.shadow.default,
571
+ 'shadow.brand': color.dark.shadow.brand,
572
+ 'shadow.broadband': color.dark.shadow.broadband,
573
+ 'shadow.cashback': color.dark.shadow.cashback,
574
+ 'shadow.energy': color.dark.shadow.energy,
575
+ 'shadow.insurance': color.dark.shadow.insurance,
576
+ }}
577
+ />
578
+ <ColorItem
579
+ title="Shadow Colors (Cont.)"
580
+ subtitle="Additional shadow colors"
581
+ colors={{
582
+ 'shadow.mobile': color.dark.shadow.mobile,
583
+ 'shadow.pig': color.dark.shadow.pig,
584
+ }}
585
+ />
586
+ </ColorPalette>
587
+
248
588
  ### Primitive Color Palette
249
589
 
250
590
  Access the full primitive color palette for custom use cases:
@@ -266,6 +606,54 @@ Available primitive colors with full scales (0-1000):
266
606
  - `broadbandGreen`, `energyBlue`, `mobileRose`
267
607
  - `insuranceOrange`, `cashbackLilac`, `piggyPink`
268
608
 
609
+ #### Color Scales
610
+
611
+ <ColorPalette>
612
+ {Object.keys(color)
613
+ .filter(key => !['light', 'dark'].includes(key))
614
+ .map(key => (
615
+ <>
616
+ <ColorItem
617
+ key={`${key}-1`}
618
+ title={key}
619
+ subtitle={`${key}`}
620
+ colors={Object.keys(color[key])
621
+ .slice(0, 6)
622
+ .reduce((acc, subKey) => {
623
+ acc[subKey] = color[key][subKey];
624
+ return acc;
625
+ }, {})}
626
+ />
627
+ {Object.keys(color[key]).length > 6 && (
628
+ <ColorItem
629
+ key={`${key}-2`}
630
+ title=""
631
+ subtitle=""
632
+ colors={Object.keys(color[key])
633
+ .slice(6, 12)
634
+ .reduce((acc, subKey) => {
635
+ acc[subKey] = color[key][subKey];
636
+ return acc;
637
+ }, {})}
638
+ />
639
+ )}
640
+ {Object.keys(color[key]).length > 12 && (
641
+ <ColorItem
642
+ key={`${key}-3`}
643
+ title=""
644
+ subtitle=""
645
+ colors={Object.keys(color[key])
646
+ .slice(12, 18)
647
+ .reduce((acc, subKey) => {
648
+ acc[subKey] = color[key][subKey];
649
+ return acc;
650
+ }, {})}
651
+ />
652
+ )}
653
+ </>
654
+ ))}
655
+ </ColorPalette>
656
+
269
657
  ## Typography
270
658
 
271
659
  The typography system provides a cohesive set of font properties based on the design system.
package/eslint.config.js CHANGED
@@ -8,13 +8,17 @@ import globals from 'globals';
8
8
  import tseslint from 'typescript-eslint';
9
9
 
10
10
  export default tseslint.config(
11
- { ignores: ['build', 'dist', 'storybook-static'] },
11
+ { ignores: ['build', 'dist', 'storybook-static', '**/*.figma.tsx'] },
12
12
  {
13
13
  extends: [js.configs.recommended, ...tseslint.configs.recommended],
14
14
  files: ['**/*.{ts,tsx}'],
15
15
  languageOptions: {
16
16
  ecmaVersion: 2020,
17
17
  globals: globals.browser,
18
+ parserOptions: {
19
+ project: './tsconfig.eslint.json',
20
+ tsconfigRootDir: import.meta.dirname,
21
+ },
18
22
  },
19
23
  plugins: {
20
24
  'react-hooks': reactHooks,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilitywarehouse/hearth-react-native",
3
- "version": "0.15.3",
3
+ "version": "0.16.1",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -25,18 +25,18 @@
25
25
  "devDependencies": {
26
26
  "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
27
27
  "@chromatic-com/storybook": "^4.1.3",
28
- "@figma/code-connect": "^1.3.11",
28
+ "@figma/code-connect": "^1.3.12",
29
29
  "@gorhom/bottom-sheet": "5.2.6",
30
- "@storybook/addon-a11y": "^10.1.4",
31
- "@storybook/addon-docs": "^10.1.4",
32
- "@storybook/addon-vitest": "^10.1.4",
33
- "@storybook/react-native-web-vite": "^10.1.4",
30
+ "@storybook/addon-a11y": "^10.2.1",
31
+ "@storybook/addon-docs": "^10.2.1",
32
+ "@storybook/addon-vitest": "^10.2.1",
33
+ "@storybook/react-native-web-vite": "^10.2.1",
34
34
  "@types/prismjs": "^1.26.5",
35
35
  "@types/react": "^19.1.10",
36
36
  "@vitest/browser": "^3.2.4",
37
37
  "@vitest/coverage-v8": "^3.2.4",
38
38
  "chromatic": "^13.3.0",
39
- "eslint-plugin-storybook": "10.1.4",
39
+ "eslint-plugin-storybook": "10.2.1",
40
40
  "playwright": "^1.55.1",
41
41
  "prismjs": "^1.30.0",
42
42
  "react": "^19.1.0",
@@ -50,14 +50,14 @@
50
50
  "react-native-web": "^0.20.0",
51
51
  "react-native-worklets": "^0.6.1",
52
52
  "remark-gfm": "^4.0.1",
53
- "storybook": "^10.1.4",
53
+ "storybook": "^10.2.1",
54
54
  "typescript": "^5.7.3",
55
55
  "vite": "^7.1.3",
56
56
  "vite-plugin-svgr": "^4.5.0",
57
57
  "vitest": "^3.2.4",
58
+ "@utilitywarehouse/hearth-fonts": "^0.0.4",
58
59
  "@utilitywarehouse/hearth-react-icons": "^0.7.4",
59
60
  "@utilitywarehouse/hearth-react-native-icons": "^0.7.4",
60
- "@utilitywarehouse/hearth-fonts": "^0.0.4",
61
61
  "@utilitywarehouse/hearth-svg-assets": "^0.3.0",
62
62
  "@utilitywarehouse/hearth-tokens": "^0.2.2"
63
63
  },
@@ -69,15 +69,15 @@
69
69
  "react-native-gesture-handler": "^2.22.0",
70
70
  "react-native-reanimated": "3.x || ^4.x",
71
71
  "react-native-svg": ">=13.4.0",
72
- "react-native-unistyles": ">=>3.0.0",
72
+ "react-native-unistyles": ">=3.0.0",
73
73
  "react-native-web": ">=0.19"
74
74
  },
75
75
  "scripts": {
76
76
  "clean": "rm -rf node_modules rm -rf build .turbo",
77
77
  "generateColours": "node ./scripts/generateColours.js",
78
78
  "copyTokens": "node ./scripts/copyTokens.js",
79
- "lint:fix": "TIMING=1 eslint --fix --max-warnings 0",
80
- "lint": "TIMING=1 eslint --max-warnings 0",
79
+ "lint:fix": "TIMING=1 eslint --fix .",
80
+ "lint": "TIMING=1 eslint .",
81
81
  "build": "tsc",
82
82
  "watch": "tsc --watch",
83
83
  "figma:create": "figma connect create",
@@ -1,23 +1,21 @@
1
- import React from "react"
2
- import Accordion from "./Accordion"
3
- import figma from "@figma/code-connect"
4
-
5
- /**
6
- * -- This file was auto-generated by Code Connect --
7
- * None of your props could be automatically mapped to Figma properties.
8
- * You should update the `props` object to include a mapping from your
9
- * code props to Figma properties, and update the `example` function to
10
- * return the code example you'd like to see in Figma
11
- */
1
+ import figma from '@figma/code-connect';
2
+ import { Accordion } from './';
12
3
 
13
4
  figma.connect(
14
5
  Accordion,
15
- "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3385%3A7751",
6
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3385%3A7751',
16
7
  {
17
8
  props: {
18
- // No matching props could be found for these Figma properties:
19
- // "sectionHeader": figma.boolean('Section header?')
9
+ sectionHeader: figma.nestedProps('Section Header', {
10
+ helperText: figma.string('Helper text'),
11
+ heading: figma.string('Heading'),
12
+ }),
13
+ items: figma.children('Accordion Item'),
20
14
  },
21
- example: (props) => <Accordion />,
22
- },
23
- )
15
+ example: props => (
16
+ <Accordion heading={props.sectionHeader.heading} helperText={props.sectionHeader.helperText}>
17
+ {props.items}
18
+ </Accordion>
19
+ ),
20
+ }
21
+ );