@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,36 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TableBodyOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `sm` — Compact. Dense data a reader scans rather than reads — a ledger, a positions table, anything where fitting more rows on screen is worth more than air around each one
|
|
5
|
+
* `md` — Balanced, and the default: rows a reader moves through at reading pace, with enough room that the eye does not slip between them
|
|
6
|
+
* `lg` — Spacious. Few rows, each carrying something substantial — a plan comparison, a summary of three accounts. Reach for it when the table is the page rather than a part of it
|
|
7
|
+
*/
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
/**
|
|
10
|
+
* `rows` — The default. A line between rows and none between columns, which is what stops the eye slipping from one row's start to another's end — the mistake a wide table invites and the one a reader never notices making
|
|
11
|
+
* `grid` — Lines both ways, for a table read as a matrix rather than as a list of records: a rate card, a comparison where the reader traces a column as often as a row. It is more lines than most tables need, so it should be asked for
|
|
12
|
+
* `none` — No lines at all. Right for two or three rows, where the rules are more structure than data, and for a table whose columns are already separated by their alignment
|
|
13
|
+
*/
|
|
14
|
+
dividers?: 'rows' | 'grid' | 'none';
|
|
15
|
+
/** Handed down by the table. It draws a wash under the pointer so a reader knows which row a press would land on — and only on a device that has a pointer, which the row's own stylesheet gates */
|
|
16
|
+
hoverable?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* `wrap` — The default. Text too long for its column wraps and the row grows taller, so nothing is hidden — right whenever the value is the point and a reader has to read all of it
|
|
19
|
+
* `truncate` — Rows must stay one line high — a dense table a reader scans down, where a row that grew would break the rhythm they are scanning by. The value is clipped with an ellipsis and the whole of it is still reachable, so this trades seeing for scanning rather than losing anything
|
|
20
|
+
*/
|
|
21
|
+
overflow?: 'wrap' | 'truncate';
|
|
22
|
+
/** Allowed: TableRow */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export type TableBodyProps = TableBodyOwnProps & Omit<HTMLAttributes<HTMLTableSectionElement>, 'className' | 'size' | 'dividers' | 'hoverable' | 'overflow'>;
|
|
26
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
27
|
+
export declare const tableBodyParts: {
|
|
28
|
+
readonly root: "dds-tablebody";
|
|
29
|
+
};
|
|
30
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
31
|
+
export declare const tableBodyDefaults: {
|
|
32
|
+
readonly size: "md";
|
|
33
|
+
readonly dividers: "rows";
|
|
34
|
+
readonly hoverable: true;
|
|
35
|
+
readonly overflow: "wrap";
|
|
36
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// GENERATED from table-body.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const tableBodyParts = {
|
|
4
|
+
root: 'dds-tablebody',
|
|
5
|
+
};
|
|
6
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
7
|
+
export const tableBodyDefaults = { size: 'md', dividers: 'rows', hoverable: true, overflow: 'wrap' };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* GENERATED from tablecell.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-tablecell {
|
|
4
|
+
border-block-end-width: 0;
|
|
5
|
+
border-inline-width: 0;
|
|
6
|
+
border-style: solid;
|
|
7
|
+
vertical-align: top;
|
|
8
|
+
border-color: var(--color-border-subtle);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-align="center"] {
|
|
12
|
+
text-align: center;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-align="end"] {
|
|
16
|
+
text-align: end;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-align="start"] {
|
|
20
|
+
text-align: start;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-numeric="false"] {
|
|
24
|
+
font-variant-numeric: normal;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-numeric="true"] {
|
|
28
|
+
font-variant-numeric: tabular-nums;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-overflow="truncate"] {
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-overflow="wrap"] {
|
|
38
|
+
white-space: normal;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-dividers="grid"] {
|
|
42
|
+
border-block-start-width: var(--border-width-hairline);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-dividers="none"] {
|
|
46
|
+
border-block-start-width: var(--border-width-none);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-dividers="rows"] {
|
|
50
|
+
border-block-start-width: var(--border-width-hairline);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-size="lg"] {
|
|
54
|
+
font-family: var(--font-body-lg-family);
|
|
55
|
+
font-size: var(--font-body-lg-size);
|
|
56
|
+
line-height: var(--font-body-lg-line-height);
|
|
57
|
+
padding-block: var(--space-inset-lg);
|
|
58
|
+
padding-inline: var(--space-inset-lg);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-size="md"] {
|
|
62
|
+
font-family: var(--font-body-md-family);
|
|
63
|
+
font-size: var(--font-body-md-size);
|
|
64
|
+
line-height: var(--font-body-md-line-height);
|
|
65
|
+
padding-block: var(--space-inset-md);
|
|
66
|
+
padding-inline: var(--space-inset-md);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:where([data-dds-context="marketing"]) .dds-tablecell[data-size="sm"] {
|
|
70
|
+
font-family: var(--font-body-sm-family);
|
|
71
|
+
font-size: var(--font-body-sm-size);
|
|
72
|
+
line-height: var(--font-body-sm-line-height);
|
|
73
|
+
padding-block: var(--space-inset-sm);
|
|
74
|
+
padding-inline: var(--space-inset-sm);
|
|
75
|
+
}
|
|
76
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import './TableCell.css';
|
|
2
|
+
import { type TableCellProps } from './TableCell.types.js';
|
|
3
|
+
export type { TableCellProps };
|
|
4
|
+
/**
|
|
5
|
+
* One value in a row, under the column that names it.
|
|
6
|
+
*
|
|
7
|
+
* A slot: what goes in is the page's to compose, which is what lets a cell hold a badge, a status
|
|
8
|
+
* dot, a link or a control rather than only text. What it decides is where the value sits in the
|
|
9
|
+
* column and whether its digits line up with the ones above and below.
|
|
10
|
+
*
|
|
11
|
+
* It draws the rule above itself. A `<tr>` border is painted only while a table collapses its
|
|
12
|
+
* borders, and this table separates them so it can hold a corner — so the line between two rows is
|
|
13
|
+
* a run of cell edges rather than one row edge, handed down from the row.
|
|
14
|
+
*
|
|
15
|
+
* `numeric` sets tabular figures and nothing else. Inter's default figures are proportional, so a
|
|
16
|
+
* column of amounts drawn with them has its decimal points in slightly different places and stops
|
|
17
|
+
* being a column a reader can compare down. Ranging the column to the end is `align`'s job — the
|
|
18
|
+
* two travel together on almost every numeric column, and keeping them apart is what lets a centred
|
|
19
|
+
* count exist.
|
|
20
|
+
*/
|
|
21
|
+
export declare function TableCell({ size, align, numeric, dividers, overflow, children, ...rest }: TableCellProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import './TableCell.css';
|
|
4
|
+
import { tableCellDefaults, tableCellParts } from './TableCell.types.js';
|
|
5
|
+
/**
|
|
6
|
+
* One value in a row, under the column that names it.
|
|
7
|
+
*
|
|
8
|
+
* A slot: what goes in is the page's to compose, which is what lets a cell hold a badge, a status
|
|
9
|
+
* dot, a link or a control rather than only text. What it decides is where the value sits in the
|
|
10
|
+
* column and whether its digits line up with the ones above and below.
|
|
11
|
+
*
|
|
12
|
+
* It draws the rule above itself. A `<tr>` border is painted only while a table collapses its
|
|
13
|
+
* borders, and this table separates them so it can hold a corner — so the line between two rows is
|
|
14
|
+
* a run of cell edges rather than one row edge, handed down from the row.
|
|
15
|
+
*
|
|
16
|
+
* `numeric` sets tabular figures and nothing else. Inter's default figures are proportional, so a
|
|
17
|
+
* column of amounts drawn with them has its decimal points in slightly different places and stops
|
|
18
|
+
* being a column a reader can compare down. Ranging the column to the end is `align`'s job — the
|
|
19
|
+
* two travel together on almost every numeric column, and keeping them apart is what lets a centred
|
|
20
|
+
* count exist.
|
|
21
|
+
*/
|
|
22
|
+
export function TableCell({ size = tableCellDefaults.size, align = tableCellDefaults.align, numeric = tableCellDefaults.numeric, dividers = tableCellDefaults.dividers, overflow = tableCellDefaults.overflow, children, ...rest }) {
|
|
23
|
+
/*
|
|
24
|
+
* A value has no case decision, and the row clones every cell it holds with the same props — so
|
|
25
|
+
* the header's setting arrives here too. Left in `rest` it reaches the element as
|
|
26
|
+
* `headercase="upper"`, which is not an attribute a `<td>` has. The same swallow TableHeaderCell
|
|
27
|
+
* makes of the overflow a header never uses.
|
|
28
|
+
*/
|
|
29
|
+
const { headerCase: _headerCase, ...attrs } = rest;
|
|
30
|
+
return (_jsx("td", { ...attrs, className: tableCellParts.root, "data-size": size, "data-align": align, "data-numeric": String(numeric), "data-dividers": dividers, "data-overflow": overflow, children: children }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode, TdHTMLAttributes } from 'react';
|
|
2
|
+
export interface TableCellOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `sm` — Compact. Dense data a reader scans rather than reads — a ledger, a positions table, anything where fitting more rows on screen is worth more than air around each one
|
|
5
|
+
* `md` — Balanced, and the default: rows a reader moves through at reading pace, with enough room that the eye does not slip between them
|
|
6
|
+
* `lg` — Spacious. Few rows, each carrying something substantial — a plan comparison, a summary of three accounts. Reach for it when the table is the page rather than a part of it
|
|
7
|
+
*/
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
/**
|
|
10
|
+
* `start` — Words. Names, descriptions, statuses — anything read left to right starts where the reading does, and a column of them shares one edge the eye can run down
|
|
11
|
+
* `center` — Rare, and worth arguing for: a single glyph or a very short state where neither edge means anything. A centred column of words has two ragged edges instead of one
|
|
12
|
+
* `end` — Numbers that line up under each other — amounts, counts, percentages. The decimal point is what a reader compares down a column, and ranging to the end is what puts it in one place
|
|
13
|
+
*/
|
|
14
|
+
align?: 'start' | 'center' | 'end';
|
|
15
|
+
/** The cell holds digits a reader compares against the cells above and below — an amount, a count, a percentage. It sets tabular figures, so every digit takes the same width and the decimal points line up down the column. Ranging the column to the end is `align`'s job and a separate decision — the two travel together on almost every numeric column, and keeping them apart is what lets a centred count exist */
|
|
16
|
+
numeric?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* `rows` — The default. A line between rows and none between columns, which is what stops the eye slipping from one row's start to another's end — the mistake a wide table invites and the one a reader never notices making
|
|
19
|
+
* `grid` — Lines both ways, for a table read as a matrix rather than as a list of records: a rate card, a comparison where the reader traces a column as often as a row. It is more lines than most tables need, so it should be asked for
|
|
20
|
+
* `none` — No lines at all. Right for two or three rows, where the rules are more structure than data, and for a table whose columns are already separated by their alignment
|
|
21
|
+
*/
|
|
22
|
+
dividers?: 'rows' | 'grid' | 'none';
|
|
23
|
+
/**
|
|
24
|
+
* `wrap` — The default. Text too long for its column wraps and the row grows taller, so nothing is hidden — right whenever the value is the point and a reader has to read all of it
|
|
25
|
+
* `truncate` — Rows must stay one line high — a dense table a reader scans down, where a row that grew would break the rhythm they are scanning by. The value is clipped with an ellipsis and the whole of it is still reachable, so this trades seeing for scanning rather than losing anything
|
|
26
|
+
*/
|
|
27
|
+
overflow?: 'wrap' | 'truncate';
|
|
28
|
+
/** Allowed: any content */
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export type TableCellProps = TableCellOwnProps & Omit<TdHTMLAttributes<HTMLTableCellElement>, 'className' | 'size' | 'align' | 'numeric' | 'dividers' | 'overflow'>;
|
|
32
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
33
|
+
export declare const tableCellParts: {
|
|
34
|
+
readonly root: "dds-tablecell";
|
|
35
|
+
};
|
|
36
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
37
|
+
export declare const tableCellDefaults: {
|
|
38
|
+
readonly size: "md";
|
|
39
|
+
readonly align: "start";
|
|
40
|
+
readonly numeric: false;
|
|
41
|
+
readonly dividers: "rows";
|
|
42
|
+
readonly overflow: "wrap";
|
|
43
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// GENERATED from table-cell.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const tableCellParts = {
|
|
4
|
+
root: 'dds-tablecell',
|
|
5
|
+
};
|
|
6
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
7
|
+
export const tableCellDefaults = { size: 'md', align: 'start', numeric: false, dividers: 'rows', overflow: 'wrap' };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './TableHead.css';
|
|
2
|
+
import './table-head-impl.css';
|
|
3
|
+
import { type TableHeadProps } from './TableHead.types.js';
|
|
4
|
+
export type { TableHeadProps };
|
|
5
|
+
/**
|
|
6
|
+
* The column names, above the data, and the filter row where there is one.
|
|
7
|
+
*
|
|
8
|
+
* It exists as a component rather than a wrapper because a screen reader announces a column's
|
|
9
|
+
* header before every value under it, and that only happens if the header is marked up as one.
|
|
10
|
+
*
|
|
11
|
+
* It takes the table's `dividers` and hands it on, like the size and the case beside it — but it
|
|
12
|
+
* draws only the vertical half of a grid. The rule under a header is the first data row's top edge
|
|
13
|
+
* — TableRow draws its rule above itself — so a horizontal rule here would be a second line at the
|
|
14
|
+
* top of the table with nothing above it to separate, sitting inside the corner where it reads as
|
|
15
|
+
* a crack. That half is suppressed in table-head-impl.css.
|
|
16
|
+
*
|
|
17
|
+
* It was once said by handing the rows `dividers="none"`, which was true of the horizontal rule and
|
|
18
|
+
* wrong about the other: it took the vertical rules with it, so a table set to `grid` drew columns
|
|
19
|
+
* through its data and none through its header, leaving the names floating over the columns they
|
|
20
|
+
* name. One decision silently answering two questions, which is what moving it into CSS fixes.
|
|
21
|
+
*/
|
|
22
|
+
export declare function TableHead({ size, overflow, headerCase, dividers, children, ...rest }: TableHeadProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Children, cloneElement, isValidElement } from 'react';
|
|
4
|
+
import './TableHead.css';
|
|
5
|
+
import './table-head-impl.css';
|
|
6
|
+
import { tableHeadDefaults, tableHeadParts } from './TableHead.types.js';
|
|
7
|
+
/**
|
|
8
|
+
* The column names, above the data, and the filter row where there is one.
|
|
9
|
+
*
|
|
10
|
+
* It exists as a component rather than a wrapper because a screen reader announces a column's
|
|
11
|
+
* header before every value under it, and that only happens if the header is marked up as one.
|
|
12
|
+
*
|
|
13
|
+
* It takes the table's `dividers` and hands it on, like the size and the case beside it — but it
|
|
14
|
+
* draws only the vertical half of a grid. The rule under a header is the first data row's top edge
|
|
15
|
+
* — TableRow draws its rule above itself — so a horizontal rule here would be a second line at the
|
|
16
|
+
* top of the table with nothing above it to separate, sitting inside the corner where it reads as
|
|
17
|
+
* a crack. That half is suppressed in table-head-impl.css.
|
|
18
|
+
*
|
|
19
|
+
* It was once said by handing the rows `dividers="none"`, which was true of the horizontal rule and
|
|
20
|
+
* wrong about the other: it took the vertical rules with it, so a table set to `grid` drew columns
|
|
21
|
+
* through its data and none through its header, leaving the names floating over the columns they
|
|
22
|
+
* name. One decision silently answering two questions, which is what moving it into CSS fixes.
|
|
23
|
+
*/
|
|
24
|
+
export function TableHead({ size = tableHeadDefaults.size, overflow = tableHeadDefaults.overflow, headerCase = tableHeadDefaults.headerCase, dividers = tableHeadDefaults.dividers, children, ...rest }) {
|
|
25
|
+
/*
|
|
26
|
+
* `hoverable` is answered here rather than passed on — a header is not a row a reader acts on —
|
|
27
|
+
* so it is taken out of `rest` before it reaches the element. Left in, React warns: it is a
|
|
28
|
+
* boolean the DOM has no such attribute for. `dividers` is no longer stripped with it; it is a
|
|
29
|
+
* declared prop now, destructured above and handed to the rows.
|
|
30
|
+
*/
|
|
31
|
+
const { hoverable: _hoverable, ...attrs } = rest;
|
|
32
|
+
return (_jsx("thead", { ...attrs, className: tableHeadParts.root, children: Children.toArray(children)
|
|
33
|
+
.filter(isValidElement)
|
|
34
|
+
.map((row, at) => cloneElement(row, {
|
|
35
|
+
key: row.key ?? at,
|
|
36
|
+
size,
|
|
37
|
+
overflow,
|
|
38
|
+
headerCase,
|
|
39
|
+
// A header names the columns; it is not a row a reader acts on, so it never lights up.
|
|
40
|
+
hoverable: false,
|
|
41
|
+
/*
|
|
42
|
+
Passed through rather than forced to 'none'. The head needs the vertical half of a
|
|
43
|
+
grid — a column read top to bottom starts at its name, and rules beginning below the
|
|
44
|
+
header leave the names floating over the columns they belong to. It must still draw
|
|
45
|
+
no horizontal rule, because the line under a header is the first data row's top edge
|
|
46
|
+
and a second here would sit above the table's own top edge, inside the corner. That
|
|
47
|
+
half is suppressed in table-head-impl.css, which is now the one place the fact is
|
|
48
|
+
written: saying it by handing the rows 'none' took the vertical rules with it.
|
|
49
|
+
*/
|
|
50
|
+
dividers,
|
|
51
|
+
})) }));
|
|
52
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TableHeadOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `upper` — The house setting: column names in capitals, at the role that suits them. A header is read once where the data under it is read many times, and capitals are what stop it competing
|
|
5
|
+
* `title` — Names drawn as they were written, at twelve pixels. Right where the names are long, are proper nouns whose own capitals would be flattened, or are in a script with no case at all
|
|
6
|
+
*/
|
|
7
|
+
headerCase?: 'upper' | 'title';
|
|
8
|
+
/**
|
|
9
|
+
* `rows` — The default. A line between rows and none between columns. The head draws neither: the rule under it is the first data row’s top edge, and there are no columns to separate
|
|
10
|
+
* `grid` — Lines both ways, for a table read as a matrix rather than as a list of records. The head takes the vertical half of it — a column read top to bottom starts at its name, and a grid whose rules begin below the header leaves the names floating over the columns they belong to
|
|
11
|
+
* `none` — No lines at all, which for the head is what it already draws
|
|
12
|
+
*/
|
|
13
|
+
dividers?: 'rows' | 'grid' | 'none';
|
|
14
|
+
/**
|
|
15
|
+
* `wrap` — The default. Text too long for its column wraps and the row grows taller, so nothing is hidden — right whenever the value is the point and a reader has to read all of it
|
|
16
|
+
* `truncate` — Rows must stay one line high — a dense table a reader scans down, where a row that grew would break the rhythm they are scanning by. The value is clipped with an ellipsis and the whole of it is still reachable, so this trades seeing for scanning rather than losing anything
|
|
17
|
+
*/
|
|
18
|
+
overflow?: 'wrap' | 'truncate';
|
|
19
|
+
/**
|
|
20
|
+
* `sm` — Compact. Dense data a reader scans rather than reads — a ledger, a positions table, anything where fitting more rows on screen is worth more than air around each one
|
|
21
|
+
* `md` — Balanced, and the default: rows a reader moves through at reading pace, with enough room that the eye does not slip between them
|
|
22
|
+
* `lg` — Spacious. Few rows, each carrying something substantial — a plan comparison, a summary of three accounts. Reach for it when the table is the page rather than a part of it
|
|
23
|
+
*/
|
|
24
|
+
size?: 'sm' | 'md' | 'lg';
|
|
25
|
+
/** Allowed: TableRow */
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export type TableHeadProps = TableHeadOwnProps & Omit<HTMLAttributes<HTMLTableSectionElement>, 'className' | 'headerCase' | 'dividers' | 'overflow' | 'size'>;
|
|
29
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
30
|
+
export declare const tableHeadParts: {
|
|
31
|
+
readonly root: "dds-tablehead";
|
|
32
|
+
};
|
|
33
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
34
|
+
export declare const tableHeadDefaults: {
|
|
35
|
+
readonly headerCase: "upper";
|
|
36
|
+
readonly dividers: "rows";
|
|
37
|
+
readonly overflow: "wrap";
|
|
38
|
+
readonly size: "md";
|
|
39
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// GENERATED from table-head.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const tableHeadParts = {
|
|
4
|
+
root: 'dds-tablehead',
|
|
5
|
+
};
|
|
6
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
7
|
+
export const tableHeadDefaults = { headerCase: 'upper', dividers: 'rows', overflow: 'wrap', size: 'md' };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Scoped to this package, like the generated sheet beside it.
|
|
3
|
+
*
|
|
4
|
+
* `:where([data-dds-context="marketing"])` confines these rules without contributing
|
|
5
|
+
* specificity, so every override below still ties or beats exactly what it did
|
|
6
|
+
* before — several here are written a class deeper than they look in order to
|
|
7
|
+
* match generated CSS, and a scope that carried weight would break all of them.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* The filter row sitting under the names rather than away from them.
|
|
12
|
+
*
|
|
13
|
+
* Every cell in this system carries its own inset, which is right between a row of values and the
|
|
14
|
+
* next: each row owns the air above and below it, and no row has to know what it sits under. In a
|
|
15
|
+
* head it doubles. The names carry an inset below them and the controls carry one above, so a
|
|
16
|
+
* reader saw the column names, a gap of two insets, and then a row of fields that read as a
|
|
17
|
+
* separate thing floating over the table rather than as the head's second half.
|
|
18
|
+
*
|
|
19
|
+
* So the second row gives up the top half of it. The names keep their own inset — the gap is theirs
|
|
20
|
+
* and it is the one the head already had — and the controls sit directly under it. The bottom inset
|
|
21
|
+
* stays, because that gap is real: it separates the head from the first row of data.
|
|
22
|
+
*
|
|
23
|
+
* It cannot be a binding. A binding names a part and a state, and this is neither — it is a fact
|
|
24
|
+
* about position, that this row is the one after another, which a contract has no way to say. The
|
|
25
|
+
* same limit the header's hover runs into and the row's pointer gate before it.
|
|
26
|
+
*/
|
|
27
|
+
:where([data-dds-context="marketing"]) .dds-tablehead > .dds-tablerow + .dds-tablerow > .dds-tablecell {
|
|
28
|
+
padding-block-start: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* The head takes the vertical rules of a grid and never the horizontal one.
|
|
33
|
+
*
|
|
34
|
+
* The line under a header is already drawn: it is the first data row's top edge, because every row
|
|
35
|
+
* draws the rule above itself. A rule on the head's own cells would be a second line at the very
|
|
36
|
+
* top of the table, above the names, with nothing over it to separate — and inside the corner a
|
|
37
|
+
* container clips, where it reads as a crack rather than as a rule.
|
|
38
|
+
*
|
|
39
|
+
* Written here rather than by handing the head's rows `dividers="none"`, which is how it was said
|
|
40
|
+
* before. That was true of the horizontal rule and wrong about the other: the vertical rules key
|
|
41
|
+
* off the same value, so `none` took them too, and a table set to `grid` drew columns through its
|
|
42
|
+
* data and none through its header — leaving the names floating over the columns they name. One
|
|
43
|
+
* value cannot answer two questions, so the half that is not the prop's is stated here.
|
|
44
|
+
*
|
|
45
|
+
* Three classes deep, which beats the generated rule's class-and-attribute without needing to be
|
|
46
|
+
* scoped any harder.
|
|
47
|
+
*/
|
|
48
|
+
:where([data-dds-context="marketing"]) .dds-tablehead > .dds-tablerow > .dds-tableheadercell,
|
|
49
|
+
:where([data-dds-context="marketing"]) .dds-tablehead > .dds-tablerow > .dds-tablecell {
|
|
50
|
+
border-block-start-width: 0;
|
|
51
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/* GENERATED from tableheadercell.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell {
|
|
4
|
+
border-block-end-width: 0;
|
|
5
|
+
border-inline-width: 0;
|
|
6
|
+
border-style: solid;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
text-overflow: ellipsis;
|
|
9
|
+
vertical-align: bottom;
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
border-color: var(--color-border-subtle);
|
|
12
|
+
color: var(--color-fg-muted);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell .dds-tableheadercell__trigger {
|
|
16
|
+
align-items: center;
|
|
17
|
+
appearance: none;
|
|
18
|
+
border-style: none;
|
|
19
|
+
color: inherit;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
display: flex;
|
|
22
|
+
font: inherit;
|
|
23
|
+
inline-size: 100%;
|
|
24
|
+
outline-style: solid;
|
|
25
|
+
text-transform: inherit;
|
|
26
|
+
background-color: var(--color-bg-transparent);
|
|
27
|
+
gap: var(--space-gap-xs);
|
|
28
|
+
min-block-size: var(--size-target-min);
|
|
29
|
+
min-inline-size: var(--size-target-min);
|
|
30
|
+
outline-width: var(--border-width-none);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell .dds-tableheadercell__indicator {
|
|
34
|
+
align-items: center;
|
|
35
|
+
display: flex;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-align="center"] {
|
|
39
|
+
text-align: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-align="end"] {
|
|
43
|
+
text-align: end;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-align="start"] {
|
|
47
|
+
text-align: start;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-header-case="upper"] {
|
|
51
|
+
text-transform: uppercase;
|
|
52
|
+
font-family: var(--font-eyebrow-family);
|
|
53
|
+
font-size: var(--font-eyebrow-size);
|
|
54
|
+
font-weight: var(--font-eyebrow-weight);
|
|
55
|
+
letter-spacing: var(--font-eyebrow-letter-spacing);
|
|
56
|
+
line-height: var(--font-eyebrow-line-height);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-align="center"] .dds-tableheadercell__trigger {
|
|
60
|
+
justify-content: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-align="end"] .dds-tableheadercell__trigger {
|
|
64
|
+
justify-content: flex-end;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-align="start"] .dds-tableheadercell__trigger {
|
|
68
|
+
justify-content: flex-start;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell .dds-tableheadercell__indicator:hover {
|
|
72
|
+
color: var(--color-fg-default);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell .dds-tableheadercell__trigger:focus-visible {
|
|
76
|
+
outline-color: var(--color-border-focus);
|
|
77
|
+
outline-width: var(--border-width-focus);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-dividers="grid"] {
|
|
81
|
+
border-block-start-width: var(--border-width-hairline);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-dividers="none"] {
|
|
85
|
+
border-block-start-width: var(--border-width-none);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-dividers="rows"] {
|
|
89
|
+
border-block-start-width: var(--border-width-hairline);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-header-case="title"] {
|
|
93
|
+
font-family: var(--font-label-sm-family);
|
|
94
|
+
font-size: var(--font-label-sm-size);
|
|
95
|
+
font-weight: var(--font-label-sm-weight);
|
|
96
|
+
letter-spacing: var(--font-label-sm-letter-spacing);
|
|
97
|
+
line-height: var(--font-label-sm-line-height);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-size="lg"] {
|
|
101
|
+
padding-block: var(--space-inset-lg);
|
|
102
|
+
padding-inline: var(--space-inset-lg);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-size="md"] {
|
|
106
|
+
padding-block: var(--space-inset-md);
|
|
107
|
+
padding-inline: var(--space-inset-md);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-size="sm"] {
|
|
111
|
+
padding-block: var(--space-inset-sm);
|
|
112
|
+
padding-inline: var(--space-inset-sm);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-sort-direction="ascending"] .dds-tableheadercell__indicator {
|
|
116
|
+
color: var(--color-fg-default);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-sort-direction="descending"] .dds-tableheadercell__indicator {
|
|
120
|
+
color: var(--color-fg-default);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:where([data-dds-context="marketing"]) .dds-tableheadercell[data-sort-direction="none"] .dds-tableheadercell__indicator {
|
|
124
|
+
color: var(--color-fg-muted);
|
|
125
|
+
}
|
|
126
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import './TableHeaderCell.css';
|
|
2
|
+
import './table-header-cell-impl.css';
|
|
3
|
+
import { type TableHeaderCellProps } from './TableHeaderCell.types.js';
|
|
4
|
+
export type { TableHeaderCellProps };
|
|
5
|
+
/**
|
|
6
|
+
* The name of a column, announced before every value under it.
|
|
7
|
+
*
|
|
8
|
+
* That is the whole of why it is a component rather than a styled cell: a screen reader reads the
|
|
9
|
+
* header before each cell in the column, which is how a reader knows what a number means without
|
|
10
|
+
* looking it up — and it only happens if the header is a header in the markup.
|
|
11
|
+
*
|
|
12
|
+
* Where the column can be sorted, the header holds a real `<button>` rather than a click handler on
|
|
13
|
+
* the cell. Sorting is an action: it has to be reachable by Tab, answer Enter and Space, and take a
|
|
14
|
+
* focus ring, and a `<th>` does none of those.
|
|
15
|
+
*
|
|
16
|
+
* `aria-sort` stays on the cell, not on the button. The direction is a fact about the column, and
|
|
17
|
+
* the column is the cell — announcing it on the control would say the button is ascending rather
|
|
18
|
+
* than the data. It is also why the mark alone never carries the direction: the indicator is drawn
|
|
19
|
+
* and never announced.
|
|
20
|
+
*/
|
|
21
|
+
export declare function TableHeaderCell({ size, align, sortDirection, sortable, dividers, headerCase, onSort, children, ...rest }: TableHeaderCellProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowUpArrowDownRegularIcon, ChevronDownRegularIcon, ChevronUpRegularIcon } from '@deriv-com/quill-icons-web';
|
|
4
|
+
import './TableHeaderCell.css';
|
|
5
|
+
import './table-header-cell-impl.css';
|
|
6
|
+
import { Icon } from '../icon/Icon.js';
|
|
7
|
+
import { tableHeaderCellDefaults, tableHeaderCellParts, } from './TableHeaderCell.types.js';
|
|
8
|
+
/**
|
|
9
|
+
* The name of a column, announced before every value under it.
|
|
10
|
+
*
|
|
11
|
+
* That is the whole of why it is a component rather than a styled cell: a screen reader reads the
|
|
12
|
+
* header before each cell in the column, which is how a reader knows what a number means without
|
|
13
|
+
* looking it up — and it only happens if the header is a header in the markup.
|
|
14
|
+
*
|
|
15
|
+
* Where the column can be sorted, the header holds a real `<button>` rather than a click handler on
|
|
16
|
+
* the cell. Sorting is an action: it has to be reachable by Tab, answer Enter and Space, and take a
|
|
17
|
+
* focus ring, and a `<th>` does none of those.
|
|
18
|
+
*
|
|
19
|
+
* `aria-sort` stays on the cell, not on the button. The direction is a fact about the column, and
|
|
20
|
+
* the column is the cell — announcing it on the control would say the button is ascending rather
|
|
21
|
+
* than the data. It is also why the mark alone never carries the direction: the indicator is drawn
|
|
22
|
+
* and never announced.
|
|
23
|
+
*/
|
|
24
|
+
export function TableHeaderCell({ size = tableHeaderCellDefaults.size, align = tableHeaderCellDefaults.align, sortDirection = tableHeaderCellDefaults.sortDirection, sortable = tableHeaderCellDefaults.sortable, dividers = tableHeaderCellDefaults.dividers, headerCase = tableHeaderCellDefaults.headerCase, onSort, children, ...rest }) {
|
|
25
|
+
/*
|
|
26
|
+
* A header cell always truncates, so it declares no `overflow` — and the row hands one to every
|
|
27
|
+
* cell it holds, because a data cell's does change. Left in `rest` it reached the element as
|
|
28
|
+
* `overflow="wrap"`, which is not an attribute a `<th>` has: React warns, and the markup carries
|
|
29
|
+
* a word that describes the opposite of what this cell does. The same swallow TableHead makes of
|
|
30
|
+
* the two decisions it answers itself.
|
|
31
|
+
*/
|
|
32
|
+
const { overflow: _overflow, ...attrs } = rest;
|
|
33
|
+
return (_jsx("th", { ...attrs, className: tableHeaderCellParts.root, scope: "col", "data-size": size, "data-align": align, "data-sort-direction": sortDirection, "data-dividers": dividers, "data-header-case": headerCase, "aria-sort": sortable ? sortDirection : undefined, children: !sortable ? (children) : (_jsxs("button", { type: "button", className: tableHeaderCellParts.trigger, onClick: () => onSort?.(), children: [children, _jsx("span", { className: tableHeaderCellParts.indicator, "aria-hidden": "true", children: _jsx(Icon, { size: "xs", children: sortDirection === 'ascending' ? (_jsx(ChevronUpRegularIcon, {})) : sortDirection === 'descending' ? (_jsx(ChevronDownRegularIcon, {})) : (_jsx(ArrowUpArrowDownRegularIcon, {})) }) })] })) }));
|
|
34
|
+
}
|