@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
|
@@ -2,18 +2,23 @@ import { html } from 'lit';
|
|
|
2
2
|
import './link.js';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title : '
|
|
5
|
+
title : 'Atoms/Link',
|
|
6
6
|
tags : ['autodocs'],
|
|
7
7
|
parameters: {
|
|
8
|
-
|
|
8
|
+
/* The specimen stories render fixed markup and take no args, so a control
|
|
9
|
+
on them can only ever look broken -- which is how a dead fontSize select
|
|
10
|
+
came to be read as a component bug. The Playground turns them back on,
|
|
11
|
+
and it is the one story wired to args. */
|
|
12
|
+
controls: { disable: true },
|
|
13
|
+
docs : {
|
|
9
14
|
description: {
|
|
10
15
|
component: `
|
|
11
|
-
**BdLink** is a Lit anchor component with
|
|
16
|
+
**BdLink** is a Lit anchor component with variant, underline, disabled, and target support.
|
|
12
17
|
|
|
13
18
|
### Usage
|
|
14
19
|
\`\`\`html
|
|
15
|
-
<bd-link href="/products"
|
|
16
|
-
<bd-link href="/docs"
|
|
20
|
+
<bd-link href="/products" variant="primary">View products</bd-link>
|
|
21
|
+
<bd-link href="/docs" variant="secondary" underline>Documentation</bd-link>
|
|
17
22
|
<bd-link href="/old" disabled>Unavailable</bd-link>
|
|
18
23
|
\`\`\`
|
|
19
24
|
|
|
@@ -28,6 +33,31 @@ export default {
|
|
|
28
33
|
- When \`disabled\`, renders a \`<span>\` instead of \`<a>\`
|
|
29
34
|
- Click events are prevented via \`e.preventDefault()\` and \`e.stopImmediatePropagation()\`
|
|
30
35
|
|
|
36
|
+
### fontSize and color are step names, not CSS values
|
|
37
|
+
Both are closed sets resolved through the token scales, so a literal is
|
|
38
|
+
impossible:
|
|
39
|
+
|
|
40
|
+
- \`fontSize\` takes a type-scale step — \`sm\`, \`base\`, \`lg\` — and becomes
|
|
41
|
+
\`var(--typography-fontSize-*)\`. Passing \`14px\` does nothing.
|
|
42
|
+
- \`color\` takes a semantic role — \`primary\`, \`strong\`, \`muted\`, \`subtle\`,
|
|
43
|
+
\`inverse\`, \`success\`, \`warning\`, \`error\` — and becomes a palette token.
|
|
44
|
+
Passing \`#026DFF\` does nothing.
|
|
45
|
+
|
|
46
|
+
Anything off the scale is dropped and the link keeps the styling its \`kind\`
|
|
47
|
+
gives it.
|
|
48
|
+
|
|
49
|
+
### underline and noUnderline both exist
|
|
50
|
+
They are two booleans for one axis, which is one more than the axis needs.
|
|
51
|
+
\`underline\` adds \`bd-link--underline\` and \`noUnderline\` adds
|
|
52
|
+
\`bd-link--no-underline\`, and nothing stops you setting both — the result then
|
|
53
|
+
depends on CSS order rather than on intent. Prefer whichever one differs from
|
|
54
|
+
your \`kind\`'s default and leave the other alone.
|
|
55
|
+
|
|
56
|
+
### active
|
|
57
|
+
Marks the link as the current destination, for a nav or breadcrumb. It is
|
|
58
|
+
styling only — pair it with \`aria-current="page"\` on the element for the state
|
|
59
|
+
to be announced.
|
|
60
|
+
|
|
31
61
|
### Events
|
|
32
62
|
- \`custom-click\` — NOT dispatched by BdLink (click handled natively by the \`<a>\` tag)
|
|
33
63
|
`
|
|
@@ -46,10 +76,10 @@ export default {
|
|
|
46
76
|
description: 'Browser target for the link',
|
|
47
77
|
table : { type: { summary: 'string' }, defaultValue: { summary: '_self' }, category: 'Navigation' }
|
|
48
78
|
},
|
|
49
|
-
|
|
79
|
+
variant: {
|
|
50
80
|
control : { type: 'select' },
|
|
51
81
|
options : ['primary', 'secondary', 'light'],
|
|
52
|
-
description: 'Visual style variant applied as `bd-link--{
|
|
82
|
+
description: 'Visual style variant applied as `bd-link--{variant}` class',
|
|
53
83
|
table : { type: { summary: "'primary'|'secondary'|'light'" }, defaultValue: { summary: 'primary' }, category: 'Appearance' }
|
|
54
84
|
},
|
|
55
85
|
underline: {
|
|
@@ -61,18 +91,66 @@ export default {
|
|
|
61
91
|
control : 'boolean',
|
|
62
92
|
description: 'Renders a `<span>` instead of `<a>` and prevents click events',
|
|
63
93
|
table : { type: { summary: 'boolean' }, defaultValue: { summary: 'false' }, category: 'State' }
|
|
94
|
+
},
|
|
95
|
+
noUnderline: {
|
|
96
|
+
control : 'boolean',
|
|
97
|
+
description: 'Adds `bd-link--no-underline`. Overlaps with `underline` — see the note on the two of them.',
|
|
98
|
+
table : { type: { summary: 'boolean' }, defaultValue: { summary: 'false' }, category: 'Appearance' }
|
|
99
|
+
},
|
|
100
|
+
active: {
|
|
101
|
+
control : 'boolean',
|
|
102
|
+
description: 'Marks the link as the current one, e.g. in a nav. Adds `bd-link--active`.',
|
|
103
|
+
table : { type: { summary: 'boolean' }, defaultValue: { summary: 'false' }, category: 'State' }
|
|
104
|
+
},
|
|
105
|
+
inline: {
|
|
106
|
+
control : 'boolean',
|
|
107
|
+
description: 'The link is text inside a sentence: size, leading, tracking and family come from the sentence (the `--typography-link-default-*` role, all `inherit`). Without it the link renders 1rem whatever surrounds it. Suppresses `fontSize`.',
|
|
108
|
+
table : { type: { summary: 'boolean' }, defaultValue: { summary: 'false' }, category: 'Typography' }
|
|
109
|
+
},
|
|
110
|
+
fontSize: {
|
|
111
|
+
control : { type: 'select' },
|
|
112
|
+
options : ['', 'xxs', 'xs', 'sm', 'base', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', '7xl', '8xl', '9xl'],
|
|
113
|
+
description: 'A type-scale step name, not a length. Resolves to `var(--typography-fontSize-*)`; anything off the scale is dropped.',
|
|
114
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: "''" }, category: 'Typography' }
|
|
115
|
+
},
|
|
116
|
+
color: {
|
|
117
|
+
control : { type: 'select' },
|
|
118
|
+
options : ['', 'primary', 'strong', 'muted', 'subtle', 'inverse', 'success', 'warning', 'error'],
|
|
119
|
+
description: 'A semantic colour role, not a CSS colour. Resolves to a palette token; anything else is dropped.',
|
|
120
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: "''" }, category: 'Typography' }
|
|
64
121
|
}
|
|
65
122
|
}
|
|
66
123
|
};
|
|
67
124
|
|
|
68
|
-
|
|
125
|
+
/* Every arg the Playground offers is passed below. fontSize, color,
|
|
126
|
+
noUnderline and active each had an argTypes entry and a control, and the
|
|
127
|
+
render function took none of them, so selecting a type step did nothing on
|
|
128
|
+
any story in this file -- the control was not wired rather than the property
|
|
129
|
+
being broken. */
|
|
130
|
+
const defaultArgs = {
|
|
131
|
+
href : '/products',
|
|
132
|
+
target : '_self',
|
|
133
|
+
kind : 'primary',
|
|
134
|
+
underline : false,
|
|
135
|
+
noUnderline: false,
|
|
136
|
+
active : false,
|
|
137
|
+
disabled : false,
|
|
138
|
+
inline : false,
|
|
139
|
+
fontSize : '',
|
|
140
|
+
color : ''
|
|
141
|
+
};
|
|
69
142
|
|
|
70
143
|
const render = (args) => html`
|
|
71
144
|
<bd-link
|
|
72
145
|
href="${args.href}"
|
|
73
146
|
target="${args.target}"
|
|
74
|
-
|
|
147
|
+
variant="${args.kind}"
|
|
148
|
+
font-size="${args.fontSize}"
|
|
149
|
+
color="${args.color}"
|
|
75
150
|
?underline="${args.underline}"
|
|
151
|
+
?no-underline="${args.noUnderline}"
|
|
152
|
+
?active="${args.active}"
|
|
153
|
+
?inline="${args.inline}"
|
|
76
154
|
?disabled="${args.disabled}"
|
|
77
155
|
>Click this link</bd-link>
|
|
78
156
|
`;
|
|
@@ -81,7 +159,7 @@ const render = (args) => html`
|
|
|
81
159
|
|
|
82
160
|
export const Default = {
|
|
83
161
|
name : 'Default (Primary)',
|
|
84
|
-
render : () => html`<bd-link href="/products"
|
|
162
|
+
render : () => html`<bd-link href="/products" variant="primary">View products</bd-link>`,
|
|
85
163
|
parameters: { docs: { description: { story: 'Default primary link rendered as an `<a>` tag.' } } }
|
|
86
164
|
};
|
|
87
165
|
|
|
@@ -89,9 +167,9 @@ export const AllKinds = {
|
|
|
89
167
|
name : 'All Kinds',
|
|
90
168
|
render: () => html`
|
|
91
169
|
<div style="display:flex; gap:16px; flex-wrap:wrap; align-items:center; padding:8px; background:#333;">
|
|
92
|
-
<bd-link href="#"
|
|
93
|
-
<bd-link href="#"
|
|
94
|
-
<bd-link href="#"
|
|
170
|
+
<bd-link href="#" variant="primary">Primary</bd-link>
|
|
171
|
+
<bd-link href="#" variant="secondary">Secondary</bd-link>
|
|
172
|
+
<bd-link href="#" variant="light">Light</bd-link>
|
|
95
173
|
</div>
|
|
96
174
|
`,
|
|
97
175
|
parameters: { docs: { description: { story: 'All three `kind` values. Light kind is shown on a dark background for visibility.' } } }
|
|
@@ -101,8 +179,8 @@ export const WithUnderline = {
|
|
|
101
179
|
name : 'With Underline',
|
|
102
180
|
render: () => html`
|
|
103
181
|
<div style="display:flex; gap:16px; flex-wrap:wrap;">
|
|
104
|
-
<bd-link href="#"
|
|
105
|
-
<bd-link href="#"
|
|
182
|
+
<bd-link href="#" variant="primary" underline>Primary underlined</bd-link>
|
|
183
|
+
<bd-link href="#" variant="secondary" underline>Secondary underlined</bd-link>
|
|
106
184
|
</div>
|
|
107
185
|
`,
|
|
108
186
|
parameters: { docs: { description: { story: '`underline` prop adds `bd-link--underline` class.' } } }
|
|
@@ -110,7 +188,7 @@ export const WithUnderline = {
|
|
|
110
188
|
|
|
111
189
|
export const Disabled = {
|
|
112
190
|
name : 'Disabled',
|
|
113
|
-
render : () => html`<bd-link href="/products"
|
|
191
|
+
render : () => html`<bd-link href="/products" variant="primary" disabled>Unavailable link</bd-link>`,
|
|
114
192
|
parameters: { docs: { description: { story: 'Disabled link renders as `<span>` — not clickable, not navigable.' } } }
|
|
115
193
|
};
|
|
116
194
|
|
|
@@ -118,9 +196,9 @@ export const DisabledAllKinds = {
|
|
|
118
196
|
name : 'Disabled — All Kinds',
|
|
119
197
|
render: () => html`
|
|
120
198
|
<div style="display:flex; gap:16px; flex-wrap:wrap; align-items:center;">
|
|
121
|
-
<bd-link href="#"
|
|
122
|
-
<bd-link href="#"
|
|
123
|
-
<bd-link href="#"
|
|
199
|
+
<bd-link href="#" variant="primary" disabled>Primary disabled</bd-link>
|
|
200
|
+
<bd-link href="#" variant="secondary" disabled>Secondary disabled</bd-link>
|
|
201
|
+
<bd-link href="#" variant="light" disabled>Light disabled</bd-link>
|
|
124
202
|
</div>
|
|
125
203
|
`,
|
|
126
204
|
parameters: { docs: { description: { story: 'Disabled state across all three kind variants.' } } }
|
|
@@ -129,7 +207,7 @@ export const DisabledAllKinds = {
|
|
|
129
207
|
export const OpenInNewTab = {
|
|
130
208
|
name : 'Opens in New Tab',
|
|
131
209
|
render: () => html`
|
|
132
|
-
<bd-link href="https://bitdefender.com"
|
|
210
|
+
<bd-link href="https://bitdefender.com" variant="primary" target="_blank">
|
|
133
211
|
Visit Bitdefender.com
|
|
134
212
|
</bd-link>
|
|
135
213
|
`,
|
|
@@ -138,24 +216,37 @@ export const OpenInNewTab = {
|
|
|
138
216
|
|
|
139
217
|
export const InlineWithText = {
|
|
140
218
|
name : 'Inline Within Text',
|
|
219
|
+
/* Three paragraphs, because one at 16px cannot show this: 16px is the single
|
|
220
|
+
size at which a link that ignores its context still looks right. The first
|
|
221
|
+
two inherit; the third is the same markup without `inline`. */
|
|
141
222
|
render: () => html`
|
|
142
|
-
<p style="font-size:
|
|
143
|
-
Bitdefender offers award-winning protection.
|
|
144
|
-
<bd-link href="/products"
|
|
223
|
+
<p style="font-size: var(--typography-fontSize-sm); line-height: var(--typography-lineHeight-relaxed)">
|
|
224
|
+
At the small step, Bitdefender offers award-winning protection.
|
|
225
|
+
<bd-link href="/products" variant="primary" inline underline>View all products</bd-link>
|
|
145
226
|
to find the right plan for you.
|
|
146
227
|
</p>
|
|
228
|
+
<p style="font-size: var(--typography-fontSize-lg); line-height: var(--typography-lineHeight-relaxed)">
|
|
229
|
+
At the large step, the same link follows the sentence up.
|
|
230
|
+
<bd-link href="/products" variant="primary" inline underline>View all products</bd-link>
|
|
231
|
+
to find the right plan for you.
|
|
232
|
+
</p>
|
|
233
|
+
<p style="font-size: var(--typography-fontSize-lg); line-height: var(--typography-lineHeight-relaxed)">
|
|
234
|
+
Without <code>inline</code>, at that same large step, it does not:
|
|
235
|
+
<bd-link href="/products" variant="primary" underline>View all products</bd-link>
|
|
236
|
+
holds 1rem whatever surrounds it.
|
|
237
|
+
</p>
|
|
147
238
|
`,
|
|
148
|
-
parameters: { docs: { description: { story: '
|
|
239
|
+
parameters: { docs: { description: { story: '`inline` takes the size, leading, tracking and family from the sentence — the `--typography-link-default-*` role, whose axes are all `inherit`. Without it the link reads the standalone role and renders 1rem in any context, which is why the third paragraph disagrees with the two above it. `fontSize` is suppressed while `inline` is set, because the sentence has already answered that question.' } } }
|
|
149
240
|
};
|
|
150
241
|
|
|
151
242
|
export const NavigationLinks = {
|
|
152
243
|
name : 'Navigation Link Row',
|
|
153
244
|
render: () => html`
|
|
154
245
|
<nav style="display:flex; gap:24px; padding:16px; background:#1a1a1a;">
|
|
155
|
-
<bd-link href="/consumer"
|
|
156
|
-
<bd-link href="/small-business"
|
|
157
|
-
<bd-link href="/business"
|
|
158
|
-
<bd-link href="/partners"
|
|
246
|
+
<bd-link href="/consumer" variant="light">Consumer</bd-link>
|
|
247
|
+
<bd-link href="/small-business" variant="light">Small Business</bd-link>
|
|
248
|
+
<bd-link href="/business" variant="light">Business</bd-link>
|
|
249
|
+
<bd-link href="/partners" variant="light">Partners</bd-link>
|
|
159
250
|
</nav>
|
|
160
251
|
`,
|
|
161
252
|
parameters: { docs: { description: { story: 'Light kind links used as navigation items on a dark background.' } } }
|
|
@@ -165,5 +256,8 @@ export const Playground = {
|
|
|
165
256
|
name : '🛝 Playground',
|
|
166
257
|
args : { ...defaultArgs },
|
|
167
258
|
render,
|
|
168
|
-
parameters: {
|
|
169
|
-
}
|
|
259
|
+
parameters: {
|
|
260
|
+
controls: { disable: false },
|
|
261
|
+
docs : { description: { story: 'Interactive playground, and the only story wired to args. Every control here reaches the element: href, target, kind, underline, no-underline, active, disabled, inline, font-size and color.' } }
|
|
262
|
+
}
|
|
263
|
+
};
|
|
@@ -2,6 +2,16 @@ import { css } from "lit";
|
|
|
2
2
|
|
|
3
3
|
export default css`
|
|
4
4
|
@layer bd-components {
|
|
5
|
+
/* Sans, and the same ink as bd-p. This was set in --font-family-mono, so a
|
|
6
|
+
bulleted list rendered in monospace while the paragraph above it was in
|
|
7
|
+
sans — the only text atom in the system that was not. That token was also
|
|
8
|
+
a duplicate of --typography-fontFamily-mono carrying a shorter fallback
|
|
9
|
+
stack, so the two spellings of "mono" degraded differently; it has been
|
|
10
|
+
retired.
|
|
11
|
+
|
|
12
|
+
The ink was neutral-700 against bd-p's neutral-1000 and bd-display's
|
|
13
|
+
neutral-900. A list and the paragraph beside it are the same running text
|
|
14
|
+
and now take the same role. */
|
|
5
15
|
.bd-list-item {
|
|
6
16
|
margin: 0;
|
|
7
17
|
padding: 0;
|
|
@@ -9,25 +19,35 @@ export default css`
|
|
|
9
19
|
display: flex;
|
|
10
20
|
align-items: flex-start;
|
|
11
21
|
gap: var(--spacing-8);
|
|
12
|
-
color: var(--color-
|
|
13
|
-
|
|
14
|
-
font-family: var(--font-family-mono);
|
|
22
|
+
color: var(--color-text-primary);
|
|
23
|
+
font-family: var(--typography-fontFamily-sans);
|
|
15
24
|
}
|
|
16
25
|
|
|
17
26
|
/* === SIZE VARIANTS === */
|
|
18
27
|
|
|
28
|
+
/* The size ladder is body-small / body-regular / body-large: a list item is
|
|
29
|
+
running prose, which is what the body-* family is for. The leading used to
|
|
30
|
+
sit once on the base rule as lineHeight-normal for all three rungs; it now
|
|
31
|
+
comes from each rung's own role, which is what makes the ladder a role
|
|
32
|
+
ladder rather than three sizes over one shared number. */
|
|
19
33
|
.bd-list-item.sm {
|
|
20
|
-
|
|
34
|
+
--bd-li-line-height: var(--typography-body-small-lineHeight);
|
|
35
|
+
font-size: var(--typography-body-small-fontSize);
|
|
36
|
+
line-height: var(--bd-li-line-height);
|
|
21
37
|
margin-bottom: var(--spacing-4);
|
|
22
38
|
}
|
|
23
39
|
|
|
24
40
|
.bd-list-item.md {
|
|
25
|
-
|
|
41
|
+
--bd-li-line-height: var(--typography-body-regular-lineHeight);
|
|
42
|
+
font-size: var(--typography-body-regular-fontSize);
|
|
43
|
+
line-height: var(--bd-li-line-height);
|
|
26
44
|
margin-bottom: var(--bd-li-margin-bottom, var(--spacing-6));
|
|
27
45
|
}
|
|
28
46
|
|
|
29
47
|
.bd-list-item.lg {
|
|
30
|
-
|
|
48
|
+
--bd-li-line-height: var(--typography-body-large-lineHeight);
|
|
49
|
+
font-size: var(--typography-body-large-fontSize);
|
|
50
|
+
line-height: var(--bd-li-line-height);
|
|
31
51
|
margin-bottom: var(--spacing-8);
|
|
32
52
|
}
|
|
33
53
|
|
|
@@ -38,8 +58,13 @@ export default css`
|
|
|
38
58
|
align-self: flex-start;
|
|
39
59
|
/* centrează markerul pe înălțimea unei linii de text,
|
|
40
60
|
calculat din line-height-ul itemului, indiferent de size.
|
|
41
|
-
Se aplică doar markerelor "forme" (bullet, check) — nu textului (number).
|
|
42
|
-
|
|
61
|
+
Se aplică doar markerelor "forme" (bullet, check) — nu textului (number).
|
|
62
|
+
|
|
63
|
+
Reads the rung's own leading, not a fixed 1.5. The three rungs used to
|
|
64
|
+
share one leading on the base rule, so hard-coding it here was
|
|
65
|
+
equivalent; body-large is 1.625, so it no longer is, and a fixed ratio
|
|
66
|
+
would leave the bullet 1.125px above the line's centre at lg. */
|
|
67
|
+
margin-top: calc((1em * var(--bd-li-line-height, var(--typography-body-regular-lineHeight)) - var(--bd-li-marker-size, var(--spacing-6))) / 2);
|
|
43
68
|
}
|
|
44
69
|
|
|
45
70
|
/* Bullet List */
|
|
@@ -47,8 +72,8 @@ export default css`
|
|
|
47
72
|
--bd-li-marker-size: var(--spacing-6);
|
|
48
73
|
width: var(--bd-li-marker-size);
|
|
49
74
|
height: var(--bd-li-marker-size);
|
|
50
|
-
background-color: var(--bd-li-marker-color, var(--color-
|
|
51
|
-
border-radius:
|
|
75
|
+
background-color: var(--bd-li-marker-color, var(--color-text-primary));
|
|
76
|
+
border-radius: var(--radius-full);
|
|
52
77
|
}
|
|
53
78
|
|
|
54
79
|
/* Number List */
|
|
@@ -62,28 +87,54 @@ export default css`
|
|
|
62
87
|
|
|
63
88
|
.bd-list-item.number .bd-list-item-marker::before {
|
|
64
89
|
content: counter(bd-list-counter) ".";
|
|
90
|
+
/* no role: a marker glyph, not running prose. The number or bullet in
|
|
91
|
+
front of a list item is a symbol sized and weighted to sit against the
|
|
92
|
+
text beside it, the same category typography rule 7 already covers for
|
|
93
|
+
an icon-only line box's leading. A role describes text a reader reads
|
|
94
|
+
as a sentence; it has nothing to say about a glyph. This is the
|
|
95
|
+
argument for every "no role: glyph/marker/placeholder" marker in the
|
|
96
|
+
package -- the others point here rather than restating it. */
|
|
65
97
|
font-weight: var(--typography-fontWeight-semibold);
|
|
66
|
-
color: var(--bd-li-marker-color, var(--color-
|
|
98
|
+
color: var(--bd-li-marker-color, var(--color-text-primary));
|
|
67
99
|
}
|
|
68
100
|
|
|
69
101
|
/* Check List */
|
|
102
|
+
/* green-700, not green-500: the tick is white on this disc, and on
|
|
103
|
+
green-500 that measures 2.39:1 — it fails 1.4.3 as text and 1.4.11 as a
|
|
104
|
+
graphic. green-700 gives 4.75 and is the step bd-badge already picked for
|
|
105
|
+
white-on-green, for the same reason and with the same measurement.
|
|
106
|
+
.
|
|
107
|
+
So the disc and the tick are the badge's fill pair, and read it by name:
|
|
108
|
+
--status-success-fill and --status-success-on-fill. They used to read
|
|
109
|
+
-accent and --color-text-inverse, which resolve to the same two colours
|
|
110
|
+
here and are not the same two roles -- a dark theme moves the accent
|
|
111
|
+
and flips the inverse ink, and the pair it was borrowing from would come
|
|
112
|
+
apart. */
|
|
70
113
|
.bd-list-item.check .bd-list-item-marker {
|
|
71
114
|
--bd-li-marker-size: var(--spacing-16);
|
|
72
115
|
width: var(--bd-li-marker-size);
|
|
73
116
|
height: var(--bd-li-marker-size);
|
|
74
|
-
background-color: var(--
|
|
75
|
-
border-radius:
|
|
117
|
+
background-color: var(--status-success-fill);
|
|
118
|
+
border-radius: var(--radius-full);
|
|
76
119
|
position: relative;
|
|
77
120
|
}
|
|
78
121
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
122
|
+
/* The tick is bd-check-icon now, not a "✓" in a ::after. A character here was
|
|
123
|
+
type doing an icon's job -- it changed shape with the font and drew
|
|
124
|
+
differently on macOS and Windows, on a mark whose whole purpose is to be
|
|
125
|
+
recognised at 16px. The atom is drawn at the same 2-unit weight as
|
|
126
|
+
bd-plus-icon and bd-minus-icon, so the three read as one family.
|
|
127
|
+
.
|
|
128
|
+
The absolute centring went with it: the marker is a flex box now, which
|
|
129
|
+
also means no ::after and no transform to keep in step with the disc. The
|
|
130
|
+
icon inherits the white through currentColor from the colour set here, so
|
|
131
|
+
the contrast argument above still holds and is still measured on the disc
|
|
132
|
+
rather than on the glyph. */
|
|
133
|
+
.bd-list-item.check .bd-list-item-marker {
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
justify-content: center;
|
|
137
|
+
color: var(--status-success-on-fill);
|
|
87
138
|
}
|
|
88
139
|
|
|
89
140
|
/* Custom Icon */
|
|
@@ -92,7 +143,8 @@ export default css`
|
|
|
92
143
|
width: var(--bd-li-marker-size);
|
|
93
144
|
height: var(--bd-li-marker-size);
|
|
94
145
|
flex-shrink: 0;
|
|
95
|
-
|
|
146
|
+
/* the rung's own leading -- see .bd-list-item-marker above. */
|
|
147
|
+
margin-top: calc((1em * var(--bd-li-line-height, var(--typography-body-regular-lineHeight)) - var(--bd-li-marker-size)) / 2);
|
|
96
148
|
}
|
|
97
149
|
|
|
98
150
|
/* No Marker */
|
|
@@ -1,30 +1,48 @@
|
|
|
1
1
|
import { LitElement, html, nothing } from "lit";
|
|
2
|
-
|
|
2
|
+
// Installs the design tokens into document scope; see src/tokens/tokens.js
|
|
3
|
+
import "../../../tokens/tokens.js";
|
|
3
4
|
import listItemCSS from "./list-item.css.js";
|
|
5
|
+
import "../../icons/check-icon.js";
|
|
6
|
+
|
|
7
|
+
// the size steps list-item.css.js actually implements
|
|
8
|
+
const SIZE_STEPS = ['sm', 'md', 'lg'];
|
|
9
|
+
|
|
10
|
+
/** The markers this item can draw. */
|
|
11
|
+
const MARKERS = ['bullet', 'number', 'check', 'none'];
|
|
4
12
|
|
|
5
13
|
export class BdListItem extends LitElement {
|
|
6
14
|
static properties = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
variant: { type: String, reflect: true },
|
|
16
|
+
/** @deprecated pass `variant`. */
|
|
17
|
+
kind : { type: String },
|
|
18
|
+
size : { type: String }, // sm, md, lg
|
|
19
|
+
icon : { type: String }, // custom icon URL
|
|
20
|
+
color : { type: String } // optional
|
|
11
21
|
};
|
|
12
22
|
|
|
13
23
|
constructor() {
|
|
14
24
|
super();
|
|
15
|
-
this.
|
|
25
|
+
this.variant = "bullet";
|
|
26
|
+
this.kind = "";
|
|
16
27
|
this.size = "md";
|
|
17
28
|
this.icon = "";
|
|
18
29
|
this.color = "";
|
|
19
30
|
}
|
|
20
31
|
|
|
32
|
+
willUpdate(changed) {
|
|
33
|
+
if (changed.has("kind") && this.kind) this.variant = this.kind;
|
|
34
|
+
if (changed.has("variant") || changed.has("kind")) {
|
|
35
|
+
if (!MARKERS.includes(this.variant)) this.variant = "bullet";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
21
39
|
render() {
|
|
22
40
|
const style = this.color
|
|
23
41
|
? `color: ${this.color}; --bd-li-marker-color: ${this.color};`
|
|
24
42
|
: "";
|
|
25
43
|
|
|
26
44
|
return html`
|
|
27
|
-
<li class="bd-list-item ${this.
|
|
45
|
+
<li class="bd-list-item ${this.variant} ${SIZE_STEPS.includes(this.size) ? this.size : 'md'}" style="${style}">
|
|
28
46
|
${this._renderMarker()}
|
|
29
47
|
<span class="bd-list-item-content">
|
|
30
48
|
<slot></slot>
|
|
@@ -34,16 +52,20 @@ export class BdListItem extends LitElement {
|
|
|
34
52
|
}
|
|
35
53
|
|
|
36
54
|
_renderMarker() {
|
|
37
|
-
if (this.
|
|
55
|
+
if (this.variant === "none") return nothing;
|
|
38
56
|
|
|
39
57
|
if (this.icon) {
|
|
40
58
|
return html`<img src="${this.icon}" alt="" class="bd-list-item-custom-icon" />`;
|
|
41
59
|
}
|
|
42
60
|
|
|
43
|
-
return html`<span class="bd-list-item-marker"
|
|
61
|
+
return html`<span class="bd-list-item-marker">${
|
|
62
|
+
this.variant === "check"
|
|
63
|
+
? html`<bd-check-icon size="xs" aria-hidden="true"></bd-check-icon>`
|
|
64
|
+
: nothing
|
|
65
|
+
}</span>`;
|
|
44
66
|
}
|
|
45
67
|
|
|
46
|
-
static styles = [
|
|
68
|
+
static styles = [listItemCSS];
|
|
47
69
|
}
|
|
48
70
|
|
|
49
71
|
customElements.define("bd-li", BdListItem);
|
|
@@ -2,7 +2,7 @@ import { html } from "lit";
|
|
|
2
2
|
import "./list-item.js";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title : "
|
|
5
|
+
title : "Atoms/List item",
|
|
6
6
|
component : "bd-li",
|
|
7
7
|
tags : ["autodocs"],
|
|
8
8
|
parameters: {
|
|
@@ -13,9 +13,9 @@ export default {
|
|
|
13
13
|
Componentă Lit pentru un element de listă cu marker configurabil.
|
|
14
14
|
|
|
15
15
|
\`\`\`html
|
|
16
|
-
<bd-li
|
|
17
|
-
<bd-li
|
|
18
|
-
<bd-li
|
|
16
|
+
<bd-li variant="bullet" size="md">Text element</bd-li>
|
|
17
|
+
<bd-li variant="check" size="md">Element bifat</bd-li>
|
|
18
|
+
<bd-li variant="number" size="md">Element numerotat</bd-li>
|
|
19
19
|
\`\`\`
|
|
20
20
|
|
|
21
21
|
### Atribute
|
|
@@ -29,8 +29,8 @@ Componentă Lit pentru un element de listă cu marker configurabil.
|
|
|
29
29
|
\`bd-li\` este destinat uzului în interiorul \`bd-list\`:
|
|
30
30
|
\`\`\`html
|
|
31
31
|
<bd-list type="unordered" spacing="md">
|
|
32
|
-
<bd-li
|
|
33
|
-
<bd-li
|
|
32
|
+
<bd-li variant="bullet" size="md">Primul element</bd-li>
|
|
33
|
+
<bd-li variant="bullet" size="md">Al doilea element</bd-li>
|
|
34
34
|
</bd-list>
|
|
35
35
|
\`\`\`
|
|
36
36
|
`
|
|
@@ -38,7 +38,7 @@ Componentă Lit pentru un element de listă cu marker configurabil.
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
argTypes: {
|
|
41
|
-
|
|
41
|
+
variant: {
|
|
42
42
|
control : { type: "select" },
|
|
43
43
|
options : ["bullet", "number", "check", "none"],
|
|
44
44
|
description: "Tipul marker-ului",
|
|
@@ -64,7 +64,7 @@ export const Default = {
|
|
|
64
64
|
name : "Default",
|
|
65
65
|
args : { kind: "bullet", size: "md" },
|
|
66
66
|
render: ({ kind, size }) => html`
|
|
67
|
-
<bd-li
|
|
67
|
+
<bd-li variant="${kind}" size="${size}">Default list item with bullet marker</bd-li>
|
|
68
68
|
`
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -74,7 +74,7 @@ export const Bullet = {
|
|
|
74
74
|
name : "Bullet",
|
|
75
75
|
args : { kind: "bullet", size: "md" },
|
|
76
76
|
render: ({ kind, size }) => html`
|
|
77
|
-
<bd-li
|
|
77
|
+
<bd-li variant="${kind}" size="${size}">Item with bullet marker</bd-li>
|
|
78
78
|
`
|
|
79
79
|
};
|
|
80
80
|
|
|
@@ -84,7 +84,7 @@ export const Number = {
|
|
|
84
84
|
name : "Number",
|
|
85
85
|
args : { kind: "number", size: "md" },
|
|
86
86
|
render: ({ kind, size }) => html`
|
|
87
|
-
<bd-li
|
|
87
|
+
<bd-li variant="${kind}" size="${size}">Item with number marker</bd-li>
|
|
88
88
|
`
|
|
89
89
|
};
|
|
90
90
|
|
|
@@ -94,7 +94,7 @@ export const Check = {
|
|
|
94
94
|
name : "Check",
|
|
95
95
|
args : { kind: "check", size: "md" },
|
|
96
96
|
render: ({ kind, size }) => html`
|
|
97
|
-
<bd-li
|
|
97
|
+
<bd-li variant="${kind}" size="${size}">Item with checkmark marker</bd-li>
|
|
98
98
|
`
|
|
99
99
|
};
|
|
100
100
|
|
|
@@ -104,7 +104,7 @@ export const None = {
|
|
|
104
104
|
name : "None",
|
|
105
105
|
args : { kind: "none", size: "md" },
|
|
106
106
|
render: ({ kind, size }) => html`
|
|
107
|
-
<bd-li
|
|
107
|
+
<bd-li variant="${kind}" size="${size}">Item without marker</bd-li>
|
|
108
108
|
`
|
|
109
109
|
};
|
|
110
110
|
|
|
@@ -115,9 +115,9 @@ export const SizeVariants = {
|
|
|
115
115
|
parameters: { controls: { disable: true } },
|
|
116
116
|
render : () => html`
|
|
117
117
|
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
118
|
-
<bd-li
|
|
119
|
-
<bd-li
|
|
120
|
-
<bd-li
|
|
118
|
+
<bd-li variant="bullet" size="sm">Small list item (sm)</bd-li>
|
|
119
|
+
<bd-li variant="bullet" size="md">Medium list item (md)</bd-li>
|
|
120
|
+
<bd-li variant="bullet" size="lg">Large list item (lg)</bd-li>
|
|
121
121
|
</div>
|
|
122
122
|
`
|
|
123
123
|
};
|
|
@@ -129,10 +129,10 @@ export const AllKinds = {
|
|
|
129
129
|
parameters: { controls: { disable: true } },
|
|
130
130
|
render : () => html`
|
|
131
131
|
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
132
|
-
<bd-li
|
|
133
|
-
<bd-li
|
|
134
|
-
<bd-li
|
|
135
|
-
<bd-li
|
|
132
|
+
<bd-li variant="bullet" size="md">Bullet — marker punct negru</bd-li>
|
|
133
|
+
<bd-li variant="number" size="md">Number — marker număr</bd-li>
|
|
134
|
+
<bd-li variant="check" size="md">Check — marker bifă verde</bd-li>
|
|
135
|
+
<bd-li variant="none" size="md">None — fără marker</bd-li>
|
|
136
136
|
</div>
|
|
137
137
|
`
|
|
138
138
|
};
|
|
@@ -143,7 +143,7 @@ export const WithRichContent = {
|
|
|
143
143
|
name : "Cu conținut rich",
|
|
144
144
|
parameters: { controls: { disable: true } },
|
|
145
145
|
render : () => html`
|
|
146
|
-
<bd-li
|
|
146
|
+
<bd-li variant="bullet" size="lg">
|
|
147
147
|
<strong>Element evidențiat</strong> cu text descriptiv suplimentar care se poate întinde
|
|
148
148
|
pe mai multe rânduri, menținând alinierea corectă față de marker.
|
|
149
149
|
</bd-li>
|
|
@@ -157,9 +157,9 @@ export const Playground = {
|
|
|
157
157
|
args : { kind: "bullet", size: "md" },
|
|
158
158
|
render: ({ kind, size }) => html`
|
|
159
159
|
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
|
160
|
-
<bd-li
|
|
161
|
-
<bd-li
|
|
162
|
-
<bd-li
|
|
160
|
+
<bd-li variant="${kind}" size="${size}">Primul element de listă</bd-li>
|
|
161
|
+
<bd-li variant="${kind}" size="${size}">Al doilea element de listă</bd-li>
|
|
162
|
+
<bd-li variant="${kind}" size="${size}">Al treilea element de listă</bd-li>
|
|
163
163
|
</div>
|
|
164
164
|
`
|
|
165
165
|
};
|