@canonical/react-ds-global 0.29.0 → 0.30.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 (300) hide show
  1. package/README.md +33 -0
  2. package/dist/esm/lib/_work_in_progress/IconSection/IconSection.js +1 -1
  3. package/dist/esm/lib/_work_in_progress/IconSection/IconSection.js.map +1 -1
  4. package/dist/esm/lib/_work_in_progress/index.js +13 -0
  5. package/dist/esm/lib/_work_in_progress/index.js.map +1 -0
  6. package/dist/esm/lib/component/Accordion/Accordion.js +2 -0
  7. package/dist/esm/lib/component/Accordion/Accordion.js.map +1 -1
  8. package/dist/esm/lib/component/Accordion/common/Item/styles.css +19 -50
  9. package/dist/esm/lib/component/Accordion/styles.css +5 -1
  10. package/dist/esm/lib/component/Announcement/Announcement.js +5 -3
  11. package/dist/esm/lib/component/Announcement/Announcement.js.map +1 -1
  12. package/dist/esm/lib/component/Announcement/index.js +1 -0
  13. package/dist/esm/lib/component/Announcement/index.js.map +1 -1
  14. package/dist/esm/lib/component/Announcement/styles.css +60 -36
  15. package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js +2 -0
  16. package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js.map +1 -1
  17. package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js +1 -1
  18. package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js.map +1 -1
  19. package/dist/esm/lib/component/Button/Button.js +13 -5
  20. package/dist/esm/lib/component/Button/Button.js.map +1 -1
  21. package/dist/esm/lib/component/Button/styles.css +135 -39
  22. package/dist/esm/lib/component/Card/Card.js +9 -6
  23. package/dist/esm/lib/component/Card/Card.js.map +1 -1
  24. package/dist/esm/lib/component/Card/common/Content/styles.css +1 -1
  25. package/dist/esm/lib/component/Card/common/Footer/Footer.js +1 -1
  26. package/dist/esm/lib/component/Card/common/Footer/styles.css +1 -1
  27. package/dist/esm/lib/component/Card/common/Header/styles.css +1 -1
  28. package/dist/esm/lib/component/Card/common/index.js +0 -1
  29. package/dist/esm/lib/component/Card/common/index.js.map +1 -1
  30. package/dist/esm/lib/component/Card/styles.css +8 -8
  31. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js +94 -0
  32. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js.map +1 -0
  33. package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js +32 -0
  34. package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js.map +1 -0
  35. package/dist/esm/lib/component/ContextualMenu/common/Item/index.js +2 -0
  36. package/dist/esm/lib/component/ContextualMenu/common/Item/index.js.map +1 -0
  37. package/dist/esm/lib/component/ContextualMenu/common/Item/styles.css +93 -0
  38. package/dist/esm/lib/component/ContextualMenu/common/Item/types.js.map +1 -0
  39. package/dist/esm/lib/component/ContextualMenu/common/MenuContext.js +12 -0
  40. package/dist/esm/lib/component/ContextualMenu/common/MenuContext.js.map +1 -0
  41. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js +109 -0
  42. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js.map +1 -0
  43. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/index.js +2 -0
  44. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/index.js.map +1 -0
  45. package/dist/esm/lib/component/ContextualMenu/index.js +2 -0
  46. package/dist/esm/lib/component/ContextualMenu/index.js.map +1 -0
  47. package/dist/esm/lib/component/ContextualMenu/styles.css +86 -0
  48. package/dist/esm/lib/component/ContextualMenu/types.js.map +1 -0
  49. package/dist/esm/lib/component/Icon/Icon.js +3 -0
  50. package/dist/esm/lib/component/Icon/Icon.js.map +1 -1
  51. package/dist/esm/lib/component/InlineCode/InlineCode.js +2 -0
  52. package/dist/esm/lib/component/InlineCode/InlineCode.js.map +1 -1
  53. package/dist/esm/lib/component/KeyboardKey/KeyboardKey.js +2 -0
  54. package/dist/esm/lib/component/KeyboardKey/KeyboardKey.js.map +1 -1
  55. package/dist/esm/lib/component/Popover/Popover.js +50 -0
  56. package/dist/esm/lib/component/Popover/Popover.js.map +1 -0
  57. package/dist/esm/lib/component/Popover/index.js +2 -0
  58. package/dist/esm/lib/component/Popover/index.js.map +1 -0
  59. package/dist/esm/lib/component/Popover/styles.css +65 -0
  60. package/dist/esm/lib/component/Popover/types.js +2 -0
  61. package/dist/esm/lib/component/Popover/types.js.map +1 -0
  62. package/dist/esm/lib/component/Tabs/Tabs.js +27 -0
  63. package/dist/esm/lib/component/Tabs/Tabs.js.map +1 -0
  64. package/dist/esm/lib/component/Tabs/common/Item/Item.js +20 -0
  65. package/dist/esm/lib/component/Tabs/common/Item/Item.js.map +1 -0
  66. package/dist/esm/lib/component/Tabs/common/Item/index.js +3 -0
  67. package/dist/esm/lib/component/Tabs/common/Item/index.js.map +1 -0
  68. package/dist/esm/lib/component/Tabs/common/Item/styles.css +75 -0
  69. package/dist/esm/lib/component/Tabs/common/Item/types.js +2 -0
  70. package/dist/esm/lib/component/Tabs/common/Item/types.js.map +1 -0
  71. package/dist/esm/lib/component/Tabs/common/index.js +2 -0
  72. package/dist/esm/lib/component/Tabs/common/index.js.map +1 -0
  73. package/dist/esm/lib/component/Tabs/index.js +3 -0
  74. package/dist/esm/lib/component/Tabs/index.js.map +1 -0
  75. package/dist/esm/lib/component/Tabs/styles.css +37 -0
  76. package/dist/esm/lib/component/Tabs/types.js +2 -0
  77. package/dist/esm/lib/component/Tabs/types.js.map +1 -0
  78. package/dist/esm/lib/component/Tile/Tile.js +6 -1
  79. package/dist/esm/lib/component/Tile/Tile.js.map +1 -1
  80. package/dist/esm/lib/component/Tile/common/Content/styles.css +17 -8
  81. package/dist/esm/lib/component/Tile/common/Header/styles.css +15 -12
  82. package/dist/esm/lib/component/Tile/styles.css +19 -53
  83. package/dist/esm/lib/component/Tooltip/Tooltip.js +6 -4
  84. package/dist/esm/lib/component/Tooltip/Tooltip.js.map +1 -1
  85. package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js +47 -25
  86. package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js.map +1 -1
  87. package/dist/esm/lib/component/Tooltip/styles.css +146 -81
  88. package/dist/esm/lib/component/Tooltip/withTooltip.js +3 -3
  89. package/dist/esm/lib/component/Tooltip/withTooltip.js.map +1 -1
  90. package/dist/esm/lib/component/index.js +17 -0
  91. package/dist/esm/lib/component/index.js.map +1 -0
  92. package/dist/esm/lib/group/KeyboardKeys/KeyboardKeys.js +3 -0
  93. package/dist/esm/lib/group/KeyboardKeys/KeyboardKeys.js.map +1 -1
  94. package/dist/esm/lib/group/index.js +3 -0
  95. package/dist/esm/lib/group/index.js.map +1 -0
  96. package/dist/esm/lib/hooks/index.js +2 -1
  97. package/dist/esm/lib/hooks/index.js.map +1 -1
  98. package/dist/esm/lib/hooks/useContextualMenu/index.js +3 -0
  99. package/dist/esm/lib/hooks/useContextualMenu/index.js.map +1 -0
  100. package/dist/esm/lib/hooks/useContextualMenu/types.js +2 -0
  101. package/dist/esm/lib/hooks/useContextualMenu/types.js.map +1 -0
  102. package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js +175 -0
  103. package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js.map +1 -0
  104. package/dist/esm/lib/hooks/useDisclosure/index.js +3 -0
  105. package/dist/esm/lib/hooks/useDisclosure/index.js.map +1 -0
  106. package/dist/esm/lib/hooks/useDisclosure/types.js +2 -0
  107. package/dist/esm/lib/hooks/useDisclosure/types.js.map +1 -0
  108. package/dist/esm/lib/hooks/useDisclosure/useDisclosure.js +230 -0
  109. package/dist/esm/lib/hooks/useDisclosure/useDisclosure.js.map +1 -0
  110. package/dist/esm/lib/hooks/useResizeObserver/useResizeObserver.js +37 -7
  111. package/dist/esm/lib/hooks/useResizeObserver/useResizeObserver.js.map +1 -1
  112. package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js +9 -0
  113. package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js.map +1 -1
  114. package/dist/esm/lib/hooks/useWindowFitment/index.js +1 -0
  115. package/dist/esm/lib/hooks/useWindowFitment/index.js.map +1 -1
  116. package/dist/esm/lib/hooks/useWindowFitment/readingDirection.js +25 -0
  117. package/dist/esm/lib/hooks/useWindowFitment/readingDirection.js.map +1 -0
  118. package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js +211 -21
  119. package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js.map +1 -1
  120. package/dist/esm/lib/index.js +8 -25
  121. package/dist/esm/lib/index.js.map +1 -1
  122. package/dist/esm/lib/pattern/index.js +3 -0
  123. package/dist/esm/lib/pattern/index.js.map +1 -0
  124. package/dist/esm/lib/subcomponent/Spinner/Spinner.js +35 -0
  125. package/dist/esm/lib/subcomponent/Spinner/Spinner.js.map +1 -0
  126. package/dist/esm/lib/subcomponent/Spinner/index.js +2 -0
  127. package/dist/esm/lib/subcomponent/Spinner/index.js.map +1 -0
  128. package/dist/esm/lib/subcomponent/Spinner/styles.css +50 -0
  129. package/dist/esm/lib/subcomponent/Spinner/types.js +2 -0
  130. package/dist/esm/lib/subcomponent/Spinner/types.js.map +1 -0
  131. package/dist/esm/lib/subcomponent/index.js +3 -0
  132. package/dist/esm/lib/subcomponent/index.js.map +1 -0
  133. package/dist/esm/lib/types/link.js +2 -0
  134. package/dist/esm/lib/types/link.js.map +1 -0
  135. package/dist/types/lib/_work_in_progress/Link/types.d.ts +1 -1
  136. package/dist/types/lib/_work_in_progress/Link/types.d.ts.map +1 -1
  137. package/dist/types/lib/_work_in_progress/index.d.ts +12 -0
  138. package/dist/types/lib/_work_in_progress/index.d.ts.map +1 -0
  139. package/dist/types/lib/component/Accordion/Accordion.d.ts +2 -0
  140. package/dist/types/lib/component/Accordion/Accordion.d.ts.map +1 -1
  141. package/dist/types/lib/component/Announcement/Announcement.d.ts +2 -2
  142. package/dist/types/lib/component/Announcement/Announcement.d.ts.map +1 -1
  143. package/dist/types/lib/component/Announcement/index.d.ts.map +1 -1
  144. package/dist/types/lib/component/Announcement/types.d.ts +17 -6
  145. package/dist/types/lib/component/Announcement/types.d.ts.map +1 -1
  146. package/dist/types/lib/component/Breadcrumbs/Breadcrumbs.d.ts +3 -1
  147. package/dist/types/lib/component/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  148. package/dist/types/lib/component/Breadcrumbs/common/Item/Item.d.ts +1 -1
  149. package/dist/types/lib/component/Breadcrumbs/common/Item/Item.d.ts.map +1 -1
  150. package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts +8 -13
  151. package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts.map +1 -1
  152. package/dist/types/lib/component/Breadcrumbs/types.d.ts +8 -1
  153. package/dist/types/lib/component/Breadcrumbs/types.d.ts.map +1 -1
  154. package/dist/types/lib/component/Button/Button.d.ts +3 -1
  155. package/dist/types/lib/component/Button/Button.d.ts.map +1 -1
  156. package/dist/types/lib/component/Button/types.d.ts +8 -4
  157. package/dist/types/lib/component/Button/types.d.ts.map +1 -1
  158. package/dist/types/lib/component/Card/Card.d.ts +3 -5
  159. package/dist/types/lib/component/Card/Card.d.ts.map +1 -1
  160. package/dist/types/lib/component/Card/common/Footer/Footer.d.ts +1 -1
  161. package/dist/types/lib/component/Card/common/Footer/types.d.ts +1 -1
  162. package/dist/types/lib/component/Card/common/index.d.ts +0 -1
  163. package/dist/types/lib/component/Card/common/index.d.ts.map +1 -1
  164. package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts +15 -0
  165. package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts.map +1 -0
  166. package/dist/types/lib/component/ContextualMenu/common/Item/Item.d.ts +14 -0
  167. package/dist/types/lib/component/ContextualMenu/common/Item/Item.d.ts.map +1 -0
  168. package/dist/types/lib/component/ContextualMenu/common/Item/index.d.ts +3 -0
  169. package/dist/types/lib/component/ContextualMenu/common/Item/index.d.ts.map +1 -0
  170. package/dist/types/lib/component/ContextualMenu/common/Item/types.d.ts +11 -0
  171. package/dist/types/lib/component/ContextualMenu/common/Item/types.d.ts.map +1 -0
  172. package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts +19 -0
  173. package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts.map +1 -0
  174. package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts +15 -0
  175. package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts.map +1 -0
  176. package/dist/types/lib/component/ContextualMenu/common/SubMenu/index.d.ts +2 -0
  177. package/dist/types/lib/component/ContextualMenu/common/SubMenu/index.d.ts.map +1 -0
  178. package/dist/types/lib/component/ContextualMenu/index.d.ts +3 -0
  179. package/dist/types/lib/component/ContextualMenu/index.d.ts.map +1 -0
  180. package/dist/types/lib/component/ContextualMenu/types.d.ts +30 -0
  181. package/dist/types/lib/component/ContextualMenu/types.d.ts.map +1 -0
  182. package/dist/types/lib/component/Icon/Icon.d.ts +3 -0
  183. package/dist/types/lib/component/Icon/Icon.d.ts.map +1 -1
  184. package/dist/types/lib/component/InlineCode/InlineCode.d.ts +2 -0
  185. package/dist/types/lib/component/InlineCode/InlineCode.d.ts.map +1 -1
  186. package/dist/types/lib/component/KeyboardKey/KeyboardKey.d.ts +2 -0
  187. package/dist/types/lib/component/KeyboardKey/KeyboardKey.d.ts.map +1 -1
  188. package/dist/types/lib/component/Popover/Popover.d.ts +16 -0
  189. package/dist/types/lib/component/Popover/Popover.d.ts.map +1 -0
  190. package/dist/types/lib/component/Popover/index.d.ts +3 -0
  191. package/dist/types/lib/component/Popover/index.d.ts.map +1 -0
  192. package/dist/types/lib/component/Popover/types.d.ts +24 -0
  193. package/dist/types/lib/component/Popover/types.d.ts.map +1 -0
  194. package/dist/types/lib/component/Tabs/Tabs.d.ts +18 -0
  195. package/dist/types/lib/component/Tabs/Tabs.d.ts.map +1 -0
  196. package/dist/types/lib/component/Tabs/common/Item/Item.d.ts +15 -0
  197. package/dist/types/lib/component/Tabs/common/Item/Item.d.ts.map +1 -0
  198. package/dist/types/lib/component/Tabs/common/Item/index.d.ts +3 -0
  199. package/dist/types/lib/component/Tabs/common/Item/index.d.ts.map +1 -0
  200. package/dist/types/lib/component/Tabs/common/Item/types.d.ts +18 -0
  201. package/dist/types/lib/component/Tabs/common/Item/types.d.ts.map +1 -0
  202. package/dist/types/lib/component/Tabs/common/index.d.ts +2 -0
  203. package/dist/types/lib/component/Tabs/common/index.d.ts.map +1 -0
  204. package/dist/types/lib/component/Tabs/index.d.ts +3 -0
  205. package/dist/types/lib/component/Tabs/index.d.ts.map +1 -0
  206. package/dist/types/lib/component/Tabs/types.d.ts +46 -0
  207. package/dist/types/lib/component/Tabs/types.d.ts.map +1 -0
  208. package/dist/types/lib/component/Tile/Tile.d.ts +2 -0
  209. package/dist/types/lib/component/Tile/Tile.d.ts.map +1 -1
  210. package/dist/types/lib/component/Tile/common/Content/types.d.ts +1 -1
  211. package/dist/types/lib/component/Tile/common/Header/types.d.ts +1 -1
  212. package/dist/types/lib/component/Tile/types.d.ts +4 -5
  213. package/dist/types/lib/component/Tile/types.d.ts.map +1 -1
  214. package/dist/types/lib/component/Tooltip/Tooltip.d.ts +1 -1
  215. package/dist/types/lib/component/Tooltip/Tooltip.d.ts.map +1 -1
  216. package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts +2 -2
  217. package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts.map +1 -1
  218. package/dist/types/lib/component/Tooltip/common/TooltipArea/types.d.ts +14 -2
  219. package/dist/types/lib/component/Tooltip/common/TooltipArea/types.d.ts.map +1 -1
  220. package/dist/types/lib/component/Tooltip/types.d.ts +6 -0
  221. package/dist/types/lib/component/Tooltip/types.d.ts.map +1 -1
  222. package/dist/types/lib/component/Tooltip/withTooltip.d.ts +10 -3
  223. package/dist/types/lib/component/Tooltip/withTooltip.d.ts.map +1 -1
  224. package/dist/types/lib/component/index.d.ts +16 -0
  225. package/dist/types/lib/component/index.d.ts.map +1 -0
  226. package/dist/types/lib/group/KeyboardKeys/KeyboardKeys.d.ts +3 -0
  227. package/dist/types/lib/group/KeyboardKeys/KeyboardKeys.d.ts.map +1 -1
  228. package/dist/types/lib/group/index.d.ts +2 -0
  229. package/dist/types/lib/group/index.d.ts.map +1 -0
  230. package/dist/types/lib/hooks/index.d.ts +2 -1
  231. package/dist/types/lib/hooks/index.d.ts.map +1 -1
  232. package/dist/types/lib/hooks/useContextualMenu/index.d.ts +3 -0
  233. package/dist/types/lib/hooks/useContextualMenu/index.d.ts.map +1 -0
  234. package/dist/types/lib/hooks/useContextualMenu/types.d.ts +71 -0
  235. package/dist/types/lib/hooks/useContextualMenu/types.d.ts.map +1 -0
  236. package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts +20 -0
  237. package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts.map +1 -0
  238. package/dist/types/lib/hooks/useDisclosure/index.d.ts +3 -0
  239. package/dist/types/lib/hooks/useDisclosure/index.d.ts.map +1 -0
  240. package/dist/types/lib/hooks/useDisclosure/types.d.ts +103 -0
  241. package/dist/types/lib/hooks/useDisclosure/types.d.ts.map +1 -0
  242. package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts +32 -0
  243. package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts.map +1 -0
  244. package/dist/types/lib/hooks/useResizeObserver/useResizeObserver.d.ts +6 -0
  245. package/dist/types/lib/hooks/useResizeObserver/useResizeObserver.d.ts.map +1 -1
  246. package/dist/types/lib/hooks/useWindowDimensions/useWindowDimensions.d.ts.map +1 -1
  247. package/dist/types/lib/hooks/useWindowFitment/index.d.ts +1 -0
  248. package/dist/types/lib/hooks/useWindowFitment/index.d.ts.map +1 -1
  249. package/dist/types/lib/hooks/useWindowFitment/readingDirection.d.ts +14 -0
  250. package/dist/types/lib/hooks/useWindowFitment/readingDirection.d.ts.map +1 -0
  251. package/dist/types/lib/hooks/useWindowFitment/types.d.ts +75 -4
  252. package/dist/types/lib/hooks/useWindowFitment/types.d.ts.map +1 -1
  253. package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts +44 -2
  254. package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts.map +1 -1
  255. package/dist/types/lib/index.d.ts +5 -25
  256. package/dist/types/lib/index.d.ts.map +1 -1
  257. package/dist/types/lib/pattern/index.d.ts +2 -0
  258. package/dist/types/lib/pattern/index.d.ts.map +1 -0
  259. package/dist/types/lib/subcomponent/Spinner/Spinner.d.ts +24 -0
  260. package/dist/types/lib/subcomponent/Spinner/Spinner.d.ts.map +1 -0
  261. package/dist/types/lib/subcomponent/Spinner/index.d.ts +3 -0
  262. package/dist/types/lib/subcomponent/Spinner/index.d.ts.map +1 -0
  263. package/dist/types/lib/subcomponent/Spinner/types.d.ts +17 -0
  264. package/dist/types/lib/subcomponent/Spinner/types.d.ts.map +1 -0
  265. package/dist/types/lib/subcomponent/index.d.ts +2 -0
  266. package/dist/types/lib/subcomponent/index.d.ts.map +1 -0
  267. package/dist/types/lib/types/index.d.ts +1 -0
  268. package/dist/types/lib/types/index.d.ts.map +1 -1
  269. package/dist/types/lib/types/link.d.ts +26 -0
  270. package/dist/types/lib/types/link.d.ts.map +1 -0
  271. package/package.json +16 -19
  272. package/dist/esm/lib/component/Card/common/Thumbnail/Thumbnail.js +0 -21
  273. package/dist/esm/lib/component/Card/common/Thumbnail/Thumbnail.js.map +0 -1
  274. package/dist/esm/lib/component/Card/common/Thumbnail/index.js +0 -2
  275. package/dist/esm/lib/component/Card/common/Thumbnail/index.js.map +0 -1
  276. package/dist/esm/lib/component/Card/common/Thumbnail/styles.css +0 -39
  277. package/dist/esm/lib/component/Card/common/Thumbnail/types.js.map +0 -1
  278. package/dist/esm/lib/hooks/usePopup/index.js +0 -3
  279. package/dist/esm/lib/hooks/usePopup/index.js.map +0 -1
  280. package/dist/esm/lib/hooks/usePopup/types.js.map +0 -1
  281. package/dist/esm/lib/hooks/usePopup/usePopup.js +0 -93
  282. package/dist/esm/lib/hooks/usePopup/usePopup.js.map +0 -1
  283. package/dist/esm/storybook/decorators.js +0 -16
  284. package/dist/esm/storybook/decorators.js.map +0 -1
  285. package/dist/types/lib/component/Card/common/Thumbnail/Thumbnail.d.ts +0 -23
  286. package/dist/types/lib/component/Card/common/Thumbnail/Thumbnail.d.ts.map +0 -1
  287. package/dist/types/lib/component/Card/common/Thumbnail/index.d.ts +0 -3
  288. package/dist/types/lib/component/Card/common/Thumbnail/index.d.ts.map +0 -1
  289. package/dist/types/lib/component/Card/common/Thumbnail/types.d.ts +0 -27
  290. package/dist/types/lib/component/Card/common/Thumbnail/types.d.ts.map +0 -1
  291. package/dist/types/lib/hooks/usePopup/index.d.ts +0 -3
  292. package/dist/types/lib/hooks/usePopup/index.d.ts.map +0 -1
  293. package/dist/types/lib/hooks/usePopup/types.d.ts +0 -65
  294. package/dist/types/lib/hooks/usePopup/types.d.ts.map +0 -1
  295. package/dist/types/lib/hooks/usePopup/usePopup.d.ts +0 -19
  296. package/dist/types/lib/hooks/usePopup/usePopup.d.ts.map +0 -1
  297. package/dist/types/storybook/decorators.d.ts +0 -15
  298. package/dist/types/storybook/decorators.d.ts.map +0 -1
  299. /package/dist/esm/lib/component/{Card/common/Thumbnail → ContextualMenu/common/Item}/types.js +0 -0
  300. /package/dist/esm/lib/{hooks/usePopup → component/ContextualMenu}/types.js +0 -0
