@canonical/react-ds-global 0.30.0 → 0.32.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 (110) hide show
  1. package/dist/esm/lib/component/Accordion/common/Item/styles.css +127 -9
  2. package/dist/esm/lib/component/Badge/styles.css +25 -24
  3. package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js +2 -2
  4. package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js +12 -2
  5. package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js.map +1 -1
  6. package/dist/esm/lib/component/Breadcrumbs/common/Item/styles.css +17 -5
  7. package/dist/esm/lib/component/Breadcrumbs/styles.css +3 -0
  8. package/dist/esm/lib/component/Button/Button.js +4 -5
  9. package/dist/esm/lib/component/Button/Button.js.map +1 -1
  10. package/dist/esm/lib/component/Button/styles.css +99 -17
  11. package/dist/esm/lib/component/Card/Card.js +7 -0
  12. package/dist/esm/lib/component/Card/Card.js.map +1 -1
  13. package/dist/esm/lib/component/Card/common/Content/styles.css +7 -3
  14. package/dist/esm/lib/component/Card/common/Footer/Footer.js +1 -1
  15. package/dist/esm/lib/component/Card/common/Footer/styles.css +12 -2
  16. package/dist/esm/lib/component/Card/styles.css +52 -14
  17. package/dist/esm/lib/component/Chip/styles.css +3 -0
  18. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js +11 -8
  19. package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js.map +1 -1
  20. package/dist/esm/lib/component/ContextualMenu/common/Item/styles.css +31 -3
  21. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js +24 -5
  22. package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js.map +1 -1
  23. package/dist/esm/lib/component/Tabs/common/Item/styles.css +12 -0
  24. package/dist/esm/lib/component/Tooltip/Tooltip.js +1 -1
  25. package/dist/esm/lib/component/Tooltip/index.js +0 -1
  26. package/dist/esm/lib/component/Tooltip/index.js.map +1 -1
  27. package/dist/esm/lib/component/Tooltip/styles.css +17 -0
  28. package/dist/esm/lib/component/Tooltip/withTooltip.js +70 -7
  29. package/dist/esm/lib/component/Tooltip/withTooltip.js.map +1 -1
  30. package/dist/esm/lib/group/Cards/Cards.js +49 -0
  31. package/dist/esm/lib/group/Cards/Cards.js.map +1 -0
  32. package/dist/esm/lib/group/Cards/index.js +3 -0
  33. package/dist/esm/lib/group/Cards/index.js.map +1 -0
  34. package/dist/esm/lib/group/Cards/styles.css +55 -0
  35. package/dist/esm/lib/group/Cards/types.js.map +1 -0
  36. package/dist/esm/lib/group/index.js +1 -0
  37. package/dist/esm/lib/group/index.js.map +1 -1
  38. package/dist/esm/lib/hooks/index.js +1 -0
  39. package/dist/esm/lib/hooks/index.js.map +1 -1
  40. package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js +6 -0
  41. package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js.map +1 -1
  42. package/dist/esm/lib/hooks/useIsMounted/index.js +3 -0
  43. package/dist/esm/lib/hooks/useIsMounted/index.js.map +1 -0
  44. package/dist/esm/lib/hooks/useIsMounted/types.js +2 -0
  45. package/dist/esm/lib/hooks/useIsMounted/types.js.map +1 -0
  46. package/dist/esm/lib/hooks/useIsMounted/useIsMounted.js +21 -0
  47. package/dist/esm/lib/hooks/useIsMounted/useIsMounted.js.map +1 -0
  48. package/dist/esm/lib/hooks/useWindowFitment/readingDirection.js +19 -4
  49. package/dist/esm/lib/hooks/useWindowFitment/readingDirection.js.map +1 -1
  50. package/dist/types/lib/component/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  51. package/dist/types/lib/component/Breadcrumbs/common/Item/Item.d.ts.map +1 -1
  52. package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts +5 -0
  53. package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts.map +1 -1
  54. package/dist/types/lib/component/Breadcrumbs/types.d.ts +15 -0
  55. package/dist/types/lib/component/Breadcrumbs/types.d.ts.map +1 -1
  56. package/dist/types/lib/component/Button/Button.d.ts.map +1 -1
  57. package/dist/types/lib/component/Button/types.d.ts +7 -5
  58. package/dist/types/lib/component/Button/types.d.ts.map +1 -1
  59. package/dist/types/lib/component/Card/Card.d.ts +7 -0
  60. package/dist/types/lib/component/Card/Card.d.ts.map +1 -1
  61. package/dist/types/lib/component/Card/common/Footer/Footer.d.ts +1 -1
  62. package/dist/types/lib/component/Card/common/Footer/types.d.ts +1 -1
  63. package/dist/types/lib/component/Card/common/Footer/types.d.ts.map +1 -1
  64. package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts.map +1 -1
  65. package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts.map +1 -1
  66. package/dist/types/lib/component/Tooltip/Tooltip.d.ts +1 -1
  67. package/dist/types/lib/component/Tooltip/index.d.ts +0 -1
  68. package/dist/types/lib/component/Tooltip/index.d.ts.map +1 -1
  69. package/dist/types/lib/component/Tooltip/types.d.ts +60 -0
  70. package/dist/types/lib/component/Tooltip/types.d.ts.map +1 -1
  71. package/dist/types/lib/component/Tooltip/withTooltip.d.ts +10 -12
  72. package/dist/types/lib/component/Tooltip/withTooltip.d.ts.map +1 -1
  73. package/dist/types/lib/group/Cards/Cards.d.ts +40 -0
  74. package/dist/types/lib/group/Cards/Cards.d.ts.map +1 -0
  75. package/dist/types/lib/group/Cards/index.d.ts +3 -0
  76. package/dist/types/lib/group/Cards/index.d.ts.map +1 -0
  77. package/dist/types/lib/group/Cards/types.d.ts +14 -0
  78. package/dist/types/lib/group/Cards/types.d.ts.map +1 -0
  79. package/dist/types/lib/group/index.d.ts +1 -0
  80. package/dist/types/lib/group/index.d.ts.map +1 -1
  81. package/dist/types/lib/hooks/index.d.ts +1 -0
  82. package/dist/types/lib/hooks/index.d.ts.map +1 -1
  83. package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts.map +1 -1
  84. package/dist/types/lib/hooks/useIsMounted/index.d.ts +3 -0
  85. package/dist/types/lib/hooks/useIsMounted/index.d.ts.map +1 -0
  86. package/dist/types/lib/hooks/useIsMounted/types.d.ts +6 -0
  87. package/dist/types/lib/hooks/useIsMounted/types.d.ts.map +1 -0
  88. package/dist/types/lib/hooks/useIsMounted/useIsMounted.d.ts +15 -0
  89. package/dist/types/lib/hooks/useIsMounted/useIsMounted.d.ts.map +1 -0
  90. package/dist/types/lib/hooks/useWindowFitment/readingDirection.d.ts +12 -4
  91. package/dist/types/lib/hooks/useWindowFitment/readingDirection.d.ts.map +1 -1
  92. package/dist/types/lib/types/link.d.ts +1 -1
  93. package/package.json +16 -16
  94. package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js +0 -62
  95. package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js.map +0 -1
  96. package/dist/esm/lib/component/Tooltip/common/TooltipArea/index.js +0 -2
  97. package/dist/esm/lib/component/Tooltip/common/TooltipArea/index.js.map +0 -1
  98. package/dist/esm/lib/component/Tooltip/common/TooltipArea/styles.css +0 -13
  99. package/dist/esm/lib/component/Tooltip/common/TooltipArea/types.js.map +0 -1
  100. package/dist/esm/lib/component/Tooltip/common/index.js +0 -2
  101. package/dist/esm/lib/component/Tooltip/common/index.js.map +0 -1
  102. package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts +0 -10
  103. package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts.map +0 -1
  104. package/dist/types/lib/component/Tooltip/common/TooltipArea/index.d.ts +0 -3
  105. package/dist/types/lib/component/Tooltip/common/TooltipArea/index.d.ts.map +0 -1
  106. package/dist/types/lib/component/Tooltip/common/TooltipArea/types.d.ts +0 -47
  107. package/dist/types/lib/component/Tooltip/common/TooltipArea/types.d.ts.map +0 -1
  108. package/dist/types/lib/component/Tooltip/common/index.d.ts +0 -2
  109. package/dist/types/lib/component/Tooltip/common/index.d.ts.map +0 -1
  110. /package/dist/esm/lib/{component/Tooltip/common/TooltipArea → group/Cards}/types.js +0 -0
