@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,22 @@
|
|
|
1
|
+
import './NavbarItem.css';
|
|
2
|
+
import { type NavbarItemProps } from './NavbarItem.types.js';
|
|
3
|
+
export type { NavbarItemProps };
|
|
4
|
+
/**
|
|
5
|
+
* One place the site has, in the bar across the top of it.
|
|
6
|
+
*
|
|
7
|
+
* It takes no colour of its own, and that is what lets a bar change its ink in
|
|
8
|
+
* one declaration: the bar sets it, every item inherits, and an item that painted
|
|
9
|
+
* its own would be the one thing left behind. What it does declare is the ground
|
|
10
|
+
* under the words.
|
|
11
|
+
*
|
|
12
|
+
* `tone` has to be passed rather than sensed. An item cannot see the ground it is
|
|
13
|
+
* on, and the tints either side of it are mirrors — ink-based on paper,
|
|
14
|
+
* paper-based on dark — so the page that knows which bar it is writing is the
|
|
15
|
+
* only thing that can say.
|
|
16
|
+
*
|
|
17
|
+
* The current item keeps its href. That is where this parts company with
|
|
18
|
+
* BreadcrumbItem, whose last step is not a link because it leads nowhere new: a
|
|
19
|
+
* section you are in is one you can return to the top of, and a reader who lands
|
|
20
|
+
* on it should hear which section that is rather than meet a dead stop.
|
|
21
|
+
*/
|
|
22
|
+
export declare function NavbarItem({ current, tone, href, icon, external, children, ...rest }: NavbarItemProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowUpRightRegularIcon } from '@deriv-com/quill-icons-web';
|
|
4
|
+
import './NavbarItem.css';
|
|
5
|
+
import { Icon } from '../icon/Icon.js';
|
|
6
|
+
import { visuallyHidden } from '../../visually-hidden.js';
|
|
7
|
+
import { navbarItemDefaults, navbarItemParts } from './NavbarItem.types.js';
|
|
8
|
+
/**
|
|
9
|
+
* What the words become when the destination leaves the site.
|
|
10
|
+
*
|
|
11
|
+
* Appended to the content rather than replacing it with an `aria-label`: a label
|
|
12
|
+
* replaces the words a sighted reader is looking at, and somebody using both
|
|
13
|
+
* hears one thing and sees another. This keeps them the same sentence.
|
|
14
|
+
*/
|
|
15
|
+
const OPENS_ELSEWHERE = '(opens in a new tab)';
|
|
16
|
+
/**
|
|
17
|
+
* One place the site has, in the bar across the top of it.
|
|
18
|
+
*
|
|
19
|
+
* It takes no colour of its own, and that is what lets a bar change its ink in
|
|
20
|
+
* one declaration: the bar sets it, every item inherits, and an item that painted
|
|
21
|
+
* its own would be the one thing left behind. What it does declare is the ground
|
|
22
|
+
* under the words.
|
|
23
|
+
*
|
|
24
|
+
* `tone` has to be passed rather than sensed. An item cannot see the ground it is
|
|
25
|
+
* on, and the tints either side of it are mirrors — ink-based on paper,
|
|
26
|
+
* paper-based on dark — so the page that knows which bar it is writing is the
|
|
27
|
+
* only thing that can say.
|
|
28
|
+
*
|
|
29
|
+
* The current item keeps its href. That is where this parts company with
|
|
30
|
+
* BreadcrumbItem, whose last step is not a link because it leads nowhere new: a
|
|
31
|
+
* section you are in is one you can return to the top of, and a reader who lands
|
|
32
|
+
* on it should hear which section that is rather than meet a dead stop.
|
|
33
|
+
*/
|
|
34
|
+
export function NavbarItem({ current = navbarItemDefaults.current, tone = navbarItemDefaults.tone, href, icon, external = navbarItemDefaults.external, children, ...rest }) {
|
|
35
|
+
return (_jsxs("a", { ...rest, href: href, className: navbarItemParts.root, "data-current": String(current), "data-tone": tone, "aria-current": current ? 'page' : undefined,
|
|
36
|
+
// Both, or neither. `target` without `rel` hands the opened document a live
|
|
37
|
+
// reference back to this one; `rel` without `target` guards a navigation
|
|
38
|
+
// that never leaves.
|
|
39
|
+
target: external ? '_blank' : undefined, rel: external ? 'noreferrer' : undefined, children: [icon !== undefined && icon !== null && (_jsx("span", { className: navbarItemParts.icon, children: icon })), _jsx("span", { className: navbarItemParts.label, children: children }), external && (_jsxs(_Fragment, { children: [_jsx("span", { className: navbarItemParts.external, "aria-hidden": "true", children: _jsx(Icon, { size: "xs", children: _jsx(ArrowUpRightRegularIcon, {}) }) }), _jsx("span", { style: visuallyHidden, children: ` ${OPENS_ELSEWHERE}` })] }))] }));
|
|
40
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface NavbarItemOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `default` — The bar has a light ground under it, which is every bar on a marketing page today. The tints here are ink-based and read against paper
|
|
5
|
+
* `inverse` — The bar sits on a dark ground — a band, or art the page put behind it — and the ink runs light. The tints mirror: paper-based rather than ink-based, so a hover is visible instead of disappearing into the dark
|
|
6
|
+
*/
|
|
7
|
+
tone?: 'default' | 'inverse';
|
|
8
|
+
/** Always. This is a place, and a place has an address — an item with no href is a control drawn as a link, which is the one thing its intent says it is not */
|
|
9
|
+
href: string;
|
|
10
|
+
/** The bar's sections are quicker to tell apart by a mark than by reading them, which is rare on a marketing site and usual in an application */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** Allowed: text */
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export type NavbarItemProps = NavbarItemOwnProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'className' | 'current' | 'tone' | 'href' | 'icon' | 'external'> & ({
|
|
16
|
+
current?: boolean;
|
|
17
|
+
external?: false;
|
|
18
|
+
} | {
|
|
19
|
+
current?: false;
|
|
20
|
+
external?: boolean;
|
|
21
|
+
});
|
|
22
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
23
|
+
export declare const navbarItemParts: {
|
|
24
|
+
readonly root: "dds-navbaritem";
|
|
25
|
+
readonly icon: "dds-navbaritem__icon";
|
|
26
|
+
readonly label: "dds-navbaritem__label";
|
|
27
|
+
readonly external: "dds-navbaritem__external";
|
|
28
|
+
};
|
|
29
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
30
|
+
export declare const navbarItemDefaults: {
|
|
31
|
+
readonly current: false;
|
|
32
|
+
readonly tone: "default";
|
|
33
|
+
readonly external: false;
|
|
34
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// GENERATED from navbar-item.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const navbarItemParts = {
|
|
4
|
+
root: 'dds-navbaritem',
|
|
5
|
+
icon: 'dds-navbaritem__icon',
|
|
6
|
+
label: 'dds-navbaritem__label',
|
|
7
|
+
external: 'dds-navbaritem__external',
|
|
8
|
+
};
|
|
9
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
10
|
+
export const navbarItemDefaults = { current: false, tone: 'default', external: false };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/* GENERATED from navbarmenu.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
flex-shrink: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu .dds-navbarmenu__trigger {
|
|
9
|
+
transition-property: background-color, outline-color, outline-width;
|
|
10
|
+
align-items: center;
|
|
11
|
+
appearance: none;
|
|
12
|
+
border-style: none;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
color: inherit;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
outline-style: solid;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
background-color: var(--color-bg-transparent);
|
|
20
|
+
border-radius: var(--radius-pill);
|
|
21
|
+
font-family: var(--font-label-sm-family);
|
|
22
|
+
font-size: var(--font-label-sm-size);
|
|
23
|
+
font-weight: var(--font-label-sm-weight);
|
|
24
|
+
gap: var(--space-gap-xs);
|
|
25
|
+
letter-spacing: var(--font-label-sm-letter-spacing);
|
|
26
|
+
line-height: var(--font-label-sm-line-height);
|
|
27
|
+
min-block-size: var(--size-control-lg);
|
|
28
|
+
outline-width: var(--border-width-none);
|
|
29
|
+
padding-block: var(--space-inset-2xs);
|
|
30
|
+
padding-inline: var(--space-inset-md);
|
|
31
|
+
transition-duration: var(--motion-duration-fast);
|
|
32
|
+
transition-timing-function: var(--motion-easing-standard);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu .dds-navbarmenu__chevron {
|
|
36
|
+
align-items: center;
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
block-size: var(--icon-size-xs);
|
|
41
|
+
transition-duration: var(--motion-duration-fast);
|
|
42
|
+
transition-timing-function: var(--motion-easing-standard);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu .dds-navbarmenu__surface {
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
display: flex;
|
|
48
|
+
position: absolute;
|
|
49
|
+
color: var(--color-fg-default);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu .dds-navbarmenu__groups {
|
|
53
|
+
display: block;
|
|
54
|
+
flex: auto;
|
|
55
|
+
inline-size: 100%;
|
|
56
|
+
min-inline-size: 0;
|
|
57
|
+
column-gap: var(--space-gap-xl);
|
|
58
|
+
font-family: var(--font-body-sm-family);
|
|
59
|
+
font-size: var(--font-body-sm-size);
|
|
60
|
+
font-weight: var(--font-body-sm-weight);
|
|
61
|
+
letter-spacing: var(--font-body-sm-letter-spacing);
|
|
62
|
+
line-height: var(--font-body-sm-line-height);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu .dds-navbarmenu__feature {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex: auto;
|
|
68
|
+
inline-size: 100%;
|
|
69
|
+
min-inline-size: 0;
|
|
70
|
+
aspect-ratio: var(--aspect-widescreen);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu .dds-navbarmenu__trigger:focus-visible {
|
|
74
|
+
outline-color: var(--color-border-focus);
|
|
75
|
+
outline-width: var(--border-width-focus);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu[data-presentation="floating"] .dds-navbarmenu__groups {
|
|
79
|
+
padding-block-end: var(--space-inset-lg);
|
|
80
|
+
padding-block-start: var(--space-inset-md);
|
|
81
|
+
padding-inline-start: var(--space-inset-md);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu[data-presentation="floating"] .dds-navbarmenu__surface {
|
|
85
|
+
background-color: var(--color-bg-surface-raised);
|
|
86
|
+
border-radius: var(--radius-container);
|
|
87
|
+
box-shadow: var(--elevation-surface-overlay);
|
|
88
|
+
gap: var(--space-gap-xl);
|
|
89
|
+
inline-size: var(--size-menu-panel-max);
|
|
90
|
+
margin-block-start: var(--space-gap-sm);
|
|
91
|
+
min-block-size: var(--size-menu-panel-min);
|
|
92
|
+
padding-block: var(--space-inset-xs);
|
|
93
|
+
padding-inline: var(--space-inset-xs);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu[data-presentation="inline"] .dds-navbarmenu__chevron {
|
|
97
|
+
inline-size: var(--size-target-min);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu[data-presentation="inline"] .dds-navbarmenu__surface {
|
|
101
|
+
background-color: var(--color-bg-transparent);
|
|
102
|
+
border-radius: var(--radius-none);
|
|
103
|
+
gap: var(--space-gap-md);
|
|
104
|
+
padding-block: var(--space-inset-sm);
|
|
105
|
+
padding-inline: var(--space-inset-sm);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu[data-tone="default"] .dds-navbarmenu__trigger:hover:where(:not(:disabled)) {
|
|
109
|
+
background-color: var(--color-bg-hover);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu[data-tone="inverse"] .dds-navbarmenu__trigger:hover:where(:not(:disabled)) {
|
|
113
|
+
background-color: var(--color-bg-hover-inverse);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu[data-tone="default"] .dds-navbarmenu__trigger[data-expanded="true"] {
|
|
117
|
+
background-color: var(--color-bg-selected);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu[data-tone="inverse"] .dds-navbarmenu__trigger[data-expanded="true"] {
|
|
121
|
+
background-color: var(--color-bg-hover-inverse);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@media (prefers-reduced-motion: reduce) {
|
|
125
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu,
|
|
126
|
+
:where([data-dds-context="marketing"]) .dds-navbarmenu * { transition: none; }
|
|
127
|
+
}
|
|
128
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './NavbarMenu.css';
|
|
2
|
+
import './navbar-menu-impl.css';
|
|
3
|
+
import { type NavbarMenuProps } from './NavbarMenu.types.js';
|
|
4
|
+
export type { NavbarMenuProps };
|
|
5
|
+
export declare function NavbarMenu({ presentation, tone, label, open, onOpenChange, replacing, feature, children, ...rest }: NavbarMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useLayoutEffect, useCallback, useEffect, useRef, useState, } from 'react';
|
|
4
|
+
import { ChevronDownRegularIcon } from '@deriv-com/quill-icons-web';
|
|
5
|
+
import './NavbarMenu.css';
|
|
6
|
+
import './navbar-menu-impl.css';
|
|
7
|
+
import { milliseconds } from '../../css-time.js';
|
|
8
|
+
import { useHoverOpen } from '../../hover-open.js';
|
|
9
|
+
import { Icon } from '../icon/Icon.js';
|
|
10
|
+
import { navbarMenuDefaults, navbarMenuParts } from './NavbarMenu.types.js';
|
|
11
|
+
/**
|
|
12
|
+
* A section of the site that opens rather than goes.
|
|
13
|
+
*
|
|
14
|
+
* A `<button>`, not a link. Pressing it reveals something on the page the reader
|
|
15
|
+
* is already on — no navigation, no history entry, nothing for the back button to
|
|
16
|
+
* undo — and a trigger that claimed to be a link would be wrong to the browser,
|
|
17
|
+
* the back button and every assistive technology at once.
|
|
18
|
+
*
|
|
19
|
+
* Controlled when told, its own answer otherwise. A row of these needs the bar to
|
|
20
|
+
* hold which one is open, because no menu can see its neighbours and two panels
|
|
21
|
+
* open at once is two surfaces overlapping in front of the page. Standing alone
|
|
22
|
+
* it holds its own, which is what makes it usable outside a bar at all.
|
|
23
|
+
*
|
|
24
|
+
* The panel is not a menu and takes no menu role. What it holds is links, and
|
|
25
|
+
* `role="menu"` would promise arrow-key navigation over a set of commands — a
|
|
26
|
+
* promise whose first consequence is that a screen reader stops announcing the
|
|
27
|
+
* links as links.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* How a section's panel arrives, which is a different movement in each presentation.
|
|
31
|
+
*
|
|
32
|
+
* Floating, it hangs off the trigger over a page that does not move: nothing below it is
|
|
33
|
+
* displaced, so the motion is the panel itself appearing — a fade with a few pixels of travel
|
|
34
|
+
* down from the name that opened it, which gives the fade a direction without making a journey
|
|
35
|
+
* of it.
|
|
36
|
+
*
|
|
37
|
+
* Inline, it is a row of a list and everything under it is pushed down. There the honest movement
|
|
38
|
+
* is the height: a panel that faded in at full height would shove the rest of the list away in one
|
|
39
|
+
* frame and then take a fifth of a second to become visible in the space it had already taken.
|
|
40
|
+
* That mismatch — a box at its final size before what fills it has arrived — is the same thing
|
|
41
|
+
* that read as a jump when the bar gathered, and it is worth not repeating.
|
|
42
|
+
*
|
|
43
|
+
* Measured and handed over rather than transitioned, for the reason the bar's pill was: the height
|
|
44
|
+
* here is `auto`, layout decides it, and there is no value for CSS to interpolate between. The
|
|
45
|
+
* element is measured in a layout effect, after React has written it and before the browser paints
|
|
46
|
+
* it.
|
|
47
|
+
*
|
|
48
|
+
* `overflow: hidden` only while it runs. A panel clipped for the rest of its life would cut off a
|
|
49
|
+
* focus ring on the first destination in it, and the property cannot be part of the animation —
|
|
50
|
+
* so it is set here and taken off when the animation settles.
|
|
51
|
+
*
|
|
52
|
+
* The step and the curve come from the same roles everything else in this family moves on, read
|
|
53
|
+
* off the element so a retune reaches all of them at once.
|
|
54
|
+
*/
|
|
55
|
+
function useOpening(surface, presentation, open) {
|
|
56
|
+
useLayoutEffect(() => {
|
|
57
|
+
const element = surface.current;
|
|
58
|
+
if (element === null || !open)
|
|
59
|
+
return;
|
|
60
|
+
/*
|
|
61
|
+
Both are absent outside a browser that draws: jsdom implements neither, and the
|
|
62
|
+
generated tests render this component. Asking for the feature rather than for a
|
|
63
|
+
environment — the animation is an enhancement, and anything that cannot run it
|
|
64
|
+
gets the same arrangement without it.
|
|
65
|
+
*/
|
|
66
|
+
if (typeof window === 'undefined')
|
|
67
|
+
return;
|
|
68
|
+
if (typeof window.matchMedia !== 'function')
|
|
69
|
+
return;
|
|
70
|
+
if (typeof element.animate !== 'function')
|
|
71
|
+
return;
|
|
72
|
+
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches)
|
|
73
|
+
return;
|
|
74
|
+
const style = getComputedStyle(element);
|
|
75
|
+
const duration = milliseconds(style.getPropertyValue('--motion-duration-normal')) ?? 200;
|
|
76
|
+
const easing = style.getPropertyValue('--motion-easing-standard').trim() || 'ease';
|
|
77
|
+
if (presentation !== 'inline') {
|
|
78
|
+
// The same step a control lifts by under a pointer, off the same role, rather
|
|
79
|
+
// than a distance invented here.
|
|
80
|
+
const travel = style.getPropertyValue('--motion-translate-hover').trim() || '0 0';
|
|
81
|
+
element.animate([{ opacity: 0 }, { opacity: 1 }], { duration, easing });
|
|
82
|
+
/*
|
|
83
|
+
Added to the panel's own translate rather than written over it.
|
|
84
|
+
|
|
85
|
+
The floating panel is centred on its trigger by `translate: -50%`, and a keyframe naming
|
|
86
|
+
`translate` outright replaces that for as long as it runs — so the panel spent the whole
|
|
87
|
+
animation half its own width to the right of where it belonged and snapped into place at
|
|
88
|
+
the end, when the stylesheet got the property back. `composite: 'add'` leaves the
|
|
89
|
+
positioning underneath and moves the panel relative to it, which is what an entrance was
|
|
90
|
+
always meant to do: say how something arrives, not where it goes.
|
|
91
|
+
|
|
92
|
+
Two animations rather than one because only the travel is additive. Opacity added to an
|
|
93
|
+
underlying 1 would start the fade at full strength and never show it.
|
|
94
|
+
*/
|
|
95
|
+
element.animate([{ translate: travel }, { translate: '0 0' }], {
|
|
96
|
+
duration,
|
|
97
|
+
easing,
|
|
98
|
+
composite: 'add',
|
|
99
|
+
});
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const height = element.getBoundingClientRect().height;
|
|
103
|
+
element.style.overflow = 'hidden';
|
|
104
|
+
const opening = element.animate([{ blockSize: '0', opacity: 0 }, { blockSize: `${height}px`, opacity: 1 }], { duration, easing });
|
|
105
|
+
// `finished` rejects when an animation is cancelled, which is what unmounting
|
|
106
|
+
// does — and an unhandled rejection is not the price of closing a menu.
|
|
107
|
+
opening.finished.then(() => { element.style.overflow = ''; }).catch(() => { });
|
|
108
|
+
}, [surface, presentation, open]);
|
|
109
|
+
}
|
|
110
|
+
export function NavbarMenu({ presentation = navbarMenuDefaults.presentation, tone = navbarMenuDefaults.tone, label, open, onOpenChange, replacing = navbarMenuDefaults.replacing, feature, children, ...rest }) {
|
|
111
|
+
const rootRef = useRef(null);
|
|
112
|
+
const triggerRef = useRef(null);
|
|
113
|
+
const surfaceRef = useRef(null);
|
|
114
|
+
const [held, setHeld] = useState(false);
|
|
115
|
+
const controlled = open !== undefined;
|
|
116
|
+
const expanded = controlled ? open : held;
|
|
117
|
+
/*
|
|
118
|
+
The entrance runs when this panel is arriving and not when it is taking another's place. The
|
|
119
|
+
two are different elements — one unmounts, the other mounts — so nothing can tween between
|
|
120
|
+
them, and playing the entrance on the second reads as a close and an open rather than as an
|
|
121
|
+
exchange. The bar is the only thing that knows which of the two this is.
|
|
122
|
+
*/
|
|
123
|
+
useOpening(surfaceRef, presentation, expanded && !replacing);
|
|
124
|
+
const setOpen = useCallback((next) => {
|
|
125
|
+
if (!controlled)
|
|
126
|
+
setHeld(next);
|
|
127
|
+
onOpenChange?.(next);
|
|
128
|
+
}, [controlled, onOpenChange]);
|
|
129
|
+
/*
|
|
130
|
+
Escape, and a press outside.
|
|
131
|
+
|
|
132
|
+
On the document rather than the root, because both questions are about what
|
|
133
|
+
happened elsewhere. The panel holds links rather than controls that handle
|
|
134
|
+
their own keys, so there is nothing inside it with a prior claim on Escape —
|
|
135
|
+
which is the case that kept the panel's listener local in NavbarPanel and does
|
|
136
|
+
not arise here.
|
|
137
|
+
*/
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
if (!expanded)
|
|
140
|
+
return;
|
|
141
|
+
const onKeyDown = (event) => {
|
|
142
|
+
if (event.key !== 'Escape')
|
|
143
|
+
return;
|
|
144
|
+
hover.release();
|
|
145
|
+
setOpen(false);
|
|
146
|
+
// Back to the trigger. A reader who opened this from the keyboard is
|
|
147
|
+
// otherwise returned to the top of the document.
|
|
148
|
+
triggerRef.current?.focus();
|
|
149
|
+
};
|
|
150
|
+
const onPointerDown = (event) => {
|
|
151
|
+
const root = rootRef.current;
|
|
152
|
+
if (root === null)
|
|
153
|
+
return;
|
|
154
|
+
if (root.contains(event.target))
|
|
155
|
+
return;
|
|
156
|
+
setOpen(false);
|
|
157
|
+
};
|
|
158
|
+
document.addEventListener('keydown', onKeyDown);
|
|
159
|
+
document.addEventListener('pointerdown', onPointerDown);
|
|
160
|
+
return () => {
|
|
161
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
162
|
+
document.removeEventListener('pointerdown', onPointerDown);
|
|
163
|
+
};
|
|
164
|
+
}, [expanded, setOpen]);
|
|
165
|
+
/*
|
|
166
|
+
Opening on hover, floating only. The inline panel is a row of a list read down — there is no
|
|
167
|
+
hovering a list on the device it is drawn for, and a section that opened as a finger passed
|
|
168
|
+
over it would open every one on the way to the last.
|
|
169
|
+
|
|
170
|
+
The behaviour itself is shared: DropdownMenu wants the identical thing, and the three subtle
|
|
171
|
+
parts of it are three things to get wrong twice. See `useHoverOpen`.
|
|
172
|
+
*/
|
|
173
|
+
const hover = useHoverOpen(presentation === 'floating', expanded, setOpen);
|
|
174
|
+
return (_jsxs("div", { ...rest, ref: rootRef, className: navbarMenuParts.root, "data-presentation": presentation, "data-tone": tone, onPointerEnter: (event) => {
|
|
175
|
+
rest.onPointerEnter?.(event);
|
|
176
|
+
hover.onPointerEnter(event);
|
|
177
|
+
}, onPointerLeave: (event) => {
|
|
178
|
+
rest.onPointerLeave?.(event);
|
|
179
|
+
hover.onPointerLeave(event);
|
|
180
|
+
}, children: [_jsxs("button", { ref: triggerRef, type: "button", className: navbarMenuParts.trigger, "aria-expanded": expanded, "data-expanded": String(expanded), onClick: () => {
|
|
181
|
+
// The press owns the state from here. Left set, a panel the pointer had opened and
|
|
182
|
+
// the reader then pressed shut would close a second time when the pointer left.
|
|
183
|
+
hover.release();
|
|
184
|
+
setOpen(!expanded);
|
|
185
|
+
}, children: [label, _jsx("span", { className: navbarMenuParts.chevron, "aria-hidden": "true", children: _jsx(Icon, { size: "xs", children: _jsx(ChevronDownRegularIcon, {}) }) })] }), expanded && (_jsxs("div", { ref: surfaceRef, className: navbarMenuParts.surface, children: [_jsx("div", { className: navbarMenuParts.groups, children: children }), feature !== undefined && feature !== null && (_jsx("div", { className: navbarMenuParts.feature, children: feature }))] }))] }));
|
|
186
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface NavbarMenuOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `floating` — The menu is in the bar, which is everywhere a page puts one. The panel hangs from the trigger and floats over what is beneath it
|
|
5
|
+
* `inline` — NavbarPanel is rendering the menu, and it sets this itself — a page should not. Inside the collapsed panel there is nothing to float over and no bar to hang from, so the panel opens in the flow and pushes what follows it down, which is what an accordion row does
|
|
6
|
+
*/
|
|
7
|
+
presentation?: 'floating' | 'inline';
|
|
8
|
+
/**
|
|
9
|
+
* `default` — The bar has a light ground under it, which is every bar on a marketing page today. The trigger's tints are ink-based and read against paper
|
|
10
|
+
* `inverse` — The bar sits on a dark ground and the ink runs light. Only the trigger mirrors — the panel is its own surface with its own ground, and is the same either way
|
|
11
|
+
*/
|
|
12
|
+
tone?: 'default' | 'inverse';
|
|
13
|
+
/** Always — it is the name of the section, the words on the trigger, and the accessible name of the control. Name the section rather than the act: 'Trading', not 'Open trading menu' */
|
|
14
|
+
label: string;
|
|
15
|
+
/** The bar is holding which section is open, because only one should be at a time. Passing it makes the menu controlled: it shows what it is told and reports presses through onOpenChange.
|
|
16
|
+
|
|
17
|
+
Leave it off and the menu holds its own answer, which is right for a menu standing alone and wrong for a row of them — two panels open at once is two surfaces overlapping in front of the page */
|
|
18
|
+
open?: boolean;
|
|
19
|
+
/** Whenever open is — together they are how a bar holds which section is showing. It is called with the state being moved to, by the trigger and by Escape */
|
|
20
|
+
onOpenChange?: (open: boolean) => void;
|
|
21
|
+
/** Another section's panel was already on screen when this one opened. A container that holds one section open at a time knows this and a menu cannot, so the container sets it — Navbar does, and a page should not */
|
|
22
|
+
replacing?: boolean;
|
|
23
|
+
/** The section has something the site wants shown alongside its destinations — a promotion, a platform, a piece of art. A Card, which already knows how to hold a picture with words over it.
|
|
24
|
+
|
|
25
|
+
That is not declared as an `accepts`, and the omission is deliberate: the workbench builds a sample for any slot naming a component, from that component's own showcase, and it cannot build one whose children are themselves components — which a Card's are. Naming it would document the slot by breaking the page that shows it. */
|
|
26
|
+
feature?: ReactNode;
|
|
27
|
+
/** Allowed: NavbarMenuGroup, NavbarItem */
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export type NavbarMenuProps = NavbarMenuOwnProps & Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'presentation' | 'tone' | 'label' | 'open' | 'onOpenChange' | 'replacing' | 'feature'>;
|
|
31
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
32
|
+
export declare const navbarMenuParts: {
|
|
33
|
+
readonly root: "dds-navbarmenu";
|
|
34
|
+
readonly trigger: "dds-navbarmenu__trigger";
|
|
35
|
+
readonly chevron: "dds-navbarmenu__chevron";
|
|
36
|
+
readonly surface: "dds-navbarmenu__surface";
|
|
37
|
+
readonly groups: "dds-navbarmenu__groups";
|
|
38
|
+
readonly feature: "dds-navbarmenu__feature";
|
|
39
|
+
};
|
|
40
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
41
|
+
export declare const navbarMenuDefaults: {
|
|
42
|
+
readonly presentation: "floating";
|
|
43
|
+
readonly tone: "default";
|
|
44
|
+
readonly replacing: false;
|
|
45
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// GENERATED from navbar-menu.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const navbarMenuParts = {
|
|
4
|
+
root: 'dds-navbarmenu',
|
|
5
|
+
trigger: 'dds-navbarmenu__trigger',
|
|
6
|
+
chevron: 'dds-navbarmenu__chevron',
|
|
7
|
+
surface: 'dds-navbarmenu__surface',
|
|
8
|
+
groups: 'dds-navbarmenu__groups',
|
|
9
|
+
feature: 'dds-navbarmenu__feature',
|
|
10
|
+
};
|
|
11
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
12
|
+
export const navbarMenuDefaults = { presentation: 'floating', tone: 'default', replacing: false };
|