package/README.md CHANGED
@@ -57,6 +57,39 @@ 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
+ ## Icon assets
61
+
62
+ Components that render an icon — `Icon`, `Spinner`, and any component with an
63
+ icon affordance (e.g. the `Accordion` caret) — reference SVGs from
64
+ `@canonical/ds-assets` **at runtime**, not from the JavaScript bundle. Each
65
+ glyph is fetched by URL, e.g. `/icons/spinner.svg#spinner`.
66
+
67
+ Your application must therefore **serve the `@canonical/ds-assets` icons at
68
+ `/icons`**. In most setups this means copying (or symlinking) the package's
69
+ `icons/` directory into the app's static/public directory so the files are
70
+ reachable at `/icons/*.svg`. If the icons are not served, icon-rendering
71
+ components mount but appear empty (the SVG `<use>` resolves to nothing).
72
+
73
+ If you serve the icons from a different path:
74
+
75
+ - **`Icon` and `Spinner`** accept a `rootPath` prop (default `/icons`) to
76
+ override the location per instance:
77
+
78
+ ```tsx
79
+ <Spinner rootPath="/assets/icons" />
80
+ ```
81
+
82
+ There is currently no global default — the override is per component
83
+ instance.
84
+
85
+ - **CSS-referenced icons** (such as the `Accordion` caret) are fixed at
86
+ `/icons` in the stylesheet and cannot be redirected via a prop. Serve the
87
+ icons at `/icons`, or override the relevant component CSS custom property in
88
+ your own styles.
89
+
90
+ A single global source of truth for the icon root is planned; until then,
91
+ serving the assets at `/icons` is the path of least resistance.
92
+
60
93
  ## Storybook
