@canonical/react-ds-global 0.29.1 → 0.31.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 (308) 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/common/Item/styles.css +73 -56
  7. package/dist/esm/lib/component/Accordion/styles.css +5 -1
  8. package/dist/esm/lib/component/Announcement/Announcement.js +5 -3
  9. package/dist/esm/lib/component/Announcement/Announcement.js.map +1 -1
  10. package/dist/esm/lib/component/Announcement/index.js +1 -0
  11. package/dist/esm/lib/component/Announcement/index.js.map +1 -1
  12. package/dist/esm/lib/component/Announcement/styles.css +60 -36
  13. package/dist/esm/lib/component/Badge/styles.css +25 -24
  14. package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js +2 -2
  15. package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js +13 -3
  16. package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js.map +1 -1
  17. package/dist/esm/lib/component/Breadcrumbs/common/Item/styles.css +17 -5
  18. package/dist/esm/lib/component/Breadcrumbs/styles.css +3 -0
  19. package/dist/esm/lib/component/Button/Button.js +13 -6
  20. package/dist/esm/lib/component/Button/Button.js.map +1 -1
  21. package/dist/esm/lib/component/Button/styles.css +200 -38
  22. package/dist/esm/lib/component/Card/Card.js +16 -6
  23. package/dist/esm/lib/component/Card/Card.js.map +1 -1
  24. package/dist/esm/lib/component/Card/common/Content/styles.css +8 -4
  25. package/dist/esm/lib/component/Card/common/Footer/Footer.js +2 -2
  26. package/dist/esm/lib/component/Card/common/Footer/styles.css +13 -3
  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 +60 -22
  31. package/dist/esm/lib/component/Chip/styles.css +3 -0
  32. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js +96 -0
  33. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js.map +1 -0
  34. package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js +32 -0
  35. package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js.map +1 -0
  36. package/dist/esm/lib/component/ContextualMenu/common/Item/index.js +2 -0
  37. package/dist/esm/lib/component/ContextualMenu/common/Item/index.js.map +1 -0
  38. package/dist/esm/lib/component/ContextualMenu/common/Item/styles.css +121 -0
  39. package/dist/esm/lib/component/ContextualMenu/common/Item/types.js.map +1 -0
  40. package/dist/esm/lib/component/ContextualMenu/common/MenuContext.js +12 -0
  41. package/dist/esm/lib/component/ContextualMenu/common/MenuContext.js.map +1 -0
  42. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js +128 -0
  43. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js.map +1 -0
  44. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/index.js +2 -0
  45. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/index.js.map +1 -0
  46. package/dist/esm/lib/component/ContextualMenu/index.js +2 -0
  47. package/dist/esm/lib/component/ContextualMenu/index.js.map +1 -0
  48. package/dist/esm/lib/component/ContextualMenu/styles.css +86 -0
  49. package/dist/esm/lib/component/ContextualMenu/types.js.map +1 -0
  50. package/dist/esm/lib/component/Popover/Popover.js +50 -0
  51. package/dist/esm/lib/component/Popover/Popover.js.map +1 -0
  52. package/dist/esm/lib/component/Popover/index.js +2 -0
  53. package/dist/esm/lib/component/Popover/index.js.map +1 -0
  54. package/dist/esm/lib/component/Popover/styles.css +65 -0
  55. package/dist/esm/lib/component/Popover/types.js +2 -0
  56. package/dist/esm/lib/component/Popover/types.js.map +1 -0
  57. package/dist/esm/lib/component/Tabs/Tabs.js +27 -0
  58. package/dist/esm/lib/component/Tabs/Tabs.js.map +1 -0
  59. package/dist/esm/lib/component/Tabs/common/Item/Item.js +20 -0
  60. package/dist/esm/lib/component/Tabs/common/Item/Item.js.map +1 -0
  61. package/dist/esm/lib/component/Tabs/common/Item/index.js +3 -0
  62. package/dist/esm/lib/component/Tabs/common/Item/index.js.map +1 -0
  63. package/dist/esm/lib/component/Tabs/common/Item/styles.css +75 -0
  64. package/dist/esm/lib/component/Tabs/common/Item/types.js +2 -0
  65. package/dist/esm/lib/component/Tabs/common/Item/types.js.map +1 -0
  66. package/dist/esm/lib/component/Tabs/common/index.js +2 -0
  67. package/dist/esm/lib/component/Tabs/common/index.js.map +1 -0
  68. package/dist/esm/lib/component/Tabs/index.js +3 -0
  69. package/dist/esm/lib/component/Tabs/index.js.map +1 -0
  70. package/dist/esm/lib/component/Tabs/styles.css +37 -0
  71. package/dist/esm/lib/component/Tabs/types.js +2 -0
  72. package/dist/esm/lib/component/Tabs/types.js.map +1 -0
  73. package/dist/esm/lib/component/Tile/Tile.js +6 -1
  74. package/dist/esm/lib/component/Tile/Tile.js.map +1 -1
  75. package/dist/esm/lib/component/Tile/common/Content/styles.css +17 -8
  76. package/dist/esm/lib/component/Tile/common/Header/styles.css +15 -12
  77. package/dist/esm/lib/component/Tile/styles.css +19 -53
  78. package/dist/esm/lib/component/Tooltip/Tooltip.js +6 -4
  79. package/dist/esm/lib/component/Tooltip/Tooltip.js.map +1 -1
  80. package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js +45 -25
  81. package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js.map +1 -1
  82. package/dist/esm/lib/component/Tooltip/styles.css +146 -81
  83. package/dist/esm/lib/component/Tooltip/withTooltip.js +3 -3
  84. package/dist/esm/lib/component/Tooltip/withTooltip.js.map +1 -1
  85. package/dist/esm/lib/component/index.js +17 -0
  86. package/dist/esm/lib/component/index.js.map +1 -0
  87. package/dist/esm/lib/group/Cards/Cards.js +49 -0
  88. package/dist/esm/lib/group/Cards/Cards.js.map +1 -0
  89. package/dist/esm/lib/group/Cards/index.js +3 -0
  90. package/dist/esm/lib/group/Cards/index.js.map +1 -0
  91. package/dist/esm/lib/group/Cards/styles.css +55 -0
  92. package/dist/esm/lib/group/Cards/types.js +2 -0
  93. package/dist/esm/lib/group/Cards/types.js.map +1 -0
  94. package/dist/esm/lib/group/index.js +4 -0
  95. package/dist/esm/lib/group/index.js.map +1 -0
  96. package/dist/esm/lib/hooks/index.js +3 -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 +181 -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/useIsMounted/index.js +3 -0
  111. package/dist/esm/lib/hooks/useIsMounted/index.js.map +1 -0
  112. package/dist/esm/lib/hooks/useIsMounted/types.js +2 -0
  113. package/dist/esm/lib/hooks/useIsMounted/types.js.map +1 -0
  114. package/dist/esm/lib/hooks/useIsMounted/useIsMounted.js +21 -0
  115. package/dist/esm/lib/hooks/useIsMounted/useIsMounted.js.map +1 -0
  116. package/dist/esm/lib/hooks/useResizeObserver/useResizeObserver.js +37 -7
  117. package/dist/esm/lib/hooks/useResizeObserver/useResizeObserver.js.map +1 -1
  118. package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js +9 -0
  119. package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js.map +1 -1
  120. package/dist/esm/lib/hooks/useWindowFitment/index.js +1 -0
  121. package/dist/esm/lib/hooks/useWindowFitment/index.js.map +1 -1
  122. package/dist/esm/lib/hooks/useWindowFitment/readingDirection.js +25 -0
  123. package/dist/esm/lib/hooks/useWindowFitment/readingDirection.js.map +1 -0
  124. package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js +211 -21
  125. package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js.map +1 -1
  126. package/dist/esm/lib/index.js +8 -25
  127. package/dist/esm/lib/index.js.map +1 -1
  128. package/dist/esm/lib/pattern/index.js +3 -0
  129. package/dist/esm/lib/pattern/index.js.map +1 -0
  130. package/dist/esm/lib/subcomponent/Spinner/Spinner.js +35 -0
  131. package/dist/esm/lib/subcomponent/Spinner/Spinner.js.map +1 -0
  132. package/dist/esm/lib/subcomponent/Spinner/index.js +2 -0
  133. package/dist/esm/lib/subcomponent/Spinner/index.js.map +1 -0
  134. package/dist/esm/lib/subcomponent/Spinner/styles.css +50 -0
  135. package/dist/esm/lib/subcomponent/Spinner/types.js +2 -0
  136. package/dist/esm/lib/subcomponent/Spinner/types.js.map +1 -0
  137. package/dist/esm/lib/subcomponent/index.js +3 -0
  138. package/dist/esm/lib/subcomponent/index.js.map +1 -0
  139. package/dist/esm/lib/types/link.js +2 -0
  140. package/dist/esm/lib/types/link.js.map +1 -0
  141. package/dist/types/lib/_work_in_progress/Link/types.d.ts +1 -1
  142. package/dist/types/lib/_work_in_progress/Link/types.d.ts.map +1 -1
  143. package/dist/types/lib/_work_in_progress/index.d.ts +12 -0
  144. package/dist/types/lib/_work_in_progress/index.d.ts.map +1 -0
  145. package/dist/types/lib/component/Announcement/Announcement.d.ts +2 -2
  146. package/dist/types/lib/component/Announcement/Announcement.d.ts.map +1 -1
  147. package/dist/types/lib/component/Announcement/index.d.ts.map +1 -1
  148. package/dist/types/lib/component/Announcement/types.d.ts +17 -6
  149. package/dist/types/lib/component/Announcement/types.d.ts.map +1 -1
  150. package/dist/types/lib/component/Breadcrumbs/Breadcrumbs.d.ts +3 -3
  151. package/dist/types/lib/component/Breadcrumbs/common/Item/Item.d.ts +1 -1
  152. package/dist/types/lib/component/Breadcrumbs/common/Item/Item.d.ts.map +1 -1
  153. package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts +13 -13
  154. package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts.map +1 -1
  155. package/dist/types/lib/component/Breadcrumbs/types.d.ts +23 -1
  156. package/dist/types/lib/component/Breadcrumbs/types.d.ts.map +1 -1
  157. package/dist/types/lib/component/Button/Button.d.ts +3 -1
  158. package/dist/types/lib/component/Button/Button.d.ts.map +1 -1
  159. package/dist/types/lib/component/Button/types.d.ts +12 -6
  160. package/dist/types/lib/component/Button/types.d.ts.map +1 -1
  161. package/dist/types/lib/component/Card/Card.d.ts +10 -5
  162. package/dist/types/lib/component/Card/Card.d.ts.map +1 -1
  163. package/dist/types/lib/component/Card/common/Footer/Footer.d.ts +2 -2
  164. package/dist/types/lib/component/Card/common/Footer/types.d.ts +2 -2
  165. package/dist/types/lib/component/Card/common/Footer/types.d.ts.map +1 -1
  166. package/dist/types/lib/component/Card/common/index.d.ts +0 -1
  167. package/dist/types/lib/component/Card/common/index.d.ts.map +1 -1
  168. package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts +15 -0
  169. package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts.map +1 -0
  170. package/dist/types/lib/component/ContextualMenu/common/Item/Item.d.ts +14 -0
  171. package/dist/types/lib/component/ContextualMenu/common/Item/Item.d.ts.map +1 -0
  172. package/dist/types/lib/component/ContextualMenu/common/Item/index.d.ts +3 -0
  173. package/dist/types/lib/component/ContextualMenu/common/Item/index.d.ts.map +1 -0
  174. package/dist/types/lib/component/ContextualMenu/common/Item/types.d.ts +11 -0
  175. package/dist/types/lib/component/ContextualMenu/common/Item/types.d.ts.map +1 -0
  176. package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts +19 -0
  177. package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts.map +1 -0
  178. package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts +15 -0
  179. package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts.map +1 -0
  180. package/dist/types/lib/component/ContextualMenu/common/SubMenu/index.d.ts +2 -0
  181. package/dist/types/lib/component/ContextualMenu/common/SubMenu/index.d.ts.map +1 -0
  182. package/dist/types/lib/component/ContextualMenu/index.d.ts +3 -0
  183. package/dist/types/lib/component/ContextualMenu/index.d.ts.map +1 -0
  184. package/dist/types/lib/component/ContextualMenu/types.d.ts +30 -0
  185. package/dist/types/lib/component/ContextualMenu/types.d.ts.map +1 -0
  186. package/dist/types/lib/component/Popover/Popover.d.ts +16 -0
  187. package/dist/types/lib/component/Popover/Popover.d.ts.map +1 -0
  188. package/dist/types/lib/component/Popover/index.d.ts +3 -0
  189. package/dist/types/lib/component/Popover/index.d.ts.map +1 -0
  190. package/dist/types/lib/component/Popover/types.d.ts +24 -0
  191. package/dist/types/lib/component/Popover/types.d.ts.map +1 -0
  192. package/dist/types/lib/component/Tabs/Tabs.d.ts +18 -0
  193. package/dist/types/lib/component/Tabs/Tabs.d.ts.map +1 -0
  194. package/dist/types/lib/component/Tabs/common/Item/Item.d.ts +15 -0
  195. package/dist/types/lib/component/Tabs/common/Item/Item.d.ts.map +1 -0
  196. package/dist/types/lib/component/Tabs/common/Item/index.d.ts +3 -0
  197. package/dist/types/lib/component/Tabs/common/Item/index.d.ts.map +1 -0
  198. package/dist/types/lib/component/Tabs/common/Item/types.d.ts +18 -0
  199. package/dist/types/lib/component/Tabs/common/Item/types.d.ts.map +1 -0
  200. package/dist/types/lib/component/Tabs/common/index.d.ts +2 -0
  201. package/dist/types/lib/component/Tabs/common/index.d.ts.map +1 -0
  202. package/dist/types/lib/component/Tabs/index.d.ts +3 -0
  203. package/dist/types/lib/component/Tabs/index.d.ts.map +1 -0
  204. package/dist/types/lib/component/Tabs/types.d.ts +46 -0
  205. package/dist/types/lib/component/Tabs/types.d.ts.map +1 -0
  206. package/dist/types/lib/component/Tile/Tile.d.ts +2 -0
  207. package/dist/types/lib/component/Tile/Tile.d.ts.map +1 -1
  208. package/dist/types/lib/component/Tile/common/Content/types.d.ts +1 -1
  209. package/dist/types/lib/component/Tile/common/Header/types.d.ts +1 -1
  210. package/dist/types/lib/component/Tile/types.d.ts +4 -5
  211. package/dist/types/lib/component/Tile/types.d.ts.map +1 -1
  212. package/dist/types/lib/component/Tooltip/Tooltip.d.ts +1 -1
  213. package/dist/types/lib/component/Tooltip/Tooltip.d.ts.map +1 -1
  214. package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts +1 -1
  215. package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts.map +1 -1
  216. package/dist/types/lib/component/Tooltip/common/TooltipArea/types.d.ts +14 -2
  217. package/dist/types/lib/component/Tooltip/common/TooltipArea/types.d.ts.map +1 -1
  218. package/dist/types/lib/component/Tooltip/types.d.ts +6 -0
  219. package/dist/types/lib/component/Tooltip/types.d.ts.map +1 -1
  220. package/dist/types/lib/component/Tooltip/withTooltip.d.ts +10 -3
  221. package/dist/types/lib/component/Tooltip/withTooltip.d.ts.map +1 -1
  222. package/dist/types/lib/component/index.d.ts +16 -0
  223. package/dist/types/lib/component/index.d.ts.map +1 -0
  224. package/dist/types/lib/group/Cards/Cards.d.ts +40 -0
  225. package/dist/types/lib/group/Cards/Cards.d.ts.map +1 -0
  226. package/dist/types/lib/group/Cards/index.d.ts +3 -0
  227. package/dist/types/lib/group/Cards/index.d.ts.map +1 -0
  228. package/dist/types/lib/group/Cards/types.d.ts +14 -0
  229. package/dist/types/lib/group/Cards/types.d.ts.map +1 -0
  230. package/dist/types/lib/group/index.d.ts +3 -0
  231. package/dist/types/lib/group/index.d.ts.map +1 -0
  232. package/dist/types/lib/hooks/index.d.ts +3 -1
  233. package/dist/types/lib/hooks/index.d.ts.map +1 -1
  234. package/dist/types/lib/hooks/useContextualMenu/index.d.ts +3 -0
  235. package/dist/types/lib/hooks/useContextualMenu/index.d.ts.map +1 -0
  236. package/dist/types/lib/hooks/useContextualMenu/types.d.ts +71 -0
  237. package/dist/types/lib/hooks/useContextualMenu/types.d.ts.map +1 -0
  238. package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts +20 -0
  239. package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts.map +1 -0
  240. package/dist/types/lib/hooks/useDisclosure/index.d.ts +3 -0
  241. package/dist/types/lib/hooks/useDisclosure/index.d.ts.map +1 -0
  242. package/dist/types/lib/hooks/useDisclosure/types.d.ts +103 -0
  243. package/dist/types/lib/hooks/useDisclosure/types.d.ts.map +1 -0
  244. package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts +32 -0
  245. package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts.map +1 -0
  246. package/dist/types/lib/hooks/useIsMounted/index.d.ts +3 -0
  247. package/dist/types/lib/hooks/useIsMounted/index.d.ts.map +1 -0
  248. package/dist/types/lib/hooks/useIsMounted/types.d.ts +6 -0
  249. package/dist/types/lib/hooks/useIsMounted/types.d.ts.map +1 -0
  250. package/dist/types/lib/hooks/useIsMounted/useIsMounted.d.ts +15 -0
  251. package/dist/types/lib/hooks/useIsMounted/useIsMounted.d.ts.map +1 -0
  252. package/dist/types/lib/hooks/useResizeObserver/useResizeObserver.d.ts +6 -0
  253. package/dist/types/lib/hooks/useResizeObserver/useResizeObserver.d.ts.map +1 -1
  254. package/dist/types/lib/hooks/useWindowDimensions/useWindowDimensions.d.ts.map +1 -1
  255. package/dist/types/lib/hooks/useWindowFitment/index.d.ts +1 -0
  256. package/dist/types/lib/hooks/useWindowFitment/index.d.ts.map +1 -1
  257. package/dist/types/lib/hooks/useWindowFitment/readingDirection.d.ts +14 -0
  258. package/dist/types/lib/hooks/useWindowFitment/readingDirection.d.ts.map +1 -0
  259. package/dist/types/lib/hooks/useWindowFitment/types.d.ts +75 -4
  260. package/dist/types/lib/hooks/useWindowFitment/types.d.ts.map +1 -1
  261. package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts +44 -2
  262. package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts.map +1 -1
  263. package/dist/types/lib/index.d.ts +5 -25
  264. package/dist/types/lib/index.d.ts.map +1 -1
  265. package/dist/types/lib/pattern/index.d.ts +2 -0
  266. package/dist/types/lib/pattern/index.d.ts.map +1 -0
  267. package/dist/types/lib/subcomponent/Spinner/Spinner.d.ts +24 -0
  268. package/dist/types/lib/subcomponent/Spinner/Spinner.d.ts.map +1 -0
  269. package/dist/types/lib/subcomponent/Spinner/index.d.ts +3 -0
  270. package/dist/types/lib/subcomponent/Spinner/index.d.ts.map +1 -0
  271. package/dist/types/lib/subcomponent/Spinner/types.d.ts +17 -0
  272. package/dist/types/lib/subcomponent/Spinner/types.d.ts.map +1 -0
  273. package/dist/types/lib/subcomponent/index.d.ts +2 -0
  274. package/dist/types/lib/subcomponent/index.d.ts.map +1 -0
  275. package/dist/types/lib/types/index.d.ts +1 -0
  276. package/dist/types/lib/types/index.d.ts.map +1 -1
  277. package/dist/types/lib/types/link.d.ts +26 -0
  278. package/dist/types/lib/types/link.d.ts.map +1 -0
  279. package/package.json +16 -19
  280. package/dist/esm/lib/component/Card/common/Thumbnail/Thumbnail.js +0 -21
  281. package/dist/esm/lib/component/Card/common/Thumbnail/Thumbnail.js.map +0 -1
  282. package/dist/esm/lib/component/Card/common/Thumbnail/index.js +0 -2
  283. package/dist/esm/lib/component/Card/common/Thumbnail/index.js.map +0 -1
  284. package/dist/esm/lib/component/Card/common/Thumbnail/styles.css +0 -39
  285. package/dist/esm/lib/component/Card/common/Thumbnail/types.js.map +0 -1
  286. package/dist/esm/lib/hooks/usePopup/index.js +0 -3
  287. package/dist/esm/lib/hooks/usePopup/index.js.map +0 -1
  288. package/dist/esm/lib/hooks/usePopup/types.js.map +0 -1
  289. package/dist/esm/lib/hooks/usePopup/usePopup.js +0 -93
  290. package/dist/esm/lib/hooks/usePopup/usePopup.js.map +0 -1
  291. package/dist/esm/storybook/decorators.js +0 -16
  292. package/dist/esm/storybook/decorators.js.map +0 -1
  293. package/dist/types/lib/component/Card/common/Thumbnail/Thumbnail.d.ts +0 -23
  294. package/dist/types/lib/component/Card/common/Thumbnail/Thumbnail.d.ts.map +0 -1
  295. package/dist/types/lib/component/Card/common/Thumbnail/index.d.ts +0 -3
  296. package/dist/types/lib/component/Card/common/Thumbnail/index.d.ts.map +0 -1
  297. package/dist/types/lib/component/Card/common/Thumbnail/types.d.ts +0 -27
  298. package/dist/types/lib/component/Card/common/Thumbnail/types.d.ts.map +0 -1
  299. package/dist/types/lib/hooks/usePopup/index.d.ts +0 -3
  300. package/dist/types/lib/hooks/usePopup/index.d.ts.map +0 -1
  301. package/dist/types/lib/hooks/usePopup/types.d.ts +0 -65
  302. package/dist/types/lib/hooks/usePopup/types.d.ts.map +0 -1
  303. package/dist/types/lib/hooks/usePopup/usePopup.d.ts +0 -19
  304. package/dist/types/lib/hooks/usePopup/usePopup.d.ts.map +0 -1
  305. package/dist/types/storybook/decorators.d.ts +0 -15
  306. package/dist/types/storybook/decorators.d.ts.map +0 -1
  307. /package/dist/esm/lib/component/{Card/common/Thumbnail → ContextualMenu/common/Item}/types.js +0 -0
  308. /package/dist/esm/lib/{hooks/usePopup → component/ContextualMenu}/types.js +0 -0
