@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.
Files changed (460) hide show
  1. package/.llm/components/accordion.md +193 -0
  2. package/.llm/components/accordionitem.md +236 -0
  3. package/.llm/components/aspectratio.md +212 -0
  4. package/.llm/components/badge.md +231 -0
  5. package/.llm/components/bottomsheet.md +404 -0
  6. package/.llm/components/breadcrumb.md +197 -0
  7. package/.llm/components/breadcrumbitem.md +178 -0
  8. package/.llm/components/button.md +271 -0
  9. package/.llm/components/buttonicon.md +313 -0
  10. package/.llm/components/card.md +313 -0
  11. package/.llm/components/cardbody.md +409 -0
  12. package/.llm/components/cardbutton.md +259 -0
  13. package/.llm/components/checkbox.md +285 -0
  14. package/.llm/components/divider.md +230 -0
  15. package/.llm/components/dropdownmenu.md +453 -0
  16. package/.llm/components/filterchip.md +314 -0
  17. package/.llm/components/footer.md +408 -0
  18. package/.llm/components/footergroup.md +241 -0
  19. package/.llm/components/grid.md +659 -0
  20. package/.llm/components/icon.md +194 -0
  21. package/.llm/components/link.md +354 -0
  22. package/.llm/components/menuitem.md +218 -0
  23. package/.llm/components/navbar.md +458 -0
  24. package/.llm/components/navbaritem.md +238 -0
  25. package/.llm/components/navbarmenu.md +319 -0
  26. package/.llm/components/navbarmenugroup.md +184 -0
  27. package/.llm/components/navbarpanel.md +255 -0
  28. package/.llm/components/navbarswitcher.md +343 -0
  29. package/.llm/components/navbarswitcheroption.md +156 -0
  30. package/.llm/components/option.md +268 -0
  31. package/.llm/components/pagination.md +361 -0
  32. package/.llm/components/removablechip.md +247 -0
  33. package/.llm/components/row.md +381 -0
  34. package/.llm/components/scroller.md +470 -0
  35. package/.llm/components/searchinput.md +279 -0
  36. package/.llm/components/segmentedcontrol.md +358 -0
  37. package/.llm/components/segmentedcontrolitem.md +272 -0
  38. package/.llm/components/select.md +509 -0
  39. package/.llm/components/selectchip.md +334 -0
  40. package/.llm/components/spinner.md +222 -0
  41. package/.llm/components/stack.md +334 -0
  42. package/.llm/components/statusdot.md +205 -0
  43. package/.llm/components/subdomainnavbar.md +327 -0
  44. package/.llm/components/tab.md +291 -0
  45. package/.llm/components/table.md +660 -0
  46. package/.llm/components/tablebody.md +258 -0
  47. package/.llm/components/tablecell.md +248 -0
  48. package/.llm/components/tablehead.md +248 -0
  49. package/.llm/components/tableheadercell.md +298 -0
  50. package/.llm/components/tablerow.md +285 -0
  51. package/.llm/components/tablist.md +210 -0
  52. package/.llm/components/textarea.md +362 -0
  53. package/.llm/components/textinput.md +467 -0
  54. package/.llm/components/tooltip.md +267 -0
  55. package/.llm/components/typography.md +245 -0
  56. package/.llm/digest/accordion.md +43 -0
  57. package/.llm/digest/accordionitem.md +47 -0
  58. package/.llm/digest/aspectratio.md +47 -0
  59. package/.llm/digest/badge.md +45 -0
  60. package/.llm/digest/bottomsheet.md +69 -0
  61. package/.llm/digest/breadcrumb.md +38 -0
  62. package/.llm/digest/breadcrumbitem.md +43 -0
  63. package/.llm/digest/button.md +48 -0
  64. package/.llm/digest/buttonicon.md +61 -0
  65. package/.llm/digest/card.md +50 -0
  66. package/.llm/digest/cardbody.md +68 -0
  67. package/.llm/digest/cardbutton.md +49 -0
  68. package/.llm/digest/checkbox.md +63 -0
  69. package/.llm/digest/divider.md +52 -0
  70. package/.llm/digest/dropdownmenu.md +67 -0
  71. package/.llm/digest/filterchip.md +68 -0
  72. package/.llm/digest/footer.md +57 -0
  73. package/.llm/digest/footergroup.md +42 -0
  74. package/.llm/digest/grid.md +62 -0
  75. package/.llm/digest/icon.md +45 -0
  76. package/.llm/digest/link.md +59 -0
  77. package/.llm/digest/menuitem.md +46 -0
  78. package/.llm/digest/navbar.md +60 -0
  79. package/.llm/digest/navbaritem.md +54 -0
  80. package/.llm/digest/navbarmenu.md +54 -0
  81. package/.llm/digest/navbarmenugroup.md +40 -0
  82. package/.llm/digest/navbarpanel.md +53 -0
  83. package/.llm/digest/navbarswitcher.md +51 -0
  84. package/.llm/digest/navbarswitcheroption.md +37 -0
  85. package/.llm/digest/option.md +54 -0
  86. package/.llm/digest/pagination.md +71 -0
  87. package/.llm/digest/removablechip.md +51 -0
  88. package/.llm/digest/row.md +60 -0
  89. package/.llm/digest/scroller.md +59 -0
  90. package/.llm/digest/searchinput.md +56 -0
  91. package/.llm/digest/segmentedcontrol.md +59 -0
  92. package/.llm/digest/segmentedcontrolitem.md +59 -0
  93. package/.llm/digest/select.md +92 -0
  94. package/.llm/digest/selectchip.md +68 -0
  95. package/.llm/digest/spinner.md +52 -0
  96. package/.llm/digest/stack.md +56 -0
  97. package/.llm/digest/statusdot.md +46 -0
  98. package/.llm/digest/subdomainnavbar.md +54 -0
  99. package/.llm/digest/tab.md +60 -0
  100. package/.llm/digest/table.md +71 -0
  101. package/.llm/digest/tablebody.md +49 -0
  102. package/.llm/digest/tablecell.md +55 -0
  103. package/.llm/digest/tablehead.md +50 -0
  104. package/.llm/digest/tableheadercell.md +65 -0
  105. package/.llm/digest/tablerow.md +56 -0
  106. package/.llm/digest/tablist.md +46 -0
  107. package/.llm/digest/textarea.md +78 -0
  108. package/.llm/digest/textinput.md +95 -0
  109. package/.llm/digest/tooltip.md +58 -0
  110. package/.llm/digest/typography.md +59 -0
  111. package/.llm/index.md +86 -0
  112. package/.llm/rules.md +122 -0
  113. package/.llm/tokens.md +341 -0
  114. package/AGENTS.md +164 -0
  115. package/LICENSE +21 -0
  116. package/README.md +63 -15
  117. package/dist/components/core/accordion/Accordion.css +10 -0
  118. package/dist/components/core/accordion/Accordion.d.ts +20 -0
  119. package/dist/components/core/accordion/Accordion.js +69 -0
  120. package/dist/components/core/accordion/Accordion.types.d.ts +20 -0
  121. package/dist/components/core/accordion/Accordion.types.js +7 -0
  122. package/dist/components/core/accordion-item/AccordionItem.css +98 -0
  123. package/dist/components/core/accordion-item/AccordionItem.d.ts +44 -0
  124. package/dist/components/core/accordion-item/AccordionItem.js +63 -0
  125. package/dist/components/core/accordion-item/AccordionItem.types.d.ts +32 -0
  126. package/dist/components/core/accordion-item/AccordionItem.types.js +13 -0
  127. package/dist/components/core/accordion-item/accordion-item-impl.css +107 -0
  128. package/dist/components/core/badge/Badge.css +37 -0
  129. package/dist/components/core/badge/Badge.d.ts +37 -0
  130. package/dist/components/core/badge/Badge.js +40 -0
  131. package/dist/components/core/badge/Badge.types.d.ts +24 -0
  132. package/dist/components/core/badge/Badge.types.js +8 -0
  133. package/dist/components/core/badge/badge-impl.css +32 -0
  134. package/dist/components/core/bottom-sheet/BottomSheet.css +178 -0
  135. package/dist/components/core/bottom-sheet/BottomSheet.d.ts +22 -0
  136. package/dist/components/core/bottom-sheet/BottomSheet.js +359 -0
  137. package/dist/components/core/bottom-sheet/BottomSheet.types.d.ts +67 -0
  138. package/dist/components/core/bottom-sheet/BottomSheet.types.js +18 -0
  139. package/dist/components/core/bottom-sheet/bottom-sheet-impl.css +57 -0
  140. package/dist/components/core/breadcrumb/Breadcrumb.css +19 -0
  141. package/dist/components/core/breadcrumb/Breadcrumb.d.ts +16 -0
  142. package/dist/components/core/breadcrumb/Breadcrumb.js +22 -0
  143. package/dist/components/core/breadcrumb/Breadcrumb.types.d.ts +18 -0
  144. package/dist/components/core/breadcrumb/Breadcrumb.types.js +9 -0
  145. package/dist/components/core/breadcrumb-item/BreadcrumbItem.css +34 -0
  146. package/dist/components/core/breadcrumb-item/BreadcrumbItem.d.ts +12 -0
  147. package/dist/components/core/breadcrumb-item/BreadcrumbItem.js +15 -0
  148. package/dist/components/core/breadcrumb-item/BreadcrumbItem.types.d.ts +22 -0
  149. package/dist/components/core/breadcrumb-item/BreadcrumbItem.types.js +9 -0
  150. package/dist/components/core/button/Button.css +141 -0
  151. package/dist/components/core/button/Button.d.ts +25 -0
  152. package/dist/components/core/button/Button.js +28 -0
  153. package/dist/components/core/button/Button.types.d.ts +40 -0
  154. package/dist/components/core/button/Button.types.js +9 -0
  155. package/dist/components/core/button/button-impl.css +46 -0
  156. package/dist/components/core/button-icon/ButtonIcon.css +135 -0
  157. package/dist/components/core/button-icon/ButtonIcon.d.ts +34 -0
  158. package/dist/components/core/button-icon/ButtonIcon.js +117 -0
  159. package/dist/components/core/button-icon/ButtonIcon.types.d.ts +41 -0
  160. package/dist/components/core/button-icon/ButtonIcon.types.js +8 -0
  161. package/dist/components/core/card/Card.css +65 -0
  162. package/dist/components/core/card/Card.d.ts +24 -0
  163. package/dist/components/core/card/Card.js +26 -0
  164. package/dist/components/core/card/Card.types.d.ts +33 -0
  165. package/dist/components/core/card/Card.types.js +7 -0
  166. package/dist/components/core/card-body/CardBody.css +139 -0
  167. package/dist/components/core/card-body/CardBody.d.ts +62 -0
  168. package/dist/components/core/card-body/CardBody.js +97 -0
  169. package/dist/components/core/card-body/CardBody.types.d.ts +61 -0
  170. package/dist/components/core/card-body/CardBody.types.js +15 -0
  171. package/dist/components/core/card-body/card-body-impl.css +87 -0
  172. package/dist/components/core/card-button/CardButton.css +73 -0
  173. package/dist/components/core/card-button/CardButton.d.ts +27 -0
  174. package/dist/components/core/card-button/CardButton.js +37 -0
  175. package/dist/components/core/card-button/CardButton.types.d.ts +24 -0
  176. package/dist/components/core/card-button/CardButton.types.js +7 -0
  177. package/dist/components/core/card-button/card-button-impl.css +39 -0
  178. package/dist/components/core/checkbox/Checkbox.css +149 -0
  179. package/dist/components/core/checkbox/Checkbox.d.ts +21 -0
  180. package/dist/components/core/checkbox/Checkbox.js +97 -0
  181. package/dist/components/core/checkbox/Checkbox.types.d.ts +46 -0
  182. package/dist/components/core/checkbox/Checkbox.types.js +15 -0
  183. package/dist/components/core/checkbox/checkbox-impl.css +90 -0
  184. package/dist/components/core/divider/Divider.css +41 -0
  185. package/dist/components/core/divider/Divider.d.ts +46 -0
  186. package/dist/components/core/divider/Divider.js +51 -0
  187. package/dist/components/core/divider/Divider.types.d.ts +25 -0
  188. package/dist/components/core/divider/Divider.types.js +9 -0
  189. package/dist/components/core/dropdown-menu/DropdownMenu.css +146 -0
  190. package/dist/components/core/dropdown-menu/DropdownMenu.d.ts +22 -0
  191. package/dist/components/core/dropdown-menu/DropdownMenu.js +309 -0
  192. package/dist/components/core/dropdown-menu/DropdownMenu.types.d.ts +62 -0
  193. package/dist/components/core/dropdown-menu/DropdownMenu.types.js +12 -0
  194. package/dist/components/core/dropdown-menu/dropdown-menu-impl.css +70 -0
  195. package/dist/components/core/filter-chip/FilterChip.css +149 -0
  196. package/dist/components/core/filter-chip/FilterChip.d.ts +23 -0
  197. package/dist/components/core/filter-chip/FilterChip.js +37 -0
  198. package/dist/components/core/filter-chip/FilterChip.types.d.ts +53 -0
  199. package/dist/components/core/filter-chip/FilterChip.types.js +12 -0
  200. package/dist/components/core/footer/Footer.css +104 -0
  201. package/dist/components/core/footer/Footer.d.ts +43 -0
  202. package/dist/components/core/footer/Footer.js +53 -0
  203. package/dist/components/core/footer/Footer.types.d.ts +47 -0
  204. package/dist/components/core/footer/Footer.types.js +18 -0
  205. package/dist/components/core/footer/footer-impl.css +218 -0
  206. package/dist/components/core/footer-group/FooterGroup.css +90 -0
  207. package/dist/components/core/footer-group/FooterGroup.d.ts +32 -0
  208. package/dist/components/core/footer-group/FooterGroup.js +64 -0
  209. package/dist/components/core/footer-group/FooterGroup.types.d.ts +25 -0
  210. package/dist/components/core/footer-group/FooterGroup.types.js +12 -0
  211. package/dist/components/core/footer-group/footer-group-impl.css +78 -0
  212. package/dist/components/core/icon/Icon.css +40 -0
  213. package/dist/components/core/icon/Icon.d.ts +23 -0
  214. package/dist/components/core/icon/Icon.js +79 -0
  215. package/dist/components/core/icon/Icon.types.d.ts +24 -0
  216. package/dist/components/core/icon/Icon.types.js +7 -0
  217. package/dist/components/core/link/Link.css +89 -0
  218. package/dist/components/core/link/Link.d.ts +37 -0
  219. package/dist/components/core/link/Link.js +141 -0
  220. package/dist/components/core/link/Link.types.d.ts +41 -0
  221. package/dist/components/core/link/Link.types.js +9 -0
  222. package/dist/components/core/link/link-impl.css +168 -0
  223. package/dist/components/core/menu-item/MenuItem.css +70 -0
  224. package/dist/components/core/menu-item/MenuItem.d.ts +11 -0
  225. package/dist/components/core/menu-item/MenuItem.js +26 -0
  226. package/dist/components/core/menu-item/MenuItem.types.d.ts +28 -0
  227. package/dist/components/core/menu-item/MenuItem.types.js +9 -0
  228. package/dist/components/core/navbar/Navbar.css +135 -0
  229. package/dist/components/core/navbar/Navbar.d.ts +36 -0
  230. package/dist/components/core/navbar/Navbar.js +371 -0
  231. package/dist/components/core/navbar/Navbar.types.d.ts +49 -0
  232. package/dist/components/core/navbar/Navbar.types.js +17 -0
  233. package/dist/components/core/navbar/navbar-impl.css +590 -0
  234. package/dist/components/core/navbar-item/NavbarItem.css +75 -0
  235. package/dist/components/core/navbar-item/NavbarItem.d.ts +22 -0
  236. package/dist/components/core/navbar-item/NavbarItem.js +40 -0
  237. package/dist/components/core/navbar-item/NavbarItem.types.d.ts +34 -0
  238. package/dist/components/core/navbar-item/NavbarItem.types.js +10 -0
  239. package/dist/components/core/navbar-menu/NavbarMenu.css +128 -0
  240. package/dist/components/core/navbar-menu/NavbarMenu.d.ts +5 -0
  241. package/dist/components/core/navbar-menu/NavbarMenu.js +186 -0
  242. package/dist/components/core/navbar-menu/NavbarMenu.types.d.ts +45 -0
  243. package/dist/components/core/navbar-menu/NavbarMenu.types.js +12 -0
  244. package/dist/components/core/navbar-menu/navbar-menu-impl.css +186 -0
  245. package/dist/components/core/navbar-menu-group/NavbarMenuGroup.css +26 -0
  246. package/dist/components/core/navbar-menu-group/NavbarMenuGroup.d.ts +17 -0
  247. package/dist/components/core/navbar-menu-group/NavbarMenuGroup.js +22 -0
  248. package/dist/components/core/navbar-menu-group/NavbarMenuGroup.types.d.ts +14 -0
  249. package/dist/components/core/navbar-menu-group/NavbarMenuGroup.types.js +7 -0
  250. package/dist/components/core/navbar-panel/NavbarPanel.css +87 -0
  251. package/dist/components/core/navbar-panel/NavbarPanel.d.ts +34 -0
  252. package/dist/components/core/navbar-panel/NavbarPanel.js +46 -0
  253. package/dist/components/core/navbar-panel/NavbarPanel.types.d.ts +29 -0
  254. package/dist/components/core/navbar-panel/NavbarPanel.types.js +12 -0
  255. package/dist/components/core/navbar-panel/navbar-panel-impl.css +104 -0
  256. package/dist/components/core/navbar-panel/use-navbar-panel.d.ts +26 -0
  257. package/dist/components/core/navbar-panel/use-navbar-panel.js +135 -0
  258. package/dist/components/core/navbar-switcher/NavbarSwitcher.css +117 -0
  259. package/dist/components/core/navbar-switcher/NavbarSwitcher.d.ts +20 -0
  260. package/dist/components/core/navbar-switcher/NavbarSwitcher.js +90 -0
  261. package/dist/components/core/navbar-switcher/NavbarSwitcher.types.d.ts +46 -0
  262. package/dist/components/core/navbar-switcher/NavbarSwitcher.types.js +13 -0
  263. package/dist/components/core/navbar-switcher/navbar-switcher-impl.css +179 -0
  264. package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.css +39 -0
  265. package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.d.ts +16 -0
  266. package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.js +19 -0
  267. package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.types.d.ts +18 -0
  268. package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.types.js +7 -0
  269. package/dist/components/core/option/Option.css +133 -0
  270. package/dist/components/core/option/Option.d.ts +25 -0
  271. package/dist/components/core/option/Option.js +31 -0
  272. package/dist/components/core/option/Option.types.d.ts +44 -0
  273. package/dist/components/core/option/Option.types.js +14 -0
  274. package/dist/components/core/pagination/Pagination.css +237 -0
  275. package/dist/components/core/pagination/Pagination.d.ts +30 -0
  276. package/dist/components/core/pagination/Pagination.js +406 -0
  277. package/dist/components/core/pagination/Pagination.types.d.ts +59 -0
  278. package/dist/components/core/pagination/Pagination.types.js +14 -0
  279. package/dist/components/core/pagination/pagination-impl.css +17 -0
  280. package/dist/components/core/removable-chip/RemovableChip.css +125 -0
  281. package/dist/components/core/removable-chip/RemovableChip.d.ts +25 -0
  282. package/dist/components/core/removable-chip/RemovableChip.js +36 -0
  283. package/dist/components/core/removable-chip/RemovableChip.types.d.ts +38 -0
  284. package/dist/components/core/removable-chip/RemovableChip.types.js +13 -0
  285. package/dist/components/core/search-input/SearchInput.css +205 -0
  286. package/dist/components/core/search-input/SearchInput.d.ts +5 -0
  287. package/dist/components/core/search-input/SearchInput.js +81 -0
  288. package/dist/components/core/search-input/SearchInput.types.d.ts +43 -0
  289. package/dist/components/core/search-input/SearchInput.types.js +13 -0
  290. package/dist/components/core/search-input/search-input-impl.css +20 -0
  291. package/dist/components/core/segmented-control/SegmentedControl.css +57 -0
  292. package/dist/components/core/segmented-control/SegmentedControl.d.ts +37 -0
  293. package/dist/components/core/segmented-control/SegmentedControl.js +269 -0
  294. package/dist/components/core/segmented-control/SegmentedControl.types.d.ts +38 -0
  295. package/dist/components/core/segmented-control/SegmentedControl.types.js +8 -0
  296. package/dist/components/core/segmented-control/segmented-control-impl.css +57 -0
  297. package/dist/components/core/segmented-control-item/SegmentedControlItem.css +151 -0
  298. package/dist/components/core/segmented-control-item/SegmentedControlItem.d.ts +50 -0
  299. package/dist/components/core/segmented-control-item/SegmentedControlItem.js +101 -0
  300. package/dist/components/core/segmented-control-item/SegmentedControlItem.types.d.ts +37 -0
  301. package/dist/components/core/segmented-control-item/SegmentedControlItem.types.js +10 -0
  302. package/dist/components/core/segmented-control-item/segmented-control-item-impl.css +69 -0
  303. package/dist/components/core/select/Select.css +400 -0
  304. package/dist/components/core/select/Select.d.ts +29 -0
  305. package/dist/components/core/select/Select.js +524 -0
  306. package/dist/components/core/select/Select.types.d.ts +96 -0
  307. package/dist/components/core/select/Select.types.js +26 -0
  308. package/dist/components/core/select/select-impl.css +114 -0
  309. package/dist/components/core/select-chip/SelectChip.css +155 -0
  310. package/dist/components/core/select-chip/SelectChip.d.ts +20 -0
  311. package/dist/components/core/select-chip/SelectChip.js +273 -0
  312. package/dist/components/core/select-chip/SelectChip.types.d.ts +56 -0
  313. package/dist/components/core/select-chip/SelectChip.types.js +14 -0
  314. package/dist/components/core/select-chip/select-chip-impl.css +38 -0
  315. package/dist/components/core/spinner/Spinner.css +76 -0
  316. package/dist/components/core/spinner/Spinner.d.ts +5 -0
  317. package/dist/components/core/spinner/Spinner.js +29 -0
  318. package/dist/components/core/spinner/Spinner.types.d.ts +37 -0
  319. package/dist/components/core/spinner/Spinner.types.js +10 -0
  320. package/dist/components/core/spinner/spinner-impl.css +27 -0
  321. package/dist/components/core/status-dot/StatusDot.css +43 -0
  322. package/dist/components/core/status-dot/StatusDot.d.ts +35 -0
  323. package/dist/components/core/status-dot/StatusDot.js +46 -0
  324. package/dist/components/core/status-dot/StatusDot.types.d.ts +29 -0
  325. package/dist/components/core/status-dot/StatusDot.types.js +7 -0
  326. package/dist/components/core/status-dot/status-dot-impl.css +42 -0
  327. package/dist/components/core/subdomain-navbar/SubdomainNavbar.css +89 -0
  328. package/dist/components/core/subdomain-navbar/SubdomainNavbar.d.ts +21 -0
  329. package/dist/components/core/subdomain-navbar/SubdomainNavbar.js +127 -0
  330. package/dist/components/core/subdomain-navbar/SubdomainNavbar.types.d.ts +43 -0
  331. package/dist/components/core/subdomain-navbar/SubdomainNavbar.types.js +13 -0
  332. package/dist/components/core/subdomain-navbar/subdomain-navbar-impl.css +147 -0
  333. package/dist/components/core/tab/Tab.css +113 -0
  334. package/dist/components/core/tab/Tab.d.ts +36 -0
  335. package/dist/components/core/tab/Tab.js +53 -0
  336. package/dist/components/core/tab/Tab.types.d.ts +42 -0
  337. package/dist/components/core/tab/Tab.types.js +13 -0
  338. package/dist/components/core/tab/tab-impl.css +49 -0
  339. package/dist/components/core/tab-list/TabList.css +40 -0
  340. package/dist/components/core/tab-list/TabList.d.ts +26 -0
  341. package/dist/components/core/tab-list/TabList.js +124 -0
  342. package/dist/components/core/tab-list/TabList.types.d.ts +20 -0
  343. package/dist/components/core/tab-list/TabList.types.js +7 -0
  344. package/dist/components/core/tab-list/tab-list-impl.css +56 -0
  345. package/dist/components/core/table/Table.css +40 -0
  346. package/dist/components/core/table/Table.d.ts +19 -0
  347. package/dist/components/core/table/Table.js +55 -0
  348. package/dist/components/core/table/Table.types.d.ts +59 -0
  349. package/dist/components/core/table/Table.types.js +9 -0
  350. package/dist/components/core/table/table-impl.css +75 -0
  351. package/dist/components/core/table/use-table-sort.d.ts +43 -0
  352. package/dist/components/core/table/use-table-sort.js +51 -0
  353. package/dist/components/core/table-body/TableBody.css +6 -0
  354. package/dist/components/core/table-body/TableBody.d.ts +12 -0
  355. package/dist/components/core/table-body/TableBody.js +26 -0
  356. package/dist/components/core/table-body/TableBody.types.d.ts +36 -0
  357. package/dist/components/core/table-body/TableBody.types.js +7 -0
  358. package/dist/components/core/table-cell/TableCell.css +76 -0
  359. package/dist/components/core/table-cell/TableCell.d.ts +21 -0
  360. package/dist/components/core/table-cell/TableCell.js +31 -0
  361. package/dist/components/core/table-cell/TableCell.types.d.ts +43 -0
  362. package/dist/components/core/table-cell/TableCell.types.js +7 -0
  363. package/dist/components/core/table-head/TableHead.css +6 -0
  364. package/dist/components/core/table-head/TableHead.d.ts +22 -0
  365. package/dist/components/core/table-head/TableHead.js +52 -0
  366. package/dist/components/core/table-head/TableHead.types.d.ts +39 -0
  367. package/dist/components/core/table-head/TableHead.types.js +7 -0
  368. package/dist/components/core/table-head/table-head-impl.css +51 -0
  369. package/dist/components/core/table-header-cell/TableHeaderCell.css +126 -0
  370. package/dist/components/core/table-header-cell/TableHeaderCell.d.ts +21 -0
  371. package/dist/components/core/table-header-cell/TableHeaderCell.js +34 -0
  372. package/dist/components/core/table-header-cell/TableHeaderCell.types.d.ts +56 -0
  373. package/dist/components/core/table-header-cell/TableHeaderCell.types.js +9 -0
  374. package/dist/components/core/table-header-cell/table-header-cell-impl.css +74 -0
  375. package/dist/components/core/table-row/TableRow.css +18 -0
  376. package/dist/components/core/table-row/TableRow.d.ts +17 -0
  377. package/dist/components/core/table-row/TableRow.js +32 -0
  378. package/dist/components/core/table-row/TableRow.types.d.ts +45 -0
  379. package/dist/components/core/table-row/TableRow.types.js +7 -0
  380. package/dist/components/core/table-row/table-row-impl.css +31 -0
  381. package/dist/components/core/text-area/TextArea.css +325 -0
  382. package/dist/components/core/text-area/TextArea.d.ts +13 -0
  383. package/dist/components/core/text-area/TextArea.js +133 -0
  384. package/dist/components/core/text-area/TextArea.types.d.ts +67 -0
  385. package/dist/components/core/text-area/TextArea.types.js +19 -0
  386. package/dist/components/core/text-area/text-area-impl.css +36 -0
  387. package/dist/components/core/text-input/TextInput.css +400 -0
  388. package/dist/components/core/text-input/TextInput.d.ts +5 -0
  389. package/dist/components/core/text-input/TextInput.js +130 -0
  390. package/dist/components/core/text-input/TextInput.types.d.ts +96 -0
  391. package/dist/components/core/text-input/TextInput.types.js +24 -0
  392. package/dist/components/core/text-input/text-input-impl.css +36 -0
  393. package/dist/components/core/tooltip/Tooltip.css +101 -0
  394. package/dist/components/core/tooltip/Tooltip.d.ts +51 -0
  395. package/dist/components/core/tooltip/Tooltip.js +87 -0
  396. package/dist/components/core/tooltip/Tooltip.types.d.ts +38 -0
  397. package/dist/components/core/tooltip/Tooltip.types.js +9 -0
  398. package/dist/components/core/tooltip/TooltipAnchor.d.ts +52 -0
  399. package/dist/components/core/tooltip/TooltipAnchor.js +69 -0
  400. package/dist/components/core/tooltip/tooltip-anchor.css +145 -0
  401. package/dist/components/core/tooltip/tooltip-impl.css +54 -0
  402. package/dist/components/core/tooltip/use-tooltip.d.ts +111 -0
  403. package/dist/components/core/tooltip/use-tooltip.js +189 -0
  404. package/dist/components/core/typography/Typography.css +96 -0
  405. package/dist/components/core/typography/Typography.d.ts +297 -0
  406. package/dist/components/core/typography/Typography.js +28 -0
  407. package/dist/components/core/typography/Typography.types.d.ts +40 -0
  408. package/dist/components/core/typography/Typography.types.js +7 -0
  409. package/dist/components/css-time.d.ts +20 -0
  410. package/dist/components/css-time.js +30 -0
  411. package/dist/components/given.d.ts +7 -0
  412. package/dist/components/given.js +9 -0
  413. package/dist/components/hover-open.d.ts +34 -0
  414. package/dist/components/hover-open.js +90 -0
  415. package/dist/components/index.d.ts +114 -1
  416. package/dist/components/index.js +115 -2
  417. package/dist/components/layout/aspect-ratio/AspectRatio.css +29 -0
  418. package/dist/components/layout/aspect-ratio/AspectRatio.d.ts +24 -0
  419. package/dist/components/layout/aspect-ratio/AspectRatio.js +26 -0
  420. package/dist/components/layout/aspect-ratio/AspectRatio.types.d.ts +22 -0
  421. package/dist/components/layout/aspect-ratio/AspectRatio.types.js +7 -0
  422. package/dist/components/layout/aspect-ratio/aspect-ratio-impl.css +44 -0
  423. package/dist/components/layout/grid/Grid.css +76 -0
  424. package/dist/components/layout/grid/Grid.d.ts +31 -0
  425. package/dist/components/layout/grid/Grid.js +33 -0
  426. package/dist/components/layout/grid/Grid.types.d.ts +48 -0
  427. package/dist/components/layout/grid/Grid.types.js +7 -0
  428. package/dist/components/layout/grid/grid-impl.css +62 -0
  429. package/dist/components/layout/row/Row.css +85 -0
  430. package/dist/components/layout/row/Row.d.ts +32 -0
  431. package/dist/components/layout/row/Row.js +34 -0
  432. package/dist/components/layout/row/Row.types.d.ts +45 -0
  433. package/dist/components/layout/row/Row.types.js +7 -0
  434. package/dist/components/layout/scroller/Scroller.css +59 -0
  435. package/dist/components/layout/scroller/Scroller.d.ts +34 -0
  436. package/dist/components/layout/scroller/Scroller.js +36 -0
  437. package/dist/components/layout/scroller/Scroller.types.d.ts +38 -0
  438. package/dist/components/layout/scroller/Scroller.types.js +7 -0
  439. package/dist/components/layout/scroller/scroller-impl.css +45 -0
  440. package/dist/components/layout/stack/Stack.css +73 -0
  441. package/dist/components/layout/stack/Stack.d.ts +28 -0
  442. package/dist/components/layout/stack/Stack.js +30 -0
  443. package/dist/components/layout/stack/Stack.types.d.ts +41 -0
  444. package/dist/components/layout/stack/Stack.types.js +7 -0
  445. package/dist/components/visually-hidden.d.ts +22 -0
  446. package/dist/components/visually-hidden.js +31 -0
  447. package/dist/fonts/LICENSE-inter.txt +93 -0
  448. package/dist/fonts/LICENSE-red-hat-mono.txt +93 -0
  449. package/dist/fonts/fonts.css +111 -0
  450. package/dist/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
  451. package/dist/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
  452. package/dist/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
  453. package/dist/fonts/inter-greek-wght-normal.woff2 +0 -0
  454. package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  455. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  456. package/dist/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
  457. package/dist/fonts/red-hat-mono-latin-ext-wght-normal.woff2 +0 -0
  458. package/dist/fonts/red-hat-mono-latin-wght-normal.woff2 +0 -0
  459. package/dist/marketing.css +289 -241
  460. package/package.json +18 -4
