@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
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Controls, Heading as DocHeading, Markdown, Primary as DocPrimary, Stories, Subtitle, Title, } from '@storybook/addon-docs/blocks';
|
|
4
|
+
import { CheckboxCellRenderer } from './CheckboxCellRenderer';
|
|
5
|
+
import { Table } from '../../table/Table';
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Docs page content
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
const DESCRIPTION_INTRO = [
|
|
10
|
+
'`CheckboxCellRenderer` is an AG Grid cell renderer that renders an editable Arbor `CheckboxInput`',
|
|
11
|
+
'inside a table cell. On toggle, it calls `node.setDataValue` to update the row data in-place.',
|
|
12
|
+
'',
|
|
13
|
+
'Register it via the string key `dsCheckboxCellRenderer` (pre-registered by Arbor\'s `Table`) or by importing the component directly.',
|
|
14
|
+
].join('\n');
|
|
15
|
+
const USAGE_GUIDANCE = [
|
|
16
|
+
'### When to use',
|
|
17
|
+
'',
|
|
18
|
+
'- On boolean columns that the user needs to toggle directly in the table without opening a form',
|
|
19
|
+
'- "Active", "Enrolled", "Consent given" columns where inline editing is expected',
|
|
20
|
+
'',
|
|
21
|
+
'---',
|
|
22
|
+
'',
|
|
23
|
+
'### When NOT to use',
|
|
24
|
+
'',
|
|
25
|
+
'| Situation | Use instead |',
|
|
26
|
+
'|---|---|',
|
|
27
|
+
'| Display-only boolean (no editing) | `BooleanCellRenderer` (`dsBooleanCellRenderer`) |',
|
|
28
|
+
'| Toggling the value requires confirmation or a side effect | Handle in a modal; do not edit inline |',
|
|
29
|
+
].join('\n');
|
|
30
|
+
const DEVELOPER_NOTES = [
|
|
31
|
+
'### Critical usage patterns',
|
|
32
|
+
'',
|
|
33
|
+
'**`column` must be provided for changes to persist.**',
|
|
34
|
+
'On toggle, the renderer calls `node.setDataValue(column, !value)`. If `column` is not available in',
|
|
35
|
+
'props (which should not happen inside a real AG Grid), the change is silently ignored.',
|
|
36
|
+
'',
|
|
37
|
+
'**`aria-label` is derived from `colDef.headerName`.**',
|
|
38
|
+
'Always set `headerName` on the column definition — without it, the checkbox has no accessible label.',
|
|
39
|
+
'Override with `cellRendererParams: { "aria-label": "..." }` if needed.',
|
|
40
|
+
'',
|
|
41
|
+
'**Pass extra `CheckboxInput` props via `cellRendererParams`.**',
|
|
42
|
+
'The renderer spreads `cellRendererParams` onto `CheckboxInput`, so you can pass `disabled`, `className`, etc.',
|
|
43
|
+
'',
|
|
44
|
+
'```tsx',
|
|
45
|
+
"import { Table } from '@arbor-education/design-system.components';",
|
|
46
|
+
'',
|
|
47
|
+
'const colDefs = [',
|
|
48
|
+
' {',
|
|
49
|
+
" field: 'isEnrolled',",
|
|
50
|
+
" headerName: 'Enrolled',",
|
|
51
|
+
" cellRenderer: 'dsCheckboxCellRenderer',",
|
|
52
|
+
' // optional extra CheckboxInput props:',
|
|
53
|
+
' cellRendererParams: { disabled: isReadOnly },',
|
|
54
|
+
' },',
|
|
55
|
+
'];',
|
|
56
|
+
'```',
|
|
57
|
+
'',
|
|
58
|
+
'---',
|
|
59
|
+
'',
|
|
60
|
+
'### Accessibility',
|
|
61
|
+
'',
|
|
62
|
+
'The `aria-label` is set to `"Checkbox: {headerName}"` when `headerName` is defined. Without it,',
|
|
63
|
+
'the checkbox has no accessible label — WCAG 2.1 failure (1.3.1 Info and Relationships).',
|
|
64
|
+
'',
|
|
65
|
+
'---',
|
|
66
|
+
'',
|
|
67
|
+
'### TypeScript types',
|
|
68
|
+
'',
|
|
69
|
+
'```ts',
|
|
70
|
+
"import { CheckboxCellRenderer } from '@arbor-education/design-system.components';",
|
|
71
|
+
'```',
|
|
72
|
+
'',
|
|
73
|
+
'`CheckboxCellRenderer` accepts `CustomCellRendererProps` from AG Grid.',
|
|
74
|
+
'`value` should be a `boolean`. Additional `CheckboxInput` props can be passed via `colDef.cellRendererParams`.',
|
|
75
|
+
].join('\n');
|
|
76
|
+
const RELATED_COMPONENTS = [
|
|
77
|
+
'## Related components',
|
|
78
|
+
'',
|
|
79
|
+
'[Table](?path=/docs/components-table--docs) · [BooleanCellRenderer](?path=/docs/components-table-cellrenderers-booleancellrenderer--docs) · [CheckboxInput](?path=/docs/components-checkboxinput--docs)',
|
|
80
|
+
].join('\n');
|
|
81
|
+
const PROPS_INTRO = 'The preview below uses a mock AG Grid row node — click the checkbox to see it toggle. `node.setDataValue` is wired to local state in this preview; in a real table it updates the row data directly.';
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
// Custom DocsPage
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
function CheckboxCellRendererDocsPage() {
|
|
86
|
+
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: "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 })] }));
|
|
87
|
+
}
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
// Meta
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
const meta = {
|
|
92
|
+
title: 'Components/Table/CellRenderers/CheckboxCellRenderer',
|
|
93
|
+
component: CheckboxCellRenderer,
|
|
94
|
+
tags: ['autodocs'],
|
|
95
|
+
parameters: {
|
|
96
|
+
layout: 'padded',
|
|
97
|
+
docs: { page: CheckboxCellRendererDocsPage },
|
|
98
|
+
},
|
|
99
|
+
argTypes: {
|
|
100
|
+
value: {
|
|
101
|
+
control: false,
|
|
102
|
+
description: 'The current boolean state of the checkbox. On toggle, the renderer calls `node.setDataValue(column, !value)`.',
|
|
103
|
+
table: {
|
|
104
|
+
type: { summary: 'boolean' },
|
|
105
|
+
defaultValue: { summary: 'false' },
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
node: {
|
|
109
|
+
control: false,
|
|
110
|
+
description: 'AG Grid row node. The renderer calls `node.setDataValue` on toggle.',
|
|
111
|
+
table: { type: { summary: 'IRowNode' } },
|
|
112
|
+
},
|
|
113
|
+
column: {
|
|
114
|
+
control: false,
|
|
115
|
+
description: 'AG Grid column instance. Passed as the first argument to `node.setDataValue`.',
|
|
116
|
+
table: { type: { summary: 'Column | null' } },
|
|
117
|
+
},
|
|
118
|
+
colDef: {
|
|
119
|
+
control: false,
|
|
120
|
+
description: '`headerName` is used as the basis of the checkbox `aria-label`. Extra `CheckboxInput` props can be passed via `cellRendererParams`.',
|
|
121
|
+
table: { type: { summary: 'ColDef' } },
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
export default meta;
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// Helper: attach a per-story description to docs
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
const withDescription = (story, description) => ({
|
|
130
|
+
...story,
|
|
131
|
+
parameters: {
|
|
132
|
+
...story.parameters,
|
|
133
|
+
docs: { ...story.parameters?.docs, description: { story: description } },
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
// ---------------------------------------------------------------------------
|
|
137
|
+
// Template components
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
const InteractiveTemplate = () => {
|
|
140
|
+
const [checked, setChecked] = useState(false);
|
|
141
|
+
const mockNode = { setDataValue: (_, val) => setChecked(val) };
|
|
142
|
+
const mockColumn = {};
|
|
143
|
+
return (_jsx(CheckboxCellRenderer, { ...{}, value: checked, node: mockNode, column: mockColumn, colDef: { headerName: 'Enrolled' } }));
|
|
144
|
+
};
|
|
145
|
+
const DisabledTemplate = ({ checked }) => (_jsx(CheckboxCellRenderer, { ...{}, value: checked, node: { setDataValue: () => { } }, column: {}, colDef: { headerName: 'Enrolled', cellRendererParams: { disabled: true } } }));
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
// Stories
|
|
148
|
+
// ---------------------------------------------------------------------------
|
|
149
|
+
export const Default = withDescription({
|
|
150
|
+
parameters: { controls: { disable: true } },
|
|
151
|
+
render: InteractiveTemplate,
|
|
152
|
+
}, 'An interactive `CheckboxInput` backed by a mock row node. Click to toggle — `node.setDataValue` updates local state in this preview; in a real table it updates the AG Grid row data in-place.');
|
|
153
|
+
export const Checked = withDescription({
|
|
154
|
+
parameters: {
|
|
155
|
+
controls: { disable: true },
|
|
156
|
+
docs: {
|
|
157
|
+
source: {
|
|
158
|
+
language: 'tsx',
|
|
159
|
+
code: `
|
|
160
|
+
import { Table } from '@arbor-education/design-system.components';
|
|
161
|
+
|
|
162
|
+
const colDefs = [
|
|
163
|
+
{
|
|
164
|
+
field: 'isEnrolled',
|
|
165
|
+
headerName: 'Enrolled',
|
|
166
|
+
cellRenderer: 'dsCheckboxCellRenderer',
|
|
167
|
+
},
|
|
168
|
+
];
|
|
169
|
+
`.trim(),
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
render: () => _jsx(DisabledTemplate, { checked: true }),
|
|
174
|
+
}, 'Checked state — `value={true}`. The `aria-label` is derived from `colDef.headerName` ("Checkbox: Enrolled").');
|
|
175
|
+
export const Unchecked = withDescription({
|
|
176
|
+
parameters: { controls: { disable: true } },
|
|
177
|
+
render: () => _jsx(DisabledTemplate, { checked: false }),
|
|
178
|
+
}, 'Unchecked state — `value={false}`.');
|
|
179
|
+
export const DisabledChecked = withDescription({
|
|
180
|
+
parameters: { controls: { disable: true } },
|
|
181
|
+
render: () => (_jsx(CheckboxCellRenderer, { ...{}, value: true, node: { setDataValue: () => { } }, column: {}, colDef: { headerName: 'Enrolled', cellRendererParams: { disabled: true } } })),
|
|
182
|
+
}, 'Disabled state — pass `disabled: true` via `cellRendererParams` to prevent the user from toggling the value. Useful for read-only rows or conditional editing logic.');
|
|
183
|
+
const CHECKBOX_IN_TABLE_DATA = [
|
|
184
|
+
{ name: 'Alice Johnson', enrolled: true },
|
|
185
|
+
{ name: 'Bob Smith', enrolled: false },
|
|
186
|
+
{ name: 'Charlie Brown', enrolled: true },
|
|
187
|
+
{ name: 'Diana Prince', enrolled: false },
|
|
188
|
+
];
|
|
189
|
+
export const InATable = withDescription({
|
|
190
|
+
parameters: {
|
|
191
|
+
controls: { disable: true },
|
|
192
|
+
docs: {
|
|
193
|
+
source: {
|
|
194
|
+
language: 'tsx',
|
|
195
|
+
code: `
|
|
196
|
+
import { Table } from '@arbor-education/design-system.components';
|
|
197
|
+
|
|
198
|
+
const rowData = [
|
|
199
|
+
{ name: 'Alice Johnson', enrolled: true },
|
|
200
|
+
{ name: 'Bob Smith', enrolled: false },
|
|
201
|
+
{ name: 'Charlie Brown', enrolled: true },
|
|
202
|
+
{ name: 'Diana Prince', enrolled: false },
|
|
203
|
+
];
|
|
204
|
+
|
|
205
|
+
function CheckboxCellRendererExample() {
|
|
206
|
+
return (
|
|
207
|
+
<Table
|
|
208
|
+
rowData={rowData}
|
|
209
|
+
columnDefs={[
|
|
210
|
+
{ field: 'name', headerName: 'Name', flex: 2 },
|
|
211
|
+
{
|
|
212
|
+
field: 'enrolled',
|
|
213
|
+
headerName: 'Enrolled',
|
|
214
|
+
flex: 1,
|
|
215
|
+
editable: false,
|
|
216
|
+
cellRenderer: 'dsCheckboxCellRenderer',
|
|
217
|
+
},
|
|
218
|
+
]}
|
|
219
|
+
defaultColDef={{ flex: 1, minWidth: 120 }}
|
|
220
|
+
domLayout="autoHeight"
|
|
221
|
+
/>
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export default CheckboxCellRendererExample;
|
|
226
|
+
`.trim(),
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
render: () => (_jsx(Table, { rowData: CHECKBOX_IN_TABLE_DATA, columnDefs: [
|
|
231
|
+
{ field: 'name', headerName: 'Name', flex: 2 },
|
|
232
|
+
{
|
|
233
|
+
field: 'enrolled',
|
|
234
|
+
headerName: 'Enrolled',
|
|
235
|
+
flex: 1,
|
|
236
|
+
editable: false,
|
|
237
|
+
cellRenderer: 'dsCheckboxCellRenderer',
|
|
238
|
+
},
|
|
239
|
+
], defaultColDef: { flex: 1, minWidth: 120 }, domLayout: "autoHeight" })),
|
|
240
|
+
}, '`dsCheckboxCellRenderer` wired up inside a full `Table`. Click a checkbox to toggle the value — AG Grid calls `node.setDataValue` which updates the row data in-place. The `headerName` ("Enrolled") becomes the checkbox `aria-label`.');
|
|
241
|
+
//# sourceMappingURL=CheckboxCellRenderer.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxCellRenderer.stories.js","sourceRoot":"","sources":["../../../../src/components/table/cellRenderers/CheckboxCellRenderer.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,OAAO,EACP,QAAQ,EACR,KAAK,GACN,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG;IACxB,mGAAmG;IACnG,+FAA+F;IAC/F,EAAE;IACF,sIAAsI;CACvI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,cAAc,GAAG;IACrB,iBAAiB;IACjB,EAAE;IACF,iGAAiG;IACjG,kFAAkF;IAClF,EAAE;IACF,KAAK;IACL,EAAE;IACF,qBAAqB;IACrB,EAAE;IACF,6BAA6B;IAC7B,WAAW;IACX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E,QAAQ,EAAE,KAAK,EAAE;IACtC,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzC,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE;CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU,eAAe,CAC5C;IACE,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC3B,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bf,CAAC,IAAI,EAAE;aACC;SACF;KACF;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,KAAC,KAAK,IACJ,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE;YACV,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE;YAC9C;gBACE,KAAK,EAAE,UAAU;gBACjB,UAAU,EAAE,UAAU;gBACtB,IAAI,EAAE,CAAC;gBACP,QAAQ,EAAE,KAAK;gBACf,YAAY,EAAE,wBAAwB;aACvC;SACF,EACD,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EACzC,SAAS,EAAC,YAAY,GACtB,CACH;CACF,EACD,yOAAyO,CAC1O,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import type { CustomCellRendererProps } from 'ag-grid-react';
|
|
3
|
+
import { DefaultCellRenderer } from './DefaultCellRenderer';
|
|
4
|
+
declare function DefaultCellRendererDocsPage(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const meta: {
|
|
6
|
+
title: string;
|
|
7
|
+
component: (props: CustomCellRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
tags: string[];
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: string;
|
|
11
|
+
docs: {
|
|
12
|
+
page: typeof DefaultCellRendererDocsPage;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
argTypes: {
|
|
16
|
+
valueFormatted: {
|
|
17
|
+
control: false;
|
|
18
|
+
description: string;
|
|
19
|
+
table: {
|
|
20
|
+
type: {
|
|
21
|
+
summary: string;
|
|
22
|
+
};
|
|
23
|
+
defaultValue: {
|
|
24
|
+
summary: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
value: {
|
|
29
|
+
control: false;
|
|
30
|
+
description: string;
|
|
31
|
+
table: {
|
|
32
|
+
type: {
|
|
33
|
+
summary: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
colDef: {
|
|
38
|
+
control: false;
|
|
39
|
+
description: string;
|
|
40
|
+
table: {
|
|
41
|
+
type: {
|
|
42
|
+
summary: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export default meta;
|
|
49
|
+
type Story = StoryObj<typeof DefaultCellRenderer>;
|
|
50
|
+
export declare const Default: Story;
|
|
51
|
+
export declare const RawValueFallback: Story;
|
|
52
|
+
export declare const Empty: Story;
|
|
53
|
+
export declare const WithDataTestId: Story;
|
|
54
|
+
export declare const InATable: Story;
|
|
55
|
+
//# sourceMappingURL=DefaultCellRenderer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultCellRenderer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/table/cellRenderers/DefaultCellRenderer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAU5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA2F5D,iBAAS,2BAA2B,4CAmBnC;AAQD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCkC,CAAC;AAE7C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAkBlD,eAAO,MAAM,OAAO,EAAE,KAarB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAa9B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAanB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAkC5B,CAAC;AAQF,eAAO,MAAM,QAAQ,EAAE,KAwEtB,CAAC"}
|
|
@@ -0,0 +1,245 @@
|
|
|
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 { DefaultCellRenderer } from './DefaultCellRenderer';
|
|
4
|
+
import { Table } from '../../table/Table';
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Docs page content
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
const DESCRIPTION_INTRO = [
|
|
9
|
+
'`DefaultCellRenderer` is the internal default cell renderer used by Arbor\'s `Table`. It renders',
|
|
10
|
+
'`valueFormatted` when available, falls back to `value.value`, and renders an empty `div` for',
|
|
11
|
+
'`null` or `undefined`. It also supports an optional `dataTestId` via `colDef.cellRendererParams`.',
|
|
12
|
+
'',
|
|
13
|
+
'**You rarely need to register this renderer explicitly.** AG Grid uses it automatically for all',
|
|
14
|
+
'columns in an Arbor Table.',
|
|
15
|
+
].join('\n');
|
|
16
|
+
const USAGE_GUIDANCE = [
|
|
17
|
+
'### When to use',
|
|
18
|
+
'',
|
|
19
|
+
'- When you need to add a `dataTestId` to a cell for automated testing',
|
|
20
|
+
'- When you want to be explicit about using the default renderer in a column definition',
|
|
21
|
+
'',
|
|
22
|
+
'---',
|
|
23
|
+
'',
|
|
24
|
+
'### When NOT to use',
|
|
25
|
+
'',
|
|
26
|
+
'| Situation | Use instead |',
|
|
27
|
+
'|---|---|',
|
|
28
|
+
'| The column needs interactive controls | `CheckboxCellRenderer`, `ButtonCellRenderer`, or `SelectDropdownCellRenderer` |',
|
|
29
|
+
'| The column renders a boolean flag | `BooleanCellRenderer` |',
|
|
30
|
+
'| You want formatted text output | A `valueFormatter` on the column — `DefaultCellRenderer` renders `valueFormatted` automatically |',
|
|
31
|
+
].join('\n');
|
|
32
|
+
const DEVELOPER_NOTES = [
|
|
33
|
+
'### Critical usage patterns',
|
|
34
|
+
'',
|
|
35
|
+
'**Value resolution order:**',
|
|
36
|
+
'1. Uses `valueFormatted` if it exists and is NOT the string `"[object Object]"`',
|
|
37
|
+
'2. Falls back to `value.value`',
|
|
38
|
+
'3. Renders an empty `<div>` for `null` or `undefined`',
|
|
39
|
+
'',
|
|
40
|
+
'This means a `valueFormatter` on the column will always take precedence over the raw value.',
|
|
41
|
+
'',
|
|
42
|
+
'**`dataTestId` must be passed via `colDef.cellRendererParams`** — it is not a direct prop.',
|
|
43
|
+
'',
|
|
44
|
+
'```tsx',
|
|
45
|
+
"import { Table } from '@arbor-education/design-system.components';",
|
|
46
|
+
'',
|
|
47
|
+
'const colDefs = [',
|
|
48
|
+
' {',
|
|
49
|
+
" field: 'name',",
|
|
50
|
+
" headerName: 'Name',",
|
|
51
|
+
' // Explicit registration — only needed when you want a dataTestId:',
|
|
52
|
+
' cellRenderer: DefaultCellRenderer,',
|
|
53
|
+
' cellRendererParams: {',
|
|
54
|
+
" dataTestId: 'student-name-cell',",
|
|
55
|
+
' },',
|
|
56
|
+
' },',
|
|
57
|
+
'];',
|
|
58
|
+
'```',
|
|
59
|
+
'',
|
|
60
|
+
'---',
|
|
61
|
+
'',
|
|
62
|
+
'### Accessibility',
|
|
63
|
+
'',
|
|
64
|
+
'No specific accessibility requirements — this renderer renders plain text. Ensure your `valueFormatter`',
|
|
65
|
+
'returns a human-readable string, not a raw object (which would produce `"[object Object]"`).',
|
|
66
|
+
'',
|
|
67
|
+
'---',
|
|
68
|
+
'',
|
|
69
|
+
'### TypeScript types',
|
|
70
|
+
'',
|
|
71
|
+
'```ts',
|
|
72
|
+
"import { DefaultCellRenderer } from '@arbor-education/design-system.components';",
|
|
73
|
+
'```',
|
|
74
|
+
'',
|
|
75
|
+
'`DefaultCellRenderer` accepts `CustomCellRendererProps` from AG Grid.',
|
|
76
|
+
].join('\n');
|
|
77
|
+
const RELATED_COMPONENTS = [
|
|
78
|
+
'## Related components',
|
|
79
|
+
'',
|
|
80
|
+
'[Table](?path=/docs/components-table--docs) · [BooleanCellRenderer](?path=/docs/components-table-cellrenderers-booleancellrenderer--docs)',
|
|
81
|
+
].join('\n');
|
|
82
|
+
const PROPS_INTRO = 'The preview below shows `DefaultCellRenderer` in its various value states. This renderer is used internally by Arbor\'s Table — its Controls are not individually wired to the grid runtime.';
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
// Custom DocsPage
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
function DefaultCellRendererDocsPage() {
|
|
87
|
+
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: "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 })] }));
|
|
88
|
+
}
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// Meta
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
const MOCK_CELL_PROPS = {};
|
|
93
|
+
const meta = {
|
|
94
|
+
title: 'Components/Table/CellRenderers/DefaultCellRenderer',
|
|
95
|
+
component: DefaultCellRenderer,
|
|
96
|
+
tags: ['autodocs'],
|
|
97
|
+
parameters: {
|
|
98
|
+
layout: 'padded',
|
|
99
|
+
docs: { page: DefaultCellRendererDocsPage },
|
|
100
|
+
},
|
|
101
|
+
argTypes: {
|
|
102
|
+
valueFormatted: {
|
|
103
|
+
control: false,
|
|
104
|
+
description: 'String produced by AG Grid\'s `valueFormatter`. Takes precedence over `value.value` unless it equals `"[object Object]"`.',
|
|
105
|
+
table: {
|
|
106
|
+
type: { summary: 'string | undefined' },
|
|
107
|
+
defaultValue: { summary: 'undefined' },
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
value: {
|
|
111
|
+
control: false,
|
|
112
|
+
description: 'The raw cell value from AG Grid. The renderer reads `value.value` as a fallback when `valueFormatted` is not set.',
|
|
113
|
+
table: {
|
|
114
|
+
type: { summary: '{ value: string | number | null | undefined } | any' },
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
colDef: {
|
|
118
|
+
control: false,
|
|
119
|
+
description: 'Pass `cellRendererParams: { dataTestId: "..." }` to add a test ID to the cell `div`.',
|
|
120
|
+
table: {
|
|
121
|
+
type: { summary: 'ColDef' },
|
|
122
|
+
},
|
|
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
|
+
// Stories
|
|
139
|
+
// ---------------------------------------------------------------------------
|
|
140
|
+
export const Default = withDescription({
|
|
141
|
+
parameters: { controls: { disable: true } },
|
|
142
|
+
render: () => (_jsx(DefaultCellRenderer, { ...MOCK_CELL_PROPS, valueFormatted: "Smith, Alice", value: { value: 'smith-alice' }, colDef: {} })),
|
|
143
|
+
}, '`valueFormatted` takes precedence — the renderer displays "Smith, Alice" (the formatted value) rather than "smith-alice" (the raw value).');
|
|
144
|
+
export const RawValueFallback = withDescription({
|
|
145
|
+
parameters: { controls: { disable: true } },
|
|
146
|
+
render: () => (_jsx(DefaultCellRenderer, { ...MOCK_CELL_PROPS, valueFormatted: undefined, value: { value: 'Unformatted cell value' }, colDef: {} })),
|
|
147
|
+
}, 'When `valueFormatted` is not set, the renderer falls back to `value.value`.');
|
|
148
|
+
export const Empty = withDescription({
|
|
149
|
+
parameters: { controls: { disable: true } },
|
|
150
|
+
render: () => (_jsx(DefaultCellRenderer, { ...MOCK_CELL_PROPS, valueFormatted: undefined, value: { value: null }, colDef: {} })),
|
|
151
|
+
}, '`null` or `undefined` resolved values render an empty `<div>`. The cell is blank but the DOM element is present (useful for `dataTestId` targeting).');
|
|
152
|
+
export const WithDataTestId = withDescription({
|
|
153
|
+
parameters: {
|
|
154
|
+
controls: { disable: true },
|
|
155
|
+
docs: {
|
|
156
|
+
source: {
|
|
157
|
+
language: 'tsx',
|
|
158
|
+
code: `
|
|
159
|
+
import { DefaultCellRenderer } from '@arbor-education/design-system.components';
|
|
160
|
+
|
|
161
|
+
const colDefs = [
|
|
162
|
+
{
|
|
163
|
+
field: 'name',
|
|
164
|
+
headerName: 'Name',
|
|
165
|
+
cellRenderer: DefaultCellRenderer,
|
|
166
|
+
cellRendererParams: {
|
|
167
|
+
dataTestId: 'student-name-cell',
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
];
|
|
171
|
+
`.trim(),
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
render: () => (_jsx(DefaultCellRenderer, { ...MOCK_CELL_PROPS, valueFormatted: "Smith, Alice", value: { value: 'smith-alice' }, colDef: { cellRendererParams: { dataTestId: 'student-name-cell' } } })),
|
|
176
|
+
}, 'Pass `dataTestId` via `colDef.cellRendererParams` to add a `data-testid` attribute to the cell `div`. Inspect the rendered element to see `data-testid="student-name-cell"`.');
|
|
177
|
+
const DEFAULT_IN_TABLE_DATA = [
|
|
178
|
+
{ name: { value: 'Alice Johnson' }, role: { value: 'Developer' } },
|
|
179
|
+
{ name: { value: 'Bob Smith' }, role: { value: 'Designer' } },
|
|
180
|
+
{ name: { value: 'Charlie Brown' }, role: { value: 'Manager' } },
|
|
181
|
+
];
|
|
182
|
+
export const InATable = withDescription({
|
|
183
|
+
parameters: {
|
|
184
|
+
controls: { disable: true },
|
|
185
|
+
docs: {
|
|
186
|
+
source: {
|
|
187
|
+
language: 'tsx',
|
|
188
|
+
code: `
|
|
189
|
+
import { Table, DefaultCellRenderer } from '@arbor-education/design-system.components';
|
|
190
|
+
|
|
191
|
+
const rowData = [
|
|
192
|
+
{ name: { value: 'Alice Johnson' }, role: { value: 'Developer' } },
|
|
193
|
+
{ name: { value: 'Bob Smith' }, role: { value: 'Designer' } },
|
|
194
|
+
{ name: { value: 'Charlie Brown' }, role: { value: 'Manager' } },
|
|
195
|
+
];
|
|
196
|
+
|
|
197
|
+
function DefaultCellRendererExample() {
|
|
198
|
+
return (
|
|
199
|
+
<Table
|
|
200
|
+
rowData={rowData}
|
|
201
|
+
columnDefs={[
|
|
202
|
+
{
|
|
203
|
+
field: 'name',
|
|
204
|
+
headerName: 'Name',
|
|
205
|
+
flex: 2,
|
|
206
|
+
cellRenderer: DefaultCellRenderer,
|
|
207
|
+
cellRendererParams: { dataTestId: 'name-cell' },
|
|
208
|
+
valueFormatter: Table.DefaultValueFormatter,
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
field: 'role',
|
|
212
|
+
headerName: 'Role',
|
|
213
|
+
flex: 1,
|
|
214
|
+
valueFormatter: Table.DefaultValueFormatter,
|
|
215
|
+
},
|
|
216
|
+
]}
|
|
217
|
+
defaultColDef={{ flex: 1, minWidth: 120 }}
|
|
218
|
+
domLayout="autoHeight"
|
|
219
|
+
/>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export default DefaultCellRendererExample;
|
|
224
|
+
`.trim(),
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
render: () => (_jsx(Table, { rowData: DEFAULT_IN_TABLE_DATA, columnDefs: [
|
|
229
|
+
{
|
|
230
|
+
field: 'name',
|
|
231
|
+
headerName: 'Name',
|
|
232
|
+
flex: 2,
|
|
233
|
+
cellRenderer: DefaultCellRenderer,
|
|
234
|
+
cellRendererParams: { dataTestId: 'name-cell' },
|
|
235
|
+
valueFormatter: Table.DefaultValueFormatter,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
field: 'role',
|
|
239
|
+
headerName: 'Role',
|
|
240
|
+
flex: 1,
|
|
241
|
+
valueFormatter: Table.DefaultValueFormatter,
|
|
242
|
+
},
|
|
243
|
+
], defaultColDef: { flex: 1, minWidth: 120 }, domLayout: "autoHeight" })),
|
|
244
|
+
}, '`DefaultCellRenderer` registered explicitly on the Name column to attach a `dataTestId`. Row data uses the `{ value: string }` object shape — `Table.DefaultValueFormatter` formats it for display, and `DefaultCellRenderer` reads `value.value` as its fallback. Inspect the Name cells in DevTools to see `data-testid="name-cell"`.');
|
|
245
|
+
//# sourceMappingURL=DefaultCellRenderer.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultCellRenderer.stories.js","sourceRoot":"","sources":["../../../../src/components/table/cellRenderers/DefaultCellRenderer.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,OAAO,EACP,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I,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;CACjE,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU,eAAe,CAC5C;IACE,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC3B,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCf,CAAC,IAAI,EAAE;aACC;SACF;KACF;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,KAAC,KAAK,IACJ,OAAO,EAAE,qBAAqB,EAC9B,UAAU,EAAE;YACV;gBACE,KAAK,EAAE,MAAM;gBACb,UAAU,EAAE,MAAM;gBAClB,IAAI,EAAE,CAAC;gBACP,YAAY,EAAE,mBAAmB;gBACjC,kBAAkB,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE;gBAC/C,cAAc,EAAE,KAAK,CAAC,qBAAqB;aAC5C;YACD;gBACE,KAAK,EAAE,MAAM;gBACb,UAAU,EAAE,MAAM;gBAClB,IAAI,EAAE,CAAC;gBACP,cAAc,EAAE,KAAK,CAAC,qBAAqB;aAC5C;SACF,EACD,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EACzC,SAAS,EAAC,YAAY,GACtB,CACH;CACF,EACD,yUAAyU,CAC1U,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import type { CustomCellRendererProps } from 'ag-grid-react';
|
|
3
|
+
import { InlineTextCellRenderer } from './InlineTextCellRenderer';
|
|
4
|
+
declare function InlineTextCellRendererDocsPage(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const meta: {
|
|
6
|
+
title: string;
|
|
7
|
+
component: (props: CustomCellRendererProps<any, any, any> & {
|
|
8
|
+
value: string;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
tags: string[];
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
docs: {
|
|
14
|
+
page: typeof InlineTextCellRendererDocsPage;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
argTypes: {
|
|
18
|
+
value: {
|
|
19
|
+
control: false;
|
|
20
|
+
description: string;
|
|
21
|
+
table: {
|
|
22
|
+
type: {
|
|
23
|
+
summary: string;
|
|
24
|
+
};
|
|
25
|
+
defaultValue: {
|
|
26
|
+
summary: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
valueFormatted: {
|
|
31
|
+
control: false;
|
|
32
|
+
description: string;
|
|
33
|
+
table: {
|
|
34
|
+
type: {
|
|
35
|
+
summary: string;
|
|
36
|
+
};
|
|
37
|
+
defaultValue: {
|
|
38
|
+
summary: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
node: {
|
|
43
|
+
control: false;
|
|
44
|
+
description: string;
|
|
45
|
+
table: {
|
|
46
|
+
type: {
|
|
47
|
+
summary: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
column: {
|
|
52
|
+
control: false;
|
|
53
|
+
description: string;
|
|
54
|
+
table: {
|
|
55
|
+
type: {
|
|
56
|
+
summary: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export default meta;
|
|
63
|
+
type Story = StoryObj<typeof InlineTextCellRenderer>;
|
|
64
|
+
export declare const Default: Story;
|
|
65
|
+
export declare const Empty: Story;
|
|
66
|
+
export declare const InATable: Story;
|
|
67
|
+
//# sourceMappingURL=InlineTextCellRenderer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineTextCellRenderer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/table/cellRenderers/InlineTextCellRenderer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAU5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAsFlE,iBAAS,8BAA8B,4CAmBtC;AAQD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCqC,CAAC;AAEhD,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAkBrD,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KA6BnB,CAAC;AAQF,eAAO,MAAM,QAAQ,EAAE,KA4DtB,CAAC"}
|