@canonical/react-ds-global 0.49.0 → 0.50.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/_work_in_progress/Announcement/styles.css +4 -4
- package/dist/esm/lib/_work_in_progress/Label/styles.css +1 -7
- package/dist/esm/lib/component/Accordion/common/Item/styles.css +5 -6
- package/dist/esm/lib/component/Accordion/styles.css +3 -9
- package/dist/esm/lib/component/Breadcrumbs/common/Item/styles.css +6 -14
- package/dist/esm/lib/component/Breadcrumbs/styles.css +2 -9
- package/dist/esm/lib/component/Button/styles.css +1 -1
- package/dist/esm/lib/component/Card/common/Content/styles.css +4 -5
- package/dist/esm/lib/component/Card/common/Header/styles.css +1 -2
- package/dist/esm/lib/component/Card/styles.css +1 -2
- package/dist/esm/lib/component/ContextualMenu/common/Item/styles.css +6 -9
- package/dist/esm/lib/component/ContextualMenu/styles.css +6 -7
- package/dist/esm/lib/component/Icon/styles.css +3 -7
- package/dist/esm/lib/component/InlineCode/styles.css +2 -3
- package/dist/esm/lib/component/KeyboardKey/styles.css +6 -8
- package/dist/esm/lib/component/Tabs/common/Item/styles.css +1 -1
- package/dist/esm/lib/component/Tabs/styles.css +4 -8
- package/dist/esm/lib/component/Tile/common/Content/styles.css +2 -5
- package/dist/esm/lib/component/Tile/common/Header/styles.css +3 -6
- package/dist/esm/lib/component/Tile/styles.css +1 -5
- package/dist/esm/lib/component/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/lib/component/Tooltip/TooltipEngine.js +91 -15
- package/dist/esm/lib/component/Tooltip/TooltipEngine.js.map +1 -1
- package/dist/esm/lib/component/Tooltip/hooks/useTooltipState.js +89 -0
- package/dist/esm/lib/component/Tooltip/hooks/useTooltipState.js.map +1 -0
- package/dist/esm/lib/component/Tooltip/styles.css +151 -80
- package/dist/esm/lib/component/Tooltip/withTooltip.js +3 -3
- package/dist/esm/lib/group/KeyboardKeys/styles.css +1 -1
- package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js +172 -173
- package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js.map +1 -1
- package/dist/esm/lib/pattern/Modal/common/Content/styles.css +3 -6
- package/dist/esm/lib/pattern/Modal/common/Footer/styles.css +1 -1
- package/dist/esm/lib/pattern/Modal/common/Header/styles.css +3 -9
- package/dist/esm/lib/pattern/Modal/styles.css +14 -20
- package/dist/esm/lib/pattern/Timeline/common/Content/styles.css +1 -4
- package/dist/esm/lib/pattern/Timeline/common/Event/styles.css +6 -13
- package/dist/esm/lib/pattern/Timeline/styles.css +1 -4
- package/dist/types/lib/component/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/lib/component/Tooltip/TooltipEngine.d.ts +6 -4
- package/dist/types/lib/component/Tooltip/TooltipEngine.d.ts.map +1 -1
- package/dist/types/lib/component/Tooltip/hooks/useTooltipState.d.ts +17 -0
- package/dist/types/lib/component/Tooltip/hooks/useTooltipState.d.ts.map +1 -0
- package/dist/types/lib/component/Tooltip/types.d.ts +27 -2
- package/dist/types/lib/component/Tooltip/types.d.ts.map +1 -1
- package/dist/types/lib/component/Tooltip/withTooltip.d.ts +3 -3
- package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts +22 -1
- package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts.map +1 -1
- package/package.json +23 -14
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* modifier family (@canonical/design-tokens → modifiers.criticality.css), which
|
|
8
8
|
* remaps the --modifier-color-* channels. The criticality tints the SURFACE —
|
|
9
9
|
* background, side bar, and icon — via those channels; the text stays the
|
|
10
|
-
* neutral root colour (`--color-text`) on every criticality
|
|
10
|
+
* neutral root colour (`--color-text`) on every criticality. The
|
|
11
11
|
* component restates no criticality token; it only reads channels. The default
|
|
12
12
|
* look comes from the `criticality="information"` prop default, which applies
|
|
13
13
|
* `.information` and supplies the channel values; no class ⇒ no tint, by design.
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
align-items: flex-start;
|
|
30
30
|
gap: var(--dimension-100);
|
|
31
31
|
|
|
32
|
-
/* Side bar
|
|
32
|
+
/* Side bar: leading rule carrying the criticality colour. */
|
|
33
33
|
border-inline-start-style: solid;
|
|
34
34
|
border-inline-start-width: var(--dimension-stroke-thickness-large);
|
|
35
35
|
border-inline-start-color: var(--modifier-color-border);
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
padding: var(--dimension-100);
|
|
38
38
|
|
|
39
39
|
/* Text is always the root text colour — the criticality tints the icon,
|
|
40
|
-
side bar and background, but the copy stays neutral
|
|
41
|
-
|
|
40
|
+
side bar and background, but the copy stays neutral on every
|
|
41
|
+
criticality. Only the icon reads the criticality colour channel. */
|
|
42
42
|
color: var(--color-text);
|
|
43
43
|
background-color: var(--modifier-color-foreground-secondary);
|
|
44
44
|
|
|
@@ -5,19 +5,13 @@
|
|
|
5
5
|
* Label styles
|
|
6
6
|
* @implements ds:global.component.label
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* - layout.display: inline -> display: inline
|
|
10
|
-
* - typography.size: font/size/label -> font-size: var(--font-size-label)
|
|
11
|
-
* - typography.weight: font/weight/medium -> font-weight: var(--font-weight-medium)
|
|
8
|
+
* Inline text at the label font size and the medium font weight.
|
|
12
9
|
*/
|
|
13
10
|
.ds.label {
|
|
14
|
-
/* layout.display: inline */
|
|
15
11
|
display: inline;
|
|
16
12
|
|
|
17
|
-
/* typography.size: font/size/label */
|
|
18
13
|
font-size: var(--label-font-size, var(--font-size-label, 0.75rem));
|
|
19
14
|
|
|
20
|
-
/* typography.weight: font/weight/medium */
|
|
21
15
|
font-weight: var(--label-font-weight, var(--font-weight-medium, 500));
|
|
22
16
|
|
|
23
17
|
/* Additional styling */
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @implements ds:global.subcomponent.accordion-item
|
|
7
7
|
*
|
|
8
8
|
* Rendered with native <details>/<summary>. Typography and baseline alignment
|
|
9
|
-
* come from the `.p` class on the heading and content.
|
|
10
|
-
*
|
|
9
|
+
* come from the `.p` class on the heading and content. The header's
|
|
10
|
+
* interactive background uses the ghost surface channel (which
|
|
11
11
|
* auto-steps on nested .surface contexts to layer2/layer3), text uses
|
|
12
12
|
* color-text, the chevron uses color-icon, and dividers use color-border-muted.
|
|
13
13
|
* Vertical padding is expressed in baseline multiples.
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
/* Vertical content padding in baseline multiples (dimension-100 = 1 bU). */
|
|
57
57
|
--accordion-item-content-padding-block: var(--dimension-100);
|
|
58
58
|
|
|
59
|
-
/* Fixed chevron size
|
|
59
|
+
/* Fixed chevron size so every item reserves the same chevron
|
|
60
60
|
column width and all headings start at the same x-position, regardless of
|
|
61
61
|
heading level — no horizontal drift. */
|
|
62
62
|
--accordion-item-chevron-size: var(--dimension-200);
|
|
@@ -76,8 +76,7 @@
|
|
|
76
76
|
/* Inline (side) borders — off by default, see the token above. */
|
|
77
77
|
border-inline: var(--accordion-item-border-inline);
|
|
78
78
|
|
|
79
|
-
/*
|
|
80
|
-
of an accordion item indicates the end of an accordion item"). */
|
|
79
|
+
/* The divider at the end of each item marks where the item ends. */
|
|
81
80
|
border-block-end: var(--dimension-stroke-thickness-medium) solid
|
|
82
81
|
var(--accordion-item-color-border);
|
|
83
82
|
}
|
|
@@ -220,7 +219,7 @@
|
|
|
220
219
|
}
|
|
221
220
|
}
|
|
222
221
|
|
|
223
|
-
/* Open: chevron points down (
|
|
222
|
+
/* Open: the chevron points down (it points right when closed). */
|
|
224
223
|
.ds.accordion-item[open] > .header > .chevron {
|
|
225
224
|
transform: rotate(0deg);
|
|
226
225
|
}
|
|
@@ -5,19 +5,13 @@
|
|
|
5
5
|
* Accordion styles
|
|
6
6
|
* @implements ds:global.component.accordion
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* - layout.type: stack -> display: flex; flex-direction: column
|
|
10
|
-
* - layout.direction: vertical -> flex-direction: column
|
|
11
|
-
* - appearance.border: color-border-$root
|
|
12
|
-
*
|
|
13
|
-
* Tokens follow the Figma spec.
|
|
8
|
+
* A vertical stack of items.
|
|
14
9
|
*/
|
|
15
10
|
:root {
|
|
16
11
|
--accordion-border-radius: var(--dimension-radius-small);
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
.ds.accordion {
|
|
20
|
-
/* layout.type: stack, layout.direction: vertical */
|
|
21
15
|
display: flex;
|
|
22
16
|
flex-direction: column;
|
|
23
17
|
|
|
@@ -31,8 +25,8 @@
|
|
|
31
25
|
.surface context; outside any .surface it defaults to the base background. */
|
|
32
26
|
background: var(--surface-color-background, var(--color-background));
|
|
33
27
|
|
|
34
|
-
/*
|
|
35
|
-
|
|
28
|
+
/* The accordion has no outer border or frame, only the per-item dividers
|
|
29
|
+
(see Accordion.Item). */
|
|
36
30
|
border-radius: var(--accordion-border-radius);
|
|
37
31
|
|
|
38
32
|
/* Clip item corners to the accordion radius */
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
* Breadcrumbs.Item styles
|
|
6
6
|
* @implements ds:global.subcomponent.breadcrumbs-item
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
11
|
-
* - layout.align: center -> align-items: center
|
|
12
|
-
*
|
|
13
|
-
* Tokens follow the Figma spec: links use color-text-link, the current item
|
|
14
|
-
* and the separator use color-text, and the spacing around the separator
|
|
15
|
-
* uses the dimension scale (Figma specs 6px, which is not on the scale; the
|
|
16
|
-
* nearest token is dimension-100 = 8px).
|
|
8
|
+
* A centred row. Links use color-text-link, the current item and the
|
|
9
|
+
* separator use color-text, and the spacing around the separator is
|
|
10
|
+
* dimension-100 (8px), the nearest step of the dimension scale to 6px.
|
|
17
11
|
*/
|
|
18
12
|
.ds.breadcrumbs-item {
|
|
19
13
|
/* Component tokens — pure aliases to semantic tokens, component-scoped
|
|
@@ -26,25 +20,23 @@
|
|
|
26
20
|
--breadcrumbs-item-separator-color: var(--color-text);
|
|
27
21
|
--breadcrumbs-item-focus-color: var(--color-text-link);
|
|
28
22
|
|
|
29
|
-
/* layout.type: flow, layout.direction: horizontal */
|
|
30
23
|
display: flex;
|
|
31
24
|
flex-direction: row;
|
|
32
25
|
|
|
33
26
|
/* Distance between the separator and the link. */
|
|
34
27
|
column-gap: var(--breadcrumbs-item-separator-margin);
|
|
35
28
|
|
|
36
|
-
/* layout.align: center */
|
|
37
29
|
align-items: center;
|
|
38
30
|
|
|
39
31
|
/* Remove list styling */
|
|
40
32
|
list-style: none;
|
|
41
33
|
|
|
42
|
-
/* Link element
|
|
34
|
+
/* Link element. */
|
|
43
35
|
& > .link {
|
|
44
36
|
color: var(--breadcrumbs-item-link-color);
|
|
45
37
|
text-decoration: none;
|
|
46
38
|
|
|
47
|
-
/*
|
|
39
|
+
/* Underlined on interaction. */
|
|
48
40
|
&:hover {
|
|
49
41
|
text-decoration: underline;
|
|
50
42
|
}
|
|
@@ -56,7 +48,7 @@
|
|
|
56
48
|
}
|
|
57
49
|
}
|
|
58
50
|
|
|
59
|
-
/* Separator element
|
|
51
|
+
/* Separator element. Rendered before the link so a
|
|
60
52
|
wrapped row starts with the slash; hidden on the first item. Spacing
|
|
61
53
|
around it is gap-based (the list column-gap before, the item
|
|
62
54
|
column-gap after) rather than separator margins, so a separator that
|
|
@@ -5,13 +5,8 @@
|
|
|
5
5
|
* Breadcrumbs styles
|
|
6
6
|
* @implements ds:global.component.breadcrumbs
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* - layout.direction: horizontal -> flex-direction: row
|
|
11
|
-
* - layout.align: center -> align-items: center
|
|
12
|
-
*
|
|
13
|
-
* Typography and baseline alignment come from the `.p` class on the list
|
|
14
|
-
* (the typography-text-primary tier, per the Figma spec).
|
|
8
|
+
* A centred row that wraps. Typography and baseline alignment come from the
|
|
9
|
+
* `.p` class on the list (the typography-text-primary tier).
|
|
15
10
|
*/
|
|
16
11
|
.ds.breadcrumbs {
|
|
17
12
|
/* Component token — a pure alias to a semantic token, component-scoped
|
|
@@ -20,7 +15,6 @@
|
|
|
20
15
|
--breadcrumbs-item-separator-margin: var(--dimension-100);
|
|
21
16
|
|
|
22
17
|
& > .list {
|
|
23
|
-
/* layout.type: flow, layout.direction: horizontal */
|
|
24
18
|
display: flex;
|
|
25
19
|
flex-direction: row;
|
|
26
20
|
flex-wrap: wrap;
|
|
@@ -33,7 +27,6 @@
|
|
|
33
27
|
opens a wrapped row aligns flush with the container edge. */
|
|
34
28
|
column-gap: var(--breadcrumbs-item-separator-margin);
|
|
35
29
|
|
|
36
|
-
/* layout.align: center */
|
|
37
30
|
align-items: center;
|
|
38
31
|
|
|
39
32
|
/* Reset list styles */
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
--button-color-text: var(--color-text);
|
|
24
24
|
--button-color-border: var(--color-border-highlighted, var(--color-border));
|
|
25
25
|
|
|
26
|
-
/* Inline padding
|
|
26
|
+
/* Inline padding:
|
|
27
27
|
- end (right): always dimension-200 (16px) — the label always sits 16px
|
|
28
28
|
from the trailing edge.
|
|
29
29
|
- start (left): dimension-200 (16px) with no icon; dimension-100 (8px) when
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* Card.Content styles
|
|
6
6
|
* @implements ds:global.subcomponent.card-content
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* sides 200).
|
|
8
|
+
* A vertical stack and a content-bearing section: it pads itself (the card
|
|
9
|
+
* frame applies no general padding). Vertical padding is in baseline
|
|
10
|
+
* multiples and asymmetric: one baseline on top, two below (top 100 /
|
|
11
|
+
* bottom 200 / sides 200).
|
|
13
12
|
*/
|
|
14
13
|
:root {
|
|
15
14
|
--card-content-gap: var(--dimension-100);
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* Card.Header styles
|
|
6
6
|
* @implements ds:global.subcomponent.card-header
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* A content-bearing section: it pads itself (the card frame applies no general
|
|
8
|
+
* A row with its items spread to both ends, and a content-bearing section: it pads itself (the card frame applies no general
|
|
10
9
|
* padding). Vertical padding is in baseline multiples.
|
|
11
10
|
*/
|
|
12
11
|
:root {
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
* The Card is NOT a surface: it establishes no `.surface` context and sets no
|
|
9
9
|
* background of its own, so on a surface it takes the same background as its
|
|
10
10
|
* container (no step) and reads as flush. It stays delimited by its border,
|
|
11
|
-
* radius, and the dividers between its sections.
|
|
12
|
-
* spec.
|
|
11
|
+
* radius, and the dividers between its sections.
|
|
13
12
|
*
|
|
14
13
|
* ── A Card is a grid participant ────────────────────────────────────────────
|
|
15
14
|
* A Card always lives inside a grid (standalone: wrap it in a `.grid`; in bulk:
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
2
2
|
|
|
3
3
|
@layer ds.components.global {
|
|
4
|
-
/* Component tokens — sourced from @canonical/design-tokens
|
|
5
|
-
Mapped strictly to the Figma "Contextual menu item" frame:
|
|
4
|
+
/* Component tokens — sourced from @canonical/design-tokens:
|
|
6
5
|
px = dimension-200 (16px), py = dimension-050 (4px), gap = dimension-050 (4px)
|
|
7
6
|
between icon<->text and text<->caret, text = color-text (black),
|
|
8
7
|
fills = color-foreground-ghost/-active, line-height 24px.
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
);
|
|
20
19
|
--contextual-menu-item-padding-block: var(--dimension-050);
|
|
21
20
|
--contextual-menu-item-padding-inline: var(--dimension-200);
|
|
22
|
-
/* 4px gap: icon<->text and text<->caret
|
|
21
|
+
/* 4px gap: icon<->text and text<->caret. */
|
|
23
22
|
--contextual-menu-item-gap: var(--dimension-050);
|
|
24
23
|
/* De-emphasised slot text (badge / shortcut) — muted, matching
|
|
25
24
|
KeyboardKey / Tabs. */
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
|
|
38
37
|
.ds.contextual-menu-item {
|
|
39
38
|
display: flex;
|
|
40
|
-
/* Icon and first line of text are centre-aligned
|
|
39
|
+
/* Icon and first line of text are centre-aligned. */
|
|
41
40
|
align-items: center;
|
|
42
41
|
gap: var(--contextual-menu-item-gap);
|
|
43
42
|
padding-block: var(--contextual-menu-item-padding-block);
|
|
@@ -57,8 +56,7 @@
|
|
|
57
56
|
background-color: var(--contextual-menu-item-color-background-hover);
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
/* The highlighted (roving) item shows the active fill
|
|
61
|
-
"Active" state. */
|
|
59
|
+
/* The highlighted (roving) item shows the active fill. */
|
|
62
60
|
&:focus-visible,
|
|
63
61
|
&[tabindex="0"] {
|
|
64
62
|
background-color: var(--contextual-menu-item-color-background-active);
|
|
@@ -69,8 +67,7 @@
|
|
|
69
67
|
non-text minimum — so keyboard focus additionally draws a ring (WCAG
|
|
70
68
|
1.4.11 / 2.4.13). Inset (negative offset) so the popup surface's
|
|
71
69
|
`overflow-y: auto` never clips it; :focus-visible only, so pointer users
|
|
72
|
-
keep the quiet
|
|
73
|
-
state, which fails WCAG. */
|
|
70
|
+
keep the quiet look. The active fill alone fails WCAG. */
|
|
74
71
|
&:focus-visible {
|
|
75
72
|
outline: var(--contextual-menu-item-focus-ring-width) solid
|
|
76
73
|
var(--contextual-menu-item-focus-ring-color);
|
|
@@ -88,7 +85,7 @@
|
|
|
88
85
|
color: var(--contextual-menu-item-slot-color);
|
|
89
86
|
}
|
|
90
87
|
|
|
91
|
-
/* The submenu caret sits on the trailing edge in a fixed icon box (
|
|
88
|
+
/* The submenu caret sits on the trailing edge in a fixed icon box (a
|
|
92
89
|
16px chevron in a 24px-tall wrapper). It always follows the reading
|
|
93
90
|
direction — chevron-right in LTR, mirrored to point left in RTL — rather
|
|
94
91
|
than flipping per-item with the side the submenu opens on, so sibling carets
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
2
2
|
|
|
3
3
|
@layer ds.components.global {
|
|
4
|
-
/* Component tokens — sourced from @canonical/design-tokens
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
muted 1px divider between sections. */
|
|
4
|
+
/* Component tokens — sourced from @canonical/design-tokens: a white
|
|
5
|
+
background (color-background), a drop shadow (no border), and a muted 1px
|
|
6
|
+
divider between sections. */
|
|
8
7
|
:root {
|
|
9
8
|
--contextual-menu-color-divider: var(--color-border-muted);
|
|
10
9
|
--contextual-menu-divider-width: var(--dimension-stroke-thickness-medium);
|
|
11
10
|
--contextual-menu-min-width: 12rem;
|
|
12
11
|
--contextual-menu-max-width: 20rem;
|
|
13
|
-
/*
|
|
12
|
+
/* A three-layer drop shadow. */
|
|
14
13
|
--contextual-menu-shadow:
|
|
15
14
|
0 1px 1px 0 rgba(0, 0, 0, 0.15), 0 2px 2px -1px rgba(0, 0, 0, 0.15),
|
|
16
15
|
0 0 3px 0 rgba(0, 0, 0, 0.2);
|
|
@@ -68,8 +67,8 @@
|
|
|
68
67
|
transition: none;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
/* A separator entry draws the muted divider between sections
|
|
72
|
-
color-border-muted, stroke-thickness-medium). Reset the UA's <hr> box —
|
|
70
|
+
/* A separator entry draws the muted divider between sections
|
|
71
|
+
(color-border-muted, stroke-thickness-medium). Reset the UA's <hr> box —
|
|
73
72
|
the divider is a coloured border, not a margin-bearing rule. */
|
|
74
73
|
.separator {
|
|
75
74
|
margin: 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
2
2
|
|
|
3
3
|
@layer ds.components.global {
|
|
4
|
-
/* Component tokens
|
|
4
|
+
/* Component tokens */
|
|
5
5
|
:root {
|
|
6
6
|
--icon-size: 1em;
|
|
7
7
|
}
|
|
@@ -10,17 +10,13 @@
|
|
|
10
10
|
* Icon styles
|
|
11
11
|
* @implements ds:global.component.icon
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* - size.width: size/icon/default -> width: var(--size-icon-default)
|
|
16
|
-
* - size.height: size/icon/default -> height: var(--size-icon-default)
|
|
13
|
+
* An inline box sized by `--icon-size`, falling back to the icon size
|
|
14
|
+
* token.
|
|
17
15
|
*/
|
|
18
16
|
.ds.icon {
|
|
19
|
-
/* layout.display: inline-block */
|
|
20
17
|
display: inline-block;
|
|
21
18
|
vertical-align: middle;
|
|
22
19
|
|
|
23
|
-
/* size.width: size/icon/default, size.height: size/icon/default */
|
|
24
20
|
width: var(--icon-size, var(--size-icon-default, 1rem));
|
|
25
21
|
height: var(--icon-size, var(--size-icon-default, 1rem));
|
|
26
22
|
}
|
|
@@ -11,9 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
/* The `.code` baseline utility (from @canonical/styles) supplies the
|
|
13
13
|
monospace typography tier; inline `.code` gets no vertical padding of its
|
|
14
|
-
own, so the chip adds it
|
|
15
|
-
|
|
16
|
-
mode-aware). */
|
|
14
|
+
own, so the chip adds it (2px top and bottom), plus the horizontal padding
|
|
15
|
+
and the code colour and background (both mode-aware). */
|
|
17
16
|
.ds.inline-code {
|
|
18
17
|
color: var(--inline-code-color-text);
|
|
19
18
|
background-color: var(--inline-code-color-background);
|
|
@@ -10,12 +10,11 @@
|
|
|
10
10
|
below, where the key's own `.surface` scope is in effect. */
|
|
11
11
|
--keyboard-key-color-border: var(--color-border-muted);
|
|
12
12
|
|
|
13
|
-
/*
|
|
14
|
-
|
|
15
|
-
(currently 0). Revisit once a 2px radius token lands. */
|
|
13
|
+
/* The corner radius is meant to be 2px, but no 2px radius token exists yet,
|
|
14
|
+
so this stays on radius-small (currently 0). Revisit once one lands. */
|
|
16
15
|
--keyboard-key-border-radius: var(--dimension-radius-small);
|
|
17
16
|
--keyboard-key-border-width: var(--dimension-stroke-thickness-medium);
|
|
18
|
-
/* 4px inline padding
|
|
17
|
+
/* 4px inline padding. */
|
|
19
18
|
--keyboard-key-padding-inline: var(--dimension-050);
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -28,15 +27,14 @@
|
|
|
28
27
|
.ds.keyboard-key {
|
|
29
28
|
display: inline-block;
|
|
30
29
|
|
|
31
|
-
/*
|
|
32
|
-
"like an input", with a muted border and the surface's text colour.
|
|
30
|
+
/* A key-cap sits on a surface+1 fill, like an input, with a muted border and the surface's text colour.
|
|
33
31
|
|
|
34
32
|
The key establishes its own `.surface` (see KeyboardKey.tsx), so it IS the
|
|
35
33
|
next surface layer and paints ITSELF with that layer's background — exactly
|
|
36
34
|
like the Tile. These reads MUST be here on the class (not `:root`) so
|
|
37
35
|
`--surface-color-*` resolves against the key's own surface depth: nested in
|
|
38
|
-
the ambient surface the background steps to the next layer (
|
|
39
|
-
like inputs
|
|
36
|
+
the ambient surface the background steps to the next layer (surface+1,
|
|
37
|
+
like inputs), and on a `.contrasted` surface it inverts
|
|
40
38
|
for free. The fallbacks keep it sane when placed outside any surface. */
|
|
41
39
|
background-color: var(--surface-color-background, var(--color-background));
|
|
42
40
|
color: var(--surface-color-text, var(--color-text));
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Tabs Item styles (internal renderer)
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Each tab is text with `--dimension-200` (16px)
|
|
8
8
|
* horizontal padding, no gap to its neighbours. The tab shows a bottom border
|
|
9
9
|
* on hover (muted) and when active (highlighted), and a focus border on
|
|
10
10
|
* every side when keyboard-focused; an inert tab (no url) is muted with no
|
|
@@ -5,12 +5,8 @@
|
|
|
5
5
|
* Tabs styles
|
|
6
6
|
* @implements ds:global.component.tabs
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* - edges: tabs-tab (1..*), slot default -> the <li> children of .tabs-list
|
|
11
|
-
*
|
|
12
|
-
* Figma (node 4388-106316): a horizontal strip of tabs with no gap between
|
|
13
|
-
* them, over a full-width muted bottom border; the strip fills its container
|
|
8
|
+
* A horizontal strip of one or more tabs (the <li> children of .tabs-list)
|
|
9
|
+
* with no gap between them, over a full-width muted bottom border; the strip fills its container
|
|
14
10
|
* and scrolls horizontally on overflow.
|
|
15
11
|
*/
|
|
16
12
|
:root {
|
|
@@ -24,7 +20,7 @@
|
|
|
24
20
|
.ds.tabs .tabs-list {
|
|
25
21
|
display: flex;
|
|
26
22
|
flex-direction: row;
|
|
27
|
-
/* No gap between tabs
|
|
23
|
+
/* No gap between tabs. */
|
|
28
24
|
gap: 0;
|
|
29
25
|
margin: 0;
|
|
30
26
|
padding: 0;
|
|
@@ -35,7 +31,7 @@
|
|
|
35
31
|
border-bottom: var(--tabs-border-width) solid var(--color-border-muted);
|
|
36
32
|
|
|
37
33
|
/* Overflow: the strip scrolls horizontally when the tabs exceed the
|
|
38
|
-
container width
|
|
34
|
+
container width. */
|
|
39
35
|
overflow-x: auto;
|
|
40
36
|
}
|
|
41
37
|
}
|
|
@@ -5,11 +5,8 @@
|
|
|
5
5
|
* Tile.Content styles
|
|
6
6
|
* @implements ds:global.subcomponent.tile-content
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
* - spacing.padding.top: dimension/100, spacing.padding.bottom: dimension/200,
|
|
11
|
-
* spacing.internal.horizontal: dimension/200 -> top 100, bottom 200,
|
|
12
|
-
* sides 200. With a header above (padding-bottom 100), the two sections read
|
|
8
|
+
* A vertical stack padded top 100, bottom 200 and sides 200. With a header
|
|
9
|
+
* above (padding-bottom 100), the two sections read
|
|
13
10
|
* as top 100 / sides 200 / bottom 200 with the sections meeting in between.
|
|
14
11
|
*/
|
|
15
12
|
:root {
|
|
@@ -5,12 +5,9 @@
|
|
|
5
5
|
* Tile.Header styles
|
|
6
6
|
* @implements ds:global.subcomponent.tile-header
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - spacing.internal.vertical: dimension/100, spacing.internal.horizontal:
|
|
12
|
-
* dimension/200 -> padding 100 (block) / 200 (inline). The header's block
|
|
13
|
-
* padding is 100 top and bottom; the content below adds its own top padding.
|
|
8
|
+
* A row with its items centred, padded 100 (block) and 200 (inline). The
|
|
9
|
+
* header's block padding is 100 top and bottom; the content below adds its
|
|
10
|
+
* own top padding.
|
|
14
11
|
*/
|
|
15
12
|
:root {
|
|
16
13
|
--tile-header-padding-block: var(--dimension-100);
|
|
@@ -10,11 +10,7 @@
|
|
|
10
10
|
* nest). It paints that background so it stands out on the page (dashboards,
|
|
11
11
|
* bento layouts). It shares the Card radius and has no border of its own. It is
|
|
12
12
|
* a static container — no cursor, hover, or focus affordance.
|
|
13
|
-
*
|
|
14
|
-
* DSL anatomy mapping:
|
|
15
|
-
* - layout.type: stack, layout.direction: vertical -> flex column
|
|
16
|
-
* - appearance.background: color/surface/tile -> the surface background channel
|
|
17
|
-
* - appearance.radius: radius/card -> shared card radius (--dimension-radius-medium)
|
|
13
|
+
* Its sections stack vertically.
|
|
18
14
|
*/
|
|
19
15
|
:root {
|
|
20
16
|
/* Shared with Card. --dimension-radius-medium is currently 0; intended 9. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,CAAC;AAGtB,8EAA8E;AAC9E,4CAA4C;AAC5C,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,OAAO,GAAG,CAAC,EACf,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,KAAK,EACL,MAAM,GAAG,KAAK,EACd,MAAM,EACN,GAAG,KAAK,EACK,EAAsB,EAAE;IACrC,OAAO,CAIL,iBACM,KAAK,EACT,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,IAAI,EAAC,SAAS,iBACD,CAAC,MAAM,EACpB,KAAK,EAAE;YACL,GAAG,KAAK;YACR,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;YACzC,MAAM;SACP,
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,CAAC;AAGtB,8EAA8E;AAC9E,4CAA4C;AAC5C,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,OAAO,GAAG,CAAC,EACf,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,KAAK,EACL,MAAM,GAAG,KAAK,EACd,MAAM,EACN,GAAG,KAAK,EACK,EAAsB,EAAE;IACrC,OAAO,CAIL,iBACM,KAAK,EACT,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,IAAI,EAAC,SAAS,iBACD,CAAC,MAAM,EACpB,KAAK,EAAE;YACL,GAAG,KAAK;YACR,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;YACzC,MAAM;SACP,YAKD,gBAAM,SAAS,EAAC,SAAS,aAEtB,IAAI,CAAC,CAAC,CAAC,CACN,eAAM,SAAS,EAAC,MAAM,iBAAa,MAAM,YACtC,IAAI,GACA,CACR,CAAC,CAAC,CAAC,IAAI,EACR,eAAM,SAAS,EAAC,MAAM,YAAE,QAAQ,GAAQ,IACnC,GACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|