61
94
 
62
95
  Each component includes Storybook stories demonstrating usage patterns and variants:
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "./styles.css";
3
- import { Icon } from "#lib/component/Icon/index.js";
3
+ import { Icon } from "../../component/Icon/index.js";
4
4
  import { TSection } from "../TSection/index.js";
5
5
  const componentCssClassName = "ds icon-section";
6
6
  const iconSelection = [
@@ -1 +1 @@
1
- {"version":3,"file":"IconSection.js","sourceRoot":"","sources":["../../../../../src/lib/_work_in_progress/IconSection/IconSection.tsx"],"names":[],"mappings":";AAMA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD,MAAM,aAAa,GAAe;IAChC,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,UAAU;IACV,WAAW;IACX,KAAK;IACL,WAAW;IACX,cAAc;IACd,eAAe;IACf,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,MAAM;IACN,OAAO;IACP,eAAe;IACf,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,MAAM;IACN,aAAa;IACb,MAAM;IACN,MAAM;IACN,eAAe;IACf,MAAM;IACN,QAAQ;IACR,UAAU;CACX,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,EACnB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACS,EAAmB,EAAE;IACtC,OAAO,CACL,KAAC,QAAQ,IACP,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,cAAgB,SAAS,EAAC,cAAc,YACtC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,IADZ,IAAI,CAER,CACP,CAAC,GACO,CACZ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"IconSection.js","sourceRoot":"","sources":["../../../../../src/lib/_work_in_progress/IconSection/IconSection.tsx"],"names":[],"mappings":";AAMA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD,MAAM,aAAa,GAAe;IAChC,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,UAAU;IACV,WAAW;IACX,KAAK;IACL,WAAW;IACX,cAAc;IACd,eAAe;IACf,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,MAAM;IACN,OAAO;IACP,eAAe;IACf,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,MAAM;IACN,aAAa;IACb,MAAM;IACN,MAAM;IACN,eAAe;IACf,MAAM;IACN,QAAQ;IACR,UAAU;CACX,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,EACnB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACS,EAAmB,EAAE;IACtC,OAAO,CACL,KAAC,QAAQ,IACP,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,cAAgB,SAAS,EAAC,cAAc,YACtC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,IADZ,IAAI,CAER,CACP,CAAC,GACO,CACZ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,13 @@
1
+ // Work-in-progress tier barrel: components not yet promoted to a stable tier.
2
+ export * from "./CategoriesSection/index.js";
3
+ export * from "./ChatSection/index.js";
4
+ export * from "./DescriptionSection/index.js";
5
+ export * from "./grid/index.js";
6
+ export * from "./IconSection/index.js";
7
+ export * from "./Label/index.js";
8
+ export * from "./Link/index.js";
9
+ export * from "./Rule/index.js";
10
+ export * from "./Section/index.js";
11
+ export * from "./SkipLink/index.js";
12
+ export * from "./TSection/index.js";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/_work_in_progress/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
@@ -12,6 +12,8 @@ const componentCssClassName = "ds accordion";
12
12
  * efficient way. Be wary that they can also hide content from users and are
13
13
  * not suitable when a user is meant to read all of the page content.
14
14
  *
15
+ * `import { Accordion } from "@canonical/react-ds-global";`
16
+ *
15
17
  * @implements dso:global.component.accordion
16
18
  */
17
19
  const Accordion = ({ className, children, ...props }) => (_jsx("div", { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: children }));
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../src/lib/component/Accordion/Accordion.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,SAAS,GAAG,CAAC,EACjB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACO,EAAsB,EAAE,CAAC,CACxC,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AAEF,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAEtB,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../src/lib/component/Accordion/Accordion.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,MAAM,SAAS,GAAG,CAAC,EACjB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACO,EAAsB,EAAE,CAAC,CACxC,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AAEF,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAEtB,eAAe,SAAS,CAAC"}
@@ -105,69 +105,32 @@
105
105
  }
106
106
 
107
107
  /* The consumer supplies the heading content — plain text by default (rendered
108
- as body copy) or an optional heading element (h1–h6), which renders at its
109
- matching typography-heading tier (the real type scale). */
108
+ as the text-primary body tier) or an <h6>, which renders at the heading-6
109
+ tier. Only those two type tokens are allowed on the accordion heading; any
110
+ other heading element is normalised to the text-primary body tier. */
110
111
  .ds.accordion-item > .header > .heading {
111
112
  flex: 1;
112
113
  min-width: 0;
113
114
 
114
- /* Default: body copy for plain-text headings. */
115
+ /* Default: body copy (text-primary) for plain text and any heading element. */
115
116
  font-family: var(--typography-text-primary-font-family);
116
117
  font-size: var(--typography-text-primary-font-size);
117
118
  font-weight: var(--typography-text-primary-font-weight);
118
119
  line-height: var(--typography-text-primary-line-height);
119
120
  letter-spacing: var(--typography-text-primary-letter-spacing);
120
121
 
121
- & :is(h1, h2, h3, h4, h5, h6) {
122
+ /* Normalise every heading element except <h6> down to the inherited body
123
+ tier. <h6> is left untouched so the base h6 tier from
124
+ @canonical/styles-typography applies (correct heading-6 tokens, including
125
+ the baseline-snapped line-height) — no heading-6 tokens are restated here. */
126
+ & :is(h1, h2, h3, h4, h5) {
122
127
  margin: 0;
123
- }
124
-
125
- & h1 {
126
- font-family: var(--typography-heading-1-font-family);
127
- font-size: var(--typography-heading-1-font-size);
128
- font-weight: var(--typography-heading-1-font-weight);
129
- line-height: var(--typography-heading-1-line-height);
130
- letter-spacing: var(--typography-heading-1-letter-spacing);
131
- }
132
-
133
- & h2 {
134
- font-family: var(--typography-heading-2-font-family);
135
- font-size: var(--typography-heading-2-font-size);
136
- font-weight: var(--typography-heading-2-font-weight);
137
- line-height: var(--typography-heading-2-line-height);
138
- letter-spacing: var(--typography-heading-2-letter-spacing);
139
- }
140
-
141
- & h3 {
142
- font-family: var(--typography-heading-3-font-family);
143
- font-size: var(--typography-heading-3-font-size);
144
- font-weight: var(--typography-heading-3-font-weight);
145
- line-height: var(--typography-heading-3-line-height);
146
- letter-spacing: var(--typography-heading-3-letter-spacing);
147
- }
148
-
149
- & h4 {
150
- font-family: var(--typography-heading-4-font-family);
151
- font-size: var(--typography-heading-4-font-size);
152
- font-weight: var(--typography-heading-4-font-weight);
153
- line-height: var(--typography-heading-4-line-height);
154
- letter-spacing: var(--typography-heading-4-letter-spacing);
155
- }
156
-
157
- & h5 {
158
- font-family: var(--typography-heading-5-font-family);
159
- font-size: var(--typography-heading-5-font-size);
160
- font-weight: var(--typography-heading-5-font-weight);
161
- line-height: var(--typography-heading-5-line-height);
162
- letter-spacing: var(--typography-heading-5-letter-spacing);
128
+ font: inherit;
129
+ letter-spacing: inherit;
163
130
  }
164
131
 
165
132
  & h6 {
166
- font-family: var(--typography-heading-6-font-family);
167
- font-size: var(--typography-heading-6-font-size);
168
- font-weight: var(--typography-heading-6-font-weight);
169
- line-height: var(--typography-heading-6-line-height);
170
- letter-spacing: var(--typography-heading-6-letter-spacing);
133
+ margin: 0;
171
134
  }
172
135
  }
173
136
 
@@ -182,16 +145,22 @@
182
145
  transition: transform var(--motion-duration-fast)
183
146
  var(--motion-easing-standard);
184
147
 
148
+ /* Chevron glyph from the Canonical icon set, masked so it can take the theme
149
+ icon colour (same technique as CheckboxInput's checkmark). */
185
150
  &::before {
186
151
  content: "";
187
152
  display: block;
188
153
  width: 100%;
189
154
  height: 100%;
190
155
  background-color: var(--accordion-item-color-icon);
191
- mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M4.47 5.47a.75.75 0 0 1 1.06 0L8 7.94l2.47-2.47a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
156
+ mask-image: url("/icons/chevron-down.svg#chevron-down");
192
157
  mask-repeat: no-repeat;
193
158
  mask-position: center;
194
159
  mask-size: contain;
160
+ -webkit-mask-image: url("/icons/chevron-down.svg#chevron-down");
161
+ -webkit-mask-repeat: no-repeat;
162
+ -webkit-mask-position: center;
163
+ -webkit-mask-size: contain;
195
164
  }
196
165
  }
