@canonical/react-ds-global 0.36.0 → 0.38.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 (279) hide show
  1. package/README.md +72 -0
  2. package/dist/esm/lib/_work_in_progress/Announcement/styles.css +51 -42
  3. package/dist/esm/lib/_work_in_progress/CategoriesSection/common/Category/styles.css +21 -17
  4. package/dist/esm/lib/_work_in_progress/CategoriesSection/styles.css +16 -12
  5. package/dist/esm/lib/_work_in_progress/ChatSection/styles.css +22 -18
  6. package/dist/esm/lib/_work_in_progress/DescriptionSection/styles.css +14 -10
  7. package/dist/esm/lib/_work_in_progress/IconSection/styles.css +18 -14
  8. package/dist/esm/lib/_work_in_progress/Label/styles.css +36 -32
  9. package/dist/esm/lib/_work_in_progress/Link/styles.css +32 -28
  10. package/dist/esm/lib/_work_in_progress/Rule/styles.css +21 -14
  11. package/dist/esm/lib/_work_in_progress/Section/styles.css +66 -62
  12. package/dist/esm/lib/_work_in_progress/SkipLink/styles.css +35 -32
  13. package/dist/esm/lib/_work_in_progress/TSection/styles.css +26 -22
  14. package/dist/esm/lib/_work_in_progress/grid/ApplicationLayout/ApplicationLayout.js +4 -1
  15. package/dist/esm/lib/_work_in_progress/grid/ApplicationLayout/ApplicationLayout.js.map +1 -1
  16. package/dist/esm/lib/_work_in_progress/grid/ApplicationLayout/styles.css +21 -17
  17. package/dist/esm/lib/_work_in_progress/grid/GridCard/GridCard.js +4 -1
  18. package/dist/esm/lib/_work_in_progress/grid/GridCard/GridCard.js.map +1 -1
  19. package/dist/esm/lib/_work_in_progress/grid/GridCard/styles.css +8 -4
  20. package/dist/esm/lib/_work_in_progress/grid/InnerGridDemo/styles.css +38 -33
  21. package/dist/esm/lib/_work_in_progress/grid/SettingsView/SettingsView.js +4 -1
  22. package/dist/esm/lib/_work_in_progress/grid/SettingsView/SettingsView.js.map +1 -1
  23. package/dist/esm/lib/_work_in_progress/grid/SettingsView/styles.css +23 -19
  24. package/dist/esm/lib/component/Accordion/common/Item/styles.css +305 -299
  25. package/dist/esm/lib/component/Accordion/styles.css +35 -31
  26. package/dist/esm/lib/component/Badge/hooks/useBadge.js +1 -1
  27. package/dist/esm/lib/component/Badge/hooks/useBadge.js.map +1 -1
  28. package/dist/esm/lib/component/Badge/styles.css +45 -41
  29. package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js +1 -1
  30. package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js.map +1 -1
  31. package/dist/esm/lib/component/Breadcrumbs/common/Item/styles.css +69 -65
  32. package/dist/esm/lib/component/Breadcrumbs/styles.css +30 -26
  33. package/dist/esm/lib/component/Button/styles.css +293 -260
  34. package/dist/esm/lib/component/Card/common/Content/styles.css +27 -23
  35. package/dist/esm/lib/component/Card/common/Footer/styles.css +30 -26
  36. package/dist/esm/lib/component/Card/common/Header/styles.css +25 -21
  37. package/dist/esm/lib/component/Card/common/Image/styles.css +8 -4
  38. package/dist/esm/lib/component/Card/styles.css +77 -73
  39. package/dist/esm/lib/component/Chip/Chip.js +29 -6
  40. package/dist/esm/lib/component/Chip/Chip.js.map +1 -1
  41. package/dist/esm/lib/component/Chip/styles.css +105 -101
  42. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js +29 -20
  43. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js.map +1 -1
  44. package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js +25 -2
  45. package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js.map +1 -1
  46. package/dist/esm/lib/component/ContextualMenu/common/Item/styles.css +116 -106
  47. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js +29 -9
  48. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js.map +1 -1
  49. package/dist/esm/lib/component/ContextualMenu/styles.css +74 -72
  50. package/dist/esm/lib/component/Icon/styles.css +24 -20
  51. package/dist/esm/lib/component/InlineCode/styles.css +19 -15
  52. package/dist/esm/lib/component/KeyboardKey/styles.css +44 -40
  53. package/dist/esm/lib/component/Popover/Popover.js.map +1 -1
  54. package/dist/esm/lib/component/Popover/styles.css +59 -52
  55. package/dist/esm/lib/component/Tabs/common/Item/styles.css +80 -76
  56. package/dist/esm/lib/component/Tabs/styles.css +36 -32
  57. package/dist/esm/lib/component/Tile/common/Content/styles.css +28 -24
  58. package/dist/esm/lib/component/Tile/common/Header/styles.css +28 -24
  59. package/dist/esm/lib/component/Tile/styles.css +31 -27
  60. package/dist/esm/lib/component/Tooltip/Tooltip.js +6 -2
  61. package/dist/esm/lib/component/Tooltip/Tooltip.js.map +1 -1
  62. package/dist/esm/lib/component/Tooltip/styles.css +213 -208
  63. package/dist/esm/lib/group/Cards/styles.css +26 -22
  64. package/dist/esm/lib/group/KeyboardKeys/styles.css +14 -10
  65. package/dist/esm/lib/hooks/useContextualMenu/index.js +1 -0
  66. package/dist/esm/lib/hooks/useContextualMenu/index.js.map +1 -1
  67. package/dist/esm/lib/hooks/useContextualMenu/isMenuSeparator.js +11 -0
  68. package/dist/esm/lib/hooks/useContextualMenu/isMenuSeparator.js.map +1 -0
  69. package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js +54 -34
  70. package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js.map +1 -1
  71. package/dist/esm/lib/hooks/useDisclosure/useDisclosure.js.map +1 -1
  72. package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js +1 -1
  73. package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js.map +1 -1
  74. package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js +3 -0
  75. package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js.map +1 -1
  76. package/dist/esm/lib/index.css +79 -0
  77. package/dist/esm/lib/pattern/Modal/Context.js +10 -0
  78. package/dist/esm/lib/pattern/Modal/Context.js.map +1 -0
  79. package/dist/esm/lib/pattern/Modal/Provider.js +103 -0
  80. package/dist/esm/lib/pattern/Modal/Provider.js.map +1 -0
  81. package/dist/esm/lib/pattern/Modal/common/Content/Content.js +15 -0
  82. package/dist/esm/lib/pattern/Modal/common/Content/Content.js.map +1 -0
  83. package/dist/esm/lib/pattern/Modal/common/Content/index.js +3 -0
  84. package/dist/esm/lib/pattern/Modal/common/Content/index.js.map +1 -0
  85. package/dist/esm/lib/pattern/Modal/common/Content/styles.css +37 -0
  86. package/dist/esm/lib/pattern/Modal/common/Content/types.js +2 -0
  87. package/dist/esm/lib/pattern/Modal/common/Content/types.js.map +1 -0
  88. package/dist/esm/lib/pattern/Modal/common/Footer/Footer.js +16 -0
  89. package/dist/esm/lib/pattern/Modal/common/Footer/Footer.js.map +1 -0
  90. package/dist/esm/lib/pattern/Modal/common/Footer/index.js +3 -0
  91. package/dist/esm/lib/pattern/Modal/common/Footer/index.js.map +1 -0
  92. package/dist/esm/lib/pattern/Modal/common/Footer/styles.css +57 -0
  93. package/dist/esm/lib/pattern/Modal/common/Footer/types.js +2 -0
  94. package/dist/esm/lib/pattern/Modal/common/Footer/types.js.map +1 -0
  95. package/dist/esm/lib/pattern/Modal/common/Header/Header.js +27 -0
  96. package/dist/esm/lib/pattern/Modal/common/Header/Header.js.map +1 -0
  97. package/dist/esm/lib/pattern/Modal/common/Header/index.js +3 -0
  98. package/dist/esm/lib/pattern/Modal/common/Header/index.js.map +1 -0
  99. package/dist/esm/lib/pattern/Modal/common/Header/styles.css +79 -0
  100. package/dist/esm/lib/pattern/Modal/common/Header/types.js +2 -0
  101. package/dist/esm/lib/pattern/Modal/common/Header/types.js.map +1 -0
  102. package/dist/esm/lib/pattern/Modal/common/index.js +5 -0
  103. package/dist/esm/lib/pattern/Modal/common/index.js.map +1 -0
  104. package/dist/esm/lib/pattern/Modal/hooks/useModalContext.js +11 -0
  105. package/dist/esm/lib/pattern/Modal/hooks/useModalContext.js.map +1 -0
  106. package/dist/esm/lib/pattern/Modal/hooks/useModalState.js +15 -0
  107. package/dist/esm/lib/pattern/Modal/hooks/useModalState.js.map +1 -0
  108. package/dist/esm/lib/pattern/Modal/index.js +4 -0
  109. package/dist/esm/lib/pattern/Modal/index.js.map +1 -0
  110. package/dist/esm/lib/pattern/Modal/styles.css +119 -0
  111. package/dist/esm/lib/pattern/Modal/types.js +2 -0
  112. package/dist/esm/lib/pattern/Modal/types.js.map +1 -0
  113. package/dist/esm/lib/pattern/Modal/withModal.js +102 -0
  114. package/dist/esm/lib/pattern/Modal/withModal.js.map +1 -0
  115. package/dist/esm/lib/pattern/Timeline/common/Content/styles.css +16 -12
  116. package/dist/esm/lib/pattern/Timeline/common/Event/styles.css +116 -112
  117. package/dist/esm/lib/pattern/Timeline/styles.css +16 -12
  118. package/dist/esm/lib/pattern/index.js +1 -0
  119. package/dist/esm/lib/pattern/index.js.map +1 -1
  120. package/dist/esm/lib/subcomponent/Spinner/styles.css +38 -34
  121. package/dist/types/lib/_work_in_progress/Announcement/types.d.ts +8 -8
  122. package/dist/types/lib/_work_in_progress/Announcement/types.d.ts.map +1 -1
  123. package/dist/types/lib/_work_in_progress/CategoriesSection/common/Category/types.d.ts +5 -3
  124. package/dist/types/lib/_work_in_progress/CategoriesSection/common/Category/types.d.ts.map +1 -1
  125. package/dist/types/lib/_work_in_progress/CategoriesSection/types.d.ts +6 -3
  126. package/dist/types/lib/_work_in_progress/CategoriesSection/types.d.ts.map +1 -1
  127. package/dist/types/lib/_work_in_progress/ChatSection/types.d.ts +6 -3
  128. package/dist/types/lib/_work_in_progress/ChatSection/types.d.ts.map +1 -1
  129. package/dist/types/lib/_work_in_progress/DescriptionSection/types.d.ts +6 -3
  130. package/dist/types/lib/_work_in_progress/DescriptionSection/types.d.ts.map +1 -1
  131. package/dist/types/lib/_work_in_progress/IconSection/types.d.ts +6 -3
  132. package/dist/types/lib/_work_in_progress/IconSection/types.d.ts.map +1 -1
  133. package/dist/types/lib/_work_in_progress/Label/types.d.ts +20 -18
  134. package/dist/types/lib/_work_in_progress/Label/types.d.ts.map +1 -1
  135. package/dist/types/lib/_work_in_progress/Rule/types.d.ts +5 -7
  136. package/dist/types/lib/_work_in_progress/Rule/types.d.ts.map +1 -1
  137. package/dist/types/lib/_work_in_progress/Section/types.d.ts +9 -10
  138. package/dist/types/lib/_work_in_progress/Section/types.d.ts.map +1 -1
  139. package/dist/types/lib/_work_in_progress/SkipLink/types.d.ts +14 -8
  140. package/dist/types/lib/_work_in_progress/SkipLink/types.d.ts.map +1 -1
  141. package/dist/types/lib/_work_in_progress/TSection/types.d.ts +14 -3
  142. package/dist/types/lib/_work_in_progress/TSection/types.d.ts.map +1 -1
  143. package/dist/types/lib/_work_in_progress/grid/ApplicationLayout/ApplicationLayout.d.ts.map +1 -1
  144. package/dist/types/lib/_work_in_progress/grid/ApplicationLayout/types.d.ts +5 -3
  145. package/dist/types/lib/_work_in_progress/grid/ApplicationLayout/types.d.ts.map +1 -1
  146. package/dist/types/lib/_work_in_progress/grid/GridCard/GridCard.d.ts.map +1 -1
  147. package/dist/types/lib/_work_in_progress/grid/GridCard/types.d.ts +5 -3
  148. package/dist/types/lib/_work_in_progress/grid/GridCard/types.d.ts.map +1 -1
  149. package/dist/types/lib/_work_in_progress/grid/InnerGridDemo/types.d.ts +5 -3
  150. package/dist/types/lib/_work_in_progress/grid/InnerGridDemo/types.d.ts.map +1 -1
  151. package/dist/types/lib/_work_in_progress/grid/SettingsView/SettingsView.d.ts.map +1 -1
  152. package/dist/types/lib/_work_in_progress/grid/SettingsView/types.d.ts +5 -3
  153. package/dist/types/lib/_work_in_progress/grid/SettingsView/types.d.ts.map +1 -1
  154. package/dist/types/lib/component/Accordion/common/Item/types.d.ts +28 -22
  155. package/dist/types/lib/component/Accordion/common/Item/types.d.ts.map +1 -1
  156. package/dist/types/lib/component/Accordion/types.d.ts +8 -6
  157. package/dist/types/lib/component/Accordion/types.d.ts.map +1 -1
  158. package/dist/types/lib/component/Badge/types.d.ts +6 -4
  159. package/dist/types/lib/component/Badge/types.d.ts.map +1 -1
  160. package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts +12 -10
  161. package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts.map +1 -1
  162. package/dist/types/lib/component/Breadcrumbs/types.d.ts +11 -10
  163. package/dist/types/lib/component/Breadcrumbs/types.d.ts.map +1 -1
  164. package/dist/types/lib/component/Button/index.d.ts +1 -1
  165. package/dist/types/lib/component/Button/index.d.ts.map +1 -1
  166. package/dist/types/lib/component/Button/types.d.ts +10 -8
  167. package/dist/types/lib/component/Button/types.d.ts.map +1 -1
  168. package/dist/types/lib/component/Card/common/Content/types.d.ts +7 -5
  169. package/dist/types/lib/component/Card/common/Content/types.d.ts.map +1 -1
  170. package/dist/types/lib/component/Card/common/Footer/types.d.ts +7 -5
  171. package/dist/types/lib/component/Card/common/Footer/types.d.ts.map +1 -1
  172. package/dist/types/lib/component/Card/common/Header/types.d.ts +7 -5
  173. package/dist/types/lib/component/Card/common/Header/types.d.ts.map +1 -1
  174. package/dist/types/lib/component/Card/common/Image/types.d.ts +6 -3
  175. package/dist/types/lib/component/Card/common/Image/types.d.ts.map +1 -1
  176. package/dist/types/lib/component/Card/types.d.ts +6 -3
  177. package/dist/types/lib/component/Card/types.d.ts.map +1 -1
  178. package/dist/types/lib/component/Chip/Chip.d.ts +7 -2
  179. package/dist/types/lib/component/Chip/Chip.d.ts.map +1 -1
  180. package/dist/types/lib/component/Chip/types.d.ts +29 -13
  181. package/dist/types/lib/component/Chip/types.d.ts.map +1 -1
  182. package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts +4 -4
  183. package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts.map +1 -1
  184. package/dist/types/lib/component/ContextualMenu/common/Item/Item.d.ts.map +1 -1
  185. package/dist/types/lib/component/ContextualMenu/common/Item/types.d.ts +7 -0
  186. package/dist/types/lib/component/ContextualMenu/common/Item/types.d.ts.map +1 -1
  187. package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts +1 -1
  188. package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts.map +1 -1
  189. package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts +9 -7
  190. package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts.map +1 -1
  191. package/dist/types/lib/component/ContextualMenu/types.d.ts +17 -8
  192. package/dist/types/lib/component/ContextualMenu/types.d.ts.map +1 -1
  193. package/dist/types/lib/component/Icon/types.d.ts +6 -8
  194. package/dist/types/lib/component/Icon/types.d.ts.map +1 -1
  195. package/dist/types/lib/component/InlineCode/types.d.ts +6 -3
  196. package/dist/types/lib/component/InlineCode/types.d.ts.map +1 -1
  197. package/dist/types/lib/component/KeyboardKey/types.d.ts +6 -3
  198. package/dist/types/lib/component/KeyboardKey/types.d.ts.map +1 -1
  199. package/dist/types/lib/component/Popover/types.d.ts +10 -3
  200. package/dist/types/lib/component/Popover/types.d.ts.map +1 -1
  201. package/dist/types/lib/component/Tabs/common/Item/types.d.ts +4 -0
  202. package/dist/types/lib/component/Tabs/common/Item/types.d.ts.map +1 -1
  203. package/dist/types/lib/component/Tabs/types.d.ts +12 -10
  204. package/dist/types/lib/component/Tabs/types.d.ts.map +1 -1
  205. package/dist/types/lib/component/Tile/common/Content/types.d.ts +9 -7
  206. package/dist/types/lib/component/Tile/common/Content/types.d.ts.map +1 -1
  207. package/dist/types/lib/component/Tile/common/Header/types.d.ts +9 -7
  208. package/dist/types/lib/component/Tile/common/Header/types.d.ts.map +1 -1
  209. package/dist/types/lib/component/Tile/types.d.ts +10 -8
  210. package/dist/types/lib/component/Tile/types.d.ts.map +1 -1
  211. package/dist/types/lib/component/Tooltip/Tooltip.d.ts +1 -1
  212. package/dist/types/lib/component/Tooltip/Tooltip.d.ts.map +1 -1
  213. package/dist/types/lib/component/Tooltip/types.d.ts +11 -10
  214. package/dist/types/lib/component/Tooltip/types.d.ts.map +1 -1
  215. package/dist/types/lib/group/Cards/types.d.ts +6 -3
  216. package/dist/types/lib/group/Cards/types.d.ts.map +1 -1
  217. package/dist/types/lib/group/KeyboardKeys/types.d.ts +6 -3
  218. package/dist/types/lib/group/KeyboardKeys/types.d.ts.map +1 -1
  219. package/dist/types/lib/hooks/useContextualMenu/index.d.ts +1 -0
  220. package/dist/types/lib/hooks/useContextualMenu/index.d.ts.map +1 -1
  221. package/dist/types/lib/hooks/useContextualMenu/isMenuSeparator.d.ts +13 -0
  222. package/dist/types/lib/hooks/useContextualMenu/isMenuSeparator.d.ts.map +1 -0
  223. package/dist/types/lib/hooks/useContextualMenu/types.d.ts +45 -15
  224. package/dist/types/lib/hooks/useContextualMenu/types.d.ts.map +1 -1
  225. package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts +5 -6
  226. package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts.map +1 -1
  227. package/dist/types/lib/hooks/useDisclosure/types.d.ts +7 -2
  228. package/dist/types/lib/hooks/useDisclosure/types.d.ts.map +1 -1
  229. package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts +1 -1
  230. package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts.map +1 -1
  231. package/dist/types/lib/hooks/useWindowFitment/types.d.ts +12 -3
  232. package/dist/types/lib/hooks/useWindowFitment/types.d.ts.map +1 -1
  233. package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts +1 -1
  234. package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts.map +1 -1
  235. package/dist/types/lib/pattern/Modal/Context.d.ts +10 -0
  236. package/dist/types/lib/pattern/Modal/Context.d.ts.map +1 -0
  237. package/dist/types/lib/pattern/Modal/Provider.d.ts +63 -0
  238. package/dist/types/lib/pattern/Modal/Provider.d.ts.map +1 -0
  239. package/dist/types/lib/pattern/Modal/common/Content/Content.d.ts +17 -0
  240. package/dist/types/lib/pattern/Modal/common/Content/Content.d.ts.map +1 -0
  241. package/dist/types/lib/pattern/Modal/common/Content/index.d.ts +3 -0
  242. package/dist/types/lib/pattern/Modal/common/Content/index.d.ts.map +1 -0
  243. package/dist/types/lib/pattern/Modal/common/Content/types.d.ts +15 -0
  244. package/dist/types/lib/pattern/Modal/common/Content/types.d.ts.map +1 -0
  245. package/dist/types/lib/pattern/Modal/common/Footer/Footer.d.ts +18 -0
  246. package/dist/types/lib/pattern/Modal/common/Footer/Footer.d.ts.map +1 -0
  247. package/dist/types/lib/pattern/Modal/common/Footer/index.d.ts +3 -0
  248. package/dist/types/lib/pattern/Modal/common/Footer/index.d.ts.map +1 -0
  249. package/dist/types/lib/pattern/Modal/common/Footer/types.d.ts +16 -0
  250. package/dist/types/lib/pattern/Modal/common/Footer/types.d.ts.map +1 -0
  251. package/dist/types/lib/pattern/Modal/common/Header/Header.d.ts +24 -0
  252. package/dist/types/lib/pattern/Modal/common/Header/Header.d.ts.map +1 -0
  253. package/dist/types/lib/pattern/Modal/common/Header/index.d.ts +3 -0
  254. package/dist/types/lib/pattern/Modal/common/Header/index.d.ts.map +1 -0
  255. package/dist/types/lib/pattern/Modal/common/Header/types.d.ts +36 -0
  256. package/dist/types/lib/pattern/Modal/common/Header/types.d.ts.map +1 -0
  257. package/dist/types/lib/pattern/Modal/common/index.d.ts +4 -0
  258. package/dist/types/lib/pattern/Modal/common/index.d.ts.map +1 -0
  259. package/dist/types/lib/pattern/Modal/hooks/useModalContext.d.ts +4 -0
  260. package/dist/types/lib/pattern/Modal/hooks/useModalContext.d.ts.map +1 -0
  261. package/dist/types/lib/pattern/Modal/hooks/useModalState.d.ts +10 -0
  262. package/dist/types/lib/pattern/Modal/hooks/useModalState.d.ts.map +1 -0
  263. package/dist/types/lib/pattern/Modal/index.d.ts +4 -0
  264. package/dist/types/lib/pattern/Modal/index.d.ts.map +1 -0
  265. package/dist/types/lib/pattern/Modal/types.d.ts +122 -0
  266. package/dist/types/lib/pattern/Modal/types.d.ts.map +1 -0
  267. package/dist/types/lib/pattern/Modal/withModal.d.ts +74 -0
  268. package/dist/types/lib/pattern/Modal/withModal.d.ts.map +1 -0
  269. package/dist/types/lib/pattern/Timeline/common/Content/types.d.ts +10 -8
  270. package/dist/types/lib/pattern/Timeline/common/Content/types.d.ts.map +1 -1
  271. package/dist/types/lib/pattern/Timeline/common/Event/types.d.ts +18 -16
  272. package/dist/types/lib/pattern/Timeline/common/Event/types.d.ts.map +1 -1
  273. package/dist/types/lib/pattern/Timeline/types.d.ts +10 -8
  274. package/dist/types/lib/pattern/Timeline/types.d.ts.map +1 -1
  275. package/dist/types/lib/pattern/index.d.ts +1 -0
  276. package/dist/types/lib/pattern/index.d.ts.map +1 -1
  277. package/dist/types/lib/subcomponent/Spinner/types.d.ts +10 -8
  278. package/dist/types/lib/subcomponent/Spinner/types.d.ts.map +1 -1
  279. package/package.json +28 -18
