@arbor-education/design-system.components 3.4.5 → 4.0.0-react19-alpha.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 (82) hide show
  1. package/.changeset/empty-clocks-jog.md +5 -0
  2. package/dist/components/combobox/ComboboxButtonTrigger.d.ts +1 -1
  3. package/dist/components/combobox/ComboboxButtonTrigger.d.ts.map +1 -1
  4. package/dist/components/combobox/ComboboxListbox.d.ts +2 -2
  5. package/dist/components/combobox/ComboboxListbox.d.ts.map +1 -1
  6. package/dist/components/combobox/ComboboxTrigger.d.ts +2 -2
  7. package/dist/components/combobox/ComboboxTrigger.d.ts.map +1 -1
  8. package/dist/components/combobox/useComboboxListboxDom.d.ts +1 -1
  9. package/dist/components/combobox/useComboboxListboxDom.d.ts.map +1 -1
  10. package/dist/components/combobox/useElementWidth.d.ts +2 -0
  11. package/dist/components/combobox/useElementWidth.d.ts.map +1 -0
  12. package/dist/components/combobox/useElementWidth.js +31 -0
  13. package/dist/components/combobox/useElementWidth.js.map +1 -0
  14. package/dist/components/combobox/useVisibleChips.d.ts +21 -0
  15. package/dist/components/combobox/useVisibleChips.d.ts.map +1 -0
  16. package/dist/components/combobox/useVisibleChips.js +59 -0
  17. package/dist/components/combobox/useVisibleChips.js.map +1 -0
  18. package/dist/components/combobox/useVisibleChips.test.d.ts +2 -0
  19. package/dist/components/combobox/useVisibleChips.test.d.ts.map +1 -0
  20. package/dist/components/combobox/useVisibleChips.test.js +81 -0
  21. package/dist/components/combobox/useVisibleChips.test.js.map +1 -0
  22. package/dist/components/heading/Heading.d.ts +28 -14
  23. package/dist/components/heading/Heading.d.ts.map +1 -1
  24. package/dist/components/heading/Heading.stories.d.ts +28 -14
  25. package/dist/components/heading/Heading.stories.d.ts.map +1 -1
  26. package/dist/components/icoText/IcoText.d.ts +37 -0
  27. package/dist/components/icoText/IcoText.d.ts.map +1 -0
  28. package/dist/components/icoText/IcoText.js +29 -0
  29. package/dist/components/icoText/IcoText.js.map +1 -0
  30. package/dist/components/icoText/IcoText.stories.d.ts +60 -0
  31. package/dist/components/icoText/IcoText.stories.d.ts.map +1 -0
  32. package/dist/components/icoText/IcoText.stories.js +319 -0
  33. package/dist/components/icoText/IcoText.stories.js.map +1 -0
  34. package/dist/components/icoText/IcoText.test.d.ts +2 -0
  35. package/dist/components/icoText/IcoText.test.d.ts.map +1 -0
  36. package/dist/components/icoText/IcoText.test.js +27 -0
  37. package/dist/components/icoText/IcoText.test.js.map +1 -0
  38. package/dist/components/table/Table.test.js +18 -14
  39. package/dist/components/table/Table.test.js.map +1 -1
  40. package/dist/components/tabs/TabsItem.stories.d.ts +50 -22
  41. package/dist/components/tabs/TabsItem.stories.d.ts.map +1 -1
  42. package/dist/components/tagList/useTagListCollapsedLayout.d.ts +3 -3
  43. package/dist/components/tagList/useTagListCollapsedLayout.d.ts.map +1 -1
  44. package/dist/components/tree-row/TreeRow.d.ts +32 -0
  45. package/dist/components/tree-row/TreeRow.d.ts.map +1 -0
  46. package/dist/components/tree-row/TreeRow.js +19 -0
  47. package/dist/components/tree-row/TreeRow.js.map +1 -0
  48. package/dist/components/tree-row/TreeRow.stories.d.ts +13 -0
  49. package/dist/components/tree-row/TreeRow.stories.d.ts.map +1 -0
  50. package/dist/components/tree-row/TreeRow.stories.js +774 -0
  51. package/dist/components/tree-row/TreeRow.stories.js.map +1 -0
  52. package/dist/components/tree-row/TreeRow.test.d.ts +2 -0
  53. package/dist/components/tree-row/TreeRow.test.d.ts.map +1 -0
  54. package/dist/components/tree-row/TreeRow.test.js +262 -0
  55. package/dist/components/tree-row/TreeRow.test.js.map +1 -0
  56. package/dist/components/tree-row/TreeRowSection.d.ts +12 -0
  57. package/dist/components/tree-row/TreeRowSection.d.ts.map +1 -0
  58. package/dist/components/tree-row/TreeRowSection.js +20 -0
  59. package/dist/components/tree-row/TreeRowSection.js.map +1 -0
  60. package/dist/utils/PopupParentContext.d.ts +3 -0
  61. package/dist/utils/PopupParentContext.d.ts.map +1 -0
  62. package/dist/utils/PopupParentContext.js +6 -0
  63. package/dist/utils/PopupParentContext.js.map +1 -0
  64. package/dist/utils/PopupParentContext.stories.d.ts +17 -0
  65. package/dist/utils/PopupParentContext.stories.d.ts.map +1 -0
  66. package/dist/utils/PopupParentContext.stories.js +266 -0
  67. package/dist/utils/PopupParentContext.stories.js.map +1 -0
  68. package/dist/utils/getDefaultPopupParent.d.ts +2 -0
  69. package/dist/utils/getDefaultPopupParent.d.ts.map +1 -0
  70. package/dist/utils/getDefaultPopupParent.js +19 -0
  71. package/dist/utils/getDefaultPopupParent.js.map +1 -0
  72. package/dist/utils/hooks/useIsMounted.d.ts +1 -1
  73. package/dist/utils/hooks/useIsMounted.d.ts.map +1 -1
  74. package/package.json +19 -5
  75. package/src/components/arborLogo/__snapshots__/ArborLogo.test.tsx.snap +18 -18
  76. package/src/components/combobox/ComboboxButtonTrigger.tsx +1 -1
  77. package/src/components/combobox/ComboboxListbox.tsx +2 -2
  78. package/src/components/combobox/ComboboxTrigger.tsx +2 -2
  79. package/src/components/combobox/useComboboxListboxDom.ts +1 -1
  80. package/src/components/table/Table.test.tsx +18 -14
  81. package/src/components/tagList/useTagListCollapsedLayout.ts +3 -3
  82. package/src/docs/UsingComponents.mdx +6 -0