@@ -8,6 +8,11 @@
8
8
  * auto-steps on nested .surface contexts to layer2/layer3), text uses
9
9
  * color-text, the chevron uses color-icon, and dividers use color-border-muted.
10
10
  * Vertical padding is expressed in baseline multiples.
11
+ *
12
+ * NOTE: the apps/sites element-size sizing (collapsed item at 36px sites / 32px
13
+ * apps, and the matching h6 line box) is intentionally NOT set here — control
14
+ * heights across apps vs sites are owned by the density/height bucket, not this
15
+ * design-review geometry pass.
11
16
  */
12
17
  :root {
13
18
  --accordion-item-color-text: var(--color-text);
@@ -25,16 +30,20 @@
25
30
  /* Default header background (surface 1). The surface channel is applied on
26
31
  the element below — NOT here — because a var() referencing
27
32
  --surface-color-foreground-ghost resolved in :root would capture the :root
28
- value (where no .surface is active) and never step. The surface layer only
29
- re-channels the base ghost (no hover/active channel), so hover/active pair
30
- to the non-layered ghost vars directly. */
33
+ value (where no .surface is active) and never step. The built surface
34
+ layer re-channels only the base ghost (no hover/active channel), so
35
+ hover/active default to the non-layered ghost state vars here and are
36
+ re-pointed per surface nesting depth by the stopgap rules below the
37
+ header. */
31
38
  --accordion-item-header-background: var(--color-foreground-ghost);
32
39
  --accordion-item-header-background-hover: var(--color-foreground-ghost-hover);
33
40
  --accordion-item-header-background-active: var(
34
41
  --color-foreground-ghost-active
35
42
  );
36
43
 
37
- --accordion-item-header-gap: var(--dimension-100);
44
+ --accordion-item-header-gap: var(--dimension-200);
45
+ /* Header block padding in baseline multiples (dimension-100 = 1 bU). The
46
+ apps/sites element-size sizing (6px → 36/32) is owned by the height bucket. */
38
47
  --accordion-item-header-padding-block: var(--dimension-100);
39
48
  --accordion-item-header-padding-inline: var(--dimension-200);
40
49
 
@@ -95,15 +104,51 @@
95
104
  display: none;
96
105
  }
97
106
 
107
+ /* Prefer the surface hover/active channels so a future token build that
108
+ ships them steps automatically; today they are unset everywhere, so these
109
+ resolve to the fallback tokens, re-pointed per nesting depth below. */
98
110
  &:hover {
99
- background-color: var(--accordion-item-header-background-hover);
111
+ background-color: var(
112
+ --surface-color-foreground-ghost-hover,
113
+ var(--accordion-item-header-background-hover)
114
+ );
100
115
  }
101
116
 
102
117
  &:active {
103
- background-color: var(--accordion-item-header-background-active);
118
+ background-color: var(
119
+ --surface-color-foreground-ghost-active,
120
+ var(--accordion-item-header-background-active)
121
+ );
104
122
  }
