@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
|
@@ -1,10 +1,19 @@
|
|
|
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";
|
|
4
|
+
import {
|
|
5
|
+
spacing, spacingShorthand, fontFamily, fontWeight, fontSize, letterSpacing, color
|
|
6
|
+
} from "../shared/token-scales.js";
|
|
3
7
|
import paragraphCSS from "./paragraph.css.js";
|
|
4
8
|
|
|
9
|
+
/** The five body roles the stylesheet carries. */
|
|
10
|
+
const VARIANTS = ["xsmall", "small", "regular", "large", "lead"];
|
|
11
|
+
|
|
5
12
|
export class BdP extends LitElement {
|
|
6
13
|
static properties = {
|
|
7
|
-
|
|
14
|
+
variant : { type: String, reflect: true },
|
|
15
|
+
/** @deprecated pass `variant`. */
|
|
16
|
+
kind : { type: String },
|
|
8
17
|
padding : { type: String },
|
|
9
18
|
paddingBottom: { type: String },
|
|
10
19
|
paddingTop : { type: String },
|
|
@@ -17,7 +26,8 @@ export class BdP extends LitElement {
|
|
|
17
26
|
|
|
18
27
|
constructor() {
|
|
19
28
|
super();
|
|
20
|
-
this.
|
|
29
|
+
this.variant = "regular";
|
|
30
|
+
this.kind = "";
|
|
21
31
|
this.padding = "";
|
|
22
32
|
this.paddingBottom = "";
|
|
23
33
|
this.paddingTop = "";
|
|
@@ -28,58 +38,45 @@ export class BdP extends LitElement {
|
|
|
28
38
|
this.color = "";
|
|
29
39
|
}
|
|
30
40
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
case "regular":
|
|
36
|
-
return "bd-paragraph--regular";
|
|
37
|
-
case "large":
|
|
38
|
-
return "bd-paragraph--large";
|
|
39
|
-
default:
|
|
40
|
-
return "bd-paragraph--regular";
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Same validation as bd-h's _getValidColor — only accepts CSS token
|
|
45
|
-
// references or real colour syntax, so a typo or stray text never lands
|
|
46
|
-
// in the inline style attribute as literal (and potentially unsafe) CSS.
|
|
47
|
-
_getValidColor(color) {
|
|
48
|
-
if (!color) return "";
|
|
49
|
-
if (
|
|
50
|
-
color.startsWith("var(") ||
|
|
51
|
-
color.startsWith("#") ||
|
|
52
|
-
color.startsWith("rgb") ||
|
|
53
|
-
color.startsWith("hsl")
|
|
54
|
-
) {
|
|
55
|
-
return color;
|
|
41
|
+
willUpdate(changed) {
|
|
42
|
+
if (changed.has("kind") && this.kind) this.variant = this.kind;
|
|
43
|
+
if (changed.has("variant") || changed.has("kind")) {
|
|
44
|
+
if (!VARIANTS.includes(this.variant)) this.variant = "regular";
|
|
56
45
|
}
|
|
57
|
-
return "";
|
|
58
46
|
}
|
|
59
47
|
|
|
60
48
|
render() {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
49
|
+
// Step names, resolved to token references by shared/token-scales.js. The
|
|
50
|
+
// three spacing props took raw CSS lengths before, which is the one thing
|
|
51
|
+
// the foundation rule forbids.
|
|
52
|
+
//
|
|
53
|
+
// fontFamily and fontWeight were declared here and in the manifest and
|
|
54
|
+
// then never applied — every value passed to them was silently dropped,
|
|
55
|
+
// so bd-terminal-message asked four paragraphs for mono and got sans.
|
|
56
|
+
// They resolve through the same closed sets as everything else, so
|
|
57
|
+
// font-family takes "sans" or "mono" rather than a CSS font stack.
|
|
58
|
+
//
|
|
59
|
+
// fontSize, letterSpacing and color arrived from main as raw CSS; they take
|
|
60
|
+
// a font-size step, a letter-spacing step and a COLOR_ROLES name.
|
|
61
|
+
const styles = [
|
|
62
|
+
["padding", spacingShorthand(this.padding)],
|
|
63
|
+
["padding-bottom", spacing(this.paddingBottom)],
|
|
64
|
+
["padding-top", spacing(this.paddingTop)],
|
|
65
|
+
["font-family", fontFamily(this.fontFamily)],
|
|
66
|
+
["font-weight", fontWeight(this.fontWeight)],
|
|
67
|
+
["font-size", fontSize(this.fontSize)],
|
|
68
|
+
["letter-spacing", letterSpacing(this.letterSpacing)],
|
|
69
|
+
["color", color(this.color)]
|
|
70
|
+
].filter(([, v]) => v).map(([prop, v]) => `${prop}: ${v};`);
|
|
74
71
|
|
|
75
72
|
return html`
|
|
76
|
-
<p class="bd-paragraph
|
|
73
|
+
<p class="bd-paragraph" style="${styles.join(' ')}">
|
|
77
74
|
<slot></slot>
|
|
78
75
|
</p>
|
|
79
76
|
`;
|
|
80
77
|
}
|
|
81
78
|
|
|
82
|
-
static styles = [
|
|
79
|
+
static styles = [paragraphCSS];
|
|
83
80
|
}
|
|
84
81
|
|
|
85
82
|
customElements.define("bd-p", BdP);
|
|
@@ -2,29 +2,45 @@ import { html } from 'lit';
|
|
|
2
2
|
import './paragraph.js';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title : '
|
|
5
|
+
title : 'Atoms/Paragraph',
|
|
6
6
|
tags : ['autodocs'],
|
|
7
7
|
parameters: {
|
|
8
8
|
docs: {
|
|
9
9
|
description: {
|
|
10
10
|
component: `
|
|
11
|
-
**BdP** is a Lit paragraph component that renders a \`<p>\` tag with
|
|
11
|
+
**BdP** is a Lit paragraph component that renders a \`<p>\` tag with variant-based typography styling.
|
|
12
12
|
|
|
13
13
|
### Usage
|
|
14
14
|
\`\`\`html
|
|
15
|
-
<bd-p
|
|
16
|
-
<bd-p
|
|
17
|
-
<bd-p
|
|
15
|
+
<bd-p variant="large">Large paragraph text</bd-p>
|
|
16
|
+
<bd-p variant="regular">Regular body text</bd-p>
|
|
17
|
+
<bd-p variant="small">Small supporting text</bd-p>
|
|
18
18
|
\`\`\`
|
|
19
19
|
|
|
20
20
|
### Kind Values
|
|
21
|
-
The \`
|
|
21
|
+
The \`variant\` attribute is reflected and used as a CSS selector for typography styling:
|
|
22
22
|
| Kind | Use case |
|
|
23
23
|
|---|---|
|
|
24
24
|
| \`large\` | Lead text, intro paragraphs |
|
|
25
25
|
| \`regular\` | Default body text |
|
|
26
26
|
| \`small\` | Captions, disclaimers, supporting text |
|
|
27
27
|
|
|
28
|
+
### Spacing
|
|
29
|
+
\`padding\`, \`paddingBottom\` and \`paddingTop\` take **spacing step names, not
|
|
30
|
+
CSS lengths**:
|
|
31
|
+
|
|
32
|
+
\`\`\`html
|
|
33
|
+
<bd-p paddingBottom="16">Body text with 16px below.</bd-p>
|
|
34
|
+
<bd-p padding="12 0">Twelve above and below, none at the sides.</bd-p>
|
|
35
|
+
\`\`\`
|
|
36
|
+
|
|
37
|
+
Each step resolves to \`var(--spacing-N)\`. \`padding\` accepts one to four steps
|
|
38
|
+
as a shorthand, and if any part is off the scale the whole value is dropped
|
|
39
|
+
rather than half-applied. Passing \`16px\` does nothing.
|
|
40
|
+
|
|
41
|
+
Reach for these sparingly — spacing between paragraphs usually belongs to the
|
|
42
|
+
layout around them, not to the paragraph itself.
|
|
43
|
+
|
|
28
44
|
### Notes
|
|
29
45
|
- Content is passed via \`<slot>\`
|
|
30
46
|
- Supports rich HTML content inside the slot (strong, em, a, etc.)
|
|
@@ -33,11 +49,30 @@ The \`kind\` attribute is reflected and used as a CSS selector for typography st
|
|
|
33
49
|
}
|
|
34
50
|
},
|
|
35
51
|
argTypes: {
|
|
36
|
-
|
|
52
|
+
variant: {
|
|
37
53
|
control : { type: 'select' },
|
|
38
54
|
options : ['large', 'regular', 'small'],
|
|
39
55
|
description: 'Typography size variant, reflected as an attribute for CSS targeting',
|
|
40
56
|
table : { type: { summary: "'large'|'regular'|'small'" }, defaultValue: { summary: 'regular' }, category: 'Appearance' }
|
|
57
|
+
},
|
|
58
|
+
padding: {
|
|
59
|
+
control : 'text',
|
|
60
|
+
description: 'One to four spacing steps, e.g. `12 0`. Each part resolves to `var(--spacing-N)`; if any part is off the scale the whole value is dropped.',
|
|
61
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: "''" }, category: 'Spacing' }
|
|
62
|
+
},
|
|
63
|
+
paddingBottom: {
|
|
64
|
+
control: { type: 'select' },
|
|
65
|
+
options: ['', '0', '1', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24',
|
|
66
|
+
'28', '32', '36', '40', '44', '48', '52', '56', '64', '80', '96', '112', '128'],
|
|
67
|
+
description: 'A spacing step. Resolves to `var(--spacing-N)`.',
|
|
68
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: "''" }, category: 'Spacing' }
|
|
69
|
+
},
|
|
70
|
+
paddingTop: {
|
|
71
|
+
control: { type: 'select' },
|
|
72
|
+
options: ['', '0', '1', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24',
|
|
73
|
+
'28', '32', '36', '40', '44', '48', '52', '56', '64', '80', '96', '112', '128'],
|
|
74
|
+
description: 'A spacing step. Resolves to `var(--spacing-N)`.',
|
|
75
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: "''" }, category: 'Spacing' }
|
|
41
76
|
}
|
|
42
77
|
}
|
|
43
78
|
};
|
|
@@ -48,7 +83,7 @@ const sampleText = 'Bitdefender delivers award-winning cybersecurity to over 500
|
|
|
48
83
|
|
|
49
84
|
export const Default = {
|
|
50
85
|
name : 'Default (Regular)',
|
|
51
|
-
render : () => html`<bd-p
|
|
86
|
+
render : () => html`<bd-p variant="regular">${sampleText}</bd-p>`,
|
|
52
87
|
parameters: { docs: { description: { story: 'Default regular paragraph.' } } }
|
|
53
88
|
};
|
|
54
89
|
|
|
@@ -56,30 +91,30 @@ export const AllKinds = {
|
|
|
56
91
|
name : 'All Kinds',
|
|
57
92
|
render: () => html`
|
|
58
93
|
<div style="display:flex; flex-direction:column; gap:16px;">
|
|
59
|
-
<bd-p
|
|
60
|
-
<bd-p
|
|
61
|
-
<bd-p
|
|
94
|
+
<bd-p variant="large">${sampleText}</bd-p>
|
|
95
|
+
<bd-p variant="regular">${sampleText}</bd-p>
|
|
96
|
+
<bd-p variant="small">${sampleText}</bd-p>
|
|
62
97
|
</div>
|
|
63
98
|
`,
|
|
64
|
-
parameters: { docs: { description: { story: 'All three
|
|
99
|
+
parameters: { docs: { description: { story: 'All three variant values stacked for typographic scale comparison: large, regular, small.' } } }
|
|
65
100
|
};
|
|
66
101
|
|
|
67
102
|
export const LargeKind = {
|
|
68
103
|
name : 'Kind — Large',
|
|
69
|
-
render : () => html`<bd-p
|
|
104
|
+
render : () => html`<bd-p variant="large">${sampleText}</bd-p>`,
|
|
70
105
|
parameters: { docs: { description: { story: 'Large paragraph — suited for lead or intro text.' } } }
|
|
71
106
|
};
|
|
72
107
|
|
|
73
108
|
export const SmallKind = {
|
|
74
109
|
name : 'Kind — Small',
|
|
75
|
-
render : () => html`<bd-p
|
|
110
|
+
render : () => html`<bd-p variant="small">${sampleText}</bd-p>`,
|
|
76
111
|
parameters: { docs: { description: { story: 'Small paragraph — suited for captions, disclaimers, and supporting text.' } } }
|
|
77
112
|
};
|
|
78
113
|
|
|
79
114
|
export const RichContent = {
|
|
80
115
|
name : 'Rich Slotted Content',
|
|
81
116
|
render: () => html`
|
|
82
|
-
<bd-p
|
|
117
|
+
<bd-p variant="regular">
|
|
83
118
|
Protect your devices with <strong>award-winning</strong> security.
|
|
84
119
|
Visit our <a href="/products">products page</a> or <em>contact us</em> for more info.
|
|
85
120
|
</bd-p>
|
|
@@ -90,21 +125,21 @@ export const RichContent = {
|
|
|
90
125
|
export const Disclaimer = {
|
|
91
126
|
name : 'Disclaimer Use Case',
|
|
92
127
|
render: () => html`
|
|
93
|
-
<bd-p
|
|
128
|
+
<bd-p variant="small">
|
|
94
129
|
Protection for 1 account & 5 PCs, Macs, tablets, or smartphones.
|
|
95
130
|
Windows® | macOS® | Android™ | iOS®
|
|
96
131
|
</bd-p>
|
|
97
132
|
`,
|
|
98
|
-
parameters: { docs: { description: { story: 'Small
|
|
133
|
+
parameters: { docs: { description: { story: 'Small variant used as a product disclaimer below pricing or CTA buttons.' } } }
|
|
99
134
|
};
|
|
100
135
|
|
|
101
136
|
export const MultiParagraph = {
|
|
102
137
|
name : 'Multiple Paragraphs',
|
|
103
138
|
render: () => html`
|
|
104
139
|
<div style="display:flex; flex-direction:column; gap:12px;">
|
|
105
|
-
<bd-p
|
|
106
|
-
<bd-p
|
|
107
|
-
<bd-p
|
|
140
|
+
<bd-p variant="large">Complete protection for your digital life.</bd-p>
|
|
141
|
+
<bd-p variant="regular">Bitdefender Total Security combines award-winning antivirus protection with advanced features including VPN, parental controls, and identity protection.</bd-p>
|
|
142
|
+
<bd-p variant="small">Available on Windows, macOS, Android, and iOS. Subscription required.</bd-p>
|
|
108
143
|
</div>
|
|
109
144
|
`,
|
|
110
145
|
parameters: { docs: { description: { story: 'Three paragraphs of different kinds used together as a typical content block.' } } }
|
|
@@ -113,6 +148,6 @@ export const MultiParagraph = {
|
|
|
113
148
|
export const Playground = {
|
|
114
149
|
name : '🛝 Playground',
|
|
115
150
|
args : { kind: 'regular' },
|
|
116
|
-
render : (args) => html`<bd-p
|
|
151
|
+
render : (args) => html`<bd-p variant="${args.kind}">${sampleText}</bd-p>`,
|
|
117
152
|
parameters: { docs: { description: { story: 'Interactive playground. Switch between large, regular, and small via Controls.' } } }
|
|
118
153
|
};
|
|
@@ -37,23 +37,35 @@ export default css`
|
|
|
37
37
|
|
|
38
38
|
/* Radius Classes */
|
|
39
39
|
.bd-picture.radius-none img {
|
|
40
|
-
border-radius:
|
|
40
|
+
border-radius: var(--radius-none);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.bd-picture.radius-sm img {
|
|
44
|
-
border-radius: var(--radius-sm
|
|
44
|
+
border-radius: var(--radius-sm);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.bd-picture.radius-md img {
|
|
48
|
-
border-radius: var(--radius-md
|
|
48
|
+
border-radius: var(--radius-md);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.bd-picture.radius-lg img {
|
|
52
|
-
border-radius: var(--radius-lg
|
|
52
|
+
border-radius: var(--radius-lg);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.bd-picture.radius-xl img {
|
|
56
|
+
border-radius: var(--radius-xl);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.bd-picture.radius-2xl img {
|
|
60
|
+
border-radius: var(--radius-2xl);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.bd-picture.radius-3xl img {
|
|
64
|
+
border-radius: var(--radius-3xl);
|
|
53
65
|
}
|
|
54
66
|
|
|
55
67
|
.bd-picture.radius-full img {
|
|
56
|
-
border-radius:
|
|
68
|
+
border-radius: var(--radius-full);
|
|
57
69
|
}
|
|
58
70
|
|
|
59
71
|
/* Responsive Behavior */
|
|
@@ -97,31 +109,84 @@ export default css`
|
|
|
97
109
|
object-fit: cover;
|
|
98
110
|
}
|
|
99
111
|
|
|
100
|
-
/* Focus styles for accessibility */
|
|
101
112
|
.bd-picture:focus-within {
|
|
102
|
-
|
|
103
|
-
outline
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
/* the one focus ring — see Foundations/Focus */
|
|
114
|
+
outline: none;
|
|
115
|
+
box-shadow: var(--focus-outline-primary);
|
|
116
|
+
border-radius: var(--focus-outline-radius);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Loading state.
|
|
120
|
+
|
|
121
|
+
The label overlays the reserved box instead of sitting beside the image
|
|
122
|
+
in it. This rule used to be display: flex with the ::before as a flex
|
|
123
|
+
sibling of the <img>, so the placeholder's width came out as the label's
|
|
124
|
+
width plus the image's -- measured, with each story served an image at
|
|
125
|
+
its own declared size, the box was exactly 84px too wide every time:
|
|
126
|
+
|
|
127
|
+
declared 200x150 -> placeholder 284x150 (Fit Variants)
|
|
128
|
+
declared 180x180 -> placeholder 264x180 (Radius Variants)
|
|
129
|
+
declared 300x200 -> placeholder 384x200 (Lazy vs Eager)
|
|
130
|
+
|
|
131
|
+
84px is the rendered width of "Loading image" at
|
|
132
|
+
--typography-fontSize-sm. So the placeholder reserved a box the shape of
|
|
133
|
+
its own sentence rather than the shape of the image about to arrive, and
|
|
134
|
+
every image narrower than the label jumped left when it loaded: CLS
|
|
135
|
+
0.0188, 0.0370 and 0.0049 for those three stories. The two stories whose
|
|
136
|
+
images fill the row measured 0.0000, because max-width: 100% pinned both
|
|
137
|
+
states to the same width and hid the flaw.
|
|
138
|
+
|
|
139
|
+
This was unreachable until the [loaded] flag in picture.js started being
|
|
140
|
+
set: with the reveal permanently stuck at opacity 0 the image never
|
|
141
|
+
appeared, so nothing ever moved. Taking the label out of flow is what
|
|
142
|
+
keeps that fix from trading an invisible image for a visible jump.
|
|
143
|
+
|
|
144
|
+
position: absolute on the ::before leaves the <img> -- which carries the
|
|
145
|
+
declared width and height attributes, and therefore an intrinsic box
|
|
146
|
+
before any bytes arrive -- as the only thing sizing the placeholder. */
|
|
108
147
|
.bd-picture:not([loaded]) {
|
|
109
|
-
|
|
148
|
+
position: relative;
|
|
149
|
+
background-color: var(--color-surface-muted);
|
|
150
|
+
/* no token: the dimension scale stops at 64px */
|
|
110
151
|
min-height: 100px;
|
|
152
|
+
/* --color-text-muted, not --color-text-disabled. Loading is not disabled,
|
|
153
|
+
and the difference is not academic: the disabled text role carries a
|
|
154
|
+
contrast exemption -- WCAG 1.4.3 excuses disabled controls from the
|
|
155
|
+
4.5:1 minimum -- and this label claims that exemption without being
|
|
156
|
+
entitled to it. It is a sentence a reader is meant to read while they
|
|
157
|
+
wait.
|
|
158
|
+
|
|
159
|
+
Measured on this ground: neutral-400 on neutral-100 is 2.51:1, which
|
|
160
|
+
misses even the 3:1 floor for non-text. --color-text-muted is
|
|
161
|
+
neutral-600 at 5.12:1 and is the role this package already uses for
|
|
162
|
+
low-emphasis readable text -- caption and form help text both resolve
|
|
163
|
+
to it.
|
|
164
|
+
|
|
165
|
+
The ground stays --color-surface-muted. Loading is a state, muted is
|
|
166
|
+
the state surface, and bd-skeleton -- the package's other loading
|
|
167
|
+
affordance -- already sits on it. Only the ink was choosing by value.
|
|
168
|
+
See "Choosing a semantic role" in the package README. */
|
|
169
|
+
color: var(--color-text-muted);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* One sentence for this state, shared with bd-img, and a local property
|
|
173
|
+
rather than a string in the stylesheet so it can be translated. */
|
|
174
|
+
.bd-picture:not([loaded])::before {
|
|
175
|
+
content: var(--bd-img-loading-label, "Loading image");
|
|
176
|
+
/* no role: the pre-load placeholder -- a glyph/marker/placeholder box, not running
|
|
177
|
+
prose. See list-item.css.js's .bd-list-item-marker::before for the
|
|
178
|
+
argument. */
|
|
179
|
+
font-size: var(--typography-fontSize-sm);
|
|
180
|
+
position: absolute;
|
|
181
|
+
inset: var(--spacing-0);
|
|
111
182
|
display: flex;
|
|
112
183
|
align-items: center;
|
|
113
184
|
justify-content: center;
|
|
114
|
-
color: var(--color-neutral-400, #9ca3af);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.bd-picture:not([loaded])::before {
|
|
118
|
-
content: "Loading image...";
|
|
119
|
-
font-size: var(--text-sm, 0.875rem);
|
|
120
185
|
}
|
|
121
186
|
|
|
122
187
|
/* Smooth transitions */
|
|
123
188
|
.bd-picture img {
|
|
124
|
-
transition: opacity
|
|
189
|
+
transition: opacity var(--transition-duration-slow) var(--transition-easing-smooth), transform var(--transition-duration-slow) var(--transition-easing-smooth);
|
|
125
190
|
}
|
|
126
191
|
|
|
127
192
|
.bd-picture img[loading="lazy"] {
|
|
@@ -141,7 +206,7 @@ export default css`
|
|
|
141
206
|
|
|
142
207
|
.bd-picture.hover-lift:hover {
|
|
143
208
|
transform: translateY(-2px);
|
|
144
|
-
transition: transform
|
|
209
|
+
transition: transform var(--transition-duration-slow) var(--transition-easing-smooth);
|
|
145
210
|
}
|
|
146
211
|
|
|
147
212
|
/* Performance optimizations */
|
|
@@ -149,20 +214,15 @@ export default css`
|
|
|
149
214
|
will-change: transform, opacity;
|
|
150
215
|
}
|
|
151
216
|
|
|
152
|
-
/*
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
}
|
|
217
|
+
/* Two @container queries used to sit here, for .mobile-full and
|
|
218
|
+
.tablet-optimized. Neither could ever match: a container query needs an
|
|
219
|
+
ancestor with container-type, and nothing in this component or around it
|
|
220
|
+
declares one, so both rules were dead the day they were written. Nothing
|
|
221
|
+
else in the package referenced .mobile-full or .tablet-optimized either,
|
|
222
|
+
so the rules went and there was nothing else to remove.
|
|
160
223
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
object-fit: contain;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
224
|
+
If this comes back, the wrapper needs container-type: inline-size and
|
|
225
|
+
the 480px value needs to be on the breakpoint scale, which it was not. */
|
|
166
226
|
|
|
167
227
|
/* Print styles */
|
|
168
228
|
@media print {
|
|
@@ -171,15 +231,15 @@ export default css`
|
|
|
171
231
|
}
|
|
172
232
|
|
|
173
233
|
.bd-picture img {
|
|
174
|
-
max-width: 100
|
|
175
|
-
height: auto
|
|
234
|
+
max-width: 100%;
|
|
235
|
+
height: auto;
|
|
176
236
|
}
|
|
177
237
|
}
|
|
178
238
|
|
|
179
239
|
/* High contrast mode support */
|
|
180
240
|
@media (prefers-contrast: high) {
|
|
181
241
|
.bd-picture img {
|
|
182
|
-
border:
|
|
242
|
+
border: var(--border-width-1) solid currentColor;
|
|
183
243
|
}
|
|
184
244
|
}
|
|
185
245
|
|
|
@@ -198,12 +258,11 @@ export default css`
|
|
|
198
258
|
}
|
|
199
259
|
}
|
|
200
260
|
|
|
201
|
-
/*
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
261
|
+
/* No @media (prefers-color-scheme: dark) block. This was the one atom that
|
|
262
|
+
themed itself in CSS, which is the thing CLAUDE.md says a component must
|
|
263
|
+
never need to do — an atom changes appearance through tokens. The
|
|
264
|
+
placeholder now reads --color-surface-muted and --color-text-muted, so
|
|
265
|
+
whenever a dark theme redefines those on :root it follows without this
|
|
266
|
+
component being touched. */
|
|
208
267
|
}
|
|
209
268
|
`;
|