package/README.md CHANGED
@@ -57,6 +57,78 @@ import "@canonical/styles";
57
57
 
58
58
  `@canonical/styles` provides the global design tokens (colour, spacing, typography). Each component in this package co-locates its own component-level tokens in a `styles.css` file next to the component source. These component tokens reference the global tokens from `@canonical/design-tokens` and are included automatically when the component is imported.
59
59
 
60
+ ### How component CSS reaches the page
61
+
62
+ Each component module imports its own stylesheet (`import "./styles.css"`), so importing a component is what puts its CSS on the page. A bundler collects those imports into the application's CSS; nothing here is injected at runtime, and there is no stylesheet to link by hand. The consequence is that a component you never import ships no CSS — and that the order a bundler happens to emit the sheets in is not something you can rely on, which is what the cascade layer below is for.
63
+
64
+ That is what the aggregate below is for. It carries no layer of its own, and its imports are bare: every sheet it imports already opens its own block, so importing one with `layer(…)` would nest it a level deeper instead of placing it.
65
+
66
+ ### The one file to link
67
+
68
+ Every component stylesheet the package ships is also listed in a single aggregate:
69
+
70
+ ```css
71
+ @import url("@canonical/styles");
72
+ @import url("@canonical/react-ds-global/index.css");
73
+ ```
74
+
75
+ That is the whole file — one `@import` per component stylesheet, nothing else — and what it buys is presence, not position.
76
+
77
+ Each component imports its own stylesheet from its module, so without the aggregate a component's rules reach the page only when the JavaScript that renders it does. A lazily-loaded route therefore paints before its components' CSS arrives. Linking the aggregate puts every component rule in the entry stylesheet, present from the first paint, so no route can ever render unstyled.
78
+
79
+ It does not fix where a rule sits in the built sheet. Both copies reach the build — the aggregate's and the component module's — and a minifier that removes duplicates keeps the **last**, which is the module's. Measured on the reference application: the surviving copy of every component rule sits after the application's own CSS, exactly where it sat without the aggregate; all the aggregate leaves ahead of it are the eleven `@media` / `@starting-style` / `:has()` fragments the minifier cannot collapse (1,033 bytes). Order between a component and the application is not settled here and should not be relied on. With the component stylesheets wrapped in `ds.components.global` — the section below — the cascade arbitrates by layer and source position stops mattering at all.
80
+
81
+ The list is source, not output: it is written by hand, as the repository's constitution asks (an explicit import over a build step that discovers files by naming convention), and `src/lib/index.css.test.ts` fails the build if it stops matching the stylesheets on disk. **Adding a component means adding its line**, alphabetically, in `src/lib/index.css`.
82
+
83
+ The bytes are already in the bundle either way: the package declares no `sideEffects`, so a bundler that reaches the barrel pulls all 46 sheets in regardless. On the reference build the aggregate adds 1,033 bytes to the minified stylesheet — the residue the duplicate removal leaves — and roughly 96 KB to a build that does not remove duplicates.
84
+
85
+ The published paths are `@canonical/react-ds-global/index.css` (the subpath the `exports` map names) and `dist/esm/lib/index.css` (the file itself). The manifest also carries it as `style`, which some tools read to find a package's stylesheet without an import — the same field `@canonical/react-ds-global-form` uses for its own.
86
+
87
+ ### What the package publishes, and how to import it
88
+
89
+ The manifest now carries an `exports` map, which is the list of paths this package answers to:
90
+
91
+ | Specifier | What it gives you |
92
+ | --- | --- |
93
+ | `@canonical/react-ds-global` | the components |
94
+ | `@canonical/react-ds-global/index.css` | the aggregate stylesheet above |
95
+ | `@canonical/react-ds-global/dist/…` | any published file, by its exact path |
96
+ | `@canonical/react-ds-global/package.json` | the manifest |
97
+
98
+ **This is a breaking change for anyone importing by a path the map does not answer.** Before, a package with no `exports` map let a resolver reach any file in the directory and, in most bundlers, guess at the rest — the extension you left off, or the `index.js` inside a folder you named. Two things stop working:
99
+
100
+ - **A folder instead of a file.** `@canonical/react-ds-global/dist/esm` and `@canonical/react-ds-global/dist/esm/lib/component/Button` used to find the `index.js` inside them. Name the file: `…/dist/esm/index.js`, `…/dist/esm/lib/component/Button/index.js`.
101
+ - **Anything outside `dist`.** `@canonical/react-ds-global/README.md`, or any `src/…` path that happened to resolve in a workspace checkout, now fails with `ERR_PACKAGE_PATH_NOT_EXPORTED`. Those files are not published anyway; `files` has only ever listed `dist`.
102
+
103
+ Leaving the extension off a real file (`…/Button/Button`) still works in the resolvers we tested, but it depends on the resolver rather than on this package — write the extension.
104
+
105
+ Importing the package by name, or the stylesheet by its subpath, is unaffected, and that is what nearly every consumer does.
106
+ ### Every component stylesheet is in `ds.components.global`
107
+
108
+ Every component `styles.css` in this package is wrapped in one cascade layer:
109
+
110
+ ```css
111
+ @layer ds.components.global {
112
+ .ds.my-component {
113
+ /* … */
114
+ }
115
+ }
116
+ ```
117
+
118
+ `@canonical/styles` declares the order of every layer in one statement, and `ds.components.global` sits near the top of it. Two things follow.
119
+
120
+ Above it are the other component tiers, which follow the design system's own tier tree, flat: `ds.components.sites`, `ds.components.documentation`, `ds.components.stores` and `ds.components.apps`, and above each of those a sub-tier layer for one product's own components — `ds.components.apps-lxd`, which that package declares itself, first rule in its CSS entry, because the styles package's order statement cannot know a product's name. Flat rather than nested: a nested `ds.components.apps.lxd` would sort *inside* `ds.components.apps` and so lose to every rule written directly there, the opposite of what a product tier needs.
121
+
122
+ None of those packages is wrapped yet — at the time of writing no stylesheet under `packages/react/ds-app*` or `packages/svelte/ds-app*` carries a layer at all — and wrapping them is being done package by package alongside this one. So today a product tier still beats this package for the opposite reason: it is unlayered, and unlayered beats layered. What the layers guarantee, once those packages land, is that a product tier's rule for a component this package also styles wins by cascade layer rather than by whichever bundle the loader emitted last.
123
+
124
+ An application's own **unlayered** CSS now beats every rule in this package, whatever the selectors on either side, because unlayered author rules outrank every layered one. That is CSS working as designed, and it is the deliberate escape hatch: an application that needs to override a component writes a plain rule and it wins. An application that does *not* want to win by accident puts its CSS in `@layer app`.
125
+
126
+ **Rule for contributors:** every component `styles.css` in this package opens with that wrapper. `@keyframes` and the component's own `:root` token defaults go inside it; `@property` and `@font-face` registrations stay outside, above the block. That is a convention, not something the cascade forces: a layer does sort a registration — a higher layer's `@property` or `@keyframes` beats a lower layer's in either source order, and an unlayered one beats both (measured in Chromium 151). Keeping the registrations above the block is what makes them read as what they are, declarations the whole document shares, and puts them where a reader goes to look them up. `@keyframes` going inside the block is the opposite choice, and deliberate: it lets an application tier replace an animation by layer. A sheet this package ships is imported **bare**, never with `layer(ds.components.global)`: it already opens its own block, and the keyword would nest it one level deeper, at `ds.components.global.ds.components.global` — a sublayer that loses to this layer's own rules at any specificity (measured in Chromium 151). `layer(…)` on an import is for a sheet that carries no layer of its own. Never reach for `!important` to win a fight — an important declaration inverts the layer order and cannot be arbitrated by layers at all. The package ships exactly one, `component/Tooltip/styles.css:16`, which strips the margin off whatever a tooltip is attached to; it is a known defect and the component-hygiene change removes it. The `@canonical/styles` README's "Cascade layers" section is the reference for the full order and for what is deliberately left unlayered.
127
+
128
+ ### Components own the box of the natives they render
129
+
130
+ A component that renders a native element — a `<button>`, an `<input>`, a `<label>` — is responsible for that element's box: its margin, its width, its `min-width`, its `box-sizing`. Anything a component leaves undeclared is filled in by whatever else the host page loads, and on a page that also runs another framework that is a visible bug rather than a default. Declaring the box is being done as its own change; until it lands, treat "the native looks right on our own page" as a weaker guarantee than it sounds.
131
+
60
132
  ## Icon assets