105
123
  }
106
124
 
125
+ /* STOPGAP — step the header hover/active backgrounds with surface nesting.
126
+ The built surfaces modifier re-channels only the base ghost (it exposes no
127
+ --surface-color-foreground-ghost-hover/-active), so without this, hovering
128
+ a header on a layer-2/3 surface painted the base-layer colour. These rules
129
+ mirror the modifier's own nesting selectors to re-point the hover/active
130
+ tokens at the layered state tokens. Hard-coding surface depth in component
131
+ CSS is exactly what the token block above avoids — delete both rules once
132
+ the surfaces modifier ships the hover/active channels (the :hover/:active
133
+ rules above already prefer them). */
134
+ .surface .surface .ds.accordion-item {
135
+ --accordion-item-header-background-hover: var(
136
+ --color-foreground-ghost-layer2-hover
137
+ );
138
+ --accordion-item-header-background-active: var(
139
+ --color-foreground-ghost-layer2-active
140
+ );
141
+ }
142
+
143
+ .surface .surface .surface .ds.accordion-item {
144
+ --accordion-item-header-background-hover: var(
145
+ --color-foreground-ghost-layer3-hover
146
+ );
147
+ --accordion-item-header-background-active: var(
148
+ --color-foreground-ghost-layer3-active
149
+ );
150
+ }
151
+
107
152
  /* The consumer supplies the heading content — plain text by default (rendered
108
153
  as the text-primary body tier) or an <h6>, which renders at the heading-6
109
154
  tier. Only those two type tokens are allowed on the accordion heading; any
@@ -120,9 +165,12 @@
120
165
  letter-spacing: var(--typography-text-primary-letter-spacing);
121
166
 
122
167
  /* Normalise every heading element except <h6> down to the inherited body
123
- tier. <h6> is left untouched so the base h6 tier from
124
- @canonical/styles-typography applies (correct heading-6 tokens, including
125
- the baseline-snapped line-height) — no heading-6 tokens are restated here. */
168
+ tier. <h6> keeps the base h6 tier from @canonical/styles-typography
169
+ (correct heading-6 tokens, including the baseline-snapped line-height) — no
170
+ heading-6 tokens are restated here.
171
+ NOTE: the per-context h6 line box (24px sites / 20px apps) and zeroing the
172
+ heading padding-block nudges to make the header height padding-driven are
173
+ part of the apps/sites height bucket, not this pass. */
126
174
  & :is(h1, h2, h3, h4, h5) {
127
175
  margin: 0;
128
176
  font: inherit;
@@ -206,3 +254,73 @@
206
254
  var(--dimension-stroke-thickness-medium)
207
255
  );
208
256
  }
