@repobit/dex-system-design 0.25.12 → 0.26.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 +187 -0
- package/README.md +131 -8
- package/package.json +95 -13
- package/schemas/component-manifest.json +3294 -405
- package/schemas/manifest-omissions.json +173 -0
- package/src/blog/src/breakpoints.js +6 -6
- package/src/blog/src/content/blog-atoms-showcase.js +1 -1
- package/src/blog/src/content/blog-page-layout.js +2 -2
- package/src/blog/src/lib/article-toc.js +7 -7
- package/src/blog/src/shell/blog-shell.js +1 -1
- package/src/blog/src/tokens/blog.js +2 -2
- package/src/blog/src/tokens/core.js +34 -35
- package/src/blog/src/tokens/legacy.js +0 -9
- package/src/blog/tokens/blog.js +2 -2
- package/src/blog/tokens/core.js +34 -35
- package/src/blog/tokens/legacy.js +0 -9
- package/src/blog/tokens.css +36 -46
- package/src/components/accordion/accordion-bg.css.js +83 -59
- package/src/components/accordion/accordion-bg.js +29 -10
- package/src/components/accordion/accordion-bg.stories.js +67 -67
- package/src/components/accordion/accordion-keyboard.js +80 -0
- package/src/components/accordion/accordion.css.js +142 -80
- package/src/components/accordion/accordion.js +37 -10
- package/src/components/accordion/accordion.stories.js +7 -7
- package/src/components/agent-endpoints/agent-endpoints.css.js +36 -39
- package/src/components/agent-endpoints/agent-endpoints.js +30 -20
- package/src/components/agent-endpoints/agent-endpoints.stories.js +1 -1
- package/src/components/ai-guardian-demo.stories.js +91 -91
- package/src/components/alert/alert.css.js +198 -0
- package/src/components/alert/alert.js +103 -0
- package/src/components/alert/alert.stories.js +206 -0
- package/src/components/anchor/anchor-nav.css.js +213 -101
- package/src/components/anchor/anchor-nav.js +26 -40
- package/src/components/anchor/anchor.stories.js +22 -12
- package/src/components/annotation/annotation.css.js +58 -0
- package/src/components/annotation/annotation.js +67 -0
- package/src/components/annotation/annotation.stories.js +63 -0
- package/src/components/architecture.stories.js +285 -0
- package/src/components/atoms.stories.js +342 -0
- package/src/components/avatar/avatar.css.js +67 -0
- package/src/components/avatar/avatar.js +42 -0
- package/src/components/avatar/avatar.stories.js +95 -0
- package/src/components/awards/awards-flex.css.js +209 -23
- package/src/components/awards/awards-flex.js +66 -7
- package/src/components/awards/awards-flex.stories.js +1 -1
- package/src/components/awards/{awards-light.stories.js → awards-summary.stories.js} +54 -64
- package/src/components/awards/awards.css.js +116 -58
- package/src/components/awards/awards.js +102 -28
- package/src/components/awards/awards.stories.js +1 -1
- package/src/components/back/back.css.js +51 -22
- package/src/components/back/back.js +28 -7
- package/src/components/back/back.stories.js +9 -3
- package/src/components/badge/badge.css.js +158 -46
- package/src/components/badge/badge.js +62 -74
- package/src/components/badge/badge.stories.js +176 -248
- package/src/components/bento-grid/bento-grid.css.js +21 -16
- package/src/components/bento-grid/bento-grid.js +16 -4
- package/src/components/bento-grid/bento-grid.stories.js +19 -18
- package/src/components/bento-grid/bento-item.css.js +52 -28
- package/src/components/bento-grid/bento-item.js +2 -2
- package/src/components/blockquote/blockquote.css.js +47 -0
- package/src/components/blockquote/blockquote.js +29 -0
- package/src/components/blockquote/blockquote.stories.js +62 -0
- package/src/components/breadcrumb/breadcrumb.css.js +92 -22
- package/src/components/breadcrumb/breadcrumb.js +56 -11
- package/src/components/button/button.css.js +531 -161
- package/src/components/button/button.js +206 -214
- package/src/components/button/button.stories.js +322 -174
- package/src/components/caption/caption.css.js +21 -0
- package/src/components/caption/caption.js +31 -0
- package/src/components/caption/caption.stories.js +62 -0
- package/src/components/card-features/card-features.css.js +14 -22
- package/src/components/card-features/card-features.js +68 -9
- package/src/components/card-features/card-features.stories.js +11 -11
- package/src/components/cards/card.css.js +60 -81
- package/src/components/cards/card.js +56 -25
- package/src/components/cards/card.stories.js +39 -39
- package/src/components/carousel/carousel.css.js +93 -99
- package/src/components/carousel/carousel.js +32 -4
- package/src/components/checkbox/checkbox.css.js +111 -93
- package/src/components/checkbox/checkbox.js +64 -90
- package/src/components/checkbox/checkbox.stories.js +96 -29
- package/src/components/code/code.css.js +70 -0
- package/src/components/code/code.js +40 -0
- package/src/components/code/code.stories.js +73 -0
- package/src/components/compare/compare.css.js +179 -43
- package/src/components/compare/compare.js +52 -25
- package/src/components/compare/compare.stories.js +61 -4
- package/src/components/comparison-panel/comparison-panel.css.js +38 -51
- package/src/components/comparison-panel/comparison-panel.js +5 -4
- package/src/components/comparison-panel/comparison-panel.stories.js +1 -1
- package/src/components/compatibility-table/compatibility-table.css.js +180 -80
- package/src/components/compatibility-table/compatibility-table.js +37 -9
- package/src/components/control-alignment.stories.js +393 -0
- package/src/components/cta-banner/cta-banner.css.js +41 -13
- package/src/components/cta-banner/cta-banner.js +6 -5
- package/src/components/cta-banner/cta-banner.stories.js +43 -98
- package/src/components/display/display.css.js +25 -1
- package/src/components/display/display.js +46 -13
- package/src/components/display/display.stories.js +270 -40
- package/src/components/divider/divider-horizontal.js +21 -5
- package/src/components/divider/divider-vertical.js +15 -7
- package/src/components/divider/divider.css.js +2 -2
- package/src/components/divider/divider.stories.js +38 -34
- package/src/components/dropdown/dropdown.css.js +93 -126
- package/src/components/dropdown/dropdown.js +114 -34
- package/src/components/dropdown/dropdown.stories.js +56 -24
- package/src/components/features/features.css.js +24 -11
- package/src/components/features/features.js +7 -3
- package/src/components/features/features.stories.js +37 -37
- package/src/components/features-tab/features-tab.css.js +19 -8
- package/src/components/features-tab/features-tab.js +6 -5
- package/src/components/features-tab/features-tab.stories.js +23 -23
- package/src/components/fieldset/fieldset.css.js +30 -0
- package/src/components/fieldset/fieldset.js +28 -0
- package/src/components/fieldset/fieldset.stories.js +84 -0
- package/src/components/footer/footer-links-group.css.js +10 -14
- package/src/components/footer/footer-links-group.js +4 -3
- package/src/components/footer/footer-lp.css.js +59 -30
- package/src/components/footer/footer-lp.js +17 -12
- package/src/components/footer/footer-lp.stories.js +63 -75
- package/src/components/footer/footer-nav-menu.css.js +26 -4
- package/src/components/footer/footer-nav-menu.js +3 -2
- package/src/components/footer/footer.css.js +146 -264
- package/src/components/footer/footer.js +176 -106
- package/src/components/footer/footer.stories.js +9 -9
- package/src/components/footer/localeMap.js +1 -1
- package/src/components/grid/grid.css.js +1 -1
- package/src/components/grid/grid.js +49 -7
- package/src/components/grid/grid.stories.js +111 -0
- package/src/components/header/header-code.css.js +61 -51
- package/src/components/header/header-code.js +28 -14
- package/src/components/header/header-code.stories.js +5 -5
- package/src/components/header/header.css.js +655 -176
- package/src/components/header/header.js +269 -36
- package/src/components/header/header.stories.js +841 -18
- package/src/components/heading/heading.css.js +14 -17
- package/src/components/heading/heading.js +48 -33
- package/src/components/heading/heading.stories.js +27 -25
- package/src/components/help-text/help-text.css.js +21 -0
- package/src/components/help-text/help-text.js +25 -0
- package/src/components/help-text/help-text.stories.js +66 -0
- package/src/components/highlight/highlight.css.js +86 -64
- package/src/components/highlight/highlight.js +18 -27
- package/src/components/highlight/highlight.stories.js +14 -3
- package/src/components/icons/analysis-icon.js +6 -16
- package/src/components/icons/arrow-down-icon.js +6 -19
- package/src/components/icons/arrow-icon.js +44 -0
- package/src/components/icons/arrow-right-icon.js +30 -23
- package/src/components/icons/arrow-up-icon.js +19 -18
- package/src/components/icons/bd-ai-icon.js +1 -1
- package/src/components/icons/brand-marks.stories.js +279 -0
- package/src/components/icons/brand-signature-icon.js +42 -0
- package/src/components/icons/check-icon.js +27 -0
- package/src/components/icons/circle-info-icon.js +33 -0
- package/src/components/icons/close-icon.js +6 -18
- package/src/components/icons/family-icon.js +8 -20
- package/src/components/icons/globe-icon.js +6 -18
- package/src/components/icons/guide-icon.js +6 -18
- package/src/components/icons/icon-element.js +99 -0
- package/src/components/icons/icons.js +36 -0
- package/src/components/icons/icons.stories.js +184 -52
- package/src/components/icons/individual-icon.js +6 -18
- package/src/components/icons/laurel-icon.js +9 -19
- package/src/components/icons/machine-learning-icon.js +6 -17
- package/src/components/icons/marks.js +41 -0
- package/src/components/icons/minus-icon.js +7 -21
- package/src/components/icons/missing-icon.js +52 -0
- package/src/components/icons/plus-icon.js +7 -21
- package/src/components/icons/quote-icon.js +19 -19
- package/src/components/image/image.css.js +72 -25
- package/src/components/image/image.js +11 -6
- package/src/components/image/image.stories.js +2 -2
- package/src/components/input/custom-form.stories.js +214 -62
- package/src/components/input/input-clipboard.css.js +51 -144
- package/src/components/input/input-clipboard.js +31 -15
- package/src/components/input/input.css.js +8 -146
- package/src/components/input/input.js +93 -38
- package/src/components/install-options/install-options.css.js +84 -77
- package/src/components/install-options/install-options.js +33 -30
- package/src/components/install-options/install-options.stories.js +3 -3
- package/src/components/label/label.css.js +35 -0
- package/src/components/label/label.js +38 -0
- package/src/components/label/label.stories.js +82 -0
- package/src/components/light-carousel/light-carousel.css.js +111 -63
- package/src/components/light-carousel/light-carousel.js +85 -11
- package/src/components/light-carousel/light-carousel.stories.js +126 -82
- package/src/components/link/link.css.js +150 -99
- package/src/components/link/link.js +86 -11
- package/src/components/link/link.stories.js +124 -30
- package/src/components/list/list-item/list-item.css.js +74 -22
- package/src/components/list/list-item/list-item.js +32 -10
- package/src/components/list/list-item/list-item.stories.js +23 -23
- package/src/components/list/list.css.js +8 -2
- package/src/components/list/list.js +3 -2
- package/src/components/list/list.stories.js +222 -0
- package/src/components/modal/modal.css.js +114 -24
- package/src/components/modal/modal.js +83 -7
- package/src/components/modal/modal.stories.js +9 -9
- package/src/components/overview/overview.css.js +19 -14
- package/src/components/overview/overview.js +6 -5
- package/src/components/overview/overview.stories.js +10 -10
- package/src/components/page-switcher/page-switcher.css.js +97 -40
- package/src/components/page-switcher/page-switcher.js +28 -5
- package/src/components/page-switcher/page-switcher.stories.js +95 -0
- package/src/components/paragraph/paragraph.css.js +15 -10
- package/src/components/paragraph/paragraph.js +41 -44
- package/src/components/paragraph/paragraph.stories.js +56 -21
- package/src/components/picture/picture.css.js +103 -44
- package/src/components/picture/picture.js +100 -30
- package/src/components/picture/picture.stories.js +1 -1
- package/src/components/pricing-cards/new-pricing-card.js +3 -3
- package/src/components/pricing-cards/new-pricing.css.js +24 -15
- package/src/components/pricing-cards/pricing-card-actions.css.js +1 -1
- package/src/components/pricing-cards/pricing-card-actions.js +3 -4
- package/src/components/pricing-cards/pricing-card-container.css.js +3 -3
- package/src/components/pricing-cards/pricing-card-container.js +3 -2
- package/src/components/pricing-cards/pricing-card-header.css.js +10 -8
- package/src/components/pricing-cards/pricing-card-header.js +6 -7
- package/src/components/pricing-cards/pricing-card-pricing.css.js +16 -9
- package/src/components/pricing-cards/pricing-card-pricing.js +8 -6
- package/src/components/pricing-cards/pricing-card-show-more.css.js +11 -3
- package/src/components/pricing-cards/pricing-card-show-more.js +8 -3
- package/src/components/pricing-cards/pricing-card.css.js +244 -190
- package/src/components/pricing-cards/pricing-card.js +54 -70
- package/src/components/pricing-cards/pricing-feature-item.css.js +25 -8
- package/src/components/pricing-cards/pricing-feature-item.js +8 -3
- package/src/components/process-steps/process-steps.css.js +26 -14
- package/src/components/process-steps/process-steps.js +23 -6
- package/src/components/process-steps/process-steps.stories.js +1 -1
- package/src/components/progress/progress.css.js +80 -0
- package/src/components/progress/progress.js +42 -0
- package/src/components/progress/progress.stories.js +79 -0
- package/src/components/quick-answer/quick-answer.css.js +75 -13
- package/src/components/quick-answer/quick-answer.js +8 -3
- package/src/components/radio/radio.css.js +92 -128
- package/src/components/radio/radio.js +106 -127
- package/src/components/radio/radio.stories.js +54 -19
- package/src/components/review/review-grid.css.js +5 -6
- package/src/components/review/review-grid.js +14 -11
- package/src/components/review/review.css.js +11 -6
- package/src/components/review/review.js +3 -8
- package/src/components/shared/ensemble.css.js +93 -0
- package/src/components/shared/form-field.css.js +206 -0
- package/src/components/shared/prop-vocabulary.js +48 -0
- package/src/components/shared/token-scales.js +306 -0
- package/src/components/skeleton/skeleton.css.js +34 -0
- package/src/components/skeleton/skeleton.js +32 -0
- package/src/components/skeleton/skeleton.stories.js +70 -0
- package/src/components/spinner/spinner.css.js +62 -0
- package/src/components/spinner/spinner.js +38 -0
- package/src/components/spinner/spinner.stories.js +92 -0
- package/src/components/spotlight-section/spotlight-section.css.js +14 -13
- package/src/components/spotlight-section/spotlight-section.js +42 -39
- package/src/components/switch/switch.css.js +103 -0
- package/src/components/switch/switch.js +44 -0
- package/src/components/switch/switch.stories.js +86 -0
- package/src/components/tab-list/content-switcher.stories.js +189 -0
- package/src/components/tab-list/tab-list.css.js +250 -0
- package/src/components/tab-list/tab-list.js +184 -0
- package/src/components/tab-list/tab-list.stories.js +221 -0
- package/src/components/tabs/tabs.css.js +14 -123
- package/src/components/tabs/tabs.js +16 -19
- package/src/components/tabs/tabs.stories.js +95 -95
- package/src/components/tag/tag.css.js +54 -0
- package/src/components/tag/tag.js +32 -0
- package/src/components/tag/tag.stories.js +126 -0
- package/src/components/terminal/terminal-message.css.js +164 -60
- package/src/components/terminal/terminal-message.js +5 -5
- package/src/components/terminal/terminal-message.stories.js +70 -1
- package/src/components/termsOfUse/terms.css.js +25 -20
- package/src/components/termsOfUse/terms.js +13 -9
- package/src/components/termsOfUse/terms.stories.js +1 -1
- package/src/components/textarea/textarea.css.js +51 -0
- package/src/components/textarea/textarea.js +136 -0
- package/src/components/textarea/textarea.stories.js +191 -0
- package/src/components/tooltip/tooltip.css.js +75 -0
- package/src/components/tooltip/tooltip.js +156 -0
- package/src/components/tooltip/tooltip.stories.js +161 -0
- package/src/components/trust-panel/trust-panel.css.js +85 -33
- package/src/components/trust-panel/trust-panel.js +18 -10
- package/src/components/trust-panel/trust-panel.stories.js +1 -1
- package/src/components/ultimate-security-demo.stories.js +431 -0
- package/src/components/video/video.css.js +17 -0
- package/src/components/video/video.js +40 -0
- package/src/components/video/video.stories.js +106 -0
- package/src/components/video-player/video-player.css.js +67 -11
- package/src/components/video-player/video-player.js +35 -4
- package/src/components/video-player/video-player.stories.js +1 -1
- package/src/components/visual-alignment.stories.js +411 -0
- package/src/components/visually-hidden/visually-hidden.css.js +24 -0
- package/src/components/visually-hidden/visually-hidden.js +16 -0
- package/src/components/visually-hidden/visually-hidden.stories.js +56 -0
- package/src/stories/Button.stories.js +17 -17
- package/src/stories/Header.stories.js +10 -10
- package/src/stories/Page.js +1 -1
- package/src/stories/Page.stories.js +6 -6
- package/src/tokens/borders.stories.js +339 -0
- package/src/tokens/color-responsibilities.stories.js +227 -0
- package/src/tokens/dark-derivation.js +309 -0
- package/src/tokens/dark-findings.js +197 -0
- package/src/tokens/dark-mode.stories.js +207 -0
- package/src/tokens/dimension.stories.js +251 -0
- package/src/tokens/elevation.stories.js +143 -0
- package/src/tokens/focus.stories.js +276 -0
- package/src/tokens/fonts.css +20 -20
- package/src/tokens/fonts.stories.js +354 -374
- package/src/tokens/layout.css +25 -11
- package/src/tokens/motion.stories.js +231 -0
- package/src/tokens/shape.stories.js +272 -0
- package/src/tokens/spacing-rhythm.stories.js +359 -0
- package/src/tokens/spacing.stories.js +208 -703
- package/src/tokens/story-chrome.js +503 -0
- package/src/tokens/surfaces.stories.js +224 -0
- package/src/tokens/text-on-surface.stories.js +164 -0
- package/src/tokens/token-map.js +220 -0
- package/src/tokens/token-map.stories.js +257 -0
- package/src/tokens/token-purposes.js +266 -0
- package/src/tokens/tokens-grid.stories.js +388 -900
- package/src/tokens/tokens.css +1633 -1045
- package/src/tokens/tokens.js +1130 -492
- package/src/tokens/tokens.stories.js +137 -47
- package/src/tokens/type-ceiling-words.js +299 -0
- package/src/tokens/typography.stories.js +1003 -965
- package/src/tokens/vertical-rhythm.stories.js +224 -0
- package/src/components/awards/awards-icon.js +0 -56
- package/src/components/awards/awards-light.js +0 -240
- package/src/components/banner/banner.js +0 -60
- package/src/components/banner/banner.stories.js +0 -51
- package/src/components/button/icons.js +0 -24
- package/src/components/input/index.js +0 -0
- package/src/components/light-carousel/light-carousel-simple.css.js +0 -183
- package/src/components/light-carousel/light-carousel-simple.js +0 -74
- package/src/tokens/colors.js +0 -121
- package/src/tokens/typography.css.js +0 -207
- package/src/tokens/typography.js +0 -0
|
@@ -3,6 +3,7 @@ import { tokens } from "../../tokens/tokens.js";
|
|
|
3
3
|
import "../heading/heading.js";
|
|
4
4
|
import "../paragraph/paragraph.js";
|
|
5
5
|
import compatibilityTableCSS from "./compatibility-table.css.js";
|
|
6
|
+
import { ensembleCSS } from "../shared/ensemble.css.js";
|
|
6
7
|
|
|
7
8
|
class CompatibilityTable extends LitElement {
|
|
8
9
|
static properties = {
|
|
@@ -15,7 +16,7 @@ class CompatibilityTable extends LitElement {
|
|
|
15
16
|
rows : { type: Array }
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
static styles = [tokens, compatibilityTableCSS];
|
|
19
|
+
static styles = [tokens, ensembleCSS, compatibilityTableCSS];
|
|
19
20
|
|
|
20
21
|
constructor() {
|
|
21
22
|
super();
|
|
@@ -36,13 +37,34 @@ class CompatibilityTable extends LitElement {
|
|
|
36
37
|
return ["Environment", "Coverage", "Notes"];
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
/**
|
|
41
|
+
* The column name a cell shows below md, where the header row is hidden.
|
|
42
|
+
*
|
|
43
|
+
* It has to come from `columns`, because that is what the header shows. The
|
|
44
|
+
* stylesheet used to carry these as hardcoded strings in `content` --
|
|
45
|
+
* "Without AI Guardian: " and four others -- so a consumer who passed their
|
|
46
|
+
* own columns got them in the header and the component's English in the
|
|
47
|
+
* cells. Measured at 375 with columns set to Romanian: the header read
|
|
48
|
+
* "Fara AI Guardian" and the cell label still read "Without AI Guardian".
|
|
49
|
+
* There was no way to change it and no way to translate it.
|
|
50
|
+
*
|
|
51
|
+
* Passed to CSS as a string custom property so the label stays generated
|
|
52
|
+
* content: it is a visual stand-in for a header that is still in the
|
|
53
|
+
* accessibility tree, and putting it in the DOM would say it twice.
|
|
54
|
+
*/
|
|
55
|
+
_cellLabel(index) {
|
|
56
|
+
const columns = this._defaultColumns();
|
|
57
|
+
const name = columns?.[index];
|
|
58
|
+
return name ? `--bd-cell-label: "${String(name).replace(/["\\]/g, "")}: "` : nothing;
|
|
59
|
+
}
|
|
60
|
+
|
|
39
61
|
_renderRow(row) {
|
|
40
62
|
if (this.variant === "outcome") {
|
|
41
63
|
return html`
|
|
42
64
|
<div class="bd-compattable-row" role="row">
|
|
43
65
|
<span class="bd-compattable-cell bd-compattable-cell--event" role="cell">${row.event}</span>
|
|
44
|
-
<span class="bd-compattable-cell bd-compattable-cell--without" role="cell">${row.without}</span>
|
|
45
|
-
<span class="bd-compattable-cell bd-compattable-cell--with" role="cell">${row.with}</span>
|
|
66
|
+
<span class="bd-compattable-cell bd-compattable-cell--without" role="cell" style=${this._cellLabel(1)}>${row.without}</span>
|
|
67
|
+
<span class="bd-compattable-cell bd-compattable-cell--with" role="cell" style=${this._cellLabel(2)}>${row.with}</span>
|
|
46
68
|
</div>
|
|
47
69
|
`;
|
|
48
70
|
}
|
|
@@ -51,7 +73,7 @@ class CompatibilityTable extends LitElement {
|
|
|
51
73
|
return html`
|
|
52
74
|
<div class="bd-compattable-row" role="row">
|
|
53
75
|
<span class="bd-compattable-cell bd-compattable-cell--category" role="cell">${row.category}</span>
|
|
54
|
-
<span class="bd-compattable-cell bd-compattable-cell--riskcoverage" role="cell">${row.coverage}</span>
|
|
76
|
+
<span class="bd-compattable-cell bd-compattable-cell--riskcoverage" role="cell" style=${this._cellLabel(1)}>${row.coverage}</span>
|
|
55
77
|
</div>
|
|
56
78
|
`;
|
|
57
79
|
}
|
|
@@ -68,8 +90,8 @@ class CompatibilityTable extends LitElement {
|
|
|
68
90
|
return html`
|
|
69
91
|
<div class="bd-compattable-row" role="row">
|
|
70
92
|
<span class="bd-compattable-cell bd-compattable-cell--environment" role="cell">${row.environment}</span>
|
|
71
|
-
<span class="bd-compattable-cell bd-compattable-cell--coverage" role="cell">${row.coverage}</span>
|
|
72
|
-
<span class="bd-compattable-cell bd-compattable-cell--notes" role="cell">${row.notes}</span>
|
|
93
|
+
<span class="bd-compattable-cell bd-compattable-cell--coverage" role="cell" style=${this._cellLabel(1)}>${row.coverage}</span>
|
|
94
|
+
<span class="bd-compattable-cell bd-compattable-cell--notes" role="cell" style=${this._cellLabel(2)}>${row.notes}</span>
|
|
73
95
|
</div>
|
|
74
96
|
`;
|
|
75
97
|
}
|
|
@@ -78,7 +100,7 @@ class CompatibilityTable extends LitElement {
|
|
|
78
100
|
const columns = this._defaultColumns();
|
|
79
101
|
|
|
80
102
|
return html`
|
|
81
|
-
<div class="bd-compattable-wrapper">
|
|
103
|
+
<div class="bd-ensemble bd-compattable-wrapper">
|
|
82
104
|
${this.title
|
|
83
105
|
? html`
|
|
84
106
|
<bd-h as="h2" class="bd-compattable-title">
|
|
@@ -89,7 +111,7 @@ class CompatibilityTable extends LitElement {
|
|
|
89
111
|
|
|
90
112
|
${this.description
|
|
91
113
|
? html`
|
|
92
|
-
<bd-p
|
|
114
|
+
<bd-p variant="large" class="bd-compattable-description" color="muted">
|
|
93
115
|
<slot name="description">${this.description}</slot>
|
|
94
116
|
</bd-p>
|
|
95
117
|
`
|
|
@@ -114,7 +136,13 @@ class CompatibilityTable extends LitElement {
|
|
|
114
136
|
)}
|
|
115
137
|
</div>
|
|
116
138
|
|
|
117
|
-
|
|
139
|
+
<!-- role="rowgroup", because role="table" must own rowgroups or
|
|
140
|
+
rows and this div had no role at all. Measured in the
|
|
141
|
+
accessibility tree before it: table > row (the header),
|
|
142
|
+
then a "none" node holding all five data rows, so the rows
|
|
143
|
+
were not table-owned and their position and count were not
|
|
144
|
+
the table's to compute. One attribute; no visual change. -->
|
|
145
|
+
<div class="bd-compattable-body" role="rowgroup">
|
|
118
146
|
${this.rows.map((row) => this._renderRow(row))}
|
|
119
147
|
</div>
|
|
120
148
|
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
|
|
3
|
+
import './button/button.js';
|
|
4
|
+
import './input/input.js';
|
|
5
|
+
import './dropdown/dropdown.js';
|
|
6
|
+
import './textarea/textarea.js';
|
|
7
|
+
import './label/label.js';
|
|
8
|
+
import './help-text/help-text.js';
|
|
9
|
+
import './fieldset/fieldset.js';
|
|
10
|
+
import './checkbox/checkbox.js';
|
|
11
|
+
import './radio/radio.js';
|
|
12
|
+
import './switch/switch.js';
|
|
13
|
+
import './badge/badge.js';
|
|
14
|
+
import './tag/tag.js';
|
|
15
|
+
import './alert/alert.js';
|
|
16
|
+
import './heading/heading.js';
|
|
17
|
+
import './display/display.js';
|
|
18
|
+
import './paragraph/paragraph.js';
|
|
19
|
+
import './list/list.js';
|
|
20
|
+
import './list/list-item/list-item.js';
|
|
21
|
+
import './code/code.js';
|
|
22
|
+
import './tooltip/tooltip.js';
|
|
23
|
+
import './avatar/avatar.js';
|
|
24
|
+
import './spinner/spinner.js';
|
|
25
|
+
import './progress/progress.js';
|
|
26
|
+
import './skeleton/skeleton.js';
|
|
27
|
+
import './video/video.js';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Atoms rendered next to the atoms they are supposed to agree with.
|
|
31
|
+
*
|
|
32
|
+
* `check:ds` can prove every value came from a token. It cannot prove two
|
|
33
|
+
* components ended up looking the same — the focus ring was the standing
|
|
34
|
+
* example, where 35 declarations every one of which passed the lint produced
|
|
35
|
+
* three different results. These stories are the other half of that check:
|
|
36
|
+
* each one puts a set of atoms that share a visual role in a single frame, so a
|
|
37
|
+
* change to a shared token shows up as a difference *between* components rather
|
|
38
|
+
* than only as a diff inside one.
|
|
39
|
+
*
|
|
40
|
+
* They exist to be looked at, in Storybook and in the visual-regression diff.
|
|
41
|
+
* Nothing here is a usage example — do not copy these compositions into a page.
|
|
42
|
+
*/
|
|
43
|
+
export default {
|
|
44
|
+
title : 'Foundations/Control Alignment',
|
|
45
|
+
tags : ['autodocs'],
|
|
46
|
+
parameters: {
|
|
47
|
+
layout: 'padded',
|
|
48
|
+
docs : {
|
|
49
|
+
description: {
|
|
50
|
+
component: `
|
|
51
|
+
Cross-atom comparisons. Every story here renders atoms that share a visual role
|
|
52
|
+
side by side, so the system can be judged as a system.
|
|
53
|
+
|
|
54
|
+
Read each one by asking whether the atoms in it look like they came from the
|
|
55
|
+
same place. Where they do not, the difference is the finding.
|
|
56
|
+
`
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const row = children => html`
|
|
63
|
+
<div style="display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--spacing-24)">
|
|
64
|
+
${children}
|
|
65
|
+
</div>
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
const caption = text => html`
|
|
69
|
+
<p
|
|
70
|
+
style="margin: 0 0 var(--spacing-8); font-family: var(--typography-fontFamily-mono);
|
|
71
|
+
font-size: var(--typography-fontSize-xxs); letter-spacing: var(--typography-letterSpacing-wide);
|
|
72
|
+
text-transform: uppercase; color: var(--color-neutral-500)"
|
|
73
|
+
>${text}</p>
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
const stack = children => html`
|
|
77
|
+
<div style="display: grid; gap: var(--spacing-32)">${children}</div>
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The composition the whole form family is built for: a button and a field of
|
|
82
|
+
* the same size, side by side in one row.
|
|
83
|
+
*
|
|
84
|
+
* Both axes should agree. Heights derive from the same three tokens and match
|
|
85
|
+
* to within half a pixel — 33.5 / 44 / 54.5 — and each control now reads its
|
|
86
|
+
* radius from its own size-matched alias, so `sm` is 4px on both, `md` 6px and
|
|
87
|
+
* `lg` 8px.
|
|
88
|
+
*
|
|
89
|
+
* **The textarea is not in that comparison, and should not be read as if it
|
|
90
|
+
* were.** It agrees on the three axes that mean anything across a form row —
|
|
91
|
+
* padding, type step and radius — and it is rendered here at two rows so it
|
|
92
|
+
* reads as the multi-line control it is. Its height comes from `rows`; a
|
|
93
|
+
* single-line height would collapse it.
|
|
94
|
+
*
|
|
95
|
+
* It also does not compute its height the same way, and the difference is
|
|
96
|
+
* larger than it looks: the other three set a fixed height with
|
|
97
|
+
* `box-sizing: border-box`, which absorbs their 1px borders, while a textarea
|
|
98
|
+
* sized by `rows` adds its borders on top. Between that and the taller line
|
|
99
|
+
* box — `normal` rather than `tight`, because 1.25 is cramped for running text
|
|
100
|
+
* — a one-row textarea lands about 6px above the row it sits in. Making the
|
|
101
|
+
* two formulas agree would mean forcing `tight` on a box of running text, and
|
|
102
|
+
* a multi-line control being taller than a single-line one is correct anyway.
|
|
103
|
+
*
|
|
104
|
+
* So: check the textarea's radius, padding and type against the row, and
|
|
105
|
+
* ignore its height. The other three must agree on all four.
|
|
106
|
+
*
|
|
107
|
+
* None of this held before, and both failures are the kind this story exists
|
|
108
|
+
* to catch — neither side looked wrong on its own.
|
|
109
|
+
*
|
|
110
|
+
* The button spelled its radius as a raw `--radius-*` step while the field used
|
|
111
|
+
* the `--form-input-*` aliases, and the field's `sm` pointed at the *medium*
|
|
112
|
+
* alias and its `md` at the *large* one: a step apart at both.
|
|
113
|
+
*
|
|
114
|
+
* The textarea was the one form control left outside
|
|
115
|
+
* shared/form-field.css.js, with no size axis at all, so it rendered the `md`
|
|
116
|
+
* radius and a fixed 16px type in all three rows of this story — including the
|
|
117
|
+
* two where the caption named it alongside three controls it did not match.
|
|
118
|
+
*
|
|
119
|
+
* Worth a look on every diff rather than only when something here is being
|
|
120
|
+
* changed on purpose.
|
|
121
|
+
*/
|
|
122
|
+
export const ControlSizes = () => stack([
|
|
123
|
+
['sm', 'Small'], ['md', 'Medium'], ['lg', 'Large']
|
|
124
|
+
].map(([size, name]) => html`
|
|
125
|
+
<div>
|
|
126
|
+
${caption(`${name} — button, input, select · textarea (height from rows)`)}
|
|
127
|
+
${row(html`
|
|
128
|
+
<bd-button size=${size}>Continue</bd-button>
|
|
129
|
+
<div style="width: 14rem">
|
|
130
|
+
<bd-custom-input label="Email" size=${size} placeholder="you@example.com"></bd-custom-input>
|
|
131
|
+
</div>
|
|
132
|
+
<div style="width: 12rem">
|
|
133
|
+
<bd-custom-dropdown
|
|
134
|
+
label="Plan"
|
|
135
|
+
size=${size}
|
|
136
|
+
.options=${['Total Security', 'Internet Security', 'Antivirus Plus']}
|
|
137
|
+
></bd-custom-dropdown>
|
|
138
|
+
</div>
|
|
139
|
+
<div style="width: 12rem">
|
|
140
|
+
<bd-textarea size=${size} rows="2" placeholder="Notes"></bd-textarea>
|
|
141
|
+
</div>
|
|
142
|
+
`)}
|
|
143
|
+
</div>
|
|
144
|
+
`));
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Button and field alternating at each size, which is where a difference of a
|
|
148
|
+
* single radius step is easiest to see — the two corners sit one above the
|
|
149
|
+
* other rather than across a row. Each label names the alias that rule reads,
|
|
150
|
+
* so a mismatch is legible in the snapshot without opening the stylesheet.
|
|
151
|
+
*/
|
|
152
|
+
export const ControlRadii = () => html`
|
|
153
|
+
<div style="display: grid; gap: var(--spacing-16); max-width: 26rem">
|
|
154
|
+
${caption('Corner radius at matching sizes — 4px / 6px / 8px')}
|
|
155
|
+
<bd-button size="sm">Button sm — button-small-borderRadius</bd-button>
|
|
156
|
+
<bd-custom-input label="Input sm — form-input-small-borderRadius" size="sm"></bd-custom-input>
|
|
157
|
+
<bd-button size="md">Button md — button-medium-borderRadius</bd-button>
|
|
158
|
+
<bd-custom-input label="Input md — form-input-medium-borderRadius" size="md"></bd-custom-input>
|
|
159
|
+
<bd-button size="lg">Button lg — button-large-borderRadius</bd-button>
|
|
160
|
+
<bd-custom-input label="Input lg — form-input-large-borderRadius" size="lg"></bd-custom-input>
|
|
161
|
+
</div>
|
|
162
|
+
`;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The label / field / help-text stack, built two ways: from the standalone
|
|
166
|
+
* atoms on the left, and from the field's own built-in label and help text on
|
|
167
|
+
* the right. They are the same three parts and should produce the same stack.
|
|
168
|
+
*
|
|
169
|
+
* They do now. Both read `--form-label-*` and `--form-help-text-*`, so the
|
|
170
|
+
* weight and both gaps come from the same place.
|
|
171
|
+
*
|
|
172
|
+
* They did not before. The field hardcoded its label bold where the token says
|
|
173
|
+
* medium — 200 units apart on the same line of the same form — and the two
|
|
174
|
+
* gaps were 1px against 4px, because the margin tokens had been written
|
|
175
|
+
* against a step-indexed spacing scale and never converted.
|
|
176
|
+
*/
|
|
177
|
+
export const FieldStackVsBuiltIn = () => html`
|
|
178
|
+
<div style="display: flex; gap: var(--spacing-48); flex-wrap: wrap">
|
|
179
|
+
<div style="width: 18rem">
|
|
180
|
+
${caption('bd-label + input + bd-help-text')}
|
|
181
|
+
<bd-label for="a" required>Email address</bd-label>
|
|
182
|
+
<bd-custom-input label="" size="md" placeholder="you@example.com"></bd-custom-input>
|
|
183
|
+
<bd-help-text>We only use this for receipts.</bd-help-text>
|
|
184
|
+
</div>
|
|
185
|
+
<div style="width: 18rem">
|
|
186
|
+
${caption("the field's own label and help text")}
|
|
187
|
+
<bd-custom-input
|
|
188
|
+
label="Email address"
|
|
189
|
+
size="md"
|
|
190
|
+
required
|
|
191
|
+
placeholder="you@example.com"
|
|
192
|
+
tooltip="We only use this for receipts."
|
|
193
|
+
></bd-custom-input>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
`;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Field spacing inside a group. The gap between rows is `--form-fieldSpacing`,
|
|
200
|
+
* which is the token most likely to look wrong at a glance.
|
|
201
|
+
*/
|
|
202
|
+
export const FieldSpacing = () => html`
|
|
203
|
+
<div style="max-width: 22rem">
|
|
204
|
+
<bd-fieldset legend="Contact details">
|
|
205
|
+
<bd-custom-input label="First name" size="md"></bd-custom-input>
|
|
206
|
+
<bd-custom-input label="Last name" size="md"></bd-custom-input>
|
|
207
|
+
<bd-custom-input label="Email" size="md"></bd-custom-input>
|
|
208
|
+
</bd-fieldset>
|
|
209
|
+
</div>
|
|
210
|
+
`;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The three selection controls in one row. Checkbox and radio were written
|
|
214
|
+
* together; switch was written separately and has been brought onto their
|
|
215
|
+
* grammar — the row is the control, with their padding, their inherited label
|
|
216
|
+
* weight, a hover state it did not have, and the focus ring on the row rather
|
|
217
|
+
* than on the track. Measured, the three now agree on weight, size,
|
|
218
|
+
* line-height, padding and gap.
|
|
219
|
+
*
|
|
220
|
+
* One difference remains and is not a mistake: the switch track is 24px where
|
|
221
|
+
* the box and the circle are 20px, so its row is three pixels taller.
|
|
222
|
+
*/
|
|
223
|
+
export const SelectionControls = () => html`
|
|
224
|
+
<div style="display: grid; gap: var(--spacing-24)">
|
|
225
|
+
<div>
|
|
226
|
+
${caption('unchecked')}
|
|
227
|
+
${row(html`
|
|
228
|
+
<bd-checkbox label="Checkbox"></bd-checkbox>
|
|
229
|
+
<bd-radio label="Radio" name="align-a"></bd-radio>
|
|
230
|
+
<bd-switch label="Switch"></bd-switch>
|
|
231
|
+
`)}
|
|
232
|
+
</div>
|
|
233
|
+
<div>
|
|
234
|
+
${caption('checked')}
|
|
235
|
+
${row(html`
|
|
236
|
+
<bd-checkbox label="Checkbox" checked></bd-checkbox>
|
|
237
|
+
<bd-radio label="Radio" name="align-b" checked></bd-radio>
|
|
238
|
+
<bd-switch label="Switch" checked></bd-switch>
|
|
239
|
+
`)}
|
|
240
|
+
</div>
|
|
241
|
+
<div>
|
|
242
|
+
${caption('disabled')}
|
|
243
|
+
${row(html`
|
|
244
|
+
<bd-checkbox label="Checkbox" disabled></bd-checkbox>
|
|
245
|
+
<bd-radio label="Radio" name="align-c" disabled></bd-radio>
|
|
246
|
+
<bd-switch label="Switch" disabled></bd-switch>
|
|
247
|
+
`)}
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
`;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The three atoms that report state, now sharing one vocabulary and one set of
|
|
254
|
+
* `--status-*` roles. Badge's earlier `default` and `primary` still resolve, to
|
|
255
|
+
* `neutral` and `brand`.
|
|
256
|
+
*
|
|
257
|
+
* The remaining difference between badge and tag is deliberate and documented
|
|
258
|
+
* on the tag page: a tag carries a border and sits on the lighter tint, a badge
|
|
259
|
+
* has no border and takes the heavier one — the lighter fill is what lets the
|
|
260
|
+
* tag's border read. They are two roles, `-surface` and `-surface-strong`,
|
|
261
|
+
* rather than one flattened value. Brand is the exception: its heavier tint
|
|
262
|
+
* would be info's blue-100, so a brand badge sits on the lighter tint and
|
|
263
|
+
* differs from a brand tag only by the tag's border.
|
|
264
|
+
*
|
|
265
|
+
* What to look for: the text colour of a badge and a tag of the same tone
|
|
266
|
+
* should match, and an alert's left rule should be the same colour as a badge
|
|
267
|
+
* dot of that tone. Both used to be true only by coincidence, and success was
|
|
268
|
+
* the one where it had already stopped being true.
|
|
269
|
+
*/
|
|
270
|
+
export const StatusFamily = () => html`
|
|
271
|
+
<div style="display: grid; gap: var(--spacing-24); max-width: 34rem">
|
|
272
|
+
<div>
|
|
273
|
+
${caption('badge — neutral · brand · success · warning · error · info')}
|
|
274
|
+
${row(html`
|
|
275
|
+
<bd-badge>Neutral</bd-badge>
|
|
276
|
+
<bd-badge tone="brand">Brand</bd-badge>
|
|
277
|
+
<bd-badge tone="success">Success</bd-badge>
|
|
278
|
+
<bd-badge tone="warning">Warning</bd-badge>
|
|
279
|
+
<bd-badge tone="error">Error</bd-badge>
|
|
280
|
+
<bd-badge tone="info">Info</bd-badge>
|
|
281
|
+
`)}
|
|
282
|
+
</div>
|
|
283
|
+
<div>
|
|
284
|
+
${caption('tag — neutral · brand · success · warning · error · info')}
|
|
285
|
+
${row(html`
|
|
286
|
+
<bd-tag>Neutral</bd-tag>
|
|
287
|
+
<bd-tag tone="brand">Brand</bd-tag>
|
|
288
|
+
<bd-tag tone="success">Success</bd-tag>
|
|
289
|
+
<bd-tag tone="warning">Warning</bd-tag>
|
|
290
|
+
<bd-tag tone="error">Error</bd-tag>
|
|
291
|
+
<bd-tag tone="info">Info</bd-tag>
|
|
292
|
+
`)}
|
|
293
|
+
</div>
|
|
294
|
+
<div>
|
|
295
|
+
${caption('alert — info · success · warning · error')}
|
|
296
|
+
<div style="display: grid; gap: var(--spacing-8)">
|
|
297
|
+
<bd-alert>Info</bd-alert>
|
|
298
|
+
<bd-alert tone="success">Success</bd-alert>
|
|
299
|
+
<bd-alert tone="warning">Warning</bd-alert>
|
|
300
|
+
<bd-alert tone="error">Error</bd-alert>
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
`;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* The four text atoms in one column, on one background. Each sets its own ink:
|
|
308
|
+
* heading sets none and inherits, display sets `--color-neutral-900`, paragraph
|
|
309
|
+
* sets `--color-neutral-1000` and list item sets `--color-neutral-700`. List
|
|
310
|
+
* item is also the only one not set in the sans family.
|
|
311
|
+
*/
|
|
312
|
+
export const TextInk = () => html`
|
|
313
|
+
<div style="max-width: 34rem">
|
|
314
|
+
${caption('heading · display · paragraph · list item')}
|
|
315
|
+
<bd-display variant="sm">Display</bd-display>
|
|
316
|
+
<bd-h as="h3">Heading level 3</bd-h>
|
|
317
|
+
<bd-p variant="regular">
|
|
318
|
+
A paragraph of body copy, so the ink of the running text can be compared
|
|
319
|
+
with the heading above it and the list below it.
|
|
320
|
+
</bd-p>
|
|
321
|
+
<bd-list type="unordered">
|
|
322
|
+
<bd-li variant="bullet" size="md">First list item</bd-li>
|
|
323
|
+
<bd-li variant="check" size="md">Second list item</bd-li>
|
|
324
|
+
</bd-list>
|
|
325
|
+
</div>
|
|
326
|
+
`;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Every corner radius the atom layer uses, on the atoms that use it.
|
|
330
|
+
*
|
|
331
|
+
* The scale has eight steps and there is still no written rule for which
|
|
332
|
+
* surface takes which, but the census no longer has a step used exactly once:
|
|
333
|
+
* the code block was on `--radius-3xl` (24px), the only use of the top step
|
|
334
|
+
* anywhere, and it is now on `--radius-xl` (12px). That also brought its focus
|
|
335
|
+
* ring back into the 4-12px range every other atom sits in — the ring is a
|
|
336
|
+
* box-shadow, so it takes the shape of whatever it is drawn on.
|
|
337
|
+
*/
|
|
338
|
+
export const RadiusCensus = () => html`
|
|
339
|
+
<div style="display: grid; gap: var(--spacing-24); max-width: 34rem">
|
|
340
|
+
<div>
|
|
341
|
+
${caption('radius-sm — tooltip, inline code, checkbox box, skeleton')}
|
|
342
|
+
${row(html`
|
|
343
|
+
<bd-code>--radius-sm</bd-code>
|
|
344
|
+
<bd-checkbox label="Checkbox"></bd-checkbox>
|
|
345
|
+
<div style="width: 8rem"><bd-skeleton></bd-skeleton></div>
|
|
346
|
+
`)}
|
|
347
|
+
</div>
|
|
348
|
+
<div>
|
|
349
|
+
${caption('radius-md — alert, fieldset, button md')}
|
|
350
|
+
${row(html`<bd-button size="md">Button</bd-button>`)}
|
|
351
|
+
<div style="margin-top: var(--spacing-8)"><bd-alert>Alert</bd-alert></div>
|
|
352
|
+
</div>
|
|
353
|
+
<div>
|
|
354
|
+
${caption('radius-lg — video, button lg')}
|
|
355
|
+
${row(html`<bd-button size="lg">Button</bd-button>`)}
|
|
356
|
+
</div>
|
|
357
|
+
<div>
|
|
358
|
+
${caption('radius-xl — code block')}
|
|
359
|
+
<bd-code block>npm install @repobit/dex-system-design</bd-code>
|
|
360
|
+
</div>
|
|
361
|
+
<div>
|
|
362
|
+
${caption('radius-full — badge, tag, avatar, switch, progress, spinner')}
|
|
363
|
+
${row(html`
|
|
364
|
+
<bd-badge tone="primary">Badge</bd-badge>
|
|
365
|
+
<bd-tag tone="brand">Tag</bd-tag>
|
|
366
|
+
<bd-avatar name="Ana Popescu"></bd-avatar>
|
|
367
|
+
<bd-switch label="Switch" checked></bd-switch>
|
|
368
|
+
<bd-spinner></bd-spinner>
|
|
369
|
+
`)}
|
|
370
|
+
<div style="margin-top: var(--spacing-12); width: 14rem">
|
|
371
|
+
<bd-progress value="60"></bd-progress>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
</div>
|
|
375
|
+
`;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Every atom that draws a hairline, so the border colours can be compared. Tab
|
|
379
|
+
* list uses `--color-neutral-100`, tag and fieldset `--color-neutral-200`,
|
|
380
|
+
* input and divider `--color-neutral-400` — three different answers to the same
|
|
381
|
+
* question.
|
|
382
|
+
*/
|
|
383
|
+
export const HairlineColours = () => html`
|
|
384
|
+
<div style="display: grid; gap: var(--spacing-16); max-width: 26rem">
|
|
385
|
+
${caption('tag · fieldset · input · divider')}
|
|
386
|
+
<bd-tag>neutral-200 border</bd-tag>
|
|
387
|
+
<bd-fieldset legend="neutral-200 border">
|
|
388
|
+
<bd-checkbox label="A field"></bd-checkbox>
|
|
389
|
+
</bd-fieldset>
|
|
390
|
+
<bd-custom-input label="neutral-400 border" size="md"></bd-custom-input>
|
|
391
|
+
<hr style="border: none; border-top: var(--border-width-1) solid var(--color-neutral-400); margin: 0" />
|
|
392
|
+
</div>
|
|
393
|
+
`;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
1
|
+
import { css, unsafeCSS } from "lit";
|
|
2
|
+
import { below } from "../shared/token-scales.js";
|
|
2
3
|
|
|
3
4
|
export default css`
|
|
4
5
|
:host {
|
|
5
6
|
display: block;
|
|
6
7
|
font-family: var(--typography-fontFamily-sans);
|
|
8
|
+
/* the band runs full-bleed on the host; the column inside it is bd-ensemble */
|
|
9
|
+
background: radial-gradient(1200px 600px at 78% -10%, var(--color-blue-400) 0%, transparent 55%), linear-gradient(160deg, var(--color-blue-500) 0%, var(--color-blue-700) 48%, var(--color-blue-950) 100%);
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
.bd-ctabanner-container {
|
|
10
|
-
|
|
11
|
-
padding: var(--spacing-64) var(--layout-ensemble-inline-padding, var(--spacing-24));
|
|
13
|
+
padding-block: var(--spacing-64);
|
|
12
14
|
box-sizing: border-box;
|
|
13
15
|
display: flex;
|
|
14
16
|
flex-direction: column;
|
|
@@ -17,11 +19,11 @@ export default css`
|
|
|
17
19
|
gap: var(--spacing-16);
|
|
18
20
|
}
|
|
19
21
|
.bd-ctabanner-footer {
|
|
20
|
-
margin-top: var(--spacing-24
|
|
22
|
+
margin-top: var(--spacing-24);
|
|
21
23
|
display: flex;
|
|
22
24
|
flex-direction: column;
|
|
23
25
|
align-items: center;
|
|
24
|
-
gap: var(--spacing-8
|
|
26
|
+
gap: var(--spacing-8);
|
|
25
27
|
text-align: center;
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -31,15 +33,26 @@ export default css`
|
|
|
31
33
|
.bd-ctabanner-title {
|
|
32
34
|
display: block;
|
|
33
35
|
margin: 0;
|
|
34
|
-
color: var(--color-neutral-0, #fff);
|
|
35
|
-
line-height: var(--typography-lineHeight-tight, 1.1);
|
|
36
36
|
max-width: 800px;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.bd-ctabanner-description {
|
|
40
40
|
display: block;
|
|
41
41
|
margin: 0 0 var(--spacing-16);
|
|
42
|
-
|
|
42
|
+
/* no role: translucent white, deliberately, and the translucency is doing
|
|
43
|
+
work -- it lets the gradient behind show through the text, where a flat
|
|
44
|
+
--color-text-muted-inverse would read as grey on a brand ground. No role
|
|
45
|
+
expresses white at a fraction.
|
|
46
|
+
.
|
|
47
|
+
Measured on the real gradient, not the token values: the text is hidden,
|
|
48
|
+
the ground under the glyph band is sampled from a screenshot, and the ink
|
|
49
|
+
composited over it. Worst point rgb(23,97,202) -> composites to
|
|
50
|
+
rgb(220,231,247) -> 4.67:1 at 16px/400, where the bar is 4.5. PASSES.
|
|
51
|
+
.
|
|
52
|
+
Mixed over the palette rather than written as a raw rgba, so it follows
|
|
53
|
+
--color-neutral-0 instead of nothing. Pixel-identical to the rgba it
|
|
54
|
+
replaces. */
|
|
55
|
+
color: color-mix(in srgb, var(--color-neutral-0) 85%, transparent);
|
|
43
56
|
max-width: 640px;
|
|
44
57
|
}
|
|
45
58
|
|
|
@@ -53,14 +66,29 @@ export default css`
|
|
|
53
66
|
.bd-ctabanner-caption {
|
|
54
67
|
display: block;
|
|
55
68
|
margin: var(--spacing-8) 0 0;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
69
|
+
/* no role: as the description above, and THIS ONE HAS ALMOST NO MARGIN.
|
|
70
|
+
Measured the same way -- text hidden, ground sampled under the glyph
|
|
71
|
+
band, ink composited: worst point rgb(0,61,154) -> rgb(153,177,215) ->
|
|
72
|
+
4.51:1 at 16px/400 against a 4.5 bar. It passes by 0.01.
|
|
73
|
+
.
|
|
74
|
+
So treat it as load-bearing. Darkening the gradient's light end, moving
|
|
75
|
+
this caption up the banner, or dropping the alpha any further all break
|
|
76
|
+
it, and none of those would look like an accessibility change to whoever
|
|
77
|
+
made it. If this needs to move, re-measure rather than reason: arithmetic
|
|
78
|
+
on the token values says 1.99:1 over blue-400, which is the gradient's
|
|
79
|
+
lightest stop and is NOT where this text sits.
|
|
80
|
+
.
|
|
81
|
+
Mixed over the palette; pixel-identical to the rgba it replaces. */
|
|
82
|
+
color: color-mix(in srgb, var(--color-neutral-0) 60%, transparent);
|
|
83
|
+
font-family: var(--typography-fontFamily-mono);
|
|
84
|
+
/* No font-size: this class is on a <bd-p variant="small"> host, and bd-p
|
|
85
|
+
sets font-size on its own inner element, so a host declaration never
|
|
86
|
+
reached the text -- it rendered at body-small's 14px either way. */
|
|
59
87
|
}
|
|
60
88
|
|
|
61
|
-
@media (
|
|
89
|
+
@media ${unsafeCSS(below('sm'))} {
|
|
62
90
|
.bd-ctabanner-container {
|
|
63
|
-
padding: var(--spacing-48)
|
|
91
|
+
padding-block: var(--spacing-48);
|
|
64
92
|
}
|
|
65
93
|
|
|
66
94
|
.bd-ctabanner-cta {
|
|
@@ -3,6 +3,7 @@ import { tokens } from "../../tokens/tokens.js";
|
|
|
3
3
|
import "../heading/heading.js";
|
|
4
4
|
import "../paragraph/paragraph.js";
|
|
5
5
|
import ctaBannerCSS from "./cta-banner.css.js";
|
|
6
|
+
import { ensembleCSS } from "../shared/ensemble.css.js";
|
|
6
7
|
|
|
7
8
|
class CtaBanner extends LitElement {
|
|
8
9
|
static properties = {
|
|
@@ -11,7 +12,7 @@ class CtaBanner extends LitElement {
|
|
|
11
12
|
caption : { type: String }
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
static styles = [tokens, ctaBannerCSS];
|
|
15
|
+
static styles = [tokens, ensembleCSS, ctaBannerCSS];
|
|
15
16
|
|
|
16
17
|
constructor() {
|
|
17
18
|
super();
|
|
@@ -22,10 +23,10 @@ class CtaBanner extends LitElement {
|
|
|
22
23
|
|
|
23
24
|
render() {
|
|
24
25
|
return html`
|
|
25
|
-
<div class="bd-ctabanner-container">
|
|
26
|
+
<div class="bd-ensemble bd-ctabanner-container">
|
|
26
27
|
${this.title
|
|
27
28
|
? html`
|
|
28
|
-
<bd-h as="h2" class="bd-ctabanner-title">
|
|
29
|
+
<bd-h as="h2" color="inverse" class="bd-ctabanner-title">
|
|
29
30
|
<slot name="title">${this.title}</slot>
|
|
30
31
|
</bd-h>
|
|
31
32
|
`
|
|
@@ -33,7 +34,7 @@ class CtaBanner extends LitElement {
|
|
|
33
34
|
|
|
34
35
|
${this.description
|
|
35
36
|
? html`
|
|
36
|
-
<bd-p
|
|
37
|
+
<bd-p variant="large" class="bd-ctabanner-description">
|
|
37
38
|
<slot name="description">${this.description}</slot>
|
|
38
39
|
</bd-p>
|
|
39
40
|
`
|
|
@@ -47,7 +48,7 @@ class CtaBanner extends LitElement {
|
|
|
47
48
|
${this.caption
|
|
48
49
|
? html`
|
|
49
50
|
<bd-p
|
|
50
|
-
|
|
51
|
+
variant="small"
|
|
51
52
|
class="bd-ctabanner-caption"
|
|
52
53
|
font-family="'IBM Plex Mono', ui-monospace, SFMono-Regular, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"
|
|
53
54
|
>
|