197
166
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Accordion styles
3
- * @implements dso:global.component.accordion
3
+ * @implements ds:global.component.accordion
4
4
  *
5
5
  * DSL anatomy mapping:
6
6
  * - layout.type: stack -> display: flex; flex-direction: column
@@ -18,6 +18,10 @@
18
18
  display: flex;
19
19
  flex-direction: column;
20
20
 
21
+ /* When placed in a grid, span all columns (inert outside a grid). The
22
+ accordion is a full-width block, not a grid cell. */
23
+ grid-column: 1 / -1;
24
+
21
25
  /* The accordion background uses the surface channel, which auto-steps with
22
26
  .surface nesting (surface 1 -> base, 2 -> layer2, 3 -> layer3). Referenced
23
27
  here on the element (not in :root) so the value resolves in the element's
@@ -1,15 +1,17 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import "./styles.css";
3
3
  const componentCssClassName = "ds announcement";
4
4
  /**
5
5
  * The announcement is a persistent, high-visibility UI block used to
6
6
  * communicate time-sensitive or critical contextual information directly within
7
7
  * a page. It is not triggered by specific system or user events; instead, it is
8
- * a non-transient call-out used for broad organizational updates, compliance
8
+ * a non-transient call-out used for broad organisational updates, compliance
9
9
  * warnings, or upcoming deadlines.
10
10
  *
11
11
  * @implements ds:global.component.announcement
12
12
  */