257
+
258
+ /* ── Density seat (intrinsic) — the header is a control-height row ───────────
259
+ * Inside a density scope the header takes the SHARED control seat from
260
+ * @canonical/styles (modifiers.density.css), exactly like the Button and the
261
+ * form inputs: the heading's own line box (`--control-seat-line`, the cell
262
+ * minus one baseline of headroom per side) is the header interior;
263
+ * `--seat-before` lands its baseline on the density target; `--seat-after`
264
+ * closes the row to EXACTLY the density cell (32px apps-comfortable, 24px
265
+ * apps-dense, …) with no block-size anywhere. So an accordion header, a
266
+ * button, and an input in the same cell are the same height and their text
267
+ * shares one baseline index.
268
+ *
269
+ * The header carries no border of its own — the item's DIVIDER plays that
270
+ * role, and only on the collapsed face: collapsed, the divider renders
271
+ * directly under the header, so the closing pad absorbs its thickness
272
+ * (header + divider = the cell); expanded, the divider sits after the content
273
+ * and the content's own compensation above owns it — the header keeps the full
274
+ * closing pad. This is the per-state split the pre-density compensation rules
275
+ * above apply to the legacy (non-density) look.
276
+ *
277
+ * The chevron needs no new rule: the header's `align-items: center` centres it
278
+ * on the flex line, whose cross-size IS the heading's line box — the same
279
+ * "centre on the glyph run" pairing the input affixes use.
280
+ *
281
+ * KNOWN LIMIT: an <h6> heading keeps its own engine line-height (see the
282
+ * heading rule above), so its line box may differ from --control-seat-line;
283
+ * the h6-in-header case is owned by a later pass. The default (body-tier)
284
+ * heading is exact. */
285
+ :is(.comfortable, .dense, .app, .site, .docs) .ds.accordion-item {
286
+ /* The CONTENT panel consumes the density system's semantic spacing rung for
287
+ its block padding — space-md (16px apps-comfortable, 8px apps-dense,
288
+ 20/12px sites) — instead of the fixed 1 bU, so the panel's breathing room
289
+ follows the density cell. Every rung is a whole baseline multiple, so the
290
+ rhythm holds; the [open] divider compensation reads this same token, so it
291
+ follows automatically. Outside a density scope the :root default stands. */
292
+ --accordion-item-content-padding-block: var(
293
+ --density-space-md,
294
+ var(--dimension-100)
295
+ );
296
+ }
297
+
298
+ :is(.comfortable, .dense, .app, .site, .docs) .ds.accordion-item > .header {
299
+ /* No border above the heading inside the header, so no border term. Rounded
300
+ to ¼px for exact layout-unit representability (see the shared seat). */
301
+ --seat-before: round(nearest, max(0px, var(--control-seat-basis)), 0.25px);
302
+ --seat-after: max(
303
+ 0px,
304
+ calc(
305
+ var(--density-line-height-effective) -
306
+ var(--control-seat-line) -
307
+ var(--seat-before)
308
+ )
309
+ );
310
+ padding-block: var(--seat-before) var(--seat-after);
311
+ }
312
+ :is(.comfortable, .dense, .app, .site, .docs)
313
+ .ds.accordion-item:not([open])
314
+ > .header {
315
+ /* Collapsed: absorb the item divider below, keeping header + divider = cell. */
316
+ padding-block-end: max(
317
+ 0px,
318
+ calc(var(--seat-after) - var(--dimension-stroke-thickness-medium))
319
+ );
320
+ }
321
+ :is(.comfortable, .dense, .app, .site, .docs)
322
+ .ds.accordion-item
323
+ > .header
324
+ > .heading {
325
+ line-height: var(--control-seat-line);
326
+ }
@@ -1,27 +1,20 @@
1
- /* Component tokens (migrated from @canonical/styles-primitives-canonical tokens.css) */
2
- :root {
3
- --badge-color-background: var(--tmp-color-text-default);
4
- --badge-color-text: var(--tmp-color-background-default);
1
+ /* Badge.css */
2
+ .ds.badge {
3
+ /* Component tokens — sourced from @canonical/design-tokens */
4
+ --badge-color-background: var(--color-foreground-secondary);
5
+ --badge-color-text: var(--color-text-onForegroundSecondary);
5
6
 
6
- --badge-border-radius: 1rem;
7
- --badge-font-size: var(--font-size-xsmall);
8
- --badge-font-weight: var(--font-weight-bold);
9
- --badge-line-height: var(--line-height-xsmall);
7
+ --badge-border-radius: var(--dimension-radius-full);
8
+ --badge-font-family: var(--typography-text-tertiary-bold-font-family);
9
+ --badge-font-size: var(--typography-text-tertiary-bold-font-size);
10
+ --badge-font-weight: var(--typography-text-tertiary-bold-font-weight);
11
+ --badge-letter-spacing: var(--typography-text-tertiary-bold-letter-spacing);
12
+ --badge-line-height: var(--typography-text-tertiary-bold-line-height);
10
13
  --badge-padding-vertical: 0;
11
- --badge-padding-horizontal: var(--spacing-horizontal-xsmall);
14
+ --badge-padding-horizontal: var(--dimension-050);
12
15
  --badge-margin-bottom: 0;
13
16
 
14
- --badge-max-width: 4ch;
15
- --badge-min-width: calc(
16
- var(--badge-line-height) -
17
- (2 * var(--badge-padding-horizontal))
18
- );
19
- }
20
-
21
- /* Badge.css */
22
- .ds.badge {
23
- /** Pull the badge closer to the edge of a chip */
24
- --badge-chip-margin-tweak: 0.15rem;
17
+ --badge-min-width: calc(var(--badge-line-height) * 1em);
25
18
 
26
19
  /* Base badge styles using tokens */
27
20
  background-color: var(
@@ -29,16 +22,24 @@
29
22
  var(--badge-color-background)
30
23
  );
31
24
  border-radius: var(--badge-border-radius);
32
- box-sizing: content-box;
33
- color: var(--modifier-color-text, var(--badge-color-text));
25
+ box-sizing: border-box;
26
+ /* Label sits on the badge's own (criticality) surface, so it reads the
27
+ * on-surface text channel — NOT --modifier-color-text (the standalone
28
+ * criticality text colour), which would render same-hue-on-same-hue with
29
+ * failing contrast. Falls back to the neutral on-surface token for the
30
+ * default (no-criticality) badge. */
31
+ color: var(
32
+ --modifier-color-text-onForegroundSecondary,
33
+ var(--badge-color-text)
34
+ );
34
35
  display: inline-block;
36
+ font-family: var(--badge-font-family);
35
37
  font-size: var(--badge-font-size);
36
38
  font-weight: var(--badge-font-weight);
39
+ letter-spacing: var(--badge-letter-spacing);
37
40
  line-height: var(--badge-line-height);
38
41
  margin-bottom: var(--badge-margin-bottom);
39
- max-width: var(--badge-max-width);
40
42
  min-width: var(--badge-min-width);
41
- overflow: hidden;
42
43
  padding: var(--badge-padding-vertical) var(--badge-padding-horizontal);
43
44
  text-align: center;
44
45
  }
@@ -5,8 +5,8 @@ import "./styles.css";
5
5
  const componentCssClassName = "ds breadcrumbs";
6
6
  /**
7
7
  * Breadcrumbs are a navigational aid that shows users their current location
8
- * within a site's information hierarchy. They provide a clear path from the
9
- * root of the information hierarchy (IA) to the current page, allowing users
8
+ * within a site's information architecture. They provide a clear path from the
9
+ * root of the information architecture (IA) to the current page, allowing users
10
10
  * to quickly understand where they are and easily navigate back to previous
11
11
  * levels in the IA. Breadcrumbs should reflect the IA, not the user's path
12
12
  * they took to arrive at the current page. They work best in websites or
@@ -14,9 +14,19 @@ const Item = ({ children, label, url, current = false, separator = "/", disabled
14
14
  key: _key, items: _items, Component: _Component, ...props }) => {
15
15
  const content = children ?? label;
16
16
  const Link = LinkComponent;
17
- return (_jsxs("li", { className: [componentCssClassName, current && "current", className]
17
+ return (_jsxs("li", { className: [
18
+ componentCssClassName,
19
+ current && "current",
20
+ disabled && "disabled",
21
+ className,
22
+ ]
18
23
  .filter(Boolean)
19
- .join(" "), ...props, children: [current || disabled ? (_jsx("span", { className: "link", "aria-current": current ? "page" : undefined, children: content })) : (_jsx(Link, { className: "link", href: url, children: content })), _jsx("span", { className: "separator", "aria-hidden": "true", children: separator })] }));
24
+ .join(" "), ...props, children: [_jsx("span", { className: "separator", "aria-hidden": "true", children: separator }), current || disabled ? (
25
+ // `aria-disabled` is only honored by AT on elements with a widget role;
26
+ // a bare `<span>` has none, so `role="link"` is added when disabled to
27
+ // give it the role this item represents. This way, the disabled item
28
+ // is announced as a disabled link.
29
+ _jsx("span", { className: "link", "aria-current": current ? "page" : undefined, "aria-disabled": disabled ? "true" : undefined, role: disabled ? "link" : undefined, children: content })) : (_jsx(Link, { className: "link", href: url, children: content }))] }));
20
30
  };
21
31
  Item.displayName = "Breadcrumbs.Item";
22
32
  export default Item;
@@ -1 +1 @@
1
- {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../../../../src/lib/component/Breadcrumbs/common/Item/Item.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ,EACR,KAAK,EACL,GAAG,EACH,OAAO,GAAG,KAAK,EACf,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,aAAa,GAAG,GAAG;AACnB,gDAAgD;AAChD,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,UAAU,EACrB,GAAG,KAAK,EACE,EAAsB,EAAE;IAClC,MAAM,OAAO,GAAG,QAAQ,IAAI,KAAK,CAAC;IAClC,MAAM,IAAI,GAAG,aAAa,CAAC;IAE3B,OAAO,CACL,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,OAAO,IAAI,SAAS,EAAE,SAAS,CAAC;aAChE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,aAGR,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,CACrB,eAAM,SAAS,EAAC,MAAM,kBAAe,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAC9D,OAAO,GACH,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAE,GAAG,YAC7B,OAAO,GACH,CACR,EAED,eAAM,SAAS,EAAC,WAAW,iBAAa,MAAM,YAC3C,SAAS,GACL,IACJ,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAEtC,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../../../../src/lib/component/Breadcrumbs/common/Item/Item.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ,EACR,KAAK,EACL,GAAG,EACH,OAAO,GAAG,KAAK,EACf,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,aAAa,GAAG,GAAG;AACnB,gDAAgD;AAChD,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,UAAU,EACrB,GAAG,KAAK,EACE,EAAsB,EAAE;IAClC,MAAM,OAAO,GAAG,QAAQ,IAAI,KAAK,CAAC;IAClC,MAAM,IAAI,GAAG,aAAa,CAAC;IAE3B,OAAO,CACL,cACE,SAAS,EAAE;YACT,qBAAqB;YACrB,OAAO,IAAI,SAAS;YACpB,QAAQ,IAAI,UAAU;YACtB,SAAS;SACV;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,aAMT,eAAM,SAAS,EAAC,WAAW,iBAAa,MAAM,YAC3C,SAAS,GACL,EAEN,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC;YACrB,wEAAwE;YACxE,uEAAuE;YACvE,qEAAqE;YACrE,mCAAmC;YACnC,eACE,SAAS,EAAC,MAAM,kBACF,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,mBAC3B,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC5C,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAElC,OAAO,GACH,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAE,GAAG,YAC7B,OAAO,GACH,CACR,IACE,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAEtC,eAAe,IAAI,CAAC"}
@@ -12,15 +12,16 @@
12
12
  * dimension scale (Figma specs 6px, which is not on the scale; the nearest
13
13
  * token is dimension-100 = 8px).
14
14
  */
15
- :root {
15
+ .ds.breadcrumbs-item {
16
+ /* Component tokens — pure aliases to semantic tokens, component-scoped
17
+ per cs:styling.tokens.scoping */
16
18
  --breadcrumbs-item-link-color: var(--color-text-link);
17
19
  --breadcrumbs-item-current-color: var(--color-text);
20
+ --breadcrumbs-item-disabled-color: var(--color-text-disabled);
18
21
  --breadcrumbs-item-separator-color: var(--color-text);
19
22
  --breadcrumbs-item-separator-margin: var(--dimension-100);
20
23
  --breadcrumbs-item-focus-color: var(--color-text-link);
21
- }
22
24
 
23
- .ds.breadcrumbs-item {
24
25
  /* layout.type: flow, layout.direction: horizontal */
25
26
  display: flex;
26
27
  flex-direction: row;
@@ -48,13 +49,14 @@
48
49
  }
49
50
  }
50
51
 
51
- /* Separator element — DSL role: separator. Hidden on the last item. */
52
+ /* Separator element — DSL role: separator. Rendered before the link so a
53
+ wrapped row starts with the slash; hidden on the first item. */
52
54
  & > .separator {
53
55
  margin-inline: var(--breadcrumbs-item-separator-margin);
54
56
  color: var(--breadcrumbs-item-separator-color);
55
57
  }
56
58
 
57
- &:last-of-type > .separator {
59
+ &:first-of-type > .separator {
58
60
  display: none;
59
61
  }
60
62
 
@@ -67,4 +69,14 @@
67
69
  text-decoration: none;
68
70
  }
69
71
  }
