@canonical/react-ds-global 0.37.0 → 0.40.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 (204) hide show
  1. package/README.md +72 -0
  2. package/dist/esm/lib/_work_in_progress/Announcement/styles.css +51 -47
  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.map +1 -1
  40. package/dist/esm/lib/component/Chip/styles.css +105 -101
  41. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js +30 -22
  42. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js.map +1 -1
  43. package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js +25 -2
  44. package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js.map +1 -1
  45. package/dist/esm/lib/component/ContextualMenu/common/Item/styles.css +116 -106
  46. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js +29 -10
  47. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js.map +1 -1
  48. package/dist/esm/lib/component/ContextualMenu/styles.css +73 -72
  49. package/dist/esm/lib/component/Icon/styles.css +24 -20
  50. package/dist/esm/lib/component/InlineCode/styles.css +19 -15
  51. package/dist/esm/lib/component/KeyboardKey/styles.css +44 -40
  52. package/dist/esm/lib/component/Popover/Popover.js.map +1 -1
  53. package/dist/esm/lib/component/Popover/styles.css +59 -52
  54. package/dist/esm/lib/component/Tabs/common/Item/styles.css +80 -76
  55. package/dist/esm/lib/component/Tabs/styles.css +36 -32
  56. package/dist/esm/lib/component/Tile/common/Content/styles.css +28 -24
  57. package/dist/esm/lib/component/Tile/common/Header/styles.css +28 -24
  58. package/dist/esm/lib/component/Tile/styles.css +31 -27
  59. package/dist/esm/lib/component/Tooltip/TooltipEngine.js +66 -0
  60. package/dist/esm/lib/component/Tooltip/TooltipEngine.js.map +1 -0
  61. package/dist/esm/lib/component/Tooltip/index.js +1 -0
  62. package/dist/esm/lib/component/Tooltip/index.js.map +1 -1
  63. package/dist/esm/lib/component/Tooltip/styles.css +213 -208
  64. package/dist/esm/lib/component/Tooltip/withTooltip.js +11 -63
  65. package/dist/esm/lib/component/Tooltip/withTooltip.js.map +1 -1
  66. package/dist/esm/lib/group/Cards/styles.css +26 -22
  67. package/dist/esm/lib/group/KeyboardKeys/styles.css +14 -10
  68. package/dist/esm/lib/hooks/useContextualMenu/index.js +1 -0
  69. package/dist/esm/lib/hooks/useContextualMenu/index.js.map +1 -1
  70. package/dist/esm/lib/hooks/useContextualMenu/isMenuSeparator.js +11 -0
  71. package/dist/esm/lib/hooks/useContextualMenu/isMenuSeparator.js.map +1 -0
  72. package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js +54 -34
  73. package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js.map +1 -1
  74. package/dist/esm/lib/hooks/useDisclosure/useDisclosure.js.map +1 -1
  75. package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js +1 -1
  76. package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js.map +1 -1
  77. package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js +29 -6
  78. package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js.map +1 -1
  79. package/dist/esm/lib/index.css +79 -0
  80. package/dist/esm/lib/pattern/Modal/Context.js +10 -0
  81. package/dist/esm/lib/pattern/Modal/Context.js.map +1 -0
  82. package/dist/esm/lib/pattern/Modal/Provider.js +103 -0
  83. package/dist/esm/lib/pattern/Modal/Provider.js.map +1 -0
  84. package/dist/esm/lib/pattern/Modal/common/Content/Content.js +15 -0
  85. package/dist/esm/lib/pattern/Modal/common/Content/Content.js.map +1 -0
  86. package/dist/esm/lib/pattern/Modal/common/Content/index.js +3 -0
  87. package/dist/esm/lib/pattern/Modal/common/Content/index.js.map +1 -0
  88. package/dist/esm/lib/pattern/Modal/common/Content/styles.css +37 -0
  89. package/dist/esm/lib/pattern/Modal/common/Content/types.js +2 -0
  90. package/dist/esm/lib/pattern/Modal/common/Content/types.js.map +1 -0
  91. package/dist/esm/lib/pattern/Modal/common/Footer/Footer.js +16 -0
  92. package/dist/esm/lib/pattern/Modal/common/Footer/Footer.js.map +1 -0
  93. package/dist/esm/lib/pattern/Modal/common/Footer/index.js +3 -0
  94. package/dist/esm/lib/pattern/Modal/common/Footer/index.js.map +1 -0
  95. package/dist/esm/lib/pattern/Modal/common/Footer/styles.css +57 -0
  96. package/dist/esm/lib/pattern/Modal/common/Footer/types.js +2 -0
  97. package/dist/esm/lib/pattern/Modal/common/Footer/types.js.map +1 -0
  98. package/dist/esm/lib/pattern/Modal/common/Header/Header.js +27 -0
  99. package/dist/esm/lib/pattern/Modal/common/Header/Header.js.map +1 -0
  100. package/dist/esm/lib/pattern/Modal/common/Header/index.js +3 -0
  101. package/dist/esm/lib/pattern/Modal/common/Header/index.js.map +1 -0
  102. package/dist/esm/lib/pattern/Modal/common/Header/styles.css +79 -0
  103. package/dist/esm/lib/pattern/Modal/common/Header/types.js +2 -0
  104. package/dist/esm/lib/pattern/Modal/common/Header/types.js.map +1 -0
  105. package/dist/esm/lib/pattern/Modal/common/index.js +5 -0
  106. package/dist/esm/lib/pattern/Modal/common/index.js.map +1 -0
  107. package/dist/esm/lib/pattern/Modal/hooks/useModalContext.js +11 -0
  108. package/dist/esm/lib/pattern/Modal/hooks/useModalContext.js.map +1 -0
  109. package/dist/esm/lib/pattern/Modal/hooks/useModalState.js +15 -0
  110. package/dist/esm/lib/pattern/Modal/hooks/useModalState.js.map +1 -0
  111. package/dist/esm/lib/pattern/Modal/index.js +4 -0
  112. package/dist/esm/lib/pattern/Modal/index.js.map +1 -0
  113. package/dist/esm/lib/pattern/Modal/styles.css +119 -0
  114. package/dist/esm/lib/pattern/Modal/types.js +2 -0
  115. package/dist/esm/lib/pattern/Modal/types.js.map +1 -0
  116. package/dist/esm/lib/pattern/Modal/withModal.js +102 -0
  117. package/dist/esm/lib/pattern/Modal/withModal.js.map +1 -0
  118. package/dist/esm/lib/pattern/Timeline/common/Content/styles.css +16 -12
  119. package/dist/esm/lib/pattern/Timeline/common/Event/styles.css +116 -112
  120. package/dist/esm/lib/pattern/Timeline/styles.css +16 -12
  121. package/dist/esm/lib/pattern/index.js +1 -0
  122. package/dist/esm/lib/pattern/index.js.map +1 -1
  123. package/dist/esm/lib/subcomponent/Spinner/styles.css +38 -34
  124. package/dist/types/lib/_work_in_progress/grid/ApplicationLayout/ApplicationLayout.d.ts.map +1 -1
  125. package/dist/types/lib/_work_in_progress/grid/GridCard/GridCard.d.ts.map +1 -1
  126. package/dist/types/lib/_work_in_progress/grid/SettingsView/SettingsView.d.ts.map +1 -1
  127. package/dist/types/lib/component/Badge/types.d.ts +1 -1
  128. package/dist/types/lib/component/Badge/types.d.ts.map +1 -1
  129. package/dist/types/lib/component/Breadcrumbs/types.d.ts +2 -2
  130. package/dist/types/lib/component/Breadcrumbs/types.d.ts.map +1 -1
  131. package/dist/types/lib/component/Chip/Chip.d.ts +2 -2
  132. package/dist/types/lib/component/Chip/Chip.d.ts.map +1 -1
  133. package/dist/types/lib/component/Chip/types.d.ts +10 -8
  134. package/dist/types/lib/component/Chip/types.d.ts.map +1 -1
  135. package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts +4 -4
  136. package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts.map +1 -1
  137. package/dist/types/lib/component/ContextualMenu/common/Item/Item.d.ts.map +1 -1
  138. package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts +1 -1
  139. package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts.map +1 -1
  140. package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts +9 -7
  141. package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts.map +1 -1
  142. package/dist/types/lib/component/ContextualMenu/types.d.ts +15 -7
  143. package/dist/types/lib/component/ContextualMenu/types.d.ts.map +1 -1
  144. package/dist/types/lib/component/Tabs/types.d.ts +2 -2
  145. package/dist/types/lib/component/Tabs/types.d.ts.map +1 -1
  146. package/dist/types/lib/component/Tooltip/TooltipEngine.d.ts +16 -0
  147. package/dist/types/lib/component/Tooltip/TooltipEngine.d.ts.map +1 -0
  148. package/dist/types/lib/component/Tooltip/index.d.ts +1 -0
  149. package/dist/types/lib/component/Tooltip/index.d.ts.map +1 -1
  150. package/dist/types/lib/component/Tooltip/withTooltip.d.ts +9 -3
  151. package/dist/types/lib/component/Tooltip/withTooltip.d.ts.map +1 -1
  152. package/dist/types/lib/hooks/useContextualMenu/index.d.ts +1 -0
  153. package/dist/types/lib/hooks/useContextualMenu/index.d.ts.map +1 -1
  154. package/dist/types/lib/hooks/useContextualMenu/isMenuSeparator.d.ts +13 -0
  155. package/dist/types/lib/hooks/useContextualMenu/isMenuSeparator.d.ts.map +1 -0
  156. package/dist/types/lib/hooks/useContextualMenu/types.d.ts +45 -15
  157. package/dist/types/lib/hooks/useContextualMenu/types.d.ts.map +1 -1
  158. package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts +5 -6
  159. package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts.map +1 -1
  160. package/dist/types/lib/hooks/useDisclosure/types.d.ts +7 -2
  161. package/dist/types/lib/hooks/useDisclosure/types.d.ts.map +1 -1
  162. package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts +1 -1
  163. package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts.map +1 -1
  164. package/dist/types/lib/hooks/useWindowFitment/types.d.ts +12 -3
  165. package/dist/types/lib/hooks/useWindowFitment/types.d.ts.map +1 -1
  166. package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts +11 -6
  167. package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts.map +1 -1
  168. package/dist/types/lib/pattern/Modal/Context.d.ts +10 -0
  169. package/dist/types/lib/pattern/Modal/Context.d.ts.map +1 -0
  170. package/dist/types/lib/pattern/Modal/Provider.d.ts +63 -0
  171. package/dist/types/lib/pattern/Modal/Provider.d.ts.map +1 -0
  172. package/dist/types/lib/pattern/Modal/common/Content/Content.d.ts +17 -0
  173. package/dist/types/lib/pattern/Modal/common/Content/Content.d.ts.map +1 -0
  174. package/dist/types/lib/pattern/Modal/common/Content/index.d.ts +3 -0
  175. package/dist/types/lib/pattern/Modal/common/Content/index.d.ts.map +1 -0
  176. package/dist/types/lib/pattern/Modal/common/Content/types.d.ts +15 -0
  177. package/dist/types/lib/pattern/Modal/common/Content/types.d.ts.map +1 -0
  178. package/dist/types/lib/pattern/Modal/common/Footer/Footer.d.ts +18 -0
  179. package/dist/types/lib/pattern/Modal/common/Footer/Footer.d.ts.map +1 -0
  180. package/dist/types/lib/pattern/Modal/common/Footer/index.d.ts +3 -0
  181. package/dist/types/lib/pattern/Modal/common/Footer/index.d.ts.map +1 -0
  182. package/dist/types/lib/pattern/Modal/common/Footer/types.d.ts +16 -0
  183. package/dist/types/lib/pattern/Modal/common/Footer/types.d.ts.map +1 -0
  184. package/dist/types/lib/pattern/Modal/common/Header/Header.d.ts +24 -0
  185. package/dist/types/lib/pattern/Modal/common/Header/Header.d.ts.map +1 -0
  186. package/dist/types/lib/pattern/Modal/common/Header/index.d.ts +3 -0
  187. package/dist/types/lib/pattern/Modal/common/Header/index.d.ts.map +1 -0
  188. package/dist/types/lib/pattern/Modal/common/Header/types.d.ts +36 -0
  189. package/dist/types/lib/pattern/Modal/common/Header/types.d.ts.map +1 -0
  190. package/dist/types/lib/pattern/Modal/common/index.d.ts +4 -0
  191. package/dist/types/lib/pattern/Modal/common/index.d.ts.map +1 -0
  192. package/dist/types/lib/pattern/Modal/hooks/useModalContext.d.ts +4 -0
  193. package/dist/types/lib/pattern/Modal/hooks/useModalContext.d.ts.map +1 -0
  194. package/dist/types/lib/pattern/Modal/hooks/useModalState.d.ts +10 -0
  195. package/dist/types/lib/pattern/Modal/hooks/useModalState.d.ts.map +1 -0
  196. package/dist/types/lib/pattern/Modal/index.d.ts +4 -0
  197. package/dist/types/lib/pattern/Modal/index.d.ts.map +1 -0
  198. package/dist/types/lib/pattern/Modal/types.d.ts +122 -0
  199. package/dist/types/lib/pattern/Modal/types.d.ts.map +1 -0
  200. package/dist/types/lib/pattern/Modal/withModal.d.ts +74 -0
  201. package/dist/types/lib/pattern/Modal/withModal.d.ts.map +1 -0
  202. package/dist/types/lib/pattern/index.d.ts +1 -0
  203. package/dist/types/lib/pattern/index.d.ts.map +1 -1
  204. package/package.json +28 -18