61
133
 
62
134
  Components that render an icon — `Icon`, `Spinner`, and any component with an
@@ -18,55 +18,64 @@
18
18
  *
19
19
  * NOTE: full token pairing (spacing, typography, radius) is deferred to ADR-Q02.
20
20
  * The values below cover layout + the criticality colour surface + the side bar.
21
+ *
22
+ * Layer: ds.components.global (@canonical/styles README, "Cascade layers").
21
23
  */
22
24
 
23
- .ds.announcement {
24
- display: flex;
25
- flex-direction: row;
26
- align-items: flex-start;
27
- gap: var(--dimension-100);
25
+ @layer ds.components.global {
26
+ .ds.announcement {
27
+ display: flex;
28
+ flex-direction: row;
29
+ align-items: flex-start;
30
+ gap: var(--dimension-100);
28
31
 
29
- /* Side bar (Figma part 4): leading rule carrying the criticality colour. */
30
- border-inline-start-style: solid;
31
- border-inline-start-width: var(--dimension-stroke-thickness-large);
32
- border-inline-start-color: var(--modifier-color-border);
32
+ /* Side bar (Figma part 4): leading rule carrying the criticality colour. */
33
+ border-inline-start-style: solid;
34
+ border-inline-start-width: var(--dimension-stroke-thickness-large);
35
+ border-inline-start-color: var(--modifier-color-border);
33
36
 
34
- padding: var(--dimension-100);
37
+ padding: var(--dimension-100);
35
38
 
36
- /* Text is always the root text colour — the criticality tints the icon,
37
- side bar and background, but the copy stays neutral (Figma: color/text/root
38
- on every criticality). Only the icon reads the criticality colour channel. */
39
- color: var(--color-text);
40
- background-color: var(--modifier-color-foreground-secondary);
39
+ /* Text is always the root text colour — the criticality tints the icon,
40
+ side bar and background, but the copy stays neutral (Figma: color/text/root
41
+ on every criticality). Only the icon reads the criticality colour channel. */
42
+ color: var(--color-text);
43
+ background-color: var(--modifier-color-foreground-secondary);
41
44
 
42
- /* Icon — a masked box. The glyph shape comes from the criticality modifier's
43
- --modifier-icon channel; the fill from --modifier-color-icon. Masking (not
44
- background-image) so the glyph takes the theme colour — same technique as
45
- Accordion's chevron and the form CheckboxInput checkmark. */
46
- & > .icon {
47
- flex: 0 0 auto;
48
- inline-size: var(--dimension-200);
49
- block-size: var(--dimension-200);
50
- background-color: var(--modifier-color-icon);
51
- mask-image: var(--modifier-icon);
52
- mask-repeat: no-repeat;
53
- mask-position: center;
54
- mask-size: contain;
55
- -webkit-mask-image: var(--modifier-icon);
56
- -webkit-mask-repeat: no-repeat;
57
- -webkit-mask-position: center;
58
- -webkit-mask-size: contain;
59
- }
45
+ /* Icon — a masked box. The glyph shape comes from the criticality modifier's
46
+ --modifier-icon channel; the fill from --modifier-color-icon. Masking (not
47
+ background-image) so the glyph takes the theme colour — same technique as
48
+ Accordion's chevron and the form CheckboxInput checkmark. */
49
+ & > .icon {
50
+ flex: 0 0 auto;
51
+ inline-size: var(--dimension-200);
52
+ block-size: var(--dimension-200);
53
+ background-color: var(--modifier-color-icon);
54
+ mask-image: var(--modifier-icon);
55
+ mask-repeat: no-repeat;
56
+ mask-position: center;
57
+ mask-size: contain;
58
+ -webkit-mask-image: var(--modifier-icon);
59
+ -webkit-mask-repeat: no-repeat;
60
+ -webkit-mask-position: center;
61
+ -webkit-mask-size: contain;
62
+ }
60
63
 
61
- & > .text {
62
- display: flex;
63
- flex: 1 1 auto;
64
- flex-direction: column;
65
- gap: var(--dimension-050);
66
- min-width: 0;
67
- }
64
+ & > .text {
65
+ display: flex;
66
+ flex: 1 1 auto;
67
+ flex-direction: column;
68
+ gap: 0;
69
+ min-width: 0;
70
+ }
68
71
 
69
- & .heading {
70
- font-weight: var(--typography-text-primary-bold-font-weight);
72
+ & .heading {
73
+ font-weight: var(--typography-heading-6-font-weight);
74
+ /*
75
+ TODO: Uncomment after line-height bug in typography tokens is addressed
76
+ See https://github.com/canonical/pragma/pull/961#issuecomment-5421532811
77
+ */
78
+ /* line-height: var(--typography-heading-6-line-height); */
79
+ }
71
80
  }
72
81
  }
@@ -1,23 +1,27 @@
1
- /* Generated by component/react v0.1.0 */
2
- /* Generated by @canonical/summon:component-react v0.1.0 */
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
3
2
 
4
- .ds.category {
5
- background: #ffdede;
6
- grid-column-end: span 2;
7
- h3 {
8
- padding-top: var(--space-100);
9
- font-size: var(--typography-heading-h3-font-size, 1.5rem);
10
- margin-bottom: var(--space-100);
11
- /* Heading styles */
12
- }
13
- ul {
14
- list-style: none;
15
- padding: 0;
16
- margin: 0;
17
- li {
3
+ @layer ds.components.global {
4
+ /* Generated by component/react v0.1.0 */
5
+ /* Generated by @canonical/summon:component-react v0.1.0 */
6
+
7
+ .ds.category {
8
+ background: #ffdede;
9
+ grid-column-end: span 2;
10
+ h3 {
11
+ padding-top: var(--space-100);
12
+ font-size: var(--typography-heading-h3-font-size, 1.5rem);
13
+ margin-bottom: var(--space-100);
14
+ /* Heading styles */
15
+ }
16
+ ul {
17
+ list-style: none;
18
18
  padding: 0;
19
19
  margin: 0;
20
+ li {
21
+ padding: 0;
22
+ margin: 0;
23
+ }
20
24
  }
25
+ /* Component styles */
21
26
  }
22
- /* Component styles */
23
27
  }
@@ -1,15 +1,19 @@
1
- /* Generated by component/react v0.1.0 */
2
- /* Generated by @canonical/summon:component-react v0.1.0 */
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
3
2
 
4
- .ds.categories-section {
5
- > .title {
6
- grid-column: 1 / span 2;
7
- }
8
- .payload {
9
- grid-column: 3 / -1;
10
- gap: var(--container-gap-default);
11
- display: grid;
12
- grid-template-columns: subgrid;
3
+ @layer ds.components.global {
4
+ /* Generated by component/react v0.1.0 */
5
+ /* Generated by @canonical/summon:component-react v0.1.0 */
6
+
7
+ .ds.categories-section {
8
+ > .title {
9
+ grid-column: 1 / span 2;
10
+ }
11
+ .payload {
12
+ grid-column: 3 / -1;
13
+ gap: var(--container-gap-default);
14
+ display: grid;
15
+ grid-template-columns: subgrid;
16
+ }
17
+ /* Component styles */
13
18
  }
14
- /* Component styles */
15
19
  }
@@ -1,21 +1,25 @@
1
- /* Generated by component/react v0.1.0 */
2
- /* Generated by @canonical/summon:component-react v0.1.0 */
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
3
2
 
4
- .ds.chat-section {
5
- > .title {
6
- grid-column: 1 / -1;
7
- }
8
- .payload {
9
- display: grid;
10
- grid-template-columns: subgrid;
11
- }
12
- .form {
13
- grid-column: 3 / span 4;
14
- }
15
- textarea {
16
- width: 100%;
17
- resize: vertical;
18
- border: 0;
3
+ @layer ds.components.global {
4
+ /* Generated by component/react v0.1.0 */
5
+ /* Generated by @canonical/summon:component-react v0.1.0 */
6
+
7
+ .ds.chat-section {
8
+ > .title {
9
+ grid-column: 1 / -1;
10
+ }
11
+ .payload {
12
+ display: grid;
13
+ grid-template-columns: subgrid;
14
+ }
15
+ .form {
16
+ grid-column: 3 / span 4;
17
+ }
18
+ textarea {
19
+ width: 100%;
20
+ resize: vertical;
21
+ border: 0;
22
+ }
23
+ /* Component styles */
19
24
  }
20
- /* Component styles */
21
25
  }
@@ -1,13 +1,17 @@
1
- /* Generated by component/react v0.1.0 */
2
- /* Generated by @canonical/summon:component-react v0.1.0 */
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
3
2
 
4
- .ds.description-section {
5
- > .title {
6
- grid-column: auto / span 4;
7
- }
8
- > .payload {
9
- grid-column: auto / span 4;
10
- /* background: red; */
3
+ @layer ds.components.global {
4
+ /* Generated by component/react v0.1.0 */
5
+ /* Generated by @canonical/summon:component-react v0.1.0 */
6
+
7
+ .ds.description-section {
8
+ > .title {
9
+ grid-column: auto / span 4;
10
+ }
11
+ > .payload {
12
+ grid-column: auto / span 4;
13
+ /* background: red; */
14
+ }
15
+ /* Component styles */
11
16
  }
12
- /* Component styles */
13
17
  }
@@ -1,18 +1,22 @@
1
- /* Generated by component/react v0.1.0 */
2
- /* Generated by @canonical/summon:component-react v0.1.0 */
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
3
2
 
4
- .ds.icon-section {
5
- > .title {
6
- grid-column: auto / span 2;
7
- }
8
- > .payload {
9
- grid-column: 3 / -1;
10
- display: grid;
11
- gap: var(--container-gap-default);
12
- grid-template-columns: subgrid;
13
- /* background: red; */
14
- .icon-wrapper {
15
- background: #ffffee;
3
+ @layer ds.components.global {
4
+ /* Generated by component/react v0.1.0 */
5
+ /* Generated by @canonical/summon:component-react v0.1.0 */
6
+
7
+ .ds.icon-section {
8
+ > .title {
9
+ grid-column: auto / span 2;
10
+ }
11
+ > .payload {
12
+ grid-column: 3 / -1;
13
+ display: grid;
14
+ gap: var(--container-gap-default);
15
+ grid-template-columns: subgrid;
16
+ /* background: red; */
17
+ .icon-wrapper {
18
+ background: #ffffee;
19
+ }
16
20
  }
17
21
  }
18
22
  }
@@ -1,36 +1,40 @@
1
- /**
2
- * Label styles
3
- * @implements ds:global.component.label
4
- *
5
- * DSL anatomy mapping:
6
- * - layout.display: inline -> display: inline
7
- * - typography.size: font/size/label -> font-size: var(--font-size-label)
8
- * - typography.weight: font/weight/medium -> font-weight: var(--font-weight-medium)
9
- */
10
- .ds.label {
11
- /* layout.display: inline */
12
- display: inline;
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
13
2
 
14
- /* typography.size: font/size/label */
15
- font-size: var(--label-font-size, var(--font-size-label, 0.75rem));
3
+ @layer ds.components.global {
4
+ /**
5
+ * Label styles
6
+ * @implements ds:global.component.label
7
+ *
8
+ * DSL anatomy mapping:
9
+ * - layout.display: inline -> display: inline
10
+ * - typography.size: font/size/label -> font-size: var(--font-size-label)
11
+ * - typography.weight: font/weight/medium -> font-weight: var(--font-weight-medium)
12
+ */
13
+ .ds.label {
14
+ /* layout.display: inline */
15
+ display: inline;
16
16
 
17
- /* typography.weight: font/weight/medium */
18
- font-weight: var(--label-font-weight, var(--font-weight-medium, 500));
17
+ /* typography.size: font/size/label */
18
+ font-size: var(--label-font-size, var(--font-size-label, 0.75rem));
19
19
 
20
- /* Additional styling */
21
- line-height: var(--label-line-height, 1.2);
22
- color: var(
23
- --modifier-color-text,
24
- var(--label-color, var(--color-text-secondary, inherit))
25
- );
26
- background-color: var(
27
- --modifier-color-foreground-primary,
28
- var(--label-background, transparent)
29
- );
30
- padding-inline: var(--label-padding-inline, var(--spacing-xsmall, 0.25rem));
31
- padding-block: var(--label-padding-block, var(--spacing-xxsmall, 0.125rem));
32
- border-radius: var(
33
- --label-border-radius,
34
- var(--border-radius-small, 0.125rem)
35
- );
20
+ /* typography.weight: font/weight/medium */
21
+ font-weight: var(--label-font-weight, var(--font-weight-medium, 500));
22
+
23
+ /* Additional styling */
24
+ line-height: var(--label-line-height, 1.2);
25
+ color: var(
26
+ --modifier-color-text,
27
+ var(--label-color, var(--color-text-secondary, inherit))
28
+ );
29
+ background-color: var(
30
+ --modifier-color-foreground-primary,
31
+ var(--label-background, transparent)
32
+ );
33
+ padding-inline: var(--label-padding-inline, var(--spacing-xsmall, 0.25rem));
34
+ padding-block: var(--label-padding-block, var(--spacing-xxsmall, 0.125rem));
35
+ border-radius: var(
36
+ --label-border-radius,
37
+ var(--border-radius-small, 0.125rem)
38
+ );
39
+ }
36
40
  }
@@ -1,35 +1,39 @@
1
- /* Component tokens — sourced from @canonical/design-tokens */
2
- :root {
3
- --link-soft-selected-font-weight: var(--font-weight-bold);
4
- --link-activation-contents-padding-vertical: var(--spacing-vertical-small);
5
- --link-activation-contents-padding-horizontal: var(
6
- --spacing-horizontal-small
7
- );
8
- --link-focus-outline-style: var(--tmp-focusable-focused-outline-style);
9
- --link-focus-outline-width: var(--tmp-focusable-focused-outline-width);
10
- --link-focus-outline-color: var(--tmp-focusable-focused-outline-color);
11
- }
12
-
13
- .ds.link {
14
- &.soft {
15
- /*
16
- Soft links are explicitly meant to use normal text color
17
- TODO because <a> tag have their color set in the styles package, we need to set a specific color here.
18
- Otherwise, we could use `currentColor` or only apply link color to non-soft links, which would allow the link to inherit color from parent.
19
- We should confirm this approach is what we want.
20
- */
21
- color: var(--color-text);
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
22
2
 
23
- &:hover {
24
- color: var(--color-text-link);
25
- }
3
+ @layer ds.components.global {
4
+ /* Component tokens — sourced from @canonical/design-tokens */
5
+ :root {
6
+ --link-soft-selected-font-weight: var(--font-weight-bold);
7
+ --link-activation-contents-padding-vertical: var(--spacing-vertical-small);
8
+ --link-activation-contents-padding-horizontal: var(
9
+ --spacing-horizontal-small
10
+ );
11
+ --link-focus-outline-style: var(--tmp-focusable-focused-outline-style);
12
+ --link-focus-outline-width: var(--tmp-focusable-focused-outline-width);
13
+ --link-focus-outline-color: var(--tmp-focusable-focused-outline-color);
14
+ }
26
15
 
27
- &:visited {
16
+ .ds.link {
17
+ &.soft {
18
+ /*
19
+ Soft links are explicitly meant to use normal text color
20
+ TODO because <a> tag have their color set in the styles package, we need to set a specific color here.
21
+ Otherwise, we could use `currentColor` or only apply link color to non-soft links, which would allow the link to inherit color from parent.
22
+ We should confirm this approach is what we want.
23
+ */
28
24
  color: var(--color-text);
29
- }
30
25
 
31
- &[aria-current="page"] {
32
- font-weight: var(--link-soft-selected-font-weight);
26
+ &:hover {
27
+ color: var(--color-text-link);
28
+ }
29
+
30
+ &:visited {
31
+ color: var(--color-text);
32
+ }
33
+
34
+ &[aria-current="page"] {
35
+ font-weight: var(--link-soft-selected-font-weight);
36
+ }
33
37
  }
34
38
  }
35
39
  }
@@ -1,16 +1,23 @@
1
- /* Component tokens — sourced from @canonical/design-tokens */
2
- :root {
3
- --rule-color-background: var(--color-border-muted);
4
- --rule-border-width: 0;
5
- --rule-height: 1px;
6
- --rule-margin-top: 0;
7
- --rule-height-with-margin: var(--spacing-vertical-small);
8
- }
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
2
+
3
+ @layer ds.components.global {
4
+ /* Component tokens — sourced from @canonical/design-tokens */
5
+ :root {
6
+ --rule-color-background: var(--color-border-muted);
7
+ --rule-border-width: 0;
8
+ --rule-height: 1px;
9
+ --rule-margin-top: 0;
10
+ --rule-height-with-margin: var(--spacing-vertical-small);
11
+ }
9
12
 
10
- .ds.rule {
11
- background-color: var(--modifier-color-border, var(--rule-color-background));
12
- border-width: var(--rule-border-width);
13
- height: var(--rule-height);
14
- margin-block-start: var(--rule-margin-top);
15
- margin-block-end: calc(var(--rule-height-with-margin) - var(--rule-height));
13
+ .ds.rule {
14
+ background-color: var(
15
+ --modifier-color-border,
16
+ var(--rule-color-background)
17
+ );
18
+ border-width: var(--rule-border-width);
19
+ height: var(--rule-height);
20
+ margin-block-start: var(--rule-margin-top);
21
+ margin-block-end: calc(var(--rule-height-with-margin) - var(--rule-height));
22
+ }
16
23
  }