@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
@@ -1,4 +1,4 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.15.3 build /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.16.1 build /home/runner/work/hearth/hearth/packages/react-native
3
3
  > tsc
4
4
 
@@ -1,8 +1,69 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.15.3 lint /home/runner/work/hearth/hearth/packages/react-native
3
- > TIMING=1 eslint --max-warnings 0
2
+ > @utilitywarehouse/hearth-react-native@0.16.1 lint /home/runner/work/hearth/hearth/packages/react-native
3
+ > TIMING=1 eslint .
4
4
 
5
- Rule | Time (ms) | Relative
6
- :----|----------:|--------:
7
- Rule | Time (ms) | Relative
8
- :----|----------:|--------:
5
+
6
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/Carousel/Carousel.context.tsx
7
+ 6:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
8
+
9
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/Carousel/Carousel.tsx
10
+ 146:6 warning React Hook useMemo has a missing dependency: 'hasCarouselControlsInTree'. Either include it or remove the dependency array react-hooks/exhaustive-deps
11
+
12
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/DatePicker/DatePicker.tsx
13
+ 109:6 warning React Hook useCallback has an unnecessary dependency: 'modalRef.current'. Either exclude it or remove the dependency array. Mutable values like 'modalRef.current' aren't valid dependencies because mutating them doesn't re-render the component react-hooks/exhaustive-deps
14
+ 259:6 warning React Hook useEffect has a missing dependency: 'initialState'. Either include it or remove the dependency array react-hooks/exhaustive-deps
15
+ 346:6 warning React Hook useEffect has a missing dependency: 'onChange'. Either include it or remove the dependency array react-hooks/exhaustive-deps
16
+ 468:5 warning React Hook useCallback has a missing dependency: 'onChange'. Either include it or remove the dependency array react-hooks/exhaustive-deps
17
+ 536:6 warning React Hook useEffect has a missing dependency: 'onSelectMonth'. Either include it or remove the dependency array react-hooks/exhaustive-deps
18
+ 542:6 warning React Hook useEffect has a missing dependency: 'onSelectYear'. Either include it or remove the dependency array react-hooks/exhaustive-deps
19
+
20
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/DatePicker/DatePickerDay.tsx
21
+ 76:6 warning React Hook useMemo has an unnecessary dependency: 'styles.rangeRoot'. Either exclude it or remove the dependency array. Outer scope values like 'styles.rangeRoot' aren't valid dependencies because mutating them doesn't re-render the component react-hooks/exhaustive-deps
22
+ 84:6 warning React Hook useMemo has a missing dependency: 'isSelected'. Either include it or remove the dependency array react-hooks/exhaustive-deps
23
+
24
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/DatePicker/DatePickerDays.tsx
25
+ 179:6 warning React Hook useMemo has unnecessary dependencies: 'month' and 'year'. Either exclude them or remove the dependency array react-hooks/exhaustive-deps
26
+
27
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/DatePicker/DatePickerYears.tsx
28
+ 52:6 warning React Hook useCallback has a missing dependency: 'containerHeight'. Either include it or remove the dependency array. Outer scope values like 'styles' aren't valid dependencies because mutating them doesn't re-render the component react-hooks/exhaustive-deps
29
+
30
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/Input/Input.tsx
31
+ 75:8 warning React Hook useEffect has a missing dependency: 'formFieldContext'. Either include it or remove the dependency array react-hooks/exhaustive-deps
32
+
33
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/Modal/Modal.tsx
34
+ 72:6 warning React Hook useCallback has an unnecessary dependency: 'Platform.OS'. Either exclude it or remove the dependency array. Outer scope values like 'Platform.OS' aren't valid dependencies because mutating them doesn't re-render the component react-hooks/exhaustive-deps
35
+ 268:5 warning React Hook useCallback has a missing dependency: 'footer'. Either include it or remove the dependency array react-hooks/exhaustive-deps
36
+
37
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/Modal/Modal.web.tsx
38
+ 65:6 warning React Hook useCallback has an unnecessary dependency: 'Platform.OS'. Either exclude it or remove the dependency array. Outer scope values like 'Platform.OS' aren't valid dependencies because mutating them doesn't re-render the component react-hooks/exhaustive-deps
39
+
40
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/PillGroup/PillGroup.tsx
41
+ 17:9 warning The 'normalizedValue' conditional could make the dependencies of useMemo Hook (at line 33) change on every render. Move it inside the useMemo callback. Alternatively, wrap the initialization of 'normalizedValue' in its own useMemo() Hook react-hooks/exhaustive-deps
42
+
43
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/Tabs/Tabs.tsx
44
+ 53:6 warning React Hook useEffect has a missing dependency: 'tabValues'. Either include it or remove the dependency array react-hooks/exhaustive-deps
45
+ 53:7 warning React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked react-hooks/exhaustive-deps
46
+ 104:5 warning React Hook useMemo has an unnecessary dependency: 'tabValues'. Either exclude it or remove the dependency array react-hooks/exhaustive-deps
47
+ 127:62 warning React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked react-hooks/exhaustive-deps
48
+
49
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/Textarea/Textarea.tsx
50
+ 45:6 warning React Hook useEffect has a missing dependency: 'formFieldContext'. Either include it or remove the dependency array react-hooks/exhaustive-deps
51
+
52
+ /home/runner/work/hearth/hearth/packages/react-native/src/components/Toast/Toast.context.tsx
53
+ 9:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
54
+ 94:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
55
+
56
+ ✖ 24 problems (0 errors, 24 warnings)
57
+
58
+ Rule | Time (ms) | Relative
59
+ :-----------------------------------------|----------:|--------:
60
+ @typescript-eslint/no-unused-vars | 1453.557 | 63.1%
61
+ react-hooks/exhaustive-deps | 117.512 | 5.1%
62
+ no-global-assign | 117.462 | 5.1%
63
+ react-hooks/rules-of-hooks | 75.475 | 3.3%
64
+ no-unexpected-multiline | 45.705 | 2.0%
65
+ @typescript-eslint/ban-ts-comment | 35.030 | 1.5%
66
+ @typescript-eslint/triple-slash-reference | 30.235 | 1.3%
67
+ no-misleading-character-class | 27.369 | 1.2%
68
+ no-loss-of-precision | 26.374 | 1.1%
69
+ no-useless-escape | 25.969 | 1.1%
package/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
1
  # @utilitywarehouse/hearth-react-native