72
+
73
+ /* Disabled item (not a link) */
74
+ &.disabled > .link {
75
+ color: var(--breadcrumbs-item-disabled-color);
76
+ cursor: not-allowed;
77
+
78
+ &:hover {
79
+ text-decoration: none;
80
+ }
81
+ }
70
82
  }
@@ -17,6 +17,9 @@
17
17
  flex-direction: row;
18
18
  flex-wrap: wrap;
19
19
 
20
+ /* Guidelines: 4px vertical distance between wrapped rows */
21
+ row-gap: var(--dimension-050);
22
+
20
23
  /* layout.align: center */
21
24
  align-items: center;
22
25
 
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Spinner } from "../../subcomponent/Spinner/index.js";
3
+ import { Icon } from "../Icon/index.js";
3
4
  import "./styles.css";
4
5
  const componentCssClassName = "ds button";
5
6
  /**
@@ -23,13 +24,11 @@ const Button = ({ id, className, children, style, importance = "primary", antici
23
24
  !props["aria-labelledby"]) {
24
25
  console.warn("Button: icon-only buttons need an explicit `aria-label` or `aria-labelledby` to be accessible.");
25
26
  }
26
- const iconElement = icon && _jsx("span", { className: "icon", children: icon });
27
+ // The icon slot only accepts a design-system icon name; the Icon component
28
+ // maps it to the @canonical/ds-assets sprite (decorative by default).
29
+ const iconElement = icon && (_jsx("span", { className: "icon", children: _jsx(Icon, { icon: icon }) }));
27
30
  return (_jsxs("button", { id: id, className: [
28
31
  componentCssClassName,
29
- // The `.p` baseline utility supplies the body-text tier (font, snapped
30
- // line-height) and the padding-block nudges that align the button box
31
- // to the baseline grid — so the box height tracks the text inside.
32
- "p",
33
32
  importance,
34
33
  anticipation,
35
34
  variant,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/lib/component/Button/Button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAE9D,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,EAAE,EACF,SAAS,EACT,QAAQ,EACR,KAAK,EACL,UAAU,GAAG,SAAS,EACtB,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,GAAG,KAAK,EACF,EAAsB,EAAE;IAC9B,2EAA2E;IAC3E,6DAA6D;IAC7D,MAAM,kBAAkB,GACtB,QAAQ,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,EAAE,CAAC;IAEvE,IACE,OAAO,OAAO,KAAK,WAAW;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;QACrC,CAAC,IAAI,IAAI,OAAO,CAAC;QACjB,CAAC,kBAAkB;QACnB,CAAC,KAAK,CAAC,YAAY,CAAC;QACpB,CAAC,KAAK,CAAC,iBAAiB,CAAC,EACzB,CAAC;QACD,OAAO,CAAC,IAAI,CACV,gGAAgG,CACjG,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,IAAI,eAAM,SAAS,EAAC,MAAM,YAAE,IAAI,GAAQ,CAAC;IAEjE,OAAO,CACL,kBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE;YACT,qBAAqB;YACrB,uEAAuE;YACvE,sEAAsE;YACtE,mEAAmE;YACnE,GAAG;YACH,UAAU;YACV,YAAY;YACZ,OAAO;YACP,OAAO,IAAI,SAAS;YACpB,SAAS;SACV;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EACZ,KAAK,EAAE,KAAK,eAED,OAAO,IAAI,SAAS,EAC/B,QAAQ,EAAE,QAAQ,IAAI,OAAO,KACzB,KAAK,aAMR,WAAW,EACX,kBAAkB,IAAI,eAAM,SAAS,EAAC,OAAO,YAAE,QAAQ,GAAQ,EAC/D,OAAO,IAAI,CACV,eAAM,SAAS,EAAC,iBAAiB,iBAAa,MAAM,YAClD,KAAC,OAAO,KAAG,GACN,CACR,IACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/lib/component/Button/Button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,EAAE,EACF,SAAS,EACT,QAAQ,EACR,KAAK,EACL,UAAU,GAAG,SAAS,EACtB,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,GAAG,KAAK,EACF,EAAsB,EAAE;IAC9B,2EAA2E;IAC3E,6DAA6D;IAC7D,MAAM,kBAAkB,GACtB,QAAQ,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,EAAE,CAAC;IAEvE,IACE,OAAO,OAAO,KAAK,WAAW;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;QACrC,CAAC,IAAI,IAAI,OAAO,CAAC;QACjB,CAAC,kBAAkB;QACnB,CAAC,KAAK,CAAC,YAAY,CAAC;QACpB,CAAC,KAAK,CAAC,iBAAiB,CAAC,EACzB,CAAC;QACD,OAAO,CAAC,IAAI,CACV,gGAAgG,CACjG,CAAC;IACJ,CAAC;IAED,2EAA2E;IAC3E,sEAAsE;IACtE,MAAM,WAAW,GAAG,IAAI,IAAI,CAC1B,eAAM,SAAS,EAAC,MAAM,YACpB,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,GACf,CACR,CAAC;IAEF,OAAO,CACL,kBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE;YACT,qBAAqB;YACrB,UAAU;YACV,YAAY;YACZ,OAAO;YACP,OAAO,IAAI,SAAS;YACpB,SAAS;SACV;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EACZ,KAAK,EAAE,KAAK,eAED,OAAO,IAAI,SAAS,EAC/B,QAAQ,EAAE,QAAQ,IAAI,OAAO,KACzB,KAAK,aAMR,WAAW,EACX,kBAAkB,IAAI,eAAM,SAAS,EAAC,OAAO,YAAE,QAAQ,GAAQ,EAC/D,OAAO,IAAI,CACV,eAAM,SAAS,EAAC,iBAAiB,iBAAa,MAAM,YAClD,KAAC,OAAO,KAAG,GACN,CACR,IACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -29,7 +29,20 @@
29
29
  --button-gap: var(--dimension-100);
30
30
  --button-border-width: var(--dimension-stroke-thickness-medium);
31
31
  /* Label weight — the button label is medium, not the `.p` body weight. */