@@ -0,0 +1,18 @@
1
+ import type { LinkComponent } from "../../../../types/link.js";
2
+ import type { TabItem } from "../../types.js";
3
+ /**
4
+ * Props for the internal Tabs Item renderer.
5
+ *
6
+ * Not a public subcomponent — Tabs iterates `navigationRoot.items` and renders
7
+ * one of these per child. Kept internal so router integration lives in one
8
+ * place (the `LinkComponent` on Tabs), mirroring SideNavigation.
9
+ */
10
+ export interface ItemProps {
11
+ /** The tab's navigation item. */
12
+ item: TabItem;
13
+ /** Whether this tab is the current location (drives `aria-current="page"`). */
14
+ active: boolean;
15
+ /** Component used to render the tab when it is navigable. Defaults to `"a"`. */
16
+ LinkComponent: LinkComponent;
17
+ }
18
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/Tabs/common/Item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,+EAA+E;IAC/E,MAAM,EAAE,OAAO,CAAC;IAChB,gFAAgF;IAChF,aAAa,EAAE,aAAa,CAAC;CAC9B"}
@@ -0,0 +1,2 @@
1
+ export * from "./Item/index.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/component/Tabs/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as Tabs } from "./Tabs.js";
2
+ export type * from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tabs/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,mBAAmB,YAAY,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { Item } from "@canonical/ds-types";
2
+ import type { HTMLAttributes } from "react";
3
+ import type { LinkComponent } from "../../types/link.js";
4
+ /**
5
+ * A tab, as a WD405 navigation `Item`. A tab strip is flat, so only the
6
+ * top-level fields are used: `url` (destination — a tab without one is inert),
7
+ * `label` (visible text), `key` (identity when there is no url), and
8
+ * `disabled`. Nested `items` are ignored (tabs cannot nest).
9
+ */
10
+ export interface TabItem extends Item {
11
+ /** CSS class name applied to this tab's `<li>`, in addition to the base classes. */
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Props for the Tabs component
16
+ *
17
+ * @implements dso:global.component.tabs
18
+ */
19
+ export interface TabsProps extends HTMLAttributes<HTMLElement> {
20
+ /**
21
+ * The tab strip, as a root navigation `Item`. Its **direct children**
22
+ * (`navigationRoot.items`) are rendered as tabs; the root node itself is a
23
+ * container and is not rendered.
24
+ */
25
+ navigationRoot: TabItem;
26
+ /**
27
+ * Component used to render navigable tabs (those with a `url`). Receives
28
+ * `LinkComponentProps`. Defaults to `"a"`. Pass a router `Link` (e.g.
29
+ * `@canonical/router-react`) to integrate with client-side navigation.
30
+ */
31
+ LinkComponent?: LinkComponent;
32
+ /**
33
+ * Live current location, used to resolve which tab is active. The tab whose
34
+ * `url` matches is marked `aria-current`. Keep it in sync with the consumer's
35
+ * router (e.g. `useRoute().pathname`) so the active tab updates on navigation.
36
+ */
37
+ currentUrl?: string;
38
+ /** Class applied to the `<ul>` tab list. */
39
+ listClassName?: string;
40
+ /**
41
+ * Accessible name for the navigation landmark. Required so assistive tech can
42
+ * distinguish this tab strip from other navigation regions.
43
+ */
44
+ "aria-label": string;
45
+ }
46
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,OAAQ,SAAQ,IAAI;IACnC,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC5D;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -7,6 +7,8 @@ import "./styles.css";
7
7
  * creates a clear boundary between different pieces of content, making complex
8
8
  * layouts easier to scan and organize.
9
9
  *
10
+ * `import { Tile } from "@canonical/react-ds-global";`
11
+ *
10
12
  * @implements ds:global.component.tile
11
13
  */
12
14
  declare const Tile: {
@@ -1 +1 @@
1
- {"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tile/Tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAItB;;;;;;;GAOG;AACH,QAAA,MAAM,IAAI;wCAIP,SAAS,GAAG,KAAK,CAAC,YAAY;;;;;;;;;CAQhC,CAAC;AAKF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tile/Tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAOtB;;;;;;;;;GASG;AACH,QAAA,MAAM,IAAI;wCAIP,SAAS,GAAG,KAAK,CAAC,YAAY;;;;;;;;;CAQhC,CAAC;AAKF,eAAe,IAAI,CAAC"}
@@ -2,7 +2,7 @@ import type { HTMLAttributes, ReactNode } from "react";
2
2
  /**
3
3
  * Props for the Tile.Content subcomponent
4
4
  *
5
- * @implements dso:global.subcomponent.tile-content
5
+ * @implements ds:global.subcomponent.tile-content
6
6
  *
7
7
  * Anatomy (from DSL):
8
8
  * - layout.type: stack
@@ -2,7 +2,7 @@ import type { HTMLAttributes, ReactNode } from "react";
2
2
  /**
3
3
  * Props for the Tile.Header subcomponent
4
4
  *
5
- * @implements dso:global.subcomponent.tile-header
5
+ * @implements ds:global.subcomponent.tile-header
6
6
  *
7
7
  * Anatomy (from DSL):
8
8
  * - layout.type: flow
@@ -4,16 +4,15 @@ import type { HeaderProps } from "./common/Header/types.js";
4
4
  /**
5
5
  * Props for the Tile component
6
6
  *
7
- * @implements dso:global.component.tile
7
+ * @implements ds:global.component.tile
8
8
  *
9
9
  * Anatomy (from DSL):
10
10
  * - layout.type: stack
11
11
  * - layout.direction: vertical
12
- * - interaction.cursor: pointer
13
- * - appearance.background: color/surface/tile
14
- * - appearance.radius: radius/tile
12
+ * - appearance.background: color/surface/tile (Tile is a surface)
13
+ * - appearance.radius: radius/card (shared with Card)
15
14
  * - edges:
16
- * - [0] tile-header (slotName: header, cardinality: 1)
15
+ * - [0] tile-header (slotName: header, cardinality: 0..1)
17
16
  * - [1] tile-content (slotName: default, cardinality: 1)
18
17
  */
19
18
  export interface TileProps extends HTMLAttributes<HTMLDivElement> {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tile/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D;;;OAGG;IACH,QAAQ,EACJ,YAAY,CAAC,WAAW,GAAG,YAAY,CAAC,GACxC,YAAY,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,YAAY,CAAC,GAAG;IACjE,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,YAAY,CAAC;IAC7C,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,YAAY,CAAC;CAChD,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tile/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D;;;OAGG;IACH,QAAQ,EACJ,YAAY,CAAC,WAAW,GAAG,YAAY,CAAC,GACxC,YAAY,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,YAAY,CAAC,GAAG;IACjE,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,YAAY,CAAC;IAC7C,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,YAAY,CAAC;CAChD,CAAC"}
@@ -8,6 +8,6 @@ import type { TooltipProps } from "./types.js";
8
8
  *
9
9
  * @implements ds:global.component.tooltip
10
10
  */
11
- declare const Tooltip: ({ id, children, className, style, ref, isOpen, zIndex, onPointerEnter, onFocus, }: TooltipProps) => React.ReactElement;
11
+ declare const Tooltip: ({ id, children, icon, className, style, ref, isOpen, zIndex, onPointerEnter, onFocus, }: TooltipProps) => React.ReactElement;
12
12
  export default Tooltip;
13
13
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C;;;;;;GAMG;AACH,QAAA,MAAM,OAAO,GAAI,mFAUd,YAAY,KAAG,KAAK,CAAC,YAmBvB,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C;;;;;;GAMG;AACH,QAAA,MAAM,OAAO,GAAI,yFAWd,YAAY,KAAG,KAAK,CAAC,YA6BvB,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -5,6 +5,6 @@ import "./styles.css";
5
5
  * Wraps a target element with a tooltip.
6
6
  * This component allows you to attach a tooltip to any JSX fragment.
7
7
  */
8
- declare const TooltipArea: ({ children, style, className, Message, distance, targetElementId, targetElementClassName, targetElementStyle, messageElementClassName, messageElementStyle, parentElement, autoFit, ...props }: TooltipAreaProps) => ReactElement;
8
+ declare const TooltipArea: ({ children, style, className, Message, icon, open, distance, targetElementId, targetElementClassName, targetElementStyle, messageElementClassName, messageElementStyle, parentElement, autoFit, ...props }: TooltipAreaProps) => ReactElement;
9
9
  export default TooltipArea;
10
10
  //# sourceMappingURL=TooltipArea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipArea.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/Tooltip/common/TooltipArea/TooltipArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,cAAc,CAAC;AAKtB;;;GAGG;AACH,QAAA,MAAM,WAAW,GAAI,gMAclB,gBAAgB,KAAG,YA0ErB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"TooltipArea.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/Tooltip/common/TooltipArea/TooltipArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAIzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,cAAc,CAAC;AAItB;;;GAGG;AACH,QAAA,MAAM,WAAW,GAAI,4MAgBlB,gBAAgB,KAAG,YAgGrB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { CSSProperties, ReactNode } from "react";
2
- import type { UsePopupProps } from "#lib/hooks/index.js";
3
- export interface TooltipAreaProps extends UsePopupProps {
2
+ import type { UseDisclosureProps } from "../../../../hooks/index.js";
3
+ export interface TooltipAreaProps extends Omit<UseDisclosureProps, "mode"> {
4
4
  /**
5
5
  * The target element to which the tooltip should be attached.
6
6
  * This can be any valid React element.
@@ -10,6 +10,18 @@ export interface TooltipAreaProps extends UsePopupProps {
10
10
  * The content of the tooltip. This can be a string or any valid React node.
11
11
  */
12
12
  Message: ReactNode;
13
+ /**
14
+ * An optional leading icon for the tooltip, rendered before the message
15
+ * (Figma: 16px glyph, dimension-100 gap). Purely decorative.
16
+ */
17
+ icon?: ReactNode;
18
+ /**
19
+ * Force the tooltip open (or closed), overriding hover/focus. When a boolean
20
+ * is passed the tooltip is fully controlled and ignores pointer/keyboard —
21
+ * useful for stories, visual tests, or driving the tooltip from outside.
22
+ * Leave undefined for the default hover behaviour.
23
+ */
24
+ open?: boolean;
13
25
  /** Styles applied to the tooltip area */
14
26
  style?: CSSProperties;
15
27
  /** Class name applied to the tooltip area */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/Tooltip/common/TooltipArea/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB,yCAAyC;IACzC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iDAAiD;IACjD,kBAAkB,CAAC,EAAE,aAAa,CAAC;IACnC,wDAAwD;IACxD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC;CAC7B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/Tooltip/common/TooltipArea/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACxE;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iDAAiD;IACjD,kBAAkB,CAAC,EAAE,aAAa,CAAC;IACnC,wDAAwD;IACxD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC;CAC7B"}
@@ -3,6 +3,12 @@ export interface TooltipProps {
3
3
  id?: string;
4
4
  className?: string;
5
5
  children: ReactNode;
6
+ /**
7
+ * An optional leading icon, rendered before the text and top-aligned with the
8
+ * first line (Figma: 16px glyph, dimension-100 gap). Pass any glyph node
9
+ * (e.g. an `<Icon>` or inline SVG).
10
+ */
11
+ icon?: ReactNode;
6
12
  style?: CSSProperties;
7
13
  /** Whether the tooltip is open or not */
8
14
  isOpen?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,MAAM,WAAW,YAAY;IAE3B,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,EAAE,SAAS,CAAC;IAEpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,GAAG,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACvC,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,MAAM,WAAW,YAAY;IAE3B,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,GAAG,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACvC,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B"}
@@ -1,11 +1,18 @@
1
1
  import type { ComponentType, FC, ReactNode } from "react";
2
- import type { UsePopupProps } from "#lib/hooks/index.js";
2
+ import type { TooltipAreaProps } from "./common/TooltipArea/types.js";
3
+ /**
4
+ * The tooltip options for {@link withTooltip}: everything `TooltipArea` accepts
5
+ * except the wrapped content and the message (which are supplied separately).
6
+ * Includes `open` (force the tooltip open/closed — handy for stories), `icon`,
7
+ * `preferredDirections`, `distance`, `autoFit`, `maxWidth`, timing, etc.
8
+ */
9
+ export type WithTooltipOptions = Omit<TooltipAreaProps, "children" | "Message">;
3
10
  /**
4
11
  * A higher-order component that wraps a component with a tooltip.
5
12
  * @param Component The component function to wrap. If you need to use a Node instead of a function, use [`TooltipArea`](/?path=/docs/tooltip-withtooltip--docs) instead.
6
13
  * @param Message The content of the tooltip
7
- * @param popupProps The props to pass to the usePopup hook
14
+ * @param popupProps Tooltip options forwarded to the underlying `TooltipArea`
8
15
  */
9
- declare const withTooltip: <TProps extends object>(Component: ComponentType<TProps>, Message: ReactNode, popupProps?: UsePopupProps) => FC<TProps>;
16
+ declare const withTooltip: <TProps extends object>(Component: ComponentType<TProps>, Message: ReactNode, popupProps?: WithTooltipOptions) => FC<TProps>;
10
17
  export default withTooltip;
11
18
  //# sourceMappingURL=withTooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withTooltip.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/withTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,EAAE,EAEF,SAAS,EAEV,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD;;;;;GAKG;AACH,QAAA,MAAM,WAAW,GAAI,MAAM,SAAS,MAAM,EACxC,WAAW,aAAa,CAAC,MAAM,CAAC,EAChC,SAAS,SAAS,EAClB,aAAY,aAAkB,KAC7B,EAAE,CAAC,MAAM,CAkBX,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"withTooltip.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/withTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,EAAE,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC;AAEhF;;;;;GAKG;AACH,QAAA,MAAM,WAAW,GAAI,MAAM,SAAS,MAAM,EACxC,WAAW,aAAa,CAAC,MAAM,CAAC,EAChC,SAAS,SAAS,EAClB,aAAY,kBAAuB,KAClC,EAAE,CAAC,MAAM,CAeX,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,16 @@
1
+ export * from "./Accordion/index.js";
2
+ export * from "./Announcement/index.js";
3
+ export * from "./Badge/index.js";
4
+ export * from "./Breadcrumbs/index.js";
5
+ export * from "./Button/index.js";
6
+ export * from "./Card/index.js";
7
+ export * from "./Chip/index.js";
8
+ export * from "./ContextualMenu/index.js";
9
+ export * from "./Icon/index.js";
10
+ export * from "./InlineCode/index.js";
11
+ export * from "./KeyboardKey/index.js";
12
+ export * from "./Popover/index.js";
13
+ export * from "./Tabs/index.js";
14
+ export * from "./Tile/index.js";
15
+ export * from "./Tooltip/index.js";
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/component/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { ReactElement } from "react";
2
+ import type { CardsProps } from "./types.js";
3
+ import "./styles.css";
4
+ /**
5
+ * Cards — lays out a set of `Card`s on a shared grid so that not only the cards
6
+ * themselves, but each card's SECTIONS (image, header, content, footer) line up
7
+ * across the row.
8
+ *
9
+ * @remarks
10
+ * **Requires a top-level grid.** `Cards` is a `.subgrid`: it inherits the column
11
+ * tracks of the nearest parent `.grid` rather than defining its own. Wrap it in
12
+ * a `.grid` (e.g. the `grid()` storybook decorator or the `grid` addon param,
13
+ * the same way Accordion or a form field opts in). Outside a grid it degrades to
14
+ * a plain block — still renders, just without column alignment.
15
+ *
16
+ * **Two-level subgrid.** The parent grid supplies the columns; `Cards` inherits
17
+ * them and defines the shared section ROW tracks; each `Card` spans `cardSpan`
18
+ * columns and is itself a row-subgrid, so its sections snap to the shared
19
+ * tracks. See `styles.css` for the full model.
20
+ *
21
+ * **`cardSpan`** is the number of master columns each card spans (not a pixel
22
+ * width) — use multiples of 2/4 so cards tile evenly into the 4/8/12-column
23
+ * responsive grid.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * // inside a `.grid` context (decorator/addon)
28
+ * <Cards cardSpan={4}>
29
+ * <Card>…</Card>
30
+ * <Card>…</Card>
31
+ * <Card>…</Card>
32
+ * </Cards>
33
+ * ```
34
+ *
35
+ * @implements dso:global.group.cards
36
+ * @returns {ReactElement} the Cards group
37
+ */
38
+ declare const Cards: ({ className, children, cardSpan, style, ...props }: CardsProps) => ReactElement;
39
+ export default Cards;
40
+ //# sourceMappingURL=Cards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cards.d.ts","sourceRoot":"","sources":["../../../../../src/lib/group/Cards/Cards.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,QAAA,MAAM,KAAK,GAAI,oDAMZ,UAAU,KAAG,YAmBf,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as Cards } from "./Cards.js";
2
+ export type * from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/group/Cards/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,mBAAmB,YAAY,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export interface CardsProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** The `Card` elements to lay out. */
4
+ children?: ReactNode;
5
+ /**
6
+ * How many master-grid columns each card spans (NOT a pixel width). Fed to the
7
+ * `--card-span` CSS custom property. Larger spans mean fewer, wider cards per
8
+ * row on the 4/8/12-column responsive grid — e.g. on a 12-column grid `1` = 12
9
+ * per row, `2` = 6, `4` = 3.
10
+ * @default 1
11
+ */
12
+ cardSpan?: number;
13
+ }
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/group/Cards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,sCAAsC;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,3 @@
1
+ export * from "./Cards/index.js";
2
+ export * from "./KeyboardKeys/index.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/group/index.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
@@ -1,5 +1,7 @@
1
+ export * from "./useContextualMenu/index.js";
1
2
  export * from "./useDelayedToggle/index.js";
2
- export * from "./usePopup/index.js";
3
+ export * from "./useDisclosure/index.js";
4
+ export * from "./useIsMounted/index.js";
3
5
  export * from "./useResizeObserver/index.js";
4
6
  export * from "./useWindowDimensions/index.js";
5
7
  export * from "./useWindowFitment/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./types.js";
2
+ export { default as useContextualMenu } from "./useContextualMenu.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/hooks/useContextualMenu/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { _Item, Item } from "@canonical/ds-types";
2
+ import type { ItemProps, MenuGroupPropsResult, MenuItemPropsResult, MenuProps, MenuPropsResult, UseNavigationTreeResult } from "@canonical/react-hooks";
3
+ import type { UseDisclosureProps, UseDisclosureResult } from "../useDisclosure/index.js";
4
+ /**
5
+ * A menu item that may carry a right-aligned slot (e.g. a badge or keyboard
6
+ * shortcut) in addition to the base navigation fields. The slot is an optional
7
+ * extension that survives tree annotation.
8
+ */
9
+ export interface MenuItem extends Item {
10
+ /** Content rendered right-aligned within the item, such as a badge or shortcut. */
11
+ slot?: React.ReactNode;
12
+ /** Icon rendered left of the label. */
13
+ icon?: React.ReactNode;
14
+ /** Child items — a group's items, or a future submenu's entries. */
15
+ items?: MenuItem[];
16
+ /** CSS class name applied to this item, in addition to the base classes. */
17
+ className?: string;
18
+ /**
19
+ * Opts this item into rendering via `Component` instead of the default
20
+ * layout. `"custom"` without a `Component` falls back to the default.
21
+ */
22
+ displayItemsType?: "default" | "custom";
23
+ /** Custom component for rendering this item itself, when `displayItemsType` is `"custom"`. */
24
+ Component?: React.ComponentType<{
25
+ item: MenuItem;
26
+ }>;
27
+ }
28
+ export interface UseContextualMenuProps extends Omit<UseDisclosureProps, "mode"> {
29
+ /**
30
+ * The menu tree. The root's children are groups; each group's children are
31
+ * the menu items (menu -> group -> item). One level of items is supported now;
32
+ * deeper nesting is reserved for submenus.
33
+ */
34
+ root: MenuItem;
35
+ /** Whether arrow keys wrap at the first/last item. Defaults to false. */
36
+ wrap?: boolean;
37
+ /** Type-ahead reset timeout in milliseconds. */
38
+ typeAheadTimeout?: number;
39
+ }
40
+ /** Options for the menu/group ARIA prop-getters. */
41
+ export interface MenuAriaOptions {
42
+ /** Accessible name for the element. */
43
+ label?: string;
44
+ /** Id of an element that labels this one. */
45
+ labelledBy?: string;
46
+ /** A ref to compose with the menu's internal keyboard ref (menu container only). */
47
+ ref?: React.Ref<HTMLElement>;
48
+ }
49
+ /**
50
+ * The contextual menu combines a click disclosure (open state, positioning,
51
+ * dismissal) with a navigation tree (roving keyboard focus, type-ahead, and
52
+ * cross-group arrow traversal via a `stateReducer`) and menu ARIA wiring.
53
+ */
54
+ export interface UseContextualMenuResult extends Pick<UseDisclosureResult, "isOpen" | "open" | "close" | "toggle" | "targetRef" | "popupRef" | "popupPositionStyle" | "popupId" | "bestPosition" | "arrowOffset">, Pick<UseNavigationTreeResult<MenuItem>, "annotatedRoot" | "index" | "highlightedItems" | "highlightItem" | "selectItem" | "getNodeStatus"> {
55
+ /**
56
+ * Prop-getter for the menu trigger element. Drives the disclosure (open state,
57
+ * positioning, dismissal) and carries the menu ARIA wiring
58
+ * (`aria-haspopup`/`aria-expanded`/`aria-controls`).
59
+ */
60
+ getTriggerProps: () => Record<string, unknown>;
61
+ /**
62
+ * Prop-getter for the `role="menu"` container element. Merges the navigation
63
+ * container props (keyboard handler, ref) with the menu ARIA preset.
64
+ */
65
+ getMenuProps: (opts?: MenuAriaOptions) => MenuProps & MenuPropsResult;
66
+ /** Prop-getter for a `role="group"` element. */
67
+ getGroupProps: (opts?: MenuAriaOptions) => MenuGroupPropsResult;
68
+ /** Prop-getter for a `role="menuitem"` element. */
69
+ getItemProps: (item: _Item<MenuItem>) => ItemProps & MenuItemPropsResult;
70
+ }
71
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/hooks/useContextualMenu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EACV,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,MAAM,WAAW,QAAS,SAAQ,IAAI;IACpC,mFAAmF;IACnF,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,uCAAuC;IACvC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,oEAAoE;IACpE,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACxC,8FAA8F;IAC9F,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACxC;;;;OAIG;IACH,IAAI,EAAE,QAAQ,CAAC;IACf,yEAAyE;IACzE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,uBACf,SAAQ,IAAI,CACR,mBAAmB,EACjB,QAAQ,GACR,MAAM,GACN,OAAO,GACP,QAAQ,GACR,WAAW,GACX,UAAU,GACV,oBAAoB,GACpB,SAAS,GACT,cAAc,GACd,aAAa,CAChB,EACD,IAAI,CACF,uBAAuB,CAAC,QAAQ,CAAC,EAC/B,eAAe,GACf,OAAO,GACP,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,eAAe,CAClB;IACH;;;;OAIG;IACH,eAAe,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C;;;OAGG;IACH,YAAY,EAAE,CAAC,IAAI,CAAC,EAAE,eAAe,KAAK,SAAS,GAAG,eAAe,CAAC;IACtE,gDAAgD;IAChD,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,eAAe,KAAK,oBAAoB,CAAC;IAChE,mDAAmD;IACnD,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,SAAS,GAAG,mBAAmB,CAAC;CAC1E"}
@@ -0,0 +1,20 @@
1
+ import type { UseContextualMenuProps, UseContextualMenuResult } from "./types.js";
2
+ /**
3
+ * Drives a contextual menu: a click-triggered, positioned popup listing grouped
4
+ * menu items with full keyboard support.
5
+ *
6
+ * Positioning, open state, outside-click and Escape dismissal come from
7
+ * {@link useDisclosure} in `click` mode. Roving focus, type-ahead, and ARIA
8
+ * wiring come from `useNavigationTree`. Vertical arrow keys cross group
9
+ * boundaries through a `stateReducer`, so the shared navigation machinery stays
10
+ * menu-agnostic.
11
+ *
12
+ * @param root The menu tree (menu -> group -> item).
13
+ * @param wrap Whether arrow keys wrap at the first/last item.
14
+ * @param typeAheadTimeout Type-ahead reset timeout in milliseconds.
15
+ * @param props Forwarded to the underlying disclosure (positioning, callbacks).
16
+ * @returns The open state, positioning, and menu prop-getters.
17
+ */
18
+ declare const useContextualMenu: ({ root, wrap, typeAheadTimeout, ...props }: UseContextualMenuProps) => UseContextualMenuResult;
19
+ export default useContextualMenu;
20
+ //# sourceMappingURL=useContextualMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContextualMenu.d.ts","sourceRoot":"","sources":["../../../../../src/lib/hooks/useContextualMenu/useContextualMenu.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAEV,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,iBAAiB,GAAI,4CAKxB,sBAAsB,KAAG,uBAgN3B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./types.js";
2
+ export { default as useDisclosure } from "./useDisclosure.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/hooks/useDisclosure/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,103 @@
1
+ import type { CSSProperties, FocusEventHandler, KeyboardEventHandler, PointerEventHandler, RefObject } from "react";
2
+ import type { UseDelayedToggleProps } from "../useDelayedToggle/index.js";
3
+ import type { UseWindowFitmentProps, UseWindowFitmentResult } from "../useWindowFitment/index.js";
4
+ /**
5
+ * How the disclosure is triggered.
6
+ * - `hover`: opens on pointer-enter / focus, closes on pointer-leave / blur,
7
+ * with a delay. Suits tooltips and other non-interactive overlays. There is
8
+ * no native HTML primitive for this; the hook owns the open state.
9
+ * - `click`: toggles on click, closes on outside-click and Escape, and returns
10
+ * focus to the trigger on close. Suits popovers, menus, and dropdowns. This
11
+ * mode is complementary to a native `<details>`/`<summary>` (or a
12
+ * `<button aria-expanded>` + panel), which provides the no-JS baseline while
13
+ * the hook layers on positioning and dismissal after hydration.
14
+ */
15
+ export type DisclosureMode = "hover" | "click";
16
+ export interface UseDisclosureProps extends UseWindowFitmentProps, UseDelayedToggleProps {
17
+ /** How the disclosure opens and closes. Defaults to `hover`. */
18
+ mode?: DisclosureMode;
19
+ /** An override for the open state. When boolean, the hook is controlled. */
20
+ isOpen?: boolean;
21
+ /** Called when the popup is shown. */
22
+ onShow?: (event?: Event) => void;
23
+ /** Called when the popup is hidden. */
24
+ onHide?: (event?: Event) => void;
25
+ /**
26
+ * Whether the popup closes when the Escape key is pressed. Defaults to true.
27
+ */
28
+ closeOnEscape?: boolean;
29
+ /**
30
+ * Whether a `click` disclosure closes when a pointer-down occurs outside the
31
+ * trigger and content. Ignored in `hover` mode. Defaults to true.
32
+ */
33
+ closeOnOutsideClick?: boolean;
34
+ /**
35
+ * Whether a `click` disclosure returns focus to the trigger when it closes.
36
+ * Ignored in `hover` mode. Defaults to true.
37
+ */
38
+ returnFocus?: boolean;
39
+ /** Called when the pointer enters the trigger (`hover` mode). */
40
+ onEnter?: PointerEventHandler;
41
+ /** Called when the pointer leaves the trigger (`hover` mode). */
42
+ onLeave?: PointerEventHandler;
43
+ /** Called when the trigger is focused. */
44
+ onFocus?: FocusEventHandler;
45
+ /** Called when the trigger loses focus. */
46
+ onBlur?: FocusEventHandler;
47
+ }
48
+ /**
49
+ * Props to spread onto the trigger element. The trigger is whatever the
50
+ * component chooses to render (a `<button>`, a `<summary>`, a `<span>`); the
51
+ * hook stays element-agnostic.
52
+ */
53
+ export interface DisclosureToggleProps {
54
+ /** Reflects the open state for assistive tech (`click` mode). */
55
+ "aria-expanded"?: boolean;
56
+ /** Points at the content element (`click` mode). */
57
+ "aria-controls"?: string;
58
+ /** Associates the trigger with its description (`hover` mode). */
59
+ "aria-describedby"?: string;
60
+ onClick?: (event: React.MouseEvent) => void;
61
+ onKeyDown?: KeyboardEventHandler;
62
+ onPointerEnter?: PointerEventHandler;
63
+ onPointerLeave?: PointerEventHandler;
64
+ onFocus?: FocusEventHandler;
65
+ onBlur?: FocusEventHandler;
66
+ }
67
+ /** Props to spread onto the content (popup) element. */
68
+ export interface DisclosureContentProps {
69
+ /** Stable id, matched by the trigger's `aria-controls` / `aria-describedby`. */
70
+ id: string;
71
+ /** Hidden from layout and assistive tech while closed. */
72
+ hidden?: boolean;
73
+ onPointerEnter?: PointerEventHandler;
74
+ onPointerLeave?: PointerEventHandler;
75
+ }
76
+ export type DisableableElement = HTMLElement & {
77
+ disabled: boolean;
78
+ };
79
+ export interface UseDisclosureResult extends UseWindowFitmentResult {
80
+ /** Whether the disclosure is currently open. */
81
+ isOpen: boolean;
82
+ /** Whether the trigger is currently focused. */
83
+ isFocused: boolean;
84
+ /** Imperatively open the disclosure. */
85
+ open: () => void;
86
+ /** Imperatively close the disclosure. */
87
+ close: () => void;
88
+ /** Imperatively toggle the disclosure. */
89
+ toggle: () => void;
90
+ /** A ref to attach to the trigger element. */
91
+ targetRef: RefObject<HTMLDivElement | null>;
92
+ /** A ref to attach to the content (popup) element. */
93
+ popupRef: RefObject<HTMLDivElement | null>;
94
+ /** The style object to apply to the content element. */
95
+ popupPositionStyle: CSSProperties;
96
+ /** A stable id for the content element (associates trigger and content). */
97
+ popupId: string;
98
+ /** Prop-getter for the trigger element. */
99
+ getToggleProps: () => DisclosureToggleProps;
100
+ /** Prop-getter for the content (popup) element. */
101
+ getContentProps: () => DisclosureContentProps;
102
+ }
103
+ //# sourceMappingURL=types.d.ts.map