@utilitywarehouse/hearth-react-native 0.15.3 → 0.16.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 (83) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +1 -3
  3. package/CHANGELOG.md +67 -6
  4. package/build/components/Checkbox/CheckboxGroup.d.ts +1 -1
  5. package/build/components/Checkbox/CheckboxGroup.js +2 -2
  6. package/build/components/Checkbox/CheckboxGroup.props.d.ts +2 -1
  7. package/build/components/CurrencyInput/CurrencyInput.d.ts +1 -1
  8. package/build/components/CurrencyInput/CurrencyInput.js +2 -6
  9. package/build/components/CurrencyInput/CurrencyInput.props.d.ts +6 -0
  10. package/build/components/DateInput/DateInputSegment.js +0 -1
  11. package/build/components/DatePickerInput/DatePickerInput.d.ts +1 -1
  12. package/build/components/DatePickerInput/DatePickerInput.js +2 -2
  13. package/build/components/DatePickerInput/DatePickerInput.props.d.ts +6 -0
  14. package/build/components/FormField/FormField.context.d.ts +8 -2
  15. package/build/components/FormField/FormField.d.ts +1 -1
  16. package/build/components/FormField/FormField.js +24 -4
  17. package/build/components/FormField/FormField.props.d.ts +2 -0
  18. package/build/components/FormField/FormFieldLabel.d.ts +1 -1
  19. package/build/components/FormField/FormFieldLabel.js +3 -3
  20. package/build/components/FormField/FormFieldValid.js +2 -2
  21. package/build/components/Input/Input.js +48 -10
  22. package/build/components/Input/Input.props.d.ts +7 -1
  23. package/build/components/Label/Label.d.ts +1 -1
  24. package/build/components/Label/Label.js +5 -1
  25. package/build/components/Label/Label.props.d.ts +3 -2
  26. package/build/components/Radio/RadioGroup.d.ts +1 -1
  27. package/build/components/Radio/RadioGroup.js +2 -2
  28. package/build/components/Radio/RadioGroup.props.d.ts +1 -0
  29. package/build/components/RadioCard/RadioCard.d.ts +1 -1
  30. package/build/components/RadioCard/RadioCard.js +2 -2
  31. package/build/components/RadioCard/RadioCard.props.d.ts +1 -0
  32. package/build/components/Select/Select.d.ts +1 -1
  33. package/build/components/Select/Select.js +2 -2
  34. package/build/components/Select/Select.props.d.ts +10 -0
  35. package/build/components/Textarea/Textarea.d.ts +1 -1
  36. package/build/components/Textarea/Textarea.js +43 -6
  37. package/build/components/Textarea/Textarea.props.d.ts +8 -0
  38. package/build/components/VerificationInput/VerificationInput.d.ts +1 -1
  39. package/build/components/VerificationInput/VerificationInput.js +2 -2
  40. package/build/components/VerificationInput/VerificationInput.props.d.ts +4 -0
  41. package/docs/components/AllComponents.web.tsx +3 -2
  42. package/docs/theme-tokens.mdx +390 -2
  43. package/package.json +3 -3
  44. package/src/components/Checkbox/Checkbox.docs.mdx +32 -31
  45. package/src/components/Checkbox/CheckboxGroup.props.ts +2 -1
  46. package/src/components/Checkbox/CheckboxGroup.tsx +6 -1
  47. package/src/components/CurrencyInput/CurrencyInput.docs.mdx +52 -9
  48. package/src/components/CurrencyInput/CurrencyInput.props.ts +6 -0
  49. package/src/components/CurrencyInput/CurrencyInput.stories.tsx +30 -1
  50. package/src/components/CurrencyInput/CurrencyInput.tsx +16 -8
  51. package/src/components/DateInput/DateInputSegment.tsx +0 -1
  52. package/src/components/DatePickerInput/DatePickerInput.docs.mdx +22 -0
  53. package/src/components/DatePickerInput/DatePickerInput.props.ts +6 -0
  54. package/src/components/DatePickerInput/DatePickerInput.tsx +17 -3
  55. package/src/components/FormField/FormField.context.ts +6 -1
  56. package/src/components/FormField/FormField.docs.mdx +30 -30
  57. package/src/components/FormField/FormField.props.ts +2 -0
  58. package/src/components/FormField/FormField.stories.tsx +8 -2
  59. package/src/components/FormField/FormField.tsx +38 -4
  60. package/src/components/FormField/FormFieldLabel.tsx +7 -3
  61. package/src/components/FormField/FormFieldValid.tsx +2 -2
  62. package/src/components/Input/Input.docs.mdx +67 -22
  63. package/src/components/Input/Input.props.ts +7 -1
  64. package/src/components/Input/Input.stories.tsx +9 -1
  65. package/src/components/Input/Input.tsx +124 -59
  66. package/src/components/Label/Label.props.ts +3 -2
  67. package/src/components/Label/Label.tsx +11 -1
  68. package/src/components/Radio/Radio.docs.mdx +31 -30
  69. package/src/components/Radio/RadioGroup.props.ts +1 -0
  70. package/src/components/Radio/RadioGroup.stories.tsx +6 -0
  71. package/src/components/Radio/RadioGroup.tsx +6 -1
  72. package/src/components/RadioCard/RadioCard.docs.mdx +31 -30
  73. package/src/components/RadioCard/RadioCard.props.ts +1 -0
  74. package/src/components/RadioCard/RadioCard.tsx +8 -2
  75. package/src/components/Select/Select.props.ts +10 -0
  76. package/src/components/Select/Select.tsx +3 -2
  77. package/src/components/Textarea/Textarea.docs.mdx +65 -17
  78. package/src/components/Textarea/Textarea.props.ts +8 -0
  79. package/src/components/Textarea/Textarea.stories.tsx +23 -2
  80. package/src/components/Textarea/Textarea.tsx +84 -19
  81. package/src/components/VerificationInput/VerificationInput.docs.mdx +1 -0
  82. package/src/components/VerificationInput/VerificationInput.props.ts +4 -1
  83. package/src/components/VerificationInput/VerificationInput.tsx +2 -0
