@deriv-com/dds-marketing 0.1.0 → 0.2.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/.llm/components/accordion.md +193 -0
- package/.llm/components/accordionitem.md +236 -0
- package/.llm/components/aspectratio.md +212 -0
- package/.llm/components/badge.md +231 -0
- package/.llm/components/bottomsheet.md +404 -0
- package/.llm/components/breadcrumb.md +197 -0
- package/.llm/components/breadcrumbitem.md +178 -0
- package/.llm/components/button.md +271 -0
- package/.llm/components/buttonicon.md +313 -0
- package/.llm/components/card.md +313 -0
- package/.llm/components/cardbody.md +409 -0
- package/.llm/components/cardbutton.md +259 -0
- package/.llm/components/checkbox.md +285 -0
- package/.llm/components/divider.md +230 -0
- package/.llm/components/dropdownmenu.md +453 -0
- package/.llm/components/filterchip.md +314 -0
- package/.llm/components/footer.md +408 -0
- package/.llm/components/footergroup.md +241 -0
- package/.llm/components/grid.md +659 -0
- package/.llm/components/icon.md +194 -0
- package/.llm/components/link.md +354 -0
- package/.llm/components/menuitem.md +218 -0
- package/.llm/components/navbar.md +458 -0
- package/.llm/components/navbaritem.md +238 -0
- package/.llm/components/navbarmenu.md +319 -0
- package/.llm/components/navbarmenugroup.md +184 -0
- package/.llm/components/navbarpanel.md +255 -0
- package/.llm/components/navbarswitcher.md +343 -0
- package/.llm/components/navbarswitcheroption.md +156 -0
- package/.llm/components/option.md +268 -0
- package/.llm/components/pagination.md +361 -0
- package/.llm/components/removablechip.md +247 -0
- package/.llm/components/row.md +381 -0
- package/.llm/components/scroller.md +470 -0
- package/.llm/components/searchinput.md +279 -0
- package/.llm/components/segmentedcontrol.md +358 -0
- package/.llm/components/segmentedcontrolitem.md +272 -0
- package/.llm/components/select.md +509 -0
- package/.llm/components/selectchip.md +334 -0
- package/.llm/components/spinner.md +222 -0
- package/.llm/components/stack.md +334 -0
- package/.llm/components/statusdot.md +205 -0
- package/.llm/components/subdomainnavbar.md +327 -0
- package/.llm/components/tab.md +291 -0
- package/.llm/components/table.md +660 -0
- package/.llm/components/tablebody.md +258 -0
- package/.llm/components/tablecell.md +248 -0
- package/.llm/components/tablehead.md +248 -0
- package/.llm/components/tableheadercell.md +298 -0
- package/.llm/components/tablerow.md +285 -0
- package/.llm/components/tablist.md +210 -0
- package/.llm/components/textarea.md +362 -0
- package/.llm/components/textinput.md +467 -0
- package/.llm/components/tooltip.md +267 -0
- package/.llm/components/typography.md +245 -0
- package/.llm/digest/accordion.md +43 -0
- package/.llm/digest/accordionitem.md +47 -0
- package/.llm/digest/aspectratio.md +47 -0
- package/.llm/digest/badge.md +45 -0
- package/.llm/digest/bottomsheet.md +69 -0
- package/.llm/digest/breadcrumb.md +38 -0
- package/.llm/digest/breadcrumbitem.md +43 -0
- package/.llm/digest/button.md +48 -0
- package/.llm/digest/buttonicon.md +61 -0
- package/.llm/digest/card.md +50 -0
- package/.llm/digest/cardbody.md +68 -0
- package/.llm/digest/cardbutton.md +49 -0
- package/.llm/digest/checkbox.md +63 -0
- package/.llm/digest/divider.md +52 -0
- package/.llm/digest/dropdownmenu.md +67 -0
- package/.llm/digest/filterchip.md +68 -0
- package/.llm/digest/footer.md +57 -0
- package/.llm/digest/footergroup.md +42 -0
- package/.llm/digest/grid.md +62 -0
- package/.llm/digest/icon.md +45 -0
- package/.llm/digest/link.md +59 -0
- package/.llm/digest/menuitem.md +46 -0
- package/.llm/digest/navbar.md +60 -0
- package/.llm/digest/navbaritem.md +54 -0
- package/.llm/digest/navbarmenu.md +54 -0
- package/.llm/digest/navbarmenugroup.md +40 -0
- package/.llm/digest/navbarpanel.md +53 -0
- package/.llm/digest/navbarswitcher.md +51 -0
- package/.llm/digest/navbarswitcheroption.md +37 -0
- package/.llm/digest/option.md +54 -0
- package/.llm/digest/pagination.md +71 -0
- package/.llm/digest/removablechip.md +51 -0
- package/.llm/digest/row.md +60 -0
- package/.llm/digest/scroller.md +59 -0
- package/.llm/digest/searchinput.md +56 -0
- package/.llm/digest/segmentedcontrol.md +59 -0
- package/.llm/digest/segmentedcontrolitem.md +59 -0
- package/.llm/digest/select.md +92 -0
- package/.llm/digest/selectchip.md +68 -0
- package/.llm/digest/spinner.md +52 -0
- package/.llm/digest/stack.md +56 -0
- package/.llm/digest/statusdot.md +46 -0
- package/.llm/digest/subdomainnavbar.md +54 -0
- package/.llm/digest/tab.md +60 -0
- package/.llm/digest/table.md +71 -0
- package/.llm/digest/tablebody.md +49 -0
- package/.llm/digest/tablecell.md +55 -0
- package/.llm/digest/tablehead.md +50 -0
- package/.llm/digest/tableheadercell.md +65 -0
- package/.llm/digest/tablerow.md +56 -0
- package/.llm/digest/tablist.md +46 -0
- package/.llm/digest/textarea.md +78 -0
- package/.llm/digest/textinput.md +95 -0
- package/.llm/digest/tooltip.md +58 -0
- package/.llm/digest/typography.md +59 -0
- package/.llm/index.md +86 -0
- package/.llm/rules.md +122 -0
- package/.llm/tokens.md +341 -0
- package/AGENTS.md +164 -0
- package/LICENSE +21 -0
- package/README.md +63 -15
- package/dist/components/core/accordion/Accordion.css +10 -0
- package/dist/components/core/accordion/Accordion.d.ts +20 -0
- package/dist/components/core/accordion/Accordion.js +69 -0
- package/dist/components/core/accordion/Accordion.types.d.ts +20 -0
- package/dist/components/core/accordion/Accordion.types.js +7 -0
- package/dist/components/core/accordion-item/AccordionItem.css +98 -0
- package/dist/components/core/accordion-item/AccordionItem.d.ts +44 -0
- package/dist/components/core/accordion-item/AccordionItem.js +63 -0
- package/dist/components/core/accordion-item/AccordionItem.types.d.ts +32 -0
- package/dist/components/core/accordion-item/AccordionItem.types.js +13 -0
- package/dist/components/core/accordion-item/accordion-item-impl.css +107 -0
- package/dist/components/core/badge/Badge.css +37 -0
- package/dist/components/core/badge/Badge.d.ts +37 -0
- package/dist/components/core/badge/Badge.js +40 -0
- package/dist/components/core/badge/Badge.types.d.ts +24 -0
- package/dist/components/core/badge/Badge.types.js +8 -0
- package/dist/components/core/badge/badge-impl.css +32 -0
- package/dist/components/core/bottom-sheet/BottomSheet.css +178 -0
- package/dist/components/core/bottom-sheet/BottomSheet.d.ts +22 -0
- package/dist/components/core/bottom-sheet/BottomSheet.js +359 -0
- package/dist/components/core/bottom-sheet/BottomSheet.types.d.ts +67 -0
- package/dist/components/core/bottom-sheet/BottomSheet.types.js +18 -0
- package/dist/components/core/bottom-sheet/bottom-sheet-impl.css +57 -0
- package/dist/components/core/breadcrumb/Breadcrumb.css +19 -0
- package/dist/components/core/breadcrumb/Breadcrumb.d.ts +16 -0
- package/dist/components/core/breadcrumb/Breadcrumb.js +22 -0
- package/dist/components/core/breadcrumb/Breadcrumb.types.d.ts +18 -0
- package/dist/components/core/breadcrumb/Breadcrumb.types.js +9 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.css +34 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.d.ts +12 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.js +15 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.types.d.ts +22 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.types.js +9 -0
- package/dist/components/core/button/Button.css +141 -0
- package/dist/components/core/button/Button.d.ts +25 -0
- package/dist/components/core/button/Button.js +28 -0
- package/dist/components/core/button/Button.types.d.ts +40 -0
- package/dist/components/core/button/Button.types.js +9 -0
- package/dist/components/core/button/button-impl.css +46 -0
- package/dist/components/core/button-icon/ButtonIcon.css +135 -0
- package/dist/components/core/button-icon/ButtonIcon.d.ts +34 -0
- package/dist/components/core/button-icon/ButtonIcon.js +117 -0
- package/dist/components/core/button-icon/ButtonIcon.types.d.ts +41 -0
- package/dist/components/core/button-icon/ButtonIcon.types.js +8 -0
- package/dist/components/core/card/Card.css +65 -0
- package/dist/components/core/card/Card.d.ts +24 -0
- package/dist/components/core/card/Card.js +26 -0
- package/dist/components/core/card/Card.types.d.ts +33 -0
- package/dist/components/core/card/Card.types.js +7 -0
- package/dist/components/core/card-body/CardBody.css +139 -0
- package/dist/components/core/card-body/CardBody.d.ts +62 -0
- package/dist/components/core/card-body/CardBody.js +97 -0
- package/dist/components/core/card-body/CardBody.types.d.ts +61 -0
- package/dist/components/core/card-body/CardBody.types.js +15 -0
- package/dist/components/core/card-body/card-body-impl.css +87 -0
- package/dist/components/core/card-button/CardButton.css +73 -0
- package/dist/components/core/card-button/CardButton.d.ts +27 -0
- package/dist/components/core/card-button/CardButton.js +37 -0
- package/dist/components/core/card-button/CardButton.types.d.ts +24 -0
- package/dist/components/core/card-button/CardButton.types.js +7 -0
- package/dist/components/core/card-button/card-button-impl.css +39 -0
- package/dist/components/core/checkbox/Checkbox.css +149 -0
- package/dist/components/core/checkbox/Checkbox.d.ts +21 -0
- package/dist/components/core/checkbox/Checkbox.js +97 -0
- package/dist/components/core/checkbox/Checkbox.types.d.ts +46 -0
- package/dist/components/core/checkbox/Checkbox.types.js +15 -0
- package/dist/components/core/checkbox/checkbox-impl.css +90 -0
- package/dist/components/core/divider/Divider.css +41 -0
- package/dist/components/core/divider/Divider.d.ts +46 -0
- package/dist/components/core/divider/Divider.js +51 -0
- package/dist/components/core/divider/Divider.types.d.ts +25 -0
- package/dist/components/core/divider/Divider.types.js +9 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.css +146 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.d.ts +22 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.js +309 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.types.d.ts +62 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.types.js +12 -0
- package/dist/components/core/dropdown-menu/dropdown-menu-impl.css +70 -0
- package/dist/components/core/filter-chip/FilterChip.css +149 -0
- package/dist/components/core/filter-chip/FilterChip.d.ts +23 -0
- package/dist/components/core/filter-chip/FilterChip.js +37 -0
- package/dist/components/core/filter-chip/FilterChip.types.d.ts +53 -0
- package/dist/components/core/filter-chip/FilterChip.types.js +12 -0
- package/dist/components/core/footer/Footer.css +104 -0
- package/dist/components/core/footer/Footer.d.ts +43 -0
- package/dist/components/core/footer/Footer.js +53 -0
- package/dist/components/core/footer/Footer.types.d.ts +47 -0
- package/dist/components/core/footer/Footer.types.js +18 -0
- package/dist/components/core/footer/footer-impl.css +218 -0
- package/dist/components/core/footer-group/FooterGroup.css +90 -0
- package/dist/components/core/footer-group/FooterGroup.d.ts +32 -0
- package/dist/components/core/footer-group/FooterGroup.js +64 -0
- package/dist/components/core/footer-group/FooterGroup.types.d.ts +25 -0
- package/dist/components/core/footer-group/FooterGroup.types.js +12 -0
- package/dist/components/core/footer-group/footer-group-impl.css +78 -0
- package/dist/components/core/icon/Icon.css +40 -0
- package/dist/components/core/icon/Icon.d.ts +23 -0
- package/dist/components/core/icon/Icon.js +79 -0
- package/dist/components/core/icon/Icon.types.d.ts +24 -0
- package/dist/components/core/icon/Icon.types.js +7 -0
- package/dist/components/core/link/Link.css +89 -0
- package/dist/components/core/link/Link.d.ts +37 -0
- package/dist/components/core/link/Link.js +141 -0
- package/dist/components/core/link/Link.types.d.ts +41 -0
- package/dist/components/core/link/Link.types.js +9 -0
- package/dist/components/core/link/link-impl.css +168 -0
- package/dist/components/core/menu-item/MenuItem.css +70 -0
- package/dist/components/core/menu-item/MenuItem.d.ts +11 -0
- package/dist/components/core/menu-item/MenuItem.js +26 -0
- package/dist/components/core/menu-item/MenuItem.types.d.ts +28 -0
- package/dist/components/core/menu-item/MenuItem.types.js +9 -0
- package/dist/components/core/navbar/Navbar.css +135 -0
- package/dist/components/core/navbar/Navbar.d.ts +36 -0
- package/dist/components/core/navbar/Navbar.js +371 -0
- package/dist/components/core/navbar/Navbar.types.d.ts +49 -0
- package/dist/components/core/navbar/Navbar.types.js +17 -0
- package/dist/components/core/navbar/navbar-impl.css +590 -0
- package/dist/components/core/navbar-item/NavbarItem.css +75 -0
- package/dist/components/core/navbar-item/NavbarItem.d.ts +22 -0
- package/dist/components/core/navbar-item/NavbarItem.js +40 -0
- package/dist/components/core/navbar-item/NavbarItem.types.d.ts +34 -0
- package/dist/components/core/navbar-item/NavbarItem.types.js +10 -0
- package/dist/components/core/navbar-menu/NavbarMenu.css +128 -0
- package/dist/components/core/navbar-menu/NavbarMenu.d.ts +5 -0
- package/dist/components/core/navbar-menu/NavbarMenu.js +186 -0
- package/dist/components/core/navbar-menu/NavbarMenu.types.d.ts +45 -0
- package/dist/components/core/navbar-menu/NavbarMenu.types.js +12 -0
- package/dist/components/core/navbar-menu/navbar-menu-impl.css +186 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.css +26 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.d.ts +17 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.js +22 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.types.d.ts +14 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.types.js +7 -0
- package/dist/components/core/navbar-panel/NavbarPanel.css +87 -0
- package/dist/components/core/navbar-panel/NavbarPanel.d.ts +34 -0
- package/dist/components/core/navbar-panel/NavbarPanel.js +46 -0
- package/dist/components/core/navbar-panel/NavbarPanel.types.d.ts +29 -0
- package/dist/components/core/navbar-panel/NavbarPanel.types.js +12 -0
- package/dist/components/core/navbar-panel/navbar-panel-impl.css +104 -0
- package/dist/components/core/navbar-panel/use-navbar-panel.d.ts +26 -0
- package/dist/components/core/navbar-panel/use-navbar-panel.js +135 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.css +117 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.d.ts +20 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.js +90 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.types.d.ts +46 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.types.js +13 -0
- package/dist/components/core/navbar-switcher/navbar-switcher-impl.css +179 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.css +39 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.d.ts +16 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.js +19 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.types.d.ts +18 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.types.js +7 -0
- package/dist/components/core/option/Option.css +133 -0
- package/dist/components/core/option/Option.d.ts +25 -0
- package/dist/components/core/option/Option.js +31 -0
- package/dist/components/core/option/Option.types.d.ts +44 -0
- package/dist/components/core/option/Option.types.js +14 -0
- package/dist/components/core/pagination/Pagination.css +237 -0
- package/dist/components/core/pagination/Pagination.d.ts +30 -0
- package/dist/components/core/pagination/Pagination.js +406 -0
- package/dist/components/core/pagination/Pagination.types.d.ts +59 -0
- package/dist/components/core/pagination/Pagination.types.js +14 -0
- package/dist/components/core/pagination/pagination-impl.css +17 -0
- package/dist/components/core/removable-chip/RemovableChip.css +125 -0
- package/dist/components/core/removable-chip/RemovableChip.d.ts +25 -0
- package/dist/components/core/removable-chip/RemovableChip.js +36 -0
- package/dist/components/core/removable-chip/RemovableChip.types.d.ts +38 -0
- package/dist/components/core/removable-chip/RemovableChip.types.js +13 -0
- package/dist/components/core/search-input/SearchInput.css +205 -0
- package/dist/components/core/search-input/SearchInput.d.ts +5 -0
- package/dist/components/core/search-input/SearchInput.js +81 -0
- package/dist/components/core/search-input/SearchInput.types.d.ts +43 -0
- package/dist/components/core/search-input/SearchInput.types.js +13 -0
- package/dist/components/core/search-input/search-input-impl.css +20 -0
- package/dist/components/core/segmented-control/SegmentedControl.css +57 -0
- package/dist/components/core/segmented-control/SegmentedControl.d.ts +37 -0
- package/dist/components/core/segmented-control/SegmentedControl.js +269 -0
- package/dist/components/core/segmented-control/SegmentedControl.types.d.ts +38 -0
- package/dist/components/core/segmented-control/SegmentedControl.types.js +8 -0
- package/dist/components/core/segmented-control/segmented-control-impl.css +57 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.css +151 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.d.ts +50 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.js +101 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.types.d.ts +37 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.types.js +10 -0
- package/dist/components/core/segmented-control-item/segmented-control-item-impl.css +69 -0
- package/dist/components/core/select/Select.css +400 -0
- package/dist/components/core/select/Select.d.ts +29 -0
- package/dist/components/core/select/Select.js +524 -0
- package/dist/components/core/select/Select.types.d.ts +96 -0
- package/dist/components/core/select/Select.types.js +26 -0
- package/dist/components/core/select/select-impl.css +114 -0
- package/dist/components/core/select-chip/SelectChip.css +155 -0
- package/dist/components/core/select-chip/SelectChip.d.ts +20 -0
- package/dist/components/core/select-chip/SelectChip.js +273 -0
- package/dist/components/core/select-chip/SelectChip.types.d.ts +56 -0
- package/dist/components/core/select-chip/SelectChip.types.js +14 -0
- package/dist/components/core/select-chip/select-chip-impl.css +38 -0
- package/dist/components/core/spinner/Spinner.css +76 -0
- package/dist/components/core/spinner/Spinner.d.ts +5 -0
- package/dist/components/core/spinner/Spinner.js +29 -0
- package/dist/components/core/spinner/Spinner.types.d.ts +37 -0
- package/dist/components/core/spinner/Spinner.types.js +10 -0
- package/dist/components/core/spinner/spinner-impl.css +27 -0
- package/dist/components/core/status-dot/StatusDot.css +43 -0
- package/dist/components/core/status-dot/StatusDot.d.ts +35 -0
- package/dist/components/core/status-dot/StatusDot.js +46 -0
- package/dist/components/core/status-dot/StatusDot.types.d.ts +29 -0
- package/dist/components/core/status-dot/StatusDot.types.js +7 -0
- package/dist/components/core/status-dot/status-dot-impl.css +42 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.css +89 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.d.ts +21 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.js +127 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.types.d.ts +43 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.types.js +13 -0
- package/dist/components/core/subdomain-navbar/subdomain-navbar-impl.css +147 -0
- package/dist/components/core/tab/Tab.css +113 -0
- package/dist/components/core/tab/Tab.d.ts +36 -0
- package/dist/components/core/tab/Tab.js +53 -0
- package/dist/components/core/tab/Tab.types.d.ts +42 -0
- package/dist/components/core/tab/Tab.types.js +13 -0
- package/dist/components/core/tab/tab-impl.css +49 -0
- package/dist/components/core/tab-list/TabList.css +40 -0
- package/dist/components/core/tab-list/TabList.d.ts +26 -0
- package/dist/components/core/tab-list/TabList.js +124 -0
- package/dist/components/core/tab-list/TabList.types.d.ts +20 -0
- package/dist/components/core/tab-list/TabList.types.js +7 -0
- package/dist/components/core/tab-list/tab-list-impl.css +56 -0
- package/dist/components/core/table/Table.css +40 -0
- package/dist/components/core/table/Table.d.ts +19 -0
- package/dist/components/core/table/Table.js +55 -0
- package/dist/components/core/table/Table.types.d.ts +59 -0
- package/dist/components/core/table/Table.types.js +9 -0
- package/dist/components/core/table/table-impl.css +75 -0
- package/dist/components/core/table/use-table-sort.d.ts +43 -0
- package/dist/components/core/table/use-table-sort.js +51 -0
- package/dist/components/core/table-body/TableBody.css +6 -0
- package/dist/components/core/table-body/TableBody.d.ts +12 -0
- package/dist/components/core/table-body/TableBody.js +26 -0
- package/dist/components/core/table-body/TableBody.types.d.ts +36 -0
- package/dist/components/core/table-body/TableBody.types.js +7 -0
- package/dist/components/core/table-cell/TableCell.css +76 -0
- package/dist/components/core/table-cell/TableCell.d.ts +21 -0
- package/dist/components/core/table-cell/TableCell.js +31 -0
- package/dist/components/core/table-cell/TableCell.types.d.ts +43 -0
- package/dist/components/core/table-cell/TableCell.types.js +7 -0
- package/dist/components/core/table-head/TableHead.css +6 -0
- package/dist/components/core/table-head/TableHead.d.ts +22 -0
- package/dist/components/core/table-head/TableHead.js +52 -0
- package/dist/components/core/table-head/TableHead.types.d.ts +39 -0
- package/dist/components/core/table-head/TableHead.types.js +7 -0
- package/dist/components/core/table-head/table-head-impl.css +51 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.css +126 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.d.ts +21 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.js +34 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.types.d.ts +56 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.types.js +9 -0
- package/dist/components/core/table-header-cell/table-header-cell-impl.css +74 -0
- package/dist/components/core/table-row/TableRow.css +18 -0
- package/dist/components/core/table-row/TableRow.d.ts +17 -0
- package/dist/components/core/table-row/TableRow.js +32 -0
- package/dist/components/core/table-row/TableRow.types.d.ts +45 -0
- package/dist/components/core/table-row/TableRow.types.js +7 -0
- package/dist/components/core/table-row/table-row-impl.css +31 -0
- package/dist/components/core/text-area/TextArea.css +325 -0
- package/dist/components/core/text-area/TextArea.d.ts +13 -0
- package/dist/components/core/text-area/TextArea.js +133 -0
- package/dist/components/core/text-area/TextArea.types.d.ts +67 -0
- package/dist/components/core/text-area/TextArea.types.js +19 -0
- package/dist/components/core/text-area/text-area-impl.css +36 -0
- package/dist/components/core/text-input/TextInput.css +400 -0
- package/dist/components/core/text-input/TextInput.d.ts +5 -0
- package/dist/components/core/text-input/TextInput.js +130 -0
- package/dist/components/core/text-input/TextInput.types.d.ts +96 -0
- package/dist/components/core/text-input/TextInput.types.js +24 -0
- package/dist/components/core/text-input/text-input-impl.css +36 -0
- package/dist/components/core/tooltip/Tooltip.css +101 -0
- package/dist/components/core/tooltip/Tooltip.d.ts +51 -0
- package/dist/components/core/tooltip/Tooltip.js +87 -0
- package/dist/components/core/tooltip/Tooltip.types.d.ts +38 -0
- package/dist/components/core/tooltip/Tooltip.types.js +9 -0
- package/dist/components/core/tooltip/TooltipAnchor.d.ts +52 -0
- package/dist/components/core/tooltip/TooltipAnchor.js +69 -0
- package/dist/components/core/tooltip/tooltip-anchor.css +145 -0
- package/dist/components/core/tooltip/tooltip-impl.css +54 -0
- package/dist/components/core/tooltip/use-tooltip.d.ts +111 -0
- package/dist/components/core/tooltip/use-tooltip.js +189 -0
- package/dist/components/core/typography/Typography.css +96 -0
- package/dist/components/core/typography/Typography.d.ts +297 -0
- package/dist/components/core/typography/Typography.js +28 -0
- package/dist/components/core/typography/Typography.types.d.ts +40 -0
- package/dist/components/core/typography/Typography.types.js +7 -0
- package/dist/components/css-time.d.ts +20 -0
- package/dist/components/css-time.js +30 -0
- package/dist/components/given.d.ts +7 -0
- package/dist/components/given.js +9 -0
- package/dist/components/hover-open.d.ts +34 -0
- package/dist/components/hover-open.js +90 -0
- package/dist/components/index.d.ts +114 -1
- package/dist/components/index.js +115 -2
- package/dist/components/layout/aspect-ratio/AspectRatio.css +29 -0
- package/dist/components/layout/aspect-ratio/AspectRatio.d.ts +24 -0
- package/dist/components/layout/aspect-ratio/AspectRatio.js +26 -0
- package/dist/components/layout/aspect-ratio/AspectRatio.types.d.ts +22 -0
- package/dist/components/layout/aspect-ratio/AspectRatio.types.js +7 -0
- package/dist/components/layout/aspect-ratio/aspect-ratio-impl.css +44 -0
- package/dist/components/layout/grid/Grid.css +76 -0
- package/dist/components/layout/grid/Grid.d.ts +31 -0
- package/dist/components/layout/grid/Grid.js +33 -0
- package/dist/components/layout/grid/Grid.types.d.ts +48 -0
- package/dist/components/layout/grid/Grid.types.js +7 -0
- package/dist/components/layout/grid/grid-impl.css +62 -0
- package/dist/components/layout/row/Row.css +85 -0
- package/dist/components/layout/row/Row.d.ts +32 -0
- package/dist/components/layout/row/Row.js +34 -0
- package/dist/components/layout/row/Row.types.d.ts +45 -0
- package/dist/components/layout/row/Row.types.js +7 -0
- package/dist/components/layout/scroller/Scroller.css +59 -0
- package/dist/components/layout/scroller/Scroller.d.ts +34 -0
- package/dist/components/layout/scroller/Scroller.js +36 -0
- package/dist/components/layout/scroller/Scroller.types.d.ts +38 -0
- package/dist/components/layout/scroller/Scroller.types.js +7 -0
- package/dist/components/layout/scroller/scroller-impl.css +45 -0
- package/dist/components/layout/stack/Stack.css +73 -0
- package/dist/components/layout/stack/Stack.d.ts +28 -0
- package/dist/components/layout/stack/Stack.js +30 -0
- package/dist/components/layout/stack/Stack.types.d.ts +41 -0
- package/dist/components/layout/stack/Stack.types.js +7 -0
- package/dist/components/visually-hidden.d.ts +22 -0
- package/dist/components/visually-hidden.js +31 -0
- package/dist/fonts/LICENSE-inter.txt +93 -0
- package/dist/fonts/LICENSE-red-hat-mono.txt +93 -0
- package/dist/fonts/fonts.css +111 -0
- package/dist/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/fonts/red-hat-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/red-hat-mono-latin-wght-normal.woff2 +0 -0
- package/dist/marketing.css +289 -241
- package/package.json +18 -4
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
<!-- GENERATED from table-row.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# TableRow
|
|
4
|
+
|
|
5
|
+
One row of a table: the cells that answer the same questions in the same order as every other row. It owns the rule under it and whether it reads as picked, and nothing about what any cell holds.
|
|
6
|
+
|
|
7
|
+
Being picked is drawn here rather than on the checkbox that sets it, because selection is a fact about the row: a reader scanning a table needs to see which rows are in the set without checking every box in the first column.
|
|
8
|
+
|
|
9
|
+
## Use when
|
|
10
|
+
|
|
11
|
+
- A record, with one cell per column
|
|
12
|
+
- A row a reader can pick, where `selected` draws the state the page is holding
|
|
13
|
+
|
|
14
|
+
## Do not use
|
|
15
|
+
|
|
16
|
+
- The whole row is a target that navigates → `CardButton`
|
|
17
|
+
- A message spanning every column. A row that says "no results" is a sentence wearing a record's markup, and it is announced cell by cell against headers that do not apply to it
|
|
18
|
+
- A visual separator. The rule between rows is `dividers` on the table; an empty row is a record with nothing in it as far as anything reading the table is concerned
|
|
19
|
+
- Holding which rows are selected. `selected` draws the answer; keeping it is the page's, in its own state
|
|
20
|
+
|
|
21
|
+
## Anatomy
|
|
22
|
+
|
|
23
|
+
TableRow renders one element.
|
|
24
|
+
|
|
25
|
+
- `root` — `<tr>`, class `dds-tablerow`. The row, and the wash that says it is picked. It draws no rule of its own: a `<tr>` border is painted only while a table collapses its borders, and this table separates them so it can hold a corner. So the rule is the cells', handed down from here — every cell draws the line above it, and a run of cells across one row draws one line.
|
|
26
|
+
|
|
27
|
+
Selected is a fill rather than an edge. A row already sits between two rules, so a third line to say it is picked competes with the structure; a wash reads as the row rather than as a boundary around it, and it survives a row whose neighbours are also picked, where an outline would draw four lines between two rows.
|
|
28
|
+
|
|
29
|
+
It takes its size and its rule from the section above and hands both to every cell, so a row's air, its cells' padding and the line between rows are one decision made once.
|
|
30
|
+
|
|
31
|
+
The highlight under the pointer is gated to devices that have one, in table-row-impl.css. A touch screen reports a hover that never ends — the last row tapped keeps the wash until something else is tapped — so a highlight meant to say "a press would land here" ends up saying it about a row the reader has already left. No other component in this package gates its hover, which makes this a departure worth naming rather than a convention being followed.
|
|
32
|
+
|
|
33
|
+
Apply these classes from the generated `tableRowParts` constant rather than writing the strings by hand.
|
|
34
|
+
|
|
35
|
+
## Composition
|
|
36
|
+
|
|
37
|
+
- Can contain: `TableCell`, `TableHeaderCell`
|
|
38
|
+
- Never contains: `Table`, `TableHead`, `TableBody`, `TableRow` — in children or in any prop that takes a node
|
|
39
|
+
- Holds at least 1
|
|
40
|
+
|
|
41
|
+
## Props
|
|
42
|
+
|
|
43
|
+
### selected — `boolean` (default `false`)
|
|
44
|
+
|
|
45
|
+
Use when: The page is holding this row in a set the reader has picked — for an export, a bulk action, a comparison. It draws the state and reports nothing: the checkbox in the row is what a reader presses, and what it reports belongs to the page
|
|
46
|
+
Never for: The row under the pointer, or the row a reader last looked at. Hover is the browser's and this is a persistent answer — a row that highlighted on approach would say the reader had picked everything they passed over
|
|
47
|
+
|
|
48
|
+
### hoverable — `boolean` (default `true`)
|
|
49
|
+
|
|
50
|
+
Use when: Handed down by the table. It draws a wash under the pointer so a reader knows which row a press would land on — and only on a device that has a pointer, which the row's own stylesheet gates
|
|
51
|
+
Never for: Saying a row is chosen. Hover is where the pointer is and nothing more; `selected` is the answer a reader gave, and a row that looked picked on approach would say they had picked everything they passed over
|
|
52
|
+
|
|
53
|
+
### dividers — `rows` | `grid` | `none` (default `rows`)
|
|
54
|
+
|
|
55
|
+
- `rows` — The default. A line between rows and none between columns, which is what stops the eye slipping from one row's start to another's end — the mistake a wide table invites and the one a reader never notices making
|
|
56
|
+
- `grid` — Lines both ways, for a table read as a matrix rather than as a list of records: a rate card, a comparison where the reader traces a column as often as a row. It is more lines than most tables need, so it should be asked for
|
|
57
|
+
- `none` — No lines at all. Right for two or three rows, where the rules are more structure than data, and for a table whose columns are already separated by their alignment
|
|
58
|
+
Never for: Marking a group. A missing line is not a heading — a table that wants sections wants a header row inside the body, or two tables. Nor `grid` as decoration on a long table: every vertical line is another thing between a reader and the value they came for
|
|
59
|
+
|
|
60
|
+
### headerCase — `upper` | `title` (default `upper`)
|
|
61
|
+
|
|
62
|
+
- `upper` — The house setting: column names in capitals, at the role that suits them. A header is read once where the data under it is read many times, and capitals are what stop it competing
|
|
63
|
+
- `title` — Names drawn as they were written, at twelve pixels. Right where the names are long, are proper nouns whose own capitals would be flattened, or are in a script with no case at all
|
|
64
|
+
|
|
65
|
+
### overflow — `wrap` | `truncate` (default `wrap`)
|
|
66
|
+
|
|
67
|
+
- `wrap` — The default. Text too long for its column wraps and the row grows taller, so nothing is hidden — right whenever the value is the point and a reader has to read all of it
|
|
68
|
+
- `truncate` — Rows must stay one line high — a dense table a reader scans down, where a row that grew would break the rhythm they are scanning by. The value is clipped with an ellipsis and the whole of it is still reachable, so this trades seeing for scanning rather than losing anything
|
|
69
|
+
Never for: Making a column narrow enough to be worth truncating. Clipping is what a column does when it has run out of room, not a way to give it less — a table of ellipses has hidden its data behind a hover on every cell
|
|
70
|
+
|
|
71
|
+
### size — `sm` | `md` | `lg` (default `md`)
|
|
72
|
+
|
|
73
|
+
- `sm` — Compact. Dense data a reader scans rather than reads — a ledger, a positions table, anything where fitting more rows on screen is worth more than air around each one
|
|
74
|
+
- `md` — Balanced, and the default: rows a reader moves through at reading pace, with enough room that the eye does not slip between them
|
|
75
|
+
- `lg` — Spacious. Few rows, each carrying something substantial — a plan comparison, a summary of three accounts. Reach for it when the table is the page rather than a part of it
|
|
76
|
+
Never for: Making the text bigger or smaller. It changes how tall a row is and nothing else — the type stays one size down the whole table, because a reader comparing values across three tables at three densities is comparing the values rather than the tables. A table too wide for its column scrolls, and a smaller size only makes the same problem harder to read
|
|
77
|
+
|
|
78
|
+
Also accepts everything from `HTMLAttributes<HTMLTableRowElement>`.
|
|
79
|
+
|
|
80
|
+
## Accessibility
|
|
81
|
+
|
|
82
|
+
Guaranteed by the component. Write none of it by hand: the ids these attributes point at are generated per instance, so an attribute set from outside either says the same thing twice or points at nothing.
|
|
83
|
+
|
|
84
|
+
- Announced as: `row`
|
|
85
|
+
- a selected row says so to a screen reader as well as to the eye, which aria-selected on the row supplies. A fill is drawn and never announced, so a reader who cannot see it is told nothing about which rows are in the set
|
|
86
|
+
- the row holds one cell per column, in the same order as every other row. A short row shifts every value after it under the wrong header for anyone reading a cell at a time
|
|
87
|
+
|
|
88
|
+
## Rules
|
|
89
|
+
|
|
90
|
+
- **On a phone a section's actions stack and each fills the width, including when there is only one** — On a phone a page's actions stack, and each one fills the width. Not most of it, and not the width its label happens to need — the whole column.
|
|
91
|
+
|
|
92
|
+
Two side by side is what this replaces. On the narrowest screen each gets half a column minus the gap, which is rarely enough for a real label: the words wrap inside the pills, the two buttons come out different heights, and the pair reads as a broken row rather than as a choice. Stacked, each has the whole width and neither has to shorten its words to fit.
|
|
93
|
+
|
|
94
|
+
A single action fills too, and that is the part worth saying, because it is the one that looks unnecessary. A lone button has the room to sit at its natural width and still should not: a full-width control is the phone's convention for the thing the screen is asking you to do, and a pill hugging its label reads as one option among others that are not there. It also makes the target predictable — the whole width, wherever the thumb lands — which a centred pill does not.
|
|
95
|
+
|
|
96
|
+
Filling is the row's job rather than the button's. A button has no width of its own and is not given one; the row it sits in becomes a column and stretches its children, so nothing about the control changes and the same button is full width here and its own size on a desktop.
|
|
97
|
+
|
|
98
|
+
This is the phone's breakpoint, size.breakpoint.md, and not the wider one that decides whether a heading is centred. Those are different questions and they break at different widths: a heading stops being centred when the measure is the screen, while a button stops being full width much sooner than that — stretched across a tablet it is a long way from its own label, and a label centred in a metre of pill is harder to hit than one in a pill the size of the words.
|
|
99
|
+
|
|
100
|
+
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
101
|
+
Guidance only — cannot be checked automatically.
|
|
102
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, Input and Switch simultaneously.
|
|
103
|
+
Guidance only — cannot be checked automatically.
|
|
104
|
+
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
105
|
+
|
|
106
|
+
color.bg.brand carries a second limit that is not about forgetting. Its ink measures 3.39:1, which clears the 3:1 a heading needs and misses the 4.5:1 running copy needs. A coral band may carry a headline and a call to action; a paragraph on one is text the reader has to work through at a ratio the waiver on that role does not cover — the waiver says so itself. A section with copy in it takes color.bg.brand-strong, which is near-black and carries white at full contrast.
|
|
107
|
+
|
|
108
|
+
color.bg.strong is not a section ground. It is the inverted fill for an action that has to outrank what surrounds it, and the components that paint it — Button and ButtonIcon in their inverse form — already set both halves in one rule, which is the pattern a hand-painted section has to copy.
|
|
109
|
+
Guidance only — cannot be checked automatically.
|
|
110
|
+
- **Every gap inside a section names the relationship it expresses, and the same relationship keeps its measure when it turns on its side** — A section's spacing is named by the relationship it expresses, not chosen by size. Every gap in a section has a role token, and reaching for a step off the generic scale because it happens to be the right number is how two sections written by two people stop lining up: the numbers agree today and drift the first time one of them is tuned.
|
|
111
|
+
|
|
112
|
+
The heading group is three steps, not one gap. An eyebrow sits nearer its title than the title sits to its description, and the actions sit further from the description than either — space.heading.eyebrow-title, space.heading.title-description, space.heading.description-actions, in that order. A single `gap` on the group cannot say this; it sets all three the same and the block reads as evenly spaced lines rather than as a mark, a name and a paragraph. The eyebrow has to identify itself for this to work, because a group that opens with a title must not give its description the eyebrow's tighter step.
|
|
113
|
+
|
|
114
|
+
The step between a title and its description follows the size of the title, which is why there are two of it. What a reader sees is not the gap but the gap plus the leading above it, and leading scales with the type: under a display title the leading is most of the space, under a card's title it is half as deep. One value for both makes a card look loose at the size that made a section look right. So space.heading.title-description is the display step and space.heading.title-description-compact is the step at a card's size, and the choice is made by how big the title is rather than by what kind of block it sits in.
|
|
115
|
+
|
|
116
|
+
Every one of those steps is smaller than the gap below the group, and that ordering is what holds the group together as one thing. space.heading.content is the step between a heading group and the content it introduces, and it is the widest measure inside a section: the one gap the eye reads as a change of subject rather than as a continuation.
|
|
117
|
+
|
|
118
|
+
That step is the same whether the content is under the heading or beside it. A split is the same relationship turned on its side — a heading group and the content it introduces — so the space between the two halves is space.heading.content, not a gutter. When the split collapses to one column on a phone the gap becomes vertical again, which is where it started, and nothing has to change for that to be right.
|
|
119
|
+
|
|
120
|
+
space.grid.gutter is between two things of the same kind. Two cards in a row are the same kind; the two halves of a split are not, which is why the gutter is the wrong measure there even when the number would have looked acceptable. The gutter runs on both axes, so a grid reads as an even field rather than as rows with a seam down them.
|
|
121
|
+
|
|
122
|
+
space.inset.card is the card's, not the page's. A row of cards padded differently is a row of different cards, and the fill is the only edge they have. A page composing a row does not get to choose it.
|
|
123
|
+
|
|
124
|
+
Column count is not a breakpoint decision. A row holds as many columns as fit before a column would be narrower than size.grid.column-min, and drops one when they would not. Written as a fixed count that collapses at a breakpoint, a four-up row keeps four columns at every width above the phone and sets its copy two or three words to a line through the whole of the tablet range — and on a narrow desktop, which no breakpoint sits on at all. The threshold is a property of the row rather than of a card: a card fills whatever cell it is given.
|
|
125
|
+
|
|
126
|
+
What this does not cover is the space above and below a section, which is space.section.default and space.section.compact, and the page's own side margin, which is space.inset.page. Those are the section's outside; everything here is its inside.
|
|
127
|
+
Guidance only — cannot be checked automatically.
|
|
128
|
+
- **A section's title is centred over stacked content, starts beside content in columns, and starts on a phone** — Two arrangements, and the title's alignment is decided by which one it is introducing rather than chosen per section.
|
|
129
|
+
|
|
130
|
+
Content stacked under the title — a row of cards, an accordion, a set of steps — takes a centred title. The heading group and the block below it share one axis, so a centred title is symmetric with the thing it names, and the eye drops from the middle of the words to the middle of the set. A title starting at the left over a centred or full-width block reads as belonging to the first column rather than to all of them.
|
|
131
|
+
|
|
132
|
+
Content beside the title — a split, a picture in the other half, anything laid out in columns — takes a title that starts where its content starts. The two share a left edge, and that edge is what says they are one thing read across rather than two stacked. Centring the title there breaks the only alignment the reader has to hold the halves together, and it drifts further from its content the wider the page gets.
|
|
133
|
+
|
|
134
|
+
The heading group is what carries this, not the heading alone. An eyebrow, a title and a description are read as one block and align together; aligning the title without them leaves a centred heading over start-aligned copy, which reads as a mistake rather than as a choice.
|
|
135
|
+
|
|
136
|
+
Centred means all of it, not just the words. A badge, a row of actions, a picture — these are flex children, and a flex child is placed by align-items rather than by text-align, so a block that only sets the text leaves everything that is not text at the start. A hero is the case that shows it: its title and copy centred while its badge and its buttons did not.
|
|
137
|
+
|
|
138
|
+
A capped block centres itself as well as its words. A heading group takes size.heading-group.max, and a cap that is not centred leaves the measure at the start of the column with the words centred inside it — composed, and a long way left of the middle it appears to be in.
|
|
139
|
+
|
|
140
|
+
Both arrangements go to the start on a phone. A centred block reverts below the breakpoint, and the reason is the measure: on a phone the measure is the screen, so a centred title wraps to three or four ragged lines and the eye loses the left edge it was tracking — the same symmetry that reads as composure on a desktop is what makes it hard to scan on a phone. Centring there has to be asked for twice, and a section title is not one of the things that asks: it is centred because there is room for it, and on a phone there is not. Going back to the start means all of it too, and a capped block is the one that hides a leftover: its words go to the start while its measure stays in the middle of the column, which reads as a title still centred over a badge and buttons that are not — the box in the middle and the line inside it at the edge.
|
|
141
|
+
|
|
142
|
+
A hero is a section like any other: its badge, title, copy and actions are one stacked block, so it is centred on a desktop and starts on a phone with everything else.
|
|
143
|
+
|
|
144
|
+
What this is not about is a page whose body is a form or a document. A title over a sign-up form or a guide is not introducing a set of content — it is the first line of the thing itself, and it keeps the alignment the body has, which for running text is the start. The distinction is whether the block below is content the title names or content the title is part of.
|
|
145
|
+
Guidance only — cannot be checked automatically.
|
|
146
|
+
- **Anything a pointer has to hit is at least 24px in both directions** — A control sized by its contents is as big as its contents, and a glyph is chosen for how it reads rather than for how easily it is hit. An icon-only button with no padding is a 16px target — smaller than the pad of a finger, and smaller than the tremor of a hand using a mouse.
|
|
147
|
+
|
|
148
|
+
WCAG 2.2 asks for 24 by 24 CSS pixels at AA. The exceptions are narrower than they look: inline targets inside a sentence are exempt, and so is a small target with 24px of clear space around it — but a clear button sits against the field it empties, and a field is itself a target, so the spacing exemption does not apply to the case that keeps arising.
|
|
149
|
+
|
|
150
|
+
The target and the mark are separate decisions, and conflating them is what produces both faults. Growing the glyph to 24px makes it shout; leaving the button at 16px makes it hard to hit. So the glyph keeps the size that reads correctly beside its text, and the box around it declares a minimum of its own — which is what size.target.min is for.
|
|
151
|
+
|
|
152
|
+
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
153
|
+
Guidance only — cannot be checked automatically.
|
|
154
|
+
|
|
155
|
+
## Anti-examples
|
|
156
|
+
|
|
157
|
+
❌ TableRow for: The whole row is a target that navigates
|
|
158
|
+
A row that is one press is a different component: it takes focus, announces itself as a control and forbids the controls inside it. A table row holds cells, and cells hold links and buttons of their own — making the row pressable would make every one of them unreachable
|
|
159
|
+
→ use `CardButton` instead.
|
|
160
|
+
|
|
161
|
+
## Example
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
import { TableRow, TableCell } from '@deriv-com/dds-marketing'
|
|
165
|
+
|
|
166
|
+
<TableRow>
|
|
167
|
+
<TableCell>Alice Johnson</TableCell>
|
|
168
|
+
<TableCell>alice@example.com</TableCell>
|
|
169
|
+
<TableCell>Engineer</TableCell>
|
|
170
|
+
</TableRow>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## In use
|
|
174
|
+
|
|
175
|
+
Most rows below hold the same set, written once here:
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import { TableCell } from '@deriv-com/dds-marketing'
|
|
179
|
+
|
|
180
|
+
const tablecells = (
|
|
181
|
+
<>
|
|
182
|
+
<TableCell>Alice Johnson</TableCell>
|
|
183
|
+
<TableCell>alice@example.com</TableCell>
|
|
184
|
+
<TableCell>Engineer</TableCell>
|
|
185
|
+
</>
|
|
186
|
+
)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Picked, and not
|
|
190
|
+
|
|
191
|
+
Selection is a fact about the row, so it is drawn here rather than on the checkbox that sets it — a reader scanning sees the set without checking every box.
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import { TableRow } from '@deriv-com/dds-marketing'
|
|
195
|
+
|
|
196
|
+
// An ordinary row
|
|
197
|
+
<TableRow selected={false}>{tablecells}</TableRow>
|
|
198
|
+
|
|
199
|
+
// Picked — a wash, not an outline
|
|
200
|
+
<TableRow selected>{tablecells}</TableRow>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Under the pointer
|
|
204
|
+
|
|
205
|
+
A wash saying which row a press would land on. Gated to devices that have a pointer, because a touch screen reports a hover that never ends.
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
import { TableRow } from '@deriv-com/dds-marketing'
|
|
209
|
+
|
|
210
|
+
// hoverable
|
|
211
|
+
<TableRow hoverable>{tablecells}</TableRow>
|
|
212
|
+
|
|
213
|
+
// Read-only
|
|
214
|
+
<TableRow hoverable={false}>{tablecells}</TableRow>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Dividers
|
|
218
|
+
|
|
219
|
+
Handed to the cells, which draw the line above themselves — a row cannot, its borders not being painted once a table separates them.
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
import { TableRow } from '@deriv-com/dds-marketing'
|
|
223
|
+
|
|
224
|
+
// rows
|
|
225
|
+
<TableRow dividers="rows">{tablecells}</TableRow>
|
|
226
|
+
|
|
227
|
+
// grid
|
|
228
|
+
<TableRow dividers="grid">{tablecells}</TableRow>
|
|
229
|
+
|
|
230
|
+
// none
|
|
231
|
+
<TableRow dividers="none">{tablecells}</TableRow>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Row density
|
|
235
|
+
|
|
236
|
+
Taken from the section above and handed to every cell, so a row's air and its cells' padding are one decision.
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
import { TableRow } from '@deriv-com/dds-marketing'
|
|
240
|
+
|
|
241
|
+
// sm
|
|
242
|
+
<TableRow size="sm">{tablecells}</TableRow>
|
|
243
|
+
|
|
244
|
+
// md
|
|
245
|
+
<TableRow size="md">{tablecells}</TableRow>
|
|
246
|
+
|
|
247
|
+
// lg
|
|
248
|
+
<TableRow size="lg">{tablecells}</TableRow>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### When a value is too long
|
|
252
|
+
|
|
253
|
+
Passed to every cell in the row, so one long value does not behave differently from the ones beside it.
|
|
254
|
+
|
|
255
|
+
```tsx
|
|
256
|
+
import { TableCell, TableRow } from '@deriv-com/dds-marketing'
|
|
257
|
+
|
|
258
|
+
// wrap
|
|
259
|
+
<TableRow overflow="wrap">
|
|
260
|
+
<TableCell>Charlotte Featherstonehaugh-Willoughby</TableCell>
|
|
261
|
+
<TableCell>charlotte@example.com</TableCell>
|
|
262
|
+
<TableCell>Engineer</TableCell>
|
|
263
|
+
</TableRow>
|
|
264
|
+
|
|
265
|
+
// truncate
|
|
266
|
+
<TableRow overflow="truncate">
|
|
267
|
+
<TableCell>Charlotte Featherstonehaugh-Willoughby</TableCell>
|
|
268
|
+
<TableCell>charlotte@example.com</TableCell>
|
|
269
|
+
<TableCell>Engineer</TableCell>
|
|
270
|
+
</TableRow>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### The case of the names it holds
|
|
274
|
+
|
|
275
|
+
Passed to the cells. Only a header cell draws it; a data cell has no case decision.
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
import { TableRow } from '@deriv-com/dds-marketing'
|
|
279
|
+
|
|
280
|
+
// upper — capitals
|
|
281
|
+
<TableRow selected={false} headerCase="upper">{tablecells}</TableRow>
|
|
282
|
+
|
|
283
|
+
// title — as written
|
|
284
|
+
<TableRow selected={false} headerCase="title">{tablecells}</TableRow>
|
|
285
|
+
```
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<!-- GENERATED from tab-list.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# TabList
|
|
4
|
+
|
|
5
|
+
A strip of comparable versions of one thing, one of them showing at a time. What it says is that these are the same offer seen differently — a billing period, a platform, a market class — rather than places the site has. Two at least: selected means selected against something, and a strip of one is a heading that highlights.
|
|
6
|
+
|
|
7
|
+
It holds which tab is current and nothing else. The content each tab reveals belongs to the page, because a marketing page already has all of it written and the strip is only deciding which slice shows. That is why there is no panel here and no ARIA tab role: role="tab" is a promise about a tabpanel this component cannot see, and a promise it cannot keep is worse than the group it actually is.
|
|
8
|
+
|
|
9
|
+
## Use when
|
|
10
|
+
|
|
11
|
+
- Two or three versions of one offer differ in a way a reader wants to compare — monthly against yearly, one platform against another
|
|
12
|
+
- The page has already written every version, and showing them at once would be repetition rather than information
|
|
13
|
+
- The reader's choice changes what they see and nothing else — no route, no account, nothing the page has to remember
|
|
14
|
+
|
|
15
|
+
## Do not use
|
|
16
|
+
|
|
17
|
+
- The sections are separate topics rather than versions of one thing → `Accordion`
|
|
18
|
+
- Every version is worth reading → `Card`
|
|
19
|
+
- The tabs would go to other pages → nothing here does this
|
|
20
|
+
- Navigation. This is a group of buttons, not a landmark: nothing here carries an href, and a strip whose items led away would be a menu drawn as a comparison
|
|
21
|
+
- A sequence. Tabs are alternatives and are pressed in any order — steps happen in one, and a strip says otherwise to everyone who reads it
|
|
22
|
+
- One tab. A set of one is a heading with a border, and the selected state marks it against nothing
|
|
23
|
+
- More than about four. A strip is scanned across in a glance, and the point at which a reader has to read it to choose is the point it should have been a list
|
|
24
|
+
|
|
25
|
+
## Anatomy
|
|
26
|
+
|
|
27
|
+
TabList renders 3 elements. A token binding names the part it applies to.
|
|
28
|
+
|
|
29
|
+
- `root` — `<div>`, class `dds-tablist`. The strip, and the thing that knows which tab is current. A tab cannot see its siblings, so `selected` is injected rather than asked for — left to themselves every tab would answer for itself and all of them would show as current. Accordion owns which row is open for the same reason, and seeds itself the same way: a strip given no `value` takes its first answer from whichever tab arrived selected, falls back to the first tab when none did, and moves it itself from then on. A strip is always showing one of its slices, so it always marks one — a strip marking nothing is a page whose content has no heading over it.
|
|
30
|
+
|
|
31
|
+
It draws the rail: a hairline along the bottom at `border.width.default` in `color.border.subtle`, which the tabs sit on and the bar covers where one is current. Product's carries a `divider` axis to turn it off; there is one strip here and it always has its rail, because a marketing page is white and a strip with no line under it is a row of words nobody reads as a control.
|
|
32
|
+
|
|
33
|
+
`role="group"` with a name, which is the honest role for what this is. Not `role="tablist"`: that names a widget whose tabs own panels through `aria-controls`, and the panels here belong to the page. Not `role="navigation"` either, which is where this parts company with Product's — a landmark says the items go places, and these change what is showing on the page the reader is already on.
|
|
34
|
+
- `list` — `<div>`, class `dds-tablist__list`. The row the tabs sit in, and the box the bar is positioned against. It scrolls sideways rather than wrapping: a strip that wrapped to two lines is no longer a row to scan across, and on a phone a fourth tab has to go somewhere.
|
|
35
|
+
|
|
36
|
+
It is the positioned ancestor, which is what makes the bar's offsets content-relative — so the mark travels with the scroll instead of needing it subtracted. Its bottom padding is the bar's own thickness, keeping the bar inside the scroll container rather than hanging past it where the overflow would clip it or earn a second scrollbar.
|
|
37
|
+
- `indicator` — `<span>`, class `dds-tablist__indicator`. One bar, moved rather than switched. `border.width.thick` of `color.bg.brand`, rounded at `radius.pill`, measured to the width of the current tab's content — the words rather than the pill, so it does not run out under the padding either side.
|
|
38
|
+
|
|
39
|
+
Rendered whether or not anything is current, because it is a declared part and the generated test asserts every one of those reaches the DOM. Hidden when there is nothing to mark, which keeps it out of the accessibility tree as well as off the screen.
|
|
40
|
+
|
|
41
|
+
It is decoration and announces nothing. What it marks is said by the tab itself, which carries `aria-current` — a reader who cannot see the bar is told which version they are on rather than left to infer it from a mark they have no access to.
|
|
42
|
+
|
|
43
|
+
It sets no `display`. An absolutely positioned box is blockified already, so the keyword would add nothing — and it is an author rule, which outranks the `hidden` attribute's UA `display: none` and leaves the bar in the render tree with nothing to mark. Accordion's panel was the same mistake: state that belongs to an attribute must not be contradicted by a stylesheet.
|
|
44
|
+
|
|
45
|
+
Apply these classes from the generated `tabListParts` constant rather than writing the strings by hand.
|
|
46
|
+
|
|
47
|
+
## Composition
|
|
48
|
+
|
|
49
|
+
- Can contain: `Tab`
|
|
50
|
+
- Never contains: `TabList`, `Accordion`, `AccordionItem`, `Card`, `CardButton`, `Button` — in children or in any prop that takes a node
|
|
51
|
+
- Holds at least 2
|
|
52
|
+
|
|
53
|
+
## Props
|
|
54
|
+
|
|
55
|
+
### label — `string` **Required.**
|
|
56
|
+
|
|
57
|
+
Use when: Always — a group with no name is a group a screen reader announces as nothing, and the reader is told there is a set without being told what it is a set of. Name what the tabs switch between rather than the act of switching: 'Billing period', not 'Choose a billing period'
|
|
58
|
+
Never for: A heading. This is the group's accessible name and it is not drawn — a strip that needs a visible heading gets one on the page above it, which is a heading a sighted reader can see too
|
|
59
|
+
|
|
60
|
+
### value — `string`
|
|
61
|
+
|
|
62
|
+
Use when: The page is holding which tab is current, because the choice also drives what is rendered beneath the strip — the ordinary case here. Passing it makes the strip controlled: it shows what it is told and reports presses through onChange.
|
|
63
|
+
|
|
64
|
+
Leave it off and the strip holds its own answer, seeded from whichever tab arrived selected and from the first tab when none did. That is for a strip whose slices are all on the page already and only need showing one at a time, and it is what Accordion does with its rows.
|
|
65
|
+
Never for: Half of a controlled strip. A value passed without an onChange to move it is a strip that cannot respond to being pressed — which reads as a broken control rather than a fixed one, and is the shape a page falls into by adding the value first.
|
|
66
|
+
|
|
67
|
+
### onChange — `callback`
|
|
68
|
+
|
|
69
|
+
Use when: Whenever value is — together they are how a page holds the choice. It is called with the pressed tab's value after that tab's own onSelect, so a tab that reports its own presses keeps doing so inside a set
|
|
70
|
+
Never for: Side effects a press should not have. This says which version the reader is looking at; a strip that also navigated, submitted or fetched on it would be doing the thing its intent says it does not
|
|
71
|
+
|
|
72
|
+
Also accepts everything from `HTMLAttributes<HTMLDivElement>`.
|
|
73
|
+
|
|
74
|
+
## Accessibility
|
|
75
|
+
|
|
76
|
+
Guaranteed by the component. Write none of it by hand: the ids these attributes point at are generated per instance, so an attribute set from outside either says the same thing twice or points at nothing.
|
|
77
|
+
|
|
78
|
+
- Announced as: `group`
|
|
79
|
+
- `Tab` — Moves to each tab in turn. A group of buttons is not a composite widget, so there is no roving tabindex and no arrow keys to learn — the reader keeps the key they already have, and nothing traps them inside the strip
|
|
80
|
+
- accessible name from label, so a reader entering the group is told what these are versions of rather than that a group exists
|
|
81
|
+
- The group takes no focus of its own. Focus belongs to the tabs, which are buttons and are reached with the tab key; a strip that took focus would be a stop that does nothing.
|
|
82
|
+
- A value naming no tab selects none of them rather than falling back to the first. This is what the strip does when a page asks for a version it does not have — a mistake worth showing rather than papering over, not an arrangement to build on purpose. A strip nobody has given a value at all marks its first tab, because it is showing that tab's slice.
|
|
83
|
+
- The panels belong to the page, and so does wiring them. This group makes no aria-controls claim because it can see no panel — a page that wants the tab and its content associated says so itself, and role="tablist" here would have promised it.
|
|
84
|
+
|
|
85
|
+
## Rules
|
|
86
|
+
|
|
87
|
+
- **On a phone a section's actions stack and each fills the width, including when there is only one** — On a phone a page's actions stack, and each one fills the width. Not most of it, and not the width its label happens to need — the whole column.
|
|
88
|
+
|
|
89
|
+
Two side by side is what this replaces. On the narrowest screen each gets half a column minus the gap, which is rarely enough for a real label: the words wrap inside the pills, the two buttons come out different heights, and the pair reads as a broken row rather than as a choice. Stacked, each has the whole width and neither has to shorten its words to fit.
|
|
90
|
+
|
|
91
|
+
A single action fills too, and that is the part worth saying, because it is the one that looks unnecessary. A lone button has the room to sit at its natural width and still should not: a full-width control is the phone's convention for the thing the screen is asking you to do, and a pill hugging its label reads as one option among others that are not there. It also makes the target predictable — the whole width, wherever the thumb lands — which a centred pill does not.
|
|
92
|
+
|
|
93
|
+
Filling is the row's job rather than the button's. A button has no width of its own and is not given one; the row it sits in becomes a column and stretches its children, so nothing about the control changes and the same button is full width here and its own size on a desktop.
|
|
94
|
+
|
|
95
|
+
This is the phone's breakpoint, size.breakpoint.md, and not the wider one that decides whether a heading is centred. Those are different questions and they break at different widths: a heading stops being centred when the measure is the screen, while a button stops being full width much sooner than that — stretched across a tablet it is a long way from its own label, and a label centred in a metre of pill is harder to hit than one in a pill the size of the words.
|
|
96
|
+
|
|
97
|
+
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
98
|
+
Guidance only — cannot be checked automatically.
|
|
99
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, Input and Switch simultaneously.
|
|
100
|
+
Guidance only — cannot be checked automatically.
|
|
101
|
+
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
102
|
+
|
|
103
|
+
color.bg.brand carries a second limit that is not about forgetting. Its ink measures 3.39:1, which clears the 3:1 a heading needs and misses the 4.5:1 running copy needs. A coral band may carry a headline and a call to action; a paragraph on one is text the reader has to work through at a ratio the waiver on that role does not cover — the waiver says so itself. A section with copy in it takes color.bg.brand-strong, which is near-black and carries white at full contrast.
|
|
104
|
+
|
|
105
|
+
color.bg.strong is not a section ground. It is the inverted fill for an action that has to outrank what surrounds it, and the components that paint it — Button and ButtonIcon in their inverse form — already set both halves in one rule, which is the pattern a hand-painted section has to copy.
|
|
106
|
+
Guidance only — cannot be checked automatically.
|
|
107
|
+
- **Every gap inside a section names the relationship it expresses, and the same relationship keeps its measure when it turns on its side** — A section's spacing is named by the relationship it expresses, not chosen by size. Every gap in a section has a role token, and reaching for a step off the generic scale because it happens to be the right number is how two sections written by two people stop lining up: the numbers agree today and drift the first time one of them is tuned.
|
|
108
|
+
|
|
109
|
+
The heading group is three steps, not one gap. An eyebrow sits nearer its title than the title sits to its description, and the actions sit further from the description than either — space.heading.eyebrow-title, space.heading.title-description, space.heading.description-actions, in that order. A single `gap` on the group cannot say this; it sets all three the same and the block reads as evenly spaced lines rather than as a mark, a name and a paragraph. The eyebrow has to identify itself for this to work, because a group that opens with a title must not give its description the eyebrow's tighter step.
|
|
110
|
+
|
|
111
|
+
The step between a title and its description follows the size of the title, which is why there are two of it. What a reader sees is not the gap but the gap plus the leading above it, and leading scales with the type: under a display title the leading is most of the space, under a card's title it is half as deep. One value for both makes a card look loose at the size that made a section look right. So space.heading.title-description is the display step and space.heading.title-description-compact is the step at a card's size, and the choice is made by how big the title is rather than by what kind of block it sits in.
|
|
112
|
+
|
|
113
|
+
Every one of those steps is smaller than the gap below the group, and that ordering is what holds the group together as one thing. space.heading.content is the step between a heading group and the content it introduces, and it is the widest measure inside a section: the one gap the eye reads as a change of subject rather than as a continuation.
|
|
114
|
+
|
|
115
|
+
That step is the same whether the content is under the heading or beside it. A split is the same relationship turned on its side — a heading group and the content it introduces — so the space between the two halves is space.heading.content, not a gutter. When the split collapses to one column on a phone the gap becomes vertical again, which is where it started, and nothing has to change for that to be right.
|
|
116
|
+
|
|
117
|
+
space.grid.gutter is between two things of the same kind. Two cards in a row are the same kind; the two halves of a split are not, which is why the gutter is the wrong measure there even when the number would have looked acceptable. The gutter runs on both axes, so a grid reads as an even field rather than as rows with a seam down them.
|
|
118
|
+
|
|
119
|
+
space.inset.card is the card's, not the page's. A row of cards padded differently is a row of different cards, and the fill is the only edge they have. A page composing a row does not get to choose it.
|
|
120
|
+
|
|
121
|
+
Column count is not a breakpoint decision. A row holds as many columns as fit before a column would be narrower than size.grid.column-min, and drops one when they would not. Written as a fixed count that collapses at a breakpoint, a four-up row keeps four columns at every width above the phone and sets its copy two or three words to a line through the whole of the tablet range — and on a narrow desktop, which no breakpoint sits on at all. The threshold is a property of the row rather than of a card: a card fills whatever cell it is given.
|
|
122
|
+
|
|
123
|
+
What this does not cover is the space above and below a section, which is space.section.default and space.section.compact, and the page's own side margin, which is space.inset.page. Those are the section's outside; everything here is its inside.
|
|
124
|
+
Guidance only — cannot be checked automatically.
|
|
125
|
+
- **A section's title is centred over stacked content, starts beside content in columns, and starts on a phone** — Two arrangements, and the title's alignment is decided by which one it is introducing rather than chosen per section.
|
|
126
|
+
|
|
127
|
+
Content stacked under the title — a row of cards, an accordion, a set of steps — takes a centred title. The heading group and the block below it share one axis, so a centred title is symmetric with the thing it names, and the eye drops from the middle of the words to the middle of the set. A title starting at the left over a centred or full-width block reads as belonging to the first column rather than to all of them.
|
|
128
|
+
|
|
129
|
+
Content beside the title — a split, a picture in the other half, anything laid out in columns — takes a title that starts where its content starts. The two share a left edge, and that edge is what says they are one thing read across rather than two stacked. Centring the title there breaks the only alignment the reader has to hold the halves together, and it drifts further from its content the wider the page gets.
|
|
130
|
+
|
|
131
|
+
The heading group is what carries this, not the heading alone. An eyebrow, a title and a description are read as one block and align together; aligning the title without them leaves a centred heading over start-aligned copy, which reads as a mistake rather than as a choice.
|
|
132
|
+
|
|
133
|
+
Centred means all of it, not just the words. A badge, a row of actions, a picture — these are flex children, and a flex child is placed by align-items rather than by text-align, so a block that only sets the text leaves everything that is not text at the start. A hero is the case that shows it: its title and copy centred while its badge and its buttons did not.
|
|
134
|
+
|
|
135
|
+
A capped block centres itself as well as its words. A heading group takes size.heading-group.max, and a cap that is not centred leaves the measure at the start of the column with the words centred inside it — composed, and a long way left of the middle it appears to be in.
|
|
136
|
+
|
|
137
|
+
Both arrangements go to the start on a phone. A centred block reverts below the breakpoint, and the reason is the measure: on a phone the measure is the screen, so a centred title wraps to three or four ragged lines and the eye loses the left edge it was tracking — the same symmetry that reads as composure on a desktop is what makes it hard to scan on a phone. Centring there has to be asked for twice, and a section title is not one of the things that asks: it is centred because there is room for it, and on a phone there is not. Going back to the start means all of it too, and a capped block is the one that hides a leftover: its words go to the start while its measure stays in the middle of the column, which reads as a title still centred over a badge and buttons that are not — the box in the middle and the line inside it at the edge.
|
|
138
|
+
|
|
139
|
+
A hero is a section like any other: its badge, title, copy and actions are one stacked block, so it is centred on a desktop and starts on a phone with everything else.
|
|
140
|
+
|
|
141
|
+
What this is not about is a page whose body is a form or a document. A title over a sign-up form or a guide is not introducing a set of content — it is the first line of the thing itself, and it keeps the alignment the body has, which for running text is the start. The distinction is whether the block below is content the title names or content the title is part of.
|
|
142
|
+
Guidance only — cannot be checked automatically.
|
|
143
|
+
- **Anything a pointer has to hit is at least 24px in both directions** — A control sized by its contents is as big as its contents, and a glyph is chosen for how it reads rather than for how easily it is hit. An icon-only button with no padding is a 16px target — smaller than the pad of a finger, and smaller than the tremor of a hand using a mouse.
|
|
144
|
+
|
|
145
|
+
WCAG 2.2 asks for 24 by 24 CSS pixels at AA. The exceptions are narrower than they look: inline targets inside a sentence are exempt, and so is a small target with 24px of clear space around it — but a clear button sits against the field it empties, and a field is itself a target, so the spacing exemption does not apply to the case that keeps arising.
|
|
146
|
+
|
|
147
|
+
The target and the mark are separate decisions, and conflating them is what produces both faults. Growing the glyph to 24px makes it shout; leaving the button at 16px makes it hard to hit. So the glyph keeps the size that reads correctly beside its text, and the box around it declares a minimum of its own — which is what size.target.min is for.
|
|
148
|
+
|
|
149
|
+
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
150
|
+
Guidance only — cannot be checked automatically.
|
|
151
|
+
|
|
152
|
+
## Anti-examples
|
|
153
|
+
|
|
154
|
+
❌ TabList for: The sections are separate topics rather than versions of one thing
|
|
155
|
+
These are the two components here that answer "there is more than fits", and they answer different questions. An accordion is a list of topics a reader picks one of; a strip is one topic in several forms a reader compares. A set of unrelated topics behind tabs tells a reader a comparison exists that does not
|
|
156
|
+
→ use `Accordion` instead.
|
|
157
|
+
|
|
158
|
+
❌ TabList for: Every version is worth reading
|
|
159
|
+
A reader skimming a landing page does not press anything, so a strip is a decision to make some of the page optional. Two cards side by side is how a page shows both at once and is read by someone who never touches it
|
|
160
|
+
→ use `Card` instead.
|
|
161
|
+
|
|
162
|
+
❌ TabList for: The tabs would go to other pages
|
|
163
|
+
→ nothing in this system does this. Not a gap waiting to be filled — the case belongs outside it.
|
|
164
|
+
|
|
165
|
+
## Example
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
import { TabList, Tab } from '@deriv-com/dds-marketing'
|
|
169
|
+
|
|
170
|
+
<TabList label="Billing period">
|
|
171
|
+
<Tab value="label-1" label="Label 1" selected onSelect={(value) => { /* your handler */ }} />
|
|
172
|
+
<Tab value="label-2" label="Label 2" onSelect={(value) => { /* your handler */ }} />
|
|
173
|
+
<Tab value="label-3" label="Label 3" onSelect={(value) => { /* your handler */ }} />
|
|
174
|
+
</TabList>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import { useState } from 'react'
|
|
179
|
+
import { TabList, Tab } from '@deriv-com/dds-marketing'
|
|
180
|
+
|
|
181
|
+
// Controlled: TabList reports the value, not the event.
|
|
182
|
+
const [value, setValue] = useState('')
|
|
183
|
+
<TabList label="Billing period" value={value} onChange={setValue}>
|
|
184
|
+
<Tab value="label-1" label="Label 1" selected onSelect={(value) => { /* your handler */ }} />
|
|
185
|
+
<Tab value="label-2" label="Label 2" onSelect={(value) => { /* your handler */ }} />
|
|
186
|
+
<Tab value="label-3" label="Label 3" onSelect={(value) => { /* your handler */ }} />
|
|
187
|
+
</TabList>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## In use
|
|
191
|
+
|
|
192
|
+
### A comparison, not a menu
|
|
193
|
+
|
|
194
|
+
Two versions of one offer. The page renders the matching slice beneath — the strip decides nothing else and owns no panel.
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
import { Tab, TabList } from '@deriv-com/dds-marketing'
|
|
198
|
+
|
|
199
|
+
// Yearly current
|
|
200
|
+
<TabList label="Billing period">
|
|
201
|
+
<Tab value="monthly" label="Monthly" onSelect={(value) => { /* your handler */ }} />
|
|
202
|
+
<Tab value="yearly" label="Yearly" selected onSelect={(value) => { /* your handler */ }} />
|
|
203
|
+
</TabList>
|
|
204
|
+
|
|
205
|
+
// Monthly current
|
|
206
|
+
<TabList label="Billing period">
|
|
207
|
+
<Tab value="monthly" label="Monthly" selected onSelect={(value) => { /* your handler */ }} />
|
|
208
|
+
<Tab value="yearly" label="Yearly" onSelect={(value) => { /* your handler */ }} />
|
|
209
|
+
</TabList>
|
|
210
|
+
```
|