@arbor-education/design-system.components 0.15.0 → 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.
- package/.gather/skills/write-stories/SKILL.md +207 -271
- package/.storybook/preview.ts +5 -0
- package/CHANGELOG.md +23 -0
- package/README.md +8 -0
- package/component-library.md +144 -13
- package/dist/components/articleCard/ArticleCard.stories.d.ts +137 -11
- package/dist/components/articleCard/ArticleCard.stories.d.ts.map +1 -1
- package/dist/components/articleCard/ArticleCard.stories.js +358 -91
- package/dist/components/articleCard/ArticleCard.stories.js.map +1 -1
- package/dist/components/avatar/Avatar.stories.d.ts +6 -6
- package/dist/components/avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.stories.js +393 -49
- package/dist/components/avatar/Avatar.stories.js.map +1 -1
- package/dist/components/avatarGroup/AvatarGroup.stories.d.ts +9 -7
- package/dist/components/avatarGroup/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/components/avatarGroup/AvatarGroup.stories.js +688 -65
- package/dist/components/avatarGroup/AvatarGroup.stories.js.map +1 -1
- package/dist/components/banner/Banner.stories.d.ts.map +1 -1
- package/dist/components/banner/Banner.stories.js +7 -3
- package/dist/components/banner/Banner.stories.js.map +1 -1
- package/dist/components/card/Card.stories.d.ts +105 -4
- package/dist/components/card/Card.stories.d.ts.map +1 -1
- package/dist/components/card/Card.stories.js +336 -18
- package/dist/components/card/Card.stories.js.map +1 -1
- package/dist/components/combobox/Combobox.stories.d.ts +134 -21
- package/dist/components/combobox/Combobox.stories.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.stories.js +676 -175
- package/dist/components/combobox/Combobox.stories.js.map +1 -1
- package/dist/components/datePicker/DatePicker.stories.d.ts +119 -27
- package/dist/components/datePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/datePicker/DatePicker.stories.js +575 -47
- package/dist/components/datePicker/DatePicker.stories.js.map +1 -1
- package/dist/components/dateTimePicker/DateTimePicker.stories.d.ts +155 -39
- package/dist/components/dateTimePicker/DateTimePicker.stories.d.ts.map +1 -1
- package/dist/components/dateTimePicker/DateTimePicker.stories.js +674 -103
- package/dist/components/dateTimePicker/DateTimePicker.stories.js.map +1 -1
- package/dist/components/editableText/EditableText.stories.d.ts +53 -12
- package/dist/components/editableText/EditableText.stories.d.ts.map +1 -1
- package/dist/components/editableText/EditableText.stories.js +401 -64
- package/dist/components/editableText/EditableText.stories.js.map +1 -1
- package/dist/components/formField/FormField.d.ts +4 -0
- package/dist/components/formField/FormField.d.ts.map +1 -1
- package/dist/components/formField/FormField.js +2 -1
- package/dist/components/formField/FormField.js.map +1 -1
- package/dist/components/formField/FormField.test.js +5 -0
- package/dist/components/formField/FormField.test.js.map +1 -1
- package/dist/components/formField/fieldset/Fieldset.stories.d.ts +56 -4
- package/dist/components/formField/fieldset/Fieldset.stories.d.ts.map +1 -1
- package/dist/components/formField/fieldset/Fieldset.stories.js +534 -28
- package/dist/components/formField/fieldset/Fieldset.stories.js.map +1 -1
- package/dist/components/formField/inputs/checkbox/CheckboxGroup.d.ts +3 -1
- package/dist/components/formField/inputs/checkbox/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/formField/inputs/checkbox/CheckboxInput.js +1 -1
- package/dist/components/formField/inputs/checkbox/CheckboxInput.js.map +1 -1
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.d.ts +95 -1
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.d.ts.map +1 -1
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.js +386 -9
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.js.map +1 -1
- package/dist/components/formField/inputs/radio/RadioButtonGroup.d.ts +6 -2
- package/dist/components/formField/inputs/radio/RadioButtonGroup.d.ts.map +1 -1
- package/dist/components/formField/inputs/radio/RadioButtonGroup.js.map +1 -1
- package/dist/components/formField/inputs/radio/RadioButtonInput.stories.d.ts.map +1 -1
- package/dist/components/formField/inputs/radio/RadioButtonInput.stories.js +61 -49
- package/dist/components/formField/inputs/radio/RadioButtonInput.stories.js.map +1 -1
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.stories.d.ts +188 -166
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.stories.d.ts.map +1 -1
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.stories.js +821 -160
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.stories.js.map +1 -1
- package/dist/components/formField/inputs/time/TimeInput.stories.d.ts +176 -22
- package/dist/components/formField/inputs/time/TimeInput.stories.d.ts.map +1 -1
- package/dist/components/formField/inputs/time/TimeInput.stories.js +851 -92
- package/dist/components/formField/inputs/time/TimeInput.stories.js.map +1 -1
- package/dist/components/formField/label/Label.stories.d.ts +54 -5
- package/dist/components/formField/label/Label.stories.d.ts.map +1 -1
- package/dist/components/formField/label/Label.stories.js +238 -4
- package/dist/components/formField/label/Label.stories.js.map +1 -1
- package/dist/components/icoText/IcoText.stories.d.ts +32 -6
- package/dist/components/icoText/IcoText.stories.d.ts.map +1 -1
- package/dist/components/icoText/IcoText.stories.js +309 -14
- package/dist/components/icoText/IcoText.stories.js.map +1 -1
- package/dist/components/kpiCard/KPICard.stories.d.ts +100 -2
- package/dist/components/kpiCard/KPICard.stories.d.ts.map +1 -1
- package/dist/components/kpiCard/KPICard.stories.js +354 -10
- package/dist/components/kpiCard/KPICard.stories.js.map +1 -1
- package/dist/components/kvpList/KVPList.stories.d.ts +57 -4
- package/dist/components/kvpList/KVPList.stories.d.ts.map +1 -1
- package/dist/components/kvpList/KVPList.stories.js +403 -10
- package/dist/components/kvpList/KVPList.stories.js.map +1 -1
- package/dist/components/modal/Modal.stories.d.ts +113 -9
- package/dist/components/modal/Modal.stories.d.ts.map +1 -1
- package/dist/components/modal/Modal.stories.js +633 -13
- package/dist/components/modal/Modal.stories.js.map +1 -1
- package/dist/components/modal/modalManager/ModalManager.stories.d.ts +34 -10
- package/dist/components/modal/modalManager/ModalManager.stories.d.ts.map +1 -1
- package/dist/components/modal/modalManager/ModalManager.stories.js +463 -85
- package/dist/components/modal/modalManager/ModalManager.stories.js.map +1 -1
- package/dist/components/pill/Pill.d.ts.map +1 -1
- package/dist/components/pill/Pill.js +1 -1
- package/dist/components/pill/Pill.js.map +1 -1
- package/dist/components/pill/Pill.stories.d.ts.map +1 -1
- package/dist/components/pill/Pill.stories.js +11 -13
- package/dist/components/pill/Pill.stories.js.map +1 -1
- package/dist/components/row/Row.stories.d.ts +1 -2
- package/dist/components/row/Row.stories.d.ts.map +1 -1
- package/dist/components/row/Row.stories.js +360 -50
- package/dist/components/row/Row.stories.js.map +1 -1
- package/dist/components/searchBar/SearchBar.stories.d.ts +52 -4
- package/dist/components/searchBar/SearchBar.stories.d.ts.map +1 -1
- package/dist/components/searchBar/SearchBar.stories.js +428 -36
- package/dist/components/searchBar/SearchBar.stories.js.map +1 -1
- package/dist/components/section/Section.stories.d.ts +11 -41
- package/dist/components/section/Section.stories.d.ts.map +1 -1
- package/dist/components/section/Section.stories.js +494 -56
- package/dist/components/section/Section.stories.js.map +1 -1
- package/dist/components/singleUser/SingleUser.stories.d.ts +5 -4
- package/dist/components/singleUser/SingleUser.stories.d.ts.map +1 -1
- package/dist/components/singleUser/SingleUser.stories.js +303 -31
- package/dist/components/singleUser/SingleUser.stories.js.map +1 -1
- package/dist/components/slideoverManager/SlideoverManager.stories.d.ts +32 -11
- package/dist/components/slideoverManager/SlideoverManager.stories.d.ts.map +1 -1
- package/dist/components/slideoverManager/SlideoverManager.stories.js +380 -84
- package/dist/components/slideoverManager/SlideoverManager.stories.js.map +1 -1
- package/dist/components/table/DSDefaultColDef.d.ts.map +1 -1
- package/dist/components/table/DSDefaultColDef.js +4 -3
- package/dist/components/table/DSDefaultColDef.js.map +1 -1
- package/dist/components/table/Table.d.ts +6 -1
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/Table.js +8 -3
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.stories.d.ts +3 -0
- package/dist/components/table/Table.stories.d.ts.map +1 -1
- package/dist/components/table/Table.stories.js +384 -5
- package/dist/components/table/Table.stories.js.map +1 -1
- package/dist/components/table/Table.test.js +30 -0
- package/dist/components/table/Table.test.js.map +1 -1
- package/dist/components/table/TableFooter.stories.d.ts +49 -0
- package/dist/components/table/TableFooter.stories.d.ts.map +1 -0
- package/dist/components/table/TableFooter.stories.js +137 -0
- package/dist/components/table/TableFooter.stories.js.map +1 -0
- package/dist/components/table/TableHeader.stories.d.ts +93 -0
- package/dist/components/table/TableHeader.stories.d.ts.map +1 -0
- package/dist/components/table/TableHeader.stories.js +176 -0
- package/dist/components/table/TableHeader.stories.js.map +1 -0
- package/dist/components/table/cellEditors/DateCellEditor.stories.d.ts +44 -0
- package/dist/components/table/cellEditors/DateCellEditor.stories.d.ts.map +1 -0
- package/dist/components/table/cellEditors/DateCellEditor.stories.js +186 -0
- package/dist/components/table/cellEditors/DateCellEditor.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/BooleanCellRenderer.stories.d.ts +40 -0
- package/dist/components/table/cellRenderers/BooleanCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/BooleanCellRenderer.stories.js +209 -0
- package/dist/components/table/cellRenderers/BooleanCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/ButtonCellRenderer.stories.d.ts +48 -0
- package/dist/components/table/cellRenderers/ButtonCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/ButtonCellRenderer.stories.js +244 -0
- package/dist/components/table/cellRenderers/ButtonCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.d.ts.map +1 -1
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.js +3 -1
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.js.map +1 -1
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.d.ts +64 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.js +241 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/DefaultCellRenderer.stories.d.ts +55 -0
- package/dist/components/table/cellRenderers/DefaultCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/DefaultCellRenderer.stories.js +245 -0
- package/dist/components/table/cellRenderers/DefaultCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.d.ts +67 -0
- package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.js +221 -0
- package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.d.ts +75 -0
- package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.js +270 -0
- package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.js.map +1 -0
- package/dist/components/table/columnFilters/BooleanFilter.stories.d.ts +57 -0
- package/dist/components/table/columnFilters/BooleanFilter.stories.d.ts.map +1 -0
- package/dist/components/table/columnFilters/BooleanFilter.stories.js +198 -0
- package/dist/components/table/columnFilters/BooleanFilter.stories.js.map +1 -0
- package/dist/components/table/columnFilters/TimeFilter.stories.d.ts +58 -0
- package/dist/components/table/columnFilters/TimeFilter.stories.d.ts.map +1 -0
- package/dist/components/table/columnFilters/TimeFilter.stories.js +207 -0
- package/dist/components/table/columnFilters/TimeFilter.stories.js.map +1 -0
- package/dist/components/table/pagination/PaginationPanel.stories.d.ts +113 -0
- package/dist/components/table/pagination/PaginationPanel.stories.d.ts.map +1 -0
- package/dist/components/table/pagination/PaginationPanel.stories.js +272 -0
- package/dist/components/table/pagination/PaginationPanel.stories.js.map +1 -0
- package/dist/components/table/tableControls/HideColumnsDropdown.d.ts.map +1 -1
- package/dist/components/table/tableControls/HideColumnsDropdown.js +9 -3
- package/dist/components/table/tableControls/HideColumnsDropdown.js.map +1 -1
- package/dist/components/table/tableControls/TableControls.stories.d.ts +151 -0
- package/dist/components/table/tableControls/TableControls.stories.d.ts.map +1 -0
- package/dist/components/table/tableControls/TableControls.stories.js +356 -0
- package/dist/components/table/tableControls/TableControls.stories.js.map +1 -0
- package/dist/components/table/tableControls/TableSettingsDropdown.d.ts +27 -1
- package/dist/components/table/tableControls/TableSettingsDropdown.d.ts.map +1 -1
- package/dist/components/table/tableControls/TableSettingsDropdown.js +53 -26
- package/dist/components/table/tableControls/TableSettingsDropdown.js.map +1 -1
- package/dist/components/table/tableControls/TableSettingsDropdown.test.d.ts +2 -0
- package/dist/components/table/tableControls/TableSettingsDropdown.test.d.ts.map +1 -0
- package/dist/components/table/tableControls/TableSettingsDropdown.test.js +178 -0
- package/dist/components/table/tableControls/TableSettingsDropdown.test.js.map +1 -0
- package/dist/components/tabs/Tabs.stories.d.ts +22 -4
- package/dist/components/tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.stories.js +398 -22
- package/dist/components/tabs/Tabs.stories.js.map +1 -1
- package/dist/components/tabs/TabsItem.stories.d.ts +54 -1
- package/dist/components/tabs/TabsItem.stories.d.ts.map +1 -1
- package/dist/components/tabs/TabsItem.stories.js +61 -9
- package/dist/components/tabs/TabsItem.stories.js.map +1 -1
- package/dist/components/toast/Toast.stories.d.ts +103 -10
- package/dist/components/toast/Toast.stories.d.ts.map +1 -1
- package/dist/components/toast/Toast.stories.js +409 -47
- package/dist/components/toast/Toast.stories.js.map +1 -1
- package/dist/components/toggle/Toggle.stories.d.ts +61 -46
- package/dist/components/toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.stories.js +311 -122
- package/dist/components/toggle/Toggle.stories.js.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.d.ts +78 -6
- package/dist/components/tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.js +413 -7
- package/dist/components/tooltip/Tooltip.stories.js.map +1 -1
- package/dist/components/tooltip/TooltipWrapper.stories.d.ts +71 -7
- package/dist/components/tooltip/TooltipWrapper.stories.d.ts.map +1 -1
- package/dist/components/tooltip/TooltipWrapper.stories.js +238 -10
- package/dist/components/tooltip/TooltipWrapper.stories.js.map +1 -1
- package/dist/index.css +8 -0
- package/dist/index.css.map +1 -1
- package/dist/utils/PopupParentContext.stories.d.ts +17 -0
- package/dist/utils/PopupParentContext.stories.d.ts.map +1 -0
- package/dist/utils/PopupParentContext.stories.js +266 -0
- package/dist/utils/PopupParentContext.stories.js.map +1 -0
- package/dist/utils/getDefaultPopupParent.d.ts.map +1 -1
- package/dist/utils/getDefaultPopupParent.js +6 -0
- package/dist/utils/getDefaultPopupParent.js.map +1 -1
- package/package.json +1 -1
- package/src/components/articleCard/ArticleCard.stories.tsx +524 -111
- package/src/components/avatar/Avatar.stories.tsx +504 -59
- package/src/components/avatarGroup/AvatarGroup.stories.tsx +977 -175
- package/src/components/banner/Banner.stories.tsx +7 -3
- package/src/components/card/Card.stories.tsx +466 -36
- package/src/components/combobox/Combobox.stories.tsx +867 -260
- package/src/components/datePicker/DatePicker.stories.tsx +777 -60
- package/src/components/dateTimePicker/DateTimePicker.stories.tsx +910 -132
- package/src/components/editableText/EditableText.stories.tsx +567 -91
- package/src/components/formField/FormField.test.tsx +6 -0
- package/src/components/formField/FormField.tsx +5 -0
- package/src/components/formField/fieldset/Fieldset.stories.tsx +761 -51
- package/src/components/formField/inputs/checkbox/CheckboxGroup.tsx +1 -1
- package/src/components/formField/inputs/checkbox/CheckboxInput.tsx +1 -1
- package/src/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.tsx +504 -11
- package/src/components/formField/inputs/radio/RadioButtonGroup.tsx +17 -4
- package/src/components/formField/inputs/radio/RadioButtonInput.stories.tsx +71 -59
- package/src/components/formField/inputs/selectDropdown/SelectDropdown.stories.tsx +1079 -168
- package/src/components/formField/inputs/time/TimeInput.stories.tsx +1140 -104
- package/src/components/formField/label/Label.stories.tsx +317 -8
- package/src/components/icoText/IcoText.stories.tsx +442 -31
- package/src/components/kpiCard/KPICard.stories.tsx +475 -30
- package/src/components/kvpList/KVPList.stories.tsx +593 -26
- package/src/components/modal/Modal.stories.tsx +963 -26
- package/src/components/modal/modalManager/ModalManager.stories.tsx +612 -454
- package/src/components/pill/Pill.stories.tsx +11 -13
- package/src/components/pill/Pill.tsx +1 -0
- package/src/components/row/Row.stories.tsx +474 -58
- package/src/components/searchBar/SearchBar.stories.tsx +570 -38
- package/src/components/section/Section.stories.tsx +723 -70
- package/src/components/singleUser/SingleUser.stories.tsx +393 -34
- package/src/components/slideoverManager/SlideoverManager.stories.tsx +572 -342
- package/src/components/table/DSDefaultColDef.ts +25 -5
- package/src/components/table/Table.stories.tsx +460 -5
- package/src/components/table/Table.test.tsx +53 -0
- package/src/components/table/Table.tsx +9 -2
- package/src/components/table/TableFooter.stories.tsx +196 -0
- package/src/components/table/TableHeader.stories.tsx +251 -0
- package/src/components/table/cellEditors/DateCellEditor.stories.tsx +245 -0
- package/src/components/table/cellRenderers/BooleanCellRenderer.stories.tsx +278 -0
- package/src/components/table/cellRenderers/ButtonCellRenderer.stories.tsx +333 -0
- package/src/components/table/cellRenderers/CheckboxCellRenderer.stories.tsx +337 -0
- package/src/components/table/cellRenderers/CheckboxCellRenderer.tsx +5 -1
- package/src/components/table/cellRenderers/DefaultCellRenderer.stories.tsx +342 -0
- package/src/components/table/cellRenderers/InlineTextCellRenderer.stories.tsx +292 -0
- package/src/components/table/cellRenderers/SelectDropdownCellRenderer.stories.tsx +369 -0
- package/src/components/table/columnFilters/BooleanFilter.stories.tsx +268 -0
- package/src/components/table/columnFilters/TimeFilter.stories.tsx +281 -0
- package/src/components/table/pagination/PaginationPanel.stories.tsx +327 -0
- package/src/components/table/tableControls/HideColumnsDropdown.tsx +11 -2
- package/src/components/table/tableControls/TableControls.stories.tsx +415 -0
- package/src/components/table/tableControls/TableSettingsDropdown.test.tsx +207 -0
- package/src/components/table/tableControls/TableSettingsDropdown.tsx +103 -39
- package/src/components/tabs/Tabs.stories.tsx +540 -60
- package/src/components/tabs/TabsItem.stories.tsx +82 -8
- package/src/components/toast/Toast.stories.tsx +539 -77
- package/src/components/toggle/Toggle.stories.tsx +371 -135
- package/src/components/tooltip/Tooltip.stories.tsx +606 -15
- package/src/components/tooltip/TooltipWrapper.stories.tsx +348 -12
- package/src/docs/Contributing.mdx +241 -0
- package/src/docs/UsingComponents.mdx +93 -0
- package/src/docs/Welcome.mdx +68 -0
- package/src/global.scss +7 -0
- package/src/utils/PopupParentContext.stories.tsx +367 -0
- package/src/utils/getDefaultPopupParent.ts +6 -0
- package/.ralph/storybook-upgrade/knowledge.md +0 -308
- package/.ralph/storybook-upgrade/prd.json +0 -777
- package/.ralph/storybook-upgrade/progress.md +0 -342
- package/src/components/table/TableWIP.mdx +0 -3
|
@@ -1,132 +1,545 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import {
|
|
3
|
+
Controls,
|
|
4
|
+
Heading as DocHeading,
|
|
5
|
+
Markdown,
|
|
6
|
+
Primary as DocPrimary,
|
|
7
|
+
Stories,
|
|
8
|
+
Subtitle,
|
|
9
|
+
Title,
|
|
10
|
+
} from '@storybook/addon-docs/blocks';
|
|
2
11
|
import { fn } from 'storybook/test';
|
|
3
12
|
import { ArticleCard } from './ArticleCard';
|
|
4
13
|
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Docs page content
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
const DESCRIPTION_INTRO = [
|
|
19
|
+
'`ArticleCard` is a card variant for article and content listings. It combines an optional icon (in a left rail),',
|
|
20
|
+
'a heading, a paragraph, and an optional tag badge into a consistently-structured card.',
|
|
21
|
+
'Two interaction modes are supported: **linked** (the heading becomes a navigable `<a>`) and',
|
|
22
|
+
'**interactive shell** (the entire card is a click target via `onClick`).',
|
|
23
|
+
].join(' ');
|
|
24
|
+
|
|
25
|
+
const USAGE_GUIDANCE = [
|
|
26
|
+
'### When to use',
|
|
27
|
+
'',
|
|
28
|
+
'- Displaying a navigable item in a list or grid — a help article, report, policy document, or resource link',
|
|
29
|
+
'- When each card represents one destination and needs an icon, heading, and optional description',
|
|
30
|
+
'- Use `href` (linked mode) when navigation follows a standard URL; use `onClick` (shell mode) when navigation is programmatic',
|
|
31
|
+
'',
|
|
32
|
+
'---',
|
|
33
|
+
'',
|
|
34
|
+
'### When NOT to use',
|
|
35
|
+
'',
|
|
36
|
+
'| Situation | Use instead |',
|
|
37
|
+
'|---|---|',
|
|
38
|
+
'| Displaying a metric or statistic | [`KPICard`](?path=/docs/components-card-kpicard--docs) |',
|
|
39
|
+
'| Full control over interior layout | [`Card`](?path=/docs/components-card--docs) directly |',
|
|
40
|
+
'| Icon + text without a card shell | [`IcoText`](?path=/docs/components-icotext--docs) |',
|
|
41
|
+
'| Selecting from a list (radio/checkbox semantics) | `RadioGroup` or selection list pattern |',
|
|
42
|
+
].join('\n');
|
|
43
|
+
|
|
44
|
+
const DEVELOPER_NOTES = [
|
|
45
|
+
'### Critical usage patterns',
|
|
46
|
+
'',
|
|
47
|
+
'**Three mutually exclusive modes:**',
|
|
48
|
+
'',
|
|
49
|
+
'| Mode | When | Behaviour |',
|
|
50
|
+
'|---|---|---|',
|
|
51
|
+
'| **Linked** | `href` + `title` + `!disabled` | Title renders as `<a>` with full-card overlay |',
|
|
52
|
+
'| **Interactive shell** | `onClick` provided | Card gets `role="button"` and chevron icon |',
|
|
53
|
+
'| **Static** | Neither `href` nor `onClick` | Plain content display, no interaction |',
|
|
54
|
+
'',
|
|
55
|
+
'`href` and `onClick` are mutually exclusive — TypeScript enforces this via a discriminated union.',
|
|
56
|
+
'',
|
|
57
|
+
'**`disabled` suppresses the link in linked mode.** When `href` + `title` + `disabled=true` are all',
|
|
58
|
+
'present, no `<a>` element is rendered — the title appears as plain text. This is the most common gotcha.',
|
|
59
|
+
'',
|
|
60
|
+
'**`tagColor` without `tagText` does nothing.** The Tag only renders when `tagText` has a value.',
|
|
61
|
+
'',
|
|
62
|
+
'---',
|
|
63
|
+
'',
|
|
64
|
+
'### Accessibility',
|
|
65
|
+
'',
|
|
66
|
+
'- **Linked mode**: the `<a>` wrapping `title` is the accessible link target.',
|
|
67
|
+
' If the title text is not self-descriptive, use `aria-label` to override the accessible name.',
|
|
68
|
+
'- **Shell mode**: `aria-label` or `aria-labelledby` is required when `onClick` is provided.',
|
|
69
|
+
'- **Decorative icons**: omit `iconScreenReaderText` — the icon is `aria-hidden="true"` automatically.',
|
|
70
|
+
'',
|
|
71
|
+
'---',
|
|
72
|
+
'',
|
|
73
|
+
'### TypeScript types',
|
|
74
|
+
'',
|
|
75
|
+
'```ts',
|
|
76
|
+
"import { ArticleCard } from '@arbor-education/design-system.components';",
|
|
77
|
+
"import type { ArticleCardProps } from '@arbor-education/design-system.components';",
|
|
78
|
+
'```',
|
|
79
|
+
].join('\n');
|
|
80
|
+
|
|
81
|
+
const RELATED_COMPONENTS = [
|
|
82
|
+
'## Related components',
|
|
83
|
+
'',
|
|
84
|
+
'[Card](?path=/docs/components-card--docs) · [KPICard](?path=/docs/components-card-kpicard--docs) · [IcoText](?path=/docs/components-icotext--docs) · [Tag](?path=/docs/components-tag--docs)',
|
|
85
|
+
].join('\n');
|
|
86
|
+
|
|
87
|
+
const PROPS_INTRO = 'The preview below is wired to the **Controls** panel — tweak any prop to see the story update in real time.';
|
|
88
|
+
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// Custom DocsPage
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
|
|
93
|
+
function ArticleCardDocsPage() {
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
<Title />
|
|
97
|
+
<Subtitle />
|
|
98
|
+
<Markdown>{DESCRIPTION_INTRO}</Markdown>
|
|
99
|
+
<DocHeading>Interactive example</DocHeading>
|
|
100
|
+
<Markdown>{PROPS_INTRO}</Markdown>
|
|
101
|
+
<DocPrimary />
|
|
102
|
+
<Controls />
|
|
103
|
+
<DocHeading>Usage guidance</DocHeading>
|
|
104
|
+
<Markdown>{USAGE_GUIDANCE}</Markdown>
|
|
105
|
+
<DocHeading>Developer notes</DocHeading>
|
|
106
|
+
<Markdown>{DEVELOPER_NOTES}</Markdown>
|
|
107
|
+
<DocHeading>Examples</DocHeading>
|
|
108
|
+
<Stories title="" />
|
|
109
|
+
<Markdown>{RELATED_COMPONENTS}</Markdown>
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
// Meta
|
|
116
|
+
// ---------------------------------------------------------------------------
|
|
117
|
+
|
|
5
118
|
const meta = {
|
|
6
119
|
title: 'Components/Card/ArticleCard',
|
|
7
120
|
component: ArticleCard,
|
|
121
|
+
tags: ['autodocs'],
|
|
122
|
+
parameters: {
|
|
123
|
+
layout: 'padded',
|
|
124
|
+
docs: { page: ArticleCardDocsPage },
|
|
125
|
+
},
|
|
126
|
+
argTypes: {
|
|
127
|
+
'title': {
|
|
128
|
+
control: 'text',
|
|
129
|
+
description: 'Card heading. In linked mode (`href` provided) this becomes the `<a>` element.',
|
|
130
|
+
table: { type: { summary: 'ReactNode' } },
|
|
131
|
+
},
|
|
132
|
+
'paragraph': {
|
|
133
|
+
control: 'text',
|
|
134
|
+
description: 'Body text rendered below the heading. Accepts `ReactNode` — can include inline links.',
|
|
135
|
+
table: { type: { summary: 'ReactNode' } },
|
|
136
|
+
},
|
|
137
|
+
'icon': {
|
|
138
|
+
control: { type: 'select' },
|
|
139
|
+
options: [undefined, 'eye', 'guardians', 'date', 'book-open', 'file', 'settings', 'info', 'triangle-alert'],
|
|
140
|
+
description: 'Icon displayed in the left rail via `IcoText.Icon`. Omit for icon-free layout.',
|
|
141
|
+
table: { type: { summary: 'IconName' } },
|
|
142
|
+
},
|
|
143
|
+
'iconColor': {
|
|
144
|
+
control: 'text',
|
|
145
|
+
description: 'Colour applied to the icon. Use a CSS token, e.g. `var(--color-semantic-info-600)`.',
|
|
146
|
+
table: { type: { summary: 'string' } },
|
|
147
|
+
},
|
|
148
|
+
'iconScreenReaderText': {
|
|
149
|
+
control: 'text',
|
|
150
|
+
description: 'Accessible label for the icon. Omit for decorative icons — they become `aria-hidden` automatically.',
|
|
151
|
+
table: { type: { summary: 'string' } },
|
|
152
|
+
},
|
|
153
|
+
'tagText': {
|
|
154
|
+
control: 'text',
|
|
155
|
+
description: 'Renders a `Tag` badge. Has no effect when empty.',
|
|
156
|
+
table: { type: { summary: 'string' } },
|
|
157
|
+
},
|
|
158
|
+
'tagColor': {
|
|
159
|
+
control: { type: 'select' },
|
|
160
|
+
options: [undefined, 'neutral', 'orange', 'blue', 'green', 'purple', 'teal', 'salmon', 'yellow'],
|
|
161
|
+
description: 'Colour variant for the `Tag` badge.',
|
|
162
|
+
table: { type: { summary: "'neutral' | 'orange' | 'blue' | 'green' | 'purple' | 'teal' | 'salmon' | 'yellow'" } },
|
|
163
|
+
},
|
|
164
|
+
'disabled': {
|
|
165
|
+
control: 'boolean',
|
|
166
|
+
description: 'Disables all interaction. In linked mode, suppresses the `<a>` even when `href` is provided.',
|
|
167
|
+
table: { type: { summary: 'boolean' }, defaultValue: { summary: 'false' } },
|
|
168
|
+
},
|
|
169
|
+
'onClick': {
|
|
170
|
+
control: false,
|
|
171
|
+
description: 'Click handler. Mutually exclusive with `href`. Makes the entire card interactive (`role="button"`).',
|
|
172
|
+
table: { type: { summary: '(e: MouseEvent<HTMLElement>) => void' } },
|
|
173
|
+
},
|
|
174
|
+
'aria-label': {
|
|
175
|
+
control: 'text',
|
|
176
|
+
description: 'Accessible name. Required on interactive shell cards (when `onClick` is provided).',
|
|
177
|
+
table: { type: { summary: 'string' } },
|
|
178
|
+
},
|
|
179
|
+
'href': {
|
|
180
|
+
control: 'text',
|
|
181
|
+
description: 'URL. Mutually exclusive with `onClick`. When provided with `title` + `!disabled`, the title renders as a navigable `<a>`.',
|
|
182
|
+
table: { type: { summary: 'string' } },
|
|
183
|
+
},
|
|
184
|
+
'className': {
|
|
185
|
+
control: false,
|
|
186
|
+
description: 'Additional CSS class names on the root element.',
|
|
187
|
+
table: { type: { summary: 'string' } },
|
|
188
|
+
},
|
|
189
|
+
},
|
|
8
190
|
} satisfies Meta<typeof ArticleCard>;
|
|
9
191
|
|
|
10
|
-
|
|
192
|
+
export default meta;
|
|
193
|
+
type Story = StoryObj<typeof ArticleCard>;
|
|
11
194
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const CardWithTitleParagraphAndIcon: Story = {
|
|
24
|
-
args: {
|
|
25
|
-
'title': 'Title of Card',
|
|
26
|
-
'paragraph': 'Lorem ipsum dolor sit amet consectetur adipiscing elit.',
|
|
27
|
-
'icon': 'eye',
|
|
28
|
-
'disabled': false,
|
|
29
|
-
'onClick': fn(),
|
|
30
|
-
'onKeyDown': fn(),
|
|
31
|
-
'aria-label': 'Clickable article card with title paragraph and icon',
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const TheEverythingCard: Story = {
|
|
36
|
-
args: {
|
|
37
|
-
'title': 'Title of Card',
|
|
38
|
-
'paragraph': 'Lorem ipsum dolor sit amet consectetur adipiscing elit.',
|
|
39
|
-
'icon': 'eye',
|
|
40
|
-
'disabled': false,
|
|
41
|
-
'tagText': 'argle bargle',
|
|
42
|
-
'tagColor': 'orange',
|
|
43
|
-
'onClick': fn(),
|
|
44
|
-
'onKeyDown': fn(),
|
|
45
|
-
'aria-label': 'Clickable article card with all content',
|
|
195
|
+
// ---------------------------------------------------------------------------
|
|
196
|
+
// Helper: attach a per-story description to docs
|
|
197
|
+
// ---------------------------------------------------------------------------
|
|
198
|
+
|
|
199
|
+
const withDescription = (story: Story, description: string): Story => ({
|
|
200
|
+
...story,
|
|
201
|
+
parameters: {
|
|
202
|
+
...story.parameters,
|
|
203
|
+
docs: { ...story.parameters?.docs, description: { story: description } },
|
|
46
204
|
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
// ---------------------------------------------------------------------------
|
|
208
|
+
// Template components
|
|
209
|
+
// ---------------------------------------------------------------------------
|
|
210
|
+
|
|
211
|
+
const LinkedDisabledTemplate = () => (
|
|
212
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--spacing-large)', maxWidth: '400px' }}>
|
|
213
|
+
<div>
|
|
214
|
+
<p className="ds-text" style={{ margin: '0 0 var(--spacing-small)', color: 'var(--color-grey-600)' }}>
|
|
215
|
+
Enabled — title renders as a link
|
|
216
|
+
</p>
|
|
217
|
+
<ArticleCard
|
|
218
|
+
href="/reports/attendance"
|
|
219
|
+
title="Autumn term attendance report"
|
|
220
|
+
paragraph="Published 14 Nov 2024 · Available to all staff"
|
|
221
|
+
icon="file"
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
224
|
+
<div>
|
|
225
|
+
<p className="ds-text" style={{ margin: '0 0 var(--spacing-small)', color: 'var(--color-grey-600)' }}>
|
|
226
|
+
Disabled — link suppressed, title renders as plain text
|
|
227
|
+
</p>
|
|
228
|
+
<ArticleCard
|
|
229
|
+
href="/reports/attendance"
|
|
230
|
+
title="Autumn term attendance report"
|
|
231
|
+
paragraph="This report is not yet available."
|
|
232
|
+
icon="file"
|
|
233
|
+
disabled
|
|
234
|
+
/>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
// ---------------------------------------------------------------------------
|
|
240
|
+
// Stories
|
|
241
|
+
// ---------------------------------------------------------------------------
|
|
242
|
+
|
|
243
|
+
export const Default: Story = withDescription(
|
|
244
|
+
{
|
|
245
|
+
args: {
|
|
246
|
+
'title': 'Attendance overview',
|
|
247
|
+
'paragraph': 'View pupil attendance rates, trends, and intervention records for this academic year.',
|
|
248
|
+
'icon': 'guardians',
|
|
249
|
+
'disabled': false,
|
|
250
|
+
'onClick': fn(),
|
|
251
|
+
'aria-label': 'Attendance overview',
|
|
252
|
+
},
|
|
253
|
+
render: args => (
|
|
254
|
+
<div style={{ maxWidth: '400px' }}>
|
|
255
|
+
<ArticleCard {...args} />
|
|
256
|
+
</div>
|
|
257
|
+
),
|
|
59
258
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
259
|
+
'Interactive shell mode — `onClick` is provided so the whole card is a click target with `role="button"`. Toggle `disabled` in the Controls panel to see the dimmed state.',
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
export const Static: Story = withDescription(
|
|
263
|
+
{
|
|
264
|
+
parameters: {
|
|
265
|
+
controls: { disable: true },
|
|
266
|
+
docs: {
|
|
267
|
+
source: {
|
|
268
|
+
language: 'tsx',
|
|
269
|
+
code: `
|
|
270
|
+
import { ArticleCard } from '@arbor-education/design-system.components';
|
|
271
|
+
|
|
272
|
+
function StaticArticleCardExample() {
|
|
273
|
+
return (
|
|
274
|
+
<ArticleCard
|
|
275
|
+
title="Attendance overview"
|
|
276
|
+
paragraph="View pupil attendance rates and trends for this academic year."
|
|
277
|
+
icon="guardians"
|
|
278
|
+
/>
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
export default StaticArticleCardExample;
|
|
282
|
+
`.trim(),
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
render: () => (
|
|
287
|
+
<div style={{ maxWidth: '400px' }}>
|
|
288
|
+
<ArticleCard
|
|
289
|
+
title="Attendance overview"
|
|
290
|
+
paragraph="View pupil attendance rates and trends for this academic year."
|
|
291
|
+
icon="guardians"
|
|
292
|
+
/>
|
|
293
|
+
</div>
|
|
294
|
+
),
|
|
70
295
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
296
|
+
'Static mode — no `href`, no `onClick`. The card renders as a plain surface with no role, no tab stop, and no chevron icon.',
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
export const WithTag: Story = withDescription(
|
|
300
|
+
{
|
|
301
|
+
parameters: {
|
|
302
|
+
controls: { disable: true },
|
|
303
|
+
docs: {
|
|
304
|
+
source: {
|
|
305
|
+
language: 'tsx',
|
|
306
|
+
code: `
|
|
307
|
+
import { ArticleCard } from '@arbor-education/design-system.components';
|
|
308
|
+
|
|
309
|
+
function WithTagExample() {
|
|
310
|
+
return (
|
|
311
|
+
<ArticleCard
|
|
312
|
+
title="Safeguarding policy"
|
|
313
|
+
paragraph="Updated September 2024 — mandatory reading for all staff."
|
|
314
|
+
icon="book-open"
|
|
315
|
+
tagText="Required"
|
|
316
|
+
tagColor="orange"
|
|
317
|
+
/>
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
export default WithTagExample;
|
|
321
|
+
`.trim(),
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
render: () => (
|
|
326
|
+
<div style={{ maxWidth: '400px' }}>
|
|
327
|
+
<ArticleCard
|
|
328
|
+
title="Safeguarding policy"
|
|
329
|
+
paragraph="Updated September 2024 — mandatory reading for all staff."
|
|
330
|
+
icon="book-open"
|
|
331
|
+
tagText="Required"
|
|
332
|
+
tagColor="orange"
|
|
333
|
+
/>
|
|
334
|
+
</div>
|
|
335
|
+
),
|
|
80
336
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
337
|
+
'Adding `tagText` and `tagColor` renders a `Tag` badge. Use tags for status, category, or priority labels — e.g. "Required", "New", "Featured".',
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
export const FullComposition: Story = withDescription(
|
|
341
|
+
{
|
|
342
|
+
parameters: {
|
|
343
|
+
controls: { disable: true },
|
|
344
|
+
docs: {
|
|
345
|
+
source: {
|
|
346
|
+
language: 'tsx',
|
|
347
|
+
code: `
|
|
348
|
+
import { ArticleCard } from '@arbor-education/design-system.components';
|
|
349
|
+
|
|
350
|
+
function FullCompositionExample() {
|
|
351
|
+
return (
|
|
352
|
+
<ArticleCard
|
|
353
|
+
title="Spring term behaviour report"
|
|
354
|
+
paragraph="Incident trends, intervention outcomes, and recommendations for Year 10."
|
|
355
|
+
icon="triangle-alert"
|
|
356
|
+
iconColor="var(--color-semantic-warning-600)"
|
|
357
|
+
tagText="Pending review"
|
|
358
|
+
tagColor="yellow"
|
|
359
|
+
onClick={() => console.log('navigate to report')}
|
|
360
|
+
aria-label="Spring term behaviour report"
|
|
361
|
+
/>
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
export default FullCompositionExample;
|
|
365
|
+
`.trim(),
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
render: () => (
|
|
370
|
+
<div style={{ maxWidth: '400px' }}>
|
|
371
|
+
<ArticleCard
|
|
372
|
+
title="Spring term behaviour report"
|
|
373
|
+
paragraph="Incident trends, intervention outcomes, and recommendations for Year 10."
|
|
374
|
+
icon="triangle-alert"
|
|
375
|
+
iconColor="var(--color-semantic-warning-600)"
|
|
376
|
+
tagText="Pending review"
|
|
377
|
+
tagColor="yellow"
|
|
378
|
+
onClick={fn()}
|
|
379
|
+
aria-label="Spring term behaviour report"
|
|
380
|
+
/>
|
|
381
|
+
</div>
|
|
382
|
+
),
|
|
94
383
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
384
|
+
'All content props combined — icon + iconColor + title + paragraph + tag + interactive shell. This is the richest production pattern.',
|
|
385
|
+
);
|
|
386
|
+
|
|
387
|
+
export const LinkedMode: Story = withDescription(
|
|
388
|
+
{
|
|
389
|
+
parameters: {
|
|
390
|
+
controls: { disable: true },
|
|
391
|
+
docs: {
|
|
392
|
+
source: {
|
|
393
|
+
language: 'tsx',
|
|
394
|
+
code: `
|
|
395
|
+
import { ArticleCard } from '@arbor-education/design-system.components';
|
|
396
|
+
|
|
397
|
+
function LinkedModeExample() {
|
|
398
|
+
return (
|
|
399
|
+
<ArticleCard
|
|
400
|
+
href="/policies/attendance"
|
|
401
|
+
title="Attendance policy"
|
|
402
|
+
paragraph="School attendance policy for 2024/25 — includes statutory guidance and thresholds."
|
|
403
|
+
icon="book-open"
|
|
404
|
+
tagText="Policy"
|
|
405
|
+
tagColor="blue"
|
|
406
|
+
/>
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
export default LinkedModeExample;
|
|
410
|
+
`.trim(),
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
render: () => (
|
|
415
|
+
<div style={{ maxWidth: '400px' }}>
|
|
416
|
+
<ArticleCard
|
|
417
|
+
href="/policies/attendance"
|
|
418
|
+
title="Attendance policy"
|
|
419
|
+
paragraph="School attendance policy for 2024/25 — includes statutory guidance and thresholds."
|
|
420
|
+
icon="book-open"
|
|
421
|
+
tagText="Policy"
|
|
422
|
+
tagColor="blue"
|
|
423
|
+
/>
|
|
424
|
+
</div>
|
|
425
|
+
),
|
|
104
426
|
},
|
|
105
|
-
|
|
427
|
+
'Linked mode — `href` + `title` present. The heading renders as `<a href>` with a CSS `::after` overlay making the whole card surface clickable. The card shell has no `role="button"`.',
|
|
428
|
+
);
|
|
429
|
+
|
|
430
|
+
export const InteractiveShell: Story = withDescription(
|
|
431
|
+
{
|
|
432
|
+
parameters: {
|
|
433
|
+
controls: { disable: true },
|
|
434
|
+
docs: {
|
|
435
|
+
source: {
|
|
436
|
+
language: 'tsx',
|
|
437
|
+
code: `
|
|
438
|
+
import { ArticleCard } from '@arbor-education/design-system.components';
|
|
106
439
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
440
|
+
function InteractiveShellExample() {
|
|
441
|
+
return (
|
|
442
|
+
<ArticleCard
|
|
443
|
+
onClick={() => console.log('card clicked')}
|
|
444
|
+
aria-label="Year 10 progress report"
|
|
445
|
+
title="Year 10 progress report"
|
|
446
|
+
paragraph="Mid-year review — targets, attainment, and next steps."
|
|
447
|
+
icon="eye"
|
|
448
|
+
/>
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
export default InteractiveShellExample;
|
|
452
|
+
`.trim(),
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
render: () => (
|
|
457
|
+
<div style={{ maxWidth: '400px' }}>
|
|
458
|
+
<ArticleCard
|
|
459
|
+
onClick={fn()}
|
|
460
|
+
aria-label="Year 10 progress report"
|
|
461
|
+
title="Year 10 progress report"
|
|
462
|
+
paragraph="Mid-year review — targets, attainment, and next steps."
|
|
463
|
+
icon="eye"
|
|
464
|
+
/>
|
|
465
|
+
</div>
|
|
466
|
+
),
|
|
111
467
|
},
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
468
|
+
'Interactive shell mode — `onClick` provided. The whole card gets `role="button"` and `tabIndex={0}`. Use when navigation is programmatic (e.g. React Router `navigate`) rather than a standard URL.',
|
|
469
|
+
);
|
|
470
|
+
|
|
471
|
+
export const Disabled: Story = withDescription(
|
|
472
|
+
{
|
|
473
|
+
parameters: {
|
|
474
|
+
controls: { disable: true },
|
|
475
|
+
docs: {
|
|
476
|
+
source: {
|
|
477
|
+
language: 'tsx',
|
|
478
|
+
code: `
|
|
479
|
+
import { ArticleCard } from '@arbor-education/design-system.components';
|
|
480
|
+
|
|
481
|
+
function DisabledExample() {
|
|
482
|
+
return (
|
|
483
|
+
<ArticleCard
|
|
484
|
+
onClick={() => {}}
|
|
485
|
+
aria-label="Summer term report — not yet available"
|
|
486
|
+
title="Summer term report"
|
|
487
|
+
paragraph="This report will be available at the end of term."
|
|
488
|
+
icon="file"
|
|
489
|
+
disabled
|
|
490
|
+
/>
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
export default DisabledExample;
|
|
494
|
+
`.trim(),
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
render: () => (
|
|
499
|
+
<div style={{ maxWidth: '400px' }}>
|
|
500
|
+
<ArticleCard
|
|
501
|
+
onClick={fn()}
|
|
502
|
+
aria-label="Summer term report — not yet available"
|
|
503
|
+
title="Summer term report"
|
|
504
|
+
paragraph="This report will be available at the end of term."
|
|
505
|
+
icon="file"
|
|
506
|
+
disabled
|
|
507
|
+
/>
|
|
508
|
+
</div>
|
|
125
509
|
),
|
|
126
|
-
icon: 'eye',
|
|
127
|
-
tagText: 'Featured',
|
|
128
|
-
tagColor: 'green',
|
|
129
510
|
},
|
|
130
|
-
|
|
511
|
+
'`disabled=true` dims the card and suppresses all interaction. In interactive shell mode, `onClick` does not fire. The card is removed from the tab order.',
|
|
512
|
+
);
|
|
131
513
|
|
|
132
|
-
export
|
|
514
|
+
export const LinkedDisabled: Story = withDescription(
|
|
515
|
+
{
|
|
516
|
+
parameters: {
|
|
517
|
+
controls: { disable: true },
|
|
518
|
+
docs: {
|
|
519
|
+
source: {
|
|
520
|
+
language: 'tsx',
|
|
521
|
+
code: `
|
|
522
|
+
import { ArticleCard } from '@arbor-education/design-system.components';
|
|
523
|
+
|
|
524
|
+
function LinkedDisabledExample() {
|
|
525
|
+
// When disabled=true, hasPrimaryLink becomes false — no <a> is rendered.
|
|
526
|
+
// The title appears as plain text even though href is provided.
|
|
527
|
+
return (
|
|
528
|
+
<ArticleCard
|
|
529
|
+
href="/reports/attendance"
|
|
530
|
+
title="Autumn term attendance report"
|
|
531
|
+
paragraph="This report is not yet available."
|
|
532
|
+
icon="file"
|
|
533
|
+
disabled
|
|
534
|
+
/>
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
export default LinkedDisabledExample;
|
|
538
|
+
`.trim(),
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
render: LinkedDisabledTemplate,
|
|
543
|
+
},
|
|
544
|
+
'**The most common gotcha.** When `disabled={true}` is combined with `href`, the primary link is suppressed — no `<a>` element is rendered. The title appears as plain text. The story shows enabled vs disabled side-by-side — inspect the DOM to confirm.',
|
|
545
|
+
);
|