@@ -1,124 +1,128 @@
1
- /**
2
- * Timeline.Event styles
3
- * @implements ds:global.subcomponent.timeline-event
4
- *
5
- * DSL anatomy mapping:
6
- * - layout.type: flow -> display: flex
7
- * - layout.direction: horizontal -> flex-direction: row
8
- */
9
- .ds.timeline-event {
10
- /* layout.type: flow, layout.direction: horizontal */
11
- display: flex;
12
- flex-direction: row;
13
- gap: var(--timeline-event-gap, var(--spacing-medium, 1rem));
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
14
2
 
15
- /* Position relative for the connecting line */
16
- position: relative;
17
- }
3
+ @layer ds.components.global {
4
+ /**
5
+ * Timeline.Event styles
6
+ * @implements ds:global.subcomponent.timeline-event
7
+ *
8
+ * DSL anatomy mapping:
9
+ * - layout.type: flow -> display: flex
10
+ * - layout.direction: horizontal -> flex-direction: row
11
+ */
12
+ .ds.timeline-event {
13
+ /* layout.type: flow, layout.direction: horizontal */
14
+ display: flex;
15
+ flex-direction: row;
16
+ gap: var(--timeline-event-gap, var(--spacing-medium, 1rem));
17
+
18
+ /* Position relative for the connecting line */
19
+ position: relative;
20
+ }
18
21
 
19
- /**
20
- * Timeline marker/dot
21
- * Visual indicator connecting events
22
- */
23
- .ds.timeline-event > .marker {
24
- flex-shrink: 0;
25
- width: var(--timeline-marker-size, 12px);
26
- height: var(--timeline-marker-size, 12px);
27
- border-radius: 50%;
28
- background-color: var(
29
- --modifier-color-foreground-primary,
30
- var(--timeline-marker-color, var(--color-border, #ccc))
31
- );
32
- border: var(--timeline-marker-border-width, 2px) solid
33
- var(
34
- --modifier-color-border,
35
- var(--timeline-marker-border-color, var(--color-surface, #fff))
22
+ /**
23
+ * Timeline marker/dot
24
+ * Visual indicator connecting events
25
+ */
26
+ .ds.timeline-event > .marker {
27
+ flex-shrink: 0;
28
+ width: var(--timeline-marker-size, 12px);
29
+ height: var(--timeline-marker-size, 12px);
30
+ border-radius: 50%;
31
+ background-color: var(
32
+ --modifier-color-foreground-primary,
33
+ var(--timeline-marker-color, var(--color-border, #ccc))
36
34
  );
37
- margin-top: var(--timeline-marker-offset, 0.25rem);
35
+ border: var(--timeline-marker-border-width, 2px) solid
36
+ var(
37
+ --modifier-color-border,
38
+ var(--timeline-marker-border-color, var(--color-surface, #fff))
39
+ );
40
+ margin-top: var(--timeline-marker-offset, 0.25rem);
38
41
 
39
- /* Position for connecting line */
40
- position: relative;
41
- z-index: 1;
42
- }
42
+ /* Position for connecting line */
43
+ position: relative;
44
+ z-index: 1;
45
+ }
43
46
 
44
- /* Connecting line between events */
45
- .ds.timeline-event::before {
46
- content: "";
47
- position: absolute;
48
- left: calc(var(--timeline-marker-size, 12px) / 2 - 1px);
49
- top: calc(
50
- var(--timeline-marker-size, 12px) +
51
- var(--timeline-marker-offset, 0.25rem)
52
- );
53
- bottom: calc(
54
- -1 *
55
- var(--timeline-event-spacing, var(--spacing-large, 1.5rem))
56
- );
57
- width: var(--timeline-line-width, 2px);
58
- background-color: var(--timeline-line-color, var(--color-border, #e0e0e0));
59
- }
47
+ /* Connecting line between events */
48
+ .ds.timeline-event::before {
49
+ content: "";
50
+ position: absolute;
51
+ left: calc(var(--timeline-marker-size, 12px) / 2 - 1px);
52
+ top: calc(
53
+ var(--timeline-marker-size, 12px) +
54
+ var(--timeline-marker-offset, 0.25rem)
55
+ );
56
+ bottom: calc(
57
+ -1 *
58
+ var(--timeline-event-spacing, var(--spacing-large, 1.5rem))
59
+ );
60
+ width: var(--timeline-line-width, 2px);
61
+ background-color: var(--timeline-line-color, var(--color-border, #e0e0e0));
62
+ }
60
63
 
61
- /* Hide line for last event */
62
- .ds.timeline-event:last-child::before {
63
- display: none;
64
- }
64
+ /* Hide line for last event */
65
+ .ds.timeline-event:last-child::before {
66
+ display: none;
67
+ }
65
68
 
66
- /**
67
- * Event content container
68
- * DSL: layout.type: flow, layout.direction: horizontal
69
- * The edges (actor, datetime, payload) flow horizontally per DSL spec
70
- */
71
- .ds.timeline-event > .content {
72
- flex: 1;
73
- min-width: 0;
74
- padding-bottom: var(--timeline-event-spacing, var(--spacing-large, 1.5rem));
69
+ /**
70
+ * Event content container
71
+ * DSL: layout.type: flow, layout.direction: horizontal
72
+ * The edges (actor, datetime, payload) flow horizontally per DSL spec
73
+ */
74
+ .ds.timeline-event > .content {
75
+ flex: 1;
76
+ min-width: 0;
77
+ padding-bottom: var(--timeline-event-spacing, var(--spacing-large, 1.5rem));
75
78
 
76
- /* DSL edges flow horizontally: actor → datetime → payload */
77
- display: flex;
78
- flex-direction: row;
79
- flex-wrap: wrap;
80
- align-items: baseline;
81
- gap: var(--timeline-content-gap, var(--spacing-small, 0.5rem));
82
- }
79
+ /* DSL edges flow horizontally: actor → datetime → payload */
80
+ display: flex;
81
+ flex-direction: row;
82
+ flex-wrap: wrap;
83
+ align-items: baseline;
84
+ gap: var(--timeline-content-gap, var(--spacing-small, 0.5rem));
85
+ }
83
86
 
84
- /**
85
- * Actor element
86
- * DSL: role: actor (cardinality: 0..1)
87
- */
88
- .ds.timeline-event > .content > .actor {
89
- font-weight: var(
90
- --timeline-actor-font-weight,
91
- var(--font-weight-semibold, 600)
92
- );
93
- color: var(--timeline-actor-color, var(--color-text-primary, inherit));
94
- }
87
+ /**
88
+ * Actor element
89
+ * DSL: role: actor (cardinality: 0..1)
90
+ */
91
+ .ds.timeline-event > .content > .actor {
92
+ font-weight: var(
93
+ --timeline-actor-font-weight,
94
+ var(--font-weight-semibold, 600)
95
+ );
96
+ color: var(--timeline-actor-color, var(--color-text-primary, inherit));
97
+ }
95
98
 
96
- /**
97
- * Datetime element
98
- * DSL: role: datetime (cardinality: 0..1)
99
- */
100
- .ds.timeline-event > .content > .datetime {
101
- font-size: var(
102
- --timeline-datetime-font-size,
103
- var(--font-size-small, 0.875rem)
104
- );
105
- color: var(--timeline-datetime-color, var(--color-text-secondary, #666));
106
- }
99
+ /**
100
+ * Datetime element
101
+ * DSL: role: datetime (cardinality: 0..1)
102
+ */
103
+ .ds.timeline-event > .content > .datetime {
104
+ font-size: var(
105
+ --timeline-datetime-font-size,
106
+ var(--font-size-small, 0.875rem)
107
+ );
108
+ color: var(--timeline-datetime-color, var(--color-text-secondary, #666));
109
+ }
107
110
 
108
- /**
109
- * Payload element
110
- * DSL: role: payload (cardinality: 1, slotName: default)
111
- */
112
- .ds.timeline-event > .content > .payload {
113
- color: var(--timeline-payload-color, var(--color-text-primary, inherit));
114
- line-height: var(
115
- --timeline-payload-line-height,
116
- var(--font-line-height-relaxed, 1.6)
117
- );
118
- /* Allow payload to wrap to full width on its own line when content is long */
119
- flex-basis: 100%;
120
- }
111
+ /**
112
+ * Payload element
113
+ * DSL: role: payload (cardinality: 1, slotName: default)
114
+ */
115
+ .ds.timeline-event > .content > .payload {
116
+ color: var(--timeline-payload-color, var(--color-text-primary, inherit));
117
+ line-height: var(
118
+ --timeline-payload-line-height,
119
+ var(--font-line-height-relaxed, 1.6)
120
+ );
121
+ /* Allow payload to wrap to full width on its own line when content is long */
122
+ flex-basis: 100%;
123
+ }
121
124
 
122
- /* Criticality styling is handled by the modifier system:
123
- .success, .error, .warning, .information classes set
124
- --modifier-color-foreground-primary via design-tokens. */
125
+ /* Criticality styling is handled by the modifier system:
126
+ .success, .error, .warning, .information classes set
127
+ --modifier-color-foreground-primary via design-tokens. */
128
+ }
@@ -1,13 +1,17 @@
1
- /**
2
- * Timeline styles
3
- * @implements ds:global.pattern.timeline
4
- *
5
- * DSL anatomy mapping:
6
- * - layout.type: stack -> display: flex; flex-direction: column
7
- * - layout.direction: vertical -> flex-direction: column
8
- */
9
- .ds.timeline {
10
- /* layout.type: stack, layout.direction: vertical */
11
- display: flex;
12
- flex-direction: column;
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
2
+
3
+ @layer ds.components.global {
4
+ /**
5
+ * Timeline styles
6
+ * @implements ds:global.pattern.timeline
7
+ *
8
+ * DSL anatomy mapping:
9
+ * - layout.type: stack -> display: flex; flex-direction: column
10
+ * - layout.direction: vertical -> flex-direction: column
11
+ */
12
+ .ds.timeline {
13
+ /* layout.type: stack, layout.direction: vertical */
14
+ display: flex;
15
+ flex-direction: column;
16
+ }
13
17
  }
@@ -1,3 +1,4 @@
1
1
  // ds:Pattern tier barrel: compositions of components into reusable layouts.
2
+ export * from "./Modal/index.js";
2
3
  export * from "./Timeline/index.js";
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/pattern/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/pattern/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
@@ -5,46 +5,50 @@
5
5
  * The Spinner renders the `spinner` glyph and rotates it continuously. The
6
6
  * rotation is a linear, infinite animation so the motion reads as steady
7
7
  * rather than eased.
8
+ *
9
+ * Layer: ds.components.global (@canonical/styles README, "Cascade layers").
8
10
  */
9
11
 
10
- /* A full 0→360deg turn. Keep it a full turn: Chromatic freezes infinite
11
- animations at the last frame of the cycle, so a complete rotation lands on
12
- 360deg (visually identical to 0deg) and the snapshot stays deterministic. A
13
- partial arc here would make visual tests flaky. */
14
- @keyframes ds-spinner-rotate {
15
- from {
16
- transform: rotate(0deg);
17
- }
18
- to {
19
- transform: rotate(360deg);
12
+ @layer ds.components.global {
13
+ /* A full 0→360deg turn. Keep it a full turn: Chromatic freezes infinite
14
+ animations at the last frame of the cycle, so a complete rotation lands on
15
+ 360deg (visually identical to 0deg) and the snapshot stays deterministic. A
16
+ partial arc here would make visual tests flaky. */
17
+ @keyframes ds-spinner-rotate {
18
+ from {
19
+ transform: rotate(0deg);
20
+ }
21
+ to {
22
+ transform: rotate(360deg);
23
+ }
20
24
  }
21
- }
22
25
 
23
- .ds.spinner {
24
- display: inline-block;
25
- vertical-align: middle;
26
+ .ds.spinner {
27
+ display: inline-block;
28
+ vertical-align: middle;
26
29
 
27
- /* Sized from the text: the `1em` base makes the spinner track the container
28
- `font-size`, so it matches adjacent text. The cascade is, in order:
29
- `--spinner-size` (per-instance override) → `--icon-size` (the shared icon
30
- convention, so a global icon-size tweak also sizes spinners) → `1em`. No
31
- value is hard-declared here, so `:root`/ancestor overrides win. */
32
- width: var(--spinner-size, var(--icon-size, 1em));
33
- height: var(--spinner-size, var(--icon-size, 1em));
30
+ /* Sized from the text: the `1em` base makes the spinner track the container
31
+ `font-size`, so it matches adjacent text. The cascade is, in order:
32
+ `--spinner-size` (per-instance override) → `--icon-size` (the shared icon
33
+ convention, so a global icon-size tweak also sizes spinners) → `1em`. No
34
+ value is hard-declared here, so `:root`/ancestor overrides win. */
35
+ width: var(--spinner-size, var(--icon-size, 1em));
36
+ height: var(--spinner-size, var(--icon-size, 1em));
34
37
 
35
- /* A continuous spinner wants a much longer, linear cycle than the eased
36
- transition tokens describe (the fastest, `--motion-duration-slow`, is 0.4s
37
- — frantic for a loop). Default to ~1s/turn via a `var()` fallback (not a
38
- hard declaration) so a consumer can retune the cycle from `:root` or an
39
- ancestor with `--spinner-duration`. There is no ratified motion token this
40
- long yet, hence the literal fallback. */
41
- animation: ds-spinner-rotate var(--spinner-duration, 1s) linear infinite;
42
- }
38
+ /* A continuous spinner wants a much longer, linear cycle than the eased
39
+ transition tokens describe (the fastest, `--motion-duration-slow`, is 0.4s
40
+ — frantic for a loop). Default to ~1s/turn via a `var()` fallback (not a
41
+ hard declaration) so a consumer can retune the cycle from `:root` or an
42
+ ancestor with `--spinner-duration`. There is no ratified motion token this
43
+ long yet, hence the literal fallback. */
44
+ animation: ds-spinner-rotate var(--spinner-duration, 1s) linear infinite;
45
+ }
43
46
 
44
- /* Honour users who have asked for reduced motion: hold the icon still rather
45
- than spinning it. The spinner remains visible as a static activity glyph. */
46
- @media (prefers-reduced-motion: reduce) {
47
- .ds.spinner {
48
- animation: none;
47
+ /* Honour users who have asked for reduced motion: hold the icon still rather
48
+ than spinning it. The spinner remains visible as a static activity glyph. */
49
+ @media (prefers-reduced-motion: reduce) {
50
+ .ds.spinner {
51
+ animation: none;
52
+ }
49
53
  }
50
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/grid/ApplicationLayout/ApplicationLayout.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,cAAc,CAAC;AAGtB;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,mCAI/B,sBAAsB,KAAG,KAAK,CAAC,SAWjC,CAAC"}
1
+ {"version":3,"file":"ApplicationLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/grid/ApplicationLayout/ApplicationLayout.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,cAAc,CAAC;AAOtB;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,mCAI/B,sBAAsB,KAAG,KAAK,CAAC,SAWjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"GridCard.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/grid/GridCard/GridCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,cAAc,CAAC;AAEtB;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,mCAItB,aAAa,KAAG,KAAK,CAAC,SAMxB,CAAC"}
1
+ {"version":3,"file":"GridCard.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/grid/GridCard/GridCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,cAAc,CAAC;AAMtB;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,mCAItB,aAAa,KAAG,KAAK,CAAC,SASxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsView.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/grid/SettingsView/SettingsView.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,cAAc,CAAC;AAEtB;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,0CAK1B,iBAAiB,KAAG,KAAK,CAAC,SAoB5B,CAAC"}
1
+ {"version":3,"file":"SettingsView.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/_work_in_progress/grid/SettingsView/SettingsView.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,cAAc,CAAC;AAMtB;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,0CAK1B,iBAAiB,KAAG,KAAK,CAAC,SAoB5B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { ModifierFamily } from "@canonical/ds-types";
2
- import type { HumanizeNumberOptions, PluralizeOptions } from "@canonical/utils";
2
+ import type { HumanizeNumberOptions, PluralizeOptions } from "@canonical/ds-utils";
3
3
  import type { ComponentProps } from "react";
4
4
  type OwnProps = {
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Badge/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IAE5C;;OAEG;IACH,eAAe,CAAC,EAAE,qBAAqB,CAAC;IAExC;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAC/B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,UAAU,EACV,OAAO,GAAG,iBAAiB,GAAG,kBAAkB,CACjD,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Badge/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IAE5C;;OAEG;IACH,eAAe,CAAC,EAAE,qBAAqB,CAAC;IAExC;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAC/B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,UAAU,EACV,OAAO,GAAG,iBAAiB,GAAG,kBAAkB,CACjD,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -12,7 +12,7 @@ import type { ItemProps, LinkComponentProps } from "./common/Item/types.js";
12
12
  * products only. Not designed/approved for Canonical products; Canonical
13
13
  * products must use the default Breadcrumbs.Item.
14
14
  */
15
- export interface BreadcrumbItem extends Item {
15
+ export type BreadcrumbItem = Item & {
16
16
  /**
17
17
  * Whether this is the current page.
18
18
  * When true, renders as text instead of link.
@@ -25,7 +25,7 @@ export interface BreadcrumbItem extends Item {
25
25
  * e.g. A specialized renderer for complex items.
26
26
  */
27
27
  Component?: ComponentType<any>;
28
- }
28
+ };
29
29
  type OwnProps = {
30
30
  /**
31
31
  * Navigation items to display (WD405 Item type)
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Breadcrumbs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IAEH,SAAS,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CAChC;AAED,KAAK,QAAQ,GAAG;IACd;;;;;;;;OAQG;IACH,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;IACxD;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GACrC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAClC,KAAK,EAAE,gBAAgB,KACpB,YAAY,CAAC,GAAG;IACnB,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,YAAY,CAAC;CAC1C,CAAC;AAEF,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Breadcrumbs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IAEH,SAAS,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CAChC,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd;;;;;;;;OAQG;IACH,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;IACxD;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GACrC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAClC,KAAK,EAAE,gBAAgB,KACpB,YAAY,CAAC,GAAG;IACnB,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,YAAY,CAAC;CAC1C,CAAC;AAEF,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type React from "react";
2
2
  import "./styles.css";
3
- import type { ChipPropsType } from "./types.js";
3
+ import type { ChipProps } from "./types.js";
4
4
  /**
5
5
  * A chip is a compact, interactive component used to represent an attribute,
6
6
  * entity, or filter while facilitating secondary actions.
@@ -12,6 +12,6 @@ import type { ChipPropsType } from "./types.js";
12
12
  *
13
13
  * @implements ds:global.component.chip
14
14
  */
15
- declare const Chip: (props: ChipPropsType) => React.ReactElement;
15
+ declare const Chip: (props: ChipProps) => React.ReactElement;
16
16
  export default Chip;
17
17
  //# sourceMappingURL=Chip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIhD;;;;;;;;;;GAUG;AACH,QAAA,MAAM,IAAI,GAAI,OAAO,aAAa,KAAG,KAAK,CAAC,YA+D1C,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;;;;;;;;;;GAUG;AACH,QAAA,MAAM,IAAI,GAAI,OAAO,SAAS,KAAG,KAAK,CAAC,YA+DtC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import type { ModifierFamily } from "@canonical/ds-types";
2
2
  import type { ComponentProps, MouseEventHandler } from "react";
3
3
  /**
4
- * The Chip's DS-owned props, shared by both of its possible roots.
4
+ * The Chip's design-system props, shared by both of its possible roots.
5
+ * Private: `ChipProps` below is the public type, so the name a consumer
6
+ * imports is the one that describes what `<Chip>` accepts.
5
7
  */
6
- export interface ChipProps {
8
+ type OwnProps = {
7
9
  /**
8
10
  * Criticality modifier for status indication.
9
11
  * - "success": Positive status
@@ -26,28 +28,28 @@ export interface ChipProps {
26
28
  value?: string;
27
29
  /** Called when the chip is dismissed. */
28
30
  onDismiss?: () => void;
29
- }
31
+ };
30
32
  /**
31
33
  * Interactive chip — rendered as a `<button>` when an `onClick` handler is
32
34
  * supplied, so it extends native `<button>` props.
33
35
  */
34
- type InteractiveChipProps = ChipProps & {
36
+ type InteractiveChipProps = OwnProps & {
35
37
  /** Called when the chip is clicked. Its presence makes the chip a button. */
36
38
  onClick: MouseEventHandler<HTMLButtonElement>;
37
- } & Omit<ComponentProps<"button">, keyof ChipProps | "onClick" | "children">;
39
+ } & Omit<ComponentProps<"button">, keyof OwnProps | "onClick" | "children">;
38
40
  /**
39
41
  * Static chip — rendered as a `<span>` when no `onClick` is supplied, so it
40
42
  * extends native `<span>` props.
41
43
  */
42
- type StaticChipProps = ChipProps & {
44
+ type StaticChipProps = OwnProps & {
43
45
  /** A static chip has no click handler and renders a `<span>`. */
44
46
  onClick?: undefined;
45
- } & Omit<ComponentProps<"span">, keyof ChipProps | "onClick" | "children">;
47
+ } & Omit<ComponentProps<"span">, keyof OwnProps | "onClick" | "children">;
46
48
  /**
47
49
  * Chip props: a discriminated union on `onClick` (issue #628 precedent). A chip
48
50
  * with an `onClick` renders a `<button>` and extends button props; one without
49
51
  * renders a `<span>` and extends span props. No polymorphic `as` generic.
50
52
  */
51
- export type ChipPropsType = InteractiveChipProps | StaticChipProps;
53
+ export type ChipProps = InteractiveChipProps | StaticChipProps;
52
54
  export {};
53
55
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Chip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IAE5C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IAEpC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;GAGG;AACH,KAAK,oBAAoB,GAAG,SAAS,GAAG;IACtC,6EAA6E;IAC7E,OAAO,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAC/C,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAE7E;;;GAGG;AACH,KAAK,eAAe,GAAG,SAAS,GAAG;IACjC,iEAAiE;IACjE,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/Chip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/D;;;;GAIG;AACH,KAAK,QAAQ,GAAG;IACd;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IAE5C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IAEpC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,KAAK,oBAAoB,GAAG,QAAQ,GAAG;IACrC,6EAA6E;IAC7E,OAAO,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAC/C,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAE5E;;;GAGG;AACH,KAAK,eAAe,GAAG,QAAQ,GAAG;IAChC,iEAAiE;IACjE,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,oBAAoB,GAAG,eAAe,CAAC"}
@@ -2,14 +2,14 @@ import type React from "react";
2
2
  import type { ContextualMenuProps } from "./types.js";
3
3
  import "./styles.css";
4
4
  /**
5
- * A contextual menu presents a list of grouped actions anchored to a trigger.
6
- * It opens on click, positions itself with viewport-fitment, and supports full
7
- * keyboard navigation including arrow traversal across groups.
5
+ * A contextual menu presents a flat list of actions — optionally partitioned
6
+ * by separators — anchored to a trigger. It opens on click, positions itself
7
+ * with viewport-fitment, and supports full keyboard navigation.
8
8
  *
9
9
  * `import { ContextualMenu } from "@canonical/react-ds-global";`
10
10
  *
11
11
  * @implements ds:global.component.contextual_menu
12
12
  */
13
- declare const ContextualMenu: ({ trigger, groups, label, className, preferredDirections, distance, gutter, maxWidth, autoFit, wrap, onSelect, open, onOpenChange, ...props }: ContextualMenuProps) => React.ReactElement;
13
+ declare const ContextualMenu: ({ children, items, label, className, preferredDirections, distance, gutter, maxWidth, autoFit, wrap, onSelect, open, onOpenChange, ...props }: ContextualMenuProps) => React.ReactElement;
14
14
  export default ContextualMenu;
15
15
  //# sourceMappingURL=ContextualMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextualMenu.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ContextualMenu/ContextualMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,mBAAmB,EAAY,MAAM,YAAY,CAAC;AAChE,OAAO,cAAc,CAAC;AAItB;;;;;;;;GAQG;AACH,QAAA,MAAM,cAAc,GAAI,+IAerB,mBAAmB,KAAG,KAAK,CAAC,YAsJ9B,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ContextualMenu.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/ContextualMenu/ContextualMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,mBAAmB,EAAY,MAAM,YAAY,CAAC;AAChE,OAAO,cAAc,CAAC;AAItB;;;;;;;;GAQG;AACH,QAAA,MAAM,cAAc,GAAI,+IAerB,mBAAmB,KAAG,KAAK,CAAC,YAkJ9B,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/ContextualMenu/common/Item/Item.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,GAAI,+BAA+B,SAAS,KAAG,KAAK,CAAC,YAuD9D,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/ContextualMenu/common/Item/Item.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,GAAI,+BAA+B,SAAS,KAAG,KAAK,CAAC,YAkF9D,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -8,7 +8,7 @@ import type { MenuItem } from "../types.js";
8
8
  * whole tree shares one highlight path, one roving focus, and one keyboard
9
9
  * handler.
10
10
  */
11
- export interface MenuContextValue extends Pick<UseContextualMenuResult, "getItemProps" | "getMenuProps" | "getGroupProps" | "getNodeStatus" | "highlightItem" | "close"> {
11
+ export interface MenuContextValue extends Pick<UseContextualMenuResult, "getItemProps" | "getMenuProps" | "getNodeStatus" | "highlightItem" | "close" | "isOpen"> {
12
12
  /** Activate an item (run the consumer's onSelect and close the menu). */
13
13
  onSelectItem: (item: _Item<MenuItem>) => void;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MenuContext.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/component/ContextualMenu/common/MenuContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,WAAW,gBACf,SAAQ,IAAI,CACV,uBAAuB,EACrB,cAAc,GACd,cAAc,GACd,eAAe,GACf,eAAe,GACf,eAAe,GACf,OAAO,CACV;IACD,yEAAyE;IACzE,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,WAAW,kDAA+C,CAAC;AAEjE,yEAAyE;AACzE,eAAO,MAAM,cAAc,QAAO,gBAMjC,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"MenuContext.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/component/ContextualMenu/common/MenuContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,WAAW,gBACf,SAAQ,IAAI,CACV,uBAAuB,EACrB,cAAc,GACd,cAAc,GACd,eAAe,GACf,eAAe,GACf,OAAO,GACP,QAAQ,CACX;IACD,yEAAyE;IACzE,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,WAAW,kDAA+C,CAAC;AAEjE,yEAAyE;AACzE,eAAO,MAAM,cAAc,QAAO,gBAMjC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,15 +1,17 @@
1
1
  import type { _Item } from "@canonical/ds-types";
2
2
  import { type ReactElement } from "react";
3
- import type { MenuItem } from "../../types.js";
3
+ import type { MenuEntry } from "../../types.js";
4
4
  /**
5
- * One node in a (possibly nested) contextual menu. A leaf renders a plain item;
6
- * a submenu parent renders the item plus a positioned nested popup for its
7
- * children (see {@link SubMenuParent}). The hook that positions the popup runs
8
- * ONLY for submenu parents — leaves render a bare item — so a menu of leaves
9
- * spins up no positioning machinery.
5
+ * One node in a (possibly nested) contextual menu. A separator renders as a
6
+ * plain divider (no item props — it is not interactive, and the navigation
7
+ * tree never highlights it); a leaf renders a plain item; a submenu parent
8
+ * renders the item plus a positioned nested popup for its children (see
9
+ * {@link SubMenuParent}). The hook that positions the popup runs ONLY for
10
+ * submenu parents — leaves render a bare item — so a menu of leaves spins up
11
+ * no positioning machinery.
10
12
  */
11
13
  declare const SubMenu: ({ item }: {
12
- item: _Item<MenuItem>;
14
+ item: _Item<MenuEntry>;
13
15
  }) => ReactElement;
14
16
  export default SubMenu;
15
17
  //# sourceMappingURL=SubMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubMenu.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/ContextualMenu/common/SubMenu/SubMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,KAAK,YAAY,EAAsC,MAAM,OAAO,CAAC;AAO9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C;;;;;;GAMG;AACH,QAAA,MAAM,OAAO,GAAI,UAAU;IAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;CAAE,KAAG,YActD,CAAC;AAkJF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"SubMenu.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/ContextualMenu/common/SubMenu/SubMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,KAAK,YAAY,EAAsC,MAAM,OAAO,CAAC;AAQ9E,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,gBAAgB,CAAC;AAI1D;;;;;;;;GAQG;AACH,QAAA,MAAM,OAAO,GAAI,UAAU;IAAE,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;CAAE,KAAG,YAmBvD,CAAC;AA+JF,eAAe,OAAO,CAAC"}
@@ -1,17 +1,25 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
- import type { MenuItem, UseContextualMenuProps, WindowFitmentPlacement, WindowFitmentSide } from "../../hooks/index.js";
3
- export type { MenuItem } from "../../hooks/index.js";
4
- type OwnProps = Pick<UseContextualMenuProps, "distance" | "gutter" | "maxWidth" | "autoFit" | "wrap"> & {
2
+ import type { MenuEntry, MenuItem, UseContextualMenuProps, WindowFitmentPlacement, WindowFitmentSide } from "../../hooks/index.js";
3
+ export type { MenuEntry, MenuItem, MenuSeparator } from "../../hooks/index.js";
4
+ type OwnProps = Pick<UseContextualMenuProps, "distance" | "gutter" | "maxWidth" | "autoFit"> & {
5
+ /**
6
+ * Whether arrow keys wrap at the first/last item. Defaults to true (the
7
+ * APG menu convention), unlike the underlying hook. Declared here rather
8
+ * than picked from the hook so the differing default is documented where a
9
+ * consumer reads it.
10
+ */
11
+ wrap?: boolean;
5
12
  /**
6
13
  * The trigger content, rendered inside the trigger button. Clicking it opens
7
14
  * the menu.
8
15
  */
9
- trigger: ReactNode;
16
+ children: ReactNode;
10
17
  /**
11
- * The menu groups. Each top-level item is a group; its `items` are the menu
12
- * entries. One level is supported now; deeper nesting is reserved for submenus.
18
+ * The menu entries: one flat list of items and separators
19
+ * (`{ type: "separator", key: "…" }`). An item's own `items` form its submenu, which
20
+ * may itself contain separators.
13
21
  */
14
- groups: MenuItem[];
22
+ items: MenuEntry[];
15
23
  /** Accessible name for the menu. Falls back to labelling by the trigger. */
16
24
  label?: string;
17
25
  /**