@arbor-education/design-system.components 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gather/skills/write-stories/SKILL.md +207 -271
- package/.storybook/preview.ts +5 -0
- package/CHANGELOG.md +27 -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/number/NumberInput.d.ts.map +1 -1
- package/dist/components/formField/inputs/number/NumberInput.js +14 -2
- package/dist/components/formField/inputs/number/NumberInput.js.map +1 -1
- package/dist/components/formField/inputs/number/NumberInput.test.js +21 -0
- package/dist/components/formField/inputs/number/NumberInput.test.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 +7 -1
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/Table.js +12 -5
- 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 +445 -3
- package/dist/components/table/Table.stories.js.map +1 -1
- package/dist/components/table/Table.test.js +184 -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/cellEditors/NumberCellEditor.d.ts +13 -0
- package/dist/components/table/cellEditors/NumberCellEditor.d.ts.map +1 -0
- package/dist/components/table/cellEditors/NumberCellEditor.js +35 -0
- package/dist/components/table/cellEditors/NumberCellEditor.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/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 +27 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.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/number/NumberInput.test.tsx +28 -0
- package/src/components/formField/inputs/number/NumberInput.tsx +15 -0
- 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 +504 -3
- package/src/components/table/Table.test.tsx +255 -0
- package/src/components/table/Table.tsx +15 -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/cellEditors/NumberCellEditor.tsx +83 -0
- package/src/components/table/cellEditors/numberCellEditor.scss +11 -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/table.scss +11 -0
- 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/index.scss +1 -0
- package/src/index.ts +3 -2
- 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,47 +1,492 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import {
|
|
3
|
-
|
|
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';
|
|
11
|
+
import { fn } from 'storybook/test';
|
|
4
12
|
import { KPICard } from './KPICard';
|
|
13
|
+
import { Progress } from 'Components/progress/Progress';
|
|
14
|
+
import { KVPList } from 'Components/kvpList/KVPList';
|
|
15
|
+
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Docs page content
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
const DESCRIPTION_INTRO = [
|
|
21
|
+
'`KPICard` is a compact metric tile that surfaces a single key-performance indicator — a labelled value,',
|
|
22
|
+
'optionally expressed as a percentage, optionally followed by supplementary content.',
|
|
23
|
+
'It is built on `Card` with `spacing="dense"` and supports the same static/interactive modes.',
|
|
24
|
+
].join(' ');
|
|
25
|
+
|
|
26
|
+
const USAGE_GUIDANCE = [
|
|
27
|
+
'### When to use',
|
|
28
|
+
'',
|
|
29
|
+
'- Displaying a single headline figure — total pupils, attendance rate, behaviour incidents',
|
|
30
|
+
'- Dashboard or summary views where multiple KPIs sit side-by-side in a grid',
|
|
31
|
+
'- When the metric is navigational (click to drill down) — use the interactive variant with `onClick`',
|
|
32
|
+
'',
|
|
33
|
+
'---',
|
|
34
|
+
'',
|
|
35
|
+
'### When NOT to use',
|
|
36
|
+
'',
|
|
37
|
+
'| Situation | Use instead |',
|
|
38
|
+
'|---|---|',
|
|
39
|
+
'| Multiple related key–value pairs | [`KVPList`](?path=/docs/components-kvplist--docs) |',
|
|
40
|
+
'| Rich content card with text + image | [`ArticleCard`](?path=/docs/components-card-articlecard--docs) |',
|
|
41
|
+
'| Non-metric summary block | [`Card`](?path=/docs/components-card--docs) |',
|
|
42
|
+
'| A long label or multi-line value | `Card` with custom content |',
|
|
43
|
+
].join('\n');
|
|
44
|
+
|
|
45
|
+
const DEVELOPER_NOTES = [
|
|
46
|
+
'### Critical usage patterns',
|
|
47
|
+
'',
|
|
48
|
+
'**`label` and `value` are required** — omitting either will produce a broken layout.',
|
|
49
|
+
'Both accept `ReactNode`, so you can render formatted numbers, icons, or short JSX.',
|
|
50
|
+
'',
|
|
51
|
+
'```tsx',
|
|
52
|
+
'<KPICard label="Total pupils" value={247} />',
|
|
53
|
+
'```',
|
|
54
|
+
'',
|
|
55
|
+
'**Interactive KPICards require an accessible name.**',
|
|
56
|
+
'When `onClick` is provided, the underlying `Card` requires either `aria-label` or `aria-labelledby`.',
|
|
57
|
+
'The component throws in development and logs a console error in production if neither is supplied.',
|
|
58
|
+
'',
|
|
59
|
+
'```tsx',
|
|
60
|
+
'// ✅ Correct',
|
|
61
|
+
'<KPICard',
|
|
62
|
+
' label="Attendance"',
|
|
63
|
+
' value={94.2}',
|
|
64
|
+
' isPercentage',
|
|
65
|
+
' onClick={handleClick}',
|
|
66
|
+
' aria-label="View attendance details"',
|
|
67
|
+
'/>',
|
|
68
|
+
'',
|
|
69
|
+
'// ❌ Missing accessible name — throws in dev',
|
|
70
|
+
'<KPICard label="Attendance" value={94.2} onClick={handleClick} />',
|
|
71
|
+
'```',
|
|
72
|
+
'',
|
|
73
|
+
'**`isPercentage` appends `%` to the DOM via a `<span>`.** Do not include `%` in the `value` prop — it will be doubled.',
|
|
74
|
+
'',
|
|
75
|
+
'**`children` renders below the value row**, spanning the full card width.',
|
|
76
|
+
'Use it for trend indicators, progress bars, or supplementary `KVPList` data.',
|
|
77
|
+
'',
|
|
78
|
+
'**`disabled` only has effect when `onClick` is provided.**',
|
|
79
|
+
'Passing `disabled` to a static `KPICard` (no `onClick`) is a no-op.',
|
|
80
|
+
'',
|
|
81
|
+
'---',
|
|
82
|
+
'',
|
|
83
|
+
'### Accessibility',
|
|
84
|
+
'',
|
|
85
|
+
'- Interactive cards receive `role="button"` and `tabIndex={0}` via the underlying `Card`',
|
|
86
|
+
'- Enter and Space trigger the `onClick` handler',
|
|
87
|
+
'- `aria-label` or `aria-labelledby` is **required** on interactive cards',
|
|
88
|
+
'- `aria-disabled={true}` is set on disabled interactive cards',
|
|
89
|
+
'',
|
|
90
|
+
'---',
|
|
91
|
+
'',
|
|
92
|
+
'### TypeScript types',
|
|
93
|
+
'',
|
|
94
|
+
'```ts',
|
|
95
|
+
"import { KPICard } from '@arbor-education/design-system.components';",
|
|
96
|
+
"import type { KPICardProps } from '@arbor-education/design-system.components';",
|
|
97
|
+
'```',
|
|
98
|
+
].join('\n');
|
|
99
|
+
|
|
100
|
+
const RELATED_COMPONENTS = [
|
|
101
|
+
'## Related components',
|
|
102
|
+
'',
|
|
103
|
+
'[Card](?path=/docs/components-card--docs) · [ArticleCard](?path=/docs/components-card-articlecard--docs) · [KVPList](?path=/docs/components-kvplist--docs) · [Progress](?path=/docs/components-progress--docs)',
|
|
104
|
+
].join('\n');
|
|
105
|
+
|
|
106
|
+
const PROPS_INTRO = 'The preview below is wired to the **Controls** panel — tweak `label`, `value`, `isPercentage`, or `disabled` to see the card update in real time.';
|
|
107
|
+
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
// Custom DocsPage
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
|
|
112
|
+
function KPICardDocsPage() {
|
|
113
|
+
return (
|
|
114
|
+
<>
|
|
115
|
+
<Title />
|
|
116
|
+
<Subtitle />
|
|
117
|
+
<Markdown>{DESCRIPTION_INTRO}</Markdown>
|
|
118
|
+
<DocHeading>Interactive example</DocHeading>
|
|
119
|
+
<Markdown>{PROPS_INTRO}</Markdown>
|
|
120
|
+
<DocPrimary />
|
|
121
|
+
<Controls />
|
|
122
|
+
<DocHeading>Usage guidance</DocHeading>
|
|
123
|
+
<Markdown>{USAGE_GUIDANCE}</Markdown>
|
|
124
|
+
<DocHeading>Developer notes</DocHeading>
|
|
125
|
+
<Markdown>{DEVELOPER_NOTES}</Markdown>
|
|
126
|
+
<DocHeading>Examples</DocHeading>
|
|
127
|
+
<Stories title="" />
|
|
128
|
+
<Markdown>{RELATED_COMPONENTS}</Markdown>
|
|
129
|
+
</>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
// Meta
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
5
136
|
|
|
6
137
|
const meta = {
|
|
7
138
|
title: 'Components/Card/KPICard',
|
|
8
139
|
component: KPICard,
|
|
140
|
+
tags: ['autodocs'],
|
|
141
|
+
parameters: {
|
|
142
|
+
layout: 'padded',
|
|
143
|
+
docs: { page: KPICardDocsPage },
|
|
144
|
+
},
|
|
145
|
+
argTypes: {
|
|
146
|
+
'label': {
|
|
147
|
+
control: 'text',
|
|
148
|
+
description: '**Required.** The metric label rendered above the value.',
|
|
149
|
+
table: {
|
|
150
|
+
type: { summary: 'ReactNode' },
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
'value': {
|
|
154
|
+
control: 'text',
|
|
155
|
+
description: '**Required.** The headline metric value. Do not include `%` — use `isPercentage` instead.',
|
|
156
|
+
table: {
|
|
157
|
+
type: { summary: 'ReactNode' },
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
'isPercentage': {
|
|
161
|
+
control: 'boolean',
|
|
162
|
+
description: 'Appends a `%` suffix (`<span class="ds-kpi-card__suffix">`) after the value. Do NOT include `%` in the `value` prop.',
|
|
163
|
+
table: {
|
|
164
|
+
type: { summary: 'boolean' },
|
|
165
|
+
defaultValue: { summary: 'false' },
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
'disabled': {
|
|
169
|
+
control: 'boolean',
|
|
170
|
+
description: 'Disables an interactive card — sets `aria-disabled={true}` and suppresses click/keyboard handling. Has no effect on static cards (no `onClick`).',
|
|
171
|
+
table: {
|
|
172
|
+
type: { summary: 'boolean' },
|
|
173
|
+
defaultValue: { summary: 'false' },
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
'onClick': {
|
|
177
|
+
control: false,
|
|
178
|
+
description: [
|
|
179
|
+
'Click handler. Providing this switches the card to **interactive mode** — it gains `role="button"`,',
|
|
180
|
+
'`tabIndex={0}`, and a chevron/arrow icon. Requires `aria-label` or `aria-labelledby`.',
|
|
181
|
+
].join(' '),
|
|
182
|
+
table: {
|
|
183
|
+
type: { summary: '(e: MouseEvent<HTMLElement>) => void' },
|
|
184
|
+
defaultValue: { summary: 'undefined' },
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
'aria-label': {
|
|
188
|
+
control: 'text',
|
|
189
|
+
description: '**Required on interactive cards** (unless `aria-labelledby` is provided). Accessible name announced by screen readers.',
|
|
190
|
+
table: {
|
|
191
|
+
type: { summary: 'string' },
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
'children': {
|
|
195
|
+
control: false,
|
|
196
|
+
description: 'Optional content rendered below the value row — use for progress bars, trend indicators, or supplementary `KVPList` data.',
|
|
197
|
+
table: {
|
|
198
|
+
type: { summary: 'ReactNode' },
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
'className': {
|
|
202
|
+
control: false,
|
|
203
|
+
description: 'Additional CSS class names on the root element.',
|
|
204
|
+
table: {
|
|
205
|
+
type: { summary: 'string' },
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
},
|
|
9
209
|
} satisfies Meta<typeof KPICard>;
|
|
10
210
|
|
|
11
|
-
|
|
211
|
+
export default meta;
|
|
212
|
+
type Story = StoryObj<typeof KPICard>;
|
|
213
|
+
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
// Helper: attach a per-story description to docs
|
|
216
|
+
// ---------------------------------------------------------------------------
|
|
12
217
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
218
|
+
const withDescription = (story: Story, description: string): Story => ({
|
|
219
|
+
...story,
|
|
220
|
+
parameters: {
|
|
221
|
+
...story.parameters,
|
|
222
|
+
docs: { ...story.parameters?.docs, description: { story: description } },
|
|
18
223
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// ---------------------------------------------------------------------------
|
|
227
|
+
// Template components
|
|
228
|
+
// ---------------------------------------------------------------------------
|
|
229
|
+
|
|
230
|
+
const WithChildrenTemplate = () => (
|
|
231
|
+
<div style={{ maxWidth: '320px' }}>
|
|
232
|
+
<KPICard label="Attendance rate" value={94.2} isPercentage>
|
|
233
|
+
<KVPList>
|
|
234
|
+
<KVPList.Row>
|
|
235
|
+
<KVPList.Term>This week</KVPList.Term>
|
|
236
|
+
<KVPList.Definition>96.1%</KVPList.Definition>
|
|
237
|
+
</KVPList.Row>
|
|
238
|
+
<KVPList.Row>
|
|
239
|
+
<KVPList.Term>Last week</KVPList.Term>
|
|
240
|
+
<KVPList.Definition>92.3%</KVPList.Definition>
|
|
25
241
|
</KVPList.Row>
|
|
26
242
|
</KVPList>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
243
|
+
</KPICard>
|
|
244
|
+
</div>
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
const WithProgressTemplate = () => (
|
|
248
|
+
<div style={{ maxWidth: '320px' }}>
|
|
249
|
+
<KPICard label="Attendance rate" value={94.2} isPercentage>
|
|
250
|
+
<div style={{ marginTop: 'var(--spacing-small)' }}>
|
|
251
|
+
<Progress value={94.2} max={100} />
|
|
252
|
+
</div>
|
|
253
|
+
</KPICard>
|
|
254
|
+
</div>
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
const MultipleCardsTemplate = () => (
|
|
258
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 'var(--spacing-medium)' }}>
|
|
259
|
+
<KPICard label="Total pupils" value={247} />
|
|
260
|
+
<KPICard label="Attendance rate" value={94.2} isPercentage />
|
|
261
|
+
<KPICard label="Behaviour incidents" value={3} />
|
|
262
|
+
<KPICard label="Staff present" value={38} />
|
|
263
|
+
<KPICard label="Pupils on report" value={12} />
|
|
264
|
+
<KPICard label="Average mark" value={78} isPercentage />
|
|
265
|
+
</div>
|
|
266
|
+
);
|
|
267
|
+
|
|
268
|
+
// ---------------------------------------------------------------------------
|
|
269
|
+
// Stories
|
|
270
|
+
// ---------------------------------------------------------------------------
|
|
271
|
+
|
|
272
|
+
export const Default: Story = withDescription(
|
|
273
|
+
{
|
|
274
|
+
args: {
|
|
275
|
+
label: 'Total pupils',
|
|
276
|
+
value: 247,
|
|
277
|
+
isPercentage: false,
|
|
278
|
+
disabled: false,
|
|
279
|
+
},
|
|
280
|
+
render: args => (
|
|
281
|
+
<div style={{ maxWidth: '320px' }}>
|
|
282
|
+
<KPICard {...args} />
|
|
283
|
+
</div>
|
|
284
|
+
),
|
|
285
|
+
},
|
|
286
|
+
'The base KPICard — `label` and `value` are the only required props. Toggle `isPercentage` or `disabled` in **Controls**, or change the `label` and `value` text.',
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
export const AsPercentage: Story = withDescription(
|
|
290
|
+
{
|
|
291
|
+
parameters: {
|
|
292
|
+
controls: { disable: true },
|
|
293
|
+
docs: {
|
|
294
|
+
source: {
|
|
295
|
+
language: 'tsx',
|
|
296
|
+
code: `
|
|
297
|
+
import { KPICard } from '@arbor-education/design-system.components';
|
|
298
|
+
|
|
299
|
+
function AsPercentageExample() {
|
|
300
|
+
return (
|
|
301
|
+
<KPICard
|
|
302
|
+
label="Attendance rate"
|
|
303
|
+
value={94.2}
|
|
304
|
+
isPercentage
|
|
305
|
+
/>
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
export default AsPercentageExample;
|
|
309
|
+
`.trim(),
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
render: () => (
|
|
314
|
+
<div style={{ maxWidth: '320px' }}>
|
|
315
|
+
<KPICard label="Attendance rate" value={94.2} isPercentage />
|
|
316
|
+
</div>
|
|
317
|
+
),
|
|
318
|
+
},
|
|
319
|
+
'`isPercentage` appends a `%` suffix to the value. The `%` is rendered in a separate `<span>` — do NOT include it in the `value` prop or it will appear twice.',
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
export const WithChildren: Story = withDescription(
|
|
323
|
+
{
|
|
324
|
+
parameters: {
|
|
325
|
+
controls: { disable: true },
|
|
326
|
+
docs: {
|
|
327
|
+
source: {
|
|
328
|
+
language: 'tsx',
|
|
329
|
+
code: `
|
|
330
|
+
import { KPICard, KVPList } from '@arbor-education/design-system.components';
|
|
331
|
+
|
|
332
|
+
function WithChildrenExample() {
|
|
333
|
+
return (
|
|
334
|
+
<KPICard label="Attendance rate" value={94.2} isPercentage>
|
|
335
|
+
<KVPList>
|
|
336
|
+
<KVPList.Row>
|
|
337
|
+
<KVPList.Term>This week</KVPList.Term>
|
|
338
|
+
<KVPList.Definition>96.1%</KVPList.Definition>
|
|
34
339
|
</KVPList.Row>
|
|
35
|
-
<KVPList.Row
|
|
36
|
-
<KVPList.Term>
|
|
37
|
-
<KVPList.Definition
|
|
38
|
-
<KVPList.Definition aria-hidden="true" isRow>
|
|
39
|
-
<Progress aria-label="Progress bar second" max={100} value={95} />
|
|
40
|
-
</KVPList.Definition>
|
|
340
|
+
<KVPList.Row>
|
|
341
|
+
<KVPList.Term>Last week</KVPList.Term>
|
|
342
|
+
<KVPList.Definition>92.3%</KVPList.Definition>
|
|
41
343
|
</KVPList.Row>
|
|
42
344
|
</KVPList>
|
|
43
345
|
</KPICard>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
export default WithChildrenExample;
|
|
349
|
+
`.trim(),
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
render: WithChildrenTemplate,
|
|
354
|
+
},
|
|
355
|
+
'`children` renders below the value row, spanning the full card width. Use it for trend breakdowns (`KVPList`), progress bars, or any supplementary metric context.',
|
|
356
|
+
);
|
|
46
357
|
|
|
47
|
-
export
|
|
358
|
+
export const WithProgressBar: Story = withDescription(
|
|
359
|
+
{
|
|
360
|
+
parameters: {
|
|
361
|
+
controls: { disable: true },
|
|
362
|
+
docs: {
|
|
363
|
+
source: {
|
|
364
|
+
language: 'tsx',
|
|
365
|
+
code: `
|
|
366
|
+
import { KPICard, Progress } from '@arbor-education/design-system.components';
|
|
367
|
+
|
|
368
|
+
function WithProgressBarExample() {
|
|
369
|
+
return (
|
|
370
|
+
<KPICard label="Attendance rate" value={94.2} isPercentage>
|
|
371
|
+
<Progress value={94.2} max={100} />
|
|
372
|
+
</KPICard>
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
export default WithProgressBarExample;
|
|
376
|
+
`.trim(),
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
render: WithProgressTemplate,
|
|
381
|
+
},
|
|
382
|
+
'A `Progress` bar in `children` provides an at-a-glance visual indicator alongside the percentage value.',
|
|
383
|
+
);
|
|
384
|
+
|
|
385
|
+
export const Interactive: Story = withDescription(
|
|
386
|
+
{
|
|
387
|
+
parameters: {
|
|
388
|
+
controls: { disable: true },
|
|
389
|
+
docs: {
|
|
390
|
+
source: {
|
|
391
|
+
language: 'tsx',
|
|
392
|
+
code: `
|
|
393
|
+
import { KPICard } from '@arbor-education/design-system.components';
|
|
394
|
+
|
|
395
|
+
function InteractiveExample() {
|
|
396
|
+
return (
|
|
397
|
+
<KPICard
|
|
398
|
+
label="Total pupils"
|
|
399
|
+
value={247}
|
|
400
|
+
onClick={() => console.log('navigate to pupils list')}
|
|
401
|
+
aria-label="View all pupils"
|
|
402
|
+
/>
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
export default InteractiveExample;
|
|
406
|
+
`.trim(),
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
render: () => (
|
|
411
|
+
<div style={{ maxWidth: '320px' }}>
|
|
412
|
+
<KPICard
|
|
413
|
+
label="Total pupils"
|
|
414
|
+
value={247}
|
|
415
|
+
onClick={fn()}
|
|
416
|
+
aria-label="View all pupils"
|
|
417
|
+
/>
|
|
418
|
+
</div>
|
|
419
|
+
),
|
|
420
|
+
},
|
|
421
|
+
'With `onClick`, the card becomes interactive — `role="button"`, `tabIndex={0}`, and a chevron/arrow icon appear. `aria-label` is required and must describe the navigation destination.',
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
export const Disabled: Story = withDescription(
|
|
425
|
+
{
|
|
426
|
+
parameters: {
|
|
427
|
+
controls: { disable: true },
|
|
428
|
+
docs: {
|
|
429
|
+
source: {
|
|
430
|
+
language: 'tsx',
|
|
431
|
+
code: `
|
|
432
|
+
import { KPICard } from '@arbor-education/design-system.components';
|
|
433
|
+
|
|
434
|
+
function DisabledExample() {
|
|
435
|
+
return (
|
|
436
|
+
<KPICard
|
|
437
|
+
label="Behaviour incidents"
|
|
438
|
+
value={3}
|
|
439
|
+
onClick={() => console.log('never fires')}
|
|
440
|
+
aria-label="View behaviour incidents"
|
|
441
|
+
disabled
|
|
442
|
+
/>
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
export default DisabledExample;
|
|
446
|
+
`.trim(),
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
render: () => (
|
|
451
|
+
<div style={{ maxWidth: '320px' }}>
|
|
452
|
+
<KPICard
|
|
453
|
+
label="Behaviour incidents"
|
|
454
|
+
value={3}
|
|
455
|
+
onClick={fn()}
|
|
456
|
+
aria-label="View behaviour incidents"
|
|
457
|
+
disabled
|
|
458
|
+
/>
|
|
459
|
+
</div>
|
|
460
|
+
),
|
|
461
|
+
},
|
|
462
|
+
'`disabled` on an interactive card — `aria-disabled={true}` is set and click/keyboard handling is suppressed. `onClick` must still be provided to activate the disabled visual state.',
|
|
463
|
+
);
|
|
464
|
+
|
|
465
|
+
export const MultipleCards: Story = withDescription(
|
|
466
|
+
{
|
|
467
|
+
parameters: {
|
|
468
|
+
controls: { disable: true },
|
|
469
|
+
docs: {
|
|
470
|
+
source: {
|
|
471
|
+
language: 'tsx',
|
|
472
|
+
code: `
|
|
473
|
+
import { KPICard } from '@arbor-education/design-system.components';
|
|
474
|
+
|
|
475
|
+
function MultipleCardsExample() {
|
|
476
|
+
return (
|
|
477
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 'var(--spacing-medium)' }}>
|
|
478
|
+
<KPICard label="Total pupils" value={247} />
|
|
479
|
+
<KPICard label="Attendance rate" value={94.2} isPercentage />
|
|
480
|
+
<KPICard label="Behaviour incidents" value={3} />
|
|
481
|
+
</div>
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
export default MultipleCardsExample;
|
|
485
|
+
`.trim(),
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
render: MultipleCardsTemplate,
|
|
490
|
+
},
|
|
491
|
+
'Multiple `KPICard` tiles in a CSS grid — the typical dashboard layout. Each card is self-contained and can independently be static or interactive.',
|
|
492
|
+
);
|