@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,453 @@
|
|
|
1
|
+
<!-- GENERATED from dropdown-menu.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# DropdownMenu
|
|
4
|
+
|
|
5
|
+
A button that opens a short set of destinations. Pressing one goes somewhere and the menu shuts — it holds no value and reports no answer, so there is nothing about it to find on reopening.
|
|
6
|
+
|
|
7
|
+
It is the host MenuItem was written against. A row whose role is menuitem means nothing to a screen reader outside an element whose role is menu, so until this landed MenuItem was a contract and a stylesheet waiting for one. What this adds is everything a row cannot know about itself: that there is a set, how long it is, which one the reader is on, and that Escape puts them back on the button they pressed.
|
|
8
|
+
|
|
9
|
+
The trigger is drawn here by default rather than passed in, which is where this parts company with product's menu of the same name. There the trigger is a Button handed over, on the argument that Button is where a button is decided. Marketing's Button cannot take that job: it is an anchor with a required href — a link, always — and a link that opens a menu is a link that does not navigate. ButtonIcon renders a real button but takes no words, and a set of destinations is chosen by reading them. So there is no button-with-words in this package to hand in, and the trigger is this component's to draw. That argument still holds and is the reason the drawn trigger is the default. What it does not cover is a trigger with no words at all: A control with no words is exactly what the paragraph above rules out for a set of destinations, and exactly right for a set of page numbers, which are read by their shape rather than their wording. What gets passed is the caller's business — ButtonIcon, or a button they drew themselves, which is what Pagination's break turned out to need. So `trigger` exists for that case — Pagination's break between two runs of pages — and for no other. Pass nothing and this still draws the whole thing, chevron included.
|
|
10
|
+
|
|
11
|
+
A marketing page reaches for a menu where a set of destinations is too long to sit in the navigation and too short to deserve a page — the languages a site is published in, the regions it operates in, the pages a long index skipped over. Not for a toolbar of operations: a page has nothing to operate on, which is the whole difference from the menus an application builds.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A set of destinations too long for the navigation bar and too short to be a page of its own — languages, regions, the parts of a long index
|
|
16
|
+
- The set is short enough to read at a glance, where a visitor is choosing rather than searching
|
|
17
|
+
|
|
18
|
+
## Do not use
|
|
19
|
+
|
|
20
|
+
- The set reports a choice the visitor should find marked when they return → nothing here does this
|
|
21
|
+
- The destinations belong in the page's navigation → nothing here does this
|
|
22
|
+
- It is one destination rather than one of a set → nothing here does this
|
|
23
|
+
- The set is long enough that a visitor would rather type than read → nothing here does this
|
|
24
|
+
- Anything that destroys. Marketing has no destructive tone by decision — a page navigates a visitor toward a conversion and never deletes on their behalf
|
|
25
|
+
- The page's main action. A menu is a set of supporting destinations, and the one step a page was built to produce is a Button in the open where it can be seen without a press
|
|
26
|
+
- Carrying the words a visitor needs before choosing. A row is a short label; what a choice means belongs on the page, where it can be read without opening anything
|
|
27
|
+
|
|
28
|
+
## Anatomy
|
|
29
|
+
|
|
30
|
+
DropdownMenu renders 6 elements. A token binding names the part it applies to.
|
|
31
|
+
|
|
32
|
+
- `root` — `<div>`, class `dds-dropdownmenu`. Holds the trigger and the surface, and nothing else. `position: relative`, which is what the surface is absolute against — so the menu is pinned to the button that opened it rather than to the page, and moves with it.
|
|
33
|
+
|
|
34
|
+
Inline rather than a block, because a menu button sits in a row of other things: a navigation bar, a footer column, the end of a band. A block root would take the width of whatever contains it and put the trigger at the start of an empty line.
|
|
35
|
+
- `trigger` — `<button>`, class `dds-dropdownmenu__trigger`. The button that opens it, drawn here unless one is handed in.
|
|
36
|
+
|
|
37
|
+
That is the one structural difference from product's menu, and it is forced rather than chosen: this package's Button is an anchor with a required href, so it is a link and cannot be a trigger; ButtonIcon is a real button and has no words. A set of destinations is chosen by reading them, so the trigger needs words, and nothing in this package draws a button with words. Drawing one here is the only honest answer left — and it is confined to this component rather than offered as a new button, because the moment it takes a variant it is a second place a button is decided.
|
|
38
|
+
|
|
39
|
+
It wears the secondary button's look — an outlined pill, no fill — and takes no variant to change it. A menu of supporting destinations is not the step a page was built to produce, so the brand fill would be the one thing on the band claiming to be the point, and `one-primary-per-view` is the rule that says why. One look, because there is one job.
|
|
40
|
+
|
|
41
|
+
A real `<button>`, with `type="button"` set rather than left to the element's own default of submit: a language picker dropped into a newsletter band would otherwise send the form on the way to opening.
|
|
42
|
+
|
|
43
|
+
Two sizes, sm and md, at `size.control.sm` and `size.control.md`, each with side padding at half its height, so the words start where the pill's curve stops at either measure. The step above them is not offered: it reads as a hero control, and a menu of supporting destinations is never that. The menu passes its size to every row it renders, which keeps the trigger and the set it opens reading as one control.
|
|
44
|
+
|
|
45
|
+
The mark reaches for `icon.control.md` at sm and `icon.control.lg` at md, which looks off by a step and is. That ramp is still indexed to the control names as they were, each of its steps sitting four above the label it stands beside, and the control ramp is moving to sm/md ahead of it. The measures are right at both steps; the names realign when Button, ButtonIcon and the fields migrate, and this rebinds to sm/md then with nothing else changing.
|
|
46
|
+
|
|
47
|
+
Absent when a `trigger` is passed, which the anatomy does not say and cannot: presentWhen marks a part absent until a prop is set, and this is the inverse — the part is drawn until one is. Declaring it conditional would generate a test asserting it is missing from the default, where it is the whole trigger.
|
|
48
|
+
|
|
49
|
+
Plain, it gives up the edge and nothing else. The target is the same size, the ground under a pointer is the same, and the focus ring is untouched — a control that shed its outline and its focus ring together would be one a keyboard reader could no longer find. `border.width.none` against the `border-style: solid` above rather than a second border-style: one property carries the difference, and the style stays where it is so nothing has to be put back.
|
|
50
|
+
|
|
51
|
+
And plain, it takes the ink around it rather than naming one. The variant's whole premise is that something else has already said what this is — which means something else has also decided what colour reads on it. `color.fg.default` is a near-black chosen for paper, and a switcher carrying it into a bar standing on a dark hero is the one thing in that bar nobody can read. Link and Button both give up their ink the same way and call it `tone="inherit"`; here it is not a second axis, because a plain control has already given up its edge and its ground and there is no version of it that should keep its own colour.
|
|
52
|
+
|
|
53
|
+
Plain at the small step is the one place the two axes come apart. `size` sets the type and the height together, which is right for a control standing on its own — but a bar wants the smaller type in a finger-sized target, which is exactly what the destinations beside it are: `font.label.sm` in a box of `size.control.md`. Without this the switcher was eight pixels shorter than its neighbours and the difference was invisible until a pointer landed on it and drew a fill that did not match the row.
|
|
54
|
+
|
|
55
|
+
It can open under the pointer as well as under a press, and the press is never replaced: Enter and Space reach it where no pointer exists, and a reader who uses both gets the same result from either. Only a mouse counts — a tap reports `touch` and a stylus `pen` — and only what hover opened may be closed by hover, so a menu opened from the keyboard is not shut by a pointer passing over it on its way elsewhere.
|
|
56
|
+
- `icon` — `<svg>`, class `dds-dropdownmenu__icon`. The mark before the words, when there is one. Sized by this component rather than by whatever the glyph shipped with — every glyph in the icon package carries width and height attributes of 24, and the only thing that overrides a presentation attribute is a CSS length on the element carrying it. So the class lands on the `<svg>` itself, which is why this part is an svg and not a box around one: Button and ButtonIcon both record the same finding, and a wrapper left the mark at whatever size it was imported at.
|
|
57
|
+
|
|
58
|
+
Decorative. The trigger's words say what the menu is, and a mark that had to be read would be a button whose name was a picture.
|
|
59
|
+
|
|
60
|
+
Absent when a `trigger` is passed, which the anatomy does not say and cannot: presentWhen marks a part absent until a prop is set, and this is the inverse — the part is drawn until one is. Declaring it conditional would generate a test asserting it is missing from the default, where it is the whole trigger. Rendered only when `icon` is set.
|
|
61
|
+
- `label` — `<span>`, class `dds-dropdownmenu__label`. The trigger's words, and the accessible name of the menu they open — the surface points here rather than repeating them.
|
|
62
|
+
|
|
63
|
+
One line, never wrapped. A menu button sits in a row of other things and a trigger that grew to two lines would push that row apart; a label long enough to wrap is a label that wanted fewer words.
|
|
64
|
+
|
|
65
|
+
Absent when a `trigger` is passed, which the anatomy does not say and cannot: presentWhen marks a part absent until a prop is set, and this is the inverse — the part is drawn until one is. Declaring it conditional would generate a test asserting it is missing from the default, where it is the whole trigger.
|
|
66
|
+
- `chevron` — `<svg>`, class `dds-dropdownmenu__chevron`. The mark that says a set is there, turned over while it is on screen.
|
|
67
|
+
|
|
68
|
+
Drawn on the trigger this component draws, and not a prop. Product makes it one because its trigger is passed in and some buttons should not get a chevron — an icon-only one, or one whose trailing slot the page already filled. That case now exists here too: Pagination's break hands in an icon-only control, which wants no chevron. It does not need a prop to say so. A passed trigger simply does not get one, there being no trailing slot on anything this package draws to put it in and no way to reach inside somebody else's control to add it. So the chevron belongs to the drawn trigger, where there is no slot to compete for and no button whose author meant something else. A prop offering to remove it would only offer to remove the visual form of `aria-expanded`, which is the one thing a page cannot draw for itself because it does not know when the menu is open.
|
|
69
|
+
|
|
70
|
+
One glyph rotated rather than two glyphs swapped, which is the ruling product's own chevron records: a swap replaces the mark between two frames, so there is nothing to watch and it reads as a flicker under the press. A rotation is the same mark moving, and the movement is what says which way the set went. The angle is inline — a rotation is not a property any token here carries — and the transition is bound below, so the reduced-motion block the stylesheet generates still switches the movement off. An inline transition would outrank that rule and ignore the preference.
|
|
71
|
+
|
|
72
|
+
Decorative: `aria-expanded` on the trigger carries the same fact where it can be read.
|
|
73
|
+
|
|
74
|
+
Absent when a `trigger` is passed, which the anatomy does not say and cannot: presentWhen marks a part absent until a prop is set, and this is the inverse — the part is drawn until one is. Declaring it conditional would generate a test asserting it is missing from the default, where it is the whole trigger.
|
|
75
|
+
|
|
76
|
+
It can be turned off, which Product's version has always allowed and this one did not. The case is narrow and real: a switcher drawn `plain` in a navigation bar, among sections that each carry a chevron of their own. There the mark stops distinguishing the control and starts repeating what is already said three times across the row — and the locale's own words plus a globe are the whole of what a reader needs. `aria-expanded` is untouched either way, so what is given up is the drawing and not the fact. Rendered only when `chevron` is set.
|
|
77
|
+
- `surface` — `<ul>`, class `dds-dropdownmenu__surface`. The panel and the list at once. One element carries the fill, the corner, the shadow, the inset and the ceiling before it scrolls — there is no second element to hold an empty state, because a menu with no destinations is a menu nobody should have rendered.
|
|
78
|
+
|
|
79
|
+
Announced as a menu, which is what makes the arrow keys mean what they mean and what tells a screen reader these are rows to take rather than text to read. Named by the trigger that opened it, so a visitor hears which menu they are in without the page passing a second string.
|
|
80
|
+
|
|
81
|
+
Its corner is `radius.menu` against MenuItem's `radius.menu-item`, and the inset between them is `space.inset.2xs` — 16 less 4 is 12, so the two curves are concentric and the first and last rows land on the panel's inside edge. The panel does not take `radius.surface`: that is 24 here, a measure written for a card sitting in the page, and a corner that wide over a 4 inset leaves the row's own corner nowhere to nest — 24 less 4 is 20, which on a row of 40 is exactly half, a pill. Product meets the same arithmetic at 16 because 16 is what `radius.surface` means there. This is that geometry under marketing's names, which is why `radius.menu-item` is product's 12 unchanged. Its ceiling is `size.menu.max`, which is counted in rows rather than pixels: a row here is taller than product's, so holding product's own measure would show a row less. It deliberately does not land on a row boundary — a set cut clean at the last full row looks like the whole set.
|
|
82
|
+
|
|
83
|
+
Absent when shut rather than hidden, so nothing beneath it is covered by something nobody can see and no destination is reachable by a visitor tabbing past a closed button.
|
|
84
|
+
|
|
85
|
+
As wide as its longest row rather than as wide as the trigger, with the trigger's width as a floor. A menu is a different object from the button that opened it, and a destination reading "Bahasa Indonesia" cannot be cut to fit a button reading "Language". One edge is pinned and the other let go, and which one is the alignment axis.
|
|
86
|
+
|
|
87
|
+
It always opens downwards. A menu near the foot of the page should open upwards instead, and nothing here does that yet — the same gap product's menu has, and for the same reason it is not a prop: which side there is room on is a fact about the viewport at that moment, which a page cannot assert and cannot keep true through a scroll. Measured and flipped, or not done at all.
|
|
88
|
+
|
|
89
|
+
It fades and grows a little on arriving, from its top edge — the one it is pinned to, so it reads as coming out of the trigger rather than swelling from its own middle. Gone entirely for a visitor who has asked for less movement. There is no matching exit: the surface is removed rather than held for its own way out, which is the gap product's menu has too.
|
|
90
|
+
|
|
91
|
+
Its inset does not follow the size. Both steps keep `space.inset.2xs`, because the inset is half of the concentric arithmetic above — moving it at either step would leave `radius.menu-item` describing a corner the rows no longer sit at, and a row's corner is the one measure here that answers to the surface rather than to the control ramp.
|
|
92
|
+
|
|
93
|
+
It clears the trigger by `space.gap.sm`, which is the step NavbarMenu's own panel takes and was `space.gap.xs` here. Four pixels is enough to read as a gap when the trigger is the only thing above it and is not enough when the trigger is inside something: dropped into a navigation bar's pill, the panel hung four pixels below the control and the pill's own four pixels of padding put the panel's top edge exactly on the pill's bottom edge, so the two boxes met with no seam at all. At eight the two panels in that bar — a section's and a switcher's — clear the pill by the same four pixels, which is the point: a reader sees one bar with things hanging off it rather than two components that each chose an offset. Rendered only when `open` is set.
|
|
94
|
+
|
|
95
|
+
Apply these classes from the generated `dropdownMenuParts` constant rather than writing the strings by hand.
|
|
96
|
+
|
|
97
|
+
## Composition
|
|
98
|
+
|
|
99
|
+
- Can contain: `MenuItem`
|
|
100
|
+
- Never contains: `Button`, `ButtonIcon`, `Card`, `CardButton`, `Link`, `TextInput` — in children or in any prop that takes a node
|
|
101
|
+
|
|
102
|
+
## Props
|
|
103
|
+
|
|
104
|
+
### variant — `outlined` | `plain` (default `outlined`)
|
|
105
|
+
|
|
106
|
+
- `outlined` — The control stands on its own — a switcher in a toolbar, a filter above a table, anywhere a reader has to find it before they can use it. The edge is what says there is something here to press
|
|
107
|
+
- `plain` — The control sits among others that have already said what they are — a locale beside a row of sections in a navigation bar, where every neighbour is words and a mark and an edge around one of them would make it the loudest thing in the set. It keeps the target, the ground it takes under a pointer and the ring it takes under focus, and gives up only the edge
|
|
108
|
+
|
|
109
|
+
### size — `sm` | `md` (default `md`)
|
|
110
|
+
|
|
111
|
+
- `sm` — Beside body copy rather than above it — a language picker in a navigation bar or a footer, where the trigger is one item in a row of links and should not outweigh them
|
|
112
|
+
- `md` — The default, and nearly every other page. The same height as a default Button, so the two line up when they sit in the same band
|
|
113
|
+
|
|
114
|
+
Use when: Match it to the controls it stands beside. Two steps and no third: this package's control ramp runs sm then md, and the step above them is being retired rather than offered here
|
|
115
|
+
Never for: Making the menu itself bigger. This sizes the trigger and the rows in it; how wide the panel runs is its longest destination's business, and how tall it gets before scrolling is size.menu.max at either step
|
|
116
|
+
|
|
117
|
+
### alignment — `start` | `end` (default `start`)
|
|
118
|
+
|
|
119
|
+
- `start` — The menu's leading edge lines up with the trigger's. The default, because a visitor reads from that edge and the destinations begin where the button's own words began
|
|
120
|
+
- `end` — Its trailing edge lines up instead, which is what a trigger near the end of a row needs — a footer's language picker aligned to the start would run off the screen
|
|
121
|
+
|
|
122
|
+
### tone — `default` | `inverse` (default `default`)
|
|
123
|
+
|
|
124
|
+
- `default` — The control is on a light ground, which is every surface this package paints by default
|
|
125
|
+
- `inverse` — The control is on a ground that runs against the mode — a navigation bar standing on a dark hero. Only the tints move: the ink is the surrounding ink already under `variant="plain"`, and the words and the mark were never this component's to colour. NavbarItem and NavbarMenu take the same tone for the same reason, and a switcher among them that did not would be the one item in the row whose hover disappeared
|
|
126
|
+
|
|
127
|
+
### label — `string` **Required.**
|
|
128
|
+
|
|
129
|
+
Use when: Always — the words on the trigger, and the whole of what a visitor has to go on before they press it. "Language", "Region", "More pages". Required because a trigger drawn by this component has no children to fall back on, and a menu button reading nothing is a menu nobody opens.
|
|
130
|
+
|
|
131
|
+
It names the menu as well as the button. The surface points at the trigger for its own accessible name rather than taking a second string, so the two cannot drift — product needs a separate one only because its trigger is opaque to it, and this one is not.
|
|
132
|
+
Never for: A sentence. This sits in a row of other things and does not wrap — words long enough to need the room are words that belong on the page.
|
|
133
|
+
|
|
134
|
+
### icon — `node`
|
|
135
|
+
|
|
136
|
+
Accepts: QuillSystemIcon
|
|
137
|
+
Use when: A mark before the trigger's words, where the set is read by shape as much as by reading — a globe beside "Language", a flag beside the region a visitor is already in
|
|
138
|
+
Never for: The chevron, which this component draws itself and is not a slot. And saying what the menu holds when the words already do: a mark beside "Language" is recognised faster, a mark beside "Choose where you are reading from" is decoration in front of a sentence
|
|
139
|
+
|
|
140
|
+
### chevron — `boolean` (default `true`)
|
|
141
|
+
|
|
142
|
+
Use when: A chevron in the trigger, pointing down while the menu is shut and up while it is open. On by default because it is the visual form of aria-expanded — the same fact the attribute carries, drawn — and this component is the only thing that knows it. Product's DropdownMenu names the same prop for the same reason
|
|
143
|
+
Never for: A trigger standing on its own. Without an edge or a chevron there is nothing left saying the control opens anything, and a reader finds out by pressing it. Turn it off only where the neighbours say it — a locale in a row of sections that each carry one, where a third chevron is the repetition rather than the signal
|
|
144
|
+
|
|
145
|
+
### openOnHover — `boolean` (default `false`)
|
|
146
|
+
|
|
147
|
+
Use when: The menu is one of several things on a bar that open, and the others open on hover — a switcher beside a row of navigation sections, where a reader who has learned that the sections open under the pointer meets one control that does not and reads it as broken. Off everywhere else: a filter above a table or a switcher in a toolbar is a deliberate act, and a menu that opened as the pointer crossed it on the way somewhere else is a menu in the way
|
|
148
|
+
Never for: A menu whose rows do something on the spot rather than go somewhere. Hover is an accident as often as it is an intention, and a set opened by accident is one a reader can act on by accident
|
|
149
|
+
|
|
150
|
+
### trigger — `node`
|
|
151
|
+
|
|
152
|
+
Use when: A control this component should open rather than draw — one whose mark is the whole of it, with no words to read. A ButtonIcon is the obvious candidate and not the only one: Pagination's break between two runs of page numbers passes a button of its own, because it has to match the numbered targets either side of it and this package's ButtonIcon has no transparent form to do that with. Given one, `icon` and `label`'s words go unused: what is drawn is what was passed. What this component still supplies is the half a page gets wrong — that the control announces a menu and whether it is open, that Escape returns focus to it, and that the arrow keys move through the rows.
|
|
153
|
+
Never for: Anything that is not a button. A menu opened by a div is a menu a keyboard cannot reach, and one opened by this package's Button is a link that does not navigate — Button is an anchor here, which is the reason this component drew its own trigger to begin with. Nor for a control with words on it, which is what the drawn trigger is already for and does better, the chevron included.
|
|
154
|
+
|
|
155
|
+
### open — `boolean`
|
|
156
|
+
|
|
157
|
+
Use when: The page holds whether the menu is open, and this component stops holding it. For the case where something outside has to shut it — a navigation bar that closes its menu when another one opens. Pair it with onOpenChange, or the menu is open forever
|
|
158
|
+
Never for: Opening it on arrival. A menu that opens itself is a panel the visitor did not ask for, over content they came to read — and the browser scrolls whatever takes focus into view, so it moves the page as well
|
|
159
|
+
|
|
160
|
+
### defaultOpen — `boolean`
|
|
161
|
+
|
|
162
|
+
Use when: A specimen — a documentation page, the preview's own stage — where the menu has to be on screen to be looked at. This component still holds the state afterwards
|
|
163
|
+
Never for: A real page. It is the same objection as open's, without even a prop the page could use to close it again
|
|
164
|
+
|
|
165
|
+
### onOpenChange — `callback`
|
|
166
|
+
|
|
167
|
+
Use when: Something outside has to know — a navigation bar shutting its other menus, a page that dims behind an open one. Required in practice alongside open, which is the only way a driven menu ever closes
|
|
168
|
+
Never for: Running what the row does. That is the row's own onSelect, and a menu cannot tell you which one was pressed — it only knows that it shut
|
|
169
|
+
|
|
170
|
+
Also accepts everything from `HTMLAttributes<HTMLDivElement>`.
|
|
171
|
+
|
|
172
|
+
## Accessibility
|
|
173
|
+
|
|
174
|
+
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.
|
|
175
|
+
|
|
176
|
+
- Announced as: `menu`
|
|
177
|
+
- `Enter or Space` — on the trigger, open the menu and put focus on the first destination
|
|
178
|
+
- `ArrowDown` — on the trigger, the same; inside the menu, the next destination
|
|
179
|
+
- `ArrowUp` — on the trigger, open it and put focus on the last — for a visitor reaching for the thing at the bottom; inside the menu, the previous one
|
|
180
|
+
- `Home` — the first destination
|
|
181
|
+
- `End` — the last destination
|
|
182
|
+
- `Escape` — shut the menu and return focus to the trigger, which is where the visitor was and what they pressed
|
|
183
|
+
- `Tab` — shut the menu and carry on out of it. Inside the menu Tab does not move between rows — the arrow keys do that, which is what the menu role promises
|
|
184
|
+
- `a letter` — the next destination beginning with it, for a set read by eye and reached by hand
|
|
185
|
+
- focus moves to the rows themselves rather than being described from the trigger. A menu's rows are things to take, and a visitor pressing Enter should be pressing the thing they are on — where a field keeping focus in its box does so because the box is what holds the answer
|
|
186
|
+
- the trigger says a menu is there and whether it is open, through aria-haspopup and aria-expanded. The chevron is the same fact drawn, and neither stands in for the other — one is for a screen reader and one is for an eye
|
|
187
|
+
- the surface is named by the trigger rather than by a string of its own, so what a visitor hears is what they read before pressing and the two cannot drift apart
|
|
188
|
+
- shutting returns focus to the trigger. A menu that shuts and leaves focus where the surface was drops a keyboard visitor at the top of the document, several tabs from the button they pressed
|
|
189
|
+
- a row that cannot be used stays in the menu and is announced as unavailable rather than being removed. A set that changes shape between openings is one a visitor has to learn twice
|
|
190
|
+
- the menu is absent from the document when shut rather than hidden, so no destination is reachable by a visitor tabbing past a closed button
|
|
191
|
+
- the trigger is a real button. A menu opened by a div is a menu a keyboard cannot reach, and one opened by a link is a link that does not navigate — which is why this package's own Button, an anchor with a required href, could not be the trigger
|
|
192
|
+
|
|
193
|
+
## Rules
|
|
194
|
+
|
|
195
|
+
- **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.
|
|
196
|
+
|
|
197
|
+
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.
|
|
198
|
+
|
|
199
|
+
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.
|
|
200
|
+
|
|
201
|
+
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.
|
|
202
|
+
|
|
203
|
+
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.
|
|
204
|
+
|
|
205
|
+
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.
|
|
206
|
+
Guidance only — cannot be checked automatically.
|
|
207
|
+
- **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.
|
|
208
|
+
Guidance only — cannot be checked automatically.
|
|
209
|
+
- **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.
|
|
210
|
+
|
|
211
|
+
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.
|
|
212
|
+
|
|
213
|
+
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.
|
|
214
|
+
Guidance only — cannot be checked automatically.
|
|
215
|
+
- **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.
|
|
216
|
+
|
|
217
|
+
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.
|
|
218
|
+
|
|
219
|
+
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.
|
|
220
|
+
|
|
221
|
+
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.
|
|
222
|
+
|
|
223
|
+
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.
|
|
224
|
+
|
|
225
|
+
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.
|
|
226
|
+
|
|
227
|
+
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.
|
|
228
|
+
|
|
229
|
+
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.
|
|
230
|
+
|
|
231
|
+
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.
|
|
232
|
+
Guidance only — cannot be checked automatically.
|
|
233
|
+
- **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.
|
|
234
|
+
|
|
235
|
+
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.
|
|
236
|
+
|
|
237
|
+
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.
|
|
238
|
+
|
|
239
|
+
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.
|
|
240
|
+
|
|
241
|
+
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.
|
|
242
|
+
|
|
243
|
+
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.
|
|
244
|
+
|
|
245
|
+
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.
|
|
246
|
+
|
|
247
|
+
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.
|
|
248
|
+
|
|
249
|
+
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.
|
|
250
|
+
Guidance only — cannot be checked automatically.
|
|
251
|
+
- **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.
|
|
252
|
+
|
|
253
|
+
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.
|
|
254
|
+
|
|
255
|
+
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.
|
|
256
|
+
|
|
257
|
+
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.
|
|
258
|
+
Guidance only — cannot be checked automatically.
|
|
259
|
+
|
|
260
|
+
## Anti-examples
|
|
261
|
+
|
|
262
|
+
❌ DropdownMenu for: The set reports a choice the visitor should find marked when they return
|
|
263
|
+
Nothing here does this yet. Its rows are commands, so they hold no value and the menu cannot show which one is current — a language picker that forgets the language is a picker that has not picked. The trigger's own words are the closest this gets, and the page has to set them.
|
|
264
|
+
→ nothing in this system does this. Not a gap waiting to be filled — the case belongs outside it.
|
|
265
|
+
|
|
266
|
+
❌ DropdownMenu for: The destinations belong in the page's navigation
|
|
267
|
+
A menu is where a visitor goes when the navigation could not carry something, not a way to avoid writing one. Links in a nav are found; commands in a menu are looked for, and a visitor who does not open it never learns the set exists.
|
|
268
|
+
→ nothing in this system does this. Not a gap waiting to be filled — the case belongs outside it.
|
|
269
|
+
|
|
270
|
+
❌ DropdownMenu for: It is one destination rather than one of a set
|
|
271
|
+
Button. A menu holding a single row is a button wearing a panel, and it costs the visitor a press to discover that.
|
|
272
|
+
→ nothing in this system does this. Not a gap waiting to be filled — the case belongs outside it.
|
|
273
|
+
|
|
274
|
+
❌ DropdownMenu for: The set is long enough that a visitor would rather type than read
|
|
275
|
+
Nothing here filters, and a menu is read top to bottom. Past a couple of dozen rows a reader is searching rather than choosing, and this offers them nothing to search with — the first letter jumps, which is a shortcut for a set already known rather than a way to find one.
|
|
276
|
+
→ nothing in this system does this. Not a gap waiting to be filled — the case belongs outside it.
|
|
277
|
+
|
|
278
|
+
## Example
|
|
279
|
+
|
|
280
|
+
```tsx
|
|
281
|
+
import { DropdownMenu, MenuItem } from '@deriv-com/dds-marketing'
|
|
282
|
+
import { GlobeRegularIcon } from '@deriv-com/quill-icons-web'
|
|
283
|
+
|
|
284
|
+
<DropdownMenu label="Language" icon={<GlobeRegularIcon />}>
|
|
285
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
286
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Deutsch</MenuItem>
|
|
287
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Français</MenuItem>
|
|
288
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Bahasa Indonesia</MenuItem>
|
|
289
|
+
</DropdownMenu>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## In use
|
|
293
|
+
|
|
294
|
+
Most rows below hold the same set, written once here:
|
|
295
|
+
|
|
296
|
+
```tsx
|
|
297
|
+
import { MenuItem } from '@deriv-com/dds-marketing'
|
|
298
|
+
|
|
299
|
+
const menuitems = (
|
|
300
|
+
<>
|
|
301
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
302
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Deutsch</MenuItem>
|
|
303
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Français</MenuItem>
|
|
304
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Bahasa Indonesia</MenuItem>
|
|
305
|
+
</>
|
|
306
|
+
)
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Shut, and open
|
|
310
|
+
|
|
311
|
+
A button until it is pressed. The chevron is this component's to draw — a page cannot know when the menu is open, and one it passed would point the same way forever.
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import { DropdownMenu, MenuItem } from '@deriv-com/dds-marketing'
|
|
315
|
+
|
|
316
|
+
// Shut, which is a button and nothing more
|
|
317
|
+
<DropdownMenu label="Language">
|
|
318
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
319
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Deutsch</MenuItem>
|
|
320
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Français</MenuItem>
|
|
321
|
+
</DropdownMenu>
|
|
322
|
+
|
|
323
|
+
// Open, with the destinations it holds
|
|
324
|
+
<DropdownMenu label="Language" defaultOpen>
|
|
325
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
326
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Deutsch</MenuItem>
|
|
327
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Français</MenuItem>
|
|
328
|
+
</DropdownMenu>
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Destinations, not operations
|
|
332
|
+
|
|
333
|
+
What a marketing menu is for: the languages a site is published in, the regions it covers. A visitor is choosing where to go, not doing something to the page.
|
|
334
|
+
|
|
335
|
+
```tsx
|
|
336
|
+
import { DropdownMenu, MenuItem } from '@deriv-com/dds-marketing'
|
|
337
|
+
import { GlobeRegularIcon } from '@deriv-com/quill-icons-web'
|
|
338
|
+
|
|
339
|
+
// The languages a site is published in
|
|
340
|
+
<DropdownMenu label="Language" icon={<GlobeRegularIcon />} defaultOpen>{menuitems}</DropdownMenu>
|
|
341
|
+
|
|
342
|
+
// One not reachable yet, announced not removed
|
|
343
|
+
<DropdownMenu label="Region" defaultOpen>
|
|
344
|
+
<MenuItem onSelect={() => { /* your handler */ }}>United Kingdom</MenuItem>
|
|
345
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Singapore</MenuItem>
|
|
346
|
+
<MenuItem disabled onSelect={() => { /* your handler */ }}>Deutschland</MenuItem>
|
|
347
|
+
</DropdownMenu>
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Which edge it opens from
|
|
351
|
+
|
|
352
|
+
One edge is pinned to the trigger and the other let go, which is what lets the menu be wider than the button. End is for a trigger near the end of a row.
|
|
353
|
+
|
|
354
|
+
```tsx
|
|
355
|
+
import { DropdownMenu, MenuItem } from '@deriv-com/dds-marketing'
|
|
356
|
+
|
|
357
|
+
// From the trigger's leading edge, which is the default
|
|
358
|
+
<DropdownMenu label="Language" alignment="start" defaultOpen>
|
|
359
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
360
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Bahasa Indonesia</MenuItem>
|
|
361
|
+
</DropdownMenu>
|
|
362
|
+
|
|
363
|
+
// From its trailing edge, for a footer's last control
|
|
364
|
+
<DropdownMenu label="Language" alignment="end" defaultOpen>
|
|
365
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
366
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Bahasa Indonesia</MenuItem>
|
|
367
|
+
</DropdownMenu>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### As wide as its longest destination
|
|
371
|
+
|
|
372
|
+
The trigger's width is a floor rather than a measure. A destination reading "Bahasa Indonesia" cannot be cut to fit a button reading "Language".
|
|
373
|
+
|
|
374
|
+
```tsx
|
|
375
|
+
import { DropdownMenu, MenuItem } from '@deriv-com/dds-marketing'
|
|
376
|
+
|
|
377
|
+
// A short trigger, and a row far wider than it
|
|
378
|
+
<DropdownMenu label="Language" defaultOpen>
|
|
379
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
380
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Bahasa Indonesia</MenuItem>
|
|
381
|
+
</DropdownMenu>
|
|
382
|
+
|
|
383
|
+
// And a wide trigger with short rows, held by the floor
|
|
384
|
+
<DropdownMenu label="Choose your reading language" defaultOpen>
|
|
385
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
386
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Deutsch</MenuItem>
|
|
387
|
+
</DropdownMenu>
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### Two sizes
|
|
391
|
+
|
|
392
|
+
The trigger follows the controls it stands beside, and the rows follow the trigger. Two steps and no third — the step above them is not offered here.
|
|
393
|
+
|
|
394
|
+
```tsx
|
|
395
|
+
import { DropdownMenu, MenuItem } from '@deriv-com/dds-marketing'
|
|
396
|
+
|
|
397
|
+
// sm — beside a row of navigation links
|
|
398
|
+
<DropdownMenu size="sm" label="Language" defaultOpen>
|
|
399
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
400
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Deutsch</MenuItem>
|
|
401
|
+
</DropdownMenu>
|
|
402
|
+
|
|
403
|
+
// md — the default, and nearly every page
|
|
404
|
+
<DropdownMenu size="md" label="Language" defaultOpen>
|
|
405
|
+
<MenuItem onSelect={() => { /* your handler */ }}>English</MenuItem>
|
|
406
|
+
<MenuItem onSelect={() => { /* your handler */ }}>Deutsch</MenuItem>
|
|
407
|
+
</DropdownMenu>
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### With an edge, and without
|
|
411
|
+
|
|
412
|
+
The edge is what finds a control standing on its own. Among neighbours that are already words and a mark, it is the thing that stands out instead.
|
|
413
|
+
|
|
414
|
+
```tsx
|
|
415
|
+
import { DropdownMenu } from '@deriv-com/dds-marketing'
|
|
416
|
+
import { GlobeRegularIcon } from '@deriv-com/quill-icons-web'
|
|
417
|
+
|
|
418
|
+
// outlined — on its own in a toolbar
|
|
419
|
+
<DropdownMenu label="Language" icon={<GlobeRegularIcon />}>{menuitems}</DropdownMenu>
|
|
420
|
+
|
|
421
|
+
// plain — among items that carry their own chevrons
|
|
422
|
+
<DropdownMenu label="Language" icon={<GlobeRegularIcon />} variant="plain" size="sm" chevron={false}>{menuitems}</DropdownMenu>
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### Which ground it is on
|
|
426
|
+
|
|
427
|
+
Only the tints move. Under plain the ink is already whatever the surface set, so what is left to say is what a pointer and a focus ring should look like against it.
|
|
428
|
+
|
|
429
|
+
```tsx
|
|
430
|
+
import { DropdownMenu } from '@deriv-com/dds-marketing'
|
|
431
|
+
import { GlobeRegularIcon } from '@deriv-com/quill-icons-web'
|
|
432
|
+
|
|
433
|
+
// default — a light bar
|
|
434
|
+
<DropdownMenu label="Language" icon={<GlobeRegularIcon />} variant="plain" size="sm" chevron={false}>{menuitems}</DropdownMenu>
|
|
435
|
+
|
|
436
|
+
// inverse — a bar on a dark hero
|
|
437
|
+
<DropdownMenu label="Language" icon={<GlobeRegularIcon />} variant="plain" size="sm" chevron={false} tone="inverse">{menuitems}</DropdownMenu>
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
### What opens it
|
|
441
|
+
|
|
442
|
+
A press, always. A pointer as well where the menu sits among others that open the same way and one that did not would read as broken.
|
|
443
|
+
|
|
444
|
+
```tsx
|
|
445
|
+
import { DropdownMenu } from '@deriv-com/dds-marketing'
|
|
446
|
+
import { GlobeRegularIcon } from '@deriv-com/quill-icons-web'
|
|
447
|
+
|
|
448
|
+
// A press — a switcher standing on its own
|
|
449
|
+
<DropdownMenu label="Language" icon={<GlobeRegularIcon />}>{menuitems}</DropdownMenu>
|
|
450
|
+
|
|
451
|
+
// A press or a pointer — one of a row that opens
|
|
452
|
+
<DropdownMenu label="Language" icon={<GlobeRegularIcon />} variant="plain" size="sm" chevron={false} openOnHover>{menuitems}</DropdownMenu>
|
|
453
|
+
```
|