13
- const Announcement = ({ className, children, ...props }) => (_jsx("div", { className: [componentCssClassName, className].filter(Boolean).join(" "), role: "alert", ...props, children: children }));
13
+ const Announcement = ({ criticality = "information", heading, children, className, ...props }) => (_jsxs("div", { className: [componentCssClassName, criticality, className]
14
+ .filter(Boolean)
15
+ .join(" "), ...props, children: [_jsx("span", { className: "icon", "aria-hidden": "true" }), _jsxs("span", { className: "text", children: [heading != null && _jsx("span", { className: "heading", children: heading }), _jsx("span", { className: "content", children: children })] })] }));
14
16
  export default Announcement;
15
17
  //# sourceMappingURL=Announcement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Announcement.js","sourceRoot":"","sources":["../../../../../src/lib/component/Announcement/Announcement.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACU,EAAsB,EAAE,CAAC,CAC3C,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,IAAI,EAAC,OAAO,KACR,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"Announcement.js","sourceRoot":"","sources":["../../../../../src/lib/component/Announcement/Announcement.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAG,CAAC,EACpB,WAAW,GAAG,aAAa,EAC3B,OAAO,EACP,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACU,EAAsB,EAAE,CAAC,CAC3C,eACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,WAAW,EAAE,SAAS,CAAC;SACvD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,aAOT,eAAM,SAAS,EAAC,MAAM,iBAAa,MAAM,GAAG,EAC5C,gBAAM,SAAS,EAAC,MAAM,aACnB,OAAO,IAAI,IAAI,IAAI,eAAM,SAAS,EAAC,SAAS,YAAE,OAAO,GAAQ,EAC9D,eAAM,SAAS,EAAC,SAAS,YAAE,QAAQ,GAAQ,IACtC,IACH,CACP,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,2 +1,3 @@
