@repobit/dex-system-design 0.25.11 → 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 +195 -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,166 +1,217 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* bd-link.
|
|
5
|
+
*
|
|
6
|
+
* The base rule reads --typography-link-default-*, which had fourteen tokens
|
|
7
|
+
* and no consumer: the component re-spelled every one of them in primitives.
|
|
8
|
+
* The underline offset was a 2px literal in seven places, on a property the
|
|
9
|
+
* length rule does not check, so nothing could see it and nothing could change
|
|
10
|
+
* it in one move.
|
|
11
|
+
*
|
|
12
|
+
* Colour comes from the semantic text roles. The default was --color-blue-500,
|
|
13
|
+
* which is 4.53:1 on white — the step CLAUDE.md names as the one to avoid for
|
|
14
|
+
* text, and the atom's own bold variant already avoided it.
|
|
15
|
+
*/
|
|
3
16
|
export default css`
|
|
4
17
|
.bd-link {
|
|
5
18
|
display: inline-flex;
|
|
6
19
|
align-items: center;
|
|
7
20
|
gap: var(--spacing-4);
|
|
8
|
-
color: var(--color-blue-500);
|
|
9
|
-
text-decoration: none;
|
|
10
21
|
font-family: var(--typography-fontFamily-sans);
|
|
11
|
-
font-size: var(--typography-fontSize
|
|
12
|
-
font-weight: var(--typography-fontWeight
|
|
13
|
-
line-height: var(--typography-lineHeight
|
|
14
|
-
|
|
22
|
+
font-size: var(--typography-link-standalone-fontSize);
|
|
23
|
+
font-weight: var(--typography-link-default-fontWeight);
|
|
24
|
+
line-height: var(--typography-link-standalone-lineHeight);
|
|
25
|
+
color: var(--bd-link-color, var(--color-text-brand));
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
text-underline-offset: var(--typography-link-underlineOffset);
|
|
15
28
|
cursor: pointer;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
/* the properties that actually change, rather than all: a link that
|
|
30
|
+
animates every property also animates the ones it inherits */
|
|
31
|
+
transition: color var(--transition-duration-fast) var(--transition-easing-smooth),
|
|
32
|
+
text-decoration-color var(--transition-duration-fast) var(--transition-easing-smooth);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ---- inline ------------------------------------------------------------
|
|
36
|
+
A link in a sentence is that sentence's text, so it takes its type from
|
|
37
|
+
the sentence. --typography-link-default-* is the role that says so: size,
|
|
38
|
+
leading, tracking and family are all inherit. Four of those axes had no
|
|
39
|
+
consumer, because the base rule above reads the standalone role instead --
|
|
40
|
+
1rem and 1.5 regardless of context -- which is why an inline link measured
|
|
41
|
+
16px inside a 12px caption and inside a 32px lede alike.
|
|
42
|
+
|
|
43
|
+
display returns to inline as well. An inline-flex box does not hug its
|
|
44
|
+
own text: in a 220px column the same link measured the full 220px where a
|
|
45
|
+
plain <a> measured 209px, so it does not sit in the line the way a real
|
|
46
|
+
inline element does. The gap and align-items above go inert with it, which
|
|
47
|
+
is correct here -- an inline link is a run of text, not a row. */
|
|
48
|
+
:host([inline]) .bd-link {
|
|
49
|
+
display: inline;
|
|
50
|
+
font-size: var(--typography-link-default-fontSize);
|
|
51
|
+
line-height: var(--typography-link-default-lineHeight);
|
|
52
|
+
letter-spacing: var(--typography-link-default-letterSpacing);
|
|
53
|
+
font-family: var(--typography-link-default-fontFamily);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* ---- kinds ------------------------------------------------------------ */
|
|
19
57
|
.bd-link--primary {
|
|
20
|
-
color: var(--color-
|
|
58
|
+
color: var(--bd-link-color, var(--color-text-brand));
|
|
21
59
|
}
|
|
22
|
-
|
|
23
60
|
.bd-link--primary:hover {
|
|
24
|
-
color: var(--color-
|
|
61
|
+
color: var(--color-text-brand-hover);
|
|
25
62
|
text-decoration: underline;
|
|
26
|
-
text-underline-offset: 2px;
|
|
27
63
|
}
|
|
28
64
|
|
|
29
|
-
/* Secondary */
|
|
30
65
|
.bd-link--secondary {
|
|
31
|
-
color: var(--color-
|
|
66
|
+
color: var(--bd-link-color, var(--color-text-muted));
|
|
32
67
|
}
|
|
33
|
-
|
|
34
68
|
.bd-link--secondary:hover {
|
|
35
|
-
color: var(--color-
|
|
69
|
+
color: var(--color-text-secondary);
|
|
36
70
|
text-decoration: underline;
|
|
37
|
-
text-underline-offset: 2px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* ============================================
|
|
41
|
-
ACTIVE STATE - FONT WEIGHT 700
|
|
42
|
-
============================================ */
|
|
43
|
-
|
|
44
|
-
.bd-link--active {
|
|
45
|
-
font-weight: 700 !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Poți adăuga și alte stiluri pentru active dacă dorești */
|
|
49
|
-
.bd-link--active.bd-link--primary {
|
|
50
|
-
color: var(--color-neutral-900);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.bd-link--active.bd-link--secondary {
|
|
54
|
-
color: var(--color-neutral-900);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
.bd-link--no-underline:hover,
|
|
59
|
-
.bd-link--no-underline.bd-link--primary:hover,
|
|
60
|
-
.bd-link--no-underline.bd-link--secondary:hover,
|
|
61
|
-
.bd-link--no-underline.bd-link--danger:hover,
|
|
62
|
-
.bd-link--no-underline.bd-link--bold:hover,
|
|
63
|
-
.bd-link--no-underline.bd-link--subtle:hover {
|
|
64
|
-
text-decoration: none !important;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
color: var(--color-neutral-800) !important;
|
|
73
|
+
.bd-link--subtle {
|
|
74
|
+
color: var(--bd-link-color, var(--color-text-subtle));
|
|
75
|
+
text-decoration: none;
|
|
71
76
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
color: var(--color-neutral-0);
|
|
77
|
+
.bd-link--subtle:hover {
|
|
78
|
+
color: var(--color-text-secondary);
|
|
79
|
+
text-decoration: underline;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
|
-
.bd-link--
|
|
79
|
-
color: var(--color-
|
|
82
|
+
.bd-link--bold {
|
|
83
|
+
color: var(--bd-link-color, var(--color-text-brand));
|
|
84
|
+
/* no role: the bold modifier on a link -- a state or modifier weight, not a text-content
|
|
85
|
+
type. See button.css.js's .button--bold for the argument. */
|
|
86
|
+
font-weight: var(--typography-fontWeight-semibold);
|
|
80
87
|
text-decoration: none;
|
|
81
88
|
}
|
|
89
|
+
.bd-link--bold:hover {
|
|
90
|
+
color: var(--color-text-brand-hover);
|
|
91
|
+
text-decoration: underline;
|
|
92
|
+
}
|
|
82
93
|
|
|
83
|
-
/*
|
|
94
|
+
/* Red on a link is the error role, not bd-button's accent. The button's red
|
|
95
|
+
is this system's conversion colour and it deliberately has no danger kind;
|
|
96
|
+
a link is the opposite case — red text reads as a warning about where the
|
|
97
|
+
link goes, so it takes --color-text-error and says so. */
|
|
84
98
|
.bd-link--danger {
|
|
85
|
-
color: var(--color-
|
|
99
|
+
color: var(--bd-link-color, var(--color-text-error));
|
|
86
100
|
}
|
|
87
|
-
|
|
88
101
|
.bd-link--danger:hover {
|
|
89
|
-
color: var(--color-
|
|
102
|
+
color: var(--color-text-error);
|
|
90
103
|
text-decoration: underline;
|
|
91
|
-
text-underline-offset: 2px;
|
|
92
104
|
}
|
|
93
105
|
|
|
94
|
-
/*
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
/* ---- surface ----------------------------------------------------------
|
|
107
|
+
The same attribute bd-button uses to say the same thing. It replaces the
|
|
108
|
+
light kind, which described the surface rather than the link and could
|
|
109
|
+
not be combined with any of the kinds above. */
|
|
110
|
+
:host([surface="dark"]) .bd-link,
|
|
111
|
+
:host([surface="dark"]) .bd-link--primary,
|
|
112
|
+
:host([surface="dark"]) .bd-link--secondary,
|
|
113
|
+
:host([surface="dark"]) .bd-link--subtle,
|
|
114
|
+
:host([surface="dark"]) .bd-link--bold {
|
|
115
|
+
color: var(--color-text-inverse);
|
|
98
116
|
}
|
|
99
117
|
|
|
100
|
-
.
|
|
101
|
-
|
|
118
|
+
/* Colour only. This rule used to carry text-decoration: underline as well,
|
|
119
|
+
and at (0,4,0) it outweighed .bd-link--no-underline:hover at (0,2,0) --
|
|
120
|
+
so a link explicitly asking for no underline got one anyway, but only on a
|
|
121
|
+
dark surface. Measured: dark/primary/no-underline went none -> underline on
|
|
122
|
+
hover, where the same link on a light surface stayed none.
|
|
123
|
+
|
|
124
|
+
The underline is the kinds' business, and every kind already declares it. */
|
|
125
|
+
:host([surface="dark"]) .bd-link:hover {
|
|
126
|
+
color: var(--color-text-inverse);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* ---- modifiers --------------------------------------------------------
|
|
130
|
+
Ordered after the kinds rather than marked !important. Four declarations
|
|
131
|
+
carried it before, which made the atom unoverridable by a consuming page —
|
|
132
|
+
the exact failure the cascade-layer token work was done to avoid. */
|
|
133
|
+
.bd-link--underline {
|
|
102
134
|
text-decoration: underline;
|
|
103
|
-
|
|
135
|
+
}
|
|
136
|
+
.bd-link--underline:hover {
|
|
137
|
+
text-decoration-thickness: var(--typography-link-underlineThickness);
|
|
104
138
|
}
|
|
105
139
|
|
|
106
|
-
|
|
107
|
-
.bd-link--
|
|
108
|
-
color: var(--color-blue-600);
|
|
109
|
-
font-weight: var(--typography-fontWeight-semibold);
|
|
140
|
+
.bd-link--no-underline,
|
|
141
|
+
.bd-link--no-underline:hover {
|
|
110
142
|
text-decoration: none;
|
|
111
143
|
}
|
|
112
144
|
|
|
113
|
-
.bd-link--
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
145
|
+
.bd-link--active {
|
|
146
|
+
/* no role: a link in its active state -- a state or modifier weight, not a text-content
|
|
147
|
+
type. See button.css.js's .button--bold for the argument. */
|
|
148
|
+
font-weight: var(--typography-fontWeight-bold);
|
|
149
|
+
color: var(--color-text-primary);
|
|
117
150
|
}
|
|
118
151
|
|
|
119
|
-
/*
|
|
120
|
-
.bd-link--underline {
|
|
121
|
-
text-decoration: underline;
|
|
122
|
-
text-underline-offset: 2px;
|
|
123
|
-
}
|
|
152
|
+
/* The current item does not move under the pointer.
|
|
124
153
|
|
|
125
|
-
|
|
126
|
-
|
|
154
|
+
--active and --primary are both present on a current nav item, and
|
|
155
|
+
.bd-link--primary:hover at (0,2,0) outweighs .bd-link--active at (0,1,0)
|
|
156
|
+
-- so without this rule hovering the page you are already on turned it
|
|
157
|
+
back to the brand ink, which is the one thing that colour is not supposed
|
|
158
|
+
to mean here. Measured on bd-page-switcher before the wayfinding family
|
|
159
|
+
review: current + hover reported action/primary-active, the only one of
|
|
160
|
+
the three that recoloured an item the reader had already arrived at.
|
|
161
|
+
|
|
162
|
+
Same specificity as the kind hovers and declared after them, so it wins
|
|
163
|
+
on order. */
|
|
164
|
+
.bd-link--active:hover {
|
|
165
|
+
color: var(--color-text-primary);
|
|
127
166
|
}
|
|
128
167
|
|
|
129
|
-
/*
|
|
130
|
-
.bd-link--disabled
|
|
131
|
-
|
|
168
|
+
/* ---- states ----------------------------------------------------------- */
|
|
169
|
+
.bd-link--disabled,
|
|
170
|
+
span.bd-link--disabled {
|
|
171
|
+
color: var(--color-text-disabled);
|
|
132
172
|
cursor: not-allowed;
|
|
133
173
|
text-decoration: none;
|
|
134
174
|
pointer-events: none;
|
|
135
175
|
}
|
|
136
176
|
|
|
137
|
-
/* Focus styles */
|
|
138
177
|
.bd-link:focus {
|
|
139
178
|
outline: none;
|
|
140
179
|
}
|
|
141
180
|
|
|
142
181
|
.bd-link:focus-visible {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
.bd-link.bd-link--disabled {
|
|
150
|
-
display: inline-flex;
|
|
151
|
-
align-items: center;
|
|
182
|
+
/* the one focus ring — see Foundations/Focus. A two-colour ring whose
|
|
183
|
+
white inner band keeps it visible on a coloured or dark surface, which a
|
|
184
|
+
single-colour outline cannot do. */
|
|
185
|
+
outline: none;
|
|
186
|
+
box-shadow: var(--focus-outline-primary);
|
|
187
|
+
border-radius: var(--focus-outline-radius);
|
|
152
188
|
}
|
|
153
189
|
|
|
154
|
-
/* Additional specificity for edge cases */
|
|
155
190
|
a.bd-link {
|
|
156
191
|
cursor: pointer;
|
|
157
192
|
}
|
|
158
193
|
|
|
194
|
+
/* There is no element-qualified reset here, and that is the point.
|
|
195
|
+
|
|
196
|
+
The anchor's underline is already off: .bd-link sets text-decoration none,
|
|
197
|
+
and an author rule beats the UA stylesheet whatever its specificity. What
|
|
198
|
+
the old a.bd-link:not(.bd-link--underline) rule added was weight -- (0,2,1)
|
|
199
|
+
against the (0,2,0) of every .bd-link--<kind>:hover -- so the hover
|
|
200
|
+
underline each of the five kinds declares lost the cascade and never
|
|
201
|
+
painted. Measured on light surfaces: primary, secondary, subtle, bold and
|
|
202
|
+
danger all went none -> none across a hover. On a dark surface the same
|
|
203
|
+
hover underlined, because that rule is (0,4,0) and outweighed the reset.
|
|
204
|
+
|
|
205
|
+
The kinds and the modifiers sort themselves out on class weight alone, in
|
|
206
|
+
source order: --underline and --no-underline are declared after the kinds,
|
|
207
|
+
so they still win. */
|
|
159
208
|
span.bd-link {
|
|
160
209
|
cursor: default;
|
|
161
210
|
}
|
|
162
211
|
|
|
163
|
-
|
|
164
|
-
|
|
212
|
+
@media (prefers-reduced-motion: reduce) {
|
|
213
|
+
.bd-link {
|
|
214
|
+
transition: none;
|
|
215
|
+
}
|
|
165
216
|
}
|
|
166
|
-
`;
|
|
217
|
+
`;
|
|
@@ -1,39 +1,87 @@
|
|
|
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 linkCSS from "./link.css.js";
|
|
5
|
+
import { fontSize, color } from "../shared/token-scales.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The anchor -- or, when disabled, the span -- is exposed as `part="link"`.
|
|
9
|
+
*
|
|
10
|
+
* It is the element that carries the ink, the padding and the focus ring, and
|
|
11
|
+
* until now nothing outside this shadow root could reach it. That is not a
|
|
12
|
+
* theoretical gap: bd-breadcrumb's mobile layout put a full-width padded pill
|
|
13
|
+
* on the bd-link HOST, and the anchor inside stayed the width of its own text,
|
|
14
|
+
* so a 343x40 row offered a 43x24 target -- 7.5% of what it looked like. A
|
|
15
|
+
* part is the seam for the cases where the box a consumer needs to style and
|
|
16
|
+
* the box the browser makes focusable have to be the same box.
|
|
17
|
+
*
|
|
18
|
+
* It is a seam, not a licence to restyle the atom: reach for a variant first.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* kind values that described something else, mapped onto what they meant so
|
|
23
|
+
* existing markup keeps working. `light` said "on a dark surface", which is
|
|
24
|
+
* what the surface attribute says now.
|
|
25
|
+
*/
|
|
26
|
+
const LEGACY_KINDS = { light: "primary" };
|
|
27
|
+
const VARIANTS = ["primary", "secondary", "subtle", "bold", "danger"];
|
|
4
28
|
|
|
5
29
|
class BdLink extends LitElement {
|
|
6
30
|
static properties = {
|
|
7
31
|
href : { type: String },
|
|
8
32
|
target : { type: String },
|
|
9
|
-
|
|
33
|
+
variant : { type: String, reflect: true },
|
|
34
|
+
/** @deprecated pass `variant`. */
|
|
35
|
+
kind : { type: String },
|
|
10
36
|
underline : { type: Boolean, reflect: true },
|
|
11
37
|
noUnderline: { type: Boolean, attribute: "no-underline" },
|
|
12
38
|
disabled : { type: Boolean, reflect: true },
|
|
13
39
|
fontSize : { type: String, attribute: "font-size" },
|
|
40
|
+
/* The link is a run of text in a sentence and takes its type from that
|
|
41
|
+
sentence. Off by default: 62 of the 66 bd-link usages in this package
|
|
42
|
+
rely on the standalone role's 1rem, so inheriting cannot be the default
|
|
43
|
+
without repositioning all of them. */
|
|
44
|
+
inline : { type: Boolean, reflect: true },
|
|
14
45
|
color : { type: String },
|
|
15
|
-
active : { type: Boolean, reflect: true }
|
|
46
|
+
active : { type: Boolean, reflect: true },
|
|
47
|
+
/* The surface the link sits on, the same attribute bd-button uses. It
|
|
48
|
+
replaces kind="light", which described the surface rather than the link
|
|
49
|
+
and so could not be combined with any of the real kinds. */
|
|
50
|
+
surface : { type: String, reflect: true }
|
|
16
51
|
};
|
|
17
52
|
|
|
18
53
|
constructor() {
|
|
19
54
|
super();
|
|
20
55
|
this.href = "#";
|
|
21
56
|
this.target = "_self";
|
|
22
|
-
this.
|
|
57
|
+
this.variant = "primary";
|
|
58
|
+
this.kind = "";
|
|
23
59
|
this.underline = false;
|
|
24
60
|
this.noUnderline = false;
|
|
25
61
|
this.disabled = false;
|
|
26
62
|
this.fontSize = "";
|
|
63
|
+
this.inline = false;
|
|
27
64
|
this.color = "";
|
|
28
65
|
this.active = false;
|
|
66
|
+
this.surface = "light";
|
|
29
67
|
}
|
|
30
68
|
|
|
31
|
-
|
|
69
|
+
willUpdate(changed) {
|
|
70
|
+
if (!changed.has("kind") && !changed.has("variant")) return;
|
|
71
|
+
if (changed.has("kind") && this.kind) this.variant = this.kind;
|
|
72
|
+
// light meant "this link is on a dark surface", which the surface
|
|
73
|
+
// attribute says now
|
|
74
|
+
if (this.variant === "light") this.surface = "dark";
|
|
75
|
+
if (LEGACY_KINDS[this.variant]) this.variant = LEGACY_KINDS[this.variant];
|
|
76
|
+
if (!VARIANTS.includes(this.variant)) this.variant = "primary";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static styles = [linkCSS];
|
|
32
80
|
|
|
33
81
|
get _classes() {
|
|
34
82
|
return [
|
|
35
83
|
"bd-link",
|
|
36
|
-
`bd-link--${this.
|
|
84
|
+
`bd-link--${this.variant}`,
|
|
37
85
|
this.underline ? "bd-link--underline" : "",
|
|
38
86
|
this.noUnderline ? "bd-link--no-underline" : "",
|
|
39
87
|
this.active ? "bd-link--active" : "",
|
|
@@ -41,17 +89,43 @@ class BdLink extends LitElement {
|
|
|
41
89
|
].filter(Boolean).join(" ");
|
|
42
90
|
}
|
|
43
91
|
|
|
92
|
+
/**
|
|
93
|
+
* font-size is a type-scale step and color is a semantic role; both are
|
|
94
|
+
* resolved to token references by shared/token-scales.js, and anything off
|
|
95
|
+
* the scale is dropped.
|
|
96
|
+
*
|
|
97
|
+
* `color` is emitted as --bd-link-color rather than as `color`, and that is
|
|
98
|
+
* the whole of the fix. A style attribute beats every rule in this
|
|
99
|
+
* stylesheet, so a link with a colour prop had NO hover, NO active and NO
|
|
100
|
+
* disabled appearance -- the resting ink won in all four states. Measured on
|
|
101
|
+
* bd-anchor-nav, which passes color="strong": rest, hover and mouse-down all
|
|
102
|
+
* reported neutral-900 at weight 400, so the links were inert under the
|
|
103
|
+
* pointer. Four sites pass the prop today and all four were affected.
|
|
104
|
+
*
|
|
105
|
+
* As a custom property it is the *resting* colour instead: the kind rules
|
|
106
|
+
* below read it through a var() fallback, and the :hover, --active and
|
|
107
|
+
* --disabled rules keep plain `color` declarations, so they win the way they
|
|
108
|
+
* were always meant to.
|
|
109
|
+
*
|
|
110
|
+
* font-size is not emitted at all when inline is set, because the two ask
|
|
111
|
+
* contradictory questions: inline means the sentence decides the size. It is
|
|
112
|
+
* dropped here rather than left to lose a specificity argument in the
|
|
113
|
+
* stylesheet -- this is a style attribute, so it would beat
|
|
114
|
+
* :host([inline]) and pull the link back out of the line box that mode
|
|
115
|
+
* exists to keep it in.
|
|
116
|
+
*/
|
|
44
117
|
get _inlineStyle() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
118
|
+
return [
|
|
119
|
+
["font-size", this.inline ? "" : fontSize(this.fontSize)],
|
|
120
|
+
["--bd-link-color", color(this.color)]
|
|
121
|
+
].filter(([, v]) => v).map(([prop, v]) => `${prop}: ${v}`)
|
|
122
|
+
.join("; ");
|
|
49
123
|
}
|
|
50
124
|
|
|
51
125
|
render() {
|
|
52
126
|
if (this.disabled) {
|
|
53
127
|
return html`
|
|
54
|
-
<span class="${this._classes}" style="${this._inlineStyle}">
|
|
128
|
+
<span part="link" class="${this._classes}" style="${this._inlineStyle}">
|
|
55
129
|
<slot></slot>
|
|
56
130
|
</span>
|
|
57
131
|
`;
|
|
@@ -59,6 +133,7 @@ class BdLink extends LitElement {
|
|
|
59
133
|
|
|
60
134
|
return html`
|
|
61
135
|
<a
|
|
136
|
+
part="link"
|
|
62
137
|
class="${this._classes}"
|
|
63
138
|
style="${this._inlineStyle}"
|
|
64
139
|
href="${this.href}"
|