@@ -0,0 +1,60 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ import { IcoText } from './IcoText.js';
3
+ declare function IcoTextDocsPage(): import("react/jsx-runtime").JSX.Element;
4
+ declare const meta: {
5
+ title: string;
6
+ component: {
7
+ ({ children, className }: import("./IcoText.js").IcoTextProps): React.JSX.Element;
8
+ displayName: string;
9
+ } & {
10
+ Heading: {
11
+ ({ children, className, ...rest }: import("./IcoText.js").IcoTextHeadingProps): React.JSX.Element;
12
+ displayName: string;
13
+ };
14
+ Paragraph: {
15
+ ({ children, className, ...rest }: import("./IcoText.js").IcoTextParagraphProps): React.JSX.Element;
16
+ displayName: string;
17
+ };
18
+ Icon: {
19
+ ({ className, color, name, screenReaderText, size, }: import("./IcoText.js").IcoTextIconProps): React.JSX.Element;
20
+ displayName: string;
21
+ };
22
+ };
23
+ tags: string[];
24
+ parameters: {
25
+ layout: string;
26
+ docs: {
27
+ page: typeof IcoTextDocsPage;
28
+ };
29
+ };
30
+ argTypes: {
31
+ className: {
32
+ control: false;
33
+ description: string;
34
+ table: {
35
+ type: {
36
+ summary: string;
37
+ };
38
+ };
39
+ };
40
+ children: {
41
+ control: false;
42
+ description: string;
43
+ table: {
44
+ type: {
45
+ summary: string;
46
+ };
47
+ };
48
+ };
49
+ };
50
+ };
51
+ export default meta;
52
+ type Story = StoryObj<typeof IcoText>;
53
+ export declare const Default: Story;
54
+ export declare const HeadingOnly: Story;
55
+ export declare const WithoutIcon: Story;
56
+ export declare const IconWithScreenReaderText: Story;
57
+ export declare const IconSizes: Story;
58
+ export declare const IconColors: Story;
59
+ export declare const MultipleParagraphs: Story;
60
+ //# sourceMappingURL=IcoText.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IcoText.stories.d.ts","sourceRoot":"","sources":["../../../src/components/icoText/IcoText.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAU5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2GpC,iBAAS,eAAe,4CAyBvB;AAMD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBsB,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAsEtC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA+BzB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA+BzB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAqCtC,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAuCvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KA2BxB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KA4BhC,CAAC"}
@@ -0,0 +1,319 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Controls, Heading as DocHeading, Markdown, Primary as DocPrimary, Stories, Subtitle, Title, } from '@storybook/addon-docs/blocks';
3
+ import { IcoText } from './IcoText.js';
4
+ // ---------------------------------------------------------------------------
5
+ // Docs page content
6
+ // ---------------------------------------------------------------------------
7
+ const DESCRIPTION_INTRO = [
8
+ '`IcoText` is a compound layout component that pairs an icon in a left rail with a heading and/or paragraph.',
9
+ 'It is the canonical icon-plus-text primitive in this design system — used internally by `ArticleCard`',
10
+ 'and available for direct use in any context that needs an icon anchoring labelled content.',
11
+ ].join(' ');
12
+ const ICON_PROPS = [
13
+ '| Prop | Type | Default | Description |',
14
+ '|---|---|---|---|',
15
+ '| `name` | `IconName` | — | **Required.** The icon identifier |',
16
+ '| `size` | `12 \\| 16 \\| 24` | `24` | Icon size in pixels |',
17
+ '| `color` | `string` | — | Icon colour — use a CSS token e.g. `var(--color-grey-600)` |',
18
+ '| `screenReaderText` | `string` | — | Accessible label. Omit for decorative icons (icon becomes `aria-hidden`) |',
19
+ '| `className` | `string` | — | Additional CSS classes |',
20
+ ].join('\n');
21
+ const HEADING_PROPS = [
22
+ '| Prop | Type | Default | Description |',
23
+ '|---|---|---|---|',
24
+ '| `children` | `ReactNode` | — | **Required.** Heading text |',
25
+ '| `...HTMLAttributes<h4>` | | | All standard heading element attributes forwarded |',
26
+ ].join('\n');
27
+ const PARAGRAPH_PROPS = [
28
+ '| Prop | Type | Default | Description |',
29
+ '|---|---|---|---|',
30
+ '| `children` | `ReactNode` | — | **Required.** Paragraph text |',
31
+ '| `...HTMLAttributes<p>` | | | All standard paragraph element attributes forwarded |',
32
+ ].join('\n');
33
+ const USAGE_GUIDANCE = [
34
+ '### When to use',
35
+ '',
36
+ '- Pairing a meaningful icon with a short heading and/or description — attendance alerts, feature blurbs, help text',
37
+ '- Inside panels, list items, or cards where an icon anchors the content',
38
+ '- As the building block for `ArticleCard` icon-rail layouts',
39
+ '',
40
+ '---',
41
+ '',
42
+ '### When NOT to use',
43
+ '',
44
+ '| Situation | Use instead |',
45
+ '|---|---|',
46
+ '| Content inside a navigable card | [`ArticleCard`](?path=/docs/components-card-articlecard--docs) |',
47
+ '| Icon with no text | [`Icon`](?path=/docs/components-icon--docs) directly |',
48
+ '| Long-form prose | Semantic HTML `<p>` with a separate heading |',
49
+ '| Interactive element | Wrap `IcoText` inside a `Card` or `Button` — never add `onClick` to `IcoText` itself |',
50
+ ].join('\n');
51
+ const DEVELOPER_NOTES = [
52
+ '### Critical usage patterns',
53
+ '',
54
+ '**`IcoText.Icon` is automatically hoisted to the left rail** regardless of position in JSX.',
55
+ 'The root inspects `children`, pulls out any `IcoText.Icon` elements into a flex-shrink-0 left column,',
56
+ 'and places all other children (Heading, Paragraph) in the content column.',
57
+ '',
58
+ '```tsx',
59
+ '<IcoText>',
60
+ ' <IcoText.Icon name="guardians" />',
61
+ ' <IcoText.Heading>Year 9 Attendance</IcoText.Heading>',
62
+ ' <IcoText.Paragraph>28 pupils · 94.2% this term</IcoText.Paragraph>',
63
+ '</IcoText>',
64
+ '```',
65
+ '',
66
+ '**`IcoText.Heading` always renders as `<h4>`.** There is no `level` prop. Verify your document',
67
+ 'heading hierarchy is correct before using `IcoText` as a standalone heading.',
68
+ '',
69
+ '**Omit `screenReaderText` for decorative icons.** The icon is rendered with `aria-hidden="true"`',
70
+ 'when `screenReaderText` is absent. The heading or surrounding text should carry the accessible meaning.',
71
+ '',
72
+ '---',
73
+ '',
74
+ '### Accessibility',
75
+ '',
76
+ '- Decorative icons (no `screenReaderText`): `aria-hidden="true"` — screen readers skip them',
77
+ '- Meaningful icons: provide `screenReaderText` so the icon has an accessible label',
78
+ '- `IcoText.Heading` renders `<h4>` — verify your document heading hierarchy',
79
+ '- `IcoText.Paragraph` renders `<p>` — semantically appropriate for supporting text',
80
+ '',
81
+ '---',
82
+ '',
83
+ '### TypeScript types',
84
+ '',
85
+ '```ts',
86
+ "import { IcoText } from '@arbor-education/design-system.components';",
87
+ "import type { IcoTextProps, IcoTextIconProps, IcoTextHeadingProps, IcoTextParagraphProps } from '@arbor-education/design-system.components';",
88
+ '```',
89
+ ].join('\n');
90
+ const RELATED_COMPONENTS = [
91
+ '## Related components',
92
+ '',
93
+ '[ArticleCard](?path=/docs/components-card-articlecard--docs) · [Icon](?path=/docs/components-icon--docs) · [Card](?path=/docs/components-card--docs)',
94
+ ].join('\n');
95
+ const PROPS_INTRO = 'The preview below is wired to the **Controls** panel — tweak any prop to see the story update in real time.';
96
+ // ---------------------------------------------------------------------------
97
+ // Custom DocsPage
98
+ // ---------------------------------------------------------------------------
99
+ function IcoTextDocsPage() {
100
+ return (_jsxs(_Fragment, { children: [_jsx(Title, {}), _jsx(Subtitle, {}), _jsx(Markdown, { children: DESCRIPTION_INTRO }), _jsx(DocHeading, { children: "Interactive example" }), _jsx(Markdown, { children: PROPS_INTRO }), _jsx(DocPrimary, {}), _jsx(Controls, {}), _jsx(DocHeading, { children: "IcoText.Icon props" }), _jsx(Markdown, { children: ICON_PROPS }), _jsx(DocHeading, { children: "IcoText.Heading props" }), _jsx(Markdown, { children: HEADING_PROPS }), _jsx(DocHeading, { children: "IcoText.Paragraph props" }), _jsx(Markdown, { children: PARAGRAPH_PROPS }), _jsx(DocHeading, { children: "Usage guidance" }), _jsx(Markdown, { children: USAGE_GUIDANCE }), _jsx(DocHeading, { children: "Developer notes" }), _jsx(Markdown, { children: DEVELOPER_NOTES }), _jsx(DocHeading, { children: "Examples" }), _jsx(Stories, { title: "" }), _jsx(Markdown, { children: RELATED_COMPONENTS })] }));
101
+ }
102
+ // ---------------------------------------------------------------------------
103
+ // Meta
104
+ // ---------------------------------------------------------------------------
105
+ const meta = {
106
+ title: 'Components/IcoText',
107
+ component: IcoText,
108
+ tags: ['autodocs'],
109
+ parameters: {
110
+ layout: 'padded',
111
+ docs: { page: IcoTextDocsPage },
112
+ },
113
+ argTypes: {
114
+ className: {
115
+ control: false,
116
+ description: 'Additional CSS class names on the root `div.ds-ico-text` element.',
117
+ table: { type: { summary: 'string' } },
118
+ },
119
+ children: {
120
+ control: false,
121
+ description: 'Compose using `IcoText.Icon`, `IcoText.Heading`, and `IcoText.Paragraph` sub-components.',
122
+ table: { type: { summary: 'ReactNode' } },
123
+ },
124
+ },
125
+ };
126
+ export default meta;
127
+ // ---------------------------------------------------------------------------
128
+ // Helper: attach a per-story description to docs
129
+ // ---------------------------------------------------------------------------
130
+ const withDescription = (story, description) => ({
131
+ ...story,
132
+ parameters: {
133
+ ...story.parameters,
134
+ docs: { ...story.parameters?.docs, description: { story: description } },
135
+ },
136
+ });
137
+ // ---------------------------------------------------------------------------
138
+ // Template components
139
+ // ---------------------------------------------------------------------------
140
+ const IconSizesTemplate = () => (_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-xlarge)' }, children: [12, 16, 24].map(size => (_jsxs("div", { children: [_jsx("p", { className: "ds-text", style: { margin: '0 0 var(--spacing-small)', color: 'var(--color-grey-600)' }, children: `size={${size}}` }), _jsxs(IcoText, { children: [_jsx(IcoText.Icon, { name: "guardians", size: size }), _jsx(IcoText.Heading, { children: "Year 9 Attendance" }), _jsx(IcoText.Paragraph, { children: "28 pupils \u00B7 94.2% average this term" })] })] }, size))) }));
141
+ const IconColorsTemplate = () => (_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 'var(--spacing-xlarge)' }, children: [
142
+ { color: 'var(--color-semantic-info-600)', label: 'Info — var(--color-semantic-info-600)' },
143
+ { color: 'var(--color-semantic-success-600)', label: 'Success — var(--color-semantic-success-600)' },
144
+ { color: 'var(--color-semantic-warning-600)', label: 'Warning — var(--color-semantic-warning-600)' },
145
+ { color: 'var(--color-semantic-destructive-600)', label: 'Destructive — var(--color-semantic-destructive-600)' },
146
+ ].map(({ color, label }) => (_jsxs("div", { children: [_jsx("p", { className: "ds-text", style: { margin: '0 0 var(--spacing-small)', color: 'var(--color-grey-600)' }, children: label }), _jsxs(IcoText, { children: [_jsx(IcoText.Icon, { name: "triangle-alert", color: color }), _jsx(IcoText.Heading, { children: "Attendance alert" }), _jsx(IcoText.Paragraph, { children: "3 pupils below 90% this half-term" })] })] }, color))) }));
147
+ const MultipleParagraphsTemplate = () => (_jsxs(IcoText, { children: [_jsx(IcoText.Icon, { name: "date" }), _jsx(IcoText.Heading, { children: "Parents' evening \u2014 Tuesday 14 May" }), _jsx(IcoText.Paragraph, { children: "4:00 pm \u2013 7:00 pm \u00B7 Main Hall" }), _jsx(IcoText.Paragraph, { children: "Appointments available every 10 minutes. Please arrive 5 minutes early." })] }));
148
+ // ---------------------------------------------------------------------------
149
+ // Stories
150
+ // ---------------------------------------------------------------------------
151
+ export const Default = withDescription({
152
+ render: () => (_jsxs(IcoText, { children: [_jsx(IcoText.Icon, { name: "guardians" }), _jsx(IcoText.Heading, { children: "Year 9 Attendance" }), _jsx(IcoText.Paragraph, { children: "28 pupils \u00B7 94.2% average this term" })] })),
153
+ }, 'The full canonical composition — `IcoText.Icon` in the left rail, `IcoText.Heading` and `IcoText.Paragraph` in the content column.');
154
+ export const HeadingOnly = withDescription({
155
+ parameters: {
156
+ controls: { disable: true },
157
+ docs: {
158
+ source: {
159
+ language: 'tsx',
160
+ code: `
161
+ import { IcoText } from '@arbor-education/design-system.components';
162
+
163
+ function HeadingOnlyExample() {
164
+ return (
165
+ <IcoText>
166
+ <IcoText.Icon name="book-open" />
167
+ <IcoText.Heading>Assessment policy</IcoText.Heading>
168
+ </IcoText>
169
+ );
170
+ }
171
+ export default HeadingOnlyExample;
172
+ `.trim(),
173
+ },
174
+ },
175
+ },
176
+ render: () => (_jsxs(IcoText, { children: [_jsx(IcoText.Icon, { name: "book-open" }), _jsx(IcoText.Heading, { children: "Assessment policy" })] })),
177
+ }, 'Icon + Heading with no Paragraph — the compact pattern for short navigational labels.');
178
+ export const WithoutIcon = withDescription({
179
+ parameters: {
180
+ controls: { disable: true },
181
+ docs: {
182
+ source: {
183
+ language: 'tsx',
184
+ code: `
185
+ import { IcoText } from '@arbor-education/design-system.components';
186
+
187
+ function WithoutIconExample() {
188
+ return (
189
+ <IcoText>
190
+ <IcoText.Heading>Behaviour report</IcoText.Heading>
191
+ <IcoText.Paragraph>No incidents recorded this week. All targets met.</IcoText.Paragraph>
192
+ </IcoText>
193
+ );
194
+ }
195
+ export default WithoutIconExample;
196
+ `.trim(),
197
+ },
198
+ },
199
+ },
200
+ render: () => (_jsxs(IcoText, { children: [_jsx(IcoText.Heading, { children: "Behaviour report" }), _jsx(IcoText.Paragraph, { children: "No incidents recorded this week. All targets met." })] })),
201
+ }, 'Heading + Paragraph with no icon. The left rail disappears cleanly — `IcoText.Icon` is entirely optional.');
202
+ export const IconWithScreenReaderText = withDescription({
203
+ parameters: {
204
+ controls: { disable: true },
205
+ docs: {
206
+ source: {
207
+ language: 'tsx',
208
+ code: `
209
+ import { IcoText } from '@arbor-education/design-system.components';
210
+
211
+ function IconWithScreenReaderTextExample() {
212
+ return (
213
+ <IcoText>
214
+ <IcoText.Icon
215
+ name="triangle-alert"
216
+ color="var(--color-semantic-warning-600)"
217
+ screenReaderText="Warning"
218
+ />
219
+ <IcoText.Heading>Attendance below target</IcoText.Heading>
220
+ <IcoText.Paragraph>Alice Johnson — 78.4% this term. Intervention recommended.</IcoText.Paragraph>
221
+ </IcoText>
222
+ );
223
+ }
224
+ export default IconWithScreenReaderTextExample;
225
+ `.trim(),
226
+ },
227
+ },
228
+ },
229
+ render: () => (_jsxs(IcoText, { children: [_jsx(IcoText.Icon, { name: "triangle-alert", color: "var(--color-semantic-warning-600)", screenReaderText: "Warning" }), _jsx(IcoText.Heading, { children: "Attendance below target" }), _jsx(IcoText.Paragraph, { children: "Alice Johnson \u2014 78.4% this term. Intervention recommended." })] })),
230
+ }, 'When the icon carries meaning not conveyed by the heading text, provide `screenReaderText`. Without it the icon is `aria-hidden="true"`. Here the warning triangle conveys severity — screen readers announce "Warning, Attendance below target".');
231
+ export const IconSizes = withDescription({
232
+ parameters: {
233
+ controls: { disable: true },
234
+ docs: {
235
+ source: {
236
+ language: 'tsx',
237
+ code: `
238
+ import { IcoText } from '@arbor-education/design-system.components';
239
+
240
+ function IconSizesExample() {
241
+ return (
242
+ <>
243
+ <IcoText>
244
+ <IcoText.Icon name="guardians" size={12} />
245
+ <IcoText.Heading>size 12</IcoText.Heading>
246
+ <IcoText.Paragraph>Use in very compact contexts</IcoText.Paragraph>
247
+ </IcoText>
248
+ <IcoText>
249
+ <IcoText.Icon name="guardians" size={16} />
250
+ <IcoText.Heading>size 16</IcoText.Heading>
251
+ <IcoText.Paragraph>Use in moderately compact contexts</IcoText.Paragraph>
252
+ </IcoText>
253
+ <IcoText>
254
+ <IcoText.Icon name="guardians" size={24} />
255
+ <IcoText.Heading>size 24 (default)</IcoText.Heading>
256
+ <IcoText.Paragraph>Standard — aligns best with h4 line-height</IcoText.Paragraph>
257
+ </IcoText>
258
+ </>
259
+ );
260
+ }
261
+ export default IconSizesExample;
262
+ `.trim(),
263
+ },
264
+ },
265
+ },
266
+ render: IconSizesTemplate,
267
+ }, 'All three supported icon sizes — 12, 16, and 24 (default). Use smaller sizes only in compact contexts such as table cells or dense lists. The `24` default aligns best with `IcoText.Heading`\'s h4 line-height.');
268
+ export const IconColors = withDescription({
269
+ parameters: {
270
+ controls: { disable: true },
271
+ docs: {
272
+ source: {
273
+ language: 'tsx',
274
+ code: `
275
+ import { IcoText } from '@arbor-education/design-system.components';
276
+
277
+ function IconColorsExample() {
278
+ return (
279
+ <IcoText>
280
+ <IcoText.Icon name="triangle-alert" color="var(--color-semantic-warning-600)" />
281
+ <IcoText.Heading>Attendance alert</IcoText.Heading>
282
+ <IcoText.Paragraph>3 pupils below 90% this half-term</IcoText.Paragraph>
283
+ </IcoText>
284
+ );
285
+ }
286
+ export default IconColorsExample;
287
+ `.trim(),
288
+ },
289
+ },
290
+ },
291
+ render: IconColorsTemplate,
292
+ }, 'The `color` prop on `IcoText.Icon` accepts any CSS value — always use design token variables, never hardcoded hex. Semantic tokens (`--color-semantic-*`) are most appropriate for status-indicating icons.');
293
+ export const MultipleParagraphs = withDescription({
294
+ parameters: {
295
+ controls: { disable: true },
296
+ docs: {
297
+ source: {
298
+ language: 'tsx',
299
+ code: `
300
+ import { IcoText } from '@arbor-education/design-system.components';
301
+
302
+ function MultipleParagraphsExample() {
303
+ return (
304
+ <IcoText>
305
+ <IcoText.Icon name="calendar" />
306
+ <IcoText.Heading>Parents' evening — Tuesday 14 May</IcoText.Heading>
307
+ <IcoText.Paragraph>4:00 pm – 7:00 pm · Main Hall</IcoText.Paragraph>
308
+ <IcoText.Paragraph>Appointments every 10 minutes. Please arrive 5 minutes early.</IcoText.Paragraph>
309
+ </IcoText>
310
+ );
311
+ }
312
+ export default MultipleParagraphsExample;
313
+ `.trim(),
314
+ },
315
+ },
316
+ },
317
+ render: MultipleParagraphsTemplate,
318
+ }, 'Multiple `IcoText.Paragraph` sub-components stack vertically in the content column. Use for supplementary detail lines below the primary heading.');
319
+ //# sourceMappingURL=IcoText.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IcoText.stories.js","sourceRoot":"","sources":["../../../src/components/icoText/IcoText.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,OAAO,EACP,QAAQ,EACR,KAAK,GACN,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG;IACxB,6GAA6G;IAC7G,uGAAuG;IACvG,4FAA4F;CAC7F,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ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CAAC,IAAI,EAAE;aACC;SACF;KACF;IACD,MAAM,EAAE,0BAA0B;CACnC,EACD,mJAAmJ,CACpJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom/vitest';
2
+ //# sourceMappingURL=IcoText.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IcoText.test.d.ts","sourceRoot":"","sources":["../../../src/components/icoText/IcoText.test.tsx"],"names":[],"mappings":"AACA,OAAO,kCAAkC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { render, screen, within } from '@testing-library/react';
3
+ import '@testing-library/jest-dom/vitest';
4
+ import { describe, expect, test } from 'vitest';
5
+ import { IcoText } from './IcoText.js';
6
+ describe('IcoText', () => {
7
+ test('renders icon children before content children and keeps content in the content wrapper', () => {
8
+ const { container } = render(_jsxs(IcoText, { children: [_jsx(IcoText.Heading, { children: "Article title" }), _jsx(IcoText.Icon, { name: "eye", screenReaderText: "Views" }), _jsx(IcoText.Paragraph, { children: "Helpful supporting copy" }), _jsx("span", { children: "Metadata" }), _jsx(IcoText.Icon, { name: "eye", screenReaderText: "More views" })] }));
9
+ const root = container.querySelector('.ds-ico-text');
10
+ const content = container.querySelector('.ds-ico-text__content');
11
+ if (!content) {
12
+ throw new Error('Expected IcoText content wrapper to exist');
13
+ }
14
+ const iconElements = Array.from(root?.querySelectorAll(':scope > .ds-ico-text__icon') ?? []);
15
+ expect(iconElements).toHaveLength(2);
16
+ expect(root?.lastElementChild).toBe(content);
17
+ expect(content.querySelectorAll('.ds-ico-text__icon')).toHaveLength(0);
18
+ iconElements.forEach((iconElement) => {
19
+ expect(iconElement.compareDocumentPosition(content) & Node.DOCUMENT_POSITION_FOLLOWING).not.toBe(0);
20
+ });
21
+ expect(within(content).getByRole('heading', { level: 4 })).toHaveTextContent('Article title');
22
+ expect(within(content).getByText('Helpful supporting copy')).toBeInTheDocument();
23
+ expect(within(content).getByText('Metadata')).toBeInTheDocument();
24
+ expect(screen.getAllByRole('img', { hidden: true })).toHaveLength(2);
25
+ });
26
+ });
27
+ //# sourceMappingURL=IcoText.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IcoText.test.js","sourceRoot":"","sources":["../../../src/components/icoText/IcoText.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAI,CAAC,wFAAwF,EAAE,GAAG,EAAE;QAClG,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,MAAC,OAAO,eACN,KAAC,OAAO,CAAC,OAAO,gCAAgC,EAChD,KAAC,OAAO,CAAC,IAAI,IAAC,IAAI,EAAC,KAAK,EAAC,gBAAgB,EAAC,OAAO,GAAG,EACpD,KAAC,OAAO,CAAC,SAAS,0CAA4C,EAC9D,sCAAqB,EACrB,KAAC,OAAO,CAAC,IAAI,IAAC,IAAI,EAAC,KAAK,EAAC,gBAAgB,EAAC,YAAY,GAAG,IACjD,CACX,CAAC;QAEF,MAAM,IAAI,GAAG,SAAS,CAAC,aAAa,CAAiB,cAAc,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,SAAS,CAAC,aAAa,CAAiB,uBAAuB,CAAC,CAAC;QAEjF,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,6BAA6B,CAAC,IAAI,EAAE,CAAC,CAAC;QAE7F,MAAM,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACvE,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YACnC,MAAM,CACJ,WAAW,CAAC,uBAAuB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,2BAA2B,CAChF,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAC9F,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QACjF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAClE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -819,32 +819,34 @@ describe('Table', () => {
819
819
  cellRenderer: 'dsSelectDropdownCellRenderer',
