@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
|
@@ -5,10 +5,21 @@ export default css`
|
|
|
5
5
|
display: block;
|
|
6
6
|
}
|
|
7
7
|
@layer bd-components {
|
|
8
|
+
/* No vertical margin. A heading's spacing depends on what it sits above
|
|
9
|
+
and below, which this element cannot see, so it is the caller's to set —
|
|
10
|
+
through the padding and paddingBottom props, which resolve to spacing
|
|
11
|
+
steps in shared/token-scales.js. Six commented-out margin pairs used to
|
|
12
|
+
stand here recording an earlier answer; they were written with a //
|
|
13
|
+
prefix, which CSS does not recognise as a comment, so the parser was
|
|
14
|
+
discarding them through error recovery rather than honouring them.
|
|
15
|
+
|
|
16
|
+
The colour is set rather than inherited. Left to inherit, a heading took
|
|
17
|
+
whatever ink the page happened to carry, which is how bd-h, bd-display,
|
|
18
|
+
bd-p and bd-li ended up with four different blacks between them. */
|
|
8
19
|
.bd-heading {
|
|
9
20
|
margin: 0;
|
|
10
21
|
padding: 0;
|
|
11
|
-
|
|
22
|
+
color: var(--color-text-primary);
|
|
12
23
|
}
|
|
13
24
|
|
|
14
25
|
/* h1 */
|
|
@@ -18,8 +29,6 @@ export default css`
|
|
|
18
29
|
line-height: var(--typography-heading-h1-lineHeight);
|
|
19
30
|
letter-spacing: var(--typography-heading-h1-letterSpacing);
|
|
20
31
|
font-family: var(--typography-heading-h1-fontFamily);
|
|
21
|
-
// margin-bottom: var(--spacing-24);
|
|
22
|
-
// margin-top: var(--spacing-32);
|
|
23
32
|
}
|
|
24
33
|
|
|
25
34
|
/* h2 */
|
|
@@ -29,8 +38,6 @@ export default css`
|
|
|
29
38
|
line-height: var(--typography-heading-h2-lineHeight);
|
|
30
39
|
letter-spacing: var(--typography-heading-h2-letterSpacing);
|
|
31
40
|
font-family: var(--typography-heading-h2-fontFamily);
|
|
32
|
-
// margin-bottom: var(--spacing-20);
|
|
33
|
-
// margin-top: var(--spacing-28);
|
|
34
41
|
}
|
|
35
42
|
|
|
36
43
|
/* h3 */
|
|
@@ -40,8 +47,6 @@ export default css`
|
|
|
40
47
|
line-height: var(--typography-heading-h3-lineHeight);
|
|
41
48
|
letter-spacing: var(--typography-heading-h3-letterSpacing);
|
|
42
49
|
font-family: var(--typography-heading-h3-fontFamily);
|
|
43
|
-
// margin-bottom: var(--spacing-16);
|
|
44
|
-
// margin-top: var(--spacing-24);
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
/* h4 */
|
|
@@ -51,8 +56,6 @@ export default css`
|
|
|
51
56
|
line-height: var(--typography-heading-h4-lineHeight);
|
|
52
57
|
letter-spacing: var(--typography-heading-h4-letterSpacing);
|
|
53
58
|
font-family: var(--typography-heading-h4-fontFamily);
|
|
54
|
-
// margin-bottom: var(--spacing-12);
|
|
55
|
-
// margin-top: var(--spacing-20);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
/* h5 */
|
|
@@ -62,8 +65,6 @@ export default css`
|
|
|
62
65
|
line-height: var(--typography-heading-h5-lineHeight);
|
|
63
66
|
letter-spacing: var(--typography-heading-h5-letterSpacing);
|
|
64
67
|
font-family: var(--typography-heading-h5-fontFamily);
|
|
65
|
-
// margin-bottom: var(--spacing-8);
|
|
66
|
-
// margin-top: var(--spacing-16);
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
/* h6 */
|
|
@@ -73,10 +74,6 @@ export default css`
|
|
|
73
74
|
line-height: var(--typography-heading-h6-lineHeight);
|
|
74
75
|
letter-spacing: var(--typography-heading-h6-letterSpacing);
|
|
75
76
|
font-family: var(--typography-heading-h6-fontFamily);
|
|
76
|
-
// margin-bottom: var(--spacing-6);
|
|
77
|
-
// margin-top: var(--spacing-12);
|
|
78
77
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
`;
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
|
-
|
|
2
|
+
// Installs the design tokens into document scope; see src/tokens/tokens.js
|
|
3
|
+
import "../../tokens/tokens.js";
|
|
3
4
|
import headingCSS from "./heading.css.js";
|
|
5
|
+
import {
|
|
6
|
+
spacingShorthand, spacing, fontWeight, color
|
|
7
|
+
} from "../shared/token-scales.js";
|
|
4
8
|
|
|
5
9
|
export class BdH extends LitElement {
|
|
6
10
|
static properties = {
|
|
7
11
|
as : { type: String, reflect: true },
|
|
12
|
+
/**
|
|
13
|
+
* Which step of the heading type scale to render, when that has to differ
|
|
14
|
+
* from the semantic level. Defaults to following `as`, so passing nothing
|
|
15
|
+
* behaves exactly as before.
|
|
16
|
+
*
|
|
17
|
+
* The two were one axis: the tag chose the element AND the type scale, so
|
|
18
|
+
* a section that had to stop being an h1 for the document outline would
|
|
19
|
+
* have shrunk from 5xl to 4xl at the same time. Level is what the outline
|
|
20
|
+
* reads; size is what the page looks like, and they are not the same
|
|
21
|
+
* question. Accepts h1-h6 or 1-6.
|
|
22
|
+
*/
|
|
23
|
+
visualLevel : { type: String, attribute: "visual-level", reflect: true },
|
|
8
24
|
ariaLevel : { type: Number, attribute: "aria-level" },
|
|
9
25
|
padding : { type: String },
|
|
10
26
|
paddingBottom: { type: String },
|
|
@@ -15,6 +31,7 @@ export class BdH extends LitElement {
|
|
|
15
31
|
constructor() {
|
|
16
32
|
super();
|
|
17
33
|
this.as = "h1";
|
|
34
|
+
this.visualLevel = "";
|
|
18
35
|
this.ariaLevel = null;
|
|
19
36
|
this.padding = "";
|
|
20
37
|
this.paddingBottom = "";
|
|
@@ -26,46 +43,44 @@ export class BdH extends LitElement {
|
|
|
26
43
|
return ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag);
|
|
27
44
|
}
|
|
28
45
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
_getValidColor(color) {
|
|
38
|
-
if (!color) return "";
|
|
39
|
-
if (
|
|
40
|
-
color.startsWith("var(") ||
|
|
41
|
-
color.startsWith("#") ||
|
|
42
|
-
color.startsWith("rgb") ||
|
|
43
|
-
color.startsWith("hsl")
|
|
44
|
-
) {
|
|
45
|
-
return color;
|
|
46
|
-
}
|
|
47
|
-
return "";
|
|
46
|
+
/** Accepts h1-h6 or a bare 1-6, and returns "" for anything else. */
|
|
47
|
+
_normaliseLevel(value) {
|
|
48
|
+
const v = String(value ?? "").trim()
|
|
49
|
+
.toLowerCase();
|
|
50
|
+
if (this._isValidHeadingTag(v)) return v;
|
|
51
|
+
return /^[1-6]$/.test(v) ? `h${v}` : "";
|
|
48
52
|
}
|
|
49
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Each prop is a step name, resolved to a token reference by
|
|
56
|
+
* shared/token-scales.js. A value that is not on its scale is dropped, so
|
|
57
|
+
* the heading keeps the styling its own CSS gives it.
|
|
58
|
+
*/
|
|
50
59
|
_computeStyles() {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (this.paddingBottom) styles.push(`padding-bottom: ${this.paddingBottom};`);
|
|
58
|
-
if (validFontWeight) styles.push(`font-weight: ${validFontWeight};`);
|
|
59
|
-
if (validColor) styles.push(`color: ${validColor};`);
|
|
60
|
+
const declarations = [
|
|
61
|
+
["padding", spacingShorthand(this.padding)],
|
|
62
|
+
["padding-bottom", spacing(this.paddingBottom)],
|
|
63
|
+
["font-weight", fontWeight(this.fontWeight)],
|
|
64
|
+
["color", color(this.color)]
|
|
65
|
+
];
|
|
60
66
|
|
|
61
|
-
return
|
|
67
|
+
return declarations
|
|
68
|
+
.filter(([, value]) => value)
|
|
69
|
+
.map(([property, value]) => `${property}: ${value};`)
|
|
70
|
+
.join(" ");
|
|
62
71
|
}
|
|
63
72
|
|
|
64
73
|
|
|
65
74
|
render() {
|
|
66
|
-
|
|
75
|
+
/* An unrecognised `as` used to fall back to h1, so a typo produced a
|
|
76
|
+
page-level heading in a component that had no business owning one --
|
|
77
|
+
the loudest possible thing to get wrong silently. It falls back to h2
|
|
78
|
+
now: still a heading, never the page's. A missing `as` is unaffected,
|
|
79
|
+
because the property defaults to h1 and h1 is valid. */
|
|
80
|
+
const tag = this._normaliseLevel(this.as) || "h2";
|
|
81
|
+
const visual = this._normaliseLevel(this.visualLevel) || tag;
|
|
67
82
|
const element = document.createElement(tag);
|
|
68
|
-
element.className = `bd-heading ${
|
|
83
|
+
element.className = `bd-heading ${visual}`;
|
|
69
84
|
if (this.ariaLevel) element.setAttribute("aria-level", this.ariaLevel);
|
|
70
85
|
|
|
71
86
|
const styles = this._computeStyles();
|
|
@@ -76,7 +91,7 @@ export class BdH extends LitElement {
|
|
|
76
91
|
}
|
|
77
92
|
|
|
78
93
|
|
|
79
|
-
static styles = [
|
|
94
|
+
static styles = [headingCSS];
|
|
80
95
|
}
|
|
81
96
|
|
|
82
97
|
customElements.define("bd-h", BdH);
|
|
@@ -2,7 +2,7 @@ import { html } from 'lit';
|
|
|
2
2
|
import './heading.js';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title : '
|
|
5
|
+
title : 'Atoms/Heading',
|
|
6
6
|
tags : ['autodocs'],
|
|
7
7
|
parameters: {
|
|
8
8
|
docs: {
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
### Usage
|
|
14
14
|
\`\`\`html
|
|
15
15
|
<bd-h as="h1">Page Title</bd-h>
|
|
16
|
-
<bd-h as="h3" color="
|
|
16
|
+
<bd-h as="h3" color="primary" fontWeight="bold" paddingBottom="16">Section Title</bd-h>
|
|
17
17
|
\`\`\`
|
|
18
18
|
|
|
19
19
|
### Valid Heading Tags
|
|
@@ -45,23 +45,26 @@ export default {
|
|
|
45
45
|
},
|
|
46
46
|
padding: {
|
|
47
47
|
control : 'text',
|
|
48
|
-
description: '
|
|
48
|
+
description: 'One to four spacing steps, e.g. `10 0`. Each part resolves to `var(--spacing-N)`; if any part is off the scale the whole value is dropped.',
|
|
49
49
|
table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Spacing' }
|
|
50
50
|
},
|
|
51
51
|
paddingBottom: {
|
|
52
|
-
control
|
|
53
|
-
|
|
52
|
+
control: { type: 'select' },
|
|
53
|
+
options: ['', ...['0', '1', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24',
|
|
54
|
+
'28', '32', '36', '40', '44', '48', '52', '56', '64', '80', '96', '112', '128']],
|
|
55
|
+
description: 'A spacing step. Resolves to `var(--spacing-N)`.',
|
|
54
56
|
table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Spacing' }
|
|
55
57
|
},
|
|
56
58
|
fontWeight: {
|
|
57
59
|
control : { type: 'select' },
|
|
58
|
-
options : ['', '
|
|
59
|
-
description: '
|
|
60
|
+
options : ['', 'light', 'normal', 'medium', 'semibold', 'bold'],
|
|
61
|
+
description: 'A weight step. Resolves to `var(--typography-fontWeight-*)`. The scale stops at `bold` (700) — there is no 800 or 900.',
|
|
60
62
|
table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Typography' }
|
|
61
63
|
},
|
|
62
64
|
color: {
|
|
63
|
-
control : '
|
|
64
|
-
|
|
65
|
+
control : { type: 'select' },
|
|
66
|
+
options : ['', ...['primary', 'strong', 'muted', 'subtle', 'inverse', 'success', 'warning', 'error']],
|
|
67
|
+
description: 'A semantic colour role, not a CSS colour. Resolves to a palette token; anything else is dropped.',
|
|
65
68
|
table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Typography' }
|
|
66
69
|
}
|
|
67
70
|
}
|
|
@@ -108,10 +111,10 @@ export const CustomColor = {
|
|
|
108
111
|
name : 'Custom Color',
|
|
109
112
|
render: () => html`
|
|
110
113
|
<div style="display:flex; flex-direction:column; gap:12px;">
|
|
111
|
-
<bd-h as="h2" color="
|
|
112
|
-
<bd-h as="h2" color="
|
|
113
|
-
<bd-h as="h2" color="
|
|
114
|
-
<bd-h as="h2" color="var(--color-neutral-
|
|
114
|
+
<bd-h as="h2" color="primary">primary — var(--color-blue-600)</bd-h>
|
|
115
|
+
<bd-h as="h2" color="error">error — var(--color-red-700)</bd-h>
|
|
116
|
+
<bd-h as="h2" color="success">success — var(--color-green-800)</bd-h>
|
|
117
|
+
<bd-h as="h2" color="strong">strong — var(--color-neutral-900)</bd-h>
|
|
115
118
|
</div>
|
|
116
119
|
`,
|
|
117
120
|
parameters: { docs: { description: { story: 'Headings with hex colors and a CSS variable token. Bare color names like "blue" are rejected by `_getValidColor()`.' } } }
|
|
@@ -121,12 +124,11 @@ export const FontWeights = {
|
|
|
121
124
|
name : 'Font Weights',
|
|
122
125
|
render: () => html`
|
|
123
126
|
<div style="display:flex; flex-direction:column; gap:8px;">
|
|
124
|
-
<bd-h as="h3" fontWeight="
|
|
125
|
-
<bd-h as="h3" fontWeight="
|
|
126
|
-
<bd-h as="h3" fontWeight="
|
|
127
|
-
<bd-h as="h3" fontWeight="
|
|
128
|
-
<bd-h as="h3" fontWeight="
|
|
129
|
-
<bd-h as="h3" fontWeight="900">Black (900)</bd-h>
|
|
127
|
+
<bd-h as="h3" fontWeight="light">light (300)</bd-h>
|
|
128
|
+
<bd-h as="h3" fontWeight="normal">normal (400)</bd-h>
|
|
129
|
+
<bd-h as="h3" fontWeight="medium">medium (500)</bd-h>
|
|
130
|
+
<bd-h as="h3" fontWeight="semibold">semibold (600)</bd-h>
|
|
131
|
+
<bd-h as="h3" fontWeight="bold">bold (700)</bd-h>
|
|
130
132
|
</div>
|
|
131
133
|
`,
|
|
132
134
|
parameters: { docs: { description: { story: 'Various font weights from light (300) to black (900). Invalid weights like "purple" are silently ignored.' } } }
|
|
@@ -136,10 +138,10 @@ export const CustomPadding = {
|
|
|
136
138
|
name : 'Custom Padding',
|
|
137
139
|
render: () => html`
|
|
138
140
|
<div style="outline:1px solid #eee; display:inline-block;">
|
|
139
|
-
<bd-h as="h3" padding="
|
|
141
|
+
<bd-h as="h3" padding="24 40">With Full Padding</bd-h>
|
|
140
142
|
</div>
|
|
141
143
|
<div style="outline:1px solid #eee; display:inline-block; margin-top:16px;">
|
|
142
|
-
<bd-h as="h3" paddingBottom="
|
|
144
|
+
<bd-h as="h3" paddingBottom="32">With Padding Bottom Only</bd-h>
|
|
143
145
|
</div>
|
|
144
146
|
`,
|
|
145
147
|
parameters: { docs: { description: { story: 'Demonstrates `padding` shorthand and `paddingBottom` applied inline.' } } }
|
|
@@ -151,7 +153,7 @@ export const AriaLevelOverride = {
|
|
|
151
153
|
<p style="font-size:14px; margin-bottom:8px;">
|
|
152
154
|
Visually renders as <code>h4</code> but has <code>aria-level="2"</code>.
|
|
153
155
|
</p>
|
|
154
|
-
<bd-h as="h4" aria-level="2" color="
|
|
156
|
+
<bd-h as="h4" aria-level="2" color="primary">
|
|
155
157
|
Visually h4, semantically level 2
|
|
156
158
|
</bd-h>
|
|
157
159
|
`,
|
|
@@ -169,8 +171,8 @@ export const InvalidTag = {
|
|
|
169
171
|
export const InvalidColor = {
|
|
170
172
|
name : 'Invalid Color (silently ignored)',
|
|
171
173
|
render: () => html`
|
|
172
|
-
<bd-h as="h3" color="blue">
|
|
173
|
-
<bd-h as="h3" color="
|
|
174
|
+
<bd-h as="h3" color="blue">A bare CSS keyword is not a role, so it is dropped and the heading keeps its own colour</bd-h>
|
|
175
|
+
<bd-h as="h3" color="primary">color="primary" resolves to var(--color-blue-600)</bd-h>
|
|
174
176
|
`,
|
|
175
177
|
parameters: { docs: { description: { story: 'Bare color name `"blue"` is rejected by `_getValidColor()` and falls back to the default color. `"#026DFF"` is accepted.' } } }
|
|
176
178
|
};
|
|
@@ -178,7 +180,7 @@ export const InvalidColor = {
|
|
|
178
180
|
export const Combined = {
|
|
179
181
|
name : 'Combined Props',
|
|
180
182
|
render: () => html`
|
|
181
|
-
<bd-h as="h2" color="
|
|
183
|
+
<bd-h as="h2" color="primary" fontWeight="bold" paddingBottom="16">
|
|
182
184
|
World-class security software
|
|
183
185
|
</bd-h>
|
|
184
186
|
`,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
/** Styled entirely from design tokens — see npm run lint:tokens. */
|
|
4
|
+
export const helpTextCSS = css`
|
|
5
|
+
:host { display: block; margin-top: var(--form-help-text-default-marginTop); }
|
|
6
|
+
|
|
7
|
+
p {
|
|
8
|
+
margin: 0;
|
|
9
|
+
font-family: var(--form-help-text-default-fontFamily);
|
|
10
|
+
font-size: var(--form-help-text-default-fontSize);
|
|
11
|
+
font-weight: var(--form-help-text-default-fontWeight);
|
|
12
|
+
line-height: var(--form-help-text-default-lineHeight);
|
|
13
|
+
letter-spacing: var(--form-help-text-default-letterSpacing);
|
|
14
|
+
color: var(--form-help-text-default-color);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host([tone='error']) p { color: var(--form-help-text-error-color); }
|
|
18
|
+
:host([tone='success']) p { color: var(--form-help-text-success-color); }
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export default helpTextCSS;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from 'lit';
|
|
2
|
+
// Installs the design tokens into document scope; see src/tokens/tokens.js
|
|
3
|
+
import '../../tokens/tokens.js';
|
|
4
|
+
import { helpTextCSS } from './help-text.css.js';
|
|
5
|
+
|
|
6
|
+
export class BdHelpText extends LitElement {
|
|
7
|
+
static styles = [helpTextCSS];
|
|
8
|
+
|
|
9
|
+
static properties = {
|
|
10
|
+
tone: { type: String, reflect: true }
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.tone = 'default';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
render() {
|
|
19
|
+
return html`
|
|
20
|
+
<p role=${this.tone === 'error' ? 'alert' : nothing}><slot></slot></p>
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
customElements.define('bd-help-text', BdHelpText);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import './help-text.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title : 'Atoms/Help Text',
|
|
6
|
+
tags : ['autodocs'],
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: `
|
|
11
|
+
**BdHelpText** is the small line under a form field — a hint, a format
|
|
12
|
+
requirement, or a validation message.
|
|
13
|
+
|
|
14
|
+
### Usage
|
|
15
|
+
\`\`\`html
|
|
16
|
+
<bd-label for="pw">Password</bd-label>
|
|
17
|
+
<input id="pw" type="password">
|
|
18
|
+
<bd-help-text>At least 12 characters.</bd-help-text>
|
|
19
|
+
|
|
20
|
+
<bd-help-text tone="error">That password is too short.</bd-help-text>
|
|
21
|
+
<bd-help-text tone="success">Strong password.</bd-help-text>
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
### Props
|
|
25
|
+
| Prop | Values | Default |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| \`tone\` | \`default\`, \`success\`, \`error\` | \`default\` |
|
|
28
|
+
|
|
29
|
+
### Accessibility
|
|
30
|
+
\`tone="error"\` adds \`role="alert"\`, so a validation message is announced as
|
|
31
|
+
soon as it appears. The other tones are silent, which is right for a static
|
|
32
|
+
hint that is read as part of the field.
|
|
33
|
+
|
|
34
|
+
**Connect it to the field yourself.** This element does not wire up
|
|
35
|
+
\`aria-describedby\`, so give the help text an \`id\` and point the input at it —
|
|
36
|
+
otherwise a screen reader user reaches the field with no idea the hint exists:
|
|
37
|
+
|
|
38
|
+
\`\`\`html
|
|
39
|
+
<input id="pw" aria-describedby="pw-hint">
|
|
40
|
+
<bd-help-text id="pw-hint">At least 12 characters.</bd-help-text>
|
|
41
|
+
\`\`\`
|
|
42
|
+
`
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
argTypes: {
|
|
47
|
+
tone: {
|
|
48
|
+
control : { type: 'select' },
|
|
49
|
+
options : ['default', 'success', 'error'],
|
|
50
|
+
description: 'Which kind of message. `error` also announces itself via role="alert".',
|
|
51
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: "default" }, category: 'Appearance' }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Default = () => html`
|
|
57
|
+
<bd-help-text>We only use this for your licence key.</bd-help-text>
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
export const Error = () => html`
|
|
61
|
+
<bd-help-text tone="error">Enter a valid email address.</bd-help-text>
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
export const Success = () => html`
|
|
65
|
+
<bd-help-text tone="success">Looks good.</bd-help-text>
|
|
66
|
+
`;
|
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
1
|
+
import { css, unsafeCSS } from "lit";
|
|
2
|
+
/* unsafeCSS is how a Lit css`` template accepts a computed string. The
|
|
3
|
+
value is not arbitrary: below() resolves a name from the closed
|
|
4
|
+
breakpoint set and throws on anything else, so the only strings that
|
|
5
|
+
reach here are the ones the scale produced. */
|
|
6
|
+
import { below } from "../shared/token-scales.js";
|
|
2
7
|
|
|
3
8
|
export default css`
|
|
4
9
|
:host {
|
|
5
10
|
display: block;
|
|
11
|
+
/* No type on this host. The headline is a bd-h and the sub-title a bd-p, and
|
|
12
|
+
each atom sets size, weight and leading on its own inner element, so a
|
|
13
|
+
weight, a size and a leading declared here reached no character of either.
|
|
14
|
+
Proved by forcing this host to 70px/5/100 in all three stories and watching
|
|
15
|
+
.bd-heading hold its heading-h3 role and the sub-title hold body-small,
|
|
16
|
+
whatever those roles currently resolve to — 32/41.6/600 and 14/20.3/400
|
|
17
|
+
when this was last measured, after the leading was derived from the font.
|
|
18
|
+
The numbers move with the roles; the point is that neither budged. The
|
|
19
|
+
.highlight-text spans are slotted into the bd-h, so they inherit through
|
|
20
|
+
the flattened tree from .bd-heading too. text-align stays: neither atom
|
|
21
|
+
sets it, so it does inherit through. */
|
|
6
22
|
font-family: var(--typography-fontFamily-sans);
|
|
7
|
-
font-weight: var(--typography-heading-h1-fontWeight);
|
|
8
|
-
font-size: var(--typography-fontSize-3xl);
|
|
9
|
-
line-height: 1.3;
|
|
10
23
|
text-align: center;
|
|
11
|
-
color:
|
|
24
|
+
color: var(--color-text-primary);
|
|
25
|
+
/* no token: a centred title measure, deliberately narrower than the page
|
|
26
|
+
column (--layout-ensemble-max-width); nothing on the scale sits between
|
|
27
|
+
--content-width-readable and that column */
|
|
12
28
|
max-width: 820px;
|
|
13
29
|
margin: 0 auto;
|
|
14
|
-
// padding-top: var(--spacing-64)
|
|
15
30
|
}
|
|
16
31
|
|
|
17
32
|
.sub-title {
|
|
18
|
-
color:
|
|
19
|
-
font-family: var(--typography-fontFamily-sans);
|
|
20
|
-
font-weight: var(--typography-body-large-fontWeight);
|
|
21
|
-
font-size: 20px;
|
|
33
|
+
color: var(--color-text-brand);
|
|
22
34
|
margin: 0 0 var(--spacing-24) 0;
|
|
23
35
|
}
|
|
24
36
|
|
|
@@ -28,103 +40,113 @@ export default css`
|
|
|
28
40
|
|
|
29
41
|
.highlight {
|
|
30
42
|
display: inline;
|
|
31
|
-
background:
|
|
32
|
-
color:
|
|
33
|
-
|
|
43
|
+
background: var(--color-surface-info);
|
|
44
|
+
color: var(--color-text-primary);
|
|
45
|
+
/* The three rungs of the ladder this atom stacks its own internals on:
|
|
46
|
+
the tint sits below the line, the text on it, the decorations above. */
|
|
47
|
+
z-index: var(--z-below);
|
|
34
48
|
position: relative;
|
|
35
|
-
margin-left: calc(var(--spacing-4)
|
|
36
|
-
margin-right: var(--spacing-
|
|
49
|
+
margin-left: calc(-1 * var(--spacing-4));
|
|
50
|
+
margin-right: calc(-1 * var(--spacing-4));
|
|
37
51
|
}
|
|
38
52
|
|
|
39
53
|
.highlight-text {
|
|
40
|
-
position: relative;
|
|
41
|
-
z-index:
|
|
54
|
+
position: relative;
|
|
55
|
+
z-index: var(--z-base);
|
|
42
56
|
padding-left: var(--spacing-4);
|
|
43
|
-
padding-right:
|
|
57
|
+
padding-right: var(--spacing-4);
|
|
44
58
|
box-decoration-break: clone;
|
|
45
59
|
-webkit-box-decoration-break: clone;
|
|
46
60
|
}
|
|
47
61
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
/* Empty and inline on purpose: it takes the same content box as the text
|
|
63
|
+
beside it and has no width to break, so it rides along to whichever line
|
|
64
|
+
its end of the phrase lands on. An absolutely positioned child of
|
|
65
|
+
.highlight itself resolves against a single line fragment, which is why
|
|
66
|
+
both decorations piled onto the first line when the phrase wrapped. */
|
|
67
|
+
.highlight-anchor {
|
|
53
68
|
position: relative;
|
|
54
|
-
margin-left: -12px;
|
|
55
|
-
|
|
56
69
|
}
|
|
57
70
|
|
|
58
71
|
.highlight-deco {
|
|
72
|
+
/* Local so the two insets below derive from the box rather than restating
|
|
73
|
+
a number per breakpoint. The bar is centred in this box, so pulling the
|
|
74
|
+
box out by half its spare width lands the bar on the background edge. */
|
|
75
|
+
--bd-highlight-deco-width: var(--spacing-8);
|
|
76
|
+
--bd-highlight-deco-inset: calc(
|
|
77
|
+
-1 * (var(--bd-highlight-deco-width) - var(--spacing-2)) / 2
|
|
78
|
+
);
|
|
79
|
+
|
|
59
80
|
position: absolute;
|
|
60
|
-
width: var(--
|
|
61
|
-
height: 46px;
|
|
81
|
+
width: var(--bd-highlight-deco-width);
|
|
62
82
|
display: flex;
|
|
63
83
|
flex-direction: column;
|
|
64
84
|
align-items: center;
|
|
65
85
|
justify-content: flex-start;
|
|
66
86
|
pointer-events: none;
|
|
67
|
-
z-index:
|
|
87
|
+
z-index: var(--z-raised);
|
|
68
88
|
}
|
|
69
89
|
|
|
70
90
|
.highlight-deco.left {
|
|
71
|
-
left: -
|
|
72
|
-
top: -
|
|
91
|
+
left: var(--bd-highlight-deco-inset);
|
|
92
|
+
top: calc(-1 * var(--spacing-4));
|
|
93
|
+
bottom: 0;
|
|
73
94
|
}
|
|
74
95
|
|
|
96
|
+
/* Mirrors .left against the other edge of the same box. It used to be
|
|
97
|
+
positioned against a 1px anchor span whose distance from that edge changed
|
|
98
|
+
with the surrounding text, which is why the bar drifted clear of the
|
|
99
|
+
background when the highlight was the last word. */
|
|
75
100
|
.highlight-deco.right {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
101
|
+
right: var(--bd-highlight-deco-inset);
|
|
102
|
+
top: 0;
|
|
103
|
+
bottom: calc(-1 * var(--spacing-4));
|
|
79
104
|
}
|
|
80
105
|
|
|
106
|
+
/* no token: the brand decoration mark. blue-500 is the right step but no
|
|
107
|
+
role names it — --color-border-brand is a border, --status-brand-fill is a
|
|
108
|
+
chip background, and neither is an ornament. This needs a decoration role
|
|
109
|
+
before it can be spelled as one; inventing one for a single consumer is
|
|
110
|
+
what the token layer is trying to stop. */
|
|
81
111
|
.highlight-svg-rect {
|
|
82
112
|
width: var(--spacing-2);
|
|
83
|
-
|
|
84
|
-
|
|
113
|
+
/* whatever the dot leaves, so the bar always ends on the background edge */
|
|
114
|
+
flex: 1;
|
|
115
|
+
/* no role: the deco bar, same decision as the ellipses below -- ornament flanking the
|
|
116
|
+
highlighted text, not a mark, so an ink role is the wrong family. 4.20:1 against
|
|
117
|
+
the blue-50 ground, over the 3:1 non-text bar. */
|
|
118
|
+
fill: var(--color-blue-500);
|
|
85
119
|
margin: 0;
|
|
86
120
|
display: block;
|
|
87
121
|
}
|
|
88
122
|
|
|
89
123
|
.highlight-svg-ellipse-top,
|
|
90
124
|
.highlight-svg-ellipse-bottom {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
125
|
+
flex: none;
|
|
126
|
+
width: var(--bd-highlight-deco-width);
|
|
127
|
+
height: var(--bd-highlight-deco-width);
|
|
128
|
+
/* no role: the two deco ellipses. These are ORNAMENT, not a mark and not a glyph in
|
|
129
|
+
a text flow -- highlight.js puts them inside <span class="highlight-deco left|right">
|
|
130
|
+
flanking <span class="highlight-text">, a bracket construct drawn around the
|
|
131
|
+
highlighted words. Every icon role candidate in this package is an INK role, and
|
|
132
|
+
ink is the wrong family for a bracket: naming one here would misdescribe these the
|
|
133
|
+
way calling the terminal's line-kind blues "brand" would have. They pass their bar
|
|
134
|
+
already -- 4.20:1 against the blue-50 ground, where 3:1 is the non-text minimum.
|
|
135
|
+
See plans/reports/phase-2-vocab-b-icon-colour.md. */
|
|
136
|
+
fill: var(--color-blue-500);
|
|
94
137
|
display: block;
|
|
95
138
|
}
|
|
96
139
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.highlight {
|
|
103
|
-
margin-right: var(--spacing-2);
|
|
104
|
-
}
|
|
140
|
+
/* Narrower than sm. A media condition cannot read a custom property, so
|
|
141
|
+
below() interpolates the value; 600px was on no scale at all, and the
|
|
142
|
+
576px that replaced it still matched at exactly 576px, where sm begins. */
|
|
143
|
+
@media ${unsafeCSS(below('sm'))} {
|
|
105
144
|
|
|
106
145
|
.highlight-deco {
|
|
107
|
-
|
|
108
|
-
width: var(--spacing-6);
|
|
146
|
+
--bd-highlight-deco-width: var(--spacing-6);
|
|
109
147
|
}
|
|
110
148
|
|
|
111
|
-
.highlight-svg-rect {
|
|
112
|
-
var(--spacing-24);
|
|
113
|
-
}
|
|
114
149
|
|
|
115
|
-
.highlight-svg-ellipse-top,
|
|
116
|
-
.highlight-svg-ellipse-bottom {
|
|
117
|
-
width: var(--spacing-6);
|
|
118
|
-
height: var(--spacing-6);
|
|
119
|
-
}
|
|
120
|
-
.highlight-deco.right {
|
|
121
|
-
bottom: 0;
|
|
122
|
-
left: 3px;
|
|
123
|
-
top: -6px;
|
|
124
|
-
}
|
|
125
|
-
.highlight-text{
|
|
126
|
-
padding-right: 3px;
|
|
127
|
-
}
|
|
128
150
|
}
|
|
129
151
|
|
|
130
152
|
`;
|