@repobit/dex-system-design 2.5.1 → 2.7.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/CHANGELOG.md +91 -0
- package/README.md +2 -1
- package/package.json +14 -27
- package/schemas/component-manifest.json +233 -33
- package/schemas/manifest-omissions.json +23 -0
- package/src/components/accordion/accordion-bg.css.js +39 -30
- package/src/components/accordion/accordion-bg.js +17 -28
- package/src/components/accordion/accordion-bg.stories.js +5 -0
- package/src/components/accordion/accordion-panel.js +24 -0
- package/src/components/accordion/accordion.css.js +105 -111
- package/src/components/accordion/accordion.js +23 -37
- package/src/components/accordion/accordion.stories.js +5 -1
- package/src/components/anchor/anchor-nav.css.js +131 -53
- package/src/components/anchor/anchor-nav.js +276 -201
- package/src/components/annotation/annotation.css.js +7 -4
- package/src/components/architecture.stories.js +8 -7
- package/src/components/audience-card/audience-card.css.js +30 -4
- package/src/components/audience-card/audience-card.js +8 -13
- package/src/components/awards/awards-flex.css.js +23 -6
- package/src/components/awards/awards-flex.js +21 -6
- package/src/components/awards/awards-spotlight.css.js +25 -5
- package/src/components/awards/awards-spotlight.js +19 -7
- package/src/components/awards/awards.css.js +20 -8
- package/src/components/awards/awards.js +30 -91
- package/src/components/awards/awards.stories.js +5 -5
- package/src/components/awards/scroll-slides.js +128 -0
- package/src/components/back/back.css.js +2 -0
- package/src/components/badge/badge.css.js +15 -0
- package/src/components/bento-grid/bento-grid.css.js +105 -11
- package/src/components/bento-grid/bento-grid.js +37 -124
- package/src/components/bento-grid/bento-grid.stories.js +3 -2
- package/src/components/bento-grid/bento-item.css.js +71 -32
- package/src/components/bento-grid/bento-item.js +1 -30
- package/src/components/blockquote/blockquote.css.js +2 -2
- package/src/components/breadcrumb/breadcrumb.css.js +10 -9
- package/src/components/breadcrumb/breadcrumb.js +35 -34
- package/src/components/button/button.css.js +42 -17
- package/src/components/button/button.js +84 -3
- package/src/components/button/button.stories.js +17 -0
- package/src/components/card-features/card-features.css.js +23 -2
- package/src/components/card-features/card-features.js +6 -48
- package/src/components/cards/card.css.js +43 -14
- package/src/components/cards/card.js +43 -177
- package/src/components/cards/card.stories.js +8 -10
- package/src/components/carousel/carousel.css.js +101 -70
- package/src/components/carousel/carousel.js +107 -71
- package/src/components/carousel/carousel.stories.js +18 -16
- package/src/components/checkbox/checkbox.css.js +26 -9
- package/src/components/checkbox/checkbox.js +73 -39
- package/src/components/checkbox/checkbox.stories.js +35 -18
- package/src/components/compare/compare.css.js +68 -10
- package/src/components/compare/compare.js +40 -103
- package/src/components/compare/compare.stories.js +1 -1
- package/src/components/compatibility-table/compatibility-table.css.js +70 -37
- package/src/components/compatibility-table/compatibility-table.js +47 -40
- package/src/components/compatibility-table/compatibility-table.stories.js +78 -1
- package/src/components/display/display.css.js +7 -0
- package/src/components/dropdown/dropdown.css.js +20 -3
- package/src/components/dropdown/dropdown.js +57 -21
- package/src/components/dropdown/dropdown.stories.js +31 -9
- package/src/components/features/features.css.js +56 -21
- package/src/components/features/features.js +7 -117
- package/src/components/fieldset/fieldset.stories.js +68 -0
- package/src/components/footer/footer-images.js +34 -0
- package/src/components/footer/footer-links-group.css.js +10 -10
- package/src/components/footer/footer-locale.js +47 -0
- package/src/components/footer/footer-lp.js +27 -114
- package/src/components/footer/footer-lp.stories.js +2 -2
- package/src/components/footer/footer-nav-menu.css.js +2 -2
- package/src/components/footer/footer-nav-menu.js +8 -3
- package/src/components/footer/footer.css.js +228 -197
- package/src/components/footer/footer.js +109 -187
- package/src/components/footer/footer.stories.js +14 -4
- package/src/components/grid/grid.css.js +56 -20
- package/src/components/grid/grid.js +20 -15
- package/src/components/grid/grid.stories.js +39 -11
- package/src/components/header/header-code.css.js +20 -11
- package/src/components/header/header-code.js +1 -1
- package/src/components/header/header.css.js +20 -14
- package/src/components/header/header.js +6 -7
- package/src/components/header/header.stories.js +29 -24
- package/src/components/heading/heading.css.js +11 -0
- package/src/components/hero/hero.js +10 -2
- package/src/components/highlight/highlight.css.js +30 -6
- package/src/components/icons/arrow-icon.js +4 -1
- package/src/components/icons/arrow-right-icon.js +5 -1
- package/src/components/icons/icon-element.js +18 -0
- package/src/components/image/image.js +29 -9
- package/src/components/image/image.stories.js +38 -2
- package/src/components/input/custom-form.stories.js +38 -7
- package/src/components/input/input-clipboard.css.js +15 -1
- package/src/components/input/input-clipboard.js +84 -21
- package/src/components/input/input.js +27 -7
- package/src/components/install-options/install-options.css.js +26 -6
- package/src/components/install-options/install-options.js +32 -8
- package/src/components/label/label.css.js +1 -1
- package/src/components/light-carousel/light-carousel.css.js +100 -48
- package/src/components/light-carousel/light-carousel.js +43 -5
- package/src/components/link/link.css.js +15 -15
- package/src/components/link/link.js +17 -1
- package/src/components/link/link.stories.js +20 -7
- package/src/components/list/list.css.js +3 -3
- package/src/components/logo-marquee/logo-marquee.css.js +12 -1
- package/src/components/logo-marquee/logo-marquee.js +33 -8
- package/src/components/logo-marquee/logo-marquee.stories.js +10 -4
- package/src/components/modal/modal.css.js +74 -40
- package/src/components/modal/modal.js +85 -74
- package/src/components/modal/modal.stories.js +27 -14
- package/src/components/motion-art/motion-art.js +67 -1
- package/src/components/page-switcher/page-switcher.css.js +27 -9
- package/src/components/page-switcher/page-switcher.js +11 -8
- package/src/components/partner-banner/partner-banner.css.js +2 -0
- package/src/components/picture/picture.css.js +4 -4
- package/src/components/picture/picture.js +13 -3
- package/src/components/picture/picture.stories.js +28 -2
- package/src/components/post-card/post-card.css.js +18 -3
- package/src/components/pricing-cards/adopt-styles.js +16 -0
- package/src/components/pricing-cards/new-pricing-card.js +2 -4
- package/src/components/pricing-cards/new-pricing-card.stories.js +20 -22
- package/src/components/pricing-cards/pricing-card-actions.css.js +8 -12
- package/src/components/pricing-cards/pricing-card-actions.js +26 -13
- package/src/components/pricing-cards/pricing-card-container.css.js +4 -3
- package/src/components/pricing-cards/pricing-card-container.js +10 -4
- package/src/components/pricing-cards/pricing-card-header.css.js +5 -4
- package/src/components/pricing-cards/pricing-card-header.js +18 -31
- package/src/components/pricing-cards/pricing-card-pricing.css.js +84 -61
- package/src/components/pricing-cards/pricing-card-pricing.js +38 -24
- package/src/components/pricing-cards/pricing-card-show-more.js +8 -3
- package/src/components/pricing-cards/pricing-card.css.js +75 -41
- package/src/components/pricing-cards/pricing-card.js +356 -308
- package/src/components/progress/progress.css.js +58 -13
- package/src/components/progress/progress.js +13 -10
- package/src/components/progress/progress.stories.js +9 -7
- package/src/components/radio/radio-group.css.js +42 -0
- package/src/components/radio/radio-group.js +89 -0
- package/src/components/radio/radio.css.js +63 -6
- package/src/components/radio/radio.js +173 -140
- package/src/components/radio/radio.stories.js +99 -44
- package/src/components/radio/toggle-radio.js +44 -0
- package/src/components/review/review-grid.css.js +5 -1
- package/src/components/review/review-grid.js +2 -0
- package/src/components/review/review.js +13 -0
- package/src/components/shared/announcer.js +37 -0
- package/src/components/shared/fill-width.css.js +29 -0
- package/src/components/shared/form-control.js +194 -0
- package/src/components/shared/form-field.css.js +31 -3
- package/src/components/shared/token-scales.js +75 -26
- package/src/components/spotlight-section/spotlight-section.js +2 -2
- package/src/components/stat/stat-highlight.js +1 -1
- package/src/components/stat/stat.css.js +18 -3
- package/src/components/switch/switch.css.js +58 -5
- package/src/components/switch/switch.js +53 -5
- package/src/components/switch/switch.stories.js +30 -8
- package/src/components/tab-list/tab-list.css.js +51 -13
- package/src/components/tab-list/tab-list.js +7 -2
- package/src/components/tab-list/tab-list.stories.js +2 -2
- package/src/components/tabs/tabs.css.js +18 -1
- package/src/components/tabs/tabs.js +119 -41
- package/src/components/terminal/terminal-message.css.js +6 -1
- package/src/components/termsOfUse/terms.css.js +4 -2
- package/src/components/textarea/textarea.js +22 -7
- package/src/components/textarea/textarea.stories.js +12 -9
- package/src/components/trust-panel/trust-panel.css.js +13 -3
- package/src/components/ultimate-security-demo.stories.js +5 -5
- package/src/components/video/video.css.js +5 -0
- package/src/components/video/video.js +5 -0
- package/src/components/video/video.stories.js +12 -0
- package/src/components/video-player/video-player.css.js +20 -8
- package/src/components/video-player/video-player.js +74 -20
- package/src/components/video-player/video-player.stories.js +17 -3
- package/src/tokens/brands.stories.js +1 -1
- package/src/tokens/themes/index.js +2 -2
- package/src/tokens/typography.stories.js +4 -3
- package/src/vendor/motion-art/README.md +4 -1
- package/src/components/footer/footer-lp.css.js +0 -159
|
@@ -5,6 +5,7 @@ import "../link/link.js";
|
|
|
5
5
|
import "../paragraph/paragraph.js";
|
|
6
6
|
import installOptionsCSS from "./install-options.css.js";
|
|
7
7
|
import { ensembleCSS } from "../shared/ensemble.css.js";
|
|
8
|
+
import { Announcer } from "../shared/announcer.js";
|
|
8
9
|
|
|
9
10
|
class BdInstallOptions extends LitElement {
|
|
10
11
|
static properties = {
|
|
@@ -31,20 +32,36 @@ class BdInstallOptions extends LitElement {
|
|
|
31
32
|
this.cards = [];
|
|
32
33
|
this.promptPanel = false;
|
|
33
34
|
this.promptLabel = "";
|
|
35
|
+
/* "Copied" is said, not only shown. The button's own text changes too,
|
|
36
|
+
but a screen reader does not reliably read a focused button's new name,
|
|
37
|
+
so the message goes through the live region (shared/announcer.js). */
|
|
38
|
+
this._announcer = new Announcer(this);
|
|
34
39
|
}
|
|
35
40
|
|
|
41
|
+
/* The button says "Copied" for 1.5s and ignores presses meanwhile. It is not
|
|
42
|
+
disabled for it: disabling the focused button threw keyboard focus back to
|
|
43
|
+
the top of the page, mid-card.
|
|
44
|
+
|
|
45
|
+
The flag is data-copied, present or absent: its value is "", which reads
|
|
46
|
+
as false, so asking for its value let a second press through, and that
|
|
47
|
+
press took "Copied" as the text to restore. It is set before the
|
|
48
|
+
clipboard is awaited, so two presses in quick succession cannot both
|
|
49
|
+
start a copy. */
|
|
36
50
|
async _copy(text, btn) {
|
|
51
|
+
if ("copied" in btn.dataset) return;
|
|
52
|
+
btn.dataset.copied = "";
|
|
37
53
|
try {
|
|
38
54
|
await navigator.clipboard.writeText(text);
|
|
39
55
|
const original = btn.textContent;
|
|
40
56
|
btn.textContent = "Copied";
|
|
41
|
-
|
|
57
|
+
this._announcer.say("Copied");
|
|
42
58
|
setTimeout(() => {
|
|
43
59
|
btn.textContent = original;
|
|
44
|
-
btn.
|
|
60
|
+
delete btn.dataset.copied;
|
|
45
61
|
}, 1500);
|
|
46
62
|
} catch {
|
|
47
63
|
// clipboard permission denied or unavailable — button stays as "Copy"
|
|
64
|
+
delete btn.dataset.copied;
|
|
48
65
|
}
|
|
49
66
|
}
|
|
50
67
|
|
|
@@ -80,18 +97,22 @@ class BdInstallOptions extends LitElement {
|
|
|
80
97
|
`;
|
|
81
98
|
}
|
|
82
99
|
|
|
83
|
-
|
|
100
|
+
/* Every card's button says "Copy", so each is described by its card's
|
|
101
|
+
title: a screen reader reading the buttons on their own hears which
|
|
102
|
+
command each one copies. */
|
|
103
|
+
_renderCard(card, index) {
|
|
104
|
+
const titleId = `bd-installoptions-card-title-${index}`;
|
|
84
105
|
return html`
|
|
85
106
|
<div class="bd-installoptions-card">
|
|
86
107
|
<div class="bd-installoptions-card-head">
|
|
87
|
-
<bd-h as="h3" class="bd-installoptions-card-title">${card.title}</bd-h>
|
|
108
|
+
<bd-h as="h3" id=${titleId} class="bd-installoptions-card-title">${card.title}</bd-h>
|
|
88
109
|
${card.badge
|
|
89
110
|
? html`<span class="bd-installoptions-badge">${card.badge}</span>`
|
|
90
111
|
: nothing}
|
|
91
112
|
</div>
|
|
92
113
|
|
|
93
114
|
${card.description
|
|
94
|
-
? html`<bd-p
|
|
115
|
+
? html`<bd-p variant="small" class="bd-installoptions-card-description">${card.description}</bd-p>`
|
|
95
116
|
: nothing}
|
|
96
117
|
|
|
97
118
|
${card.code
|
|
@@ -101,6 +122,7 @@ class BdInstallOptions extends LitElement {
|
|
|
101
122
|
<button
|
|
102
123
|
type="button"
|
|
103
124
|
class="bd-installoptions-copy"
|
|
125
|
+
aria-describedby=${titleId}
|
|
104
126
|
@click=${(e) => this._copy(card.code, e.currentTarget)}
|
|
105
127
|
>Copy</button>
|
|
106
128
|
</div>
|
|
@@ -109,7 +131,7 @@ class BdInstallOptions extends LitElement {
|
|
|
109
131
|
|
|
110
132
|
${card.linkLabel
|
|
111
133
|
? html`
|
|
112
|
-
<bd-link href=${card.linkHref || "#"}
|
|
134
|
+
<bd-link href=${card.linkHref || "#"} variant="primary" class="bd-installoptions-card-link">
|
|
113
135
|
${card.linkLabel} →
|
|
114
136
|
</bd-link>
|
|
115
137
|
`
|
|
@@ -123,7 +145,7 @@ class BdInstallOptions extends LitElement {
|
|
|
123
145
|
|
|
124
146
|
return html`
|
|
125
147
|
<div class="bd-installoptions-promptpanel">
|
|
126
|
-
<bd-h as="h2" class="bd-installoptions-prompt-title">
|
|
148
|
+
<bd-h as="h2" id="bd-installoptions-prompt-title" class="bd-installoptions-prompt-title">
|
|
127
149
|
<slot name="prompt-title"></slot>
|
|
128
150
|
</bd-h>
|
|
129
151
|
|
|
@@ -142,6 +164,7 @@ class BdInstallOptions extends LitElement {
|
|
|
142
164
|
<button
|
|
143
165
|
type="button"
|
|
144
166
|
class="bd-installoptions-copy bd-installoptions-copy--prompt"
|
|
167
|
+
aria-describedby="bd-installoptions-prompt-title"
|
|
145
168
|
@click=${(e) => this._copyPromptSlot(e.currentTarget)}
|
|
146
169
|
>Copy</button>
|
|
147
170
|
</div>
|
|
@@ -187,13 +210,14 @@ class BdInstallOptions extends LitElement {
|
|
|
187
210
|
${this.cards.length
|
|
188
211
|
? html`
|
|
189
212
|
<div class="bd-installoptions-grid">
|
|
190
|
-
${this.cards.map((card) => this._renderCard(card))}
|
|
213
|
+
${this.cards.map((card, index) => this._renderCard(card, index))}
|
|
191
214
|
</div>
|
|
192
215
|
`
|
|
193
216
|
: nothing}
|
|
194
217
|
|
|
195
218
|
${this._renderPromptPanel()}
|
|
196
219
|
</div>
|
|
220
|
+
<span class="bd-installoptions-status" role="status">${this._announcer.status}</span>
|
|
197
221
|
</div>
|
|
198
222
|
`;
|
|
199
223
|
}
|
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
import { css, unsafeCSS } from "lit";
|
|
2
2
|
import { below } from "../shared/token-scales.js";
|
|
3
3
|
|
|
4
|
+
/* A card's own size at three widths, each said once and asked twice: of the
|
|
5
|
+
section, the container every width rule in this sheet reads, and of the
|
|
6
|
+
screen, for a card set on its own with no section around it
|
|
7
|
+
(Foundations/Visual Alignment's card family). The two never disagree: a
|
|
8
|
+
section is never wider than the screen, so wherever the screen says narrow
|
|
9
|
+
the section does too, and in a section on a wide screen the section alone
|
|
10
|
+
decides. */
|
|
11
|
+
|
|
12
|
+
/* No inset change at 1024. This box used to drop to 1.5em here and 1em at
|
|
13
|
+
480, and it was an outlier twice over: it started shrinking 256px of
|
|
14
|
+
viewport before any sibling did, and it kept going to 16px where the rest
|
|
15
|
+
stop at 24. It takes the compact inset with the family at md instead --
|
|
16
|
+
see cardBelowMd.
|
|
17
|
+
|
|
18
|
+
The literals were also ems, so the inset scaled with whatever font-size the
|
|
19
|
+
box inherited while every sibling card's stayed put.
|
|
20
|
+
|
|
21
|
+
The width line is unrelated and stays. With box-sizing: border-box, the 380
|
|
22
|
+
is the card's whole width rather than its content width, so the card
|
|
23
|
+
measures 380 here instead of the 444 it used to render -- 64px narrower,
|
|
24
|
+
two still to a row, each one exactly filling its grid item. The declared
|
|
25
|
+
width was chosen over the rendered one on purpose: a rule that says 380 and
|
|
26
|
+
paints 444 is the kind of thing this file is being cleaned of. */
|
|
27
|
+
const cardUpTo1024 = css`
|
|
28
|
+
.bd-light-box {
|
|
29
|
+
width: 380px;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const cardBelowMd = css`
|
|
34
|
+
.bd-light-box {
|
|
35
|
+
width: 100%;
|
|
36
|
+
max-width: 400px;
|
|
37
|
+
margin: var(--spacing-0) auto;
|
|
38
|
+
/* The compact inset, at the breakpoint the family takes it. Bento, the
|
|
39
|
+
Comparison Panel and the Trust Panel all step down here; this box used
|
|
40
|
+
to step down at 1024 and again at 480, which is why it read as the odd
|
|
41
|
+
one out when it was really just early and twice. */
|
|
42
|
+
padding: var(--card-padding-compact);
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const cardUpTo480 = css`
|
|
47
|
+
.bd-light-box {
|
|
48
|
+
width: 100%;
|
|
49
|
+
min-height: 300px;
|
|
50
|
+
}
|
|
51
|
+
.bd-light-icon {
|
|
52
|
+
bottom: var(--spacing-10);
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
const cardUpTo1024Media = css`@media (max-width: 1024px) { ${cardUpTo1024} }`;
|
|
57
|
+
const cardBelowMdMedia = css`@media ${unsafeCSS(below('md'))} { ${cardBelowMd} }`;
|
|
58
|
+
const cardUpTo480Media = css`@media (max-width: 480px) { ${cardUpTo480} }`;
|
|
59
|
+
|
|
4
60
|
export default css`
|
|
5
61
|
/* One stylesheet for both public variants.
|
|
6
62
|
|
|
@@ -43,6 +99,18 @@ export default css`
|
|
|
43
99
|
padding-top: var(--bd-lc-section-padding-block);
|
|
44
100
|
padding-bottom: var(--bd-lc-section-padding-block);
|
|
45
101
|
}
|
|
102
|
+
|
|
103
|
+
/* The section is the container every width rule below reads -- the
|
|
104
|
+
track's columns and each card's size alike, so the two never disagree
|
|
105
|
+
-- where they used to read the screen. A section across the page is as
|
|
106
|
+
wide as the screen, so there nothing moves; one placed in a narrower
|
|
107
|
+
column steps down with it. width: 100% because a size container
|
|
108
|
+
contributes nothing to its own intrinsic width. */
|
|
109
|
+
:host(bd-light-carousel-section) {
|
|
110
|
+
container-type: inline-size;
|
|
111
|
+
width: 100%;
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
}
|
|
46
114
|
.bd-header-light-carousel {
|
|
47
115
|
margin-bottom: 50px;
|
|
48
116
|
margin-top: 50px;
|
|
@@ -68,12 +136,18 @@ export default css`
|
|
|
68
136
|
.bd-light-carousel-track {
|
|
69
137
|
scroll-behavior: smooth;
|
|
70
138
|
flex: 1;
|
|
139
|
+
/* No wider than the column, so cards that do not fit scroll inside it.
|
|
140
|
+
Centred in the section's flex column, the track takes its cards' width,
|
|
141
|
+
which is right while they fit; but two 380 cards and the gap are 790,
|
|
142
|
+
and the column between 768 and 1024 is 656 to 944, so where they did
|
|
143
|
+
not fit the track never scrolled: it hung past the column on both
|
|
144
|
+
sides and the section's overflow: hidden cut the cards off there. */
|
|
145
|
+
max-width: 100%;
|
|
71
146
|
position: relative;
|
|
72
147
|
padding: var(--spacing-0);
|
|
73
148
|
overflow-x: auto;
|
|
74
149
|
overflow-y: hidden;
|
|
75
150
|
scrollbar-width: none;
|
|
76
|
-
-ms-overflow-style: none;
|
|
77
151
|
z-index: var(--z-base);
|
|
78
152
|
scroll-snap-type: x mandatory;
|
|
79
153
|
}
|
|
@@ -86,6 +160,16 @@ export default css`
|
|
|
86
160
|
display: none;
|
|
87
161
|
}
|
|
88
162
|
|
|
163
|
+
/* The track is a tab stop while it scrolls (light-carousel.js), with the
|
|
164
|
+
one focus ring -- see Foundations/Focus. It fits: the section clips at
|
|
165
|
+
its padding box, and the track sits inside the column's gutter. */
|
|
166
|
+
.bd-light-carousel-track:focus-visible {
|
|
167
|
+
outline: var(--border-width-2) solid transparent;
|
|
168
|
+
outline-offset: var(--focus-outline-offset);
|
|
169
|
+
box-shadow: var(--focus-outline-primary);
|
|
170
|
+
border-radius: var(--focus-outline-radius);
|
|
171
|
+
}
|
|
172
|
+
|
|
89
173
|
.bd-light-box {
|
|
90
174
|
flex: var(--spacing-0) var(--spacing-0) auto;
|
|
91
175
|
background: var(--color-surface-container);
|
|
@@ -143,29 +227,11 @@ export default css`
|
|
|
143
227
|
gap: var(--spacing-4);
|
|
144
228
|
}
|
|
145
229
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
viewport before any sibling did, and it kept going to 16px where the rest
|
|
149
|
-
stop at 24. It takes the compact inset with the family at md instead --
|
|
150
|
-
see the below('md') block further down.
|
|
151
|
-
|
|
152
|
-
The literals were also ems, so the inset scaled with whatever font-size the
|
|
153
|
-
box inherited while every sibling card's stayed put.
|
|
154
|
-
|
|
155
|
-
The width line is unrelated and stays. With box-sizing: border-box above,
|
|
156
|
-
the 380 is the card's whole width rather than its content width, so the
|
|
157
|
-
card measures 380 here instead of the 444 it used to render -- 64px
|
|
158
|
-
narrower, two still to a row, each one exactly filling its grid item. The
|
|
159
|
-
declared width was chosen over the rendered one on purpose: a rule that
|
|
160
|
-
says 380 and paints 444 is the kind of thing this file is being cleaned
|
|
161
|
-
of. */
|
|
162
|
-
@media (max-width: 1024px) {
|
|
163
|
-
.bd-light-box {
|
|
164
|
-
width: 380px;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
230
|
+
${cardUpTo1024Media}
|
|
231
|
+
@container (width <= 1024px) { ${cardUpTo1024} }
|
|
167
232
|
|
|
168
|
-
|
|
233
|
+
${cardBelowMdMedia}
|
|
234
|
+
@container ${unsafeCSS(below('md'))} {
|
|
169
235
|
.bd-light-carousel-track {
|
|
170
236
|
display: flex;
|
|
171
237
|
flex-direction: column;
|
|
@@ -175,39 +241,19 @@ export default css`
|
|
|
175
241
|
scroll-behavior: smooth;
|
|
176
242
|
}
|
|
177
243
|
|
|
178
|
-
|
|
179
|
-
width: 100%;
|
|
180
|
-
max-width: 400px;
|
|
181
|
-
margin: var(--spacing-0) auto;
|
|
182
|
-
/* The compact inset, at the breakpoint the family takes it. Bento, the
|
|
183
|
-
Comparison Panel and the Trust Panel all step down here; this box used
|
|
184
|
-
to step down at 1024 and again at 480, which is why it read as the odd
|
|
185
|
-
one out when it was really just early and twice. */
|
|
186
|
-
padding: var(--card-padding-compact);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.bd-arrow {
|
|
190
|
-
display: none;
|
|
191
|
-
}
|
|
244
|
+
${cardBelowMd}
|
|
192
245
|
}
|
|
193
246
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
width: 100%;
|
|
197
|
-
min-height: 300px;
|
|
198
|
-
}
|
|
199
|
-
.bd-light-icon {
|
|
200
|
-
bottom: var(--spacing-10);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
247
|
+
${cardUpTo480Media}
|
|
248
|
+
@container (width <= 480px) { ${cardUpTo480} }
|
|
203
249
|
|
|
204
|
-
@
|
|
250
|
+
@container (width <= 1024px) {
|
|
205
251
|
.bd-light-carousel-track {
|
|
206
252
|
grid-template-columns: repeat(2, 1fr);
|
|
207
253
|
}
|
|
208
254
|
}
|
|
209
255
|
|
|
210
|
-
@
|
|
256
|
+
@container (width <= 600px) {
|
|
211
257
|
.bd-light-carousel-track {
|
|
212
258
|
grid-template-columns: 1fr;
|
|
213
259
|
}
|
|
@@ -220,5 +266,11 @@ export default css`
|
|
|
220
266
|
.bd-light-box {
|
|
221
267
|
transition: none;
|
|
222
268
|
}
|
|
269
|
+
|
|
270
|
+
/* The track scrolls smoothly when its arrows or a script move it; a reader
|
|
271
|
+
who asked for less motion gets the jump. */
|
|
272
|
+
.bd-light-carousel-track {
|
|
273
|
+
scroll-behavior: auto;
|
|
274
|
+
}
|
|
223
275
|
}
|
|
224
276
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, html } from "lit";
|
|
1
|
+
import { LitElement, html, nothing } from "lit";
|
|
2
2
|
// Installs the design tokens into document scope; see src/tokens/tokens.js
|
|
3
3
|
import "../../tokens/tokens.js";
|
|
4
4
|
import "../badge/badge.js";
|
|
@@ -21,7 +21,8 @@ class CustomLightCarousel extends LitElement {
|
|
|
21
21
|
* and docs table have always used, Standard and Simple, rather than new
|
|
22
22
|
* ones invented at consolidation time.
|
|
23
23
|
*/
|
|
24
|
-
variant : { type: String, reflect: true }
|
|
24
|
+
variant : { type: String, reflect: true },
|
|
25
|
+
_scrollable : { state: true }
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
constructor() {
|
|
@@ -29,6 +30,7 @@ class CustomLightCarousel extends LitElement {
|
|
|
29
30
|
this.title = "";
|
|
30
31
|
this.headingLevel = 2;
|
|
31
32
|
this.variant = "standard";
|
|
33
|
+
this._scrollable = false;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
|
|
@@ -54,7 +56,38 @@ class CustomLightCarousel extends LitElement {
|
|
|
54
56
|
>`;
|
|
55
57
|
}
|
|
56
58
|
|
|
59
|
+
/* The track scrolls sideways when its cards do not fit (between md and
|
|
60
|
+
1024 two cards of 380 rarely do), and a scroller the keyboard cannot
|
|
61
|
+
reach cannot be scrolled from the keyboard: it is a tab stop then, named
|
|
62
|
+
after the section's title, as a region. Only then -- a track whose cards
|
|
63
|
+
fit has nothing to scroll, and a tab stop that does nothing is noise. */
|
|
64
|
+
firstUpdated() {
|
|
65
|
+
this._track = this.renderRoot.querySelector(".bd-light-carousel-track");
|
|
66
|
+
this._overflow = new ResizeObserver(() => this._syncScrollable());
|
|
67
|
+
this._overflow.observe(this._track);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Put back on the page, the track is watched again: disconnecting stops
|
|
71
|
+
the observer, and firstUpdated does not run twice, so a moved carousel
|
|
72
|
+
kept the answer it had and never gained or lost its tab stop again. An
|
|
73
|
+
observer's first delivery comes on observe(), so the answer is current. */
|
|
74
|
+
connectedCallback() {
|
|
75
|
+
super.connectedCallback();
|
|
76
|
+
if (this._track) this._overflow.observe(this._track);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
disconnectedCallback() {
|
|
80
|
+
super.disconnectedCallback();
|
|
81
|
+
this._overflow?.disconnect();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
_syncScrollable() {
|
|
85
|
+
const track = this._track;
|
|
86
|
+
this._scrollable = !!track && track.scrollWidth > track.clientWidth + 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
57
89
|
render() {
|
|
90
|
+
const scrollable = this._scrollable;
|
|
58
91
|
return html`
|
|
59
92
|
<section class="bd-ensemble bd-light-carousel">
|
|
60
93
|
${this.title
|
|
@@ -64,8 +97,13 @@ class CustomLightCarousel extends LitElement {
|
|
|
64
97
|
</div>
|
|
65
98
|
`
|
|
66
99
|
: null}
|
|
67
|
-
<div
|
|
68
|
-
|
|
100
|
+
<div
|
|
101
|
+
class="bd-light-carousel-track"
|
|
102
|
+
tabindex=${scrollable ? "0" : nothing}
|
|
103
|
+
role=${scrollable ? "region" : nothing}
|
|
104
|
+
aria-label=${scrollable ? this.title || "Cards" : nothing}
|
|
105
|
+
>
|
|
106
|
+
<slot @slotchange=${() => this._syncScrollable()}></slot>
|
|
69
107
|
</div>
|
|
70
108
|
</section>
|
|
71
109
|
`;
|
|
@@ -123,7 +161,7 @@ class LightCarouselItem extends LitElement {
|
|
|
123
161
|
<div class="bd-light-box">
|
|
124
162
|
<div class="bd-light-box-header">
|
|
125
163
|
${this.icon
|
|
126
|
-
? html`<img src="${this.icon}" alt="
|
|
164
|
+
? html`<img src="${this.icon}" alt="" class="bd-light-icon" />`
|
|
127
165
|
: ""}
|
|
128
166
|
|
|
129
167
|
${this.title || this.badge
|
|
@@ -191,7 +191,10 @@ export default css`
|
|
|
191
191
|
vertical-align: middle;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
/* The current link, read off the aria-current the <a> carries rather than
|
|
195
|
+
a class beside it, so what is drawn and what is announced are one
|
|
196
|
+
attribute and cannot disagree. */
|
|
197
|
+
.bd-link[aria-current] {
|
|
195
198
|
/* no role: a link in its active state -- a state or modifier weight, not a text-content
|
|
196
199
|
type. See button.css.js's .button--bold for the argument. */
|
|
197
200
|
font-weight: var(--typography-fontWeight-bold);
|
|
@@ -200,17 +203,16 @@ export default css`
|
|
|
200
203
|
|
|
201
204
|
/* The current item does not move under the pointer.
|
|
202
205
|
|
|
203
|
-
|
|
204
|
-
.bd-link--primary:hover
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
The current state and --primary are both present on a current nav item,
|
|
207
|
+
and .bd-link--primary:hover outweighed the class this used to be -- so
|
|
208
|
+
without this rule hovering the page you are already on turned it back to
|
|
209
|
+
the brand ink, which is the one thing that colour is not supposed to mean
|
|
210
|
+
here. Measured on bd-page-switcher before the wayfinding family review:
|
|
211
|
+
current + hover reported action/primary-active, the only one of the
|
|
212
|
+
three that recoloured an item the reader had already arrived at.
|
|
210
213
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
.bd-link--active:hover {
|
|
214
|
+
It outranks every kind hover, so it wins whatever the order. */
|
|
215
|
+
.bd-link[aria-current]:hover {
|
|
214
216
|
color: var(--color-text-primary);
|
|
215
217
|
}
|
|
216
218
|
|
|
@@ -223,10 +225,8 @@ export default css`
|
|
|
223
225
|
pointer-events: none;
|
|
224
226
|
}
|
|
225
227
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
|
|
228
|
+
/* No :focus { outline: none } beside this: the browser's own ring is a
|
|
229
|
+
:focus-visible ring too, so a pointer focus never drew one. */
|
|
230
230
|
.bd-link:focus-visible {
|
|
231
231
|
/* the one focus ring — see Foundations/Focus. A two-colour ring whose
|
|
232
232
|
white inner band keeps it visible on a coloured or dark surface, which a
|
|
@@ -45,6 +45,16 @@ class BdLink extends LitElement {
|
|
|
45
45
|
without repositioning all of them. */
|
|
46
46
|
inline : { type: Boolean, reflect: true },
|
|
47
47
|
color : { type: String },
|
|
48
|
+
/* The link is the current one in its set: page, step, location, date,
|
|
49
|
+
time, or true -- the aria-current token, which lands on the <a>.
|
|
50
|
+
aria-current written on this element never reached the <a> in its
|
|
51
|
+
shadow root, which is where a screen reader looks: bd-anchor-nav and
|
|
52
|
+
bd-page-switcher both wrote it there and announced nothing. It
|
|
53
|
+
reflects, so the element that holds the link can style its own box --
|
|
54
|
+
an indicator, say -- from the same state. */
|
|
55
|
+
current : { type: String, reflect: true, converter: { toAttribute: value => value || null } },
|
|
56
|
+
/** @deprecated pass `current`. It drew the current state without
|
|
57
|
+
announcing it; it now means current="true". */
|
|
48
58
|
active : { type: Boolean, reflect: true },
|
|
49
59
|
/* The surface the link sits on, the same attribute bd-button uses. It
|
|
50
60
|
replaces kind="light", which described the surface rather than the link
|
|
@@ -81,6 +91,7 @@ class BdLink extends LitElement {
|
|
|
81
91
|
this.fontSize = "";
|
|
82
92
|
this.inline = false;
|
|
83
93
|
this.color = "";
|
|
94
|
+
this.current = "";
|
|
84
95
|
this.active = false;
|
|
85
96
|
this.surface = "light";
|
|
86
97
|
this.arrow = false;
|
|
@@ -105,7 +116,6 @@ class BdLink extends LitElement {
|
|
|
105
116
|
`bd-link--${this.variant}`,
|
|
106
117
|
this.underline ? "bd-link--underline" : "",
|
|
107
118
|
this.noUnderline ? "bd-link--no-underline" : "",
|
|
108
|
-
this.active ? "bd-link--active" : "",
|
|
109
119
|
this.disabled ? "bd-link--disabled" : "",
|
|
110
120
|
this.arrow ? "bd-link--arrow" : ""
|
|
111
121
|
].filter(Boolean).join(" ");
|
|
@@ -157,6 +167,11 @@ class BdLink extends LitElement {
|
|
|
157
167
|
.join("; ");
|
|
158
168
|
}
|
|
159
169
|
|
|
170
|
+
/** The aria-current token, which is also what the current look keys on. */
|
|
171
|
+
get _current() {
|
|
172
|
+
return this.current || (this.active ? "true" : "");
|
|
173
|
+
}
|
|
174
|
+
|
|
160
175
|
/* No whitespace anywhere in these templates: not between the tags and the
|
|
161
176
|
slot, and not around the element either. The default flex row never
|
|
162
177
|
rendered it, but inline drops the row, and there each newline became a
|
|
@@ -173,6 +188,7 @@ class BdLink extends LitElement {
|
|
|
173
188
|
style="${this._inlineStyle}"
|
|
174
189
|
href="${this.href || nothing}"
|
|
175
190
|
target="${this.href ? this.target : nothing}"
|
|
191
|
+
aria-current="${this._current || nothing}"
|
|
176
192
|
aria-describedby="${this.description ? "description" : nothing}"
|
|
177
193
|
@click="${this._handleClick}"
|
|
178
194
|
><slot></slot>${this._arrow}</a>${this.description
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
1
|
+
import { html, nothing } from 'lit';
|
|
2
2
|
import './link.js';
|
|
3
3
|
import '../icons/arrow-right-icon.js';
|
|
4
4
|
import '../visually-hidden/visually-hidden.js';
|
|
@@ -76,10 +76,15 @@ follows the link's ink in all of them.
|
|
|
76
76
|
sets that: the link is a flex row, and a decoration is only drawn where there
|
|
77
77
|
is text.
|
|
78
78
|
|
|
79
|
-
###
|
|
80
|
-
Marks the link as the current destination, for a nav or breadcrumb
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
### current
|
|
80
|
+
Marks the link as the current destination, for a nav or breadcrumb, with the
|
|
81
|
+
\`aria-current\` token: \`page\`, \`step\`, \`location\`, \`date\`, \`time\` or
|
|
82
|
+
\`true\`. It lands on the inner \`<a>\` as \`aria-current\`, so it is announced,
|
|
83
|
+
and the current look is drawn from that same attribute. \`aria-current\` written
|
|
84
|
+
on the \`bd-link\` element itself is not announced: the \`<a>\` is in the shadow
|
|
85
|
+
root. \`current\` reflects, so a container can style the item's box from it.
|
|
86
|
+
|
|
87
|
+
\`active\` is deprecated; it now means \`current="true"\`.
|
|
83
88
|
|
|
84
89
|
### Events
|
|
85
90
|
- \`custom-click\` — NOT dispatched by BdLink (click handled natively by the \`<a>\` tag)
|
|
@@ -120,9 +125,15 @@ to be announced.
|
|
|
120
125
|
description: 'Adds `bd-link--no-underline`. Overlaps with `underline` — see the note on the two of them.',
|
|
121
126
|
table : { type: { summary: 'boolean' }, defaultValue: { summary: 'false' }, category: 'Appearance' }
|
|
122
127
|
},
|
|
128
|
+
current: {
|
|
129
|
+
control : 'select',
|
|
130
|
+
options : ['', 'page', 'step', 'location', 'date', 'time', 'true'],
|
|
131
|
+
description: 'Marks the link as the current one, e.g. in a nav: the `aria-current` token, set on the inner `<a>`. The current look is drawn from it.',
|
|
132
|
+
table : { type: { summary: "'' | 'page' | 'step' | 'location' | 'date' | 'time' | 'true'" }, defaultValue: { summary: "''" }, category: 'State' }
|
|
133
|
+
},
|
|
123
134
|
active: {
|
|
124
135
|
control : 'boolean',
|
|
125
|
-
description: '
|
|
136
|
+
description: 'Deprecated: pass `current`. Means `current="true"`.',
|
|
126
137
|
table : { type: { summary: 'boolean' }, defaultValue: { summary: 'false' }, category: 'State' }
|
|
127
138
|
},
|
|
128
139
|
arrow: {
|
|
@@ -161,6 +172,7 @@ const defaultArgs = {
|
|
|
161
172
|
kind : 'primary',
|
|
162
173
|
underline : false,
|
|
163
174
|
noUnderline: false,
|
|
175
|
+
current : '',
|
|
164
176
|
active : false,
|
|
165
177
|
disabled : false,
|
|
166
178
|
inline : false,
|
|
@@ -178,6 +190,7 @@ const render = (args) => html`
|
|
|
178
190
|
color="${args.color}"
|
|
179
191
|
?underline="${args.underline}"
|
|
180
192
|
?no-underline="${args.noUnderline}"
|
|
193
|
+
current="${args.current || nothing}"
|
|
181
194
|
?active="${args.active}"
|
|
182
195
|
?inline="${args.inline}"
|
|
183
196
|
?disabled="${args.disabled}"
|
|
@@ -384,6 +397,6 @@ export const Playground = {
|
|
|
384
397
|
render,
|
|
385
398
|
parameters: {
|
|
386
399
|
controls: { disable: false },
|
|
387
|
-
docs : { description: { story: 'Interactive playground, and the only story wired to args. Every control here reaches the element: href, target, kind, underline, no-underline, active, disabled, inline, arrow, font-size and color.' } }
|
|
400
|
+
docs : { description: { story: 'Interactive playground, and the only story wired to args. Every control here reaches the element: href, target, kind, underline, no-underline, current, active, disabled, inline, arrow, font-size and color.' } }
|
|
388
401
|
}
|
|
389
402
|
};
|
|
@@ -37,7 +37,7 @@ export default css`
|
|
|
37
37
|
argument. */
|
|
38
38
|
font-weight: var(--typography-fontWeight-semibold);
|
|
39
39
|
color: var(--color-text-muted);
|
|
40
|
-
margin-
|
|
40
|
+
margin-inline-end: var(--spacing-8);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/* Unordered list markers for vertical */
|
|
@@ -48,7 +48,7 @@ export default css`
|
|
|
48
48
|
argument. */
|
|
49
49
|
font-weight: var(--typography-fontWeight-semibold);
|
|
50
50
|
color: var(--color-text-muted);
|
|
51
|
-
margin-
|
|
51
|
+
margin-inline-end: var(--spacing-8);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/* Horizontal */
|
|
@@ -136,7 +136,7 @@ export default css`
|
|
|
136
136
|
/* === NESTED LISTS === */
|
|
137
137
|
|
|
138
138
|
.bd-list .bd-list {
|
|
139
|
-
margin-
|
|
139
|
+
margin-inline-start: var(--spacing-16);
|
|
140
140
|
margin-top: var(--spacing-8);
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -37,7 +37,8 @@ export const logoMarqueeCSS = css`
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
/* Held while the pointer or focus is on the row, and stopped by the paused
|
|
40
|
+
/* Held while the pointer or focus is on the row, and stopped by the paused
|
|
41
|
+
attribute, which the button sets. */
|
|
41
42
|
.viewport:hover .track,
|
|
42
43
|
.viewport:focus-within .track,
|
|
43
44
|
:host([paused]) .track {
|
|
@@ -57,6 +58,11 @@ export const logoMarqueeCSS = css`
|
|
|
57
58
|
flex: none;
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
/* the pause button, at the row's inline end, outside the fade */
|
|
62
|
+
.toggle {
|
|
63
|
+
flex: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
60
66
|
/* Still, and nothing hidden: the set wraps in place, and the copies and
|
|
61
67
|
the fade go. */
|
|
62
68
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -79,5 +85,10 @@ export const logoMarqueeCSS = css`
|
|
|
79
85
|
.copy {
|
|
80
86
|
display: none;
|
|
81
87
|
}
|
|
88
|
+
|
|
89
|
+
/* nothing moves, so there is nothing to pause */
|
|
90
|
+
.toggle {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
82
93
|
}
|
|
83
94
|
`;
|