@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Content/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import "./styles.css";
3
+ const componentCssClassName = "ds modal-footer";
4
+ /**
5
+ * Modal.Footer subcomponent
6
+ *
7
+ * Holds the modal's actions. When the modal is a confirmation or a form, these
8
+ * capture the decision; the button's modifiers must match the consequence, so a
9
+ * destructive confirmation uses a destructive button.
10
+ *
11
+ * @implements ds:global.subcomponent.modal-footer
12
+ */
13
+ const Footer = ({ children, className, ...props }) => (_jsx("footer", { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: children }));
14
+ Footer.displayName = "Modal.Footer";
15
+ export default Footer;
16
+ //# sourceMappingURL=Footer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Footer/Footer.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACI,EAAsB,EAAE,CAAC,CACrC,iBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,QAAQ,GACF,CACV,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,cAAc,CAAC;AAEpC,eAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ // Generated by @canonical/summon-component:react v0.1.0
2
+ export { default as Footer } from "./Footer.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Footer/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,57 @@
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
2
+
3
+ @layer ds.components.global {
4
+ /**
5
+ * Modal.Footer styles
6
+ * @implements ds:global.subcomponent.modal-footer
7
+ *
8
+ * DSL anatomy mapping:
9
+ * - layout.type: flow, layout.direction: horizontal -> display: flex; flex-direction: row
10
+ * - layout.justify: end -> justify-content: flex-end
11
+ * - spacing.gap: spacing/small -> gap: var(--modal-footer-gap)
12
+ * - spacing.internal: spacing/medium -> padding-block / padding-inline
13
+ * - appearance.border.top: border/style/divider -> an inset ::before rule, not a
14
+ * border (a border would span the full dialog width; the design insets the
15
+ * rule to the inline padding)
16
+ */
17
+
18
+ /* Component tokens — sourced from @canonical/design-tokens */
19
+ :root {
20
+ /* The rules are quiet boundaries, not structural edges: `muted` is the
21
+ palest border token (gray-100 vs gray-520 for `--color-border`). */
22
+ --modal-footer-color-border: var(--color-border-muted);
23
+ --modal-footer-border-width: var(--dimension-stroke-thickness-medium);
24
+ --modal-footer-padding-block: var(--dimension-200);
25
+ --modal-footer-padding-inline: var(--modal-padding-inline);
26
+ --modal-footer-gap: var(--dimension-100);
27
+ }
28
+
29
+ .ds.modal-footer {
30
+ /* layout.type: flow, direction horizontal, justify end */
31
+ display: flex;
32
+ flex-direction: row;
33
+ align-items: center;
34
+ justify-content: flex-end;
35
+ gap: var(--modal-footer-gap);
36
+ padding-block: var(--modal-footer-padding-block);
37
+ padding-inline: var(--modal-footer-padding-inline);
38
+ /* Never shrink: only the content pane gives way. */
39
+ flex: 0 0 auto;
40
+ /* Positions the inset rule below. */
41
+ position: relative;
42
+
43
+ /*
44
+ The second of the two horizontal rules bounding the content — inset to the
45
+ inline padding so it aligns with the actions and the content. See
46
+ Modal.Header for why this is a pseudo-element and not a border.
47
+ */
48
+ &::before {
49
+ content: "";
50
+ position: absolute;
51
+ inset-block-start: 0;
52
+ inset-inline: var(--modal-footer-padding-inline);
53
+ block-size: var(--modal-footer-border-width);
54
+ background-color: var(--modal-footer-color-border);
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Footer/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "../../../../component/Button/index.js";
3
+ import { useModalContext } from "../../hooks/useModalContext.js";
4
+ import "./styles.css";
5
+ const componentCssClassName = "ds modal-header";
6
+ /**
7
+ * Modal.Header subcomponent
8
+ *
9
+ * Carries the modal title and the optional dismiss control. The title describes
10
+ * what the modal is for, giving the user context on what triggered it. Both the
11
+ * title id (which names the dialog) and the dismiss wiring come from the Modal
12
+ * context, so a composed header needs no props of its own.
13
+ *
14
+ * The title is not a heading element: headings structure the page's document
15
+ * outline, and a modal opens from anywhere in it, so no heading level would be
16
+ * right everywhere. The title names the dialog through `aria-labelledby`
17
+ * instead, which is what a screen reader announces when the modal opens.
18
+ *
19
+ * @implements ds:global.subcomponent.modal-header
20
+ */
21
+ const Header = ({ children, titleId, undismissible = false, dismissLabel = "Close", onDismiss, className, ...props }) => {
22
+ const modal = useModalContext();
23
+ return (_jsxs("header", { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: [_jsx("span", { className: "title", id: titleId ?? modal.titleId, children: children }), !undismissible && (_jsx(Button, { className: "close", importance: "tertiary", icon: "close", "aria-label": dismissLabel, onClick: onDismiss ?? modal.onDismiss }))] }));
24
+ };
25
+ Header.displayName = "Modal.Header";
26
+ export default Header;
27
+ //# sourceMappingURL=Header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Header/Header.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,QAAQ,EACR,OAAO,EACP,aAAa,GAAG,KAAK,EACrB,YAAY,GAAG,OAAO,EACtB,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACI,EAAsB,EAAE;IACpC,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,OAAO,CACL,kBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,aAET,eAAM,SAAS,EAAC,OAAO,EAAC,EAAE,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,YACjD,QAAQ,GACJ,EACN,CAAC,aAAa,IAAI,CACjB,KAAC,MAAM,IACL,SAAS,EAAC,OAAO,EACjB,UAAU,EAAC,UAAU,EACrB,IAAI,EAAC,OAAO,gBACA,YAAY,EACxB,OAAO,EAAE,SAAS,IAAI,KAAK,CAAC,SAAS,GACrC,CACH,IACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,cAAc,CAAC;AAEpC,eAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ // Generated by @canonical/summon-component:react v0.1.0
2
+ export { default as Header } from "./Header.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Header/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,79 @@
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
2
+
3
+ @layer ds.components.global {
4
+ /**
5
+ * Modal.Header styles
6
+ * @implements ds:global.subcomponent.modal-header
7
+ *
8
+ * DSL anatomy mapping:
9
+ * - layout.type: flow, layout.direction: horizontal -> display: flex; flex-direction: row
10
+ * - layout.align: center -> align-items: center
11
+ * - layout.justify: space-between -> justify-content: space-between
12
+ * - spacing.internal: spacing/medium -> padding-block / padding-inline
13
+ * - appearance.border.bottom: border/style/divider -> an inset ::after rule,
14
+ * not a border (a border would span the full dialog width; the design insets
15
+ * the rule to the inline padding)
16
+ */
17
+
18
+ /* Component tokens — sourced from @canonical/design-tokens */
19
+ :root {
20
+ /* The rules are quiet boundaries, not structural edges: `muted` is the
21
+ palest border token (gray-100 vs gray-520 for `--color-border`). */
22
+ --modal-header-color-border: var(--color-border-muted);
23
+ --modal-header-border-width: var(--dimension-stroke-thickness-medium);
24
+ --modal-header-padding-block: var(--dimension-200);
25
+ --modal-header-padding-inline: var(--modal-padding-inline);
26
+ --modal-header-gap: var(--dimension-200);
27
+ --modal-header-font-size: var(--typography-text-primary-font-size);
28
+ --modal-header-font-weight: var(--typography-weight-semiBold);
29
+ }
30
+
31
+ .ds.modal-header {
32
+ /* layout.type: flow, direction horizontal, align center, justify space-between */
33
+ display: flex;
34
+ flex-direction: row;
35
+ align-items: center;
36
+ justify-content: space-between;
37
+ gap: var(--modal-header-gap);
38
+
39
+ padding-block: var(--modal-header-padding-block);
40
+ padding-inline: var(--modal-header-padding-inline);
41
+ /* Never shrink: only the content pane gives way. */
42
+ flex: 0 0 auto;
43
+ /* Positions the inset rule below. */
44
+ position: relative;
45
+
46
+ /*
47
+ The first of the two horizontal rules bounding the content. Drawn as a
48
+ pseudo-element rather than a border so it can be inset to the inline padding
49
+ and align with the title, the content and the actions. A pseudo-element
50
+ belongs to this element for hit-testing, so a click on it targets the header
51
+ and never registers as a backdrop click on the dialog.
52
+ */
53
+ &::after {
54
+ content: "";
55
+ position: absolute;
56
+ inset-block-end: 0;
57
+ inset-inline: var(--modal-header-padding-inline);
58
+ block-size: var(--modal-header-border-width);
59
+ background-color: var(--modal-header-color-border);
60
+ }
61
+
62
+ > .title {
63
+ flex: 1;
64
+ font-size: var(--modal-header-font-size);
65
+ font-weight: var(--modal-header-font-weight);
66
+ }
67
+
68
+ > .close {
69
+ flex: 0 0 auto;
70
+ /*
71
+ Button tightens padding-inline-start when it has an icon, which suits an
72
+ icon+label button but leaves an icon-only one lopsided (8px vs 16px).
73
+ Equalise both sides through Button's own custom-property API.
74
+ */
75
+ --button-padding-inline-start: var(--dimension-100);
76
+ --button-padding-inline-end: var(--dimension-100);
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Header/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ // Generated by @canonical/summon-component:react v0.1.0
2
+ export * from "./Content/index.js";
3
+ export * from "./Footer/index.js";
4
+ export * from "./Header/index.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/pattern/Modal/common/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { useContext } from "react";
2
+ import Context from "../Context.js";
3
+ /** Reads the shared modal API. Throws if used outside a Modal. */
4
+ export const useModalContext = () => {
5
+ const value = useContext(Context);
6
+ if (!value) {
7
+ throw new Error("useModalContext must be used within a Modal.");
8
+ }
9
+ return value;
10
+ };
11
+ //# sourceMappingURL=useModalContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useModalContext.js","sourceRoot":"","sources":["../../../../../../src/lib/pattern/Modal/hooks/useModalContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,OAAO,MAAM,eAAe,CAAC;AAGpC,kEAAkE;AAClE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAsB,EAAE;IACrD,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { useCallback, useId } from "react";
2
+ /**
3
+ * The provider state threaded to the composed subcomponents: the id that names
4
+ * the dialog, and the dismissal that closes it. Centralising it here keeps the
5
+ * provider free of state logic.
6
+ */
7
+ const useModalState = (dialogRef) => {
8
+ const titleId = useId();
9
+ const onDismiss = useCallback(() => {
10
+ dialogRef.current?.close();
11
+ }, [dialogRef]);
12
+ return { titleId, onDismiss };
13
+ };
14
+ export default useModalState;
15
+ //# sourceMappingURL=useModalState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useModalState.js","sourceRoot":"","sources":["../../../../../../src/lib/pattern/Modal/hooks/useModalState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAG3C;;;;GAIG;AACH,MAAM,aAAa,GAAG,CACpB,SAA8C,EAC3B,EAAE;IACrB,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC7B,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAChB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Generated by @canonical/summon-component:react v0.1.0
2
+ export { default as Modal } from "./Provider.js";
3
+ export { default as withModal } from "./withModal.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/pattern/Modal/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,119 @@
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
2
+
3
+ @layer ds.components.global {
4
+ /**
5
+ * Modal styles
6
+ * @implements ds:global.pattern.modal
7
+ *
8
+ * DSL anatomy mapping:
9
+ * - edges[0] backdrop -> ::backdrop (painted by the native top layer, no DOM node)
10
+ * - edges[1] dialog container -> the <dialog> element itself
11
+ * - layout.type: stack, direction vertical -> display: flex; flex-direction: column
12
+ * - layout.overflow: hidden -> overflow: hidden
13
+ * - appearance.background: color/surface/overlay -> --surface-color-background,
14
+ * supplied by the `.modal` surface class in @canonical/design-tokens'
15
+ * modifiers.surfaces.css. That class is matched by this component's own
16
+ * `ds modal` className, so renaming the component class would silently drop
17
+ * the surface reset and the modal would inherit the page's layer depth.
18
+ *
19
+ * - appearance.radius: radius/modal -> --modal-border-radius
20
+ * - appearance.shadow: shadow/overlay -> no shadow token exists at
21
+ * design-tokens 0.8.1, and the design shows no outline on the panel, so the
22
+ * overlay alone separates the modal from the page
23
+ * - size.max.width / size.max.height -> --modal-max-inline-size / --modal-max-block-size
24
+ */
25
+
26
+ /* Component tokens — sourced from @canonical/design-tokens */
27
+ :root {
28
+ /*
29
+ The panel's own colours are not component tokens: they come from the surface
30
+ channels read on the element itself (see `.ds.modal` below). The backdrop is,
31
+ because `::backdrop` has no surface channel to read.
32
+ */
33
+ --modal-color-backdrop: var(--color-backdrop);
34
+ --modal-backdrop-blur: 0;
35
+ --modal-border-radius: var(--dimension-radius-medium);
36
+
37
+ /*
38
+ One inline padding shared by the header, content and footer, so the title,
39
+ the horizontal rules, the content and the actions all align on the same two
40
+ edges — as in the design. The parts read it directly: the sections are only
41
+ ever composed inside this modal, which is where the token is defined.
42
+ */
43
+ --modal-padding-inline: var(--dimension-300);
44
+
45
+ /*
46
+ design-tokens 0.8.1 ships no `size/modal/*` token, so these two are literals
47
+ rather than token references. They are the documented override point:
48
+ `<Modal style={{ "--modal-max-inline-size": "30rem" }} />`.
49
+ */
50
+
51
+ --modal-min-inline-size: 50ch;
52
+ --modal-max-inline-size: 130ch;
53
+
54
+ --modal-inline-size: clamp(
55
+ var(--modal-min-inline-size),
56
+ 30vw,
57
+ var(--modal-max-inline-size)
58
+ );
59
+
60
+ --modal-max-block-size: 80vh;
61
+ }
62
+
63
+ .ds.modal {
64
+ /*
65
+ Padding stays on the header/content/footer, never here, so that a click
66
+ landing on the dialog box itself can only be a backdrop click.
67
+ */
68
+ padding: 0;
69
+ /* layout.overflow: hidden — the content pane is the only scroller */
70
+ overflow: hidden;
71
+
72
+ inline-size: var(--modal-inline-size);
73
+
74
+ max-block-size: var(--modal-max-block-size);
75
+
76
+ /*
77
+ Read the surface channels on the element itself. The token layer defines a
78
+ `.modal` surface (identical to top-level `.surface`), matched by this
79
+ component's own `ds modal` className, so the dialog paints at base surface
80
+ depth even when opened from a nested `.surface` — which is the DSL's
81
+ `color/surface/overlay`.
82
+
83
+ The background channel is always emitted on the `.modal` surface, so it is
84
+ read bare. The text channel is different: the surface family emits
85
+ `--surface-color-text` only on polarity-inverting (contrasted) surfaces —
86
+ a same-polarity surface like `.modal` deliberately emits none, and the
87
+ documented consumption is `var(--surface-color-text, var(--color-text))`,
88
+ which falls through to the ambient page text.
89
+ */
90
+ color: var(--surface-color-text, var(--color-text));
91
+ background-color: var(--surface-color-background);
92
+
93
+ /*
94
+ The user-agent stylesheet gives <dialog> `border: solid` (medium width, ~3px)
95
+ and `padding: 1em`, so both must be reset explicitly rather than merely left
96
+ undeclared. The design shows no outline on the panel — the overlay separates
97
+ it from the page.
98
+ */
99
+ border: none;
100
+ border-radius: var(--modal-border-radius);
101
+
102
+ /*
103
+ A closed <dialog> is `display: none` by user-agent rule. Declaring display
104
+ unconditionally here would beat that and leave the modal permanently
105
+ visible, so the stack layout is scoped to the open state.
106
+ */
107
+ &[open] {
108
+ /* layout.type: stack, layout.direction: vertical */
109
+ display: flex;
110
+ flex-direction: column;
111
+ }
112
+
113
+ /* edges[0]: backdrop — mutes the page while the modal is active */
114
+ &::backdrop {
115
+ background-color: var(--modal-color-backdrop);
116
+ backdrop-filter: blur(var(--modal-backdrop-blur));
117
+ }
118
+ }
119
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/lib/pattern/Modal/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,102 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ /**
4
+ * Wraps a trigger with a modal. Click the trigger → the modal opens.
5
+ *
6
+ * **The wrapped component must accept `onClick`** and forward it to the
7
+ * clickable element at its root — the HOC composes its open handler onto the
8
+ * trigger itself, with no wrapper element in between. An `onClick` the
9
+ * consumer passes keeps working: it runs first, then the modal opens.
10
+ *
11
+ * The second argument is a function: the HOC calls it with a props object
12
+ * carrying `close` and `ref`, and it returns a complete `<Modal>` element —
13
+ * sections, props and all:
14
+ *
15
+ * ```tsx
16
+ * const OpenButton = withModal(
17
+ * Button,
18
+ * ({ ref }) => (
19
+ * <Modal ref={ref}>
20
+ * <Modal.Content>Hello</Modal.Content>
21
+ * </Modal>
22
+ * ),
23
+ * );
24
+ * <OpenButton>Open</OpenButton>;
25
+ * ```
26
+ *
27
+ * Everything `Modal` accepts lives on the element the function returns —
28
+ * `closeOnBackdropClick`, `aria-label`, `className` — so the consumer sees the
29
+ * real modal, not an options bag. **One duty comes with that freedom: the
30
+ * factory must attach the `ref` it receives to the `<Modal>`** (`<Modal
31
+ * ref={ref}>`). The trigger opens the dialog through that ref — and `Modal`
32
+ * requires its `ref`, so a factory that forgets it fails to compile.
33
+ *
34
+ * **How it closes:** the header's X button and Escape always work. Add
35
+ * `closeOnBackdropClick` to the modal element and a backdrop click works too.
36
+ *
37
+ * **Footer buttons can only close the modal.** That is the one and only
38
+ * action this HOC provides — wire one to the `close` the function receives:
39
+ *
40
+ * ```tsx
41
+ * const confirmationModal: WithModalRender = ({ close, ref }) => (
42
+ * <Modal ref={ref}>
43
+ * <Modal.Footer>
44
+ * <Button onClick={close}>Got it</Button>
45
+ * </Modal.Footer>
46
+ * </Modal>
47
+ * );
48
+ *
49
+ * const OpenButton = withModal(Button, confirmationModal);
50
+ * ```
51
+ *
52
+ * If an action needs to do more than close — save data, open another modal,
53
+ * close conditionally — don't use this HOC: compose `Modal` directly and drive
54
+ * it through its `ref`.
55
+ *
56
+ * `withModal` is meant for static content and belongs at module scope, called
57
+ * once. The function it is handed is invoked on every render of the trigger,
58
+ * but at module scope it can only see module-level values, so what it returns
59
+ * is the same on every render. If the modal must show data from the parent —
60
+ * for example a different `userId` depending on which user is selected —
61
+ * don't call this HOC inside the component; compose `Modal` directly and
62
+ * drive it through its `ref`.
63
+ *
64
+ * A pure composition wrapper: it renders the wrapped component and the modal
65
+ * as siblings, so it carries no root element of its own.
66
+ *
67
+ * `import { withModal } from "@canonical/react-ds-global";`
68
+ *
69
+ * @param Component The trigger component to wrap (e.g. `Button`). It must accept `onClick` and forward it to its root element; clicking it opens the modal.
70
+ * @param modal A {@link WithModalRender} function: it receives `{ close, ref }`, must attach `ref` to the `<Modal>` it returns, and the trigger opens it.
71
+ */
72
+ const withModal = (Component, modal) => {
73
+ const WrappedComponent = (props) => {
74
+ // The modal owns its open state, so the HOC only needs a handle on the
75
+ // dialog to open it from the trigger and to hand `close` to the content.
76
+ const dialogRef = useRef(null);
77
+ // showModal() throws on an already-open dialog. The open modal makes the
78
+ // page inert, so a second trigger click should be impossible — but the
79
+ // guard costs nothing and a thrown error would cost the whole render.
80
+ const open = () => {
81
+ const dialog = dialogRef.current;
82
+ if (dialog && !dialog.open)
83
+ dialog.showModal();
84
+ };
85
+ const close = () => dialogRef.current?.close();
86
+ // The contract: the HOC hands the factory its own ref, and the factory
87
+ // sets it on the `<Modal>` it returns. `Modal` requires its `ref`, so a
88
+ // factory that forgets `ref={ref}` fails to compile.
89
+ const modalElement = modal({ close, ref: dialogRef });
90
+ return (_jsxs(_Fragment, { children: [_jsx(Component, { ...props, onClick: (event) => {
91
+ // The consumer's handler runs first, then the modal opens; a
92
+ // preventDefault or stopPropagation there does not gate the open.
93
+ props.onClick?.(event);
94
+ open();
95
+ } }), modalElement] }));
96
+ };
97
+ // Set the displayName for easier debugging
98
+ WrappedComponent.displayName = `withModal(${Component.displayName || Component.name || "AnonymousComponent"})`;
99
+ return WrappedComponent;
100
+ };
101
+ export default withModal;
102
+ //# sourceMappingURL=withModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withModal.js","sourceRoot":"","sources":["../../../../../src/lib/pattern/Modal/withModal.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,MAAM,SAAS,GAAG,CAChB,SAAgC,EAChC,KAAsB,EACC,EAAE;IACzB,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAgB,EAAE;QACvD,uEAAuE;QACvE,yEAAyE;QACzE,MAAM,SAAS,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;QAClD,yEAAyE;QACzE,uEAAuE;QACvE,sEAAsE;QACtE,MAAM,IAAI,GAAG,GAAS,EAAE;YACtB,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;YACjC,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI;gBAAE,MAAM,CAAC,SAAS,EAAE,CAAC;QACjD,CAAC,CAAC;QACF,MAAM,KAAK,GAAG,GAAS,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;QAErD,uEAAuE;QACvE,wEAAwE;QACxE,qDAAqD;QACrD,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;QAEtD,OAAO,CACL,8BACE,KAAC,SAAS,OACJ,KAAK,EACT,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;wBACjB,6DAA6D;wBAC7D,kEAAkE;wBAClE,KAAK,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;wBACvB,IAAI,EAAE,CAAC;oBACT,CAAC,GACD,EACD,YAAY,IACZ,CACJ,CAAC;IACJ,CAAC,CAAC;IAEF,2CAA2C;IAC3C,gBAAgB,CAAC,WAAW,GAAG,aAC7B,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,oBAC7C,GAAG,CAAC;IAEJ,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,13 +1,17 @@
1
- /**
2
- * Timeline.Content styles
3
- * @implements ds:global.subcomponent.timeline-content
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-content {
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.Content styles
6
+ * @implements ds:global.subcomponent.timeline-content
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-content {
13
+ /* layout.type: stack, layout.direction: vertical */
14
+ display: flex;
15
+ flex-direction: column;
16
+ }
13
17
  }