32
- --button-font-weight: var(--font-weight-medium, var(--font-weight-default));
32
+ --button-font-weight: var(--typography-weight-medium);
33
+ /* Label size — the button label is the text-secondary tier (14px), not the
34
+ `.p` text-primary tier (16px). The line-height snaps up to the baseline
35
+ grid exactly as the typography mapper does, so the box stays 32px tall
36
+ (24px line + 8px of baseline nudges) around 14px text. */
37
+ --button-font-size: var(--typography-text-secondary-font-size);
38
+ --button-line-height: round(
39
+ up,
40
+ calc(
41
+ var(--button-font-size) *
42
+ var(--typography-text-secondary-line-height)
43
+ ),
44
+ var(--baseline-height)
45
+ );
33
46
  }
34
47
 
35
48
  /* ==========================================================================
@@ -47,10 +60,10 @@
47
60
  border. `.primary` overrides text/icon with the on-fill
48
61
  contrast tokens.
49
62
 
50
- Interaction states read the per-state surface/text channels supplied by the
51
- states shim (`--modifier-surface-{hover,active,disabled}`,
52
- `--modifier-color-text-disabled`), which resolve to the explicit state tokens
53
- and recolour per anticipation.
63
+ Interaction states read the per-state surface/text/border channels supplied
64
+ by the states shim (`--modifier-surface-{hover,active,disabled}`,
65
+ `--modifier-color-text-disabled`, `--modifier-color-border-disabled`), which
66
+ resolve to the explicit state tokens and recolour per anticipation.
54
67
  */
