@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
package/README.md CHANGED
@@ -1,17 +1,20 @@
1
- # @deriv/dds-marketing
1
+ # @deriv-com/dds-marketing
2
2
 
3
3
  Components and design tokens from the Deriv Design System, for marketing sites — landing
4
4
  pages, pricing, sign-up.
5
5
 
6
+ **Working with an AI agent?** Point it at [`AGENTS.md`](./AGENTS.md) in this package. It is
7
+ the short version of everything below and says which of the `.llm/` documents to open.
8
+
6
9
  > **This package has no components yet.** Its tokens are real and its stylesheet is
7
10
  > complete; the component surface is still being authored. Until it lands, installing this
8
11
  > gets you the marketing token layer and an empty barrel. Product apps want
9
- > [`@deriv/dds-product`](https://www.npmjs.com/package/@deriv/dds-product).
12
+ > [`@deriv-com/dds-product`](https://www.npmjs.com/package/@deriv-com/dds-product).
10
13
 
11
14
  ## Install
12
15
 
13
16
  ```bash
14
- npm install @deriv/dds-marketing
17
+ npm install @deriv-com/dds-marketing
15
18
  ```
16
19
 
17
20
  React 19 and the Quill icon set are peer dependencies, so install them alongside it if
@@ -23,34 +26,79 @@ npm install react react-dom @deriv-com/quill-icons-web
23
26
 
24
27
  ## Use
25
28
 
26
- Import the stylesheet once, at the root of your app. It defines every token this package's
27
- components bind to — without it they render unstyled.
29
+ Import the stylesheet once, at the root of your app:
28
30
 
29
31
  ```tsx
30
- import '@deriv/dds-marketing/marketing.css'
32
+ import '@deriv-com/dds-marketing/marketing.css'
31
33
  ```
32
34
 
33
- Then import components by name:
35
+ That is the whole of the setup, and today it is the whole of the package: the token layer
36
+ is complete and the barrel is empty, so there is nothing yet to import by name. When
37
+ components land, each will bring its own stylesheet with it and nothing else will need
38
+ importing.
39
+
40
+ Product apps want [`@deriv-com/dds-product`](https://www.npmjs.com/package/@deriv-com/dds-product),
41
+ which has the components.
42
+
43
+ ## Fonts
44
+
45
+ The system is designed for [Inter](https://rsms.me/inter/) (all text) and
46
+ [Red Hat Mono](https://github.com/RedHatOfficial/RedHatFont) (code).
47
+ `marketing.css` names them but cannot carry them — if nothing loads the fonts, every role
48
+ silently falls back to the system typeface, and any weight the page is missing gets faked
49
+ by the browser. Pick one of the two paths:
50
+
51
+ **Let the package supply them.** One import next to `marketing.css`:
34
52
 
35
53
  ```tsx
36
- import { Button } from '@deriv/dds-marketing'
54
+ import '@deriv-com/dds-marketing/fonts.css'
55
+ import '@deriv-com/dds-marketing/marketing.css'
56
+ ```
57
+
58
+ This self-hosts both faces from the package (variable-weight WOFF2, subset per script,
59
+ ~260 KB total across all scripts — a page only downloads the subsets its text uses). Both
60
+ fonts are under the SIL Open Font License; the licenses ship in `dist/fonts/`.
61
+
62
+ **Load them yourself.** If your app already hosts the fonts — `next/font`, Fontsource, or
63
+ your own `@font-face` — skip `fonts.css` and point the two family variables at what you
64
+ loaded:
65
+
66
+ ```css
67
+ :root {
68
+ --font-family-sans: var(--your-inter-variable), system-ui, sans-serif;
69
+ --font-family-mono: var(--your-mono-variable), ui-monospace, monospace;
70
+ }
37
71
  ```
38
72
 
39
- Each component brings its own stylesheet with it, so nothing else needs importing.
73
+ Every type role reads its family from these two variables, so this redirects the whole
74
+ system at once. Load weights 400–700 for Inter (a variable font covers this in one file);
75
+ a missing weight does not fall back visibly — the browser synthesises a faux bold instead.
40
76
 
41
- ## Light and dark
77
+ ## One theme, and a viewport axis
42
78
 
43
- `marketing.css` defines both themes. Dark is selected by `data-theme="dark"` on any
44
- ancestor — usually `<html>`:
79
+ `marketing.css` ships light only. It contains no `[data-theme="dark"]` block, so setting
80
+ that attribute — anywhere, including on `<html>` for the rest of your app — leaves these
81
+ components light. There is nothing to configure and nothing to guard against.
45
82
 
46
- ```html
47
- <html data-theme="dark">
83
+ A dark palette is authored in the token source and held to the same role names as light,
84
+ so turning it on later is a decision rather than a rewrite. The package states what it
85
+ publishes in its own manifest:
86
+
87
+ ```json
88
+ "dds": { "modes": ["light"] }
48
89
  ```
49
90
 
50
- Marketing also carries a mobile viewport axis: seven roles take different values below
91
+ Marketing does carry a mobile viewport axis: seven roles take different values below
51
92
  768px, applied automatically and overridable with `data-dds-viewport="mobile"` or
52
93
  `"desktop"` when a page renders a device frame inside a wider window.
53
94
 
95
+ ## Documentation
96
+
97
+ - [`AGENTS.md`](./AGENTS.md) — the front door: setup, the rules that span components, and
98
+ what this package currently has.
99
+ - `.llm/rules.md` — the constraints no single component can state.
100
+ - `.llm/tokens.md` — the token vocabulary, including the mobile viewport axis above.
101
+
54
102
  ## Versioning
55
103
 
56
104
  Pre-1.0. Minor versions may contain breaking changes while the component surface settles;
@@ -0,0 +1,10 @@
1
+ /* GENERATED from accordion.contract.json. Do not edit. */
2
+
3
+ :where([data-dds-context="marketing"]) .dds-accordion {
4
+ box-sizing: border-box;
5
+ display: flex;
6
+ flex-direction: column;
7
+ inline-size: 100%;
8
+ border-width: var(--border-width-none);
9
+ }
10
+
@@ -0,0 +1,20 @@
1
+ import './Accordion.css';
2
+ import { type AccordionProps } from './Accordion.types.js';
3
+ export type { AccordionProps };
4
+ /**
5
+ * A set of rows, and the two things about them that belong to the set rather than to any row:
6
+ * how deep they sit in the outline, and which one is open.
7
+ *
8
+ * The level is pushed down rather than set per row because every row of one accordion is at one
9
+ * depth by definition — a set whose rows disagreed would describe a hierarchy the design does
10
+ * not have, and a reader navigating by heading would be told it exists.
11
+ *
12
+ * One open row is not a setting here, which is where this parts company with Product's. A
13
+ * marketing page is read by scrolling, and a set that could hold every row open is the long page
14
+ * the accordion was put there to shorten. So the set always holds the answer: a row cannot see
15
+ * its siblings, and left to themselves they would all open.
16
+ *
17
+ * Seeded from whichever row arrived open, so a set that opens showing one keeps it. A row's own
18
+ * handler still runs — it is how a page learns what was pressed, and the only way it could.
19
+ */
20
+ export declare function Accordion({ headingLevel, children, ...rest }: AccordionProps): import("react").JSX.Element;
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Children, cloneElement, isValidElement, useState } from 'react';
3
+ import './Accordion.css';
4
+ import { accordionDefaults, accordionParts } from './Accordion.types.js';
5
+ /**
6
+ * Both handlers, the row's own first.
7
+ *
8
+ * `cloneElement` replaces rather than merges, so a row already reporting its own state would
9
+ * silently stop — and that is the handler a page is most likely to have written, since it is
10
+ * how they learn which row was opened.
11
+ */
12
+ function chain(theirs, ours) {
13
+ if (theirs === undefined)
14
+ return ours;
15
+ return (expanded) => {
16
+ theirs(expanded);
17
+ ours(expanded);
18
+ };
19
+ }
20
+ /**
21
+ * A set of rows, and the two things about them that belong to the set rather than to any row:
22
+ * how deep they sit in the outline, and which one is open.
23
+ *
24
+ * The level is pushed down rather than set per row because every row of one accordion is at one
25
+ * depth by definition — a set whose rows disagreed would describe a hierarchy the design does
26
+ * not have, and a reader navigating by heading would be told it exists.
27
+ *
28
+ * One open row is not a setting here, which is where this parts company with Product's. A
29
+ * marketing page is read by scrolling, and a set that could hold every row open is the long page
30
+ * the accordion was put there to shorten. So the set always holds the answer: a row cannot see
31
+ * its siblings, and left to themselves they would all open.
32
+ *
33
+ * Seeded from whichever row arrived open, so a set that opens showing one keeps it. A row's own
34
+ * handler still runs — it is how a page learns what was pressed, and the only way it could.
35
+ */
36
+ export function Accordion({ headingLevel = accordionDefaults.headingLevel, children, ...rest }) {
37
+ const rows = Children.toArray(children).filter(isValidElement);
38
+ const [open, setOpen] = useState(() => {
39
+ const first = rows.findIndex((row) => row.props.expanded === true);
40
+ return first === -1 ? null : first;
41
+ });
42
+ return (_jsx("div", { className: accordionParts.root, ...rest, children: rows.map((row, index) => {
43
+ const props = row.props;
44
+ /*
45
+ * A DOM element is left exactly as it arrived.
46
+ *
47
+ * `cloneElement` hands its second argument to whatever it is given, and an
48
+ * intrinsic element does not know what `expanded` is — React warns three times
49
+ * and puts `headinglevel="3"` in the markup. `allowedChildren` already says this
50
+ * is misuse, but a contract is not a runtime and the reader who did it by
51
+ * accident deserves a stray div rather than a console full of noise.
52
+ *
53
+ * Keyed on the type being a string, which is what an intrinsic element's is, so a
54
+ * page's own wrapper component still receives the set's answer and can forward
55
+ * it. Comparing against AccordionItem itself would refuse those too, and a
56
+ * component that renders a row is a reasonable thing for a page to have written.
57
+ */
58
+ if (typeof row.type === 'string')
59
+ return row;
60
+ return cloneElement(row, {
61
+ key: row.key ?? index,
62
+ headingLevel,
63
+ expanded: open === index,
64
+ onExpandedChange: chain(props.onExpandedChange, (expanded) => {
65
+ setOpen(expanded ? index : null);
66
+ }),
67
+ });
68
+ }) }));
69
+ }
@@ -0,0 +1,20 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export interface AccordionOwnProps {
3
+ /**
4
+ * `2` — The rows are the page's own sections, sitting directly under its title — a page that is nothing but questions is the case
5
+ * `3` — The default. The set sits under a section heading of its own, which is where an accordion usually is
6
+ * `4` — The set is inside a subsection that already carries a heading above it
7
+ */
8
+ headingLevel?: '2' | '3' | '4';
9
+ /** Allowed: AccordionItem */
10
+ children: ReactNode;
11
+ }
12
+ export type AccordionProps = AccordionOwnProps & Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'headingLevel'>;
13
+ /** The class each part carries. Apply these — do not retype them. */
14
+ export declare const accordionParts: {
15
+ readonly root: "dds-accordion";
16
+ };
17
+ /** Generated so defaults cannot drift from the contract. */
18
+ export declare const accordionDefaults: {
19
+ readonly headingLevel: "3";
20
+ };
@@ -0,0 +1,7 @@
1
+ // GENERATED from accordion.contract.json. Do not edit.
2
+ /** The class each part carries. Apply these — do not retype them. */
3
+ export const accordionParts = {
4
+ root: 'dds-accordion',
5
+ };
6
+ /** Generated so defaults cannot drift from the contract. */
7
+ export const accordionDefaults = { headingLevel: '3' };
@@ -0,0 +1,98 @@
1
+ /* GENERATED from accordionitem.contract.json. Do not edit. */
2
+
3
+ :where([data-dds-context="marketing"]) .dds-accordionitem {
4
+ border-block-start-style: solid;
5
+ box-sizing: border-box;
6
+ display: block;
7
+ border-color: var(--color-border-subtle);
8
+ border-width: var(--border-width-default);
9
+ }
10
+
11
+ :where([data-dds-context="marketing"]) .dds-accordionitem .dds-accordionitem__heading {
12
+ display: block;
13
+ }
14
+
15
+ :where([data-dds-context="marketing"]) .dds-accordionitem .dds-accordionitem__trigger {
16
+ transition-property: color, outline-color, outline-width;
17
+ align-items: center;
18
+ appearance: none;
19
+ background: none;
20
+ border-style: none;
21
+ box-sizing: border-box;
22
+ cursor: pointer;
23
+ display: flex;
24
+ inline-size: 100%;
25
+ outline-style: solid;
26
+ padding-inline: 0;
27
+ text-align: start;
28
+ color: var(--color-fg-default);
29
+ gap: var(--space-gap-md);
30
+ min-block-size: var(--size-target-min);
31
+ min-inline-size: var(--size-target-min);
32
+ outline-width: var(--border-width-none);
33
+ padding-block: var(--space-inset-md);
34
+ transition-duration: var(--motion-duration-fast);
35
+ transition-timing-function: var(--motion-easing-standard);
36
+ }
37
+
38
+ :where([data-dds-context="marketing"]) .dds-accordionitem .dds-accordionitem__title {
39
+ text-align: start;
40
+ font-family: var(--font-label-md-family);
41
+ font-size: var(--font-label-md-size);
42
+ font-weight: var(--font-label-md-weight);
43
+ letter-spacing: var(--font-label-md-letter-spacing);
44
+ line-height: var(--font-label-md-line-height);
45
+ }
46
+
47
+ :where([data-dds-context="marketing"]) .dds-accordionitem .dds-accordionitem__panel {
48
+ overflow: hidden;
49
+ }
50
+
51
+ :where([data-dds-context="marketing"]) .dds-accordionitem .dds-accordionitem__content {
52
+ overflow: hidden;
53
+ font-family: var(--font-body-md-family);
54
+ font-size: var(--font-body-md-size);
55
+ line-height: var(--font-body-md-line-height);
56
+ padding-block-end: var(--space-inset-md);
57
+ }
58
+
59
+ :where([data-dds-context="marketing"]) .dds-accordionitem[data-expanded="false"] .dds-accordionitem__panel {
60
+ display: none;
61
+ transition-duration: var(--motion-duration-normal);
62
+ transition-timing-function: var(--motion-easing-exit);
63
+ }
64
+
65
+ :where([data-dds-context="marketing"]) .dds-accordionitem[data-expanded="true"] .dds-accordionitem__panel {
66
+ display: grid;
67
+ transition-duration: var(--motion-duration-slow);
68
+ transition-timing-function: var(--motion-easing-enter);
69
+ }
70
+
71
+ :where([data-dds-context="marketing"]) .dds-accordionitem .dds-accordionitem__marker {
72
+ color: var(--color-fg-muted);
73
+ }
74
+
75
+ :where([data-dds-context="marketing"]) .dds-accordionitem .dds-accordionitem__trigger:hover:where(:not(:disabled)) {
76
+ color: var(--color-fg-muted);
77
+ }
78
+
79
+ :where([data-dds-context="marketing"]) .dds-accordionitem .dds-accordionitem__trigger:focus-visible {
80
+ outline-color: var(--color-border-focus);
81
+ outline-width: var(--border-width-focus);
82
+ }
83
+
84
+ :where([data-dds-context="marketing"]) .dds-accordionitem[data-expanded="false"] .dds-accordionitem__marker {
85
+ transition-duration: var(--motion-duration-normal);
86
+ transition-timing-function: var(--motion-easing-exit);
87
+ }
88
+
89
+ :where([data-dds-context="marketing"]) .dds-accordionitem[data-expanded="true"] .dds-accordionitem__marker {
90
+ transition-duration: var(--motion-duration-slow);
91
+ transition-timing-function: var(--motion-easing-enter);
92
+ }
93
+
94
+ @media (prefers-reduced-motion: reduce) {
95
+ :where([data-dds-context="marketing"]) .dds-accordionitem,
96
+ :where([data-dds-context="marketing"]) .dds-accordionitem * { transition: none; }
97
+ }
98
+
@@ -0,0 +1,44 @@
1
+ import './AccordionItem.css';
2
+ import './accordion-item-impl.css';
3
+ import { type AccordionItemProps } from './AccordionItem.types.js';
4
+ export type { AccordionItemProps };
5
+ /**
6
+ * One row: a heading that stays, and the detail under it that does not.
7
+ *
8
+ * It works alone and it works in a set, and the difference is only who holds the
9
+ * answer. Alone, the row keeps its own — `expanded` is read once as the state it
10
+ * opens in, and every press after that is its own business. Inside an Accordion
11
+ * the set injects `expanded` on every render, so the row stops deciding and
12
+ * starts reporting: a row cannot see its siblings, which is exactly the fact that
13
+ * makes one-at-a-time impossible to arrange from here.
14
+ *
15
+ * `useState` seeded from the prop rather than derived from it. A row that read
16
+ * the prop every render would be uncontrolled and unable to move; one that
17
+ * ignored it could not be opened by the set. Holding both and preferring the
18
+ * injected value is what lets the same component be either — and it is why
19
+ * `expanded` declares no default: absent has to stay distinguishable from false,
20
+ * because absent is the only way a row knows nobody is controlling it.
21
+ *
22
+ * The heading is a `<div role="heading">` with the level as a number, not an
23
+ * `<h3>`. The level is a prop, and an element cannot be picked at runtime without
24
+ * six branches saying the same thing — the role and `aria-level` say it once.
25
+ *
26
+ * `aria-expanded` sits on the button rather than the panel, because that is what
27
+ * the reader is about to press: the state belongs to the thing they act on, not
28
+ * to a region they cannot see until it opens.
29
+ *
30
+ * The panel is a named region, and the name is the heading that opened it. A
31
+ * `region` is a landmark, and an unnamed one is worse than none — it fills a
32
+ * screen reader's landmark list with anonymous entries nobody can choose between.
33
+ * Naming it is what makes it worth having: a reader who has found the question
34
+ * can jump straight to the answer. Product declines the role instead, which is
35
+ * also correct and is the other way to avoid the same fault; it can afford to
36
+ * because its rows open independently and a set of them would proliferate
37
+ * landmarks, where only one of these is ever open.
38
+ *
39
+ * The panel stays mounted when shut. Unmounting it would take its height with it,
40
+ * so there would be nothing to move between — and it would take the words out of
41
+ * the browser's own find-on-page, which is how a reader looks for an answer they
42
+ * half remember.
43
+ */
44
+ export declare function AccordionItem({ expanded, onExpandedChange, title, headingLevel, children, ...rest }: AccordionItemProps): import("react").JSX.Element;
@@ -0,0 +1,63 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useId, useState } from 'react';
4
+ import { ChevronDownRegularIcon } from '@deriv-com/quill-icons-web';
5
+ import { Icon } from '../icon/Icon.js';
6
+ import './AccordionItem.css';
7
+ import './accordion-item-impl.css';
8
+ import { accordionItemDefaults, accordionItemParts, } from './AccordionItem.types.js';
9
+ /**
10
+ * One row: a heading that stays, and the detail under it that does not.
11
+ *
12
+ * It works alone and it works in a set, and the difference is only who holds the
13
+ * answer. Alone, the row keeps its own — `expanded` is read once as the state it
14
+ * opens in, and every press after that is its own business. Inside an Accordion
15
+ * the set injects `expanded` on every render, so the row stops deciding and
16
+ * starts reporting: a row cannot see its siblings, which is exactly the fact that
17
+ * makes one-at-a-time impossible to arrange from here.
18
+ *
19
+ * `useState` seeded from the prop rather than derived from it. A row that read
20
+ * the prop every render would be uncontrolled and unable to move; one that
21
+ * ignored it could not be opened by the set. Holding both and preferring the
22
+ * injected value is what lets the same component be either — and it is why
23
+ * `expanded` declares no default: absent has to stay distinguishable from false,
24
+ * because absent is the only way a row knows nobody is controlling it.
25
+ *
26
+ * The heading is a `<div role="heading">` with the level as a number, not an
27
+ * `<h3>`. The level is a prop, and an element cannot be picked at runtime without
28
+ * six branches saying the same thing — the role and `aria-level` say it once.
29
+ *
30
+ * `aria-expanded` sits on the button rather than the panel, because that is what
31
+ * the reader is about to press: the state belongs to the thing they act on, not
32
+ * to a region they cannot see until it opens.
33
+ *
34
+ * The panel is a named region, and the name is the heading that opened it. A
35
+ * `region` is a landmark, and an unnamed one is worse than none — it fills a
36
+ * screen reader's landmark list with anonymous entries nobody can choose between.
37
+ * Naming it is what makes it worth having: a reader who has found the question
38
+ * can jump straight to the answer. Product declines the role instead, which is
39
+ * also correct and is the other way to avoid the same fault; it can afford to
40
+ * because its rows open independently and a set of them would proliferate
41
+ * landmarks, where only one of these is ever open.
42
+ *
43
+ * The panel stays mounted when shut. Unmounting it would take its height with it,
44
+ * so there would be nothing to move between — and it would take the words out of
45
+ * the browser's own find-on-page, which is how a reader looks for an answer they
46
+ * half remember.
47
+ */
48
+ export function AccordionItem({ expanded, onExpandedChange, title, headingLevel = accordionItemDefaults.headingLevel, children, ...rest }) {
49
+ // Seeded from the prop rather than derived from it, and `false` rather than a default the
50
+ // contract no longer declares: `expanded` is genuinely absent when nobody is controlling
51
+ // the row, and a default would have said it always holds a value.
52
+ const [held, setHeld] = useState(expanded ?? false);
53
+ // The set's answer wins while there is one. `undefined` is the row standing alone,
54
+ // which is a different thing from a set saying the row is shut.
55
+ const open = expanded ?? held;
56
+ const id = useId();
57
+ const panelId = `${id}-panel`;
58
+ const triggerId = `${id}-trigger`;
59
+ return (_jsxs("div", { className: accordionItemParts.root, "data-expanded": String(open), ...rest, children: [_jsx("div", { className: accordionItemParts.heading, role: "heading", "aria-level": Number(headingLevel), children: _jsxs("button", { type: "button", className: accordionItemParts.trigger, id: triggerId, "aria-expanded": open, "aria-controls": panelId, onClick: () => {
60
+ setHeld(!open);
61
+ onExpandedChange?.(!open);
62
+ }, children: [_jsx("span", { className: accordionItemParts.title, children: title }), _jsx(Icon, { size: "sm", children: _jsx(ChevronDownRegularIcon, { className: accordionItemParts.marker }) })] }) }), _jsx("div", { className: accordionItemParts.panel, id: panelId, role: "region", "aria-labelledby": triggerId, hidden: !open, children: _jsx("div", { className: accordionItemParts.content, children: children }) })] }));
63
+ }
@@ -0,0 +1,32 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export interface AccordionItemOwnProps {
3
+ /** Whether the panel is showing. Inside an Accordion this is injected on every render and the set owns it — a row cannot see its siblings, so it cannot know it is the one that should close. Left off, the row owns itself: absent is not the same as false here, and that difference is the whole of how one component is both. `false` is a set saying the row is shut; absent is nobody saying anything, and the row answers its own presses from there */
4
+ expanded?: boolean;
5
+ /** The page needs to know the row was pressed — to record which question was asked, or to hold the answer itself. Inside an Accordion the set chains its own handler after this one, so a page keeps its report whether or not it is also controlling the row */
6
+ onExpandedChange?: (expanded: boolean) => void;
7
+ /** Always — it is the half of the row that is always on screen. A question in the reader's own words, or the name of the thing the panel details. A string rather than a node, for the reason CardBody's title is one: a node prop cannot be given text in an examples row, and a row nobody can show is worse than a heading that cannot hold a link */
8
+ title: string;
9
+ /**
10
+ * `2` — The rows are the page's own sections. Set on the Accordion rather than here, which pushes it down
11
+ * `3` — The default, and where an accordion usually sits — under a section heading of its own
12
+ * `4` — The set is inside a subsection that already carries a heading
13
+ */
14
+ headingLevel?: '2' | '3' | '4';
15
+ /** Allowed: any content */
16
+ children: ReactNode;
17
+ }
18
+ export type AccordionItemProps = AccordionItemOwnProps & Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'expanded' | 'onExpandedChange' | 'title' | 'headingLevel'>;
19
+ /** The class each part carries. Apply these — do not retype them. */
20
+ export declare const accordionItemParts: {
21
+ readonly root: "dds-accordionitem";
22
+ readonly heading: "dds-accordionitem__heading";
23
+ readonly trigger: "dds-accordionitem__trigger";
24
+ readonly title: "dds-accordionitem__title";
25
+ readonly marker: "dds-accordionitem__marker";
26
+ readonly panel: "dds-accordionitem__panel";
27
+ readonly content: "dds-accordionitem__content";
28
+ };
29
+ /** Generated so defaults cannot drift from the contract. */
30
+ export declare const accordionItemDefaults: {
31
+ readonly headingLevel: "3";
32
+ };
@@ -0,0 +1,13 @@
1
+ // GENERATED from accordion-item.contract.json. Do not edit.
2
+ /** The class each part carries. Apply these — do not retype them. */
3
+ export const accordionItemParts = {
4
+ root: 'dds-accordionitem',
5
+ heading: 'dds-accordionitem__heading',
6
+ trigger: 'dds-accordionitem__trigger',
7
+ title: 'dds-accordionitem__title',
8
+ marker: 'dds-accordionitem__marker',
9
+ panel: 'dds-accordionitem__panel',
10
+ content: 'dds-accordionitem__content',
11
+ };
12
+ /** Generated so defaults cannot drift from the contract. */
13
+ export const accordionItemDefaults = { headingLevel: '3' };
@@ -0,0 +1,107 @@
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
+ /* Implementation CSS that the contract's staticCss cannot express. */
11
+
12
+ /*
13
+ * The separator is between rows, so the first row has none.
14
+ *
15
+ * The rule is declared on every row — a border width binds all four sides at once and only the
16
+ * block-start edge is styled to draw — which makes the first row the exception rather than every
17
+ * other row the rule. Left in, it would draw a line across the top of a set that is a list rather
18
+ * than a box, and the set draws none under the last row for the same reason.
19
+ */
20
+ :where([data-dds-context="marketing"]) .dds-accordionitem:first-child {
21
+ border-block-start-style: none;
22
+ }
23
+
24
+ /*
25
+ * The words take the room the mark does not.
26
+ *
27
+ * The trigger is a flex row of two things and only the title may wrap. Without a basis of its
28
+ * own a flex item will not shrink below its content, so a long question pushed the chevron off
29
+ * the end of the row instead of wrapping under itself.
30
+ */
31
+ :where([data-dds-context="marketing"]) .dds-accordionitem__title {
32
+ flex: 1;
33
+ min-inline-size: 0;
34
+ }
35
+
36
+ /*
37
+ * The row opens and shuts on its own height.
38
+ *
39
+ * A height is the only thing here worth animating. A fade tells a reader the panel arrived; the
40
+ * rows below it still jump to their new place in one frame, which is the movement they would
41
+ * actually notice — a set is a column, and opening one row moves every row under it.
42
+ *
43
+ * The panel is a grid of a single track and the track is what moves. `0fr` is a track with no
44
+ * space in it and `1fr` is a track with all of it, which on a grid of automatic height resolves
45
+ * to exactly the height of what is inside. That is the point: a number here would be a guess at
46
+ * how long an answer is, and the one thing a panel's height cannot be is known.
47
+ *
48
+ * Both boxes clip, and they are doing different jobs. The one on the content is what makes the
49
+ * collapse possible at all: a grid item's automatic minimum size down the block axis is its
50
+ * min-content height, so `0fr` alone is a track told to take no space and stopping at however
51
+ * tall the words are. An item that is a scroll container has an automatic minimum of zero, and
52
+ * `overflow: hidden` is what makes it one. The one on the panel clips the stub the collapse
53
+ * leaves behind, because the content's own inset renders outside a box of no height.
54
+ *
55
+ * `display` transitions too, and that is what makes the shut state real rather than merely
56
+ * short. This is the part the first version got wrong: it forced `display: grid` back on to keep
57
+ * the panel animatable and hid it with `visibility` instead, and `visibility: hidden` does not
58
+ * take a box out of the layout. A grid of no height is still a box — and the track is not even
59
+ * no height, because a flex factor under one is treated as one when the container's own height
60
+ * is indefinite, so the track keeps the item's base size and the content's bottom inset showed
61
+ * as a band of empty space under every shut row.
62
+ *
63
+ * So `hidden` stays on the panel and keeps its `display: none`, which is also what takes the
64
+ * contents out of the tab order and out of a screen reader. `allow-discrete` defers the flip to
65
+ * the end of the collapse rather than applying it in the first frame and cutting the animation
66
+ * off before it starts. Opening runs the other way — display flips first and the track then has
67
+ * somewhere to travel from, which is what `@starting-style` supplies: an element arriving from
68
+ * `display: none` has no previous style to interpolate out of, so without it the first frame is
69
+ * already the last one.
70
+ *
71
+ * A transition rather than a keyframe, because this is reversible and has to be interruptible: a
72
+ * reader who shuts a row halfway through opening it should have it travel back from where it is.
73
+ * The duration and the curve are tokens the contract binds per side of the axis.
74
+ */
75
+ :where([data-dds-context="marketing"]) .dds-accordionitem__panel {
76
+ grid-template-rows: 0fr;
77
+ transition-property: grid-template-rows, display;
78
+ transition-behavior: allow-discrete;
79
+ }
80
+
81
+ :where([data-dds-context="marketing"]) .dds-accordionitem[data-expanded='true'] .dds-accordionitem__panel {
82
+ grid-template-rows: 1fr;
83
+ }
84
+
85
+ @starting-style {
86
+ .dds-accordionitem[data-expanded='true'] .dds-accordionitem__panel {
87
+ grid-template-rows: 0fr;
88
+ }
89
+ }
90
+
91
+ /*
92
+ * The chevron points where the row is going.
93
+ *
94
+ * Turned rather than swapped: a swap replaces the mark between frames and there is nothing to
95
+ * watch, where the turn is itself the movement that says which way the fold went. A rotation is
96
+ * not a property the contract can bind, which is the whole reason it is written here — the
97
+ * duration and the curve above it are tokens.
98
+ */
99
+ :where([data-dds-context="marketing"]) .dds-accordionitem[data-expanded='true'] .dds-accordionitem__marker {
100
+ rotate: 180deg;
101
+ }
102
+
103
+ /*
104
+ * Reduced motion is answered by the generated sheet, which sets `transition: none` on this row
105
+ * and everything in it. Nothing is needed here, and a second rule saying the same thing weaker
106
+ * would be one more place to keep in step.
107
+ */
@@ -0,0 +1,37 @@
1
+ /* GENERATED from badge.contract.json. Do not edit. */
2
+
3
+ :where([data-dds-context="marketing"]) .dds-badge {
4
+ align-items: center;
5
+ box-sizing: border-box;
6
+ display: inline-flex;
7
+ inline-size: fit-content;
8
+ white-space: nowrap;
9
+ border-radius: var(--radius-pill);
10
+ font-family: var(--font-label-medium-sm-family);
11
+ font-size: var(--font-label-medium-sm-size);
12
+ font-weight: var(--font-label-medium-sm-weight);
13
+ gap: var(--space-gap-xs);
14
+ letter-spacing: var(--font-label-medium-sm-letter-spacing);
15
+ line-height: var(--font-label-medium-sm-line-height);
16
+ padding-block: var(--space-inset-2xs);
17
+ padding-inline: var(--space-inset-sm);
18
+ }
19
+
20
+ :where([data-dds-context="marketing"]) .dds-badge .dds-badge__icon {
21
+ align-items: center;
22
+ display: flex;
23
+ flex: none;
24
+ block-size: var(--icon-size-xs);
25
+ inline-size: var(--icon-size-xs);
26
+ }
27
+
28
+ :where([data-dds-context="marketing"]) .dds-badge[data-variant="accent"] {
29
+ background-color: var(--color-bg-brand-subtle);
30
+ color: var(--color-fg-brand);
31
+ }
32
+
33
+ :where([data-dds-context="marketing"]) .dds-badge[data-variant="neutral"] {
34
+ background-color: var(--color-bg-subtle);
35
+ color: var(--color-fg-default);
36
+ }
37
+