@repobit/dex-system-design 2.5.0 → 2.6.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 +226 -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 +3 -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 +238 -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 +64 -5
- 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 +33 -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
|
@@ -15,48 +15,50 @@ export const accordionItem = css`
|
|
|
15
15
|
lands on it and a screen reader announces it. The ITEM owns the focus
|
|
16
16
|
VISUAL: a disclosure is perceived as one object -- the question and, when
|
|
17
17
|
open, its answer -- and the ring goes round that object, growing with the
|
|
18
|
-
answer when it is revealed. Measured before
|
|
19
|
-
Accordion "Item open by default": host [99,131,1242,61],
|
|
20
|
-
[99,131,1242,24], content [99,171,1242,21] -- the ring stopped at
|
|
21
|
-
question and the answer sat outside it.
|
|
18
|
+
answer when it is revealed. Measured before the item drew it, on
|
|
19
|
+
Components/Accordion "Item open by default": host [99,131,1242,61],
|
|
20
|
+
trigger [99,131,1242,24], content [99,171,1242,21] -- the ring stopped at
|
|
21
|
+
the question and the answer sat outside it.
|
|
22
22
|
|
|
23
23
|
Exactly one painter. The trigger's :focus-visible rule below sets outline
|
|
24
24
|
none and nothing else; the ring lives here. P6C.2.1 found both painting the
|
|
25
|
-
same --focus-outline-primary and removed the host's; P6C.2.2
|
|
26
|
-
ring
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
attribute stays off; after Tab it is on.
|
|
47
|
-
|
|
48
|
-
The stacking is the other reason the attribute exists, and it is measured:
|
|
49
|
-
--bd-acc-item-margin-bottom is a public custom property, and with it zeroed
|
|
50
|
-
on AccordionBg "FAQ - Default" a 300x5 sample where the ring overlaps the
|
|
51
|
-
next item holds 600 blue-500 pixels with position/z-index and 0 without --
|
|
52
|
-
the next item's tint paints over the ring. On the untinted
|
|
53
|
-
bd-accordion-item it reads 600 either way.
|
|
25
|
+
same --focus-outline-primary and removed the host's; P6C.2.2 moved the one
|
|
26
|
+
ring up to the item and took the trigger's away, so the invariant that
|
|
27
|
+
phase established -- one token, one painter -- still holds.
|
|
28
|
+
|
|
29
|
+
The item is .disclosure, the element in this shadow root that holds the
|
|
30
|
+
trigger and the panel and fills the host's box, so :has() can see the
|
|
31
|
+
trigger match :focus-visible. The host cannot: :host(:has(...)) looks at
|
|
32
|
+
light-DOM children, never at the shadow tree. It used to be the host all
|
|
33
|
+
the same, through data-bd-acc-focus, an attribute script set two frames
|
|
34
|
+
after focusin and again on every keydown when the trigger matched
|
|
35
|
+
:focus-visible; the selector answers both of those as they happen. A
|
|
36
|
+
mouse click is still not :focus-visible, so it still draws no ring.
|
|
37
|
+
|
|
38
|
+
The radius is the host's, inherited, for the reason the bg item's note
|
|
39
|
+
gives: the ring follows the item's own corner.
|
|
40
|
+
|
|
41
|
+
The stacking is measured: --bd-acc-item-margin-bottom is a public custom
|
|
42
|
+
property, and with it zeroed on AccordionBg "FAQ - Default" a 300x5
|
|
43
|
+
sample where the ring overlaps the next item holds 600 blue-500 pixels
|
|
44
|
+
with position/z-index and 0 without -- the next item's tint paints over
|
|
45
|
+
the ring. On the untinted bd-accordion-item it reads 600 either way.
|
|
54
46
|
|
|
55
47
|
bd-accordion-bg-item adopts this stylesheet too, so this is the one rule
|
|
56
48
|
that rings and stacks the whole accordion family. */
|
|
57
|
-
|
|
49
|
+
.disclosure {
|
|
50
|
+
border-radius: inherit;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.disclosure:has(> :is(.header, .bd-accordion-bg-question):focus-visible) {
|
|
58
54
|
position: relative;
|
|
59
55
|
z-index: var(--z-base);
|
|
56
|
+
/* The host's ground, repainted by the element that draws the ring, so
|
|
57
|
+
one element anti-aliases the ring's inner corner against the tint.
|
|
58
|
+
Split between the two, the corner showed a faint tinted seam inside
|
|
59
|
+
the ring's white band (60 pixels at 8x, measured). Unset hosts are
|
|
60
|
+
transparent, so this paints nothing on them. */
|
|
61
|
+
background-color: inherit;
|
|
60
62
|
box-shadow: var(--focus-outline-primary);
|
|
61
63
|
/* forced-colors mode does not paint box-shadow, so the ring
|
|
62
64
|
vanishes there; it does paint an outline, in a system colour. This one
|
|
@@ -70,47 +72,13 @@ export const accordionItem = css`
|
|
|
70
72
|
margin-bottom: 0;
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
--bd-acc-title-color-expanded: var(--color-text-primary);
|
|
81
|
-
--bd-acc-title-color-collapsed: var(--color-text-primary);
|
|
82
|
-
--bd-acc-panel-font-size: var(--typography-body-small-fontSize);
|
|
83
|
-
--bd-acc-panel-font-weight: var(--typography-body-small-fontWeight);
|
|
84
|
-
--bd-acc-panel-line-height: var(--typography-body-small-lineHeight);
|
|
85
|
-
/* Panel body copy. */
|
|
86
|
-
--bd-acc-panel-color: var(--color-text-primary);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
:host-context(bd-accordion-section[variant="default-blue"]) {
|
|
90
|
-
/* -text-brand IS blue-600; naming the role also inherits the reason it is
|
|
91
|
-
blue-600 and not blue-500, which tokens.js records. */
|
|
92
|
-
--bd-acc-title-color-expanded: var(--color-text-brand);
|
|
93
|
-
--bd-acc-title-color-collapsed: var(--color-text-brand);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
:host-context(bd-accordion-section[variant="small"]) {
|
|
97
|
-
--bd-acc-header-padding: var(--spacing-12) var(--spacing-8);
|
|
98
|
-
--bd-acc-header-margin-bottom: var(--spacing-0);
|
|
99
|
-
--bd-acc-icon-gap: var(--spacing-12);
|
|
100
|
-
--bd-acc-toggle-size: var(--icon-sm-size);
|
|
101
|
-
--bd-acc-title-font-size: var(--typography-label-default-fontSize);
|
|
102
|
-
--bd-acc-title-font-weight: var(--typography-label-default-fontWeight);
|
|
103
|
-
--bd-acc-title-line-height: var(--typography-label-default-lineHeight);
|
|
104
|
-
--bd-acc-panel-font-size: var(--typography-caption-default-fontSize);
|
|
105
|
-
--bd-acc-panel-font-weight: var(--typography-caption-default-fontWeight);
|
|
106
|
-
--bd-acc-panel-line-height: var(--typography-caption-default-lineHeight);
|
|
107
|
-
/* Panel body copy, small variant. */
|
|
108
|
-
--bd-acc-panel-color: var(--color-text-primary);
|
|
109
|
-
--bd-acc-panel-padding: var(--spacing-0) var(--spacing-8) var(--spacing-8)
|
|
110
|
-
var(--spacing-36);
|
|
111
|
-
--bd-acc-panel-paragraph-gap: var(--spacing-0);
|
|
112
|
-
--bd-acc-item-margin-bottom: var(--spacing-0);
|
|
113
|
-
}
|
|
75
|
+
/* The section variants reach the items as custom properties, set on
|
|
76
|
+
bd-accordion-section's own host (accordionSection below) and inherited
|
|
77
|
+
through the slot. They were :host-context() rules here, which only
|
|
78
|
+
Chromium implements: in Safari and Firefox the small variant's padding,
|
|
79
|
+
type and colours, and the item spacing, never applied. The default
|
|
80
|
+
section's block went with them -- every value in it was already the
|
|
81
|
+
fallback each rule below carries, and its title colours were never read. */
|
|
114
82
|
|
|
115
83
|
::slotted(bd-list) {
|
|
116
84
|
--bd-li-margin-bottom: var(--spacing-16);
|
|
@@ -134,7 +102,7 @@ export const accordionItem = css`
|
|
|
134
102
|
padding: var(--bd-acc-header-padding, var(--spacing-0));
|
|
135
103
|
border: none;
|
|
136
104
|
background: none;
|
|
137
|
-
text-align:
|
|
105
|
+
text-align: start;
|
|
138
106
|
cursor: pointer;
|
|
139
107
|
gap: var(--bd-acc-icon-gap, var(--spacing-12));
|
|
140
108
|
font-family: var(--typography-fontFamily-sans);
|
|
@@ -145,41 +113,31 @@ export const accordionItem = css`
|
|
|
145
113
|
margin-bottom: var(--bd-acc-header-margin-bottom, var(--spacing-16));
|
|
146
114
|
}
|
|
147
115
|
|
|
148
|
-
:host-context(bd-features) .header {
|
|
149
|
-
margin-bottom: var(--spacing-8);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
116
|
/* No ring on the trigger. outline: none is not a removal: the visible focus
|
|
153
|
-
indicator is the item's ring, drawn by
|
|
154
|
-
|
|
155
|
-
|
|
117
|
+
indicator is the item's ring, drawn by .disclosure above on exactly the
|
|
118
|
+
frames this pseudo-class matches. Painting it here as well is the double
|
|
119
|
+
ring P6C.2.1 measured and removed. */
|
|
156
120
|
.header:focus-visible {
|
|
157
121
|
outline: none;
|
|
158
122
|
}
|
|
159
123
|
|
|
160
124
|
.header[aria-expanded="true"] .title {
|
|
161
125
|
/* blue-500 is 4.2:1 on the blue-50 tint these titles sit on; blue-600 is 5.72 */
|
|
162
|
-
color: var(--color-text-brand);
|
|
126
|
+
color: var(--bd-acc-title-color-expanded, var(--color-text-brand));
|
|
163
127
|
}
|
|
164
128
|
|
|
165
129
|
.header[aria-expanded="false"] .title {
|
|
166
|
-
color: var(--color-text-brand);
|
|
130
|
+
color: var(--bd-acc-title-color-collapsed, var(--color-text-brand));
|
|
167
131
|
}
|
|
168
132
|
|
|
169
|
-
|
|
170
|
-
|
|
133
|
+
/* Only a section that sets a hover colour changes on hover; the fallback is
|
|
134
|
+
each state's own colour. */
|
|
135
|
+
.header[aria-expanded="true"]:hover .title {
|
|
136
|
+
color: var(--bd-acc-title-color-hover, var(--bd-acc-title-color-expanded, var(--color-text-brand)));
|
|
171
137
|
}
|
|
172
138
|
|
|
173
|
-
|
|
174
|
-
color: var(--color-text-brand);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
:host-context(bd-accordion-section[variant="small"]) .header[aria-expanded="true"] .title {
|
|
178
|
-
color: var(--color-brand-800);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
:host-context(bd-accordion-section[variant="small"]) .header[aria-expanded="true"]:hover .title {
|
|
182
|
-
color: var(--color-text-brand);
|
|
139
|
+
.header[aria-expanded="false"]:hover .title {
|
|
140
|
+
color: var(--bd-acc-title-color-hover, var(--bd-acc-title-color-collapsed, var(--color-text-brand)));
|
|
183
141
|
}
|
|
184
142
|
|
|
185
143
|
.toggle {
|
|
@@ -193,6 +151,8 @@ export const accordionItem = css`
|
|
|
193
151
|
/* the box holds an icon, not text; none collapses the leading to the
|
|
194
152
|
glyph rather than reserving a text line around it */
|
|
195
153
|
line-height: var(--typography-lineHeight-none);
|
|
154
|
+
/* Safari reads only the prefixed property */
|
|
155
|
+
-webkit-user-select: none;
|
|
196
156
|
user-select: none;
|
|
197
157
|
margin-top: calc(
|
|
198
158
|
(var(--bd-acc-title-line-height, var(--typography-label-large-lineHeight)) * 1em -
|
|
@@ -232,23 +192,39 @@ export const accordionItem = css`
|
|
|
232
192
|
flex-wrap: wrap;
|
|
233
193
|
}
|
|
234
194
|
|
|
195
|
+
/* The panel is indented past the toggle, so the indent is on the inline
|
|
196
|
+
start: on a right-to-left page the toggle and the indent are both on the
|
|
197
|
+
right. The section variant passes its padding as a block pair and an
|
|
198
|
+
inline pair (start end) for the same reason; it was one four-value
|
|
199
|
+
shorthand, which put the indent on the left whatever the direction. */
|
|
235
200
|
.content {
|
|
236
|
-
padding: var(--bd-acc-panel-padding, 0
|
|
201
|
+
padding-block: var(--bd-acc-panel-padding-block, 0);
|
|
202
|
+
padding-inline: var(--bd-acc-panel-padding-inline, calc(var(--icon-sm-size) + var(--spacing-12)) 0);
|
|
237
203
|
font-family: var(--typography-fontFamily-sans);
|
|
238
204
|
font-size: var(--bd-acc-panel-font-size, var(--typography-body-small-fontSize));
|
|
239
205
|
font-weight: var(--bd-acc-panel-font-weight, var(--typography-body-small-fontWeight));
|
|
240
206
|
line-height: var(--bd-acc-panel-line-height, var(--typography-body-small-lineHeight));
|
|
241
|
-
/*
|
|
242
|
-
|
|
243
|
-
outside any section -- one rendering that disagreed with every real
|
|
244
|
-
usage, and with the Figma item, which draws this at text/primary. */
|
|
207
|
+
/* -primary, which is what every section renders this at, and what the
|
|
208
|
+
Figma item draws: text/primary. */
|
|
245
209
|
color: var(--bd-acc-panel-color, var(--color-text-primary));
|
|
246
210
|
}
|
|
247
211
|
|
|
248
|
-
|
|
212
|
+
/* Plain hidden only: a panel that is hidden="until-found" must keep its
|
|
213
|
+
box, or find in page cannot reach it (accordion-panel.js). The browser
|
|
214
|
+
skips its contents, so it paints nothing, but a box in flow still counts:
|
|
215
|
+
its block padding would show (the small variant's is 8 at the bottom), and
|
|
216
|
+
even at zero height it stops the trigger's bottom margin collapsing
|
|
217
|
+
through the item -- measured, every closed item grew from 24 to 40. Out of
|
|
218
|
+
flow and unpadded, a closed panel lays out as display: none did. */
|
|
219
|
+
.content[hidden]:not([hidden="until-found" i]) {
|
|
249
220
|
display: none !important;
|
|
250
221
|
}
|
|
251
222
|
|
|
223
|
+
.content[hidden] {
|
|
224
|
+
position: absolute;
|
|
225
|
+
padding-block: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
252
228
|
::slotted(p) {
|
|
253
229
|
margin-top: 0;
|
|
254
230
|
margin-bottom: var(--bd-acc-panel-paragraph-gap, var(--spacing-16));
|
|
@@ -305,20 +281,18 @@ export const accordionItem = css`
|
|
|
305
281
|
`;
|
|
306
282
|
|
|
307
283
|
export const accordionSection = css`
|
|
284
|
+
/* The band is as wide as the section, and the section, like every page
|
|
285
|
+
section, is as wide as the page; the column inside is .bd-ensemble's. It
|
|
286
|
+
used to escape to the window's edges with width: 100vw and calc(50% -
|
|
287
|
+
50vw) margins, and 100vw counts a classic scrollbar: measured with a 15px
|
|
288
|
+
one, the band ran from -7px to 1273px over a 1265px page, so every page
|
|
289
|
+
with an accordion section scrolled sideways. */
|
|
308
290
|
.bd-accordion-section-container {
|
|
309
291
|
background-color: var(--bd-acc-section-bg, var(--color-surface-container));
|
|
310
292
|
border-radius: var(--radius-none);
|
|
311
293
|
box-sizing: border-box;
|
|
312
|
-
|
|
313
|
-
/* Bleed — bg full width */
|
|
314
|
-
width: 100vw;
|
|
315
|
-
margin-left: calc(50% - 50vw);
|
|
316
|
-
margin-right: calc(50% - 50vw);
|
|
317
|
-
|
|
318
294
|
padding-top: var(--bd-acc-section-padding-v, var(--spacing-32));
|
|
319
295
|
padding-bottom: var(--bd-acc-section-padding-v, var(--spacing-32));
|
|
320
|
-
padding-left: calc(50vw - 50%);
|
|
321
|
-
padding-right: calc(50vw - 50%);
|
|
322
296
|
}
|
|
323
297
|
|
|
324
298
|
.bd-accordion-section-inner {
|
|
@@ -330,6 +304,26 @@ export const accordionSection = css`
|
|
|
330
304
|
job; the default variant two rules up already asks for a surface role. */
|
|
331
305
|
--bd-acc-section-bg: var(--color-surface-default);
|
|
332
306
|
--bd-acc-section-padding-v: var(--spacing-24);
|
|
307
|
+
/* Read by the items (accordionItem above), which inherit them through the slot. */
|
|
308
|
+
--bd-acc-header-padding: var(--spacing-12) var(--spacing-8);
|
|
309
|
+
--bd-acc-header-margin-bottom: var(--spacing-0);
|
|
310
|
+
--bd-acc-icon-gap: var(--spacing-12);
|
|
311
|
+
--bd-acc-toggle-size: var(--icon-sm-size);
|
|
312
|
+
--bd-acc-title-font-size: var(--typography-label-default-fontSize);
|
|
313
|
+
--bd-acc-title-font-weight: var(--typography-label-default-fontWeight);
|
|
314
|
+
--bd-acc-title-line-height: var(--typography-label-default-lineHeight);
|
|
315
|
+
--bd-acc-title-color-collapsed: var(--color-text-primary);
|
|
316
|
+
--bd-acc-title-color-expanded: var(--color-brand-800);
|
|
317
|
+
--bd-acc-title-color-hover: var(--color-text-brand);
|
|
318
|
+
--bd-acc-panel-font-size: var(--typography-caption-default-fontSize);
|
|
319
|
+
--bd-acc-panel-font-weight: var(--typography-caption-default-fontWeight);
|
|
320
|
+
--bd-acc-panel-line-height: var(--typography-caption-default-lineHeight);
|
|
321
|
+
/* Panel body copy, small variant. */
|
|
322
|
+
--bd-acc-panel-color: var(--color-text-primary);
|
|
323
|
+
--bd-acc-panel-padding-block: var(--spacing-0) var(--spacing-8);
|
|
324
|
+
--bd-acc-panel-padding-inline: var(--spacing-36) var(--spacing-8);
|
|
325
|
+
--bd-acc-panel-paragraph-gap: var(--spacing-0);
|
|
326
|
+
--bd-acc-item-margin-bottom: var(--spacing-0);
|
|
333
327
|
}
|
|
334
328
|
|
|
335
329
|
:host([variant="default-blue"]) {
|
|
@@ -10,6 +10,7 @@ import "../paragraph/paragraph.js";
|
|
|
10
10
|
import { accordionItem, accordionSection } from "./accordion.css.js";
|
|
11
11
|
import { ensembleCSS } from "../shared/ensemble.css.js";
|
|
12
12
|
import { onTriggerKeydown } from "./accordion-keyboard.js";
|
|
13
|
+
import { panelHidden } from "./accordion-panel.js";
|
|
13
14
|
|
|
14
15
|
export class BdAccordionItem extends LitElement {
|
|
15
16
|
static styles = [accordionItem];
|
|
@@ -34,37 +35,14 @@ export class BdAccordionItem extends LitElement {
|
|
|
34
35
|
this.open = !this.open;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* (see the note on :host([data-bd-acc-focus]) in accordion.css.js). Two
|
|
42
|
-
* frames, because :focus-visible is decided after the focus event.
|
|
43
|
-
*
|
|
44
|
-
* Called on focusin and on every keydown. The keydown matters: after a mouse
|
|
45
|
-
* click the button is focused without :focus-visible and the attribute is
|
|
46
|
-
* rightly off, but a keypress then makes it :focus-visible with no focus
|
|
47
|
-
* change, and without this the item would show no ring for a keyboard user.
|
|
48
|
-
*/
|
|
49
|
-
_onTriggerFocusIn() {
|
|
50
|
-
const btn = this.renderRoot?.querySelector(".header");
|
|
51
|
-
if (!btn) return;
|
|
52
|
-
requestAnimationFrame(() => {
|
|
53
|
-
requestAnimationFrame(() => {
|
|
54
|
-
if (btn.matches(":focus-visible")) {
|
|
55
|
-
this.setAttribute("data-bd-acc-focus", "");
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
_onTriggerFocusOut() {
|
|
62
|
-
this.removeAttribute("data-bd-acc-focus");
|
|
38
|
+
/* Find in page matched text in the closed panel: open, so the item's state
|
|
39
|
+
agrees with what the browser is about to reveal (accordion-panel.js). */
|
|
40
|
+
_onBeforeMatch() {
|
|
41
|
+
this.open = true;
|
|
63
42
|
}
|
|
64
43
|
|
|
65
44
|
_onTriggerKeydown(e) {
|
|
66
45
|
onTriggerKeydown(this, e);
|
|
67
|
-
this._onTriggerFocusIn();
|
|
68
46
|
}
|
|
69
47
|
|
|
70
48
|
/** Move keyboard focus to this item's disclosure trigger. */
|
|
@@ -72,19 +50,19 @@ export class BdAccordionItem extends LitElement {
|
|
|
72
50
|
this.renderRoot?.querySelector(".header")?.focus();
|
|
73
51
|
}
|
|
74
52
|
|
|
53
|
+
/* The trigger and its panel sit in one .disclosure, the box the focus ring
|
|
54
|
+
goes round -- see the note on .disclosure in accordion.css.js. */
|
|
75
55
|
render() {
|
|
76
56
|
const badgeEl = this.querySelector("[slot='badge']");
|
|
77
57
|
|
|
78
58
|
if (this.chevron) {
|
|
79
|
-
return html
|
|
59
|
+
return html`<div class="disclosure">
|
|
80
60
|
<button
|
|
81
61
|
type="button"
|
|
82
62
|
class="header header--chevron"
|
|
83
63
|
aria-expanded="${this.open}"
|
|
84
64
|
aria-controls="${this._panelId}"
|
|
85
65
|
@click=${this.toggle}
|
|
86
|
-
@focusin=${this._onTriggerFocusIn}
|
|
87
|
-
@focusout=${this._onTriggerFocusOut}
|
|
88
66
|
@keydown=${this._onTriggerKeydown}
|
|
89
67
|
>
|
|
90
68
|
<span class="title-badge-wrapper">
|
|
@@ -97,21 +75,24 @@ export class BdAccordionItem extends LitElement {
|
|
|
97
75
|
: html`<bd-arrow-down-icon size="16" color="var(--color-text-brand)"></bd-arrow-down-icon>`}
|
|
98
76
|
</span>
|
|
99
77
|
</button>
|
|
100
|
-
<div
|
|
78
|
+
<div
|
|
79
|
+
id="${this._panelId}"
|
|
80
|
+
class="content content--chevron"
|
|
81
|
+
hidden=${panelHidden(this.open)}
|
|
82
|
+
@beforematch=${this._onBeforeMatch}
|
|
83
|
+
>
|
|
101
84
|
<slot></slot>
|
|
102
85
|
</div>
|
|
103
|
-
|
|
86
|
+
</div>`;
|
|
104
87
|
}
|
|
105
88
|
|
|
106
|
-
return html
|
|
89
|
+
return html`<div class="disclosure">
|
|
107
90
|
<button
|
|
108
91
|
type="button"
|
|
109
92
|
class="header"
|
|
110
93
|
aria-expanded="${this.open}"
|
|
111
94
|
aria-controls="${this._panelId}"
|
|
112
95
|
@click=${this.toggle}
|
|
113
|
-
@focusin=${this._onTriggerFocusIn}
|
|
114
|
-
@focusout=${this._onTriggerFocusOut}
|
|
115
96
|
@keydown=${this._onTriggerKeydown}
|
|
116
97
|
>
|
|
117
98
|
<span class="toggle" aria-hidden="true">
|
|
@@ -124,10 +105,15 @@ export class BdAccordionItem extends LitElement {
|
|
|
124
105
|
${badgeEl ? badgeEl.cloneNode(true) : ""}
|
|
125
106
|
</span>
|
|
126
107
|
</button>
|
|
127
|
-
<div
|
|
108
|
+
<div
|
|
109
|
+
id="${this._panelId}"
|
|
110
|
+
class="content"
|
|
111
|
+
hidden=${panelHidden(this.open)}
|
|
112
|
+
@beforematch=${this._onBeforeMatch}
|
|
113
|
+
>
|
|
128
114
|
<slot></slot>
|
|
129
115
|
</div>
|
|
130
|
-
|
|
116
|
+
</div>`;
|
|
131
117
|
}
|
|
132
118
|
}
|
|
133
119
|
|
|
@@ -29,6 +29,10 @@ background — instead of the default left-side plus/minus icon. Combine it with
|
|
|
29
29
|
\`bd-compatibility-table\` (\`variant="risk"\`) to build a collapsible risk-mapping
|
|
30
30
|
table, as shown below.
|
|
31
31
|
|
|
32
|
+
A closed panel is \`hidden="until-found"\` where the browser supports it (Chromium,
|
|
33
|
+
Firefox 148+), so find in page reaches its text and opens the item; elsewhere it
|
|
34
|
+
is plain \`hidden\`, as before.
|
|
35
|
+
|
|
32
36
|
### Attributes
|
|
33
37
|
|
|
34
38
|
#### \`bd-accordion-section\`
|
|
@@ -193,7 +197,7 @@ export const WithGuideLinkAndIcon = {
|
|
|
193
197
|
render: () => html`
|
|
194
198
|
<bd-accordion-section
|
|
195
199
|
title="Troubleshooting"
|
|
196
|
-
guide-icon="/assets/
|
|
200
|
+
guide-icon="/assets/user_guide.png"
|
|
197
201
|
guide-label="View the full user guide"
|
|
198
202
|
guide-href="https://www.bitdefender.com/consumer/support/"
|
|
199
203
|
>
|