@@ -6,6 +6,7 @@ interface RadioCardProps extends Omit<PressableProps, 'children'> {
6
6
  onChange?: (isSelected: boolean) => void;
7
7
  children?: ViewProps['children'];
8
8
  label?: string;
9
+ labelVariant?: 'heading' | 'body';
9
10
  flexDirection?: ViewStyle['flexDirection'];
10
11
  flexWrap?: ViewStyle['flexWrap'];
11
12
  alignItems?: ViewStyle['alignItems'];
@@ -1,6 +1,6 @@
1
1
  import SelectProps from './Select.props';
2
2
  declare const Select: {
3
- ({ options, value, onValueChange, label, placeholder, disabled, leadingIcon: LeadingIcon, validationStatus, required, children, bottomSheetProps, menuHeading, readonly, emptyText, listProps, searchable, searchPlaceholder, ...rest }: SelectProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ options, value, onValueChange, label, labelVariant, placeholder, disabled, leadingIcon: LeadingIcon, validationStatus, required, children, bottomSheetProps, menuHeading, readonly, emptyText, listProps, searchable, searchPlaceholder, ...rest }: SelectProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default Select;
@@ -12,7 +12,7 @@ import { Input } from '../Input';
12
12
  import { Label } from '../Label';
13
13
  import { SelectContext } from './Select.context';
14
14
  import SelectOption from './SelectOption';
15
- const Select = ({ options = [], value, onValueChange, label, placeholder = 'Select an option', disabled = false, leadingIcon: LeadingIcon, validationStatus = 'initial', required = true, children, bottomSheetProps, menuHeading, readonly = false, emptyText = 'No options available', listProps, searchable = false, searchPlaceholder = 'Search', ...rest }) => {
15
+ const Select = ({ options = [], value, onValueChange, label, labelVariant = 'body', placeholder = 'Select an option', disabled = false, leadingIcon: LeadingIcon, validationStatus = 'initial', required = true, children, bottomSheetProps, menuHeading, readonly = false, emptyText = 'No options available', listProps, searchable = false, searchPlaceholder = 'Search', ...rest }) => {
16
16
  const formFieldContext = useFormFieldContext();
17
17
  const validationStatusFromContext = formFieldContext?.validationStatus ?? validationStatus;
18
18
  const isRequired = formFieldContext?.required ?? required;
@@ -67,7 +67,7 @@ const Select = ({ options = [], value, onValueChange, label, placeholder = 'Sele
67
67
  }, []);
68
68
  const renderSelectOption = useCallback(({ item }) => (_jsx(SelectOption, { label: item.label, value: item.value, disabled: item.disabled, leadingIcon: item.leadingIcon, trailingIcon: item.trailingIcon })), []);
69
69
  const renderEmptyComponent = useCallback(() => (_jsx(BottomSheetView, { style: styles.emptyContainer, children: _jsx(DetailText, { children: emptyText }) })), [emptyText]);
70
- return (_jsxs(View, { ...rest, style: [styles.container, rest.style], children: [!!label && (_jsx(View, { children: _jsxs(Label, { children: [label, !isRequired && _jsx(Label, { children: " (Optional)" })] }) })), _jsxs(Pressable, { onPress: openBottomSheet, disabled: isDisabled || isReadonly, style: ({ pressed }) => [
70
+ return (_jsxs(View, { ...rest, style: [styles.container, rest.style], children: [!!label && (_jsx(View, { children: _jsxs(Label, { variant: labelVariant, children: [label, !isRequired && _jsx(Label, { variant: labelVariant, children: " (Optional)" })] }) })), _jsxs(Pressable, { onPress: openBottomSheet, disabled: isDisabled || isReadonly, style: ({ pressed }) => [
71
71
  styles.selectContainer,
72
72
  styles.pressedContainer(pressed || isOpen),
73
73
  ], children: [!!LeadingIcon && (_jsx(View, { children: (() => {
@@ -40,6 +40,16 @@ interface SelectProps extends ViewProps {
40
40
  * Label for the select
41
41
  */
42
42
  label?: string;
43
+ /**
44
+ * The variant of the label text.
45
+ *
46
+ * Supported values are:
47
+ * - `'heading'` – use heading text styling for the label.
48
+ * - `'body'` – use body text styling for the label.
49
+ *
50
+ * @default 'body'.
51
+ */
52
+ labelVariant?: 'heading' | 'body';
43
53
  /**
44
54
  * Placeholder text to show when no value is selected
45
55
  */
@@ -7,5 +7,5 @@ export declare const TextareaComponent: import("@gluestack-ui/textarea/lib/types
7
7
  };
8
8
  }, import("react-native").TextInputProps>;
9
9
  export declare const TextareaField: import("react").ForwardRefExoticComponent<import("react-native").TextInputProps & import("react").RefAttributes<import("react-native").TextInputProps> & import("@gluestack-ui/textarea/lib/typescript/types").IInputProps>;
10
- declare const Textarea: ({ validationStatus, children, disabled, focused, readonly, ...props }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
10
+ declare const Textarea: ({ validationStatus, children, disabled, focused, readonly, label, labelVariant, helperText, validText, invalidText, required, helperIcon, ...props }: TextareaProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export default Textarea;
@@ -1,17 +1,54 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createTextarea } from '@gluestack-ui/textarea';
3
- import TextareaRoot from './TextareaRoot';
3
+ import { useEffect } from 'react';
4
+ import { FormField, useFormFieldContext } from '../FormField';
4
5
  import TextareaFieldComponent from './TextareaField';
5
- import { useFormFieldContext } from '../FormField';
6
+ import TextareaRoot from './TextareaRoot';
6
7
  export const TextareaComponent = createTextarea({
7
8
  Root: TextareaRoot,
8
9
  Input: TextareaFieldComponent,
9
10
  });
10
11
  export const TextareaField = TextareaComponent.Input;
11
- const Textarea = ({ validationStatus = 'initial', children, disabled, focused, readonly, ...props }) => {
12
+ const Textarea = ({ validationStatus = 'initial', children, disabled, focused, readonly, label, labelVariant, helperText, validText, invalidText, required, helperIcon, ...props }) => {
12
13
  const formFieldContext = useFormFieldContext();
13
- const { disabled: formFieldDisabled } = formFieldContext;
14
- const validationStatusFromContext = formFieldContext?.validationStatus ?? validationStatus;
15
- return (_jsx(TextareaComponent, { ...(children ? props : {}), validationStatus: validationStatusFromContext, isInvalid: validationStatusFromContext === 'invalid', isReadOnly: readonly, isDisabled: formFieldDisabled ?? disabled, isFocused: focused, children: children ? (_jsx(_Fragment, { children: children })) : (_jsx(_Fragment, { children: _jsx(TextareaField, { ...props }) })) }));
14
+ const textareaLabel = label ?? formFieldContext?.label;
15
+ const textareaHelperText = helperText ?? formFieldContext?.helperText;
16
+ const textareaValidText = validText ?? formFieldContext?.validText;
17
+ const textareaInvalidText = invalidText ?? formFieldContext?.invalidText;
18
+ const textareaRequired = required ?? formFieldContext?.required;
19
+ const textareaDisabled = disabled ?? formFieldContext?.disabled;
20
+ const textareaReadonly = readonly ?? formFieldContext?.readonly;
21
+ const textareaValidationStatus = formFieldContext?.validationStatus ?? validationStatus;
22
+ useEffect(() => {
23
+ if (formFieldContext?.setShouldHandleAccessibility) {
24
+ formFieldContext.setShouldHandleAccessibility(true);
25
+ }
26
+ }, []);
27
+ const getAccessibilityLabel = () => {
28
+ let accessibilityLabel = '';
29
+ if (textareaLabel) {
30
+ accessibilityLabel = accessibilityLabel + textareaLabel;
31
+ }
32
+ if (textareaRequired) {
33
+ accessibilityLabel = accessibilityLabel + ', required';
34
+ }
35
+ return accessibilityLabel || props.accessibilityLabel;
36
+ };
37
+ const getAccessibilityHint = () => {
38
+ let accessibilityHint = '';
39
+ if (textareaValidationStatus !== 'initial') {
40
+ if (accessibilityHint.length > 0) {
41
+ accessibilityHint = accessibilityHint + ', ';
42
+ }
43
+ if (textareaValidationStatus === 'invalid' && textareaInvalidText) {
44
+ accessibilityHint = accessibilityHint + textareaInvalidText;
45
+ }
46
+ if (textareaValidationStatus === 'valid' && textareaValidText) {
47
+ accessibilityHint = accessibilityHint + textareaValidText;
48
+ }
49
+ }
50
+ return accessibilityHint || props.accessibilityHint;
51
+ };
52
+ return (_jsx(FormField, { label: label, labelVariant: labelVariant, helperText: helperText, helperIcon: helperIcon, validText: validText, invalidText: invalidText, required: required, validationStatus: validationStatus, disabled: disabled, readonly: readonly, accessibilityHandledByChildren: true, children: _jsx(TextareaComponent, { ...(children ? props : {}), validationStatus: textareaValidationStatus, isInvalid: textareaValidationStatus === 'invalid', isReadOnly: textareaReadonly, isDisabled: textareaDisabled, isFocused: focused, required: textareaRequired, "aria-label": getAccessibilityLabel(), accessibilityHint: getAccessibilityHint(), children: children ? (_jsx(_Fragment, { children: children })) : (_jsx(_Fragment, { children: _jsx(TextareaField, { ...props }) })) }) }));
16
53
  };
17
54
  export default Textarea;
@@ -23,6 +23,14 @@ export interface TextareaBaseProps {
23
23
  readonly?: boolean;
24
24
  focused?: boolean;
25
25
  placeholder?: string;
26
+ label?: string;
27
+ labelVariant?: 'heading' | 'body';
28
+ helperText?: string;
29
+ helperIcon?: React.ComponentType;
30
+ validText?: string;
31
+ invalidText?: string;
32
+ required?: boolean;
33
+ isInBottomSheet?: boolean;
26
34
  }
27
35
  export interface TextareaWithChildrenProps extends TextareaBaseProps, ViewProps {
28
36
  }
@@ -1,6 +1,6 @@
1
1
  import VerificationInputProps from './VerificationInput.props';
2
2
  declare const VerificationInput: {
3
- ({ value, onChangeText, label, helperText, helperIcon, validationStatus, validText, invalidText, disabled, readonly, secureTextEntry, style, ...props }: VerificationInputProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ value, onChangeText, label, labelVariant, helperText, helperIcon, validationStatus, validText, invalidText, disabled, readonly, secureTextEntry, style, ...props }: VerificationInputProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default VerificationInput;
@@ -4,14 +4,14 @@ import { StyleSheet } from 'react-native-unistyles';
4
4
  import { FormField } from '../FormField';
5
5
  import { useVerificationInput } from './useVerificationInput';
6
6
  import { VerificationInputSlot } from './VerificationInputSlot';
7
- const VerificationInput = ({ value = '', onChangeText, label, helperText, helperIcon, validationStatus = 'initial', validText, invalidText, disabled = false, readonly = false, secureTextEntry = false, style, ...props }) => {
7
+ const VerificationInput = ({ value = '', onChangeText, label, labelVariant = 'body', helperText, helperIcon, validationStatus = 'initial', validText, invalidText, disabled = false, readonly = false, secureTextEntry = false, style, ...props }) => {
8
8
  const length = 6;
9
9
  const { inputRefs, focusedIndex, handleFocus, handleBlur, handleChangeText, handleKeyPress } = useVerificationInput({
10
10
  value,
11
11
  onChangeText,
12
12
  });
13
13
  const slots = Array.from({ length }, (_, index) => index);
14
- return (_jsx(FormField, { label: label, helperText: helperText, helperIcon: helperIcon, validationStatus: validationStatus, validText: validText, invalidText: invalidText, disabled: disabled, readonly: readonly, style: [styles.root, style], ...props, children: _jsx(View, { style: styles.slotsContainer, children: slots.map(index => {
14
+ return (_jsx(FormField, { label: label, labelVariant: labelVariant, helperText: helperText, helperIcon: helperIcon, validationStatus: validationStatus, validText: validText, invalidText: invalidText, disabled: disabled, readonly: readonly, style: [styles.root, style], ...props, children: _jsx(View, { style: styles.slotsContainer, children: slots.map(index => {
15
15
  const char = value[index] || '';
16
16
  const isActive = focusedIndex === index;
17
17
  return (_jsx(VerificationInputSlot, { ref: ref => {
@@ -13,6 +13,10 @@ export interface VerificationInputProps extends ViewProps {
13
13
  * The label for the input.
14
14
  */
15
15
  label?: string;
16
+ /**
17
+ * The label variant for the input.
18
+ */
19
+ labelVariant?: 'heading' | 'body';
16
20
  /**
17
21
  * Helper text to display below the input.
18
22
  */
@@ -17,7 +17,7 @@ import {
17
17
  import SpotBillingDark from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-dark.svg';
18
18
  // @ts-ignore
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,
@@ -489,7 +490,7 @@ const AllComponents: React.FC = () => {
489
490
  headingColor="energy"
490
491
  imageContainerHeight={40}
491
492
  image={
492
- <Image
493
+ <HighlightBannerImage
493
494
  source={{
494
495
  uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=800&q=80',
495
496
  }}
@@ -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/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.0",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -55,9 +55,9 @@
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,7 +69,7 @@
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": {