@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,361 @@
|
|
|
1
|
+
<!-- GENERATED from pagination.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# Pagination
|
|
4
|
+
|
|
5
|
+
The control that moves a reader through a set too large to show at once. It sits beneath the index, archive or card set it governs, reports where in the sequence the reader stands, and offers the ways out of it — a step either side, a numbered target under one variant, a row of marks under another.
|
|
6
|
+
|
|
7
|
+
What separates this from product's is what a press is. A page of an index has an address of its own: page two of a blog is a place, and one a search engine has to be able to reach, so the numbered variant draws links and is given the URL of each page. A slide in a carousel is not a place and has no address, so its marks are buttons and the page handles the press. That is not a setting to choose — it is which variant you reached for, and the two cases arrive at different ends of this component.
|
|
8
|
+
|
|
9
|
+
## Use when
|
|
10
|
+
|
|
11
|
+
- An index or archive has been split across pages and the reader needs to move through it — a blog listing, a news archive, a resource library. It belongs below the results, because the decision to move on is one the reader makes after reading what is here
|
|
12
|
+
- The reader needs to reach a particular page rather than step towards it — page fourteen of forty, in one press. That is the pages variant, and the only one offering a target with a number on it. Where the row has no room for that number, the break standing in for it opens a menu of the pages it hides, so a page the row cannot show is two presses away rather than a walk
|
|
13
|
+
- The pages have addresses a search engine should follow. Numbered targets drawn as links are how an index gets crawled past its first page, which on a marketing site is usually the reason the index exists
|
|
14
|
+
- How much is left matters as much as where the reader stands. A total passed to the count variant turns the readout from a position into a measure, which is what tells someone whether to keep reading or search instead
|
|
15
|
+
- The reader is walking a short visual sequence and what they want to know is where they are in it rather than what that position is called — a carousel of cards, a testimonial slider, a walkthrough. That is the dots variant, and it holds while the set stays under about ten: a dot carries no number, so past a handful the reader is counting marks too small and too many to count
|
|
16
|
+
|
|
17
|
+
## Do not use
|
|
18
|
+
|
|
19
|
+
- The reader is moving between views of one page rather than through one long set → `TabList`
|
|
20
|
+
- More results are appended to the view as the reader reaches the end, rather than one page replacing another → `Button`
|
|
21
|
+
- The reader is hunting for one row among thousands rather than walking the set → `SearchInput`
|
|
22
|
+
- A set that fits on one page. There is nothing to move between, and a control offering to move is read as a promise that there is more — so the reader presses it, nothing happens, and they are left unsure whether the control or the results are at fault
|
|
23
|
+
- Placing above the content it governs. The reader decides whether to move on only after seeing what is here, so a control above the results asks the question before they hold the answer — and on a long page it puts the control off screen at exactly the moment they want it
|
|
24
|
+
- Ten or more positions under the dots variant. A dot carries no number, so a reader working out where they are is counting marks; past a handful the marks are too small and too many to count, and the row degrades into saying only "somewhere in the middle"
|
|
25
|
+
- Standing in for a filter. Handing a reader four hundred pages is not giving them access to the set, it is giving them the shape of it — the answer is a narrower query, and pagination is what works once the set is small enough to walk
|
|
26
|
+
|
|
27
|
+
## Anatomy
|
|
28
|
+
|
|
29
|
+
Pagination renders 8 elements. A token binding names the part it applies to.
|
|
30
|
+
|
|
31
|
+
- `root` — `<nav>`, class `dds-pagination`. The nav landmark the control sits in, and the layout decision for it. A nav because a reader listing a page's landmarks is looking for the way through the results, and an unnamed row of buttons is not something they can find. It paints nothing: its only choice is that the two step controls flank whatever the middle holds, centred, wherever they are drawn — and showSteps is the one thing that takes them away, for a set the reader moves through by swiping cards or images and this only reports. One skeleton rather than the more familiar split layout, where the readout sits at one edge and the steps at the other — that needs the steps wrapped together, which would make a step's declared parent true in some variants and false in others. Flanking keeps the controls where the reader's hand left them as the variant changes. It never exceeds the width it is given, and what gives when the row outgrows it is the window rather than the layout. The row measures what it has — the width left once the two step controls have taken theirs, against the widest slot the set can draw — and shows as many siblings as that holds, down to none, which is the five-slot row of the two ends, two breaks and the page the reader is on. This is the one thing the component measures and the one thing it holds of its own, because the container's width is a fact no consumer can pass it. It is measured rather than compared against a threshold in pixels: a numbered target is a Button, so how much room a digit takes is Button's padding and the loaded font, neither of which this component owns. Below the shortest row — first page, break, current page, break, last page — the list is what gives: it shrinks below its contents and scrolls, while the two steps hold their size, because a centred flex row with nothing allowed to shrink overflows in both directions at once, which put the back control on top of whatever sat to the left and the forward one outside the container entirely. That last degrade is a scroller with a page cut in half at the edge of it, which a reader cannot tell from a broken control — so it is where a column too narrow for numbers should have been given count or compact instead.
|
|
32
|
+
- `list` — `<div>`, class `dds-pagination__list`. The row of targets between the two step controls: numbered pages under the pages variant, position marks under dots, and nothing at all under the rest, where the readout takes this place. A div rather than an ol, deliberately — an ordered list may hold only li elements, so each target would need a wrapper, doubling the anatomy to buy semantics the nav landmark and aria-current already provide.
|
|
33
|
+
|
|
34
|
+
Under pages it holds Buttons, which in this package are anchors: each carries the address of the page it names, so a visitor can cmd-click one, see where it goes, and a crawler can follow it. They are secondary and transparent, with the current one dropping its transparency so it alone carries a ground. Under dots it holds this component's own marks, which are buttons — a slide has no address to point at.
|
|
35
|
+
- `summary` — `<span>`, class `dds-pagination__summary`. The readout, in place of the row of targets, under two variants and reading differently in each. Count answers how much is left: a range against a total. Compact answers only where the reader stands and drops the words to do it, reading "3 / 24", which is the terseness the variant exists for.
|
|
36
|
+
|
|
37
|
+
Label text rather than body, which is the opposite of the choice product made and deliberate. This package's body ramp is page copy — its small step is described as the legal line at the foot of a section — and a readout set in it reads as small print rather than as part of the row of controls it sits between. label is this package's text for chrome: semibold, tight, and the same measure the controls either side of it carry. At the default foreground, because it reports a fact rather than offering one. Rendered only when `variant` is set.
|
|
38
|
+
- `dot` — `<button>`, class `dds-pagination__dot`. One position in a short sequence, under the dots variant alone. The button is the target and not the mark: a dot at the size a dot should be is about eight pixels, a third of what WCAG asks of anything a pointer must hit, so the pressable box is held at size.target.min and the visible circle is a child of it — while the marks are the only way through the set. Growing the dot to twenty-four instead would produce the pages variant with the numbers taken out.
|
|
39
|
+
|
|
40
|
+
That target is also what made a long row too wide for a phone: twenty of them is four hundred and eighty pixels before the steps have taken theirs. So the box narrows to the mark's own width while the steps are drawn beside it, which is a twelve-pixel pitch with the gap and fits twenty marks and both steps inside a phone. The exception is the one WCAG names rather than one of ours: an undersized target is allowed where the same function is reachable by a control that meets the size, and the steps are that control — every position the marks offer is reachable by pressing them. Take the steps away and the exception goes with them, so the box returns to the full target, and the width the steps were taking pays for it. It is the block axis that stays either way: a shorter box would cost hit area on the axis that was never the problem. It paints nothing of its own but the focus ring — its ground stays transparent through hover and press, and what it carries instead is the colour the mark paints with. A ground here drew a filled circle three times the mark's width under the pointer, which reads as a control appearing around the dot rather than as the dot answering, and at the tightest gap the scale offers those grounds nearly touched their neighbours'. Holding the colour rather than the ground is also the only way the mark can answer at all: hover belongs to whatever the pointer is over, the target is this button, and a span is never hovered as a target. So every state the reader sees on the mark — at rest, under the pointer, pressed, current — is declared here, and the mark inherits it. Round for the focus ring's sake, which is the one thing it still draws around itself.
|
|
41
|
+
|
|
42
|
+
Its four colours are product's own, reached through roles that do not sound like it. The mark steps through solid greys toward the page the reader is on — E6E8EA at rest, D8DADD under the pointer, BDC0C5 pressed, black when current — which is exactly product's ramp in light. This package has no neutral mid-grey roles to say that with, so the two middle steps borrow color.bg.readonly and color.border.default for their values. The names are wrong and the pixels are right, which is the trade taken knowingly: the alternative was color.bg.hover and color.bg.active, whose names fit perfectly and whose values are alpha overlays meant to sit behind something — bound to a foreground they rendered the mark at five per cent black, which is a dot that disappears under the pointer. Naming these two properly is a small addition to the colour layer and the right fix; until then this comment is the record that they were chosen rather than mistaken. Rendered only when `variant` is set.
|
|
43
|
+
- `dot-mark` — `<span>`, class `dds-pagination__dot-mark`. The circle the reader actually sees, centred in a target three times its width. It carries the current position by a change of ground rather than of size: a dot that grows moves its neighbours, and a row that reflows as the reader steps through it is a row they must re-read. Its ground is currentcolor and so is every state of it — the recessive fill at rest, a step up under the pointer, a step further pressed, and when current the strongest the page can carry, which is the widest separation two solids in this system have and what survives being eight pixels across. The colour is the button's because the states are: this is a span inside the target rather than the target, so it cannot be hovered as one, and a fill bound here would have sat still while the thing the reader was pointing at changed. Nothing else about it moves, which is the point — the mark answers by darkening where it is. Rendered only when `variant` is set.
|
|
44
|
+
- `step` — `<button>`, class `dds-pagination__step`. One of the two step controls, drawn by this component rather than borrowed. Product hands this job to ButtonIcon; this package's ButtonIcon has no disabled and says so in its own source — it is a link family, and a link cannot be disabled, which is a correct decision there and an unusable one here. A step at the end of the set must be disabled rather than removed: removing it shifts every remaining target sideways at the moment the reader is aiming at one.
|
|
45
|
+
|
|
46
|
+
An <a> when the component was given pageHref and a <button> when not, which is the rule ButtonIcon and CardButton already follow. At the first or last page there is no page to point at, so the anchor becomes a disabled button rather than a link to nowhere — the only place the two modes meet.
|
|
47
|
+
- `page` — `<button>`, class `dds-pagination__page`. One numbered target, under the pages variant. An <a> when given pageHref and a <button> when not, the same rule the step follows.
|
|
48
|
+
|
|
49
|
+
Drawn here rather than taken from Button, which was the intention until Button turned out not to fit: it is an anchor with a required href, so it cannot be a press the page handles, and its quiet form does not exist — the variants are primary, secondary and inverse, none of them the transparent target a row of page numbers wants. A page number is not a call to action, and a row of them set as one reads as a row of offers rather than a position.
|
|
50
|
+
|
|
51
|
+
Declared unconditional though it is drawn under the pages variant alone, which is the one place this anatomy is less precise than the component. presentWhen marks a part absent by default and present once a prop is set; this part is the opposite — pages is the default, so it is there on a bare render and gone under the other three. Saying presentWhen: variant would generate a test asserting it is missing from the default row, where it is the row. The break beside it does not have the problem, needing a set long enough to break before it appears at all.
|
|
52
|
+
- `break` — `<button>`, class `dds-pagination__break`. The control standing between two runs of numbered pages, which presses: it opens a menu of exactly the pages the row had no room to draw.
|
|
53
|
+
|
|
54
|
+
Drawn here rather than handed to a ButtonIcon, which is what it was first. Product's break is a transparent secondary ButtonIcon; this package's ButtonIcon has no transparent — its secondary paints a border, its primary a coral fill and its inverse a black one — so the break arrived wearing a ring none of the targets beside it wear, and read as a different kind of thing sitting in the row. Nothing about DropdownMenu required a ButtonIcon: it wires whatever element it is given, so the break is this component's own button and carries the same ground, corner and states as the numbered pages either side of it.
|
|
55
|
+
|
|
56
|
+
Square rather than a pill that grows, because it holds a mark and not a number. It is the one target in the row whose width says nothing about what is behind it. Rendered only when `variant` is set.
|
|
57
|
+
|
|
58
|
+
Apply these classes from the generated `paginationParts` constant rather than writing the strings by hand.
|
|
59
|
+
|
|
60
|
+
## Composition
|
|
61
|
+
|
|
62
|
+
- Takes no children. Everything it renders comes from props
|
|
63
|
+
- Never contains: `TabList`, `Pagination`, `Card`, `TextInput` — in children or in any prop that takes a node
|
|
64
|
+
|
|
65
|
+
## Props
|
|
66
|
+
|
|
67
|
+
### variant — `pages` | `count` | `compact` | `none` | `dots` (default `pages`)
|
|
68
|
+
|
|
69
|
+
- `pages` — An index or archive whose pages have addresses of their own — a blog listing, a news archive, a resource library. The only variant offering a numbered target, so the only one on which reaching page fourteen costs a single press rather than thirteen, and the only one a crawler can follow past page one. It draws Buttons, which in this package are anchors, so it needs pageHref and the pages it points at have to exist as URLs. A page too far out to be drawn is still not a walk: the break between two runs of numbers presses, and offers the pages it stands for
|
|
70
|
+
- `count` — A long set where the reader's real question is how much is left rather than which page they are on — "page 3" says nothing until you know whether there are four pages or four hundred. Pass totalItems so the readout can answer it. The steps take pageHref where the pages have addresses and fall back to onPageChange where they do not
|
|
71
|
+
- `compact` — A place with no room for a row of numbers — a card footer, a sidebar, a column at a phone's width. Position and the two steps, and nothing else. Like count, its steps are anchors given pageHref and buttons without it
|
|
72
|
+
- `none` — The two steps and nothing between them, for a place where position is either obvious or beside the point — a lightbox moving through images, a set of two. It is the least this component can be, and choosing it is a claim that the reader does not need to know where they are, which on a page with an address per position is a claim worth making deliberately
|
|
73
|
+
- `dots` — A carousel of cards, a testimonial slider, a walkthrough — a short visual sequence where the reader cares where they are rather than what that position is called. The marks are always buttons and the press is always the page's to handle, a slide having no address to link to; pageHref is ignored here rather than obeyed. The case it was built for is a set the reader swipes: pass showSteps={false} there and the row is marks alone, which is also the only variant still offering a target once the steps are gone. Keep the set under about ten — a dot carries no number, so beyond a handful the reader is counting marks too small and too many to count
|
|
74
|
+
Never for: Choosing by the width available rather than by the reader's question. The five answer different questions, and which one is being asked comes from the content above the control, not the room beneath it. Reaching for compact because a row of numbers will not fit is the one defensible inversion — and still a narrowing of what the reader can do, not a neutral swap
|
|
75
|
+
|
|
76
|
+
### showSteps — `boolean` (default `true`)
|
|
77
|
+
|
|
78
|
+
Use when: Whether the two step controls are drawn, under the dots variant. True wherever this component is the way through the set, which is nearly all of them. False for a set the reader moves through some other way and this only reports — a carousel they swipe, a gallery with its own arrows — where a second pair underneath competes with the first. Dropping them also buys the width that lets a long row of marks fit a phone
|
|
79
|
+
Never for: Any variant but dots, where it is inert rather than obeyed — the same as siblingCount under count, or totalItems under pages. Dots is the only middle holding targets of its own, so it is the only row that still works once the arrows go. The type cannot say so: an exclusion names one prop and one value, and there is no way to write one naming five variants at once
|
|
80
|
+
|
|
81
|
+
### page — `number` (default `1`)
|
|
82
|
+
|
|
83
|
+
Use when: Always — it is which page is on screen, counting from one, and the component renders around it rather than holding it. The consumer owns this because the results do: the page number and the rows beneath it are one fact, and a control keeping its own copy is how the two come to disagree. The default is the first page, which is where a set with nothing said about it starts
|
|
84
|
+
Never for: Half a controlled component. Passing this without updating it when onPageChange fires gives a row that cannot move — the reader presses, the number stays, and the control reads as broken. Nor for a zero-based index: the numbers are shown to a reader, who counts from one, and a component quietly adding one would put every other page number in the consumer's own code off by one
|
|
85
|
+
|
|
86
|
+
### totalPages — `number` (default `1`)
|
|
87
|
+
|
|
88
|
+
Use when: How many pages the set has been divided into. It decides where the row ends, when the ellipsis appears, and when next goes disabled. The default of one is the honest answer for a set nothing has been said about, and it is also the case the component should not be used in at all — a single page has nothing to move between
|
|
89
|
+
Never for: A count of items. That is totalItems, and passing one for the other gives a reader four hundred page numbers for forty pages of results. Nor for an unknown total: a number invented so the component would render is a promise about how much is left, and the reader has no way to tell it from a real one
|
|
90
|
+
|
|
91
|
+
### onPageChange — `callback`
|
|
92
|
+
|
|
93
|
+
Use when: What the page does when the reader asks for another one, counting from one. Required wherever the route to a page is a press rather than a destination: the dots variant always, and the steps under any variant given no pageHref. Under pages it is the pageHref that carries the reader, so this is the reporting half rather than the moving one — useful for telling analytics, and unnecessary if nothing is listening. One of this and pageHref is needed; a component given neither draws a row nothing can move.
|
|
94
|
+
Never for: Navigating by hand when pageHref would do it. A press handler that sets window.location is an anchor with its advantages removed — no cmd-click, no destination in the status bar, nothing for a crawler to follow.
|
|
95
|
+
|
|
96
|
+
### pageHref — `callback`
|
|
97
|
+
|
|
98
|
+
Use when: The address of a page, given the page number. Passing it makes every route to a page an anchor: the numbered targets, and both steps. Required under the pages variant, which draws Buttons — and a Button in this package is an anchor with a destination, never a press the page handles. Pass it under compact or count too wherever the pages have real URLs, because an anchor is what gives a visitor cmd-click, a destination in the status bar, and a link a search engine can follow to page two. One of this and onPageChange is needed; a component given neither draws a row nothing can move.
|
|
99
|
+
Never for: A carousel or any sequence whose positions have no address. A slide is not a place, so a link to one is a link to nowhere and the dots variant ignores this entirely. Nor for smuggling state into a query string the page does not actually route on — a URL that renders the same page whatever it says is worse than a button, which at least does not promise otherwise.
|
|
100
|
+
|
|
101
|
+
### totalItems — `number`
|
|
102
|
+
|
|
103
|
+
Use when: How many results there are altogether, where that is known. It is what turns the count variant's readout from a position into a measure — "1–10 of 240" rather than "page 1 of 24" — which is the fact that tells a reader whether to keep stepping or narrow their filter instead
|
|
104
|
+
Never for: A count of what is on this page. It is the whole set, which is what makes the range in front of it mean anything. Nor an estimate presented as exact: a reader shown a total treats it as one, and a number that moves as they page through the set reads as the results changing underneath them
|
|
105
|
+
|
|
106
|
+
### pageSize — `number`
|
|
107
|
+
|
|
108
|
+
Use when: How many items each page holds, which is what lets the count variant work out the range on screen from the page number alone. Pass it alongside totalItems; on its own it has nothing to be a fraction of. It reports the size in force and does not offer to change it — a control for that is the consumer's to place, beside this one
|
|
109
|
+
Never for: Changing how many items are fetched. This component displays and nothing else — the fetch is the consumer's, and a page size passed here while the query still asks for a different number produces a readout that describes a page nobody is looking at
|
|
110
|
+
|
|
111
|
+
### siblingCount — `number` (default `1`)
|
|
112
|
+
|
|
113
|
+
Use when: How many numbered pages sit around the current one before the row breaks, under the pages variant. Around rather than either side: the window is split, with the odd one going forward, since the page the reader has not read is the one they most likely want. One is the current page and the one after it, a row of six; two is mirrored. The most it will show rather than a promise, since the row drops what the container cannot hold
|
|
114
|
+
Never for: Widening the row until nothing is hidden. Past a few siblings the row is longer than the eye scans, and a reader who needs page 200 of 400 is not served by seeing 199 either. What widening removes is also a control now rather than a mark: the break it takes away was the menu that reached those pages in one press
|
|
115
|
+
|
|
116
|
+
### label — `string` (default `Pagination`)
|
|
117
|
+
|
|
118
|
+
Use when: Always, and the default is almost always right. It names the landmark rather than the content — a screen reader user listing what is on a page hears this, and a nav with no name is one they cannot tell from the page's other navigation. Set it where a page carries two of these, so the two are distinguishable by what they page through
|
|
119
|
+
Never for: Describing where the reader is. That is the summary's job and aria-current's, both of which change as the reader moves, while this does not — a landmark renamed on every press is one that cannot be navigated to
|
|
120
|
+
|
|
121
|
+
### previousLabel — `string` (default `Previous page`)
|
|
122
|
+
|
|
123
|
+
Use when: The accessible name for the step-back control, which is a glyph and therefore announces nothing on its own. Override it to translate it, or where "page" is the wrong noun for what is being stepped through
|
|
124
|
+
Never for: Visible text. Nothing here renders it — it is the button's name, not its content, and a row that showed the words would be a different control at a different width
|
|
125
|
+
|
|
126
|
+
### nextLabel — `string` (default `Next page`)
|
|
127
|
+
|
|
128
|
+
Use when: The accessible name for the step-forward control, for the reason previousLabel exists. Keep the two parallel: a pair reading "Next page" and "Go back" is two people's wording in one control
|
|
129
|
+
Never for: Visible text, for the reason previousLabel is not
|
|
130
|
+
|
|
131
|
+
### morePagesLabel — `string` (default `More pages`)
|
|
132
|
+
|
|
133
|
+
Use when: The accessible name for the break between two runs of numbered pages — the control that opens a menu of the pages that break stands for. A glyph announces nothing, which is the position previousLabel and nextLabel are in, and this is passed the same way the two steps' names are, as the control's own accessible name. It names the menu as well as the control, so a reader who has opened it hears which menu they are in
|
|
134
|
+
Never for: Visible text, for the reason previousLabel is not. Nor for naming the range it covers: which pages a break stands for changes with every step the reader takes, and a name that went stale would be read out long after it stopped being true
|
|
135
|
+
|
|
136
|
+
Also accepts everything from `HTMLAttributes<HTMLElement>`.
|
|
137
|
+
|
|
138
|
+
## Choosing a variant
|
|
139
|
+
|
|
140
|
+
Placement in, props out. When one of these describes what you are building, take
|
|
141
|
+
its props — do not re-derive them from the variant descriptions above.
|
|
142
|
+
|
|
143
|
+
- **A transactions table at the foot of a desktop page, where the reader returns to particular pages** — `variant="pages"`
|
|
144
|
+
Numbered targets are the only ones a reader can aim at deliberately, and a table is the case where they come back to a page they have already read rather than only moving on from it
|
|
145
|
+
- **A long list of search results where the reader is judging whether to keep going** — `variant="count"`
|
|
146
|
+
The question underneath the press is how much is left, and a page number cannot answer it. Pass totalItems and pageSize so the readout gives a range against a whole
|
|
147
|
+
- **A card footer or a side panel too narrow for a row of numbers** — `variant="compact"`, not `variant="pages"`
|
|
148
|
+
A row of numbers in a narrow column either wraps or clips, and both are worse than dropping the numbers deliberately. Compact keeps the two steps and the position, which is the part that survives the loss of width
|
|
149
|
+
- **An archive running to dozens of pages, where the reader wants one further out than the row can draw** — `variant="pages"`
|
|
150
|
+
The break between two runs of numbers presses and lists the pages it stands for, so a page the row cannot show is two presses away rather than a walk. Past fifty it lists an evenly spaced sample of the run instead, and the break beside where the reader lands stands for a shorter run and steps through it more finely
|
|
151
|
+
- **A carousel or an onboarding walkthrough of a handful of screens** — `variant="dots"`
|
|
152
|
+
The sequence is short and unnamed, so position is the whole of what the reader needs — and a dot shows it without asking them to read anything
|
|
153
|
+
|
|
154
|
+
## Accessibility
|
|
155
|
+
|
|
156
|
+
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.
|
|
157
|
+
|
|
158
|
+
- Announced as: `navigation`
|
|
159
|
+
- `Tab` — Moves onto and through the controls in the order they are read — the step back, then whatever targets the variant offers, then the step forward. No roving tabindex here, unlike a segmented control: these are separate destinations rather than one question with several answers, and a reader tabbing through them is choosing between things they can see rather than cycling a value
|
|
160
|
+
- `Enter` — Goes to the page the focused control names. Where that control is an anchor — a numbered target, or a step given pageHref — Enter follows the link and the browser does the rest, which is the whole point of drawing it as one. Where it is a button, the page is reported through onPageChange and nothing moves until the consumer passes the new page back. On the break between two runs of numbers it opens that break's menu instead, since the break names no page of its own
|
|
161
|
+
- `Space` — The same as Enter on everything this component draws as a button: the marks under dots, the numbered targets and steps where no pageHref was given, and a step sitting at either end of the set. On an anchor it does nothing, which is the browser's rule rather than this component's — a link answers Enter alone
|
|
162
|
+
- `Arrow keys` — Move through the pages a break's menu offers once it is open, and open it from the break itself — down onto the first page it lists, up onto the last. DropdownMenu's behaviour rather than this component's: the break is its trigger and the menu is its surface, which is the whole reason the break is built out of it
|
|
163
|
+
- `Escape` — Shuts a break's menu and puts focus back on the break, leaving the reader on the page they were already on. DropdownMenu's as well
|
|
164
|
+
- an accessible name drawn from label, so a reader listing the page's landmarks can tell what this one pages through. A navigation landmark without a name is one they cannot navigate to, and a page carrying two of them unnamed is worse — the list reports the same word twice
|
|
165
|
+
- the current page carries aria-current="page", and only that page. It is the one fact a reader cannot get from the row's appearance, and the attribute is what a screen reader announces alongside the number. Separate from the data attribute the stylesheet reads, so that changing how the current page looks and changing what it announces stay two decisions
|
|
166
|
+
- the step-back control carries its own accessible name, from previousLabel. A glyph announces nothing, so an unnamed pair is heard as two buttons with no way to tell which direction either goes
|
|
167
|
+
- the step-forward control carries its own, from nextLabel, and the two stay parallel — a pair reading "Next page" and "Go back" is two people's wording in one control
|
|
168
|
+
- a step control at the boundary is disabled rather than removed. Removing it shifts every remaining target sideways at the moment the reader is aiming at one, and takes away the thing a screen reader user was about to be told is unavailable. The native disabled attribute rather than aria-disabled, because there is nothing here to explain: the reader can see they are on the first page
|
|
169
|
+
- the current page's own target stays enabled and in the tab order. Disabling it would leave the one page a keyboard reader is on as the one page they cannot reach, and the row would report a different number of stops depending on where in the set they stood
|
|
170
|
+
- the position marks under the dots variant are buttons with names, not decoration. A dot that cannot be reached or announced leaves a keyboard reader with the two step controls and no way to know how many positions there are
|
|
171
|
+
- the break between two runs of numbers is a control with an accessible name of its own, from morePagesLabel, and announces that it opens a menu. It was punctuation and aria-hidden while it did nothing, which was right then and is not now: the pages behind a break are the ones a reader deep in a long set most needs, and a control that offers them to a pointer and not to a screen reader is worse than the punctuation it replaced
|
|
172
|
+
|
|
173
|
+
## Rules
|
|
174
|
+
|
|
175
|
+
- **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.
|
|
176
|
+
|
|
177
|
+
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.
|
|
178
|
+
|
|
179
|
+
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.
|
|
180
|
+
|
|
181
|
+
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.
|
|
182
|
+
|
|
183
|
+
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.
|
|
184
|
+
|
|
185
|
+
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.
|
|
186
|
+
Guidance only — cannot be checked automatically.
|
|
187
|
+
- **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.
|
|
188
|
+
Guidance only — cannot be checked automatically.
|
|
189
|
+
- **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.
|
|
190
|
+
|
|
191
|
+
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.
|
|
192
|
+
|
|
193
|
+
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.
|
|
194
|
+
Guidance only — cannot be checked automatically.
|
|
195
|
+
- **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.
|
|
196
|
+
|
|
197
|
+
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.
|
|
198
|
+
|
|
199
|
+
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.
|
|
200
|
+
|
|
201
|
+
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.
|
|
202
|
+
|
|
203
|
+
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.
|
|
204
|
+
|
|
205
|
+
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.
|
|
206
|
+
|
|
207
|
+
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.
|
|
208
|
+
|
|
209
|
+
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.
|
|
210
|
+
|
|
211
|
+
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.
|
|
212
|
+
Guidance only — cannot be checked automatically.
|
|
213
|
+
- **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.
|
|
214
|
+
|
|
215
|
+
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.
|
|
216
|
+
|
|
217
|
+
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.
|
|
218
|
+
|
|
219
|
+
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.
|
|
220
|
+
|
|
221
|
+
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.
|
|
222
|
+
|
|
223
|
+
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.
|
|
224
|
+
|
|
225
|
+
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.
|
|
226
|
+
|
|
227
|
+
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.
|
|
228
|
+
|
|
229
|
+
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.
|
|
230
|
+
Guidance only — cannot be checked automatically.
|
|
231
|
+
- **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.
|
|
232
|
+
|
|
233
|
+
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.
|
|
234
|
+
|
|
235
|
+
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.
|
|
236
|
+
|
|
237
|
+
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.
|
|
238
|
+
Guidance only — cannot be checked automatically.
|
|
239
|
+
|
|
240
|
+
## Anti-examples
|
|
241
|
+
|
|
242
|
+
❌ Pagination for: The reader is moving between views of one page rather than through one long set
|
|
243
|
+
Tabs name their destinations and pagination numbers them, which is the difference between choosing a view and advancing through a sequence. A reader handed numbers for what are really four named sections has to open each one to learn what it holds, and the numbers imply an order that the sections do not have
|
|
244
|
+
→ use `TabList` instead.
|
|
245
|
+
|
|
246
|
+
❌ Pagination for: More results are appended to the view as the reader reaches the end, rather than one page replacing another
|
|
247
|
+
That pattern has one control and no position — nothing is left behind, so there is no page to be on and no way back to describe. Pagination would report a position the view does not have, and its previous control would offer to undo something that never happened. A single button reading "Show more" is the whole of what that interaction needs
|
|
248
|
+
→ use `Button` instead.
|
|
249
|
+
|
|
250
|
+
❌ Pagination for: The reader is hunting for one row among thousands rather than walking the set
|
|
251
|
+
Four hundred pages is not an index, and a reader who knows what they are looking for should not have to guess which page it fell on. Pagination is what they use afterwards, once the query has cut the set down to something worth walking through
|
|
252
|
+
→ use `SearchInput` instead.
|
|
253
|
+
|
|
254
|
+
## Example
|
|
255
|
+
|
|
256
|
+
```tsx
|
|
257
|
+
import { Pagination } from '@deriv-com/dds-marketing'
|
|
258
|
+
|
|
259
|
+
<Pagination variant="pages" page={3} totalPages={8} />
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## In use
|
|
263
|
+
|
|
264
|
+
### Variants
|
|
265
|
+
|
|
266
|
+
One archive of 240 articles, ten to a page, under four of the five. Dots take a shorter set, because past about ten the marks stop being countable.
|
|
267
|
+
|
|
268
|
+
```tsx
|
|
269
|
+
import { Pagination } from '@deriv-com/dds-marketing'
|
|
270
|
+
|
|
271
|
+
// Pages — a blog index the reader returns to
|
|
272
|
+
<Pagination variant="pages" page={3} totalPages={24} />
|
|
273
|
+
|
|
274
|
+
// Count — the same archive, measured
|
|
275
|
+
<Pagination variant="count" page={3} totalPages={24} totalItems={240} pageSize={10} />
|
|
276
|
+
|
|
277
|
+
// Compact — a card footer with no room
|
|
278
|
+
<Pagination variant="compact" page={3} totalPages={24} />
|
|
279
|
+
|
|
280
|
+
// None — steps only, position unstated
|
|
281
|
+
<Pagination variant="none" page={3} totalPages={24} />
|
|
282
|
+
|
|
283
|
+
// Dots — a five-card carousel, not the archive
|
|
284
|
+
<Pagination variant="dots" page={3} totalPages={5} />
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Where the reader stands
|
|
288
|
+
|
|
289
|
+
The row shows different pages as the reader moves and always the same number of them, and the steps go unavailable at the ends rather than disappearing.
|
|
290
|
+
|
|
291
|
+
```tsx
|
|
292
|
+
import { Pagination } from '@deriv-com/dds-marketing'
|
|
293
|
+
|
|
294
|
+
// First page — nothing behind them
|
|
295
|
+
<Pagination variant="pages" page={1} totalPages={24} />
|
|
296
|
+
|
|
297
|
+
// Mid-set — a break at each end
|
|
298
|
+
<Pagination variant="pages" page={12} totalPages={24} />
|
|
299
|
+
|
|
300
|
+
// Last page — nothing ahead
|
|
301
|
+
<Pagination variant="pages" page={24} totalPages={24} />
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### A set longer than the row
|
|
305
|
+
|
|
306
|
+
The break stands for the pages there was no room to draw, and it presses: a menu of exactly those, so page 260 of 500 is chosen rather than walked to.
|
|
307
|
+
|
|
308
|
+
```tsx
|
|
309
|
+
import { Pagination } from '@deriv-com/dds-marketing'
|
|
310
|
+
|
|
311
|
+
// Forty pages — the break offers every page it hides
|
|
312
|
+
<Pagination variant="pages" page={20} totalPages={40} />
|
|
313
|
+
|
|
314
|
+
// Five hundred — a sample of the run, then a finer break
|
|
315
|
+
<Pagination variant="pages" page={250} totalPages={500} />
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### How wide the window is
|
|
319
|
+
|
|
320
|
+
siblingCount sets how many numbers sit around the reader before the row breaks, split with the odd one forward. The row is one length on every page either way.
|
|
321
|
+
|
|
322
|
+
```tsx
|
|
323
|
+
import { Pagination } from '@deriv-com/dds-marketing'
|
|
324
|
+
|
|
325
|
+
// One forward — the default
|
|
326
|
+
<Pagination variant="pages" page={12} totalPages={24} siblingCount={1} />
|
|
327
|
+
|
|
328
|
+
// Two, one either side
|
|
329
|
+
<Pagination variant="pages" page={12} totalPages={24} siblingCount={2} />
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### When the total is unknown
|
|
333
|
+
|
|
334
|
+
The count variant needs both a total and a page size to state a range. Given neither it counts pages instead, which lets the variant be chosen before the data arrives.
|
|
335
|
+
|
|
336
|
+
```tsx
|
|
337
|
+
import { Pagination } from '@deriv-com/dds-marketing'
|
|
338
|
+
|
|
339
|
+
// Total known — a range against a whole
|
|
340
|
+
<Pagination variant="count" page={3} totalPages={24} totalItems={240} pageSize={10} />
|
|
341
|
+
|
|
342
|
+
// Total unknown — pages, not items
|
|
343
|
+
<Pagination variant="count" page={3} totalPages={24} />
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### A set the reader swipes
|
|
347
|
+
|
|
348
|
+
Cards moved by swiping, where the row reports position and does not offer to change it. Marks alone, at the full target, being the only way through for anyone not swiping.
|
|
349
|
+
|
|
350
|
+
```tsx
|
|
351
|
+
import { Pagination } from '@deriv-com/dds-marketing'
|
|
352
|
+
|
|
353
|
+
// Five cards, third one showing
|
|
354
|
+
<Pagination variant="dots" page={3} totalPages={5} showSteps={false} />
|
|
355
|
+
|
|
356
|
+
// The same set with steps
|
|
357
|
+
<Pagination variant="dots" page={3} totalPages={5} />
|
|
358
|
+
|
|
359
|
+
// Twenty marks and both steps
|
|
360
|
+
<Pagination variant="dots" page={8} totalPages={20} />
|
|
361
|
+
```
|