1
+ // Generated by @canonical/summon-component:react v0.1.0
1
2
  export { default as Announcement } from "./Announcement.js";
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/component/Announcement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/component/Announcement/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,48 +1,72 @@
1
1
  /**
2
2
  * Announcement styles
3
- * @implements dso:global.announcement
3
+ * @implements ds:global.component.announcement
4
4
  *
5
- * DSL anatomy mapping:
6
- * layout.type: flow → display: flex
7
- * layout.direction: horizontal → flex-direction: row
8
- * layout.align: center → align-items: center
9
- * layout.justify: center → justify-content: center
10
- * size.width: fill → width: 100%
11
- * spacing.internal: spacing/medium → gap: var(--spacing-medium)
12
- * appearance.background: color/surface/announcement → background-color
13
- * [message] typography.size: font/size/small → font-size
14
- * [message] typography.color: color/text/on-announcement → color
5
+ * Criticality-wired (this pass). The `criticality` prop applies a modifier
6
+ * class (.information | .success | .warning | .error) from the criticality
7
+ * modifier family (@canonical/design-tokens → modifiers.criticality.css), which
8
+ * remaps the --modifier-color-* channels. The criticality tints the SURFACE —
9
+ * background, side bar, and icon — via those channels; the text stays the
10
+ * neutral root colour (`--color-text`) on every criticality, per Figma. The
11
+ * component restates no criticality token; it only reads channels. The default
12
+ * look comes from the `criticality="information"` prop default, which applies
13
+ * `.information` and supplies the channel values; no class ⇒ no tint, by design.
14
+ *
15
+ * The icon is driven the same way: `--modifier-icon` (a mask-image, supplied by
16
+ * @canonical/styles' criticality shim) picks the glyph for the type, and
17
+ * `--modifier-color-icon` fills it. No per-criticality markup in the component.
18
+ *
19
+ * NOTE: full token pairing (spacing, typography, radius) is deferred to ADR-Q02.
20
+ * The values below cover layout + the criticality colour surface + the side bar.
15
21
  */