55
68
 
56
69
  .ds.button {
@@ -63,17 +76,28 @@
63
76
 
64
77
  color: var(--modifier-color-text, var(--button-color-text));
65
78
  background-color: var(--modifier-surface, var(--button-color-background));
66
- border-color: var(--modifier-color-border, var(--button-color-border));
79
+ /* The outline flag (0/1) toggles the border's COLOUR, not its width: the
80
+ border is ALWAYS present at the nominal width (transparent when hidden), so
81
+ a bordered and a borderless importance share byte-identical geometry and
82
+ the density seat below subtracts one constant. (The previous
83
+ width-multiplied toggle left the primary 2px shorter than the secondary
84
+ and seated its label ~1px high.) */
85
+ border-color: color-mix(
86
+ in srgb,
87
+ var(--modifier-color-border, var(--button-color-border))
88
+ calc(var(--modifier-outline, 0) * 100%),
89
+ transparent
90
+ );
67
91
  border-style: solid;
68
- /* The outline flag (0/1) toggles the border on: multiplying the width means
69
- a borderless importance simply resolves to 0 with no separate rule. */
70
- border-width: calc(var(--modifier-outline, 0) * var(--button-border-width));
71
-
72
- /* Typography and block padding come from the `.p` baseline utility on the
73
- element (font-size, snapped line-height, and the padding-block nudges that
74
- align the box to the baseline grid). The button only overrides the label
75
- weight and its own inline padding — declaring font-size/line-height/
76
- padding-block here would bypass the baseline-grid maths. */
92
+ border-width: var(--button-border-width);
93
+
94
+ /* Label typography tokens (text-secondary tier, 14px). The block placement that
95
+ lands the label on the baseline grid comes from the density seat at the end of
96
+ this file (the button no longer carries `.p`, so the engine's on-element nudges
97
+ don't apply — without the seat the label is flat/unaligned). --font-size /
98
+ --line-height are still exposed for any consumer that reads them. */
99
+ --font-size: var(--button-font-size);
100
+ --line-height: var(--button-line-height);
77
101
  font-weight: var(--button-font-weight);
78
102
  padding-inline: var(--button-padding-inline-start)
79
103
  var(--button-padding-inline-end);
@@ -120,7 +144,9 @@
120
144
  /* Disabled — explicit disabled tokens (not the computed deltas): the surface,
121
145
  text and border each resolve to their `-disabled` token. Primary supplies
122
146
  the on-fill disabled text via `--modifier-color-text-disabled`; ghost
123
- importances fall back to the plain disabled text colour. */
147
+ importances fall back to the plain disabled text colour. The border reads
148
+ the disabled border channel, so it stays on the same highlighted ramp as
149
+ the enabled border and recolours per anticipation. */
124
150
  &:disabled {
125
151
  cursor: not-allowed;
126
152
  color: var(--modifier-color-text-disabled, var(--color-text-disabled));
@@ -128,7 +154,10 @@
128
154
  --modifier-surface-disabled,
129
155
  var(--button-color-background-disabled)
130
156
  );
131
- border-color: var(--color-border-disabled);
157
+ border-color: var(
158
+ --modifier-color-border-disabled,
159
+ var(--color-border-highlighted-disabled)
160
+ );
132
161
  }
133
162
  }
134
163
 
@@ -210,3 +239,56 @@
210
239
  border-color: transparent;
211
240
  }
212
241
  }
