@utilitywarehouse/hearth-react 0.28.7 → 0.29.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 (104) hide show
  1. package/README.md +34 -20
  2. package/SKILL.md +355 -0
  3. package/dist/{chunk-TLCA3FQZ.js → chunk-ABES5BZY.js} +2 -2
  4. package/dist/{chunk-OHPQ5IRM.cjs → chunk-Y2CHQFKQ.cjs} +2 -2
  5. package/dist/{chunk-OHPQ5IRM.cjs.map → chunk-Y2CHQFKQ.cjs.map} +1 -1
  6. package/dist/components/CardAccordion/CardAccordion.context.d.ts.map +1 -1
  7. package/dist/components/ExpandableCard/ExpandableCard.cjs +1 -1
  8. package/dist/components/ExpandableCard/ExpandableCard.js +1 -1
  9. package/dist/components/ProgressBar/ProgressBar.cjs +1 -1
  10. package/dist/components/ProgressBar/ProgressBar.js +1 -1
  11. package/dist/helpers/get-classname-styles.d.ts.map +1 -1
  12. package/dist/helpers/logger.d.ts.map +1 -1
  13. package/dist/helpers/merge-ids.d.ts.map +1 -1
  14. package/dist/hooks/use-ids.d.ts.map +1 -1
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.js +1 -1
  18. package/package.json +14 -10
  19. package/public/llms/components/accordion.md +321 -0
  20. package/public/llms/components/alert.md +217 -0
  21. package/public/llms/components/avatar.md +112 -0
  22. package/public/llms/components/badge.md +158 -0
  23. package/public/llms/components/body-text.md +200 -0
  24. package/public/llms/components/box.md +148 -0
  25. package/public/llms/components/breadcrumbs.md +97 -0
  26. package/public/llms/components/button.md +595 -0
  27. package/public/llms/components/card-accordion.md +277 -0
  28. package/public/llms/components/card.md +985 -0
  29. package/public/llms/components/checkbox-group.md +193 -0
  30. package/public/llms/components/checkbox-tile.md +116 -0
  31. package/public/llms/components/checkbox.md +108 -0
  32. package/public/llms/components/combobox.md +360 -0
  33. package/public/llms/components/container.md +162 -0
  34. package/public/llms/components/currency-input.md +85 -0
  35. package/public/llms/components/date-input.md +90 -0
  36. package/public/llms/components/date-picker.md +159 -0
  37. package/public/llms/components/description-list.md +149 -0
  38. package/public/llms/components/detail-text.md +89 -0
  39. package/public/llms/components/divider.md +88 -0
  40. package/public/llms/components/em.md +43 -0
  41. package/public/llms/components/expandable-card.md +231 -0
  42. package/public/llms/components/flex.md +197 -0
  43. package/public/llms/components/grid.md +244 -0
  44. package/public/llms/components/heading.md +65 -0
  45. package/public/llms/components/helper-text.md +27 -0
  46. package/public/llms/components/highlight-banner.md +94 -0
  47. package/public/llms/components/icon-button.md +516 -0
  48. package/public/llms/components/icon-container.md +247 -0
  49. package/public/llms/components/inline-link.md +190 -0
  50. package/public/llms/components/label.md +28 -0
  51. package/public/llms/components/link.md +236 -0
  52. package/public/llms/components/list.md +715 -0
  53. package/public/llms/components/menu.md +270 -0
  54. package/public/llms/components/modal.md +328 -0
  55. package/public/llms/components/pagination.md +138 -0
  56. package/public/llms/components/password-input.md +93 -0
  57. package/public/llms/components/progress-bar.md +139 -0
  58. package/public/llms/components/progress-stepper.md +147 -0
  59. package/public/llms/components/radio-group.md +487 -0
  60. package/public/llms/components/search-input.md +132 -0
  61. package/public/llms/components/section-header.md +82 -0
  62. package/public/llms/components/select.md +148 -0
  63. package/public/llms/components/skeleton.md +282 -0
  64. package/public/llms/components/spinner.md +59 -0
  65. package/public/llms/components/strong.md +49 -0
  66. package/public/llms/components/switch.md +106 -0
  67. package/public/llms/components/table.md +230 -0
  68. package/public/llms/components/tabs.md +320 -0
  69. package/public/llms/components/text-area.md +141 -0
  70. package/public/llms/components/text-input.md +228 -0
  71. package/public/llms/components/toast.md +323 -0
  72. package/public/llms/components/toggle-button-card.md +513 -0
  73. package/public/llms/components/tooltip.md +188 -0
  74. package/public/llms/components/unstyled-icon-button.md +175 -0
  75. package/public/llms/components/validation-text.md +29 -0
  76. package/public/llms/components/verification-input.md +96 -0
  77. package/public/llms/docs/changelog.md +1430 -0
  78. package/public/llms/docs/common-props/align-self.md +90 -0
  79. package/public/llms/docs/common-props/border.md +308 -0
  80. package/public/llms/docs/common-props/colour.md +221 -0
  81. package/public/llms/docs/common-props/flex-items.md +91 -0
  82. package/public/llms/docs/common-props/gap.md +111 -0
  83. package/public/llms/docs/common-props/grid-items.md +96 -0
  84. package/public/llms/docs/common-props/margin.md +105 -0
  85. package/public/llms/docs/common-props/opacity.md +100 -0
  86. package/public/llms/docs/common-props/order.md +90 -0
  87. package/public/llms/docs/common-props/overflow.md +89 -0
  88. package/public/llms/docs/common-props/padding.md +102 -0
  89. package/public/llms/docs/common-props/position.md +92 -0
  90. package/public/llms/docs/common-props/size.md +93 -0
  91. package/public/llms/docs/common-props/spacing.md +97 -0
  92. package/public/llms/docs/common-props/text.md +35 -0
  93. package/public/llms/docs/common-props/z-index.md +88 -0
  94. package/public/llms/docs/design-tokens.md +72 -0
  95. package/public/llms/docs/getting-started.md +117 -0
  96. package/public/llms/docs/layout.md +135 -0
  97. package/public/llms/docs/migrating.md +302 -0
  98. package/public/llms/docs/responsive-design/breakpoints.md +119 -0
  99. package/public/llms/docs/responsive-design/media-queries.md +89 -0
  100. package/public/llms/docs/responsive-design/responsive-props.md +37 -0
  101. package/public/llms.txt +97 -0
  102. package/scripts/init-ai.js +142 -0
  103. package/styles.css +1 -1
  104. /package/dist/{chunk-TLCA3FQZ.js.map → chunk-ABES5BZY.js.map} +0 -0