16
22
 
17
- :root {
18
- --announcement-color-background: var(
19
- --color-surface-announcement,
20
- var(--color-foreground-ghost)
21
- );
22
- --announcement-color-text: var(
23
- --color-text-on-announcement,
24
- var(--color-text)
25
- );
26
- --announcement-font-size: var(--font-size-small);
27
- --announcement-color-border: var(--color-border);
28
- --announcement-padding-vertical: var(--spacing-input-padding-vertical);
29
- --announcement-padding-horizontal: var(--spacing-horizontal-large);
30
- --announcement-border-width: var(--spacing-border-width);
31
- }
32
-
33
23
  .ds.announcement {
34
24
  display: flex;
35
25
  flex-direction: row;
36
- align-items: center;
37
- justify-content: center;
26
+ align-items: flex-start;
27
+ gap: var(--dimension-100);
28
+
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);
33
+
34
+ padding: var(--dimension-100);
35
+
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);
38
41
 
39
- color: var(--announcement-color-text);
40
- background-color: var(--announcement-color-background);
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
+ }
41
60
 
42
- border-style: solid;
43
- border-color: var(--announcement-color-border);
44
- border-width: var(--announcement-border-width);
61
+ & > .text {
62
+ display: flex;
63
+ flex: 1 1 auto;
64
+ flex-direction: column;
65
+ gap: var(--dimension-050);
66
+ min-width: 0;
67
+ }
45
68
 
46
- font-size: var(--announcement-font-size, var(--font-size-small, 0.75rem));
47
- padding: var(--announcement-padding, var(--spacing-medium, 1rem));
69
+ & .heading {
70
+ font-weight: var(--typography-text-primary-bold-font-weight);
71
+ }
48
72
  }
@@ -13,6 +13,8 @@ const componentCssClassName = "ds breadcrumbs";
13
13
  * applications with multiple levels of hierarchy and are particularly useful
14
14
  * when users might arrive at deep pages through search or external links.
15
15
  *
16
+ * `import { Breadcrumbs } from "@canonical/react-ds-global";`
17
+ *
16
18
  * @implements ds:global.pattern.breadcrumbs
17
19
  */