242
+
243
+ /* ── Density seat (apps 32 / sites 36, dense 24 / 28) — intrinsic ────────────
244
+ * The button consumes the SHARED control seat from @canonical/styles
245
+ * (modifiers.density.css): the label's own line box (cell − 2 baselines) is the
246
+ * button interior, `--control-seat-before` puts its baseline on the density
247
+ * target, `--control-seat-after` closes the box to EXACTLY the density cell.
248
+ * The height is INTRINSIC — no block-size: border + pads + line-height add up
249
+ * to the cell, and both outer edges land on grid lines.
250
+ *
251
+ * This lives HERE (ds-global) and not in ds-global-form's density.css, because
252
+ * the Button is a ds-global component: an app that ships ds-global without the
253
+ * form package must still get a seated button. The seat vars come from the
254
+ * shared styles layer, so there is no form dependency.
255
+ *
256
+ * The seat subtracts the NOMINAL --button-border-width for BOTH importances —
257
+ * the border is constant width and transparent when not shown (the
258
+ * --modifier-outline pattern), so a bordered and a borderless button share one
259
+ * geometry; no per-importance branch.
260
+ *
261
+ * `:is()` on the density scope (0,1,0) so `:is(...) .ds.button` (0,2,0) beats
262
+ * the button's own `.ds.button { align-items: center }` (0,1,0) — otherwise the
263
+ * label stays flex-CENTRED and the padding-based seat can't govern. */
264
+ :is(.comfortable, .dense, .app, .site, .docs) .ds.button {
265
+ /* Fold the button's own border into the shared basis HERE (a var() inside a
266
+ custom property substitutes at its declaring element, so the shared layer
267
+ cannot read this border). `1cap` in the basis resolves against the button's
268
+ own label font. */
269
+ /* Rounded to ¼px so the pad is exactly representable in the browser's 1/64px
270
+ layout units — the fractional 1cap term otherwise leaves ~1/60px residues
271
+ on the box height. */
272
+ --seat-before: round(
273
+ nearest,
274
+ max(0px, calc(var(--control-seat-basis) - var(--button-border-width, 0px))),
275
+ 0.25px
276
+ );
277
+ --seat-after: max(
278
+ 0px,
279
+ calc(
280
+ var(--density-line-height-effective) -
281
+ var(--control-seat-line) -
282
+ var(--seat-before) -
283
+ 2 *
284
+ var(--button-border-width, 0px)
285
+ )
286
+ );
287
+
288
+ box-sizing: border-box;
289
+ block-size: auto;
290
+ align-items: flex-start;
291
+ justify-content: flex-start;
292
+ line-height: var(--control-seat-line);
293
+ padding-block: var(--seat-before) var(--seat-after);
294
+ }
@@ -13,6 +13,13 @@ const componentCssClassName = "ds card";
13
13
  * predictable structure that allows the user to compare attributes across data
14
14
  * objects.
15
15
  *
16
+ * A Card is always a grid participant: `.ds.card` is a ROW SUBGRID that spans
17
+ * four fixed section tracks (image / header / content / footer), inheriting them
18
+ * from its parent grid. Standalone (wrapped in a `.grid`) it lays its own
19
+ * sections out on those tracks; inside a `Cards` group it shares the group's
20
+ * tracks so the same sections line up across every card in the row. See the
21
+ * `Cards` group component for the full layout model.
22
+ *
16
23
  * `import { Card } from "@canonical/react-ds-global";`
17
24
  *
18
25
  * @implements ds:global.component.card
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../../src/lib/component/Card/Card.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,4EAA4E;AAC5E,wEAAwE;AACxE,iCAAiC;AACjC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAExC;;;;;;;;;;GAUG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACE,EAAsB,EAAE,CAAC,CACnC,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AAEF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAEnB,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../../src/lib/component/Card/Card.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,4EAA4E;AAC5E,wEAAwE;AACxE,iCAAiC;AACjC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAExC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACE,EAAsB,EAAE,CAAC,CACnC,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AAEF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAEnB,eAAe,IAAI,CAAC"}
@@ -4,11 +4,14 @@
4
4
  *
5
5
  * DSL anatomy: layout.type stack, direction vertical.
6
6
  * A content-bearing section: it pads itself (the card frame applies no general
7
- * padding). Vertical padding is in baseline multiples.
7
+ * padding). Vertical padding is in baseline multiples, asymmetric per the
8
+ * Figma styling frame: one baseline on top, two below (top 100 / bottom 200 /
9
+ * sides 200).
8
10
  */
9
11
  :root {
10
12
  --card-content-gap: var(--dimension-100);
11
- --card-content-padding-block: var(--dimension-200);
13
+ --card-content-padding-block-start: var(--dimension-100);
14
+ --card-content-padding-block-end: var(--dimension-200);
12
15
  --card-content-padding-inline: var(--dimension-200);
13
16
  }
14
17
 
@@ -17,6 +20,7 @@
17
20
  flex-direction: column;
18
21
  gap: var(--card-content-gap);
19
22
 
20
- padding-block: var(--card-content-padding-block);
23
+ padding-block-start: var(--card-content-padding-block-start);
24
+ padding-block-end: var(--card-content-padding-block-end);
21
25
  padding-inline: var(--card-content-padding-inline);
22
26
  }
@@ -3,7 +3,7 @@ import "./styles.css";
3
3
  const componentCssClassName = "ds card-footer";
4
4
  /**
5
5
  * Footer component for Card. A padded content-bearing section pinned to the
6
- * bottom of the card, for actions or supplementary information.
6
+ * bottom of the card, for tags and labels.
7
7
  *
8
8
  * @implements ds:global.subcomponent.card-footer
9
9
  */
@@ -3,7 +3,8 @@
3
3
  * @implements ds:global.subcomponent.card-footer
4
4
  *
5
5
  * A content-bearing section: it pads itself (the card frame applies no general
6
- * padding). Vertical padding is in baseline multiples.
6
+ * padding). Vertical padding is in baseline multiples. Holds tags and labels,
7
+ * which flow in a wrapping row.
7
8
  */
8
9
  :root {
9
10
  --card-footer-gap: var(--dimension-100);
@@ -12,10 +13,19 @@
12
13
  }
13
14
 
14
15
  .ds.card-footer {
16
+ /* Inline flow: badges, chips and inline text sit on a line and wrap. Children
17
+ * keep their natural width (`flex: 0 0 auto` — no grow, no shrink) and are
18
+ * vertically centred, so a Badge is not stretched to the footer width. */
15
19
  display: flex;
16
- flex-direction: column;
20
+ flex-direction: row;
21
+ flex-wrap: wrap;
22
+ align-items: center;
17
23
  gap: var(--card-footer-gap);
18
24
 
19
25
  padding-block: var(--card-footer-padding-block);
20
26
  padding-inline: var(--card-footer-padding-inline);
27
+
28
+ & > * {
29
+ flex: 0 0 auto;
30
+ }
21
31
  }