@@ -0,0 +1,406 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { ChevronLeftRegularIcon, ChevronRightRegularIcon, EllipsisRegularIcon } from '@deriv-com/quill-icons-web';
4
+ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
5
+ import { DropdownMenu } from '../dropdown-menu/DropdownMenu.js';
6
+ import { Icon } from '../icon/Icon.js';
7
+ import { MenuItem } from '../menu-item/MenuItem.js';
8
+ import './Pagination.css';
9
+ // Second, and it adds rather than corrects: the row stops clipping while a break's menu is
10
+ // open, which is a rule about two elements and cannot be a binding.
11
+ import './pagination-impl.css';
12
+ import { paginationDefaults, paginationParts } from './Pagination.types.js';
13
+ /**
14
+ * The glyph inside a step control.
15
+ *
16
+ * A constant rather than a map, the size axis having gone: there is one control measure
17
+ * here and so one mark that fits it. Written down rather than left to the glyph because a
18
+ * raw Quill icon ships its own width and height, and passing one straight through is how a
19
+ * step draws at the wrong size while every gate still passes.
20
+ */
21
+ const GLYPH_SIZE = 'xs';
22
+ /**
23
+ * The most marks the dots variant will draw.
24
+ *
25
+ * Twice the set size the variant asks for, so nothing anyone should be using it on comes
26
+ * near it. It is a guard rather than a design threshold: the marks are decoration, and one
27
+ * target per page meant a total wired straight from a result count built that many
28
+ * controls and took the page with it. Past this the marks give way to the readout in
29
+ * words, which is a degrade a reader can see — an empty row is not one.
30
+ */
31
+ const DOT_LIMIT = 20;
32
+ /**
33
+ * The most pages a break will offer in one menu.
34
+ *
35
+ * Fifty rows already outruns the surface and scrolls, which is the point at which a list stops
36
+ * being read and starts being searched — and a break in a set of five thousand stands for nearly
37
+ * all of them, so there is no length at which listing the run whole is honest. Past this the menu
38
+ * lists an evenly spaced sample of the run instead: the reader lands near the page they were after,
39
+ * and the break beside where they land stands for a shorter run and so steps through it more finely.
40
+ */
41
+ const JUMP_LIMIT = 50;
42
+ /**
43
+ * The pages a break stands for, read off the numbers either side of it.
44
+ *
45
+ * The break itself carries no range. It does not need to: a gap sits between two numbered slots by
46
+ * construction, and everything between those two numbers is exactly what the row had no room to
47
+ * draw — so the range is a fact about the row rather than about the slot, and deriving it here is
48
+ * what keeps it true however the window arithmetic changes.
49
+ */
50
+ function hidden(before, after) {
51
+ if (typeof before !== 'number' || typeof after !== 'number')
52
+ return [];
53
+ const from = before + 1;
54
+ const length = after - from;
55
+ if (length <= 0)
56
+ return [];
57
+ if (length <= JUMP_LIMIT)
58
+ return Array.from({ length }, (_, index) => from + index);
59
+ // Both ends of the run included, and evenly spaced between them. The stride is greater than one
60
+ // by definition here — the run is longer than the limit — so no two indexes can round onto the
61
+ // same page and the result is strictly increasing without being deduplicated.
62
+ const stride = (length - 1) / (JUMP_LIMIT - 1);
63
+ return Array.from({ length: JUMP_LIMIT }, (_, index) => from + Math.round(index * stride));
64
+ }
65
+ /**
66
+ * The pages worth showing, and where the row breaks.
67
+ *
68
+ * The first and last page are always offered, because they are the two a reader asks for
69
+ * by name — the start of the set and the end of it — and neither is reachable by stepping
70
+ * without pressing as many times as there are pages. Everything between is the window
71
+ * `siblingCount` opens around where the reader currently stands.
72
+ *
73
+ * The window is split rather than mirrored, and the odd one goes after the current page
74
+ * because forward is the direction the reader is travelling. At the default of one that
75
+ * makes the window the current page and the page after it, which is a row of six — and it
76
+ * holds the current page at the same place in that row on every page of the middle band,
77
+ * so the highlighted target stays put as the reader steps.
78
+ *
79
+ * The row holds the same number of targets on every page, which is why the arithmetic is
80
+ * shaped this way rather than the shorter form. That form let the ends of the set truncate
81
+ * the window, so a set of eight drew four targets on the first page and seven in the
82
+ * middle — and since the row is centred, those extra targets pushed both step controls
83
+ * outwards under the hand that had just pressed one.
84
+ *
85
+ * A break is drawn only where it stands for more than the page it replaced: `start > 3`
86
+ * means at least two pages sit unshown, and where only one does the row shows that page
87
+ * instead. An ellipsis occupying the width of the single page it names is punctuation that
88
+ * costs what it saves.
89
+ */
90
+ function slots(current, last, siblings) {
91
+ const width = siblings + 5;
92
+ const before = Math.floor(siblings / 2);
93
+ const after = siblings - before;
94
+ const run = (from, to) => Array.from({ length: Math.max(0, to - from + 1) }, (_, index) => from + index);
95
+ if (last <= width)
96
+ return run(1, last);
97
+ const start = Math.max(2, current - before);
98
+ const end = Math.min(last - 1, current + after);
99
+ if (start <= 3)
100
+ return [...run(1, width - 2), 'gap', last];
101
+ if (end >= last - 2)
102
+ return [1, 'gap', ...run(last - width + 3, last)];
103
+ return [1, 'gap', ...run(start, end), 'gap', last];
104
+ }
105
+ /**
106
+ * What the row has to work with, measured, or null where there is nothing to measure.
107
+ *
108
+ * `overflowing` is the signal the decision hangs on, rather than a comparison of the room
109
+ * against the row's width. A `<nav>` in a block container takes the width it is given; a
110
+ * `<nav>` that is a flex item — a pagination row centred in a footer, which is most of
111
+ * them — is sized to its own contents instead, so `clientWidth` there is what the row
112
+ * already takes rather than what it may have. The list, though, only shrinks below its
113
+ * contents when something has constrained it, so its overflow is the one honest report of
114
+ * not fitting.
115
+ *
116
+ * Null where nothing can be measured. A width of zero is what an element out of the layout
117
+ * reports, and what jsdom reports for everything.
118
+ */
119
+ function measurements(root, list) {
120
+ const rowGap = Number.parseFloat(getComputedStyle(root).columnGap) || 0;
121
+ const slotGap = Number.parseFloat(getComputedStyle(list).columnGap) || 0;
122
+ const steps = Array.from(root.children)
123
+ .filter((child) => child !== list)
124
+ .reduce((total, child) => total + child.offsetWidth + rowGap, 0);
125
+ const room = root.clientWidth - steps;
126
+ const widest = Array.from(list.children).reduce((most, child) => Math.max(most, child.offsetWidth), 0);
127
+ if (room <= 0 || widest <= 0)
128
+ return null;
129
+ return {
130
+ room,
131
+ holds: Math.floor((room + slotGap) / (widest + slotGap)),
132
+ // A pixel of tolerance, because a fractional layout rounds one way in the scroll width
133
+ // and the other in the client width.
134
+ overflowing: list.scrollWidth > list.clientWidth + 1,
135
+ };
136
+ }
137
+ /**
138
+ * What the readout says, which depends on how much the consumer knows.
139
+ *
140
+ * A range against a total is the better sentence and the one the count variant exists for,
141
+ * but it needs both halves: `pageSize` to know how wide a page is, and `totalItems` to know
142
+ * what it is a fraction of. Given one without the other it falls back to counting pages
143
+ * rather than guessing — a total this component invented would be indistinguishable, to the
144
+ * reader, from one the consumer supplied.
145
+ *
146
+ * The upper bound is clamped to the total because the last page is rarely full: 24 pages of
147
+ * 10 across 235 items ends at 235, and a readout claiming 240 of 235 is arithmetic the
148
+ * reader can see is wrong.
149
+ */
150
+ function readout(variant, current, last, totalItems, pageSize) {
151
+ // Compact is a bare position, and the terseness is the point rather than a saving: the
152
+ // variant is chosen for a place with no width. It is also what keeps the two readouts
153
+ // from being the same sentence, count falling back to counting pages when it has no total.
154
+ if (variant === 'compact')
155
+ return `${String(current)} / ${String(last)}`;
156
+ if (totalItems === undefined || pageSize === undefined) {
157
+ return `Page ${String(current)} of ${String(last)}`;
158
+ }
159
+ const from = (current - 1) * pageSize + 1;
160
+ const to = Math.min(current * pageSize, totalItems);
161
+ return `${String(from)}–${String(to)} of ${String(totalItems)}`;
162
+ }
163
+ /**
164
+ * A `<nav>` holding the ways through a set that has been divided into pages.
165
+ *
166
+ * Nothing about the reader's position is held here. `page` is the consumer's, because the
167
+ * results above this control are theirs too, and the two are one fact — a component keeping
168
+ * its own copy is how a row of numbers comes to disagree with what it describes.
169
+ *
170
+ * The one thing it does hold is how much of the window there is room for, which is not the
171
+ * reader's position but the container's width, and is a fact no consumer can pass because
172
+ * only the row can see it.
173
+ *
174
+ * Every control in the row is drawn here rather than borrowed, which is where this parts
175
+ * company with product's. There the steps are ButtonIcons and the numbered pages are
176
+ * Buttons; this package's ButtonIcon has no disabled state and says so in its own source,
177
+ * being a family of links, and a step at the end of the set has to be disabled rather than
178
+ * removed. Its Button is an anchor with a required href and has no quiet form, so a row of
179
+ * page numbers built from it would be a row of calls to action. Both are correct decisions
180
+ * for what those components are, and neither leaves anything to borrow.
181
+ *
182
+ * What a press is depends on the variant, and on `pageHref`. Given it, every route to a
183
+ * page is an anchor — the numbered targets and both steps — which is what gives a visitor
184
+ * cmd-click, a destination in the status bar and a link a crawler can follow. Without it
185
+ * they are buttons reporting through `onPageChange`. The marks under `dots` are always
186
+ * buttons: a slide has no address.
187
+ */
188
+ export function Pagination({ variant = paginationDefaults.variant, showSteps = paginationDefaults.showSteps, page = paginationDefaults.page, totalPages = paginationDefaults.totalPages, onPageChange, pageHref, totalItems, pageSize, siblingCount = paginationDefaults.siblingCount, label = paginationDefaults.label, previousLabel = paginationDefaults.previousLabel, nextLabel = paginationDefaults.nextLabel, morePagesLabel = paginationDefaults.morePagesLabel, ...rest }) {
189
+ // Clamped rather than trusted. A page beyond the set is what a consumer holds for the
190
+ // moment between a filter narrowing the results and their own state catching up, and a
191
+ // row that renders nothing during it reads as the component breaking rather than as the
192
+ // data moving. Truncated because nothing downstream means anything at 3.5.
193
+ // Truncated because nothing downstream — an index, a label, a comparison — means anything at
194
+ // 3.5, and floored at a real number because nothing downstream survives NaN or Infinity either:
195
+ // a total arriving as Math.ceil(total / size) is NaN for exactly as long as `total` is undefined,
196
+ // and a row built from it draws a page numbered NaN beside two empty menus.
197
+ const whole = (value, floor) => (Number.isFinite(value) ? Math.max(floor, Math.trunc(value)) : floor);
198
+ const last = whole(totalPages, 1);
199
+ const current = Math.min(whole(page, 1), last);
200
+ const siblings = whole(siblingCount, 0);
201
+ const atStart = current <= 1;
202
+ const atEnd = current >= last;
203
+ /*
204
+ Whether the steps are drawn, which is showSteps under dots and true everywhere else.
205
+
206
+ Inert outside dots rather than obeyed, in the way this component's other
207
+ variant-specific props already are. What makes dots the exception is that its middle is
208
+ the only one holding targets of its own — every position is a mark and every mark is a
209
+ button — so the row still works when the steps go. Under count and compact the steps are
210
+ the whole of what there is to press, and under pages the numbers reach the two ends and
211
+ the window between them, with stepping the way to anything else.
212
+ */
213
+ const steps = variant === 'dots' ? showSteps : true;
214
+ const rootRef = useRef(null);
215
+ const listRef = useRef(null);
216
+ /**
217
+ * How many siblings the row is drawing, which is the consumer's number until the width
218
+ * says otherwise. Null means nothing has been decided, and it is what every row starts
219
+ * at: a row that opened at its shortest and grew a moment later would be a visible flinch
220
+ * on every mount, and most containers have the room.
221
+ */
222
+ const [fit, setFit] = useState(null);
223
+ const shown = fit === null ? siblings : Math.min(siblings, fit);
224
+ /**
225
+ * The room the row had when it last gave something up.
226
+ *
227
+ * Overflow is the only honest signal that the row does not fit, and a folded row does not
228
+ * overflow — so once folded, the row cannot tell from its own width whether the container
229
+ * has since grown. This remembers the width that forced it, and anything wider is worth
230
+ * trying the full window at again. Monotonic on purpose, so the two decisions cannot
231
+ * chase each other.
232
+ */
233
+ const foldedAt = useRef(Number.POSITIVE_INFINITY);
234
+ const measure = useCallback(() => {
235
+ const root = rootRef.current;
236
+ const list = listRef.current;
237
+ if (root === null || list === null)
238
+ return;
239
+ /*
240
+ Not while a break's menu is open. The rule that keeps that menu out of the list's
241
+ scrollable overflow takes the clip away for as long as it is up, and overflow is the only
242
+ honest report of not fitting — so a measurement taken now would read a row that cannot clip
243
+ as a row with room to spare, and give the window back into a container that never had space
244
+ for it.
245
+
246
+ Read off the DOM rather than off state, which is where this parts company with product's.
247
+ There the row holds which break is open because it spends that state on the trigger's own
248
+ look — an open break keeps a container the way the current page does. Nothing here needs
249
+ that: the break is a part of ours and its open state is already on the element, published
250
+ by DropdownMenu as `aria-expanded`. Holding a second copy would be keeping a fact this
251
+ component does not own purely to answer one question. It is the same attribute the
252
+ stylesheet reads to stop the row clipping, so there is one source rather than two.
253
+ */
254
+ if (list.querySelector('[aria-expanded="true"]') !== null)
255
+ return;
256
+ const measured = measurements(root, list);
257
+ if (measured === null)
258
+ return;
259
+ if (measured.overflowing) {
260
+ // A row of `holds` slots carries holds - 5 siblings once the four fixed slots and the
261
+ // current page are paid for. Never more than was asked for: this decides what the
262
+ // width forbids and the consumer decides the rest. Where even none of them fits there
263
+ // is nothing left to give up that would not cost the reader the page they are on or an
264
+ // end of the set, so the list scrolls — which is the point at which the column wanted
265
+ // count or compact rather than numbers.
266
+ const afford = Math.max(0, measured.holds - 5);
267
+ if (afford < shown) {
268
+ foldedAt.current = measured.room;
269
+ setFit(afford);
270
+ }
271
+ return;
272
+ }
273
+ if (fit !== null && measured.room > foldedAt.current)
274
+ setFit(null);
275
+ }, [fit, shown]);
276
+ // Layout rather than a plain effect: between the two the browser would paint the full
277
+ // window in a container that cannot hold it, which is the clipped page for one frame.
278
+ useLayoutEffect(() => {
279
+ if (variant !== 'pages')
280
+ return;
281
+ measure();
282
+ }, [measure, variant, last, shown]);
283
+ /**
284
+ * The container changing width changes how much of the window there is room for.
285
+ *
286
+ * Absent where there is no ResizeObserver rather than fatal — the row keeps the window the
287
+ * last measurement allowed. jsdom is the environment that asks: the generated behaviour
288
+ * test runs there and reports every width as zero, which `measurements` declines to answer.
289
+ */
290
+ useEffect(() => {
291
+ const root = rootRef.current;
292
+ if (root === null)
293
+ return;
294
+ if (variant !== 'pages')
295
+ return;
296
+ if (typeof ResizeObserver === 'undefined')
297
+ return;
298
+ const observer = new ResizeObserver(() => {
299
+ measure();
300
+ });
301
+ observer.observe(root);
302
+ return () => {
303
+ observer.disconnect();
304
+ };
305
+ }, [measure, variant]);
306
+ /**
307
+ * What a press means, in one place.
308
+ *
309
+ * An anchor needs none of this — the browser follows its href and nothing here runs. This is for
310
+ * the presses that are not anchors: every target when no pageHref was given, and the rows of a
311
+ * break's menu always, MenuItem taking no href of its own. Where a page has an address and the
312
+ * press cannot carry it, this is what walks the reader there.
313
+ */
314
+ const goTo = (to) => {
315
+ if (onPageChange !== undefined)
316
+ onPageChange(to);
317
+ else if (pageHref !== undefined)
318
+ window.location.assign(pageHref(to));
319
+ };
320
+ const go = (to) => () => {
321
+ goTo(to);
322
+ };
323
+ // The row as slots, held here rather than mapped inside the JSX, because the arithmetic
324
+ // is a fact about the row rather than about any one slot.
325
+ const row = variant === 'pages' ? slots(current, last, shown) : [];
326
+ /**
327
+ * One step control, which is an anchor where there is a page to point at and a button
328
+ * otherwise.
329
+ *
330
+ * At either end of the set there is no page, so it is a disabled `<button>` even in link
331
+ * mode — the one place the two modes meet, and the reason this is drawn here rather than
332
+ * taken from ButtonIcon: a link cannot be disabled, which is exactly why that component
333
+ * declines to offer it.
334
+ */
335
+ const stepControl = (to, name, disabled, glyph) => {
336
+ const mark = _jsx(Icon, { size: GLYPH_SIZE, children: glyph });
337
+ if (pageHref !== undefined && !disabled) {
338
+ return (_jsx("a", { className: paginationParts.step, href: pageHref(to), "aria-label": name, onClick: go(to), children: mark }));
339
+ }
340
+ return (_jsx("button", { className: paginationParts.step, type: "button", "aria-label": name, disabled: disabled, onClick: go(to), children: mark }));
341
+ };
342
+ return (_jsxs("nav", { ref: rootRef, className: paginationParts.root, "aria-label": label, "data-variant": variant, "data-show-steps": showSteps, ...rest, children: [steps && stepControl(current - 1, previousLabel, atStart, _jsx(ChevronLeftRegularIcon, {})), variant === 'pages' && (_jsx("div", { className: paginationParts.list, ref: listRef, children: row.map((slot, index) => {
343
+ if (slot === 'gap') {
344
+ const stands = row[index - 1];
345
+ /*
346
+ The break, which presses.
347
+
348
+ It was a span, and aria-hidden with it, on the argument that it names no page —
349
+ true, and the wrong half of the fact. What it stands for is every page the row had
350
+ no room to draw, which is exactly the set a reader who cannot see the page they
351
+ want is after, and the row was making them walk there.
352
+
353
+ A trigger handed to DropdownMenu, which that component did not accept until this
354
+ needed it — its own chevron note named an icon-only trigger as the case product has
355
+ the prop for and said neither case existed here. The menu behind it is
356
+ DropdownMenu's rather than a surface of ours: what happens when a menu opens, where
357
+ focus goes, what Escape does and what the arrow keys move through is described
358
+ once, in the component that exists to describe it.
359
+
360
+ No chevron: a passed trigger is drawn by whoever passed it, and a break wearing one
361
+ would read as a control with a set of its own rather than as the pages between two
362
+ numbers.
363
+
364
+ Keyed by the number in front of it rather than by its position in the row, so a
365
+ break whose range changes under a fold is a different break and takes its open menu
366
+ with it.
367
+ */
368
+ return (_jsx(DropdownMenu, { label: morePagesLabel, trigger:
369
+ /*
370
+ This component's own button rather than a ButtonIcon, which is what it was
371
+ until the row was looked at. Product's break is a transparent secondary
372
+ ButtonIcon; nothing here is transparent — secondary paints a border — so the
373
+ break wore a ring none of the numbers beside it wear and read as a different
374
+ kind of thing in the row. DropdownMenu never asked for a ButtonIcon: it wires
375
+ whatever element it is handed, so this is a plain button carrying the break
376
+ part, and the part carries the same ground, corner and states as the page
377
+ targets either side of it.
378
+ */
379
+ _jsx("button", { className: paginationParts.break, type: "button", "aria-label": morePagesLabel, children: _jsx(Icon, { size: GLYPH_SIZE, children: _jsx(EllipsisRegularIcon, {}) }) }), children: hidden(stands, row[index + 1]).map((to) => (_jsx(MenuItem, { onSelect: () => {
380
+ // The same split every other route to a page makes, and it has to be made
381
+ // here rather than by the row: MenuItem takes no href, so a menu row cannot
382
+ // be an anchor the way a numbered target is. Without this the menu reported
383
+ // to a handler the pages variant is not obliged to have — so in the
384
+ // configuration that variant is documented for, every row did nothing.
385
+ goTo(to);
386
+ }, children: String(to) }, to))) }, `gap-${String(stands ?? index)}`));
387
+ }
388
+ const isCurrent = slot === current;
389
+ // aria-current rather than aria-selected: these are destinations in a set of
390
+ // pages, not options in a listbox, and "page" is the token that says so. The
391
+ // current page's own target stays enabled and in the tab order — a reader who
392
+ // lands on it should hear which page they are on, and pressing it is a harmless
393
+ // no-op rather than a dead end.
394
+ //
395
+ // data-current beside it, saying the same thing to a different reader. The
396
+ // generated stylesheet selects on the data attribute, so without it the rule
397
+ // that fills the current page matches nothing and every number renders alike —
398
+ // which is exactly what shipped until it was looked at. The contract keeps them
399
+ // apart on purpose: what the current page announces and what it looks like are
400
+ // two decisions, and one should not be able to silently change the other.
401
+ if (pageHref !== undefined) {
402
+ return (_jsx("a", { className: paginationParts.page, href: pageHref(slot), "aria-current": isCurrent ? 'page' : undefined, "data-current": isCurrent ? 'true' : undefined, onClick: go(slot), children: slot }, slot));
403
+ }
404
+ return (_jsx("button", { className: paginationParts.page, type: "button", "aria-current": isCurrent ? 'page' : undefined, "data-current": isCurrent ? 'true' : undefined, onClick: go(slot), children: slot }, slot));
405
+ }) })), variant === 'dots' && (_jsx("div", { className: paginationParts.list, ref: listRef, children: last <= DOT_LIMIT ? (Array.from({ length: last }, (_, index) => index + 1).map((to) => (_jsx("button", { className: paginationParts.dot, type: "button", "aria-label": `Page ${String(to)}`, "aria-current": to === current ? 'page' : undefined, "data-current": to === current ? 'true' : undefined, onClick: go(to), children: _jsx("span", { className: paginationParts['dot-mark'] }) }, to)))) : (_jsx("span", { className: paginationParts.summary, children: readout('count', current, last, totalItems, pageSize) })) })), (variant === 'count' || variant === 'compact') && (_jsx("span", { className: paginationParts.summary, children: readout(variant, current, last, totalItems, pageSize) })), steps && stepControl(current + 1, nextLabel, atEnd, _jsx(ChevronRightRegularIcon, {}))] }));
406
+ }
@@ -0,0 +1,59 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export interface PaginationOwnProps {
3
+ /**
4
+ * `pages` — An index or archive whose pages have addresses of their own — a blog listing, a news archive, a resource library. The only variant offering a numbered target, so the only one on which reaching page fourteen costs a single press rather than thirteen, and the only one a crawler can follow past page one. It draws Buttons, which in this package are anchors, so it needs pageHref and the pages it points at have to exist as URLs. A page too far out to be drawn is still not a walk: the break between two runs of numbers presses, and offers the pages it stands for
5
+ * `count` — A long set where the reader's real question is how much is left rather than which page they are on — "page 3" says nothing until you know whether there are four pages or four hundred. Pass totalItems so the readout can answer it. The steps take pageHref where the pages have addresses and fall back to onPageChange where they do not
6
+ * `compact` — A place with no room for a row of numbers — a card footer, a sidebar, a column at a phone's width. Position and the two steps, and nothing else. Like count, its steps are anchors given pageHref and buttons without it
7
+ * `none` — The two steps and nothing between them, for a place where position is either obvious or beside the point — a lightbox moving through images, a set of two. It is the least this component can be, and choosing it is a claim that the reader does not need to know where they are, which on a page with an address per position is a claim worth making deliberately
8
+ * `dots` — A carousel of cards, a testimonial slider, a walkthrough — a short visual sequence where the reader cares where they are rather than what that position is called. The marks are always buttons and the press is always the page's to handle, a slide having no address to link to; pageHref is ignored here rather than obeyed. The case it was built for is a set the reader swipes: pass showSteps={false} there and the row is marks alone, which is also the only variant still offering a target once the steps are gone. Keep the set under about ten — a dot carries no number, so beyond a handful the reader is counting marks too small and too many to count
9
+ */
10
+ variant?: 'pages' | 'count' | 'compact' | 'none' | 'dots';
11
+ /** Whether the two step controls are drawn, under the dots variant. True wherever this component is the way through the set, which is nearly all of them. False for a set the reader moves through some other way and this only reports — a carousel they swipe, a gallery with its own arrows — where a second pair underneath competes with the first. Dropping them also buys the width that lets a long row of marks fit a phone */
12
+ showSteps?: boolean;
13
+ /** Always — it is which page is on screen, counting from one, and the component renders around it rather than holding it. The consumer owns this because the results do: the page number and the rows beneath it are one fact, and a control keeping its own copy is how the two come to disagree. The default is the first page, which is where a set with nothing said about it starts */
14
+ page?: number;
15
+ /** How many pages the set has been divided into. It decides where the row ends, when the ellipsis appears, and when next goes disabled. The default of one is the honest answer for a set nothing has been said about, and it is also the case the component should not be used in at all — a single page has nothing to move between */
16
+ totalPages?: number;
17
+ /** What the page does when the reader asks for another one, counting from one. Required wherever the route to a page is a press rather than a destination: the dots variant always, and the steps under any variant given no pageHref. Under pages it is the pageHref that carries the reader, so this is the reporting half rather than the moving one — useful for telling analytics, and unnecessary if nothing is listening. One of this and pageHref is needed; a component given neither draws a row nothing can move. */
18
+ onPageChange?: (page: number) => void;
19
+ /** The address of a page, given the page number. Passing it makes every route to a page an anchor: the numbered targets, and both steps. Required under the pages variant, which draws Buttons — and a Button in this package is an anchor with a destination, never a press the page handles. Pass it under compact or count too wherever the pages have real URLs, because an anchor is what gives a visitor cmd-click, a destination in the status bar, and a link a search engine can follow to page two. One of this and onPageChange is needed; a component given neither draws a row nothing can move. */
20
+ pageHref?: (page: number) => string;
21
+ /** How many results there are altogether, where that is known. It is what turns the count variant's readout from a position into a measure — "1–10 of 240" rather than "page 1 of 24" — which is the fact that tells a reader whether to keep stepping or narrow their filter instead */
22
+ totalItems?: number;
23
+ /** How many items each page holds, which is what lets the count variant work out the range on screen from the page number alone. Pass it alongside totalItems; on its own it has nothing to be a fraction of. It reports the size in force and does not offer to change it — a control for that is the consumer's to place, beside this one */
24
+ pageSize?: number;
25
+ /** How many numbered pages sit around the current one before the row breaks, under the pages variant. Around rather than either side: the window is split, with the odd one going forward, since the page the reader has not read is the one they most likely want. One is the current page and the one after it, a row of six; two is mirrored. The most it will show rather than a promise, since the row drops what the container cannot hold */
26
+ siblingCount?: number;
27
+ /** Always, and the default is almost always right. It names the landmark rather than the content — a screen reader user listing what is on a page hears this, and a nav with no name is one they cannot tell from the page's other navigation. Set it where a page carries two of these, so the two are distinguishable by what they page through */
28
+ label?: string;
29
+ /** The accessible name for the step-back control, which is a glyph and therefore announces nothing on its own. Override it to translate it, or where "page" is the wrong noun for what is being stepped through */
30
+ previousLabel?: string;
31
+ /** The accessible name for the step-forward control, for the reason previousLabel exists. Keep the two parallel: a pair reading "Next page" and "Go back" is two people's wording in one control */
32
+ nextLabel?: string;
33
+ /** The accessible name for the break between two runs of numbered pages — the control that opens a menu of the pages that break stands for. A glyph announces nothing, which is the position previousLabel and nextLabel are in, and this is passed the same way the two steps' names are, as the control's own accessible name. It names the menu as well as the control, so a reader who has opened it hears which menu they are in */
34
+ morePagesLabel?: string;
35
+ }
36
+ export type PaginationProps = PaginationOwnProps & Omit<HTMLAttributes<HTMLElement>, 'className' | 'variant' | 'showSteps' | 'page' | 'totalPages' | 'onPageChange' | 'pageHref' | 'totalItems' | 'pageSize' | 'siblingCount' | 'label' | 'previousLabel' | 'nextLabel' | 'morePagesLabel'>;
37
+ /** The class each part carries. Apply these — do not retype them. */
38
+ export declare const paginationParts: {
39
+ readonly root: "dds-pagination";
40
+ readonly list: "dds-pagination__list";
41
+ readonly summary: "dds-pagination__summary";
42
+ readonly dot: "dds-pagination__dot";
43
+ readonly 'dot-mark': "dds-pagination__dot-mark";
44
+ readonly step: "dds-pagination__step";
45
+ readonly page: "dds-pagination__page";
46
+ readonly break: "dds-pagination__break";
47
+ };
48
+ /** Generated so defaults cannot drift from the contract. */
49
+ export declare const paginationDefaults: {
50
+ readonly variant: "pages";
51
+ readonly showSteps: true;
52
+ readonly page: 1;
53
+ readonly totalPages: 1;
54
+ readonly siblingCount: 1;
55
+ readonly label: "Pagination";
56
+ readonly previousLabel: "Previous page";
57
+ readonly nextLabel: "Next page";
58
+ readonly morePagesLabel: "More pages";
59
+ };
@@ -0,0 +1,14 @@
1
+ // GENERATED from pagination.contract.json. Do not edit.
2
+ /** The class each part carries. Apply these — do not retype them. */
3
+ export const paginationParts = {
4
+ root: 'dds-pagination',
5
+ list: 'dds-pagination__list',
6
+ summary: 'dds-pagination__summary',
7
+ dot: 'dds-pagination__dot',
8
+ 'dot-mark': 'dds-pagination__dot-mark',
9
+ step: 'dds-pagination__step',
10
+ page: 'dds-pagination__page',
11
+ break: 'dds-pagination__break',
12
+ };
13
+ /** Generated so defaults cannot drift from the contract. */
14
+ export const paginationDefaults = { variant: 'pages', showSteps: true, page: 1, totalPages: 1, siblingCount: 1, label: 'Pagination', previousLabel: 'Previous page', nextLabel: 'Next page', morePagesLabel: 'More pages' };
@@ -0,0 +1,17 @@
1
+ /*
2
+ * What the contract cannot hold, which here is one rule about two elements.
3
+ *
4
+ * The row of targets scrolls when it cannot fit, which is the last resort after giving up
5
+ * siblings — and a scroll container clips. A break's menu is drawn inside that container, so
6
+ * the clip that saves the row from a half-drawn page also takes the top off the menu. The
7
+ * two cannot both be bindings: a binding carries one token for one part in one state, and
8
+ * this is the list's overflow answering to a descendant's aria-expanded.
9
+ *
10
+ * `:has` rather than a class the component toggles, because the fact is already in the DOM.
11
+ * DropdownMenu publishes `aria-expanded` on whatever trigger it was given, so the row does
12
+ * not have to hold a second copy of a state it does not own — and a copy is what would drift
13
+ * the first time a menu shut by a route the row did not hear about.
14
+ */
15
+ :where([data-dds-context="marketing"]) .dds-pagination .dds-pagination__list:has([aria-expanded='true']) {
16
+ overflow: visible;
17
+ }
@@ -0,0 +1,125 @@
1
+ /* GENERATED from removablechip.contract.json. Do not edit. */
2
+
3
+ :where([data-dds-context="marketing"]) .dds-removablechip {
4
+ transition-property: opacity;
5
+ align-items: center;
6
+ border-style: solid;
7
+ box-sizing: border-box;
8
+ cursor: default;
9
+ display: inline-flex;
10
+ max-inline-size: 100%;
11
+ background-color: var(--color-bg-brand-strong);
12
+ border-color: var(--color-bg-brand-strong);
13
+ border-radius: var(--radius-pill);
14
+ border-width: var(--border-width-default);
15
+ color: var(--color-fg-on-brand-strong);
16
+ gap: var(--space-gap-xs);
17
+ }
18
+
19
+ :where([data-dds-context="marketing"]) .dds-removablechip .dds-removablechip__icon {
20
+ align-items: center;
21
+ display: flex;
22
+ flex: none;
23
+ justify-content: center;
24
+ }
25
+
26
+ :where([data-dds-context="marketing"]) .dds-removablechip .dds-removablechip__label {
27
+ min-inline-size: 0;
28
+ overflow: hidden;
29
+ text-overflow: ellipsis;
30
+ white-space: nowrap;
31
+ }
32
+
33
+ :where([data-dds-context="marketing"]) .dds-removablechip .dds-removablechip__remove {
34
+ transition-property: background-color, outline-color, outline-width;
35
+ align-items: center;
36
+ appearance: none;
37
+ background-color: transparent;
38
+ border-style: none;
39
+ cursor: pointer;
40
+ display: inline-flex;
41
+ flex: none;
42
+ justify-content: center;
43
+ outline-style: solid;
44
+ padding: unset;
45
+ border-radius: var(--radius-pill);
46
+ color: var(--color-fg-on-brand-strong);
47
+ min-block-size: var(--size-target-min);
48
+ min-inline-size: var(--size-target-min);
49
+ outline-width: var(--border-width-none);
50
+ transition-duration: var(--motion-duration-fast);
51
+ transition-timing-function: var(--motion-easing-standard);
52
+ }
53
+
54
+ :where([data-dds-context="marketing"]) .dds-removablechip .dds-removablechip__remove-icon {
55
+ flex: none;
56
+ }
57
+
58
+ :where([data-dds-context="marketing"]) .dds-removablechip .dds-removablechip__remove:hover:where(:not(:disabled)) {
59
+ background-color: var(--color-bg-hover-inverse);
60
+ }
61
+
62
+ :where([data-dds-context="marketing"]) .dds-removablechip .dds-removablechip__remove:active {
63
+ background-color: var(--color-bg-active-inverse);
64
+ }
65
+
66
+ :where([data-dds-context="marketing"]) .dds-removablechip .dds-removablechip__remove:focus-visible {
67
+ outline-color: var(--color-border-focus);
68
+ outline-width: var(--border-width-focus);
69
+ }
70
+
71
+ :where([data-dds-context="marketing"]) .dds-removablechip[data-disabled="true"] {
72
+ opacity: var(--opacity-disabled);
73
+ }
74
+
75
+ :where([data-dds-context="marketing"]) .dds-removablechip[data-size="md"] {
76
+ block-size: var(--size-control-md);
77
+ padding-inline-end: var(--space-inset-sm);
78
+ padding-inline-start: var(--space-inset-md);
79
+ }
80
+
81
+ :where([data-dds-context="marketing"]) .dds-removablechip[data-size="md"] .dds-removablechip__icon {
82
+ block-size: var(--icon-size-sm);
83
+ inline-size: var(--icon-size-sm);
84
+ }
85
+
86
+ :where([data-dds-context="marketing"]) .dds-removablechip[data-size="md"] .dds-removablechip__label {
87
+ font-family: var(--font-label-md-family);
88
+ font-size: var(--font-label-md-size);
89
+ font-weight: var(--font-label-md-weight);
90
+ line-height: var(--font-label-md-line-height);
91
+ }
92
+
93
+ :where([data-dds-context="marketing"]) .dds-removablechip[data-size="md"] .dds-removablechip__remove-icon {
94
+ block-size: var(--icon-size-sm);
95
+ inline-size: var(--icon-size-sm);
96
+ }
97
+
98
+ :where([data-dds-context="marketing"]) .dds-removablechip[data-size="sm"] {
99
+ block-size: var(--size-control-sm);
100
+ padding-inline-end: var(--space-inset-xs);
101
+ padding-inline-start: var(--space-inset-sm);
102
+ }
103
+
104
+ :where([data-dds-context="marketing"]) .dds-removablechip[data-size="sm"] .dds-removablechip__icon {
105
+ block-size: var(--icon-size-xs);
106
+ inline-size: var(--icon-size-xs);
107
+ }
108
+
109
+ :where([data-dds-context="marketing"]) .dds-removablechip[data-size="sm"] .dds-removablechip__label {
110
+ font-family: var(--font-label-sm-family);
111
+ font-size: var(--font-label-sm-size);
112
+ font-weight: var(--font-label-sm-weight);
113
+ line-height: var(--font-label-sm-line-height);
114
+ }
115
+
116
+ :where([data-dds-context="marketing"]) .dds-removablechip[data-size="sm"] .dds-removablechip__remove-icon {
117
+ block-size: var(--icon-size-xs);
118
+ inline-size: var(--icon-size-xs);
119
+ }
120
+
121
+ @media (prefers-reduced-motion: reduce) {
122
+ :where([data-dds-context="marketing"]) .dds-removablechip,
123
+ :where([data-dds-context="marketing"]) .dds-removablechip * { transition: none; }
124
+ }
125
+