18
20
  const Breadcrumbs = ({ items, separator = "/", LinkComponent = "a", className, "aria-label": ariaLabel = "Breadcrumb", ...props }) => (_jsx("nav", { className: [componentCssClassName, className].filter(Boolean).join(" "), "aria-label": ariaLabel, ...props, children: _jsx("ol", { className: "list p", children: items.map((item) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../../../../../src/lib/component/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAE/C;;;;;;;;;;;GAW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AG,GAAG,EACnB,SAAS,EACT,YAAY,EAAE,SAAS,GAAG,YAAY,EACtC,GAAG,KAAK,EACS,EAAsB,EAAE,CAAC,CAC1C,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAC3D,SAAS,KACjB,KAAK,YAET,aAAI,SAAS,EAAC,QAAQ,YACnB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAChC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,CAAC;YACzC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;YAE7C,+CAA+C;YAC/C,yCAAyC;YACzC,OAAO,CACL,KAAC,aAAa,IAEZ,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,KACxB,SAAS,IAHR,OAAO,CAIZ,CACH,CAAC;QACJ,CAAC,CAAC,GACC,GACD,CACP,CAAC;AAEF,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;AAExB,eAAe,WAAW,CAAC"}
@@ -11,7 +11,7 @@ const componentCssClassName = "ds breadcrumbs-item";
11
11
  */
12
12
  const Item = ({ children, label, url, current = false, separator = "/", disabled = false, className, LinkComponent = "a",
13
13
  // Destructure Item props we don't spread to DOM
14
- key: _key, items: _items, displayItemsType: _displayItemsType, Component: _Component, ...props }) => {
14
+ key: _key, items: _items, Component: _Component, ...props }) => {
15
15
  const content = children ?? label;
16
16
  const Link = LinkComponent;
17
17
  return (_jsxs("li", { className: [componentCssClassName, current && "current", className]
@@ -1 +1 @@
1
- {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../../../../src/lib/component/Breadcrumbs/common/Item/Item.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ,EACR,KAAK,EACL,GAAG,EACH,OAAO,GAAG,KAAK,EACf,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,aAAa,GAAG,GAAG;AACnB,gDAAgD;AAChD,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,iBAAiB,EACnC,SAAS,EAAE,UAAU,EACrB,GAAG,KAAK,EACE,EAAsB,EAAE;IAClC,MAAM,OAAO,GAAG,QAAQ,IAAI,KAAK,CAAC;IAClC,MAAM,IAAI,GAAG,aAAa,CAAC;IAE3B,OAAO,CACL,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,OAAO,IAAI,SAAS,EAAE,SAAS,CAAC;aAChE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,aAGR,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,CACrB,eAAM,SAAS,EAAC,MAAM,kBAAe,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAC9D,OAAO,GACH,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAE,GAAG,YAC7B,OAAO,GACH,CACR,EAED,eAAM,SAAS,EAAC,WAAW,iBAAa,MAAM,YAC3C,SAAS,GACL,IACJ,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAEtC,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../../../../src/lib/component/Breadcrumbs/common/Item/Item.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ,EACR,KAAK,EACL,GAAG,EACH,OAAO,GAAG,KAAK,EACf,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,aAAa,GAAG,GAAG;AACnB,gDAAgD;AAChD,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,UAAU,EACrB,GAAG,KAAK,EACE,EAAsB,EAAE;IAClC,MAAM,OAAO,GAAG,QAAQ,IAAI,KAAK,CAAC;IAClC,MAAM,IAAI,GAAG,aAAa,CAAC;IAE3B,OAAO,CACL,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,OAAO,IAAI,SAAS,EAAE,SAAS,CAAC;aAChE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,aAGR,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,CACrB,eAAM,SAAS,EAAC,MAAM,kBAAe,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAC9D,OAAO,GACH,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAE,GAAG,YAC7B,OAAO,GACH,CACR,EAED,eAAM,SAAS,EAAC,WAAW,iBAAa,MAAM,YAC3C,SAAS,GACL,IACJ,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAEtC,eAAe,IAAI,CAAC"}
@@ -1,4 +1,5 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Spinner } from "../../subcomponent/Spinner/index.js";
2
3
  import "./styles.css";
3
4
  const componentCssClassName = "ds button";
4
5
  /**
@@ -6,30 +7,37 @@ const componentCssClassName = "ds button";
6
7
  * data transformation or manipulation. They provide clear visual
7
8
  * indicators of the primary actions users can perform.
8
9
  *
10
+ * `import { Button } from "@canonical/react-ds-global";`
11
+ *
9
12
  * @implements ds:global.component.button
10
13
  */
11
- const Button = ({ id, className, children, style, importance, anticipation, variant, icon, iconPosition = "start", ...props }) => {
14
+ const Button = ({ id, className, children, style, importance = "primary", anticipation, variant, icon, loading = false, disabled, ...props }) => {
12
15
  // Booleans and nullish children render nothing; everything else (including
13
16
  // the number 0) produces visible text that names the button.
14
17
  const hasVisibleChildren = children != null && typeof children !== "boolean" && children !== "";
15
18
  if (typeof process !== "undefined" &&
16
19
  process.env.NODE_ENV !== "production" &&
17
- icon &&
20
+ (icon || loading) &&
18
21
  !hasVisibleChildren &&
19
22
  !props["aria-label"] &&
20
23
  !props["aria-labelledby"]) {
21
24
  console.warn("Button: icon-only buttons need an explicit `aria-label` or `aria-labelledby` to be accessible.");
22
25
  }
23
26
  const iconElement = icon && _jsx("span", { className: "icon", children: icon });
24
- return (_jsx("button", { id: id, className: [
27
+ return (_jsxs("button", { id: id, className: [
25
28
  componentCssClassName,
29
+ // The `.p` baseline utility supplies the body-text tier (font, snapped
30
+ // line-height) and the padding-block nudges that align the button box
31
+ // to the baseline grid — so the box height tracks the text inside.
32
+ "p",
26
33
  importance,
27
34
  anticipation,
28
35
  variant,
36
+ loading && "loading",
29
37
  className,
30
38
  ]
31
39
  .filter(Boolean)
32
- .join(" "), style: style, ...props, children: iconPosition === "start" ? (_jsxs(_Fragment, { children: [iconElement, children] })) : (_jsxs(_Fragment, { children: [children, iconElement] })) }));
40
+ .join(" "), style: style, "aria-busy": loading || undefined, disabled: disabled || loading, ...props, children: [iconElement, hasVisibleChildren && _jsx("span", { className: "label", children: children }), loading && (_jsx("span", { className: "loading-spinner", "aria-hidden": "true", children: _jsx(Spinner, {}) }))] }));
33
41
  };
34
42
  export default Button;
35
43
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/lib/component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