820
820
  cellRendererParams: { options: options, placeholder: 'Placeholder Text' },
821
821
  }];
822
- test('renders with placeholder', () => {
822
+ test('renders with placeholder', async () => {
823
823
  const rowData = [{ selectField: null }];
824
824
  render(_jsx(Table, { columnDefs: columnDefs, rowData: rowData }));
825
- expect(screen.getByText('Placeholder Text')).toBeInTheDocument();
825
+ expect(await screen.findByText('Placeholder Text')).toBeInTheDocument();
826
826
  });
827
- test('renders with option', () => {
827
+ test('renders with option', async () => {
828
828
  const rowData = [{ selectField: 'option1' }];
829
829
  render(_jsx(Table, { columnDefs: columnDefs, rowData: rowData }));
830
- expect(screen.getByText('Option 1')).toBeInTheDocument();
830
+ expect(await screen.findByText('Option 1')).toBeInTheDocument();
831
831
  });
832
- test('renders with value not in options as raw string', () => {
832
+ test('renders with value not in options as raw string', async () => {
833
833
  const rowData = [{ selectField: 'unknown-value' }];
834
834
  render(_jsx(Table, { columnDefs: columnDefs, rowData: rowData }));
835
- expect(screen.getByText('unknown-value')).toBeInTheDocument();
835
+ expect(await screen.findByText('unknown-value')).toBeInTheDocument();
836
836
  });
837
- test('renders with empty string shows placeholder', () => {
837
+ test('renders with empty string shows placeholder', async () => {
838
838
  const rowData = [{ selectField: '' }];
839
839
  render(_jsx(Table, { columnDefs: columnDefs, rowData: rowData }));
840
- expect(screen.getByText('Placeholder Text')).toBeInTheDocument();
840
+ expect(await screen.findByText('Placeholder Text')).toBeInTheDocument();
841
841
  });
842
- test('renders dropdown button variant in cell', () => {
842
+ test('renders dropdown button variant in cell', async () => {
843
843
  const rowData = [{ selectField: 'option1' }];
844
844
  const { container } = render(_jsx(Table, { columnDefs: columnDefs, rowData: rowData }));
845
- const dropdownWrapper = container.querySelector('.ds-table__select-dropdown');
846
- const dropdownButton = dropdownWrapper?.querySelector('.ds-button--dropdown');
847
- expect(dropdownButton).toBeInTheDocument();
845
+ await waitFor(() => {
846
+ const dropdownWrapper = container.querySelector('.ds-table__select-dropdown');
847
+ const dropdownButton = dropdownWrapper?.querySelector('.ds-button--dropdown');
848
+ expect(dropdownButton).toBeInTheDocument();
849
+ });
848
850
  });
849
851
  });
850
852
  describe('InlineTextCellRenderer', () => {
@@ -1164,6 +1166,7 @@ describe('Table', () => {
1164
1166
  gridApi = event.api;
1165
1167
  } }));
1166
1168
  await waitFor(() => expect(screen.getByRole('grid')).toBeInTheDocument());
1169
+ await waitFor(() => expect(gridApi).toBeDefined());
1167
1170
  gridApi.startEditingCell({ rowIndex: 0, colKey: 'dateOfBirth' });
1168
1171
  await waitFor(() => expect(screen.getByRole('button', { name: 'Open date picker' })).toBeInTheDocument());
1169
1172
  });
@@ -1175,6 +1178,7 @@ describe('Table', () => {
1175
1178
  gridApi = event.api;
1176
1179
  }, onCellValueChanged: onCellValueChanged }));
1177
1180
  await waitFor(() => expect(screen.getByRole('grid')).toBeInTheDocument());
1181
+ await waitFor(() => expect(gridApi).toBeDefined());
1178
1182
  gridApi.setFocusedCell(0, 'dateOfBirth');
1179
1183
  await userEvent.keyboard('{Enter}');
1180
1184
  await waitFor(() => expect(container.querySelector('input[type="date"]')).toBeInTheDocument());
@@ -1197,6 +1201,7 @@ describe('Table', () => {
1197
1201
  gridApi = event.api;
1198
1202
  } }));
1199
1203
  await waitFor(() => expect(screen.getByRole('grid')).toBeInTheDocument());
1204
+ await waitFor(() => expect(gridApi).toBeDefined());
1200
1205
  gridApi.startEditingCell({ rowIndex: 0, colKey: 'dateOfBirth' });
1201
1206
  await waitFor(() => expect(container.querySelector('input[type="date"]')).toBeInTheDocument());
1202
1207
  expect(container.querySelector('input[type="date"]')).toHaveValue('2024-06-15');
@@ -1324,8 +1329,7 @@ describe('Table', () => {
1324
1329
  test('setting suppressCellFocusAndFocusFirstElement to true should add the ds-table__cell--suppress-focus class', async () => {
1325
1330
  const { container } = render(_jsx(Table, { columnDefs: columnDefs, rowData: rowData }));
1326
1331
  await screen.findByRole('grid', {}, { timeout: 10000 });
1327
- const cellWithClass = container.querySelector('.ds-table__cell--suppress-focus');
1328
- expect(cellWithClass).toBeInTheDocument();
1332
+ await waitFor(() => expect(container.querySelector('.ds-table__cell--suppress-focus')).toBeInTheDocument());
1329
1333
  });
1330
1334
  test('setting suppressCellFocusAndFocusFirstElement to true should suppress cell focus and focus the first element', async () => {
1331
1335
  const focusFirstFocusableElementSpy = vi.spyOn(focusFirstFocusableElementModule, 'focusFirstFocusableElement');