@@ -0,0 +1,277 @@
1
+ # CardAccordion
2
+
3
+ `CardAccordion` breaks a form journey into multiple collapsible cards, allowing
4
+ users to progress step-by-step on a single page while keeping previously
5
+ completed steps visible and editable. Each card represents one logical step in
6
+ the journey. As the user progresses, completed cards collapse into a summary
7
+ view while the next card expands.
8
+
9
+ - [Usage](#usage)
10
+ - [Current content](#current-content)
11
+ - [Summary content](#summary-content)
12
+ - [Validation](#validation)
13
+ - [Footer actions](#footer-actions)
14
+ - [Heading levels](#heading-levels)
15
+ - [Accessibility](#accessibility)
16
+ - [Keyboard interactions](#keyboard-interactions)
17
+ - [API](#api)
18
+
19
+ ```tsx
20
+ <Box width="600px">
21
+ <CardAccordion>
22
+ <CardAccordionItem
23
+ value="1a"
24
+ title="1a. Your new cover"
25
+ summaryTitle="1a. Your home"
26
+ summaryDescription={
27
+ <Flex direction="column" gap="50">
28
+ <HelperText>Your type of cover, address & policy start date.</HelperText>
29
+ <BodyText size="lg">31/08/2025</BodyText>
30
+ </Flex>
31
+ }
32
+ >
33
+ <CardAccordionFooter>
34
+ <CardAccordionButton action="next" />
35
+ </CardAccordionFooter>
36
+ </CardAccordionItem>
37
+ <CardAccordionItem
38
+ value="1b"
39
+ title="1b. About your property"
40
+ summaryDescription={
41
+ <HelperText>Details about your property type, ownership, and number of rooms.</HelperText>
42
+ }
43
+ >
44
+ <Box>Content</Box>
45
+ <CardAccordionFooter>
46
+ <CardAccordionButton action="next" />
47
+ <CardAccordionButton action="previous" />
48
+ </CardAccordionFooter>
49
+ </CardAccordionItem>
50
+ <CardAccordionItem
51
+ value="1c"
52
+ title="1c. How your home was built"
53
+ summaryDescription={<HelperText>Summary of your home’s age and construction.</HelperText>}
54
+ >
55
+ <Box>Content</Box>
56
+ <CardAccordionFooter>
57
+ <CardAccordionButton action="previous" />
58
+ <CardAccordionButton action="next" />
59
+ </CardAccordionFooter>
60
+ </CardAccordionItem>
61
+ <CardAccordionItem
62
+ value="1d"
63
+ title="1d. Use of your home"
64
+ summaryDescription={
65
+ <HelperText>Details about who lives in your home and how the property is used.</HelperText>
66
+ }
67
+ >
68
+ <Box>Content</Box>
69
+ <CardAccordionFooter>
70
+ <CardAccordionButton action="previous" />
71
+ <CardAccordionButton action="next" />
72
+ </CardAccordionFooter>
73
+ </CardAccordionItem>
74
+ </CardAccordion>
75
+ </Box>
76
+ ```
77
+
78
+ ## Usage
79
+
80
+ The steps in a `CardAccordion` are represented by `CardAccordionItem`
81
+ components, and consist of 3 possible states: `previous`, `current`, and
82
+ `future`.
83
+
84
+ - `previous` represents a completed step in the journey - The card is collapsed
85
+ and shows a summary of the user’s submitted information, helping users
86
+ quickly review what they have entered. An Edit button allows users to reopen
87
+ the step and update their answers if needed.
88
+ - `current` represents the active step the user is currently completing - The
89
+ card is expanded and contains the form inputs required for this stage of the
90
+ journey. A button group is provided to allow users to continue to the next
91
+ step or return to the previous step if needed.
92
+ - `future` represents upcoming steps that have not yet been reached - These
93
+ cards are visible to give users an overview of what remains in the journey,
94
+ but they are inactive and cannot be interacted with until earlier steps are
95
+ completed.
96
+
97
+ Each `CardAccordionItem` component requires a `value` to be able to automatically
98
+ determine the state of each item, as a user progresses through all the steps.
99
+
100
+ ```tsx
101
+ <CardAccordion>
102
+ <CardAccordionItem value="step-1" title="Step 1: Personal details">
103
+ ...
104
+ <CardAccordionFooter>
105
+ <CardAccordionButton action="next" />
106
+ </CardAccordionFooter>
107
+ </CardAccordionItem>
108
+ <CardAccordionItem value="step-2" title="Step 2: Address details">
109
+ ...
110
+ <CardAccordionFooter>
111
+ <CardAccordionButton action="previous" />
112
+ <CardAccordionButton action="next" />
113
+ </CardAccordionFooter>
114
+ </CardAccordionItem>
115
+ <CardAccordionItem value="step-3" title="Step 3: Payment details">
116
+ ...
117
+ <CardAccordionFooter>
118
+ <CardAccordionButton action="previous" />
119
+ </CardAccordionFooter>
120
+ </CardAccordionItem>
121
+ </CardAccordion>
122
+ ```
123
+
124
+ ## Current content
125
+
126
+ The main form content, visible when the item is in the `current` state, should
127
+ be rendered as a child of `CardAccordionItem`.
128
+
129
+ ## Summary content
130
+
131
+ When an item is in the `previous` state, you can render an alternative title
132
+ and additional content using the `summaryTitle` & `summaryDescription` props.
133
+
134
+ ```tsx
135
+ <CardAccordionItem
136
+ value="1a"
137
+ title="1a. Your new cover"
138
+ summaryTitle="1a. Your home"
139
+ summaryDescription={
140
+ <Flex direction="column" gap="50">
141
+ <HelperText>Your type of cover, address & policy start date.</HelperText>
142
+ <BodyText size="lg">31/08/2025</BodyText>
143
+ </Flex>
144
+ }
145
+ >
146
+ ```
147
+
148
+ ## Validation
149
+
150
+ It is up to you to ensure the current state has been validated before allowing
151
+ the user to progress to the next step.
152
+
153
+ ## Footer actions
154
+
155
+ You must include a `CardAccordionFooter` component within each
156
+ `CardAccordionItem` to render the action buttons for each step. The
157
+ `CardAccordionButton` component will be either a `next` or `previous` action, and
158
+ can render a custom label if necessary.
159
+
160
+ ```tsx
161
+ <CardAccordionFooter>
162
+ <CardAccordionButton action="previous">Back to 1a</CardAccordionButton>
163
+ <CardAccordionButton action="next" />
164
+ </CardAccordionFooter>
165
+ ```
166
+
167
+ ## Heading levels
168
+
169
+ By default the `CardAccordionItem` title renders an `h3` element. If this
170
+ doesn't follow the structure of your page, you can use the `headingElement`
171
+ prop to change these to an appropriate heading level.
172
+
173
+ ## Accessibility
174
+
175
+ Follows the [Accordion WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/accordion).
176
+
177
+ ### Keyboard interactions
178
+
179
+ <Flex direction="column" gap="200" className="sb-unstyled">
180
+ <Flex>
181
+ <Box width="300px">
182
+ <BodyText as="span" weight="bold">
183
+ Key
184
+ </BodyText>
185
+ </Box>
186
+ <BodyText as="span" weight="bold">
187
+ Description
188
+ </BodyText>
189
+ </Flex>
190
+ <Divider />
191
+ {[
192
+ {
193
+ key: 'Space',
194
+ description:
195
+ 'When focus is on a CardAccordionTrigger of a collapsed section, expands the section.',
196
+ },
197
+ {
198
+ key: 'Enter',
199
+ description:
200
+ 'When focus is on a CardAccordionTrigger of a collapsed section, expands the section.',
201
+ },
202
+ {
203
+ key: 'Tab',
204
+ description: 'Moves focus to the next focusable element.',
205
+ },
206
+ {
207
+ key: 'Shift+Tab',
208
+ description: 'Moves focus to the previous focusable element.',
209
+ },
210
+ {
211
+ key: 'ArrowDown',
212
+ description: 'Moves focus to the next CardAccordionTrigger.',
213
+ },
214
+ {
215
+ key: 'ArrowUp',
216
+ description: 'Moves focus to the previous CardAccordionTrigger.',
217
+ },
218
+ ].map((kbi, i) => (
219
+ <>
220
+ <Flex>
221
+ <Box width="300px">
222
+ <kbd>{kbi.key}</kbd>
223
+ </Box>
224
+ <BodyText as="span">{kbi.description}</BodyText>
225
+ </Flex>
226
+ {i < 4 ? <Divider /> : null}
227
+ </>
228
+ ))}
229
+ </Flex>
230
+
231
+ ## API
232
+
233
+ This component is based on the `div` element and supports the following common props:
234
+
235
+ - Margin
236
+
237
+ | Prop | Type | Default | Description |
238
+ | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----------- |
239
+ | `onValueChange` | `((value: string) => void)` | — | |
240
+ | `value` | `string` | — | |
241
+ | `margin` | `Responsive<"0" \| "auto" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
242
+ | `marginTop` | `Responsive<"0" \| "auto" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
243
+ | `marginRight` | `Responsive<"0" \| "auto" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
244
+ | `marginBottom` | `Responsive<"0" \| "auto" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
245
+ | `marginLeft` | `Responsive<"0" \| "auto" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
246
+ | `marginX` | `Responsive<"0" \| "auto" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
247
+ | `marginY` | `Responsive<"0" \| "auto" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
248
+
249
+ ### CardAccordionItem
250
+
251
+ | Prop | Type | Default | Description |
252
+ | -------------------- | -------------------------------------- | ------- | --------------------------------------------------------------------------------------- |
253
+ | `title` | `string` | — | |
254
+ | `value` | `string` | — | |
255
+ | `disabled` | `boolean` | — | Whether or not an accordion item is disabled from user interaction. @defaultValue false |
256
+ | `description` | `string` | — | |
257
+ | `summaryTitle` | `string` | — | |
258
+ | `summaryDescription` | `ReactNode` | — | |
259
+ | `headingElement` | `"h1" \| "h2" \| "h3" \| "h4"` | `h3` | |
260
+ | `onEditClick` | `MouseEventHandler<HTMLButtonElement>` | — | |
261
+
262
+ ### CardAccordionButton
263
+
264
+ | Prop | Type | Default | Description |
265
+ | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------- |
266
+ | `margin` | `Responsive<"auto" \| "0" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
267
+ | `marginTop` | `Responsive<"auto" \| "0" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
268
+ | `marginRight` | `Responsive<"auto" \| "0" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
269
+ | `marginBottom` | `Responsive<"auto" \| "0" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
270
+ | `marginLeft` | `Responsive<"auto" \| "0" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
271
+ | `marginX` | `Responsive<"auto" \| "0" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
272
+ | `marginY` | `Responsive<"auto" \| "0" \| "25" \| "50" \| "75" \| "100" \| "150" \| "175" \| "200" \| "250" \| "300" \| "350" \| "400" \| "500" \| "600" \| "700" \| "800" \| "900" \| "1000" \| `var(--h-${string})`>` | — | |
273
+ | `loading` | `boolean` | — | Indicate when the button is in a loading state, will also disable the button. |
274
+ | `inverted` | `boolean` | — | Inverts the component colours, for use on darker surface colours. |
275
+ | `size` | `Responsive<"sm" \| "md">` | `md` | Sets the button height. |
276
+ | `paddingNone` | `boolean` | — | Remove the inline padding for better alignment with other elements. Only affects the `ghost` variant. |
277
+ | `action` | `"next" \| "previous"` | — | |