2
2
 
3
+ ## 0.16.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#817](https://github.com/utilitywarehouse/hearth/pull/817) [`fb4f4d0`](https://github.com/utilitywarehouse/hearth/commit/fb4f4d034e5b67b0c75dc093f7fdd8d3ab26edde) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: `DateInput` height issue
8
+
9
+ ## 0.16.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#810](https://github.com/utilitywarehouse/hearth/pull/810) [`eae4c24`](https://github.com/utilitywarehouse/hearth/commit/eae4c24a421415247c720f88bb8341133340cc7b) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: All `Input` components accessibility improvements and you can now pass a label, helper text and validation to the `Input` component directly.
14
+
15
+ ### Input accessibility improvements and FormField integration
16
+
17
+ The `Input` component has been updated to internally use `FormField`. This allows you to pass props like `label`, `helperText`, and validation status directly to the `Input` component, streamlining its usage.
18
+
19
+ We have also greatly improved accessibility behavior. The `Input` component now intelligently constructs `aria-label` and `accessibilityHint` based on the provided label, helper text, and validation state. To support this, `FormField` now has a mechanism to hide its own accessibility elements when a child component is handling them, preventing duplicate announcements.
20
+
21
+ #### Affected components
22
+ - `Input`
23
+ - `CurrencyInput`
24
+ - `DatePickerInput`
25
+ - `Textarea`
26
+ - `FormField`
27
+
28
+ #### Developer changes
29
+
30
+ You can now use `Input`, `CurrencyInput`, `DatePickerInput`, and `Textarea` without explicitly wrapping them in `FormField` for standard layouts:
31
+
32
+ ```tsx
33
+ // Before
34
+ <FormField label="Email" helperText="Enter email">
35
+ <Input />
36
+ </FormField>
37
+
38
+ // After
39
+ <Input label="Email" helperText="Enter email" />
40
+ ```
41
+
42
+ No breaking changes. The `Input` component continues to support being wrapped externally by `FormField`.
43
+
44
+ #### References
45
+ - UWDS-4179
46
+
47
+ - [#803](https://github.com/utilitywarehouse/hearth/pull/803) [`8e96af6`](https://github.com/utilitywarehouse/hearth/commit/8e96af69f3a3498f264f2a6dc2416cdb6a298275) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Adds `labelVariant` prop to components with a label
48
+
49
+ ### Adds `labelVariant` prop to components with a label
50
+
51
+ Added a `labelVariant` prop to allow consumers to choose between a body or heading style for component labels. Defaults to `body`.
52
+
53
+ #### Affected components
54
+ - `CheckboxGroup`
55
+ - `FormField`
56
+ - `Label`
57
+ - `RadioGroup`
58
+ - `RadioCard`
59
+ - `Select`
60
+ - `VerificationInput`
61
+ - `Input`
62
+ - `CurrencyInput`
63
+ - `DatePickerInput`
64
+ - `Textarea`
65
+
66
+ #### Developer changes
67
+
68
+ You can now pass `labelVariant="heading"` to these components to render the label as a heading instead of body text.
69
+
70
+ ```tsx
71
+ <FormField label="My Label" labelVariant="heading">
72
+ <Input />
73
+ </FormField>
74
+ ```
75
+
3
76
  ## 0.15.3
4
77
 
5
78
  ### Patch Changes
@@ -31,7 +104,6 @@
31
104
  Added new props to `UL`, `OL`, and `ListItem` components to support custom list markers, including icons, images, and colors. This brings the functionality closer to CSS-like list styling. We also fixed a layout issue where list item text could overflow the container.
32
105
 
33
106
  **Components affected**:
34
-
35
107
  - `UL` (UnorderedList)
36
108
  - `OL` (OrderedList)
37
109
  - `ListItem`
@@ -51,7 +123,6 @@
51
123
  ```
52
124
 
53
125
  Supported props:
54
-
55
126
  - `listStyleImage`: React Element (e.g. `<Image />`)
56
127
  - `listStyleIcon`: Icon component
57
128
  - `listStyleWidth` / `listStyleHeight`: Dimensions for the marker (default: 20)
@@ -188,7 +259,6 @@
188
259
  - [#567](https://github.com/utilitywarehouse/hearth/pull/567) [`b6869cf`](https://github.com/utilitywarehouse/hearth/commit/b6869cfaca7b3a5aacb27c06733f0243b6faa02a) Thanks [@MichalCiesliczka](https://github.com/MichalCiesliczka)! - Adds `ProgressStepper` component
189
260
 
190
261
  - [#596](https://github.com/utilitywarehouse/hearth/pull/596) [`61f1073`](https://github.com/utilitywarehouse/hearth/commit/61f10735a42445b6e4eb90282a2b340317f1ec08) Thanks [@jordmccord](https://github.com/jordmccord)! - `List` component updates:
191
-
192
262
  - [BREAKING] The `text` prop in `ListItem` is now `heading`.
193
263
  - Added `ListAction` component.
194
264
  - Added `badge` prop to `ListItem`.
@@ -196,7 +266,6 @@
196
266
  - Removes `divider` prop from `List` and `ListItem`; dividers are now handled automatically.
197
267
 
198
268
  - [#585](https://github.com/utilitywarehouse/hearth/pull/585) [`4894c34`](https://github.com/utilitywarehouse/hearth/commit/4894c34acaadcbbaba78fd64be2f8ae862200e1f) Thanks [@dorota-uw](https://github.com/dorota-uw)! - [BREAKING] `DescriptionListItem` updates:
199
-
200
269
  - Removed `Link` props: `linkText`, `linkHref`, `linkIcon`, `linkIconPosition`, `linkOnPress`, `linkTarget`, `linkShowIcon`.
201
270
  - Added `trailingContent` prop to allow custom trailing content (e.g. Link, Button).
202
271
  - Added validation text support to `DescriptionListItem` via `invalidText` prop.
@@ -204,7 +273,6 @@
204
273
  - [#572](https://github.com/utilitywarehouse/hearth/pull/572) [`9fa6499`](https://github.com/utilitywarehouse/hearth/commit/9fa6499b6eb1534c2ce7dc4352b1f848b94786ec) Thanks [@MichalCiesliczka](https://github.com/MichalCiesliczka)! - Adds `IndicatorIconButton` component
205
274
 
206
275
  - [#596](https://github.com/utilitywarehouse/hearth/pull/596) [`61f1073`](https://github.com/utilitywarehouse/hearth/commit/61f10735a42445b6e4eb90282a2b340317f1ec08) Thanks [@jordmccord](https://github.com/jordmccord)! - [BREAKING] `SectionHeader` updates:
207
-
208
276
  - Removed `Link` props: `linkText`, `linkOnPress`, `linkAccessibilityLabel`.
209
277
  - Added `trailingContent` prop to allow custom trailing content (e.g. Link, Button).
210
278
  - Added `badge` prop to display a `Badge` next to the heading.
@@ -256,7 +324,6 @@
256
324
  - [#472](https://github.com/utilitywarehouse/hearth/pull/472) [`009fe4b`](https://github.com/utilitywarehouse/hearth/commit/009fe4bff4fc54e424f22629040f715d3d4714ea) Thanks [@jordmccord](https://github.com/jordmccord)! - Add `image` prop to `Checkbox` and `Radio` components
257
325
 
258
326
  - [#500](https://github.com/utilitywarehouse/hearth/pull/500) [`cc49e74`](https://github.com/utilitywarehouse/hearth/commit/cc49e74e3736b9647e8c5576ce45020add258625) Thanks [@jordmccord](https://github.com/jordmccord)! - - Updated dependencies [[`8dac8c1`](https://github.com/utilitywarehouse/hearth/commit/8dac8c1def9083d8e4efa1385e0ee7be23428c46)]:
259
-
260
327
  - @utilitywarehouse/hearth-react-native-icons@0.4.0
261
328
 
262
329
  - [#499](https://github.com/utilitywarehouse/hearth/pull/499) [`7b6781c`](https://github.com/utilitywarehouse/hearth/commit/7b6781cc054cf9f1ed4969a2c663abceb526c249) Thanks [@jordmccord](https://github.com/jordmccord)! - Fixes dark mode styles for several components
@@ -3,13 +3,11 @@ import { UserMediumIcon, UserSmallIcon } from '@utilitywarehouse/hearth-react-na
3
3
  import { useEffect, useState } from 'react';
4
4
  import { Image, View } from 'react-native';
5
5
  import { StyleSheet } from 'react-native-unistyles';
6
- import { useTheme } from '../../hooks';
7
6
  import { getInitials } from '../../utils';
8
7
  import BodyText from '../BodyText/BodyText';
9
8
  const Avatar = ({ src, name, size = 'md', delayMs = 0, onLoadingStatusChange, style, ...props }) => {
10
9
  const [status, setStatus] = useState('idle');
11
10
  const [isDelayed, setIsDelayed] = useState(delayMs > 0);
12
- const { components } = useTheme();
13
11
  useEffect(() => {
14
12
  if (!src) {
15
13
  setStatus('idle');
@@ -1,6 +1,6 @@
1
1
  import type BannerProps from './Banner.props';
2
2
  declare const Banner: {
3
- ({ icon, iconContainerVariant, iconContainerSize, iconContainerColor, illustration, image, heading, description, direction, link, button, onPress, onClose, variant, colorScheme, style, ...props }: BannerProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ icon, iconContainerVariant, iconContainerSize, iconContainerColor, illustration, image, heading, description, direction, link, button, onPress, onClose, variant, colorScheme: _, style, ...props }: BannerProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default Banner;
@@ -9,7 +9,9 @@ import { Heading } from '../Heading';
9
9
  import { IconContainer } from '../IconContainer';
10
10
  import { UnstyledIconButton } from '../UnstyledIconButton';
11
11
  import BannerContext from './Banner.context';
12
- const Banner = ({ icon, iconContainerVariant = 'subtle', iconContainerSize = 'md', iconContainerColor = 'pig', illustration, image, heading, description, direction = 'horizontal', link, button, onPress, onClose, variant = 'subtle', colorScheme = 'pig', style, ...props }) => {
12
+ const Banner = ({ icon, iconContainerVariant = 'subtle', iconContainerSize = 'md', iconContainerColor = 'pig', illustration, image, heading, description, direction = 'horizontal', link, button, onPress, onClose, variant = 'subtle',
13
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+ colorScheme: _, style, ...props }) => {
13
15
  const hasIllustration = Boolean(illustration);
14
16
  styles.useVariants({ direction, hasIllustration });
15
17
  const context = useMemo(() => ({
@@ -7,7 +7,7 @@ import { CarouselControls } from './CarouselControls';
7
7
  import { CarouselItem } from './CarouselItem';
8
8
  const Carousel = ({ centered = false, children, disabled = false, inactiveItemOpacity = 1, itemWidth, onSnapToItem, showOverflow = false, style, width, itemsStyle, activeIndex: initialActiveIndex = 0, showControls = true, showNavigation = false, controlsStyle, controlsItemStyle, controlsActiveItemStyle, controlsAccessibilityHidden = true, inverted = false, ref, ...props }) => {
9
9
  const [activeIndex, setActiveIndex] = useState(initialActiveIndex);
10
- const [numItems, setNumItems] = useState(0);
10
+ const [, setNumItems] = useState(0);
11
11
  const scrollViewRef = useRef(null);
12
12
  const flatListRef = useRef(null);
13
13
  const isWeb = Platform.OS === 'web';
@@ -1,6 +1,6 @@
1
1
  import CheckboxGroupProps from './CheckboxGroup.props';
2
2
  declare const CheckboxGroup: {
3
- ({ children, disabled, readonly, validationStatus, label, helperText, invalidText, validText, showValidationIcon, helperIcon, type, direction, gap, ...props }: CheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ children, disabled, readonly, validationStatus, label, labelVariant, helperText, invalidText, validText, showValidationIcon, helperIcon, type, direction, gap, ...props }: CheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default CheckboxGroup;
@@ -7,7 +7,7 @@ import { Label } from '../Label';
7
7
  import { CheckboxGroup as CheckboxGroupComponent } from './Checkbox';
8
8
  import { CheckboxGroupContext } from './CheckboxGroup.context';
9
9
  import CheckboxGroupTextContent from './CheckboxGroupTextContent';
10
- const CheckboxGroup = ({ children, disabled, readonly, validationStatus, label, helperText, invalidText, validText, showValidationIcon = true, helperIcon, type, direction = 'column', gap, ...props }) => {
10
+ const CheckboxGroup = ({ children, disabled, readonly, validationStatus, label, labelVariant = 'body', helperText, invalidText, validText, showValidationIcon = true, helperIcon, type, direction = 'column', gap, ...props }) => {
11
11
  const value = useMemo(() => ({ disabled, validationStatus, type, direction }), [disabled, validationStatus, type, direction]);
12
12
  const showHeader = !!label || !!helperText || !!invalidText || !!validText;
13
13
  const childrenArray = React.Children.toArray(children);
@@ -16,7 +16,7 @@ const CheckboxGroup = ({ children, disabled, readonly, validationStatus, label,
16
16
  // @ts-expect-error - child.type is not typed
17
17
  (child.props.type === 'tile' || child.type.displayName === 'CheckboxTile'));
18
18
  styles.useVariants({ type: childIsCard ? 'tile' : 'checkbox', direction });
19
- return (_jsx(CheckboxGroupContext.Provider, { value: value, children: _jsxs(CheckboxGroupComponent, { ...props, value: props.value, isDisabled: disabled, isReadOnly: readonly, isCard: childIsCard, children: [showHeader && (_jsxs(CheckboxGroupTextContent, { children: [!!label && _jsx(Label, { disabled: disabled, children: label }), !!helperText && _jsx(Helper, { disabled: disabled, icon: helperIcon, text: helperText }), validationStatus === 'invalid' && !!invalidText && (_jsx(Helper, { showIcon: showValidationIcon, disabled: disabled, validationStatus: "invalid", text: invalidText })), validationStatus === 'valid' && !!validText && (_jsx(Helper, { disabled: disabled, showIcon: showValidationIcon, validationStatus: "valid", text: validText }))] })), _jsx(View, { style: [styles.container, styles.containerGap(gap)], children: children })] }) }));
19
+ return (_jsx(CheckboxGroupContext.Provider, { value: value, children: _jsxs(CheckboxGroupComponent, { ...props, value: props.value, isDisabled: disabled, isReadOnly: readonly, isCard: childIsCard, children: [showHeader && (_jsxs(CheckboxGroupTextContent, { children: [!!label && (_jsx(Label, { disabled: disabled, variant: labelVariant, children: label })), !!helperText && _jsx(Helper, { disabled: disabled, icon: helperIcon, text: helperText }), validationStatus === 'invalid' && !!invalidText && (_jsx(Helper, { showIcon: showValidationIcon, disabled: disabled, validationStatus: "invalid", text: invalidText })), validationStatus === 'valid' && !!validText && (_jsx(Helper, { disabled: disabled, showIcon: showValidationIcon, validationStatus: "valid", text: validText }))] })), _jsx(View, { style: [styles.container, styles.containerGap(gap)], children: children })] }) }));
20
20
  };
21
21
  const styles = StyleSheet.create(theme => ({
22
22
  container: {
@@ -1,6 +1,6 @@
1
1
  import { ComponentType } from 'react';
2
- import { space } from '../../tokens';
3
2
  import { ViewProps } from 'react-native';
3
+ import { space } from '../../tokens';
4
4
  interface CheckboxGroupProps extends ViewProps {
5
5
  disabled?: boolean;
6
6
  value?: Array<string>;
@@ -8,6 +8,7 @@ interface CheckboxGroupProps extends ViewProps {
8
8
  readonly?: boolean;
9
9
  validationStatus?: 'valid' | 'invalid' | 'initial';
10
10
  label?: string;
11
+ labelVariant?: 'heading' | 'body';
11
12
  helperText?: string;
12
13
  showValidationIcon?: boolean;
13
14
  invalidText?: string;
@@ -1,6 +1,6 @@
1
1
  import type CurrencyInputProps from './CurrencyInput.props';
2
2
  declare const CurrencyInput: {
3
- ({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, required, disableGroupSeparator, value, onChangeText, ref, ...rest }: CurrencyInputProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, required, disableGroupSeparator, value, onChangeText, label, labelVariant, helperText, helperIcon, validText, invalidText, ref, ...rest }: CurrencyInputProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default CurrencyInput;
@@ -3,12 +3,8 @@ import { Platform } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
4
  import { formatThousands } from '../../utils';
5
5
  import { DetailText } from '../DetailText';
6
- import { useFormFieldContext } from '../FormField';
7
6
  import { Input, InputField, InputSlot } from '../Input';
8
- const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder, inBottomSheet = false, required, disableGroupSeparator = false, value, onChangeText, ref, ...rest }) => {
9
- const formFieldContext = useFormFieldContext();
10
- const { disabled: formFieldDisabled } = formFieldContext;
11
- const validationStatusFromContext = formFieldContext?.validationStatus ?? validationStatus;
7
+ const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder, inBottomSheet = false, required = true, disableGroupSeparator = false, value, onChangeText, label, labelVariant = 'body', helperText, helperIcon, validText, invalidText, ref, ...rest }) => {
12
8
  const defaultFormat = '0.00';
13
9
  const getPlaceholder = placeholder ?? defaultFormat;
14
10
  const handleChangeText = (text) => {
@@ -21,7 +17,7 @@ const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readon
21
17
  }
22
18
  };
23
19
  const displayValue = !disableGroupSeparator && typeof value === 'string' ? formatThousands(value) : value;
24
- return (_jsxs(Input, { validationStatus: validationStatusFromContext, disabled: formFieldDisabled ?? disabled, readonly: readonly, focused: focused, style: styles.wrap, children: [_jsx(InputSlot, { children: _jsx(DetailText, { size: "4xl", style: styles.text, accessible: false, children: "\u00A3" }) }), _jsx(InputField, { ref: ref, inputMode: "decimal", inBottomSheet: inBottomSheet, accessibilityHint: 'Enter the amount in pounds and pence, for example "10.99"', ...rest, placeholder: getPlaceholder, keyboardType: "decimal-pad", style: styles.input, value: displayValue, onChangeText: handleChangeText })] }));
20
+ return (_jsxs(Input, { validationStatus: validationStatus, disabled: disabled, readonly: readonly, focused: focused, required: required, style: styles.wrap, label: label, labelVariant: labelVariant, helperText: helperText, helperIcon: helperIcon, validText: validText, invalidText: invalidText, children: [_jsx(InputSlot, { children: _jsx(DetailText, { size: "4xl", style: styles.text, accessible: false, children: "\u00A3" }) }), _jsx(InputField, { ref: ref, inputMode: "decimal", inBottomSheet: inBottomSheet, accessibilityHint: 'Enter the amount in pounds and pence, for example "10.99"', ...rest, placeholder: getPlaceholder, keyboardType: "decimal-pad", style: styles.input, value: displayValue, onChangeText: handleChangeText })] }));
25
21
  };
26
22
  CurrencyInput.displayName = 'CurrencyInput';
27
23
  const styles = StyleSheet.create(theme => ({
@@ -11,6 +11,12 @@ export interface CurrencyInputBaseProps {
11
11
  required?: boolean;
12
12
  /** When not specifically disabled, the numeric value is automatically formatted with thousand separators (e.g. 1234 -> 1,234). */
13
13
  disableGroupSeparator?: boolean;
14
+ label?: string;
15
+ labelVariant?: 'heading' | 'body';
16
+ helperText?: string;
17
+ helperIcon?: React.ComponentType;
18
+ validText?: string;
19
+ invalidText?: string;
14
20
  }
15
21
  export type CurrencyInputProps = CurrencyInputBaseProps & Omit<TextInputProps, 'children'> & ViewProps;
16
22
  export default CurrencyInputProps;
@@ -14,6 +14,7 @@ const styles = StyleSheet.create(theme => ({
14
14
  container: {
15
15
  flexDirection: 'row',
16
16
  gap: theme.components.input.date.gap,
17
+ // alignItems: 'stretch',
17
18
  },
18
19
  }));
19
20
  export default DateInput;
@@ -12,7 +12,7 @@ const styles = StyleSheet.create(theme => ({
12
12
  container: {
13
13
  flex: 1,
14
14
  gap: theme.components.input.gap,
15
- maxWidth: 96,
15
+ // maxWidth: 96,
16
16
  },
17
17
  label: {
18
18
  variants: {
@@ -24,8 +24,7 @@ const styles = StyleSheet.create(theme => ({
24
24
  },
25
25
  },
26
26
  input: {
27
- flex: 1,
28
- maxWidth: 96,
27
+ // maxWidth: 96,
29
28
  },
30
29
  }));
31
30
  export default DateInputSegment;
@@ -21,6 +21,7 @@ dayjs.extend(utc);
21
21
  dayjs.extend(timezone);
22
22
  dayjs.extend(duration);
23
23
  const DateTimePicker = (props) => {
24
+ // eslint-disable-next-line @typescript-eslint/prefer-as-const
24
25
  const numerals = 'latn';
25
26
  const { mode = 'single', timeZone, showOutsideDays = true, timePicker = false, firstDayOfWeek = 1,
26
27
  // startYear,
@@ -119,26 +120,29 @@ const DateTimePicker = (props) => {
119
120
  ...prevState,
120
121
  currentYear: action.payload,
121
122
  };
122
- case CalendarActionKind.CHANGE_SELECTED_DATE:
123
+ case CalendarActionKind.CHANGE_SELECTED_DATE: {
123
124
  const { date: selectedDate } = action.payload;
124
125
  return {
125
126
  ...prevState,
126
127
  date: selectedDate,
127
128
  currentDate: selectedDate,
128
129
  };
129
- case CalendarActionKind.CHANGE_SELECTED_RANGE:
130
+ }
131
+ case CalendarActionKind.CHANGE_SELECTED_RANGE: {
130
132
  const { startDate: start, endDate: end } = action.payload;
131
133
  return {
132
134
  ...prevState,
133
135
  startDate: start,
134
136
  endDate: end,
135
137
  };
136
- case CalendarActionKind.CHANGE_SELECTED_MULTIPLE:
138
+ }
139
+ case CalendarActionKind.CHANGE_SELECTED_MULTIPLE: {
137
140
  const { dates: selectedDates } = action.payload;
138
141
  return {
139
142
  ...prevState,
140
143
  dates: selectedDates,
141
144
  };
145
+ }
142
146
  case CalendarActionKind.RESET_STATE:
143
147
  return action.payload;
144
148
  default:
@@ -245,7 +249,7 @@ const DateTimePicker = (props) => {
245
249
  }
246
250
  else if (mode === 'range') {
247
251
  // set time to 00:00:00
248
- let start = removeTime(stateRef.current.startDate, timeZone);
252
+ const start = removeTime(stateRef.current.startDate, timeZone);
249
253
  let end = removeTime(stateRef.current.endDate, timeZone);
250
254
  const selected = removeTime(selectedDate, timeZone);
251
255
  let isStart = true;
@@ -5,4 +5,3 @@ export type HeaderProps = {
5
5
  NextIcon?: React.ReactNode;
6
6
  navigationPosition?: NavigationPosition;
7
7
  };
8
- export type NavigationProps = {};
@@ -5,7 +5,7 @@ import { StyleSheet } from 'react-native-unistyles';
5
5
  import NextButton from './DatePickerNextButton';
6
6
  import PrevButton from './DatePickerPrevButton';
7
7
  import Selectors from './DatePickerSelectors';
8
- const NavigationButtons = ({}) => (_jsxs(View, { style: styles.navigation, children: [_jsx(PrevButton, {}), _jsx(NextButton, {})] }));
8
+ const NavigationButtons = () => (_jsxs(View, { style: styles.navigation, children: [_jsx(PrevButton, {}), _jsx(NextButton, {})] }));
9
9
  const Header = ({ navigationPosition = 'around' }) => (_jsx(View, { style: [styles.headerContainer], children: _jsx(View, { style: styles.container, children: navigationPosition === 'left' ? (_jsxs(_Fragment, { children: [_jsx(NavigationButtons, {}), _jsx(Selectors, { position: "left" })] })) : navigationPosition === 'right' ? (_jsxs(_Fragment, { children: [_jsx(Selectors, { position: "right" }), _jsx(NavigationButtons, {})] })) : (_jsxs(_Fragment, { children: [_jsx(PrevButton, {}), _jsx(Selectors, { position: "around" }), _jsx(NextButton, {})] })) }) }));
10
10
  const styles = StyleSheet.create(theme => ({
11
11
  headerContainer: {
@@ -1,4 +1,5 @@
1
1
  import 'dayjs/locale/en';
2
2
  import './polyfill';
3
+ export type { BottomSheetMethods as DatePickerMethods } from '@gorhom/bottom-sheet/lib/typescript/types';
3
4
  export type { CalendarDay, CalendarMode, CalendarMonth, CalendarWeek, CalendarYear, DateType, } from './DatePicker.props';
4
5
  export { default as DatePicker } from './DatePicker';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- // @ts-ignore
2
+ // @ts-expect-error - Polyfill for Date.toLocaleString to support timeZone option in React Native environment.
3
3
  Date.prototype._toLocaleString = Date.prototype.toLocaleString;
4
- // @ts-ignore
4
+ // @ts-expect-error - Polyfill for Date.toLocaleString to support timeZone option in React Native environment.
5
5
  Date.prototype.toLocaleString = function (a, b) {
6
6
  if (b && Object.keys(b).length === 1 && 'timeZone' in b && a === 'en-US') {
7
7
  return Intl.DateTimeFormat('en-us', {
@@ -17,6 +17,6 @@ Date.prototype.toLocaleString = function (a, b) {
17
17
  .format(this)
18
18
  .replace(/(\d{2})\/(\d{2})\/(\d{4}),/g, '$3-$1-$2');
19
19
  }
20
- // @ts-ignore
20
+ // @ts-expect-error - Polyfill for Date.toLocaleString to support timeZone option in React Native environment.
21
21
  return this._toLocaleString(a, b);
22
22
  };
@@ -98,9 +98,7 @@ const WheelWeb = ({ value, setValue = () => { }, items }) => {
98
98
  },
99
99
  ] }), displayValues?.map((displayValue, index) => {
100
100
  const animatedAngle = animatedAngles[index];
101
- return (_jsx(Animated.View, {
102
- // eslint-disable-next-line react-native/no-inline-styles
103
- style: {
101
+ return (_jsx(Animated.View, { style: {
104
102
  position: 'absolute',
105
103
  height: ITEM_HEIGHT - 10,
106
104
  transform: animatedAngle
@@ -1,6 +1,6 @@
1
1
  import type DatePickerInputProps from './DatePickerInput.props';
2
2
  declare const DatePickerInput: {
3
- ({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, format, openButtonLabel, autoCloseOnSelect, onChange, onChangeText, onBlur, onFocus, value, datePickerProps, onClear, ...rest }: DatePickerInputProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, format, openButtonLabel, autoCloseOnSelect, label, labelVariant, helperText, helperIcon, validText, invalidText, required, onChange, onChangeText, onBlur, onFocus, value, datePickerProps, onClear, ...rest }: DatePickerInputProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default DatePickerInput;
@@ -19,9 +19,8 @@ const maskDefaultFormat = (value) => {
19
19
  const year = digitsOnly.slice(4, 8);
20
20
  return [day, month, year].filter(Boolean).join('/');
21
21
  };
22
- const DatePickerInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder, inBottomSheet = false, format = DEFAULT_FORMAT, openButtonLabel = 'Open date picker', autoCloseOnSelect = true, onChange, onChangeText, onBlur, onFocus, value, datePickerProps, onClear, ...rest }) => {
22
+ const DatePickerInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder, inBottomSheet = false, format = DEFAULT_FORMAT, openButtonLabel = 'Open date picker', autoCloseOnSelect = true, label, labelVariant, helperText, helperIcon, validText, invalidText, required = true, onChange, onChangeText, onBlur, onFocus, value, datePickerProps, onClear, ...rest }) => {
23
23
  const formFieldContext = useFormFieldContext();
24
- const validationStatusFromContext = formFieldContext?.validationStatus ?? validationStatus;
25
24
  const isDisabled = formFieldContext?.disabled ?? disabled;
26
25
  const isReadonly = formFieldContext?.readonly ?? readonly;
27
26
  const pickerRef = useRef(null);
@@ -97,7 +96,7 @@ const DatePickerInput = ({ validationStatus = 'initial', disabled, focused, read
97
96
  onFocus?.(event);
98
97
  }, [onFocus]);
99
98
  const { onCancel: pickerOnCancel, ...restDatePickerProps } = datePickerProps ?? {};
100
- const { style: inputStyle, keyboardType: keyboardTypeProp, inputMode: inputModeProp, accessibilityHint: accessibilityHintProp, accessibilityLabel: accessibilityLabelProp, accessible: accessibleProp, accessibilityRole: accessibilityRoleProp, importantForAccessibility: importantForAccessibilityProp, ...textInputProps } = rest;
99
+ const { style: inputStyle, keyboardType: keyboardTypeProp, inputMode: inputModeProp, accessibilityHint: accessibilityHintProp, accessibilityLabel: accessibilityLabelProp, accessible: accessibleProp, importantForAccessibility: importantForAccessibilityProp, ...textInputProps } = rest;
101
100
  const resolvedKeyboardType = keyboardTypeProp ?? (isDefaultFormat ? 'number-pad' : undefined);
102
101
  const resolvedInputMode = inputModeProp ?? (isDefaultFormat ? 'numeric' : undefined);
103
102
  const resolvedAccessibilityHint = accessibilityHintProp ?? `Enter the date in ${format} format`;
@@ -109,7 +108,7 @@ const DatePickerInput = ({ validationStatus = 'initial', disabled, focused, read
109
108
  pickerRef.current?.close?.();
110
109
  }, [pickerOnCancel]);
111
110
  const placeholderValue = placeholder ?? format;
112
- return (_jsxs(_Fragment, { children: [_jsxs(Input, { validationStatus: validationStatusFromContext, disabled: isDisabled, readonly: isReadonly, focused: focused, style: styles.wrap, accessible: false, children: [_jsx(InputField, { editable: !isReadonly && !isDisabled, value: inputValue, placeholder: placeholderValue, onChangeText: handleTextChange, onBlur: handleBlur, onFocus: handleFocus, inBottomSheet: inBottomSheet, keyboardType: resolvedKeyboardType, inputMode: resolvedInputMode, accessibilityHint: resolvedAccessibilityHint, "aria-label": "Date input", accessibilityLabel: resolvedAccessibilityLabel, accessible: resolvedAccessible, accessibilityState: {
111
+ return (_jsxs(_Fragment, { children: [_jsxs(Input, { validationStatus: validationStatus, disabled: disabled, readonly: readonly, focused: focused, label: label, labelVariant: labelVariant, helperText: helperText, helperIcon: helperIcon, validText: validText, invalidText: invalidText, required: required, style: styles.wrap, accessible: false, children: [_jsx(InputField, { editable: !isReadonly && !isDisabled, value: inputValue, placeholder: placeholderValue, onChangeText: handleTextChange, onBlur: handleBlur, onFocus: handleFocus, inBottomSheet: inBottomSheet, keyboardType: resolvedKeyboardType, inputMode: resolvedInputMode, accessibilityHint: resolvedAccessibilityHint, "aria-label": "Date input", accessibilityLabel: resolvedAccessibilityLabel, accessible: resolvedAccessible, accessibilityState: {
113
112
  disabled: isDisabled || isReadonly,
114
113
  }, importantForAccessibility: resolvedImportantForAccessibility, inputAccessoryViewID: Platform.OS === 'ios' ? accessoryViewID : undefined, ...textInputProps, style: [styles.input, inputStyle] }), !!inputValue && onClear && !isReadonly && !isDisabled && (_jsx(InputSlot, { accessibilityElementsHidden: false, children: _jsx(UnstyledIconButton, { accessibilityLabel: "Clear date", accessibilityHint: "Removes the current date", icon: CloseSmallIcon, onPress: handleClear }) })), _jsx(InputSlot, { accessibilityElementsHidden: false, children: _jsx(UnstyledIconButton, { accessibilityLabel: openButtonLabel, accessibilityHint: "Opens the date picker calendar", icon: CalendarSmallIcon, onPress: openPicker, disabled: isDisabled || isReadonly }) })] }), _jsx(DatePicker, { ref: pickerRef, mode: "single", date: selectedDate, onChange: handlePickerChange, onCancel: handleCancel, ...restDatePickerProps }), Platform.OS === 'ios' && accessoryViewID && (_jsx(DatePickerInputDoneButton, { accessoryViewID: accessoryViewID, closeKeyboard: closeKeyboard }))] }));
115
114
  };
@@ -6,6 +6,12 @@ export interface DatePickerInputBaseProps {
6
6
  validationStatus?: 'initial' | 'valid' | 'invalid';
7
7
  readonly?: boolean;
8
8
  focused?: boolean;
9
+ label?: string;
10
+ labelVariant?: 'heading' | 'body';
11
+ helperText?: string;
12
+ helperIcon?: React.ComponentType;
13
+ validText?: string;
14
+ invalidText?: string;
9
15
  placeholder?: string;
10
16
  inBottomSheet?: boolean;
11
17
  required?: boolean;
@@ -1,6 +1,6 @@
1
1
  import type DescriptionListProps from './DescriptionList.props';
2
2
  declare const DescriptionList: {
3
- ({ direction, itemHeadingWidth, heading, helperText, headerTrailingContent, children, style, ...props }: DescriptionListProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ direction, itemHeadingWidth, heading, helperText, headerTrailingContent, children, style, invalidText, ...props }: DescriptionListProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default DescriptionList;
@@ -4,10 +4,10 @@ import { View } from 'react-native';
4
4
  import { StyleSheet } from 'react-native-unistyles';
5
5
  import { SectionHeader } from '../SectionHeader';
6
6
  import { DescriptionListContext } from './DescriptionList.context';
7
- const DescriptionList = ({ direction = 'column', itemHeadingWidth, heading, helperText, headerTrailingContent, children, style, ...props }) => {
7
+ const DescriptionList = ({ direction = 'column', itemHeadingWidth, heading, helperText, headerTrailingContent, children, style, invalidText, ...props }) => {
8
8
  styles.useVariants({ direction });
9
9
  const value = useMemo(() => ({ direction, itemHeadingWidth }), [direction, itemHeadingWidth]);
10
- return (_jsx(DescriptionListContext.Provider, { value: value, children: _jsxs(View, { accessibilityRole: "list", ...props, style: [styles.container, style], children: [heading ? (_jsx(SectionHeader, { heading: heading, helperText: helperText, trailingContent: headerTrailingContent })) : null, children] }) }));
10
+ return (_jsx(DescriptionListContext.Provider, { value: value, children: _jsxs(View, { accessibilityRole: "list", ...props, style: [styles.container, style], children: [heading ? (_jsx(SectionHeader, { heading: heading, helperText: helperText, trailingContent: headerTrailingContent, invalidText: invalidText })) : null, children] }) }));
11
11
  };
12
12
  DescriptionList.displayName = 'DescriptionList';
13
13
  const styles = StyleSheet.create(theme => ({
@@ -7,5 +7,6 @@ export interface DescriptionListProps extends ViewProps {
7
7
  heading?: string;
8
8
  helperText?: string;
9
9
  headerTrailingContent?: React.ReactNode;
10
+ invalidText?: string;
10
11
  }
11
12
  export default DescriptionListProps;
@@ -1,6 +1,6 @@
1
1
  import type DescriptionListItemProps from './DescriptionListItem.props';
2
2
  declare const DescriptionListItem: {
3
- ({ heading, description, headingWidth, trailingContent, invalidText, style, ...props }: DescriptionListItemProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ heading, description, headingWidth, trailingContent, invalidText, numericValue, style, ...props }: DescriptionListItemProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default DescriptionListItem;
@@ -4,9 +4,10 @@ import { View } from 'react-native';
4
4
  import { StyleSheet } from 'react-native-unistyles';
5
5
  import { useTheme } from '../../hooks';
6
6
  import { BodyText } from '../BodyText';
7
+ import { DetailText } from '../DetailText';
7
8
  import Helper from '../Helper/Helper';
8
9
  import { useDescriptionListContext } from './DescriptionList.context';
9
- const DescriptionListItem = ({ heading, description, headingWidth, trailingContent, invalidText, style, ...props }) => {
10
+ const DescriptionListItem = ({ heading, description, headingWidth, trailingContent, invalidText, numericValue, style, ...props }) => {
10
11
  const { components } = useTheme();
11
12
  const { direction, itemHeadingWidth = components.descriptionList.item.row.headingWidth } = useDescriptionListContext();
12
13
  styles.useVariants({ direction });
@@ -14,7 +15,7 @@ const DescriptionListItem = ({ heading, description, headingWidth, trailingConte
14
15
  const descIsText = typeof description === 'string' || typeof description === 'number';
15
16
  const combinedLabel = headingIsText && descIsText ? `${heading}: ${description}` : undefined;
16
17
  const hideDescendants = !!combinedLabel;
17
- return (_jsxs(View, { accessibilityRole: "text", accessible: !!combinedLabel, accessibilityLabel: combinedLabel, ...props, style: [styles.item, style], children: [_jsxs(View, { style: styles.textWrap, importantForAccessibility: hideDescendants ? 'no-hide-descendants' : undefined, accessibilityElementsHidden: hideDescendants || undefined, children: [_jsx(View, { style: [direction === 'row' && { width: headingWidth || itemHeadingWidth }], children: headingIsText ? _jsx(BodyText, { style: styles.headingText, children: heading }) : heading }), _jsxs(View, { style: styles.descriptionWrapper, children: [descIsText ? _jsx(BodyText, { children: description }) : description, !!invalidText && (_jsx(Helper, { validationStatus: "invalid", showIcon: true, icon: ErrorCircleSmallIcon, text: invalidText || '' }))] })] }), trailingContent ? trailingContent : null] }));
18
+ return (_jsxs(View, { accessibilityRole: "text", accessible: !!combinedLabel, accessibilityLabel: combinedLabel, ...props, style: [styles.item, style], children: [_jsxs(View, { style: styles.textWrap, importantForAccessibility: hideDescendants ? 'no-hide-descendants' : undefined, accessibilityElementsHidden: hideDescendants || undefined, children: [_jsx(View, { style: [direction === 'row' && { width: headingWidth || itemHeadingWidth }], children: headingIsText ? _jsx(BodyText, { style: styles.headingText, children: heading }) : heading }), _jsxs(View, { style: styles.descriptionWrapper, children: [descIsText ? _jsx(BodyText, { children: description }) : description, !!invalidText && (_jsx(Helper, { validationStatus: "invalid", showIcon: true, icon: ErrorCircleSmallIcon, text: invalidText || '' }))] }), numericValue ? (_jsx(View, { style: styles.descriptionWrapper, children: _jsx(DetailText, { size: "lg", children: numericValue }) })) : null] }), trailingContent ? trailingContent : null] }));
18
19
  };
19
20
  DescriptionListItem.displayName = 'DescriptionListItem';
20
21
  const styles = StyleSheet.create(theme => ({