@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
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { getItemId } from "@canonical/utils";
2
+ import { getItemId } from "@canonical/ds-utils";
3
3
  import { useMemo } from "react";
4
4
  import { createPortal } from "react-dom";
5
5
  import { MENU_ROOT_PLACEMENT, useContextualMenu, useIsMounted, } from "../../hooks/index.js";
@@ -8,20 +8,19 @@ import SubMenu from "./common/SubMenu/index.js";
8
8
  import "./styles.css";
9
9
  const componentCssClassName = "ds contextual-menu";
10
10
  /**
11
- * A contextual menu presents a list of grouped actions anchored to a trigger.
12
- * It opens on click, positions itself with viewport-fitment, and supports full
13
- * keyboard navigation including arrow traversal across groups.
11
+ * A contextual menu presents a flat list of actions — optionally partitioned
12
+ * by separators — anchored to a trigger. It opens on click, positions itself
13
+ * with viewport-fitment, and supports full keyboard navigation.
14
14
  *
15
15
  * `import { ContextualMenu } from "@canonical/react-ds-global";`
16
16
  *
17
17
  * @implements ds:global.component.contextual_menu
18
18
  */
19
- const ContextualMenu = ({ trigger, groups, label, className, preferredDirections, distance, gutter, maxWidth, autoFit, wrap, onSelect, open, onOpenChange, ...props }) => {
20
- // A synthetic root holds the groups so the tree is menu -> group -> item.
21
- // MUST be stable across renders: the hook annotates it (memoised on `root`)
22
- // and the open effect keys on the annotated root, so a fresh object each
23
- // render re-fires that effect every render → dispatch → re-render → freeze.
24
- const root = useMemo(() => ({ key: "contextual-menu-root", items: groups }), [groups]);
19
+ const ContextualMenu = ({ trigger, items, label, className, preferredDirections, distance, gutter, maxWidth, autoFit, wrap, onSelect, open, onOpenChange, ...props }) => {
20
+ // A synthetic root holds the entries so the tree is menu -> item.
21
+ // MUST be stable across renders: the hook annotates it (memoised on `root`),
22
+ // so a fresh object each render would re-annotate the tree every render.
23
+ const root = useMemo(() => ({ key: "contextual-menu-root", items }), [items]);
25
24
  // Portal only after mount so the server and first client render agree —
26
25
  // `typeof window` is already truthy on the first client render, which would
27
26
  // portal the menu on render 0 and mismatch the inline server output.
@@ -38,13 +37,15 @@ const ContextualMenu = ({ trigger, groups, label, className, preferredDirections
38
37
  gutter,
39
38
  maxWidth,
40
39
  autoFit: autoFit ?? true,
41
- wrap,
40
+ // Menus conventionally wrap: ArrowDown on the last item loops to the
41
+ // first (APG menu pattern). Opt out with `wrap={false}`.
42
+ wrap: wrap ?? true,
42
43
  onShow: () => onOpenChange?.(true),
43
44
  onHide: () => onOpenChange?.(false),
44
45
  });
45
- const { isOpen, close, targetRef, popupRef, popupPositionStyle, popupId, bestPosition, annotatedRoot, getNodeStatus, highlightItem, getTriggerProps, getMenuProps, getGroupProps, getItemProps, } = menu;
46
+ const { isOpen, close, targetRef, popupRef, popupPositionStyle, popupId, bestPosition, annotatedRoot, getNodeStatus, highlightItem, getTriggerProps, getMenuProps, getItemProps, } = menu;
46
47
  const triggerProps = getTriggerProps();
47
- const annotatedGroups = annotatedRoot.items ?? [];
48
+ const annotatedEntries = annotatedRoot.items ?? [];
48
49
  // The shared menu API threaded to every (nested) level. One state, one
49
50
  // highlight path, one keyboard handler — submenus are render-only. Memoised so
50
51
  // the context value is stable across renders; an unstable value would re-render
@@ -52,10 +53,13 @@ const ContextualMenu = ({ trigger, groups, label, className, preferredDirections
52
53
  const menuContextValue = useMemo(() => ({
53
54
  getItemProps,
54
55
  getMenuProps,
55
- getGroupProps,
56
56
  getNodeStatus,
57
57
  highlightItem,
58
58
  close,
59
+ // Submenus gate their own visibility on the ROOT open state: their
60
+ // hover state is local, so without this a mouse-selected nested leaf
61
+ // would close the root surface while the hovered submenu stayed up.
62
+ isOpen,
59
63
  onSelectItem: (item) => {
60
64
  onSelect?.(item);
61
65
  close();
@@ -63,10 +67,10 @@ const ContextualMenu = ({ trigger, groups, label, className, preferredDirections
63
67
  }), [
64
68
  getItemProps,
65
69
  getMenuProps,
66
- getGroupProps,
67
70
  getNodeStatus,
68
71
  highlightItem,
69
72
  close,
73
+ isOpen,
70
74
  onSelect,
71
75
  ]);
72
76
  // With no explicit `label`, the menu is named by its trigger — so the trigger
@@ -82,15 +86,20 @@ const ContextualMenu = ({ trigger, groups, label, className, preferredDirections
82
86
  ref: popupRef,
83
87
  });
84
88
  const menuElement = (_jsx("div", { className: [
85
- `${componentCssClassName}__surface`,
89
+ // Spelled out rather than interpolated from componentCssClassName: the
90
+ // portal target sits outside the caller's subtree, so this root marks
91
+ // its own pragma territory, and that must not depend on another
92
+ // constant keeping its "ds " prefix. SubMenu.tsx does the same.
93
+ "ds",
94
+ "contextual-menu__surface",
86
95
  "modal",
87
96
  bestPosition?.positionName,
88
97
  ]
89
98
  .filter(Boolean)
90
- .join(" "), id: popupId, "aria-hidden": !isOpen, style: popupPositionStyle, ...menuProps, children: annotatedGroups.map((group) => (_jsx("div", { className: "group", ...getGroupProps({ label: group.label }), children: (group.items ?? []).map((item) => (
91
- // SubMenu renders the item and, if it is a submenu parent, its
92
- // nested popup (recursively). Leaves render as a plain item.
93
- _jsx(SubMenu, { item: item }, getItemId(item)))) }, getItemId(group)))) }));
99
+ .join(" "), id: popupId, "aria-hidden": !isOpen, style: popupPositionStyle, ...menuProps, children: annotatedEntries.map((entry) => (
100
+ // SubMenu renders a separator as a divider, a submenu parent as the
101
+ // item plus its nested popup (recursively), and a leaf as a plain item.
102
+ _jsx(SubMenu, { item: entry }, getItemId(entry)))) }));
94
103
  return (_jsx(MenuContext.Provider, { value: menuContextValue, children: _jsxs("div", { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: [_jsx("button", { type: "button", id: triggerId, className: "trigger", ref: targetRef, ...triggerProps, children: trigger }), mounted ? createPortal(menuElement, document.body) : menuElement] }) }));
95
104
  };
96
105
  export default ContextualMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"ContextualMenu.js","sourceRoot":"","sources":["../../../../../src/lib/component/ContextualMenu/ContextualMenu.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,OAAO,MAAM,2BAA2B,CAAC;AAEhD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAG,CAAC,EACtB,OAAO,EACP,MAAM,EACN,KAAK,EACL,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,GAAG,KAAK,EACY,EAAsB,EAAE;IAC5C,0EAA0E;IAC1E,4EAA4E;IAC5E,yEAAyE;IACzE,4EAA4E;IAC5E,MAAM,IAAI,GAAG,OAAO,CAClB,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EACtD,CAAC,MAAM,CAAC,CACT,CAAC;IACF,wEAAwE;IACxE,4EAA4E;IAC5E,qEAAqE;IACrE,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,IAA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,CAAC,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,IAC7D,GACe,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ContextualMenu.js","sourceRoot":"","sources":["../../../../../src/lib/component/ContextualMenu/ContextualMenu.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,OAAO,MAAM,2BAA2B,CAAC;AAEhD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAG,CAAC,EACtB,OAAO,EACP,KAAK,EACL,KAAK,EACL,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,GAAG,KAAK,EACY,EAAsB,EAAE;IAC5C,kEAAkE;IAClE,6EAA6E;IAC7E,yEAAyE;IACzE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,wEAAwE;IACxE,4EAA4E;IAC5E,qEAAqE;IACrE,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,iBAAiB,CAAC;QAC7B,IAAI;QACJ,MAAM,EAAE,IAAI;QACZ,2EAA2E;QAC3E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item = ({ item, itemProps, onSelect }) => {
14
14
  const { label, disabled, slot, icon, className, displayItemsType, Component, items, } = item;
15
15
  // An item with children is a submenu trigger; it shows a trailing caret.
16
16
  const hasSubmenu = !!items?.length;
17
+ // A submenu parent is NOT selectable — activating it opens its submenu
18
+ // (handled by the navigation hook's ArrowRight/click), it does not fire
19
+ // `onSelect` like a leaf. Only enabled leaves select.
20
+ const isSelectable = !disabled && !hasSubmenu;
17
21
  const handleKeyDown = (event) => {
18
22
  if (event.key === "Enter" || event.key === " ") {
23
+ // Stop the Space/Enter from also reaching the menu container's key handler
24
+ // (where a bare Space would otherwise start a typeahead search).
25
+ event.stopPropagation();
26
+ // Always suppress the browser default — on a focusable div a bare Space
27
+ // scrolls the page, so a "no-op" on a disabled item or submenu parent
28
+ // would not actually be a no-op. Only a selectable leaf activates.
19
29
  event.preventDefault();
20
- if (!disabled)
30
+ if (isSelectable) {
21
31
  onSelect();
32
+ }
22
33
  }
23
34
  };
35
+ // Selecting a LEAF fires `onSelect` in addition to the navigation state update
36
+ // already wired by `itemProps.onClick` (which highlights the item / opens a
37
+ // submenu on hover). A submenu parent is not choosable, so it only runs the
38
+ // navigation handler — clicking/hovering it highlights it and shows its
39
+ // submenu, but it never fires `onSelect`. `itemProps` is loosely typed
40
+ // (`Record<string, unknown>`), so narrow its click handler before calling.
41
+ const navOnClick = itemProps?.onClick;
42
+ const handleClick = (event) => {
43
+ navOnClick?.(event);
44
+ if (isSelectable)
45
+ onSelect();
46
+ };
24
47
  const content = displayItemsType === "custom" && Component ? (_jsx(Component, { item: item })) : (_jsxs(_Fragment, { children: [icon ? _jsx("span", { className: "icon", children: icon }) : null, _jsx("span", { className: "label", children: label }), slot ? _jsx("span", { className: "slot", children: slot }) : null, hasSubmenu ? (_jsx("span", { className: "caret", "aria-hidden": "true", children: _jsx(Icon, { icon: "chevron-right" }) })) : null] }));
25
48
  return (
26
49
  // biome-ignore lint/a11y/noStaticElementInteractions: the div carries role="menuitem" (from itemProps) with roving tabindex, the correct WAI-ARIA menu pattern (a <button> cannot be a menuitem)
27
50
  _jsx("div", { className: [componentCssClassName, disabled && "disabled", className]
28
51
  .filter(Boolean)
29
- .join(" "), ...itemProps, onClick: disabled ? undefined : onSelect, onKeyDown: handleKeyDown, children: content }));
52
+ .join(" "), ...itemProps, onClick: handleClick, onKeyDown: handleKeyDown, children: content }));
30
53
  };
31
54
  export default Item;
32
55
  //# sourceMappingURL=Item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../../../../src/lib/component/ContextualMenu/common/Item/Item.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAa,EAAsB,EAAE;IAC5E,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,KAAK,GACN,GAAG,IAAI,CAAC;IAET,yEAAyE;IACzE,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC;IAEnC,MAAM,aAAa,GAAG,CAAC,KAA0B,EAAE,EAAE;QACnD,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YAC/C,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,QAAQ;gBAAE,QAAQ,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,OAAO,GACX,gBAAgB,KAAK,QAAQ,IAAI,SAAS,CAAC,CAAC,CAAC,CAC3C,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,GAAI,CAC1B,CAAC,CAAC,CAAC,CACF,8BAEG,IA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IlD,UAAU,CAAC,CAAC,CAAC,CACZ,eAAM,SAAS,EAAC,OAAO,iBAAa,MAAM,YACxC,KAAC,IAAI,IAAC,IAAI,EAAC,eAAe,GAAG,GACxB,CACR,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;IAEJ,OAAO;IACL,iMAAiM;IACjM,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,QAAQ,IAAI,UAAU,EAAE,SAAS,CAAC;aAClE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACR,SAAS,EACb,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,YAEvB,OAAO,GACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,121 +1,131 @@
1
- /* Component tokens — sourced from @canonical/design-tokens.
2
- Mapped strictly to the Figma "Contextual menu item" frame:
3
- px = dimension-200 (16px), py = dimension-050 (4px), gap = dimension-050 (4px)
4
- between icon<->text and text<->caret, text = color-text (black),
5
- fills = color-foreground-ghost/-active, line-height 24px.
6
- No min-height — the item is padding + line-height. */
7
- :root {
8
- --contextual-menu-item-color-text: var(--color-text);
9
- --contextual-menu-item-color-text-disabled: var(--color-text-disabled);
10
- --contextual-menu-item-color-background: var(--color-foreground-ghost);
11
- --contextual-menu-item-color-background-hover: var(
12
- --color-foreground-ghost-hover
13
- );
14
- --contextual-menu-item-color-background-active: var(
15
- --color-foreground-ghost-active
16
- );
17
- --contextual-menu-item-padding-block: var(--dimension-050);
18
- --contextual-menu-item-padding-inline: var(--dimension-200);
19
- /* 4px gap: icon<->text and text<->caret (per the spec). */
20
- --contextual-menu-item-gap: var(--dimension-050);
21
- /* De-emphasised slot text (badge / shortcut) — muted, matching
22
- KeyboardKey / Tabs. */
23
- --contextual-menu-item-slot-color: var(--color-text-muted);
24
- /* Keyboard focus ring (Button precedent) — the semantic focus-ring colour,
25
- with a currentColor backstop should the theme layer not be loaded. */
26
- --contextual-menu-item-focus-ring-color: var(--color-focusRing, currentColor);
27
- --contextual-menu-item-focus-ring-width: var(
28
- --dimension-stroke-thickness-large
29
- );
30
- }
31
-
32
- .ds.contextual-menu-item {
33
- display: flex;
34
- /* Icon and first line of text are centre-aligned (Figma annotation). */
35
- align-items: center;
36
- gap: var(--contextual-menu-item-gap);
37
- padding-block: var(--contextual-menu-item-padding-block);
38
- padding-inline: var(--contextual-menu-item-padding-inline);
39
- color: var(--contextual-menu-item-color-text);
40
- background-color: var(--contextual-menu-item-color-background);
41
- /* The --dimension-300 (24px) fallback is load-bearing: the typography var's
42
- --number-line-height-* reference is unresolved in the built tokens. */
43
- line-height: var(--typography-text-primary-line-height, var(--dimension-300));
44
- cursor: pointer;
45
- user-select: none;
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
46
2
 
47
- &:hover {
48
- background-color: var(--contextual-menu-item-color-background-hover);
3
+ @layer ds.components.global {
4
+ /* Component tokens — sourced from @canonical/design-tokens.
5
+ Mapped strictly to the Figma "Contextual menu item" frame:
6
+ px = dimension-200 (16px), py = dimension-050 (4px), gap = dimension-050 (4px)
7
+ between icon<->text and text<->caret, text = color-text (black),
8
+ fills = color-foreground-ghost/-active, line-height 24px.
9
+ No min-height — the item is padding + line-height. */
10
+ :root {
11
+ --contextual-menu-item-color-text: var(--color-text);
12
+ --contextual-menu-item-color-text-disabled: var(--color-text-disabled);
13
+ --contextual-menu-item-color-background: var(--color-foreground-ghost);
14
+ --contextual-menu-item-color-background-hover: var(
15
+ --color-foreground-ghost-hover
16
+ );
17
+ --contextual-menu-item-color-background-active: var(
18
+ --color-foreground-ghost-active
19
+ );
20
+ --contextual-menu-item-padding-block: var(--dimension-050);
21
+ --contextual-menu-item-padding-inline: var(--dimension-200);
22
+ /* 4px gap: icon<->text and text<->caret (per the spec). */
23
+ --contextual-menu-item-gap: var(--dimension-050);
24
+ /* De-emphasised slot text (badge / shortcut) — muted, matching
25
+ KeyboardKey / Tabs. */
26
+ --contextual-menu-item-slot-color: var(--color-text-muted);
27
+ /* Keyboard focus ring (Button precedent) — the semantic focus-ring colour,
28
+ with a currentColor backstop should the theme layer not be loaded. */
29
+ --contextual-menu-item-focus-ring-color: var(
30
+ --color-focus-ring,
31
+ currentColor
32
+ );
33
+ --contextual-menu-item-focus-ring-width: var(
34
+ --dimension-stroke-thickness-large
35
+ );
49
36
  }
50
37
 
51
- /* The highlighted (roving) item shows the active fill — matching the Figma
52
- "Active" state. */
53
- &:focus-visible,
54
- &[tabindex="0"] {
55
- background-color: var(--contextual-menu-item-color-background-active);
56
- outline: none;
57
- }
38
+ .ds.contextual-menu-item {
39
+ display: flex;
40
+ /* Icon and first line of text are centre-aligned (Figma annotation). */
41
+ align-items: center;
42
+ gap: var(--contextual-menu-item-gap);
43
+ padding-block: var(--contextual-menu-item-padding-block);
44
+ padding-inline: var(--contextual-menu-item-padding-inline);
45
+ color: var(--contextual-menu-item-color-text);
46
+ background-color: var(--contextual-menu-item-color-background);
47
+ /* The --dimension-300 (24px) fallback is load-bearing: the typography var's
48
+ --number-line-height-* reference is unresolved in the built tokens. */
49
+ line-height: var(
50
+ --typography-text-primary-line-height,
51
+ var(--dimension-300)
52
+ );
53
+ cursor: pointer;
54
+ user-select: none;
58
55
 
59
- /* The active fill alone is ~1.2:1 against the resting item — below the 3:1
60
- non-text minimum — so keyboard focus additionally draws a ring (WCAG
61
- 1.4.11 / 2.4.13). Inset (negative offset) so the popup surface's
62
- `overflow-y: auto` never clips it; :focus-visible only, so pointer users
63
- keep the quiet Figma look. Deliberately diverges from the Figma "Active"
64
- state, which fails WCAG. */
65
- &:focus-visible {
66
- outline: var(--contextual-menu-item-focus-ring-width) solid
67
- var(--contextual-menu-item-focus-ring-color);
68
- outline-offset: calc(-1 * var(--contextual-menu-item-focus-ring-width));
69
- }
56
+ &:hover {
57
+ background-color: var(--contextual-menu-item-color-background-hover);
58
+ }
70
59
 
71
- > .label {
72
- flex: 1 1 auto;
73
- }
60
+ /* The highlighted (roving) item shows the active fill — matching the Figma
61
+ "Active" state. */
62
+ &:focus-visible,
63
+ &[tabindex="0"] {
64
+ background-color: var(--contextual-menu-item-color-background-active);
65
+ outline: none;
66
+ }
74
67
 
75
- /* The slot (badge / keyboard shortcut) sits right-aligned. */
76
- > .slot {
77
- flex: 0 0 auto;
78
- margin-inline-start: auto;
79
- color: var(--contextual-menu-item-slot-color);
80
- }
68
+ /* The active fill alone is ~1.2:1 against the resting item — below the 3:1
69
+ non-text minimum — so keyboard focus additionally draws a ring (WCAG
70
+ 1.4.11 / 2.4.13). Inset (negative offset) so the popup surface's
71
+ `overflow-y: auto` never clips it; :focus-visible only, so pointer users
72
+ keep the quiet Figma look. Deliberately diverges from the Figma "Active"
73
+ state, which fails WCAG. */
74
+ &:focus-visible {
75
+ outline: var(--contextual-menu-item-focus-ring-width) solid
76
+ var(--contextual-menu-item-focus-ring-color);
77
+ outline-offset: calc(-1 * var(--contextual-menu-item-focus-ring-width));
78
+ }
81
79
 
82
- /* The submenu caret sits on the trailing edge in a fixed icon box (Figma:
83
- 16px chevron in a 24px-tall wrapper). It always follows the reading
84
- direction — chevron-right in LTR, mirrored to point left in RTL — rather
85
- than flipping per-item with the side the submenu opens on, so sibling carets
86
- stay consistent. */
87
- > .caret {
88
- flex: 0 0 auto;
89
- margin-inline-start: auto;
90
- display: inline-flex;
91
- align-items: center;
92
- justify-content: center;
93
- inline-size: var(--dimension-200);
94
- block-size: var(--dimension-300);
80
+ > .label {
81
+ flex: 1 1 auto;
82
+ }
95
83
 
96
- & > svg {
97
- inline-size: var(--dimension-200, 16px);
98
- block-size: var(--dimension-200, 16px);
84
+ /* The slot (badge / keyboard shortcut) sits right-aligned. */
85
+ > .slot {
86
+ flex: 0 0 auto;
87
+ margin-inline-start: auto;
88
+ color: var(--contextual-menu-item-slot-color);
99
89
  }
100
- }
101
90
 
102
- &.disabled {
103
- color: var(--contextual-menu-item-color-text-disabled);
104
- background-color: var(--contextual-menu-item-color-background);
105
- cursor: not-allowed;
106
- pointer-events: none;
91
+ /* The submenu caret sits on the trailing edge in a fixed icon box (Figma:
92
+ 16px chevron in a 24px-tall wrapper). It always follows the reading
93
+ direction — chevron-right in LTR, mirrored to point left in RTL — rather
94
+ than flipping per-item with the side the submenu opens on, so sibling carets
95
+ stay consistent. */
96
+ > .caret {
97
+ flex: 0 0 auto;
98
+ margin-inline-start: auto;
99
+ display: inline-flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ inline-size: var(--dimension-200);
103
+ block-size: var(--dimension-300);
107
104
 
108
- /* The slot follows the disabled text colour instead of staying muted. */
109
- > .slot {
110
- color: inherit;
105
+ & > svg {
106
+ inline-size: var(--dimension-200, 16px);
107
+ block-size: var(--dimension-200, 16px);
108
+ }
109
+ }
110
+
111
+ &.disabled {
112
+ color: var(--contextual-menu-item-color-text-disabled);
113
+ background-color: var(--contextual-menu-item-color-background);
114
+ cursor: not-allowed;
115
+ pointer-events: none;
116
+
117
+ /* The slot follows the disabled text colour instead of staying muted. */
118
+ > .slot {
119
+ color: inherit;
120
+ }
111
121
  }
112
122
  }
113
- }
114
123
 
115
- /* Mirror the `›` caret glyph to `‹` for right-to-left reading. Keyed on any
116
- `[dir="rtl"]` ANCESTOR of the item — which, because the menu is portalled to
117
- the body, must be `<html>` or `<body>` (a wrapper `<div dir>` is escaped by
118
- the portal). Set `dir="rtl"` on `<html>` (or `<body>`) and it mirrors. */
119
- [dir="rtl"] .ds.contextual-menu-item > .caret {
120
- transform: scaleX(-1);
124
+ /* Mirror the `›` caret glyph to `‹` for right-to-left reading. Keyed on any
125
+ `[dir="rtl"]` ANCESTOR of the item — which, because the menu is portalled to
126
+ the body, must be `<html>` or `<body>` (a wrapper `<div dir>` is escaped by
127
+ the portal). Set `dir="rtl"` on `<html>` (or `<body>`) and it mirrors. */
128
+ [dir="rtl"] .ds.contextual-menu-item > .caret {
129
+ transform: scaleX(-1);
130
+ }
121
131
  }
@@ -1,19 +1,25 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { getItemId } from "@canonical/utils";
2
+ import { getItemId } from "@canonical/ds-utils";
3
3
  import { useEffect, useId, useRef, useState } from "react";
4
4
  import { createPortal } from "react-dom";
5
- import { MENU_PLACEMENT, useIsMounted, useWindowFitment, } from "../../../../hooks/index.js";
5
+ import { isMenuSeparator, MENU_PLACEMENT, useIsMounted, useWindowFitment, } from "../../../../hooks/index.js";
6
6
  import Item from "../Item/index.js";
7
7
  import { useMenuContext } from "../MenuContext.js";
8
8
  /**
9
- * One node in a (possibly nested) contextual menu. A leaf renders a plain item;
10
- * a submenu parent renders the item plus a positioned nested popup for its
11
- * children (see {@link SubMenuParent}). The hook that positions the popup runs
12
- * ONLY for submenu parents — leaves render a bare item — so a menu of leaves
13
- * spins up no positioning machinery.
9
+ * One node in a (possibly nested) contextual menu. A separator renders as a
10
+ * plain divider (no item props — it is not interactive, and the navigation
11
+ * tree never highlights it); a leaf renders a plain item; a submenu parent
12
+ * renders the item plus a positioned nested popup for its children (see
13
+ * {@link SubMenuParent}). The hook that positions the popup runs ONLY for
14
+ * submenu parents — leaves render a bare item — so a menu of leaves spins up
15
+ * no positioning machinery.
14
16
  */
15
17
  const SubMenu = ({ item }) => {
16
18
  const { getItemProps, onSelectItem } = useMenuContext();
19
+ if (isMenuSeparator(item)) {
20
+ // <hr> carries the implicit `role="separator"` WAI-ARIA menus expect.
21
+ return _jsx("hr", { className: "separator" });
22
+ }
17
23
  if (item.items?.length) {
18
24
  return _jsx(SubMenuParent, { item: item });
19
25
  }
@@ -30,7 +36,11 @@ const SubMenu = ({ item }) => {
30
36
  * alignment as space runs out.
31
37
  */
32
38
  const SubMenuParent = ({ item }) => {
33
- const { getItemProps, getMenuProps, getNodeStatus, onSelectItem } = useMenuContext();
39
+ const { getItemProps, getMenuProps, getNodeStatus, onSelectItem, isOpen } = useMenuContext();
40
+ // `_Item<MenuItem>` re-types annotated children with the single member, but
41
+ // a submenu's children genuinely include separators at runtime (the hook's
42
+ // prepareEntry recurses into submenus). State the heterogeneous truth
43
+ // explicitly so readers of `children` are prompted to handle separators.
34
44
  const children = item.items ?? [];
35
45
  const status = getNodeStatus(item);
36
46
  // The submenu is keyboard-open when the highlight is in a DESCENDANT of this
@@ -39,10 +49,20 @@ const SubMenuParent = ({ item }) => {
39
49
  // (which moves the highlight back onto the parent) would leave the submenu open.
40
50
  const keyboardOpen = status.inHighlightedBranch && !status.highlighted;
41
51
  const [hovered, setHovered] = useState(false);
42
- const open = keyboardOpen || hovered;
52
+ // Gate on the ROOT open state: `hovered` is local, so a mouse-selected
53
+ // nested leaf (which closes the root disclosure) would otherwise leave the
54
+ // still-hovered submenu surface mounted and visible on its own.
55
+ const open = isOpen && (keyboardOpen || hovered);
43
56
  // Portal only after mount so the server and first client render agree —
44
57
  // `typeof window` is already truthy on the first client render.
45
58
  const mounted = useIsMounted();
59
+ // The pointer never "leaves" a surface that is hidden under it, so clear
60
+ // the hover state when the menu closes — otherwise the submenu would pop
61
+ // straight open the next time the menu opens.
62
+ useEffect(() => {
63
+ if (!isOpen)
64
+ setHovered(false);
65
+ }, [isOpen]);
46
66
  // MENU_PLACEMENT is a stable module constant and logical, so the hook mirrors
47
67
  // it in RTL from this item's own writing direction — no per-submenu dir read.
48
68
  const { targetRef, popupRef, popupPositionStyle, bestPosition } = useWindowFitment({ preferredDirections: MENU_PLACEMENT, autoFit: true });
@@ -1 +1 @@
1
- {"version":3,"file":"SubMenu.js","sourceRoot":"","sources":["../../../../../../../src/lib/component/ContextualMenu/common/SubMenu/SubMenu.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAqB,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAE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AK,CAAC,CAAiB,CAChD,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;IAET,OAAO,CACL,eACE,SAAS,EAAC,gBAAgB,EAC1B,cAAc,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EACtC,cAAc,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,aAEvC,KAAC,IAAI,IACH,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,GAClC,EACD,cAAc,IAAI,OAAO;gBACxB,CAAC,CAAC,YAAY,CAAC,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC;gBAC7C,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"SubMenu.js","sourceRoot":"","sources":["../../../../../../../src/lib/component/ContextualMenu/common/SubMenu/SubMenu.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAqB,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAA8B,EAAgB,EAAE;IACrE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAC;IAExD,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,sEAAsE;QACtE,OAA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