@arbor-education/design-system.components 0.15.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 +17 -0
- package/README.md +8 -0
- package/component-library.md +144 -13
- package/dist/components/articleCard/ArticleCard.stories.d.ts +137 -11
- package/dist/components/articleCard/ArticleCard.stories.d.ts.map +1 -1
- package/dist/components/articleCard/ArticleCard.stories.js +358 -91
- package/dist/components/articleCard/ArticleCard.stories.js.map +1 -1
- package/dist/components/avatar/Avatar.stories.d.ts +6 -6
- package/dist/components/avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.stories.js +393 -49
- package/dist/components/avatar/Avatar.stories.js.map +1 -1
- package/dist/components/avatarGroup/AvatarGroup.stories.d.ts +9 -7
- package/dist/components/avatarGroup/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/components/avatarGroup/AvatarGroup.stories.js +688 -65
- package/dist/components/avatarGroup/AvatarGroup.stories.js.map +1 -1
- package/dist/components/banner/Banner.stories.d.ts.map +1 -1
- package/dist/components/banner/Banner.stories.js +7 -3
- package/dist/components/banner/Banner.stories.js.map +1 -1
- package/dist/components/card/Card.stories.d.ts +105 -4
- package/dist/components/card/Card.stories.d.ts.map +1 -1
- package/dist/components/card/Card.stories.js +336 -18
- package/dist/components/card/Card.stories.js.map +1 -1
- package/dist/components/combobox/Combobox.stories.d.ts +134 -21
- package/dist/components/combobox/Combobox.stories.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.stories.js +676 -175
- package/dist/components/combobox/Combobox.stories.js.map +1 -1
- package/dist/components/datePicker/DatePicker.stories.d.ts +119 -27
- package/dist/components/datePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/datePicker/DatePicker.stories.js +575 -47
- package/dist/components/datePicker/DatePicker.stories.js.map +1 -1
- package/dist/components/dateTimePicker/DateTimePicker.stories.d.ts +155 -39
- package/dist/components/dateTimePicker/DateTimePicker.stories.d.ts.map +1 -1
- package/dist/components/dateTimePicker/DateTimePicker.stories.js +674 -103
- package/dist/components/dateTimePicker/DateTimePicker.stories.js.map +1 -1
- package/dist/components/editableText/EditableText.stories.d.ts +53 -12
- package/dist/components/editableText/EditableText.stories.d.ts.map +1 -1
- package/dist/components/editableText/EditableText.stories.js +401 -64
- package/dist/components/editableText/EditableText.stories.js.map +1 -1
- package/dist/components/formField/FormField.d.ts +4 -0
- package/dist/components/formField/FormField.d.ts.map +1 -1
- package/dist/components/formField/FormField.js +2 -1
- package/dist/components/formField/FormField.js.map +1 -1
- package/dist/components/formField/FormField.test.js +5 -0
- package/dist/components/formField/FormField.test.js.map +1 -1
- package/dist/components/formField/fieldset/Fieldset.stories.d.ts +56 -4
- package/dist/components/formField/fieldset/Fieldset.stories.d.ts.map +1 -1
- package/dist/components/formField/fieldset/Fieldset.stories.js +534 -28
- package/dist/components/formField/fieldset/Fieldset.stories.js.map +1 -1
- package/dist/components/formField/inputs/checkbox/CheckboxGroup.d.ts +3 -1
- package/dist/components/formField/inputs/checkbox/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/formField/inputs/checkbox/CheckboxInput.js +1 -1
- package/dist/components/formField/inputs/checkbox/CheckboxInput.js.map +1 -1
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.d.ts +95 -1
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.d.ts.map +1 -1
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.js +386 -9
- package/dist/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.js.map +1 -1
- package/dist/components/formField/inputs/radio/RadioButtonGroup.d.ts +6 -2
- package/dist/components/formField/inputs/radio/RadioButtonGroup.d.ts.map +1 -1
- package/dist/components/formField/inputs/radio/RadioButtonGroup.js.map +1 -1
- package/dist/components/formField/inputs/radio/RadioButtonInput.stories.d.ts.map +1 -1
- package/dist/components/formField/inputs/radio/RadioButtonInput.stories.js +61 -49
- package/dist/components/formField/inputs/radio/RadioButtonInput.stories.js.map +1 -1
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.stories.d.ts +188 -166
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.stories.d.ts.map +1 -1
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.stories.js +821 -160
- package/dist/components/formField/inputs/selectDropdown/SelectDropdown.stories.js.map +1 -1
- package/dist/components/formField/inputs/time/TimeInput.stories.d.ts +176 -22
- package/dist/components/formField/inputs/time/TimeInput.stories.d.ts.map +1 -1
- package/dist/components/formField/inputs/time/TimeInput.stories.js +851 -92
- package/dist/components/formField/inputs/time/TimeInput.stories.js.map +1 -1
- package/dist/components/formField/label/Label.stories.d.ts +54 -5
- package/dist/components/formField/label/Label.stories.d.ts.map +1 -1
- package/dist/components/formField/label/Label.stories.js +238 -4
- package/dist/components/formField/label/Label.stories.js.map +1 -1
- package/dist/components/icoText/IcoText.stories.d.ts +32 -6
- package/dist/components/icoText/IcoText.stories.d.ts.map +1 -1
- package/dist/components/icoText/IcoText.stories.js +309 -14
- package/dist/components/icoText/IcoText.stories.js.map +1 -1
- package/dist/components/kpiCard/KPICard.stories.d.ts +100 -2
- package/dist/components/kpiCard/KPICard.stories.d.ts.map +1 -1
- package/dist/components/kpiCard/KPICard.stories.js +354 -10
- package/dist/components/kpiCard/KPICard.stories.js.map +1 -1
- package/dist/components/kvpList/KVPList.stories.d.ts +57 -4
- package/dist/components/kvpList/KVPList.stories.d.ts.map +1 -1
- package/dist/components/kvpList/KVPList.stories.js +403 -10
- package/dist/components/kvpList/KVPList.stories.js.map +1 -1
- package/dist/components/modal/Modal.stories.d.ts +113 -9
- package/dist/components/modal/Modal.stories.d.ts.map +1 -1
- package/dist/components/modal/Modal.stories.js +633 -13
- package/dist/components/modal/Modal.stories.js.map +1 -1
- package/dist/components/modal/modalManager/ModalManager.stories.d.ts +34 -10
- package/dist/components/modal/modalManager/ModalManager.stories.d.ts.map +1 -1
- package/dist/components/modal/modalManager/ModalManager.stories.js +463 -85
- package/dist/components/modal/modalManager/ModalManager.stories.js.map +1 -1
- package/dist/components/pill/Pill.d.ts.map +1 -1
- package/dist/components/pill/Pill.js +1 -1
- package/dist/components/pill/Pill.js.map +1 -1
- package/dist/components/pill/Pill.stories.d.ts.map +1 -1
- package/dist/components/pill/Pill.stories.js +11 -13
- package/dist/components/pill/Pill.stories.js.map +1 -1
- package/dist/components/row/Row.stories.d.ts +1 -2
- package/dist/components/row/Row.stories.d.ts.map +1 -1
- package/dist/components/row/Row.stories.js +360 -50
- package/dist/components/row/Row.stories.js.map +1 -1
- package/dist/components/searchBar/SearchBar.stories.d.ts +52 -4
- package/dist/components/searchBar/SearchBar.stories.d.ts.map +1 -1
- package/dist/components/searchBar/SearchBar.stories.js +428 -36
- package/dist/components/searchBar/SearchBar.stories.js.map +1 -1
- package/dist/components/section/Section.stories.d.ts +11 -41
- package/dist/components/section/Section.stories.d.ts.map +1 -1
- package/dist/components/section/Section.stories.js +494 -56
- package/dist/components/section/Section.stories.js.map +1 -1
- package/dist/components/singleUser/SingleUser.stories.d.ts +5 -4
- package/dist/components/singleUser/SingleUser.stories.d.ts.map +1 -1
- package/dist/components/singleUser/SingleUser.stories.js +303 -31
- package/dist/components/singleUser/SingleUser.stories.js.map +1 -1
- package/dist/components/slideoverManager/SlideoverManager.stories.d.ts +32 -11
- package/dist/components/slideoverManager/SlideoverManager.stories.d.ts.map +1 -1
- package/dist/components/slideoverManager/SlideoverManager.stories.js +380 -84
- package/dist/components/slideoverManager/SlideoverManager.stories.js.map +1 -1
- package/dist/components/table/DSDefaultColDef.d.ts.map +1 -1
- package/dist/components/table/DSDefaultColDef.js +4 -3
- package/dist/components/table/DSDefaultColDef.js.map +1 -1
- package/dist/components/table/Table.d.ts +6 -1
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/Table.js +8 -3
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.stories.d.ts +2 -0
- package/dist/components/table/Table.stories.d.ts.map +1 -1
- package/dist/components/table/Table.stories.js +357 -3
- package/dist/components/table/Table.stories.js.map +1 -1
- package/dist/components/table/TableFooter.stories.d.ts +49 -0
- package/dist/components/table/TableFooter.stories.d.ts.map +1 -0
- package/dist/components/table/TableFooter.stories.js +137 -0
- package/dist/components/table/TableFooter.stories.js.map +1 -0
- package/dist/components/table/TableHeader.stories.d.ts +93 -0
- package/dist/components/table/TableHeader.stories.d.ts.map +1 -0
- package/dist/components/table/TableHeader.stories.js +176 -0
- package/dist/components/table/TableHeader.stories.js.map +1 -0
- package/dist/components/table/cellEditors/DateCellEditor.stories.d.ts +44 -0
- package/dist/components/table/cellEditors/DateCellEditor.stories.d.ts.map +1 -0
- package/dist/components/table/cellEditors/DateCellEditor.stories.js +186 -0
- package/dist/components/table/cellEditors/DateCellEditor.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/BooleanCellRenderer.stories.d.ts +40 -0
- package/dist/components/table/cellRenderers/BooleanCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/BooleanCellRenderer.stories.js +209 -0
- package/dist/components/table/cellRenderers/BooleanCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/ButtonCellRenderer.stories.d.ts +48 -0
- package/dist/components/table/cellRenderers/ButtonCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/ButtonCellRenderer.stories.js +244 -0
- package/dist/components/table/cellRenderers/ButtonCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.d.ts.map +1 -1
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.js +3 -1
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.js.map +1 -1
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.d.ts +64 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.js +241 -0
- package/dist/components/table/cellRenderers/CheckboxCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/DefaultCellRenderer.stories.d.ts +55 -0
- package/dist/components/table/cellRenderers/DefaultCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/DefaultCellRenderer.stories.js +245 -0
- package/dist/components/table/cellRenderers/DefaultCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.d.ts +67 -0
- package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.js +221 -0
- package/dist/components/table/cellRenderers/InlineTextCellRenderer.stories.js.map +1 -0
- package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.d.ts +75 -0
- package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.d.ts.map +1 -0
- package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.js +270 -0
- package/dist/components/table/cellRenderers/SelectDropdownCellRenderer.stories.js.map +1 -0
- package/dist/components/table/columnFilters/BooleanFilter.stories.d.ts +57 -0
- package/dist/components/table/columnFilters/BooleanFilter.stories.d.ts.map +1 -0
- package/dist/components/table/columnFilters/BooleanFilter.stories.js +198 -0
- package/dist/components/table/columnFilters/BooleanFilter.stories.js.map +1 -0
- package/dist/components/table/columnFilters/TimeFilter.stories.d.ts +58 -0
- package/dist/components/table/columnFilters/TimeFilter.stories.d.ts.map +1 -0
- package/dist/components/table/columnFilters/TimeFilter.stories.js +207 -0
- package/dist/components/table/columnFilters/TimeFilter.stories.js.map +1 -0
- package/dist/components/table/pagination/PaginationPanel.stories.d.ts +113 -0
- package/dist/components/table/pagination/PaginationPanel.stories.d.ts.map +1 -0
- package/dist/components/table/pagination/PaginationPanel.stories.js +272 -0
- package/dist/components/table/pagination/PaginationPanel.stories.js.map +1 -0
- package/dist/components/table/tableControls/TableControls.stories.d.ts +151 -0
- package/dist/components/table/tableControls/TableControls.stories.d.ts.map +1 -0
- package/dist/components/table/tableControls/TableControls.stories.js +356 -0
- package/dist/components/table/tableControls/TableControls.stories.js.map +1 -0
- package/dist/components/table/tableControls/TableSettingsDropdown.d.ts +27 -1
- package/dist/components/table/tableControls/TableSettingsDropdown.d.ts.map +1 -1
- package/dist/components/table/tableControls/TableSettingsDropdown.js +53 -26
- package/dist/components/table/tableControls/TableSettingsDropdown.js.map +1 -1
- package/dist/components/table/tableControls/TableSettingsDropdown.test.d.ts +2 -0
- package/dist/components/table/tableControls/TableSettingsDropdown.test.d.ts.map +1 -0
- package/dist/components/table/tableControls/TableSettingsDropdown.test.js +178 -0
- package/dist/components/table/tableControls/TableSettingsDropdown.test.js.map +1 -0
- package/dist/components/tabs/Tabs.stories.d.ts +22 -4
- package/dist/components/tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.stories.js +398 -22
- package/dist/components/tabs/Tabs.stories.js.map +1 -1
- package/dist/components/tabs/TabsItem.stories.d.ts +54 -1
- package/dist/components/tabs/TabsItem.stories.d.ts.map +1 -1
- package/dist/components/tabs/TabsItem.stories.js +61 -9
- package/dist/components/tabs/TabsItem.stories.js.map +1 -1
- package/dist/components/toast/Toast.stories.d.ts +103 -10
- package/dist/components/toast/Toast.stories.d.ts.map +1 -1
- package/dist/components/toast/Toast.stories.js +409 -47
- package/dist/components/toast/Toast.stories.js.map +1 -1
- package/dist/components/toggle/Toggle.stories.d.ts +61 -46
- package/dist/components/toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.stories.js +311 -122
- package/dist/components/toggle/Toggle.stories.js.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.d.ts +78 -6
- package/dist/components/tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.js +413 -7
- package/dist/components/tooltip/Tooltip.stories.js.map +1 -1
- package/dist/components/tooltip/TooltipWrapper.stories.d.ts +71 -7
- package/dist/components/tooltip/TooltipWrapper.stories.d.ts.map +1 -1
- package/dist/components/tooltip/TooltipWrapper.stories.js +238 -10
- package/dist/components/tooltip/TooltipWrapper.stories.js.map +1 -1
- package/dist/index.css +8 -0
- package/dist/index.css.map +1 -1
- package/dist/utils/PopupParentContext.stories.d.ts +17 -0
- package/dist/utils/PopupParentContext.stories.d.ts.map +1 -0
- package/dist/utils/PopupParentContext.stories.js +266 -0
- package/dist/utils/PopupParentContext.stories.js.map +1 -0
- package/dist/utils/getDefaultPopupParent.d.ts.map +1 -1
- package/dist/utils/getDefaultPopupParent.js +6 -0
- package/dist/utils/getDefaultPopupParent.js.map +1 -1
- package/package.json +1 -1
- package/src/components/articleCard/ArticleCard.stories.tsx +524 -111
- package/src/components/avatar/Avatar.stories.tsx +504 -59
- package/src/components/avatarGroup/AvatarGroup.stories.tsx +977 -175
- package/src/components/banner/Banner.stories.tsx +7 -3
- package/src/components/card/Card.stories.tsx +466 -36
- package/src/components/combobox/Combobox.stories.tsx +867 -260
- package/src/components/datePicker/DatePicker.stories.tsx +777 -60
- package/src/components/dateTimePicker/DateTimePicker.stories.tsx +910 -132
- package/src/components/editableText/EditableText.stories.tsx +567 -91
- package/src/components/formField/FormField.test.tsx +6 -0
- package/src/components/formField/FormField.tsx +5 -0
- package/src/components/formField/fieldset/Fieldset.stories.tsx +761 -51
- package/src/components/formField/inputs/checkbox/CheckboxGroup.tsx +1 -1
- package/src/components/formField/inputs/checkbox/CheckboxInput.tsx +1 -1
- package/src/components/formField/inputs/colourPickerDropdown/ColourPickerDropdown.stories.tsx +504 -11
- package/src/components/formField/inputs/radio/RadioButtonGroup.tsx +17 -4
- package/src/components/formField/inputs/radio/RadioButtonInput.stories.tsx +71 -59
- package/src/components/formField/inputs/selectDropdown/SelectDropdown.stories.tsx +1079 -168
- package/src/components/formField/inputs/time/TimeInput.stories.tsx +1140 -104
- package/src/components/formField/label/Label.stories.tsx +317 -8
- package/src/components/icoText/IcoText.stories.tsx +442 -31
- package/src/components/kpiCard/KPICard.stories.tsx +475 -30
- package/src/components/kvpList/KVPList.stories.tsx +593 -26
- package/src/components/modal/Modal.stories.tsx +963 -26
- package/src/components/modal/modalManager/ModalManager.stories.tsx +612 -454
- package/src/components/pill/Pill.stories.tsx +11 -13
- package/src/components/pill/Pill.tsx +1 -0
- package/src/components/row/Row.stories.tsx +474 -58
- package/src/components/searchBar/SearchBar.stories.tsx +570 -38
- package/src/components/section/Section.stories.tsx +723 -70
- package/src/components/singleUser/SingleUser.stories.tsx +393 -34
- package/src/components/slideoverManager/SlideoverManager.stories.tsx +572 -342
- package/src/components/table/DSDefaultColDef.ts +25 -5
- package/src/components/table/Table.stories.tsx +411 -3
- package/src/components/table/Table.tsx +9 -2
- package/src/components/table/TableFooter.stories.tsx +196 -0
- package/src/components/table/TableHeader.stories.tsx +251 -0
- package/src/components/table/cellEditors/DateCellEditor.stories.tsx +245 -0
- package/src/components/table/cellRenderers/BooleanCellRenderer.stories.tsx +278 -0
- package/src/components/table/cellRenderers/ButtonCellRenderer.stories.tsx +333 -0
- package/src/components/table/cellRenderers/CheckboxCellRenderer.stories.tsx +337 -0
- package/src/components/table/cellRenderers/CheckboxCellRenderer.tsx +5 -1
- package/src/components/table/cellRenderers/DefaultCellRenderer.stories.tsx +342 -0
- package/src/components/table/cellRenderers/InlineTextCellRenderer.stories.tsx +292 -0
- package/src/components/table/cellRenderers/SelectDropdownCellRenderer.stories.tsx +369 -0
- package/src/components/table/columnFilters/BooleanFilter.stories.tsx +268 -0
- package/src/components/table/columnFilters/TimeFilter.stories.tsx +281 -0
- package/src/components/table/pagination/PaginationPanel.stories.tsx +327 -0
- package/src/components/table/tableControls/TableControls.stories.tsx +415 -0
- package/src/components/table/tableControls/TableSettingsDropdown.test.tsx +207 -0
- package/src/components/table/tableControls/TableSettingsDropdown.tsx +103 -39
- package/src/components/tabs/Tabs.stories.tsx +540 -60
- package/src/components/tabs/TabsItem.stories.tsx +82 -8
- package/src/components/toast/Toast.stories.tsx +539 -77
- package/src/components/toggle/Toggle.stories.tsx +371 -135
- package/src/components/tooltip/Tooltip.stories.tsx +606 -15
- package/src/components/tooltip/TooltipWrapper.stories.tsx +348 -12
- package/src/docs/Contributing.mdx +241 -0
- package/src/docs/UsingComponents.mdx +93 -0
- package/src/docs/Welcome.mdx +68 -0
- package/src/global.scss +7 -0
- package/src/utils/PopupParentContext.stories.tsx +367 -0
- package/src/utils/getDefaultPopupParent.ts +6 -0
- package/.ralph/storybook-upgrade/knowledge.md +0 -308
- package/.ralph/storybook-upgrade/prd.json +0 -777
- package/.ralph/storybook-upgrade/progress.md +0 -342
- package/src/components/table/TableWIP.mdx +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHeader.stories.js","sourceRoot":"","sources":["../../../src/components/table/TableHeader.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,OAAO,EACP,QAAQ,EACR,KAAK,GACN,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG;IACxB,yEAAyE;IACzE,sGAAsG;IACtG,qEAAqE;IACrE,EAAE;IACF,uFAAuF;CACxF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,cAAc,GAAG;IACrB,iBAAiB;IACjB,EAAE;IACF,kFAAkF;IAClF,0FAA0F;IAC1F,kFAAkF;IAClF,EAAE;IACF,KAAK;IACL,EAAE;IACF,qBAAqB;IACrB,EAAE;IACF,6BAA6B;IAC7B,WAAW;IACX,oFAAoF;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CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC/C,OAAO,CACL,KAAC,WAAW,IAAC,SAAS,QAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,YACnE,KAAC,aAAa,IACZ,MAAM,EAAE,EAAE,EAAE,EACZ,MAAM,EAAE,EAAE,EAAE,EACZ,UAAU,EAAE,EAAE,EAAE,EAChB,YAAY,SACZ,GACU,CACf,CAAC;IACJ,CAAC;CACF,EACD,kEAAkE;MAChE,uFAAuF;MACvF,yFAAyF,CAC5F,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU,eAAe,CAChD;IACE,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC3C,IAAI,EAAE;QACJ,QAAQ,EAAE,CACR,KAAC,aAAa,IACZ,WAAW,EAAE;gBACX,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE;gBAClD,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;aACnE,EACD,MAAM,EAAE,EAAE,EAAE,EACZ,MAAM,EAAE,EAAE,EAAE,GACZ,CACH;KACF;CACF,EACD,iEAAiE;MAC/D,2FAA2F,CAC9F,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import type { CustomCellEditorProps } from 'ag-grid-react';
|
|
3
|
+
import { DateCellEditor } from './DateCellEditor';
|
|
4
|
+
declare function DateCellEditorDocsPage(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const meta: {
|
|
6
|
+
title: string;
|
|
7
|
+
component: (props: CustomCellEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
tags: string[];
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: string;
|
|
11
|
+
docs: {
|
|
12
|
+
page: typeof DateCellEditorDocsPage;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
argTypes: {
|
|
16
|
+
value: {
|
|
17
|
+
description: string;
|
|
18
|
+
control: false;
|
|
19
|
+
table: {
|
|
20
|
+
type: {
|
|
21
|
+
summary: string;
|
|
22
|
+
};
|
|
23
|
+
defaultValue: {
|
|
24
|
+
summary: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
onValueChange: {
|
|
29
|
+
description: string;
|
|
30
|
+
control: false;
|
|
31
|
+
table: {
|
|
32
|
+
type: {
|
|
33
|
+
summary: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export default meta;
|
|
40
|
+
type Story = StoryObj<typeof DateCellEditor>;
|
|
41
|
+
export declare const Default: Story;
|
|
42
|
+
export declare const WithExistingDate: Story;
|
|
43
|
+
export declare const InATable: Story;
|
|
44
|
+
//# sourceMappingURL=DateCellEditor.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateCellEditor.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/table/cellEditors/DateCellEditor.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAW5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuElD,iBAAS,sBAAsB,4CAiB9B;AAgBD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB6B,CAAC;AAExC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAC;AAc7C,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAC;AASF,eAAO,MAAM,QAAQ,EAAE,KAqEtB,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
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 { fn } from 'storybook/test';
|
|
4
|
+
import { DateCellEditor } from './DateCellEditor';
|
|
5
|
+
import { Table } from '../../table/Table';
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Docs page content
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
const DESCRIPTION_INTRO = [
|
|
10
|
+
'`DateCellEditor` is an AG Grid cell editor component that renders an Arbor `DatePicker` inside a table cell.',
|
|
11
|
+
'It is invoked when a user begins editing a date column (e.g. by pressing Enter or double-clicking the cell).',
|
|
12
|
+
'',
|
|
13
|
+
'Register it via the AG Grid `cellEditor` column definition property.',
|
|
14
|
+
].join('\n');
|
|
15
|
+
const USAGE_GUIDANCE = [
|
|
16
|
+
'### When to use',
|
|
17
|
+
'',
|
|
18
|
+
'- On date columns that need an inline date-picker editor',
|
|
19
|
+
'- When users should be able to edit a date value directly in the table without leaving the row',
|
|
20
|
+
'',
|
|
21
|
+
'---',
|
|
22
|
+
'',
|
|
23
|
+
'### Registration',
|
|
24
|
+
'',
|
|
25
|
+
'```tsx',
|
|
26
|
+
"import { DateCellEditor } from '@arbor-education/design-system.components';",
|
|
27
|
+
'',
|
|
28
|
+
'const colDefs = [',
|
|
29
|
+
' {',
|
|
30
|
+
" field: 'dob',",
|
|
31
|
+
" headerName: 'Date of birth',",
|
|
32
|
+
' cellEditor: DateCellEditor,',
|
|
33
|
+
' // or via string key:',
|
|
34
|
+
" cellEditor: 'dsDateCellEditor',",
|
|
35
|
+
' },',
|
|
36
|
+
'];',
|
|
37
|
+
'```',
|
|
38
|
+
'',
|
|
39
|
+
'---',
|
|
40
|
+
'',
|
|
41
|
+
'### `cellEditorParams`',
|
|
42
|
+
'',
|
|
43
|
+
'Any additional props to pass to the underlying `DatePicker` can be provided via `cellEditorParams`:',
|
|
44
|
+
'',
|
|
45
|
+
'```tsx',
|
|
46
|
+
'cellEditorParams: {',
|
|
47
|
+
" placeholder: 'dd/mm/yyyy',",
|
|
48
|
+
' disabled: false,',
|
|
49
|
+
'},',
|
|
50
|
+
'```',
|
|
51
|
+
'',
|
|
52
|
+
'---',
|
|
53
|
+
'',
|
|
54
|
+
'### Value format',
|
|
55
|
+
'',
|
|
56
|
+
'The `value` and `onValueChange` use the same date format as the Arbor `DatePicker`.',
|
|
57
|
+
'Refer to the [DatePicker docs](?path=/docs/components-datepicker--docs) for format details.',
|
|
58
|
+
].join('\n');
|
|
59
|
+
const RELATED_COMPONENTS = [
|
|
60
|
+
'## Related components',
|
|
61
|
+
'',
|
|
62
|
+
'[Table](?path=/docs/components-table--docs) · [DatePicker](?path=/docs/components-datepicker--docs)',
|
|
63
|
+
].join('\n');
|
|
64
|
+
const PROPS_INTRO = 'The preview below shows `DateCellEditor` rendering the Arbor `DatePicker` with a pre-set date value. In a real table this component is mounted by AG Grid when the user begins editing a date cell.';
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
// Custom DocsPage
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
function DateCellEditorDocsPage() {
|
|
69
|
+
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: "Examples" }), _jsx(Stories, { title: "" }), _jsx(Markdown, { children: RELATED_COMPONENTS })] }));
|
|
70
|
+
}
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
// Helpers
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
const makeEditorProps = (value) => ({
|
|
75
|
+
value,
|
|
76
|
+
onValueChange: fn(),
|
|
77
|
+
colDef: { cellEditorParams: {} },
|
|
78
|
+
});
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// Meta
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
const meta = {
|
|
83
|
+
title: 'Components/Table/CellEditors/DateCellEditor',
|
|
84
|
+
component: DateCellEditor,
|
|
85
|
+
tags: ['autodocs'],
|
|
86
|
+
parameters: {
|
|
87
|
+
layout: 'padded',
|
|
88
|
+
docs: { page: DateCellEditorDocsPage },
|
|
89
|
+
},
|
|
90
|
+
argTypes: {
|
|
91
|
+
value: {
|
|
92
|
+
description: 'The current date value of the cell being edited. Format matches the Arbor `DatePicker` value format.',
|
|
93
|
+
control: false,
|
|
94
|
+
table: { type: { summary: 'string' }, defaultValue: { summary: 'undefined' } },
|
|
95
|
+
},
|
|
96
|
+
onValueChange: {
|
|
97
|
+
description: 'Called by AG Grid when the editor value changes. Receives the new date value.',
|
|
98
|
+
control: false,
|
|
99
|
+
table: { type: { summary: '(value: string) => void' } },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
export default meta;
|
|
104
|
+
const withDescription = (story, description) => ({
|
|
105
|
+
...story,
|
|
106
|
+
parameters: {
|
|
107
|
+
...story.parameters,
|
|
108
|
+
docs: { ...story.parameters?.docs, description: { story: description } },
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
// Stories
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
export const Default = withDescription({
|
|
115
|
+
render: () => _jsx(DateCellEditor, { ...makeEditorProps(undefined) }),
|
|
116
|
+
}, 'The `DateCellEditor` with no initial value — renders an empty `DatePicker` ready for input.');
|
|
117
|
+
export const WithExistingDate = withDescription({
|
|
118
|
+
parameters: { controls: { disable: true } },
|
|
119
|
+
render: () => _jsx(DateCellEditor, { ...makeEditorProps(new Date('2024-09-01')) }),
|
|
120
|
+
}, 'Pre-populated with an existing date value. In a table, AG Grid passes the cell\'s current value as `value` when the editor opens.');
|
|
121
|
+
const DATE_EDITOR_IN_TABLE_DATA = [
|
|
122
|
+
{ name: 'Alice Johnson', dateOfBirth: new Date(1990, 0, 15) },
|
|
123
|
+
{ name: 'Bob Smith', dateOfBirth: new Date(1985, 5, 20) },
|
|
124
|
+
{ name: 'Charlie Brown', dateOfBirth: new Date(1992, 10, 3) },
|
|
125
|
+
{ name: 'Diana Prince', dateOfBirth: new Date(1988, 3, 12) },
|
|
126
|
+
];
|
|
127
|
+
export const InATable = withDescription({
|
|
128
|
+
parameters: {
|
|
129
|
+
controls: { disable: true },
|
|
130
|
+
docs: {
|
|
131
|
+
source: {
|
|
132
|
+
language: 'tsx',
|
|
133
|
+
code: `
|
|
134
|
+
import { Table } from '@arbor-education/design-system.components';
|
|
135
|
+
|
|
136
|
+
const rowData = [
|
|
137
|
+
{ name: 'Alice Johnson', dateOfBirth: new Date(1990, 0, 15) },
|
|
138
|
+
{ name: 'Bob Smith', dateOfBirth: new Date(1985, 5, 20) },
|
|
139
|
+
{ name: 'Charlie Brown', dateOfBirth: new Date(1992, 10, 3) },
|
|
140
|
+
{ name: 'Diana Prince', dateOfBirth: new Date(1988, 3, 12) },
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
function DateCellEditorExample() {
|
|
144
|
+
return (
|
|
145
|
+
<Table
|
|
146
|
+
rowData={rowData}
|
|
147
|
+
columnDefs={[
|
|
148
|
+
{ field: 'name', headerName: 'Name', flex: 2, editable: false },
|
|
149
|
+
{
|
|
150
|
+
field: 'dateOfBirth',
|
|
151
|
+
headerName: 'Date of birth',
|
|
152
|
+
flex: 1,
|
|
153
|
+
editable: true,
|
|
154
|
+
cellEditor: 'dsDateCellEditor',
|
|
155
|
+
valueFormatter: (params) =>
|
|
156
|
+
params.value instanceof Date
|
|
157
|
+
? params.value.toLocaleDateString('en-GB')
|
|
158
|
+
: params.value,
|
|
159
|
+
},
|
|
160
|
+
]}
|
|
161
|
+
defaultColDef={{ flex: 1, minWidth: 120 }}
|
|
162
|
+
domLayout="autoHeight"
|
|
163
|
+
/>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export default DateCellEditorExample;
|
|
168
|
+
`.trim(),
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
render: () => (_jsx(Table, { rowData: DATE_EDITOR_IN_TABLE_DATA, columnDefs: [
|
|
173
|
+
{ field: 'name', headerName: 'Name', flex: 2, editable: false },
|
|
174
|
+
{
|
|
175
|
+
field: 'dateOfBirth',
|
|
176
|
+
headerName: 'Date of birth',
|
|
177
|
+
flex: 1,
|
|
178
|
+
editable: true,
|
|
179
|
+
cellEditor: 'dsDateCellEditor',
|
|
180
|
+
valueFormatter: params => params.value instanceof Date
|
|
181
|
+
? params.value.toLocaleDateString('en-GB')
|
|
182
|
+
: params.value,
|
|
183
|
+
},
|
|
184
|
+
], defaultColDef: { flex: 1, minWidth: 120 }, domLayout: "autoHeight" })),
|
|
185
|
+
}, '`dsDateCellEditor` wired up inside a full `Table`. Double-click (or press F2/Enter) on a Date of birth cell to open the `DatePicker` editor — AG Grid mounts the editor component and passes the current cell value as `value`. The `valueFormatter` formats the stored `Date` object as a localised string for display.');
|
|
186
|
+
//# sourceMappingURL=DateCellEditor.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateCellEditor.stories.js","sourceRoot":"","sources":["../../../../src/components/table/cellEditors/DateCellEditor.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,OAAO,EACP,QAAQ,EACR,KAAK,GACN,MAAM,8BAA8B,CAAC;AAC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C5C;IACE,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC3B,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCf,CAAC,IAAI,EAAE;aACC;SACF;KACF;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,KAAC,KAAK,IACJ,OAAO,EAAE,yBAAyB,EAClC,UAAU,EAAE;YACV,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC/D;gBACE,KAAK,EAAE,aAAa;gBACpB,UAAU,EAAE,eAAe;gBAC3B,IAAI,EAAE,CAAC;gBACP,QAAQ,EAAE,IAAI;gBACd,UAAU,EAAE,kBAAkB;gBAC9B,cAAc,EAAE,MAAM,CAAC,EAAE,CACvB,MAAM,CAAC,KAAK,YAAY,IAAI;oBAC1B,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC;oBAC1C,CAAC,CAAC,MAAM,CAAC,KAAK;aACnB;SACF,EACD,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EACzC,SAAS,EAAC,YAAY,GACtB,CACH;CACF,EACD,0TAA0T,CAC3T,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import type { CustomCellRendererProps } from 'ag-grid-react';
|
|
3
|
+
import { BooleanCellRenderer } from './BooleanCellRenderer';
|
|
4
|
+
declare function BooleanCellRendererDocsPage(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const meta: {
|
|
6
|
+
title: string;
|
|
7
|
+
component: (props: CustomCellRendererProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
tags: string[];
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: string;
|
|
11
|
+
docs: {
|
|
12
|
+
page: typeof BooleanCellRendererDocsPage;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
argTypes: {
|
|
16
|
+
value: {
|
|
17
|
+
control: {
|
|
18
|
+
type: "select";
|
|
19
|
+
};
|
|
20
|
+
options: (boolean | null)[];
|
|
21
|
+
description: string;
|
|
22
|
+
table: {
|
|
23
|
+
type: {
|
|
24
|
+
summary: string;
|
|
25
|
+
};
|
|
26
|
+
defaultValue: {
|
|
27
|
+
summary: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default meta;
|
|
34
|
+
type Story = StoryObj<typeof BooleanCellRenderer>;
|
|
35
|
+
export declare const Default: Story;
|
|
36
|
+
export declare const True: Story;
|
|
37
|
+
export declare const False: Story;
|
|
38
|
+
export declare const Empty: Story;
|
|
39
|
+
export declare const InATable: Story;
|
|
40
|
+
//# sourceMappingURL=BooleanCellRenderer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanCellRenderer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/table/cellRenderers/BooleanCellRenderer.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;AAiF5D,iBAAS,2BAA2B,4CAmBnC;AAQD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBkC,CAAC;AAE7C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAkBlD,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAwBlB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AASF,eAAO,MAAM,QAAQ,EAAE,KA6DtB,CAAC"}
|
|
@@ -0,0 +1,209 @@
|
|
|
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 { BooleanCellRenderer } from './BooleanCellRenderer';
|
|
4
|
+
import { Table } from '../../table/Table';
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Docs page content
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
const DESCRIPTION_INTRO = [
|
|
9
|
+
'`BooleanCellRenderer` is an AG Grid cell renderer that displays boolean values as icons.',
|
|
10
|
+
'A `true` value renders a green check icon; a `false` value renders a red ✕ icon;',
|
|
11
|
+
'any other value (including `null` and `undefined`) renders nothing.',
|
|
12
|
+
'',
|
|
13
|
+
'Register it via the string key `dsBooleanCellRenderer` (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 where a visual icon is clearer than plain `true`/`false` text',
|
|
19
|
+
'- Active/inactive flags, yes/no columns, on/off states that are read-only',
|
|
20
|
+
'',
|
|
21
|
+
'---',
|
|
22
|
+
'',
|
|
23
|
+
'### When NOT to use',
|
|
24
|
+
'',
|
|
25
|
+
'| Situation | Use instead |',
|
|
26
|
+
'|---|---|',
|
|
27
|
+
'| User needs to toggle the value in the cell | `CheckboxCellRenderer` (`dsCheckboxCellRenderer`) |',
|
|
28
|
+
'| You want text labels like "Yes" / "No" | A `valueFormatter` returning strings, with the default renderer |',
|
|
29
|
+
'| The value is truthy/falsy but not strictly boolean | Coerce to `true`/`false` first — see Developer notes |',
|
|
30
|
+
].join('\n');
|
|
31
|
+
const DEVELOPER_NOTES = [
|
|
32
|
+
'### Critical usage patterns',
|
|
33
|
+
'',
|
|
34
|
+
'**Value comparison is strict — only `true` and `false` produce icons.**',
|
|
35
|
+
'The renderer checks `value === true` and `value === false`. Truthy values like `1`, `"yes"`, or objects render nothing.',
|
|
36
|
+
'Coerce your data to a strict boolean before passing to this column.',
|
|
37
|
+
'',
|
|
38
|
+
'```tsx',
|
|
39
|
+
"import { Table } from '@arbor-education/design-system.components';",
|
|
40
|
+
'',
|
|
41
|
+
'const colDefs = [',
|
|
42
|
+
' {',
|
|
43
|
+
" field: 'isActive',",
|
|
44
|
+
" headerName: 'Active',",
|
|
45
|
+
" cellRenderer: 'dsBooleanCellRenderer', // string key — no import needed",
|
|
46
|
+
' },',
|
|
47
|
+
'];',
|
|
48
|
+
'```',
|
|
49
|
+
'',
|
|
50
|
+
'---',
|
|
51
|
+
'',
|
|
52
|
+
'### Accessibility',
|
|
53
|
+
'',
|
|
54
|
+
'Icons include `screenReaderText` props (`"true"` and `"false"`) so screen readers announce',
|
|
55
|
+
"the cell's boolean meaning rather than describing the icon shape.",
|
|
56
|
+
'',
|
|
57
|
+
'---',
|
|
58
|
+
'',
|
|
59
|
+
'### TypeScript types',
|
|
60
|
+
'',
|
|
61
|
+
'```ts',
|
|
62
|
+
"import { BooleanCellRenderer } from '@arbor-education/design-system.components';",
|
|
63
|
+
'```',
|
|
64
|
+
'',
|
|
65
|
+
'`BooleanCellRenderer` accepts `CustomCellRendererProps` from AG Grid — only `value` is used by this renderer.',
|
|
66
|
+
].join('\n');
|
|
67
|
+
const RELATED_COMPONENTS = [
|
|
68
|
+
'## Related components',
|
|
69
|
+
'',
|
|
70
|
+
'[Table](?path=/docs/components-table--docs) · [CheckboxCellRenderer](?path=/docs/components-table-cellrenderers-checkboxcellrenderer--docs) · [Icon](?path=/docs/components-icon--docs)',
|
|
71
|
+
].join('\n');
|
|
72
|
+
const PROPS_INTRO = 'The preview below is wired to the **Controls** panel — use the `value` selector to see how `true`, `false`, and `null` each render.';
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// Custom DocsPage
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
function BooleanCellRendererDocsPage() {
|
|
77
|
+
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 })] }));
|
|
78
|
+
}
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// Meta
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
const MOCK_CELL_PROPS = {};
|
|
83
|
+
const meta = {
|
|
84
|
+
title: 'Components/Table/CellRenderers/BooleanCellRenderer',
|
|
85
|
+
component: BooleanCellRenderer,
|
|
86
|
+
tags: ['autodocs'],
|
|
87
|
+
parameters: {
|
|
88
|
+
layout: 'padded',
|
|
89
|
+
docs: { page: BooleanCellRendererDocsPage },
|
|
90
|
+
},
|
|
91
|
+
argTypes: {
|
|
92
|
+
value: {
|
|
93
|
+
control: { type: 'select' },
|
|
94
|
+
options: [true, false, null],
|
|
95
|
+
description: 'The cell value. `true` renders a green check icon; `false` renders a red ✕ icon; any other value renders nothing.',
|
|
96
|
+
table: {
|
|
97
|
+
type: { summary: 'true | false | null | undefined' },
|
|
98
|
+
defaultValue: { summary: 'undefined' },
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
export default meta;
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// Helper: attach a per-story description to docs
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
const withDescription = (story, description) => ({
|
|
108
|
+
...story,
|
|
109
|
+
parameters: {
|
|
110
|
+
...story.parameters,
|
|
111
|
+
docs: { ...story.parameters?.docs, description: { story: description } },
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
// Stories
|
|
116
|
+
// ---------------------------------------------------------------------------
|
|
117
|
+
export const Default = withDescription({
|
|
118
|
+
args: { value: true },
|
|
119
|
+
render: args => _jsx(BooleanCellRenderer, { ...MOCK_CELL_PROPS, value: args.value }),
|
|
120
|
+
}, 'Interactive example — select `true`, `false`, or `null` from the **Controls** panel to see how each value renders.');
|
|
121
|
+
export const True = withDescription({
|
|
122
|
+
parameters: {
|
|
123
|
+
controls: { disable: true },
|
|
124
|
+
docs: {
|
|
125
|
+
source: {
|
|
126
|
+
language: 'tsx',
|
|
127
|
+
code: `
|
|
128
|
+
import { Table } from '@arbor-education/design-system.components';
|
|
129
|
+
|
|
130
|
+
const colDefs = [
|
|
131
|
+
{
|
|
132
|
+
field: 'isActive',
|
|
133
|
+
headerName: 'Active',
|
|
134
|
+
cellRenderer: 'dsBooleanCellRenderer',
|
|
135
|
+
},
|
|
136
|
+
];
|
|
137
|
+
`.trim(),
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
render: () => _jsx(BooleanCellRenderer, { ...MOCK_CELL_PROPS, value: true }),
|
|
142
|
+
}, 'A `true` value renders a green check icon. The icon carries `screenReaderText="true"` for assistive technology.');
|
|
143
|
+
export const False = withDescription({
|
|
144
|
+
parameters: { controls: { disable: true } },
|
|
145
|
+
render: () => _jsx(BooleanCellRenderer, { ...MOCK_CELL_PROPS, value: false }),
|
|
146
|
+
}, 'A `false` value renders a red ✕ icon. The icon carries `screenReaderText="false"` for assistive technology.');
|
|
147
|
+
export const Empty = withDescription({
|
|
148
|
+
parameters: { controls: { disable: true } },
|
|
149
|
+
render: () => _jsx(BooleanCellRenderer, { ...MOCK_CELL_PROPS, value: null }),
|
|
150
|
+
}, '`null`, `undefined`, or any non-boolean value renders nothing — the cell is intentionally left empty. This is by design: the renderer uses strict `=== true` / `=== false` comparisons, not truthiness.');
|
|
151
|
+
const BOOLEAN_IN_TABLE_DATA = [
|
|
152
|
+
{ name: 'Alice Johnson', active: true },
|
|
153
|
+
{ name: 'Bob Smith', active: false },
|
|
154
|
+
{ name: 'Charlie Brown', active: true },
|
|
155
|
+
{ name: 'Diana Prince', active: null },
|
|
156
|
+
];
|
|
157
|
+
export const InATable = withDescription({
|
|
158
|
+
parameters: {
|
|
159
|
+
controls: { disable: true },
|
|
160
|
+
docs: {
|
|
161
|
+
source: {
|
|
162
|
+
language: 'tsx',
|
|
163
|
+
code: `
|
|
164
|
+
import { Table } from '@arbor-education/design-system.components';
|
|
165
|
+
|
|
166
|
+
const rowData = [
|
|
167
|
+
{ name: 'Alice Johnson', active: true },
|
|
168
|
+
{ name: 'Bob Smith', active: false },
|
|
169
|
+
{ name: 'Charlie Brown', active: true },
|
|
170
|
+
{ name: 'Diana Prince', active: null },
|
|
171
|
+
];
|
|
172
|
+
|
|
173
|
+
function BooleanCellRendererExample() {
|
|
174
|
+
return (
|
|
175
|
+
<Table
|
|
176
|
+
rowData={rowData}
|
|
177
|
+
columnDefs={[
|
|
178
|
+
{ field: 'name', headerName: 'Name', flex: 2 },
|
|
179
|
+
{
|
|
180
|
+
field: 'active',
|
|
181
|
+
headerName: 'Active',
|
|
182
|
+
flex: 1,
|
|
183
|
+
editable: false,
|
|
184
|
+
cellRenderer: 'dsBooleanCellRenderer',
|
|
185
|
+
},
|
|
186
|
+
]}
|
|
187
|
+
defaultColDef={{ flex: 1, minWidth: 120 }}
|
|
188
|
+
domLayout="autoHeight"
|
|
189
|
+
/>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export default BooleanCellRendererExample;
|
|
194
|
+
`.trim(),
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
render: () => (_jsx(Table, { rowData: BOOLEAN_IN_TABLE_DATA, columnDefs: [
|
|
199
|
+
{ field: 'name', headerName: 'Name', flex: 2 },
|
|
200
|
+
{
|
|
201
|
+
field: 'active',
|
|
202
|
+
headerName: 'Active',
|
|
203
|
+
flex: 1,
|
|
204
|
+
editable: false,
|
|
205
|
+
cellRenderer: 'dsBooleanCellRenderer',
|
|
206
|
+
},
|
|
207
|
+
], defaultColDef: { flex: 1, minWidth: 120 }, domLayout: "autoHeight" })),
|
|
208
|
+
}, '`dsBooleanCellRenderer` wired up inside a full `Table`. `true` renders a check, `false` renders a ✕, and `null` leaves the cell empty. The Active column is set to `editable: false` — this renderer is display-only.');
|
|
209
|
+
//# sourceMappingURL=BooleanCellRenderer.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanCellRenderer.stories.js","sourceRoot":"","sources":["../../../../src/components/table/cellRenderers/BooleanCellRenderer.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,OAAO,EACP,QAAQ,EACR,KAAK,GACN,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG;IACxB,0FAA0F;IAC1F,kFAAkF;IAClF,qEAAqE;IACrE,EAAE;IACF,qIAAqI;CACtI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,cA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AI,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE;IACvC,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE;CACvC,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,qBAAqB,EAC9B,UAAU,EAAE;YACV,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE;YAC9C;gBACE,KAAK,EAAE,QAAQ;gBACf,UAAU,EAAE,QAAQ;gBACpB,IAAI,EAAE,CAAC;gBACP,QAAQ,EAAE,KAAK;gBACf,YAAY,EAAE,uBAAuB;aACtC;SACF,EACD,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EACzC,SAAS,EAAC,YAAY,GACtB,CACH;CACF,EACD,uNAAuN,CACxN,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import type { CustomCellRendererProps } from 'ag-grid-react';
|
|
3
|
+
import { ButtonCellRenderer } from './ButtonCellRenderer';
|
|
4
|
+
declare function ButtonCellRendererDocsPage(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const meta: {
|
|
6
|
+
title: string;
|
|
7
|
+
component: (props: CustomCellRendererProps<any, any, any> & {
|
|
8
|
+
value: import("../../button/Button").ButtonProps;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
tags: string[];
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
docs: {
|
|
14
|
+
page: typeof ButtonCellRendererDocsPage;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
argTypes: {
|
|
18
|
+
value: {
|
|
19
|
+
control: false;
|
|
20
|
+
description: string;
|
|
21
|
+
table: {
|
|
22
|
+
type: {
|
|
23
|
+
summary: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
valueFormatted: {
|
|
28
|
+
control: false;
|
|
29
|
+
description: string;
|
|
30
|
+
table: {
|
|
31
|
+
type: {
|
|
32
|
+
summary: string;
|
|
33
|
+
};
|
|
34
|
+
defaultValue: {
|
|
35
|
+
summary: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export default meta;
|
|
42
|
+
type Story = StoryObj<typeof ButtonCellRenderer>;
|
|
43
|
+
export declare const Default: Story;
|
|
44
|
+
export declare const PrimaryVariant: Story;
|
|
45
|
+
export declare const DestructiveVariant: Story;
|
|
46
|
+
export declare const Disabled: Story;
|
|
47
|
+
export declare const InATable: Story;
|
|
48
|
+
//# sourceMappingURL=ButtonCellRenderer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonCellRenderer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/table/cellRenderers/ButtonCellRenderer.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,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AA0F1D,iBAAS,0BAA0B,4CAmBlC;AAQD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBiC,CAAC;AAE5C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAkBjD,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAmC5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAWhC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAQF,eAAO,MAAM,QAAQ,EAAE,KA4EtB,CAAC"}
|