@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.stories.js","sourceRoot":"","sources":["../../../src/components/toggle/Toggle.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"Toggle.stories.js","sourceRoot":"","sources":["../../../src/components/toggle/Toggle.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,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,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG;IACxB,sDAAsD;IACtD,gFAAgF;IAChF,wGAAwG;IACxG,sEAAsE;CACvE,CAAC,IAAI,CAAC,GAAG,CAAC,CA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 +1,82 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
declare const meta:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare function TooltipDocsPage(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: {
|
|
6
|
+
(props: import("@radix-ui/react-tooltip").TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Content: (props: import("./TooltipContent").TooltipContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Trigger: (props: import("@radix-ui/react-tooltip").TooltipTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
tags: string[];
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
docs: {
|
|
14
|
+
page: typeof TooltipDocsPage;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
argTypes: {
|
|
18
|
+
delayDuration: {
|
|
19
|
+
control: "number";
|
|
20
|
+
description: string;
|
|
21
|
+
table: {
|
|
22
|
+
type: {
|
|
23
|
+
summary: string;
|
|
24
|
+
};
|
|
25
|
+
defaultValue: {
|
|
26
|
+
summary: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
open: {
|
|
31
|
+
control: false;
|
|
32
|
+
description: string;
|
|
33
|
+
table: {
|
|
34
|
+
type: {
|
|
35
|
+
summary: string;
|
|
36
|
+
};
|
|
37
|
+
defaultValue: {
|
|
38
|
+
summary: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
onOpenChange: {
|
|
43
|
+
control: false;
|
|
44
|
+
description: string;
|
|
45
|
+
table: {
|
|
46
|
+
type: {
|
|
47
|
+
summary: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
defaultOpen: {
|
|
52
|
+
control: false;
|
|
53
|
+
description: string;
|
|
54
|
+
table: {
|
|
55
|
+
type: {
|
|
56
|
+
summary: string;
|
|
57
|
+
};
|
|
58
|
+
defaultValue: {
|
|
59
|
+
summary: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
children: {
|
|
64
|
+
control: false;
|
|
65
|
+
description: string;
|
|
66
|
+
table: {
|
|
67
|
+
type: {
|
|
68
|
+
summary: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
7
72
|
};
|
|
8
73
|
};
|
|
9
74
|
export default meta;
|
|
75
|
+
type Story = StoryObj<typeof meta>;
|
|
76
|
+
export declare const Default: Story;
|
|
77
|
+
export declare const AllPlacements: Story;
|
|
78
|
+
export declare const WithoutArrow: Story;
|
|
79
|
+
export declare const WithRichContent: Story;
|
|
80
|
+
export declare const WithIconTrigger: Story;
|
|
81
|
+
export declare const HoverDelay: Story;
|
|
10
82
|
//# sourceMappingURL=Tooltip.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAmI5D,iBAAS,eAAe,4CAmBvB;AAMD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDsB,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA8JnC,eAAO,MAAM,OAAO,EAAE,KAyBrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA+D3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAiC1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAqC7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAuC7B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAmDxB,CAAC"}
|
|
@@ -1,24 +1,430 @@
|
|
|
1
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';
|
|
2
3
|
import { Tooltip } from './Tooltip';
|
|
3
4
|
import { Button } from '../button/Button';
|
|
5
|
+
import { Icon } from '../icon/Icon';
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Docs page content
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
const DESCRIPTION_INTRO = [
|
|
10
|
+
'`Tooltip` is a compound component that shows a floating label when a trigger element is hovered or focused.',
|
|
11
|
+
'It wraps [Radix UI Tooltip](https://www.radix-ui.com/primitives/docs/components/tooltip) and exposes',
|
|
12
|
+
'`Tooltip.Trigger` and `Tooltip.Content` for full compositional control.',
|
|
13
|
+
'',
|
|
14
|
+
'> **Tip:** Most use cases don\'t need full composition control.',
|
|
15
|
+
'> [`TooltipWrapper`](?path=/docs/components-tooltip-tooltipwrapper--docs) handles the wiring in a single component —',
|
|
16
|
+
'> pass your trigger as `children` and your label as `tooltipContent`.',
|
|
17
|
+
].join('\n');
|
|
18
|
+
const USAGE_GUIDANCE = [
|
|
19
|
+
'### When to use',
|
|
20
|
+
'',
|
|
21
|
+
'- **Icon-only controls** — any clickable icon without visible text needs a tooltip label',
|
|
22
|
+
'- **Abbreviations and truncated text** — reveal the full value on hover',
|
|
23
|
+
'- **Contextual hints** — brief supplementary info about a field or action that doesn\'t fit inline',
|
|
24
|
+
'',
|
|
25
|
+
'---',
|
|
26
|
+
'',
|
|
27
|
+
'### When NOT to use',
|
|
28
|
+
'',
|
|
29
|
+
'| Situation | Use instead |',
|
|
30
|
+
'|---|---|',
|
|
31
|
+
'| Information is essential to complete the task | Put it inline — don\'t hide critical guidance |',
|
|
32
|
+
'| Content is longer than ~2 lines | Use a [`Section`](?path=/docs/components-section--docs) or expand the UI |',
|
|
33
|
+
'| The trigger has no visible focus state | Fix the focusability first — keyboard users won\'t see the tooltip |',
|
|
34
|
+
'| Touch / mobile-primary surfaces | Tooltips only trigger on hover — mobile users never see them |',
|
|
35
|
+
'',
|
|
36
|
+
'---',
|
|
37
|
+
'',
|
|
38
|
+
'### Sub-component API',
|
|
39
|
+
'',
|
|
40
|
+
'#### `Tooltip`',
|
|
41
|
+
'',
|
|
42
|
+
'| Prop | Type | Default | Description |',
|
|
43
|
+
'|---|---|---|---|',
|
|
44
|
+
'| `delayDuration` | `number` | `400` | Milliseconds before the tooltip appears after hover |',
|
|
45
|
+
'| `open` | `boolean` | — | Controlled open state |',
|
|
46
|
+
'| `onOpenChange` | `(open: boolean) => void` | — | Callback for controlled mode |',
|
|
47
|
+
'| `defaultOpen` | `boolean` | — | Initial open state (uncontrolled) |',
|
|
48
|
+
'| `disableHoverableContent` | `boolean` | — | Prevents hovering over the tooltip content itself |',
|
|
49
|
+
'| `children` | `ReactNode` | — | Must include `Tooltip.Trigger` and `Tooltip.Content` |',
|
|
50
|
+
'',
|
|
51
|
+
'#### `Tooltip.Trigger`',
|
|
52
|
+
'',
|
|
53
|
+
'| Prop | Type | Default | Description |',
|
|
54
|
+
'|---|---|---|---|',
|
|
55
|
+
'| `children` | `ReactNode` | — | The element that opens the tooltip. Must be focusable. |',
|
|
56
|
+
'| `className` | `string` | — | Extra CSS class merged onto the trigger child |',
|
|
57
|
+
'',
|
|
58
|
+
'#### `Tooltip.Content`',
|
|
59
|
+
'',
|
|
60
|
+
'| Prop | Type | Default | Description |',
|
|
61
|
+
'|---|---|---|---|',
|
|
62
|
+
'| `children` | `ReactNode` | — | The tooltip body |',
|
|
63
|
+
'| `shouldShowArrow` | `boolean` | `true` | Whether to render the pointing arrow |',
|
|
64
|
+
'| `side` | `"top" \\| "right" \\| "bottom" \\| "left"` | `"top"` | Preferred placement side |',
|
|
65
|
+
'| `sideOffset` | `number` | — | Distance (px) between tooltip and trigger |',
|
|
66
|
+
'| `align` | `"start" \\| "center" \\| "end"` | `"center"` | Alignment along the side |',
|
|
67
|
+
'| `portalProps` | `TooltipPortalProps` | — | Props forwarded to `Radix.Portal` |',
|
|
68
|
+
].join('\n');
|
|
69
|
+
const DEVELOPER_NOTES = [
|
|
70
|
+
'### `asChild` is built in',
|
|
71
|
+
'',
|
|
72
|
+
'`Tooltip.Trigger` always renders with `asChild` — the Radix trigger props are merged directly onto the child element.',
|
|
73
|
+
'The child must be a focusable element (`<button>`, `<a>`, etc.) or a custom component that forwards its ref.',
|
|
74
|
+
'Wrapping a `<div>` or `<span>` without `tabIndex` will cause keyboard users to miss the tooltip.',
|
|
75
|
+
'',
|
|
76
|
+
'---',
|
|
77
|
+
'',
|
|
78
|
+
'### Portal rendering',
|
|
79
|
+
'',
|
|
80
|
+
'`Tooltip.Content` renders via a Radix portal, controlled by `PopupParentContext`.',
|
|
81
|
+
'Do **not** place containing elements with `overflow: hidden` — the tooltip will be clipped.',
|
|
82
|
+
'If you need to re-parent the portal (e.g. inside a Modal), wrap the tree with',
|
|
83
|
+
'`<PopupParentContext.Provider value={containerRef}>` — see',
|
|
84
|
+
'[`PopupParentContext`](?path=/docs/utils-popupparentcontext--docs).',
|
|
85
|
+
'',
|
|
86
|
+
'---',
|
|
87
|
+
'',
|
|
88
|
+
'### Accessibility',
|
|
89
|
+
'',
|
|
90
|
+
'- Radix automatically sets `role="tooltip"` on the content and wires `aria-describedby` on the trigger — no manual ARIA needed.',
|
|
91
|
+
'- The tooltip is announced by screen readers when the trigger receives focus.',
|
|
92
|
+
'- `delayDuration={0}` is recommended for keyboard-triggered tooltips (focus shouldn\'t require a wait).',
|
|
93
|
+
'- Never put interactive content (buttons, links) inside a tooltip — use a Popup or Dropdown instead.',
|
|
94
|
+
'',
|
|
95
|
+
'---',
|
|
96
|
+
'',
|
|
97
|
+
'### TypeScript types',
|
|
98
|
+
'',
|
|
99
|
+
'```ts',
|
|
100
|
+
"import type { Tooltip } from '@arbor-education/design-system.components';",
|
|
101
|
+
'',
|
|
102
|
+
'type Props = Tooltip.Props; // Tooltip root — extends Radix TooltipProps',
|
|
103
|
+
'type ContentProps = Tooltip.ContentProps; // Tooltip.Content',
|
|
104
|
+
'type TriggerProps = Tooltip.TriggerProps; // Tooltip.Trigger — extends Radix TooltipTriggerProps',
|
|
105
|
+
'```',
|
|
106
|
+
].join('\n');
|
|
107
|
+
const RELATED_COMPONENTS = [
|
|
108
|
+
'## Related components',
|
|
109
|
+
'',
|
|
110
|
+
'[TooltipWrapper](?path=/docs/components-tooltip-tooltipwrapper--docs) · [Button](?path=/docs/components-button--docs) · [Icon](?path=/docs/components-icon--docs)',
|
|
111
|
+
].join('\n');
|
|
112
|
+
const PROPS_INTRO = 'The preview below is wired to the **Controls** panel — tweak any prop to see the story update in real time.';
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
// Docs page
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
function TooltipDocsPage() {
|
|
117
|
+
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 })] }));
|
|
118
|
+
}
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
// Meta
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
4
122
|
const meta = {
|
|
5
|
-
title: 'Components/Tooltip
|
|
123
|
+
title: 'Components/Tooltip',
|
|
6
124
|
component: Tooltip,
|
|
7
125
|
tags: ['autodocs'],
|
|
8
126
|
parameters: {
|
|
127
|
+
layout: 'centered',
|
|
9
128
|
docs: {
|
|
10
|
-
|
|
11
|
-
|
|
129
|
+
page: TooltipDocsPage,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
argTypes: {
|
|
133
|
+
delayDuration: {
|
|
134
|
+
control: 'number',
|
|
135
|
+
description: 'Milliseconds to wait before the tooltip appears after the trigger is hovered or focused.',
|
|
136
|
+
table: {
|
|
137
|
+
type: { summary: 'number' },
|
|
138
|
+
defaultValue: { summary: '400' },
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
open: {
|
|
142
|
+
control: false,
|
|
143
|
+
description: 'Controlled open state. When provided, pair with `onOpenChange` to manage state externally.',
|
|
144
|
+
table: {
|
|
145
|
+
type: { summary: 'boolean' },
|
|
146
|
+
defaultValue: { summary: 'undefined' },
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
onOpenChange: {
|
|
150
|
+
control: false,
|
|
151
|
+
description: 'Callback fired when the open state changes. Required for controlled mode.',
|
|
152
|
+
table: {
|
|
153
|
+
type: { summary: '(open: boolean) => void' },
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
defaultOpen: {
|
|
157
|
+
control: false,
|
|
158
|
+
description: 'Initial open state for uncontrolled usage.',
|
|
159
|
+
table: {
|
|
160
|
+
type: { summary: 'boolean' },
|
|
161
|
+
defaultValue: { summary: 'false' },
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
children: {
|
|
165
|
+
control: false,
|
|
166
|
+
description: 'Must include `Tooltip.Trigger` and `Tooltip.Content` sub-components.',
|
|
167
|
+
table: {
|
|
168
|
+
type: { summary: 'ReactNode' },
|
|
12
169
|
},
|
|
13
170
|
},
|
|
14
171
|
},
|
|
15
172
|
};
|
|
173
|
+
export default meta;
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
175
|
+
// Helper
|
|
176
|
+
// ---------------------------------------------------------------------------
|
|
177
|
+
const withDescription = (story, description) => ({
|
|
178
|
+
...story,
|
|
179
|
+
parameters: {
|
|
180
|
+
...story.parameters,
|
|
181
|
+
docs: {
|
|
182
|
+
...story.parameters?.docs,
|
|
183
|
+
description: {
|
|
184
|
+
story: description,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
// ---------------------------------------------------------------------------
|
|
190
|
+
// Templates
|
|
191
|
+
// ---------------------------------------------------------------------------
|
|
192
|
+
const AllPlacementsTemplate = () => (_jsx("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 'var(--spacing-xxlarge)', padding: 'var(--spacing-xxlarge)' }, children: ['top', 'right', 'bottom', 'left'].map(side => (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 'var(--spacing-small)' }, children: [_jsx("span", { style: { fontSize: 'var(--font-size-2-13)', color: 'var(--color-grey-600)' }, children: `side="${side}"` }), _jsxs(Tooltip, { delayDuration: 0, children: [_jsx(Tooltip.Trigger, { children: _jsx(Button, { type: "secondary", children: "Hover me" }) }), _jsxs(Tooltip.Content, { side: side, children: ["Tooltip on the", ' ', side] })] })] }, side))) }));
|
|
193
|
+
const WithoutArrowTemplate = () => (_jsxs(Tooltip, { delayDuration: 0, children: [_jsx(Tooltip.Trigger, { children: _jsx(Button, { type: "secondary", children: "Hover me" }) }), _jsx(Tooltip.Content, { shouldShowArrow: false, children: "No arrow on this tooltip" })] }));
|
|
194
|
+
const WithRichContentTemplate = () => (_jsxs(Tooltip, { delayDuration: 0, children: [_jsx(Tooltip.Trigger, { children: _jsx(Button, { type: "secondary", children: "Assessment period" }) }), _jsx(Tooltip.Content, { children: _jsxs("div", { children: [_jsx("strong", { children: "Autumn 1 2024\u201325" }), _jsx("div", { children: "Sep 2 \u2013 Oct 25" })] }) })] }));
|
|
195
|
+
const WithIconTriggerTemplate = () => (_jsxs("div", { style: { display: 'flex', gap: 'var(--spacing-small)' }, children: [_jsxs(Tooltip, { delayDuration: 0, children: [_jsx(Tooltip.Trigger, { children: _jsx("button", { type: "button", "aria-label": "Download report", style: { background: 'none', border: 'none', cursor: 'pointer', padding: 'var(--spacing-xsmall)', display: 'flex' }, children: _jsx(Icon, { name: "download", size: 24 }) }) }), _jsx(Tooltip.Content, { children: "Download report" })] }), _jsxs(Tooltip, { delayDuration: 0, children: [_jsx(Tooltip.Trigger, { children: _jsx("button", { type: "button", "aria-label": "Export data", style: { background: 'none', border: 'none', cursor: 'pointer', padding: 'var(--spacing-xsmall)', display: 'flex' }, children: _jsx(Icon, { name: "share", size: 24 }) }) }), _jsx(Tooltip.Content, { children: "Export data" })] }), _jsxs(Tooltip, { delayDuration: 0, children: [_jsx(Tooltip.Trigger, { children: _jsx("button", { type: "button", "aria-label": "Settings", style: { background: 'none', border: 'none', cursor: 'pointer', padding: 'var(--spacing-xsmall)', display: 'flex' }, children: _jsx(Icon, { name: "settings", size: 24 }) }) }), _jsx(Tooltip.Content, { children: "Settings" })] })] }));
|
|
196
|
+
const SlowDelayTemplate = () => (_jsxs("div", { style: { display: 'flex', gap: 'var(--spacing-large)', alignItems: 'center' }, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 'var(--spacing-small)' }, children: [_jsxs("span", { style: { fontSize: 'var(--font-size-2-13)', color: 'var(--color-grey-600)' }, children: ["delayDuration=", 0] }), _jsxs(Tooltip, { delayDuration: 0, children: [_jsx(Tooltip.Trigger, { children: _jsx(Button, { type: "secondary", children: "Instant" }) }), _jsx(Tooltip.Content, { children: "Shows immediately on hover" })] })] }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 'var(--spacing-small)' }, children: [_jsxs("span", { style: { fontSize: 'var(--font-size-2-13)', color: 'var(--color-grey-600)' }, children: ["delayDuration=", 400, ' ', "(default)"] }), _jsxs(Tooltip, { delayDuration: 400, children: [_jsx(Tooltip.Trigger, { children: _jsx(Button, { type: "secondary", children: "Default delay" }) }), _jsx(Tooltip.Content, { children: "Shows after 400ms" })] })] }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 'var(--spacing-small)' }, children: [_jsxs("span", { style: { fontSize: 'var(--font-size-2-13)', color: 'var(--color-grey-600)' }, children: ["delayDuration=", 1000] }), _jsxs(Tooltip, { delayDuration: 1000, children: [_jsx(Tooltip.Trigger, { children: _jsx(Button, { type: "secondary", children: "Slow" }) }), _jsx(Tooltip.Content, { children: "Shows after 1 second" })] })] })] }));
|
|
197
|
+
// ---------------------------------------------------------------------------
|
|
198
|
+
// Stories
|
|
199
|
+
// ---------------------------------------------------------------------------
|
|
16
200
|
export const Default = {
|
|
17
201
|
args: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
202
|
+
delayDuration: 400,
|
|
203
|
+
},
|
|
204
|
+
render: args => (_jsxs(Tooltip, { ...args, children: [_jsx(Tooltip.Trigger, { children: _jsx(Button, { type: "primary", children: "Hover or focus me" }) }), _jsx(Tooltip.Content, { children: "This is a tooltip" })] })),
|
|
205
|
+
parameters: {
|
|
206
|
+
docs: {
|
|
207
|
+
description: {
|
|
208
|
+
story: [
|
|
209
|
+
'The `Tooltip` compound component requires `Tooltip.Trigger` and `Tooltip.Content` as children.',
|
|
210
|
+
'The trigger element must be focusable — `Tooltip.Trigger` uses `asChild` to merge props onto the child.',
|
|
211
|
+
'Use the **Controls** panel to adjust `delayDuration`.',
|
|
212
|
+
].join(' '),
|
|
213
|
+
},
|
|
214
|
+
},
|
|
21
215
|
},
|
|
22
216
|
};
|
|
23
|
-
export
|
|
217
|
+
export const AllPlacements = withDescription({
|
|
218
|
+
render: AllPlacementsTemplate,
|
|
219
|
+
parameters: {
|
|
220
|
+
controls: { disable: true },
|
|
221
|
+
layout: 'centered',
|
|
222
|
+
docs: {
|
|
223
|
+
source: {
|
|
224
|
+
language: 'tsx',
|
|
225
|
+
code: `
|
|
226
|
+
import { Tooltip } from '@arbor-education/design-system.components';
|
|
227
|
+
|
|
228
|
+
function TooltipAllPlacementsExample() {
|
|
229
|
+
return (
|
|
230
|
+
<>
|
|
231
|
+
<Tooltip delayDuration={0}>
|
|
232
|
+
<Tooltip.Trigger>
|
|
233
|
+
<button type="button">Top (default)</button>
|
|
234
|
+
</Tooltip.Trigger>
|
|
235
|
+
<Tooltip.Content side="top">
|
|
236
|
+
Tooltip on the top
|
|
237
|
+
</Tooltip.Content>
|
|
238
|
+
</Tooltip>
|
|
239
|
+
|
|
240
|
+
<Tooltip delayDuration={0}>
|
|
241
|
+
<Tooltip.Trigger>
|
|
242
|
+
<button type="button">Right</button>
|
|
243
|
+
</Tooltip.Trigger>
|
|
244
|
+
<Tooltip.Content side="right">
|
|
245
|
+
Tooltip on the right
|
|
246
|
+
</Tooltip.Content>
|
|
247
|
+
</Tooltip>
|
|
248
|
+
|
|
249
|
+
<Tooltip delayDuration={0}>
|
|
250
|
+
<Tooltip.Trigger>
|
|
251
|
+
<button type="button">Bottom</button>
|
|
252
|
+
</Tooltip.Trigger>
|
|
253
|
+
<Tooltip.Content side="bottom">
|
|
254
|
+
Tooltip on the bottom
|
|
255
|
+
</Tooltip.Content>
|
|
256
|
+
</Tooltip>
|
|
257
|
+
|
|
258
|
+
<Tooltip delayDuration={0}>
|
|
259
|
+
<Tooltip.Trigger>
|
|
260
|
+
<button type="button">Left</button>
|
|
261
|
+
</Tooltip.Trigger>
|
|
262
|
+
<Tooltip.Content side="left">
|
|
263
|
+
Tooltip on the left
|
|
264
|
+
</Tooltip.Content>
|
|
265
|
+
</Tooltip>
|
|
266
|
+
</>
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
export default TooltipAllPlacementsExample;
|
|
270
|
+
`.trim(),
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
}, [
|
|
275
|
+
'Use the `side` prop on `Tooltip.Content` to control which side the tooltip appears on.',
|
|
276
|
+
'Radix will automatically flip to the opposite side if there\'s not enough viewport space.',
|
|
277
|
+
].join(' '));
|
|
278
|
+
export const WithoutArrow = withDescription({
|
|
279
|
+
render: WithoutArrowTemplate,
|
|
280
|
+
parameters: {
|
|
281
|
+
controls: { disable: true },
|
|
282
|
+
docs: {
|
|
283
|
+
source: {
|
|
284
|
+
language: 'tsx',
|
|
285
|
+
code: `
|
|
286
|
+
import { Tooltip } from '@arbor-education/design-system.components';
|
|
287
|
+
|
|
288
|
+
function TooltipWithoutArrowExample() {
|
|
289
|
+
return (
|
|
290
|
+
<Tooltip delayDuration={0}>
|
|
291
|
+
<Tooltip.Trigger>
|
|
292
|
+
<button type="button">Hover me</button>
|
|
293
|
+
</Tooltip.Trigger>
|
|
294
|
+
<Tooltip.Content shouldShowArrow={false}>
|
|
295
|
+
No arrow on this tooltip
|
|
296
|
+
</Tooltip.Content>
|
|
297
|
+
</Tooltip>
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
export default TooltipWithoutArrowExample;
|
|
301
|
+
`.trim(),
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
}, [
|
|
306
|
+
'Set `shouldShowArrow={false}` on `Tooltip.Content` to hide the pointing arrow.',
|
|
307
|
+
'Useful when the tooltip is positioned far from the trigger or inside a dense UI.',
|
|
308
|
+
].join(' '));
|
|
309
|
+
export const WithRichContent = withDescription({
|
|
310
|
+
render: WithRichContentTemplate,
|
|
311
|
+
parameters: {
|
|
312
|
+
controls: { disable: true },
|
|
313
|
+
docs: {
|
|
314
|
+
source: {
|
|
315
|
+
language: 'tsx',
|
|
316
|
+
code: `
|
|
317
|
+
import { Tooltip } from '@arbor-education/design-system.components';
|
|
318
|
+
|
|
319
|
+
function TooltipWithRichContentExample() {
|
|
320
|
+
return (
|
|
321
|
+
<Tooltip delayDuration={0}>
|
|
322
|
+
<Tooltip.Trigger>
|
|
323
|
+
<button type="button">Assessment period</button>
|
|
324
|
+
</Tooltip.Trigger>
|
|
325
|
+
<Tooltip.Content>
|
|
326
|
+
<div>
|
|
327
|
+
<strong>Autumn 1 2024–25</strong>
|
|
328
|
+
<div>Sep 2 – Oct 25</div>
|
|
329
|
+
</div>
|
|
330
|
+
</Tooltip.Content>
|
|
331
|
+
</Tooltip>
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
export default TooltipWithRichContentExample;
|
|
335
|
+
`.trim(),
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
}, [
|
|
340
|
+
'`Tooltip.Content` accepts any `ReactNode` — use structured markup for richer labels.',
|
|
341
|
+
'Keep content short: tooltips should clarify, not teach.',
|
|
342
|
+
'Never put interactive elements (buttons, links) inside a tooltip.',
|
|
343
|
+
].join(' '));
|
|
344
|
+
export const WithIconTrigger = withDescription({
|
|
345
|
+
render: WithIconTriggerTemplate,
|
|
346
|
+
parameters: {
|
|
347
|
+
controls: { disable: true },
|
|
348
|
+
docs: {
|
|
349
|
+
source: {
|
|
350
|
+
language: 'tsx',
|
|
351
|
+
code: `
|
|
352
|
+
import { Icon, Tooltip } from '@arbor-education/design-system.components';
|
|
353
|
+
|
|
354
|
+
// Icon-only controls must have both aria-label (for screen readers)
|
|
355
|
+
// and a Tooltip (for sighted users who hover).
|
|
356
|
+
function TooltipWithIconTriggerExample() {
|
|
357
|
+
return (
|
|
358
|
+
<Tooltip delayDuration={0}>
|
|
359
|
+
<Tooltip.Trigger>
|
|
360
|
+
<button
|
|
361
|
+
type="button"
|
|
362
|
+
aria-label="Download report"
|
|
363
|
+
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 'var(--spacing-xsmall)', display: 'flex' }}
|
|
364
|
+
>
|
|
365
|
+
<Icon name="download" size={24} />
|
|
366
|
+
</button>
|
|
367
|
+
</Tooltip.Trigger>
|
|
368
|
+
<Tooltip.Content>Download report</Tooltip.Content>
|
|
369
|
+
</Tooltip>
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
export default TooltipWithIconTriggerExample;
|
|
373
|
+
`.trim(),
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
}, [
|
|
378
|
+
'Icon-only buttons must have both an `aria-label` (for screen readers) and a `Tooltip` (for sighted mouse users).',
|
|
379
|
+
'The two convey the same information through different channels — they\'re complementary, not redundant.',
|
|
380
|
+
].join(' '));
|
|
381
|
+
export const HoverDelay = withDescription({
|
|
382
|
+
render: SlowDelayTemplate,
|
|
383
|
+
parameters: {
|
|
384
|
+
controls: { disable: true },
|
|
385
|
+
layout: 'centered',
|
|
386
|
+
docs: {
|
|
387
|
+
source: {
|
|
388
|
+
language: 'tsx',
|
|
389
|
+
code: `
|
|
390
|
+
import { Tooltip } from '@arbor-education/design-system.components';
|
|
391
|
+
|
|
392
|
+
// delayDuration={0} is best for keyboard-triggered tooltips (focus shouldn't wait).
|
|
393
|
+
// The default 400ms prevents flicker when the user is just moving the cursor past buttons.
|
|
394
|
+
function TooltipHoverDelayExample() {
|
|
395
|
+
return (
|
|
396
|
+
<>
|
|
397
|
+
<Tooltip delayDuration={0}>
|
|
398
|
+
<Tooltip.Trigger>
|
|
399
|
+
<button type="button">Instant (0ms)</button>
|
|
400
|
+
</Tooltip.Trigger>
|
|
401
|
+
<Tooltip.Content>Shows immediately on hover</Tooltip.Content>
|
|
402
|
+
</Tooltip>
|
|
403
|
+
|
|
404
|
+
<Tooltip delayDuration={400}>
|
|
405
|
+
<Tooltip.Trigger>
|
|
406
|
+
<button type="button">Default (400ms)</button>
|
|
407
|
+
</Tooltip.Trigger>
|
|
408
|
+
<Tooltip.Content>Shows after 400ms</Tooltip.Content>
|
|
409
|
+
</Tooltip>
|
|
410
|
+
|
|
411
|
+
<Tooltip delayDuration={1000}>
|
|
412
|
+
<Tooltip.Trigger>
|
|
413
|
+
<button type="button">Slow (1000ms)</button>
|
|
414
|
+
</Tooltip.Trigger>
|
|
415
|
+
<Tooltip.Content>Shows after 1 second</Tooltip.Content>
|
|
416
|
+
</Tooltip>
|
|
417
|
+
</>
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
export default TooltipHoverDelayExample;
|
|
421
|
+
`.trim(),
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
}, [
|
|
426
|
+
'`delayDuration` controls how long the user must hover before the tooltip appears.',
|
|
427
|
+
'The default 400ms prevents noise when the cursor moves across the page.',
|
|
428
|
+
'Use `delayDuration={0}` for icon-only controls where the label is the primary way to understand the action.',
|
|
429
|
+
].join(' '));
|
|
24
430
|
//# sourceMappingURL=Tooltip.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.stories.js","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.stories.js","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,QAAQ,EACR,OAAO,IAAI,UAAU,EACrB,OAAO,EACP,QAAQ,EACR,KAAK,GACN,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG;IACxB,6GAA6G;IAC7G,sGAAsG;IACtG,yEAAyE;IACzE,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