@canonical/react-ds-global 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/lib/component/Accordion/common/Item/styles.css +57 -9
- package/dist/esm/lib/component/Badge/styles.css +25 -24
- package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js +12 -2
- package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js.map +1 -1
- package/dist/esm/lib/component/Breadcrumbs/common/Item/styles.css +17 -5
- package/dist/esm/lib/component/Breadcrumbs/styles.css +3 -0
- package/dist/esm/lib/component/Button/Button.js +4 -5
- package/dist/esm/lib/component/Button/Button.js.map +1 -1
- package/dist/esm/lib/component/Button/styles.css +78 -12
- package/dist/esm/lib/component/Card/Card.js +7 -0
- package/dist/esm/lib/component/Card/Card.js.map +1 -1
- package/dist/esm/lib/component/Card/common/Content/styles.css +7 -3
- package/dist/esm/lib/component/Card/common/Footer/Footer.js +1 -1
- package/dist/esm/lib/component/Card/common/Footer/styles.css +12 -2
- package/dist/esm/lib/component/Card/styles.css +52 -14
- package/dist/esm/lib/component/Chip/styles.css +3 -0
- package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js +6 -4
- package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js.map +1 -1
- package/dist/esm/lib/component/ContextualMenu/common/Item/styles.css +31 -3
- package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js +24 -5
- package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js.map +1 -1
- package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js +3 -5
- package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js.map +1 -1
- package/dist/esm/lib/group/Cards/Cards.js +49 -0
- package/dist/esm/lib/group/Cards/Cards.js.map +1 -0
- package/dist/esm/lib/group/Cards/index.js +3 -0
- package/dist/esm/lib/group/Cards/index.js.map +1 -0
- package/dist/esm/lib/group/Cards/styles.css +55 -0
- package/dist/esm/lib/group/Cards/types.js +2 -0
- package/dist/esm/lib/group/Cards/types.js.map +1 -0
- package/dist/esm/lib/group/index.js +1 -0
- package/dist/esm/lib/group/index.js.map +1 -1
- package/dist/esm/lib/hooks/index.js +1 -0
- package/dist/esm/lib/hooks/index.js.map +1 -1
- package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js +6 -0
- package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js.map +1 -1
- package/dist/esm/lib/hooks/useIsMounted/index.js +3 -0
- package/dist/esm/lib/hooks/useIsMounted/index.js.map +1 -0
- package/dist/esm/lib/hooks/useIsMounted/types.js +2 -0
- package/dist/esm/lib/hooks/useIsMounted/types.js.map +1 -0
- package/dist/esm/lib/hooks/useIsMounted/useIsMounted.js +21 -0
- package/dist/esm/lib/hooks/useIsMounted/useIsMounted.js.map +1 -0
- package/dist/types/lib/component/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/types/lib/component/Breadcrumbs/common/Item/Item.d.ts.map +1 -1
- package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts +5 -0
- package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts.map +1 -1
- package/dist/types/lib/component/Breadcrumbs/types.d.ts +15 -0
- package/dist/types/lib/component/Breadcrumbs/types.d.ts.map +1 -1
- package/dist/types/lib/component/Button/Button.d.ts.map +1 -1
- package/dist/types/lib/component/Button/types.d.ts +7 -5
- package/dist/types/lib/component/Button/types.d.ts.map +1 -1
- package/dist/types/lib/component/Card/Card.d.ts +7 -0
- package/dist/types/lib/component/Card/Card.d.ts.map +1 -1
- package/dist/types/lib/component/Card/common/Footer/Footer.d.ts +1 -1
- package/dist/types/lib/component/Card/common/Footer/types.d.ts +1 -1
- package/dist/types/lib/component/Card/common/Footer/types.d.ts.map +1 -1
- package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts.map +1 -1
- package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts.map +1 -1
- package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts +1 -1
- package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts.map +1 -1
- package/dist/types/lib/group/Cards/Cards.d.ts +40 -0
- package/dist/types/lib/group/Cards/Cards.d.ts.map +1 -0
- package/dist/types/lib/group/Cards/index.d.ts +3 -0
- package/dist/types/lib/group/Cards/index.d.ts.map +1 -0
- package/dist/types/lib/group/Cards/types.d.ts +14 -0
- package/dist/types/lib/group/Cards/types.d.ts.map +1 -0
- package/dist/types/lib/group/index.d.ts +1 -0
- package/dist/types/lib/group/index.d.ts.map +1 -1
- package/dist/types/lib/hooks/index.d.ts +1 -0
- package/dist/types/lib/hooks/index.d.ts.map +1 -1
- package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts.map +1 -1
- package/dist/types/lib/hooks/useIsMounted/index.d.ts +3 -0
- package/dist/types/lib/hooks/useIsMounted/index.d.ts.map +1 -0
- package/dist/types/lib/hooks/useIsMounted/types.d.ts +6 -0
- package/dist/types/lib/hooks/useIsMounted/types.d.ts.map +1 -0
- package/dist/types/lib/hooks/useIsMounted/useIsMounted.d.ts +15 -0
- package/dist/types/lib/hooks/useIsMounted/useIsMounted.d.ts.map +1 -0
- package/dist/types/lib/types/link.d.ts +1 -1
- package/package.json +15 -15
|
@@ -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
|
|
29
|
-
re-channels the base ghost (no hover/active channel), so
|
|
30
|
-
to the non-layered ghost vars
|
|
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-
|
|
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(
|
|
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(
|
|
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>
|
|
124
|
-
|
|
125
|
-
|
|
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;
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
--badge-color-
|
|
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:
|
|
7
|
-
--badge-font-
|
|
8
|
-
--badge-font-
|
|
9
|
-
--badge-
|
|
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(--
|
|
14
|
+
--badge-padding-horizontal: var(--dimension-050);
|
|
12
15
|
--badge-margin-bottom: 0;
|
|
13
16
|
|
|
14
|
-
--badge-
|
|
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:
|
|
33
|
-
|
|
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
|
|
9
|
-
* root of the information
|
|
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: [
|
|
17
|
+
return (_jsxs("li", { className: [
|
|
18
|
+
componentCssClassName,
|
|
19
|
+
current && "current",
|
|
20
|
+
disabled && "disabled",
|
|
21
|
+
className,
|
|
22
|
+
]
|
|
18
23
|
.filter(Boolean)
|
|
19
|
-
.join(" "), ...props, children: [
|
|
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,
|
|
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
|
-
|
|
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.
|
|
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
|
-
&:
|
|
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
|
}
|
|
@@ -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
|
-
|
|
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;
|
|
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(--
|
|
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
|
|
51
|
-
states shim (`--modifier-surface-{hover,active,disabled}`,
|
|
52
|
-
`--modifier-color-text-disabled`), which
|
|
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 {
|
|
@@ -69,11 +82,13 @@
|
|
|
69
82
|
a borderless importance simply resolves to 0 with no separate rule. */
|
|
70
83
|
border-width: calc(var(--modifier-outline, 0) * var(--button-border-width));
|
|
71
84
|
|
|
72
|
-
/*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
/* Label typography tokens (text-secondary tier, 14px). The block placement that
|
|
86
|
+
lands the label on the baseline grid comes from the density seat at the end of
|
|
87
|
+
this file (the button no longer carries `.p`, so the engine's on-element nudges
|
|
88
|
+
don't apply — without the seat the label is flat/unaligned). --font-size /
|
|
89
|
+
--line-height are still exposed for any consumer that reads them. */
|
|
90
|
+
--font-size: var(--button-font-size);
|
|
91
|
+
--line-height: var(--button-line-height);
|
|
77
92
|
font-weight: var(--button-font-weight);
|
|
78
93
|
padding-inline: var(--button-padding-inline-start)
|
|
79
94
|
var(--button-padding-inline-end);
|
|
@@ -120,7 +135,9 @@
|
|
|
120
135
|
/* Disabled — explicit disabled tokens (not the computed deltas): the surface,
|
|
121
136
|
text and border each resolve to their `-disabled` token. Primary supplies
|
|
122
137
|
the on-fill disabled text via `--modifier-color-text-disabled`; ghost
|
|
123
|
-
importances fall back to the plain disabled text colour.
|
|
138
|
+
importances fall back to the plain disabled text colour. The border reads
|
|
139
|
+
the disabled border channel, so it stays on the same highlighted ramp as
|
|
140
|
+
the enabled border and recolours per anticipation. */
|
|
124
141
|
&:disabled {
|
|
125
142
|
cursor: not-allowed;
|
|
126
143
|
color: var(--modifier-color-text-disabled, var(--color-text-disabled));
|
|
@@ -128,7 +145,10 @@
|
|
|
128
145
|
--modifier-surface-disabled,
|
|
129
146
|
var(--button-color-background-disabled)
|
|
130
147
|
);
|
|
131
|
-
border-color: var(
|
|
148
|
+
border-color: var(
|
|
149
|
+
--modifier-color-border-disabled,
|
|
150
|
+
var(--color-border-highlighted-disabled)
|
|
151
|
+
);
|
|
132
152
|
}
|
|
133
153
|
}
|
|
134
154
|
|
|
@@ -210,3 +230,49 @@
|
|
|
210
230
|
border-color: transparent;
|
|
211
231
|
}
|
|
212
232
|
}
|
|
233
|
+
|
|
234
|
+
/* ── Density seat (apps 32 / sites 36, dense 24 / 28) ────────────────────────
|
|
235
|
+
* The button consumes the density primitives from @canonical/styles (context ×
|
|
236
|
+
* density on an ancestor) to size its box to the cell and seat its label on the
|
|
237
|
+
* 4px baseline grid. This lives HERE (ds-global) and not in
|
|
238
|
+
* @canonical/react-ds-global-form's density.css, because the Button is a ds-global
|
|
239
|
+
* component: an app that ships ds-global without the form package must still get a
|
|
240
|
+
* seated button, not a flat one. The primitives are read from the shared styles
|
|
241
|
+
* layer, so there is no form dependency.
|
|
242
|
+
*
|
|
243
|
+
* `:is()` on the density scope (0,1,0) so `:is(...) .ds.button` (0,2,0) beats the
|
|
244
|
+
* button's own `.ds.button { align-items: center }` (0,1,0) — otherwise the label
|
|
245
|
+
* stays flex-CENTRED and the padding-based baseline placement can't govern. */
|
|
246
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.button {
|
|
247
|
+
box-sizing: border-box;
|
|
248
|
+
/* Fixed grid-multiple height (the density cell), border-box so the border is
|
|
249
|
+
absorbed into the height — a bordered and a borderless button of one density
|
|
250
|
+
are the same height. Top-referenced so the space-before below governs. */
|
|
251
|
+
block-size: var(--density-line-height-effective);
|
|
252
|
+
min-block-size: var(--density-line-height-effective);
|
|
253
|
+
align-items: flex-start;
|
|
254
|
+
justify-content: flex-start;
|
|
255
|
+
/* Kill only the UA bottom padding; the placement below owns padding-block-start
|
|
256
|
+
(a `padding-block: 0` shorthand would out-specify and wipe the start). */
|
|
257
|
+
padding-block-end: 0;
|
|
258
|
+
|
|
259
|
+
/* Crush to line-height:1 for the seat; the baseline within that box is the cap
|
|
260
|
+
approximation (1em + 1cap)/2. The label font tier (--font-size/--font-family)
|
|
261
|
+
is the button's own (text-secondary, 14px), set on the base rule. */
|
|
262
|
+
line-height: 1;
|
|
263
|
+
--natural-baseline: calc((1em + 1cap) / 2);
|
|
264
|
+
/* The box's top border sits above the label and counts toward the target, so
|
|
265
|
+
subtract the NOMINAL --button-border-width for BOTH importances — the primary's
|
|
266
|
+
0-outline (borderless) is handled by the grid maths, not by zeroing this term
|
|
267
|
+
(a per-importance term lifts the primary a pixel; regression, reverted). */
|
|
268
|
+
--border-top-width: var(--button-border-width, 0px);
|
|
269
|
+
--space-before: max(
|
|
270
|
+
0px,
|
|
271
|
+
calc(
|
|
272
|
+
var(--density-target-baseline-px, 0px) -
|
|
273
|
+
var(--natural-baseline) -
|
|
274
|
+
var(--border-top-width, 0px)
|
|
275
|
+
)
|
|
276
|
+
);
|
|
277
|
+
padding-block-start: var(--space-before);
|
|
278
|
+
}
|
|
@@ -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
|
|
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-
|
|
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
|
|
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:
|
|
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
|
}
|
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
* container (no step) and reads as flush. It stays delimited by its border,
|
|
8
8
|
* radius, and the dividers between its sections. Colour tokens follow the Figma
|
|
9
9
|
* spec.
|
|
10
|
+
*
|
|
11
|
+
* ── A Card is a grid participant ────────────────────────────────────────────
|
|
12
|
+
* A Card always lives inside a grid (standalone: wrap it in a `.grid`; in bulk:
|
|
13
|
+
* use the `Cards` group). It carries all of its OWN grid logic here. The card is
|
|
14
|
+
* a ROW SUBGRID spanning FOUR section tracks — image / header / content / footer
|
|
15
|
+
* — inheriting them from the parent so several cards can line their sections up
|
|
16
|
+
* across a row. A card that omits a section simply leaves that track empty for
|
|
17
|
+
* itself; the four-track vocabulary is fixed because a Card only ever has those
|
|
18
|
+
* four section types. `Cards` supplies the shared tracks and the column flow.
|
|
10
19
|
*/
|
|
11
20
|
:root {
|
|
12
21
|
--card-color-border: var(--color-border-muted);
|
|
@@ -16,26 +25,55 @@
|
|
|
16
25
|
}
|
|
17
26
|
|
|
18
27
|
.ds.card {
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
/* One grid item spanning `--card-span` parent columns and its four section
|
|
29
|
+
* rows; a ROW subgrid so its sections snap to the parent's four shared tracks
|
|
30
|
+
* (that is the cross-card alignment). The parent (a `.grid` or the `Cards`
|
|
31
|
+
* group) owns the four row tracks. */
|
|
32
|
+
grid-column: span var(--card-span, 1);
|
|
33
|
+
grid-row: span 4;
|
|
34
|
+
display: grid;
|
|
35
|
+
grid-template-rows: subgrid;
|
|
36
|
+
grid-template-columns: minmax(0, 1fr);
|
|
21
37
|
|
|
22
38
|
/* No background of its own: the card is not a surface, so it inherits its
|
|
23
39
|
container's background and blends with the surface it sits on. */
|
|
24
|
-
|
|
25
40
|
border: var(--card-border-width) solid var(--card-color-border);
|
|
26
41
|
border-radius: var(--card-border-radius);
|
|
27
|
-
|
|
28
42
|
/* Clip section corners (e.g. full-bleed images) to the card radius. */
|
|
29
43
|
overflow: hidden;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Place each section on its fixed row track, spanning the card's single column.
|
|
47
|
+
* DOM order matches track order: image (1) / header (2) / content (3) /
|
|
48
|
+
* footer (4). An absent section leaves its track empty for this card only. */
|
|
49
|
+
.ds.card > .card-image {
|
|
50
|
+
grid-row: 1;
|
|
51
|
+
grid-column: 1 / -1;
|
|
52
|
+
}
|
|
53
|
+
.ds.card > .card-header {
|
|
54
|
+
grid-row: 2;
|
|
55
|
+
grid-column: 1 / -1;
|
|
56
|
+
}
|
|
57
|
+
.ds.card > .card-content {
|
|
58
|
+
grid-row: 3;
|
|
59
|
+
grid-column: 1 / -1;
|
|
60
|
+
}
|
|
61
|
+
.ds.card > .card-footer {
|
|
62
|
+
grid-row: 4;
|
|
63
|
+
grid-column: 1 / -1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Section separators: a divider between adjacent sections. The card frame
|
|
67
|
+
* provides the outer border, so the last section has none. The header is NOT a
|
|
68
|
+
* separate visual section — no divider is drawn under it and it merges with the
|
|
69
|
+
* content that follows. Media (Image) stays full-bleed; the content-bearing
|
|
70
|
+
* sections pad themselves. */
|
|
71
|
+
.ds.card > :is(.card-content, .card-footer, .card-image):not(:last-child) {
|
|
72
|
+
border-block-end: var(--card-border-width) solid var(--card-color-border);
|
|
73
|
+
}
|
|
30
74
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
&
|
|
36
|
-
> :is(.card-header, .card-content, .card-footer, .card-image):not(
|
|
37
|
-
:last-child
|
|
38
|
-
) {
|
|
39
|
-
border-block-end: var(--card-border-width) solid var(--card-color-border);
|
|
40
|
-
}
|
|
75
|
+
/* Collapse the header/content seam so title and content read as one region
|
|
76
|
+
(raw 0: unthemable by design). */
|
|
77
|
+
.ds.card > .card-header:has(+ .card-content) {
|
|
78
|
+
padding-block-end: 0;
|
|
41
79
|
}
|
|
@@ -99,6 +99,9 @@
|
|
|
99
99
|
|
|
100
100
|
/* Context-specific styling for badges within chips */
|
|
101
101
|
& .ds.badge {
|
|
102
|
+
/** Pull the badge closer to the edge of a chip */
|
|
103
|
+
--badge-chip-margin-tweak: var(--dimension-025);
|
|
104
|
+
|
|
102
105
|
align-self: center;
|
|
103
106
|
margin-left: var(--spacing-horizontal-small);
|
|
104
107
|
margin-right: var(--badge-chip-margin-tweak);
|