@repobit/dex-system-design 0.20.0 → 0.21.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 +9 -0
- package/package.json +2 -2
- package/src/components/Button/button.stories.js +51 -51
- package/src/components/accordion/accordion-bg.css.js +141 -123
- package/src/components/accordion/accordion-bg.stories.js +102 -72
- package/src/components/accordion/accordion-light.stories.js +78 -53
- package/src/components/anchor/anchor.stories.js +24 -22
- package/src/components/back/back.css.js +56 -0
- package/src/components/back/back.js +39 -0
- package/src/components/back/back.stories.js +184 -0
- package/src/components/badge/badge.stories.js +3 -10
- package/src/components/breadcrumb/breadcrumb.css.js +98 -0
- package/src/components/breadcrumb/breadcrumb.js +136 -0
- package/src/components/breadcrumb/breadcrumb.stories.js +109 -0
- package/src/components/cards/card.js +2 -1
- package/src/components/cards/card.stories.js +49 -49
- package/src/components/carousel/carousel.css.js +8 -1
- package/src/components/carousel/carousel.js +0 -1
- package/src/components/carousel/carousel.stories.js +21 -17
- package/src/components/display/display.css.js +68 -0
- package/src/components/display/display.js +26 -0
- package/src/components/display/display.stories.js +339 -0
- package/src/components/divider/divider-horizontal.js +1 -1
- package/src/components/footer/footer-links-group.js +3 -3
- package/src/components/footer/footer-lp.stories.js +0 -1
- package/src/components/footer/footer.css.js +0 -6
- package/src/components/footer/footer.js +21 -41
- package/src/components/footer/footer.stories.js +0 -1
- package/src/components/header/header.js +11 -11
- package/src/components/header/header.stories.js +36 -4
- package/src/components/heading/heading.css.js +79 -0
- package/src/components/heading/heading.js +79 -0
- package/src/components/heading/heading.stories.js +260 -0
- package/src/components/highlight/highlight.stories.js +1 -1
- package/src/components/image/image.css.js +101 -0
- package/src/components/image/image.js +57 -0
- package/src/components/image/image.stories.js +245 -0
- package/src/components/light-carousel/light-carousel-simple.js +3 -2
- package/src/components/light-carousel/light-carousel.js +3 -7
- package/src/components/light-carousel/light-carousel.stories.js +12 -13
- package/src/components/link/link.css.js +107 -18
- package/src/components/link/link.js +16 -12
- package/src/components/link/link.stories.js +177 -0
- package/src/components/list/list-item/list-item.css.js +106 -0
- package/src/components/list/list-item/list-item.js +43 -0
- package/src/components/list/list-item/list-item.stories.js +79 -0
- package/src/components/list/list.css.js +175 -0
- package/src/components/list/list.js +44 -0
- package/src/components/modal/modal.js +6 -5
- package/src/components/paragraph/paragraph.css.js +41 -11
- package/src/components/paragraph/paragraph.js +7 -45
- package/src/components/paragraph/paragraph.stories.js +235 -0
- package/src/components/picture/picture.css.js +0 -0
- package/src/components/picture/picture.js +46 -0
- package/src/components/picture/picture.stories.js +275 -0
- package/src/components/pricing-cards/pricing-card-header.js +9 -7
- package/src/components/pricing-cards/pricing-card-pricing.js +11 -12
- package/src/components/pricing-cards/pricing-card.js +37 -36
- package/src/components/tabs/tabs.js +44 -47
- package/src/components/termsOfUse/terms.js +77 -161
- package/src/components/termsOfUse/terms.stories.js +4 -3
- package/src/stories/Header.js +6 -6
- package/src/tokens/tokens.stories.js +9 -8
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
2
|
import { tokens } from "../../tokens/tokens.js";
|
|
3
3
|
import headerCSS from "../header/header.css.js";
|
|
4
|
+
import "../heading/heading.js";
|
|
5
|
+
import "../paragraph/paragraph.js";
|
|
4
6
|
|
|
5
7
|
class Header extends LitElement {
|
|
6
8
|
static properties = {
|
|
@@ -20,15 +22,13 @@ class Header extends LitElement {
|
|
|
20
22
|
super.attributeChangedCallback(name, oldVal, newVal);
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
25
|
render() {
|
|
26
26
|
return html`
|
|
27
27
|
<div class="bd-container">
|
|
28
28
|
<div class="bd-header-left">
|
|
29
|
-
<h2 class="bd-product-name">${this.productName}</
|
|
30
|
-
<
|
|
31
|
-
<p class="bd-description">${this.description}</p>
|
|
29
|
+
<bd-h as="h2" class="bd-product-name">${this.productName}</bd-h>
|
|
30
|
+
<bd-h as="h4" class="bd-value-prop">${this.valueProp}</bd-h>
|
|
31
|
+
<bd-p kind="regular" class="bd-description">${this.description}</bd-p>
|
|
32
32
|
|
|
33
33
|
<div class="bd-price-zone-top">
|
|
34
34
|
<span class="bd-full-price">${this.fullPrice}</span>
|
|
@@ -58,23 +58,23 @@ class Header extends LitElement {
|
|
|
58
58
|
</bd-button>
|
|
59
59
|
</div>
|
|
60
60
|
|
|
61
|
-
<small class="bd-disclaimer-top">
|
|
61
|
+
<bd-p kind="small" class="bd-disclaimer-top">
|
|
62
62
|
<slot name="disclaimer-top">
|
|
63
63
|
Protection for 1 account & 5 PCs, Macs, tablets, or smartphones.
|
|
64
64
|
Windows® | macOS® | Android™ | iOS®
|
|
65
65
|
</slot>
|
|
66
|
-
</
|
|
66
|
+
</bd-p>
|
|
67
67
|
|
|
68
|
-
<small class="bd-disclaimer-bottom">
|
|
68
|
+
<bd-p kind="small" class="bd-disclaimer-bottom">
|
|
69
69
|
<slot name="disclaimer-bottom-text-start"></slot>
|
|
70
70
|
<slot name="disclaimer-bottom-link"></slot>
|
|
71
71
|
<slot name="disclaimer-bottom-text-end"></slot>
|
|
72
|
-
</
|
|
72
|
+
</bd-p>
|
|
73
73
|
</div>
|
|
74
74
|
|
|
75
75
|
<div class="bd-header-right">
|
|
76
76
|
<div class="bd-header-image-wrapper">
|
|
77
|
-
<slot name="header-
|
|
77
|
+
<slot name="header-picture"></slot>
|
|
78
78
|
<div class="bd-header-watermark"><span>Trusted. Always.</span></div>
|
|
79
79
|
</div>
|
|
80
80
|
</div>
|
|
@@ -85,4 +85,4 @@ class Header extends LitElement {
|
|
|
85
85
|
|
|
86
86
|
Header.styles = [tokens, headerCSS];
|
|
87
87
|
|
|
88
|
-
customElements.define("bd-header", Header);
|
|
88
|
+
customElements.define("bd-header", Header);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
+
import '../picture/picture.js';
|
|
2
3
|
import './header.js';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
@@ -29,7 +30,32 @@ const Template = (args) => html`
|
|
|
29
30
|
.finalPrice=${args.finalPrice}
|
|
30
31
|
>
|
|
31
32
|
${args.headerImage
|
|
32
|
-
? html
|
|
33
|
+
? html`
|
|
34
|
+
<bd-picture
|
|
35
|
+
slot="header-picture"
|
|
36
|
+
.sources=${[
|
|
37
|
+
{
|
|
38
|
+
type : 'image/webp',
|
|
39
|
+
srcset: args.headerImage,
|
|
40
|
+
media : '(min-width: 1200px)'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type : 'image/webp',
|
|
44
|
+
srcset: args.headerImage,
|
|
45
|
+
media : '(min-width: 768px)'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type : 'image/webp',
|
|
49
|
+
srcset: args.headerImage
|
|
50
|
+
}
|
|
51
|
+
]}
|
|
52
|
+
alt="Security illustration"
|
|
53
|
+
fallback-src="${args.headerImage}"
|
|
54
|
+
loading="eager"
|
|
55
|
+
width="750"
|
|
56
|
+
height="500"
|
|
57
|
+
></bd-picture>
|
|
58
|
+
`
|
|
33
59
|
: ''}
|
|
34
60
|
|
|
35
61
|
${args.disclaimerTop
|
|
@@ -54,7 +80,7 @@ Default.args = {
|
|
|
54
80
|
fullPrice : '$139.99',
|
|
55
81
|
discount : 'Save 44%',
|
|
56
82
|
finalPrice : '$79.99*',
|
|
57
|
-
headerImage : '/
|
|
83
|
+
headerImage : 'https://picsum.photos/750/500',
|
|
58
84
|
disclaimerTop : 'Protection for 1 account & 5 PCs, Macs, tablets, or smartphones. Windows® | macOS® | Android™ | iOS®',
|
|
59
85
|
disclaimerBottomStart: 'Learn more about',
|
|
60
86
|
disclaimerBottomLink : 'Terms & Conditions',
|
|
@@ -64,7 +90,7 @@ Default.args = {
|
|
|
64
90
|
export const WithCustomImage = Template.bind({});
|
|
65
91
|
WithCustomImage.args = {
|
|
66
92
|
...Default.args,
|
|
67
|
-
headerImage: '/
|
|
93
|
+
headerImage: 'https://picsum.photos/750/500?random=1'
|
|
68
94
|
};
|
|
69
95
|
|
|
70
96
|
export const WithDiscountedPrice = Template.bind({});
|
|
@@ -75,9 +101,15 @@ WithDiscountedPrice.args = {
|
|
|
75
101
|
fullPrice : '$199.99',
|
|
76
102
|
discount : 'Save 35%',
|
|
77
103
|
finalPrice : '$129.99*',
|
|
78
|
-
headerImage : '/
|
|
104
|
+
headerImage : 'https://picsum.photos/750/500?random=2',
|
|
79
105
|
disclaimerTop : 'Protection for 1 account & 5 devices.',
|
|
80
106
|
disclaimerBottomStart: 'See',
|
|
81
107
|
disclaimerBottomLink : 'Details',
|
|
82
108
|
disclaimerBottomEnd : 'for more info.'
|
|
83
109
|
};
|
|
110
|
+
|
|
111
|
+
export const WithLocalImage = Template.bind({});
|
|
112
|
+
WithLocalImage.args = {
|
|
113
|
+
...Default.args,
|
|
114
|
+
headerImage: '/assets/bd-header-us.jpg'
|
|
115
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export default css`
|
|
4
|
+
@layer bd-components {
|
|
5
|
+
.bd-heading {
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
color: var(--color-neutral-900);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* h1 */
|
|
12
|
+
.bd-heading.h1 {
|
|
13
|
+
font-size: var(--typography-heading-h1-fontSize);
|
|
14
|
+
font-weight: var(--typography-heading-h1-fontWeight);
|
|
15
|
+
line-height: var(--typography-heading-h1-lineHeight);
|
|
16
|
+
letter-spacing: var(--typography-heading-h1-letterSpacing);
|
|
17
|
+
font-family: var(--typography-heading-h1-fontFamily);
|
|
18
|
+
// margin-bottom: var(--spacing-24);
|
|
19
|
+
// margin-top: var(--spacing-32);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* h2 */
|
|
23
|
+
.bd-heading.h2 {
|
|
24
|
+
font-size: var(--typography-heading-h2-fontSize);
|
|
25
|
+
font-weight: var(--typography-heading-h2-fontWeight);
|
|
26
|
+
line-height: var(--typography-heading-h2-lineHeight);
|
|
27
|
+
letter-spacing: var(--typography-heading-h2-letterSpacing);
|
|
28
|
+
font-family: var(--typography-heading-h2-fontFamily);
|
|
29
|
+
// margin-bottom: var(--spacing-20);
|
|
30
|
+
// margin-top: var(--spacing-28);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* h3 */
|
|
34
|
+
.bd-heading.h3 {
|
|
35
|
+
font-size: var(--typography-heading-h3-fontSize);
|
|
36
|
+
font-weight: var(--typography-heading-h3-fontWeight);
|
|
37
|
+
line-height: var(--typography-heading-h3-lineHeight);
|
|
38
|
+
letter-spacing: var(--typography-heading-h3-letterSpacing);
|
|
39
|
+
font-family: var(--typography-heading-h3-fontFamily);
|
|
40
|
+
// margin-bottom: var(--spacing-16);
|
|
41
|
+
// margin-top: var(--spacing-24);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* h4 */
|
|
45
|
+
.bd-heading.h4 {
|
|
46
|
+
font-size: var(--typography-heading-h4-fontSize);
|
|
47
|
+
font-weight: var(--typography-heading-h4-fontWeight);
|
|
48
|
+
line-height: var(--typography-heading-h4-lineHeight);
|
|
49
|
+
letter-spacing: var(--typography-heading-h4-letterSpacing);
|
|
50
|
+
font-family: var(--typography-heading-h4-fontFamily);
|
|
51
|
+
// margin-bottom: var(--spacing-12);
|
|
52
|
+
// margin-top: var(--spacing-20);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* h5 */
|
|
56
|
+
.bd-heading.h5 {
|
|
57
|
+
font-size: var(--typography-heading-h5-fontSize);
|
|
58
|
+
font-weight: var(--typography-heading-h5-fontWeight);
|
|
59
|
+
line-height: var(--typography-heading-h5-lineHeight);
|
|
60
|
+
letter-spacing: var(--typography-heading-h5-letterSpacing);
|
|
61
|
+
font-family: var(--typography-heading-h5-fontFamily);
|
|
62
|
+
// margin-bottom: var(--spacing-8);
|
|
63
|
+
// margin-top: var(--spacing-16);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* h6 */
|
|
67
|
+
.bd-heading.h6 {
|
|
68
|
+
font-size: var(--typography-heading-h6-fontSize);
|
|
69
|
+
font-weight: var(--typography-heading-h6-fontWeight);
|
|
70
|
+
line-height: var(--typography-heading-h6-lineHeight);
|
|
71
|
+
letter-spacing: var(--typography-heading-h6-letterSpacing);
|
|
72
|
+
font-family: var(--typography-heading-h6-fontFamily);
|
|
73
|
+
// margin-bottom: var(--spacing-6);
|
|
74
|
+
// margin-top: var(--spacing-12);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
`;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { LitElement, html } from "lit";
|
|
2
|
+
import { tokens } from "../../tokens/tokens.js";
|
|
3
|
+
import headingCSS from "./heading.css.js";
|
|
4
|
+
|
|
5
|
+
export class BdH extends LitElement {
|
|
6
|
+
static properties = {
|
|
7
|
+
as : { type: String, reflect: true },
|
|
8
|
+
ariaLevel : { type: Number, attribute: "aria-level" },
|
|
9
|
+
padding : { type: String },
|
|
10
|
+
fontWeight: { type: String },
|
|
11
|
+
color : { type: String }
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.as = "h1";
|
|
17
|
+
this.ariaLevel = null;
|
|
18
|
+
this.padding = "";
|
|
19
|
+
this.fontWeight = "";
|
|
20
|
+
this.color = "";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
_isValidHeadingTag(tag) {
|
|
24
|
+
return ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_getValidFontWeight(weight) {
|
|
28
|
+
const validWeights = [
|
|
29
|
+
"100", "200", "300", "400", "500", "600", "700", "800", "900",
|
|
30
|
+
"normal", "bold", "lighter", "bolder"
|
|
31
|
+
];
|
|
32
|
+
return validWeights.includes(weight) ? weight : "";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_getValidColor(color) {
|
|
36
|
+
if (!color) return "";
|
|
37
|
+
if (
|
|
38
|
+
color.startsWith("var(") ||
|
|
39
|
+
color.startsWith("#") ||
|
|
40
|
+
color.startsWith("rgb") ||
|
|
41
|
+
color.startsWith("hsl")
|
|
42
|
+
) {
|
|
43
|
+
return color;
|
|
44
|
+
}
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_computeStyles() {
|
|
49
|
+
const styles = [];
|
|
50
|
+
|
|
51
|
+
const validFontWeight = this._getValidFontWeight(this.fontWeight);
|
|
52
|
+
const validColor = this._getValidColor(this.color);
|
|
53
|
+
|
|
54
|
+
if (this.padding) styles.push(`padding: ${this.padding};`);
|
|
55
|
+
if (validFontWeight) styles.push(`font-weight: ${validFontWeight};`);
|
|
56
|
+
if (validColor) styles.push(`color: ${validColor};`);
|
|
57
|
+
|
|
58
|
+
return styles.join(" ");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
render() {
|
|
63
|
+
const tag = this._isValidHeadingTag(this.as) ? this.as : "h1";
|
|
64
|
+
const element = document.createElement(tag);
|
|
65
|
+
element.className = `bd-heading ${tag}`;
|
|
66
|
+
if (this.ariaLevel) element.setAttribute("aria-level", this.ariaLevel);
|
|
67
|
+
|
|
68
|
+
const styles = this._computeStyles();
|
|
69
|
+
if (styles) element.setAttribute("style", styles);
|
|
70
|
+
|
|
71
|
+
element.innerHTML = `<slot></slot>`;
|
|
72
|
+
return html`${element}`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
static styles = [tokens, headingCSS];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
customElements.define("bd-h", BdH);
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import './heading.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title : 'Atoms/Heading',
|
|
6
|
+
component: 'bd-h',
|
|
7
|
+
argTypes : {
|
|
8
|
+
kind: {
|
|
9
|
+
control : { type: 'select' },
|
|
10
|
+
options : ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
|
11
|
+
description: 'Heading level (h1-h6)'
|
|
12
|
+
},
|
|
13
|
+
content: {
|
|
14
|
+
control : 'text',
|
|
15
|
+
description: 'Heading text content'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component: 'A customizable heading component with semantic HTML and consistent typography.'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const Template = ({ kind, content }) => html`
|
|
28
|
+
<bd-h as="${kind}">${content}</bd-h>
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
export const AllHeadings = () => html`
|
|
32
|
+
<div style="display: flex; flex-direction: column; gap: 2rem;">
|
|
33
|
+
<bd-h as="h1">Heading Level 1 - Main Title</bd-h>
|
|
34
|
+
<bd-h as="h2">Heading Level 2 - Section Title</bd-h>
|
|
35
|
+
<bd-h as="h3">Heading Level 3 - Subsection Title</bd-h>
|
|
36
|
+
<bd-h as="h4">Heading Level 4 - Card Title</bd-h>
|
|
37
|
+
<bd-h as="h5">Heading Level 5 - Small Heading</bd-h>
|
|
38
|
+
<bd-h as="h6">Heading Level 6 - Minor Heading</bd-h>
|
|
39
|
+
</div>
|
|
40
|
+
`;
|
|
41
|
+
AllHeadings.parameters = {
|
|
42
|
+
docs: {
|
|
43
|
+
description: {
|
|
44
|
+
story: 'All heading levels from h1 to h6 displayed together for comparison.'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Heading1 = Template.bind({});
|
|
50
|
+
Heading1.args = {
|
|
51
|
+
kind : 'h1',
|
|
52
|
+
content: 'Main Page Title (h1)'
|
|
53
|
+
};
|
|
54
|
+
Heading1.parameters = {
|
|
55
|
+
docs: {
|
|
56
|
+
description: {
|
|
57
|
+
story: 'Primary heading level for main page titles and important sections.'
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const Heading2 = Template.bind({});
|
|
63
|
+
Heading2.args = {
|
|
64
|
+
kind : 'h2',
|
|
65
|
+
content: 'Section Title (h2)'
|
|
66
|
+
};
|
|
67
|
+
Heading2.parameters = {
|
|
68
|
+
docs: {
|
|
69
|
+
description: {
|
|
70
|
+
story: 'Secondary heading level for major section titles.'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const Heading3 = Template.bind({});
|
|
76
|
+
Heading3.args = {
|
|
77
|
+
kind : 'h3',
|
|
78
|
+
content: 'Subsection Title (h3)'
|
|
79
|
+
};
|
|
80
|
+
Heading3.parameters = {
|
|
81
|
+
docs: {
|
|
82
|
+
description: {
|
|
83
|
+
story: 'Tertiary heading level for subsection titles and card headers.'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const Heading4 = Template.bind({});
|
|
89
|
+
Heading4.args = {
|
|
90
|
+
kind : 'h4',
|
|
91
|
+
content: 'Card Title (h4)'
|
|
92
|
+
};
|
|
93
|
+
Heading4.parameters = {
|
|
94
|
+
docs: {
|
|
95
|
+
description: {
|
|
96
|
+
story: 'Heading level for card titles, feature names, and smaller sections.'
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const Heading5 = Template.bind({});
|
|
102
|
+
Heading5.args = {
|
|
103
|
+
kind : 'h5',
|
|
104
|
+
content: 'Small Heading (h5)'
|
|
105
|
+
};
|
|
106
|
+
Heading5.parameters = {
|
|
107
|
+
docs: {
|
|
108
|
+
description: {
|
|
109
|
+
story: 'Small heading level for less important titles and labels.'
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const Heading6 = Template.bind({});
|
|
115
|
+
Heading6.args = {
|
|
116
|
+
kind : 'h6',
|
|
117
|
+
content: 'Minor Heading (h6)'
|
|
118
|
+
};
|
|
119
|
+
Heading6.parameters = {
|
|
120
|
+
docs: {
|
|
121
|
+
description: {
|
|
122
|
+
story: 'Smallest heading level for minor titles and captions.'
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const WithParagraphs = () => html`
|
|
128
|
+
<div style="max-width: 800px; margin: 0 auto;">
|
|
129
|
+
<bd-h as="h1">Product Features</bd-h>
|
|
130
|
+
<bd-p kind="regular">Discover all the powerful features that make our product stand out from the competition.</bd-p>
|
|
131
|
+
|
|
132
|
+
<bd-h as="h2">Security Features</bd-h>
|
|
133
|
+
<bd-p kind="regular">Our advanced security features protect you from all types of online threats.</bd-p>
|
|
134
|
+
|
|
135
|
+
<bd-h as="h3">Real-time Protection</bd-h>
|
|
136
|
+
<bd-p kind="regular">Continuous monitoring and protection against emerging threats.</bd-p>
|
|
137
|
+
|
|
138
|
+
<bd-h as="h4">Behavioral Detection</bd-h>
|
|
139
|
+
<bd-p kind="regular">Advanced algorithms detect suspicious behavior patterns.</bd-p>
|
|
140
|
+
|
|
141
|
+
<bd-h as="h5">System Requirements</bd-h>
|
|
142
|
+
<bd-p kind="small">Windows 10/11, 2GB RAM, 2.5GB free space</bd-p>
|
|
143
|
+
</div>
|
|
144
|
+
`;
|
|
145
|
+
WithParagraphs.parameters = {
|
|
146
|
+
docs: {
|
|
147
|
+
description: {
|
|
148
|
+
story: 'Headings used in context with paragraph components to demonstrate proper hierarchy.'
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const InCardLayout = () => html`
|
|
154
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; padding: 2rem;">
|
|
155
|
+
<div style="border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.5rem;">
|
|
156
|
+
<bd-h as="h3">Advanced Protection</bd-h>
|
|
157
|
+
<bd-p kind="regular">Comprehensive security against malware, ransomware, and online threats.</bd-p>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<div style="border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.5rem;">
|
|
161
|
+
<bd-h as="h3">Privacy Features</bd-h>
|
|
162
|
+
<bd-p kind="regular">VPN, password manager, and webcam protection to keep your data safe.</bd-p>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<div style="border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.5rem;">
|
|
166
|
+
<bd-h as="h3">Performance</bd-h>
|
|
167
|
+
<bd-p kind="regular">Lightweight design with minimal impact on system resources.</bd-p>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
`;
|
|
171
|
+
InCardLayout.parameters = {
|
|
172
|
+
docs: {
|
|
173
|
+
description: {
|
|
174
|
+
story: 'Headings used in card layouts to demonstrate real-world usage patterns.'
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export const AccessibilityExample = () => html`
|
|
180
|
+
<div style="max-width: 800px; margin: 0 auto;">
|
|
181
|
+
<bd-h as="h1">Accessibility Guidelines</bd-h>
|
|
182
|
+
<bd-p kind="regular">Proper heading hierarchy is essential for screen reader users and SEO.</bd-p>
|
|
183
|
+
|
|
184
|
+
<bd-h as="h2">Semantic Structure</bd-h>
|
|
185
|
+
<bd-p kind="regular">Headings should follow a logical hierarchy without skipping levels.</bd-p>
|
|
186
|
+
|
|
187
|
+
<bd-h as="h3">Best Practices</bd-h>
|
|
188
|
+
<bd-p kind="regular">Each page should have one h1, followed by h2, h3, etc. in order.</bd-p>
|
|
189
|
+
|
|
190
|
+
<bd-h as="h4">Screen Readers</bd-h>
|
|
191
|
+
<bd-p kind="regular">Users can navigate by headings to understand page structure quickly.</bd-p>
|
|
192
|
+
|
|
193
|
+
<bd-h as="h5">SEO Benefits</bd-h>
|
|
194
|
+
<bd-p kind="regular">Search engines use heading structure to understand content importance.</bd-p>
|
|
195
|
+
</div>
|
|
196
|
+
`;
|
|
197
|
+
AccessibilityExample.parameters = {
|
|
198
|
+
docs: {
|
|
199
|
+
description: {
|
|
200
|
+
story: 'Demonstrates proper semantic heading hierarchy for accessibility and SEO.'
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export const ResponsiveExample = () => html`
|
|
206
|
+
<div style="max-width: 100%; padding: 2rem;">
|
|
207
|
+
<bd-h as="h1">Responsive Design</bd-h>
|
|
208
|
+
<bd-p kind="regular">This heading will adjust its size based on the viewport and CSS variables.</bd-p>
|
|
209
|
+
|
|
210
|
+
<div style="display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 2rem;">
|
|
211
|
+
<div style="flex: 1; min-width: 200px;">
|
|
212
|
+
<bd-h as="h3">Mobile First</bd-h>
|
|
213
|
+
<bd-p kind="small">Optimized for small screens with appropriate font sizes.</bd-p>
|
|
214
|
+
</div>
|
|
215
|
+
<div style="flex: 1; min-width: 200px;">
|
|
216
|
+
<bd-h as="h3">Tablet Ready</bd-h>
|
|
217
|
+
<bd-p kind="small">Scales perfectly for medium-sized devices.</bd-p>
|
|
218
|
+
</div>
|
|
219
|
+
<div style="flex: 1; min-width: 200px;">
|
|
220
|
+
<bd-h as="h3">Desktop Perfect</bd-h>
|
|
221
|
+
<bd-p kind="small">Looks great on large screens and monitors.</bd-p>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
`;
|
|
226
|
+
ResponsiveExample.parameters = {
|
|
227
|
+
docs: {
|
|
228
|
+
description: {
|
|
229
|
+
story: 'Shows how headings work in responsive layouts and different screen sizes.'
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export const InteractiveExample = () => {
|
|
235
|
+
const headings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
236
|
+
|
|
237
|
+
return html`
|
|
238
|
+
<div style="max-width: 800px; margin: 0 auto;">
|
|
239
|
+
<bd-h as="h2">Interactive Heading Demo</bd-h>
|
|
240
|
+
<bd-p kind="regular">Select different heading levels to see how they look:</bd-p>
|
|
241
|
+
|
|
242
|
+
${headings.map(kind => html`
|
|
243
|
+
<div style="margin: 2rem 0; padding: 1rem; border-left: 4px solid #3b82f6;">
|
|
244
|
+
<bd-h as="${kind}">This is a ${kind.toUpperCase()} heading</bd-h>
|
|
245
|
+
<bd-p kind="small" style="margin-top: 0.5rem;">
|
|
246
|
+
Font size: var(--typography-heading-${kind}-fontSize)<br>
|
|
247
|
+
Font weight: var(--typography-heading-${kind}-fontWeight)
|
|
248
|
+
</bd-p>
|
|
249
|
+
</div>
|
|
250
|
+
`)}
|
|
251
|
+
</div>
|
|
252
|
+
`;
|
|
253
|
+
};
|
|
254
|
+
InteractiveExample.parameters = {
|
|
255
|
+
docs: {
|
|
256
|
+
description: {
|
|
257
|
+
story: 'Interactive demonstration showing all heading levels with their CSS variable values.'
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export default css`
|
|
4
|
+
@layer bd-components {
|
|
5
|
+
.bd-img {
|
|
6
|
+
display: block;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
height: auto;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Object Fit Variants */
|
|
12
|
+
.bd-img.cover {
|
|
13
|
+
object-fit: cover;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.bd-img.contain {
|
|
17
|
+
object-fit: contain;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.bd-img.fill {
|
|
21
|
+
object-fit: fill;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.bd-img.none {
|
|
25
|
+
object-fit: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.bd-img.scale-down {
|
|
29
|
+
object-fit: scale-down;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Rounded Variants */
|
|
33
|
+
.bd-img.rounded {
|
|
34
|
+
border-radius: var(--spacing-8);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.bd-img.rounded-lg {
|
|
38
|
+
border-radius: var(--spacing-12);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bd-img.rounded-full {
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Shadow Variants */
|
|
46
|
+
.bd-img.shadow {
|
|
47
|
+
box-shadow: var(--shadow-sm);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.bd-img.shadow-lg {
|
|
51
|
+
box-shadow: var(--shadow-lg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bd-img.shadow-xl {
|
|
55
|
+
box-shadow: var(--shadow-xl);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Border Variants */
|
|
59
|
+
.bd-img.bordered {
|
|
60
|
+
border: 2px solid var(--color-neutral-200);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.bd-img.bordered-primary {
|
|
64
|
+
border: 2px solid var(--color-blue-500);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.bd-img.bordered-thick {
|
|
68
|
+
border: 4px solid var(--color-neutral-300);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Responsive Behavior */
|
|
72
|
+
.bd-img.responsive {
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: auto;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Aspect Ratio Containers */
|
|
78
|
+
.bd-img.aspect-16-9 {
|
|
79
|
+
aspect-ratio: 16 / 9;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.bd-img.aspect-4-3 {
|
|
83
|
+
aspect-ratio: 4 / 3;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.bd-img.aspect-1-1 {
|
|
87
|
+
aspect-ratio: 1 / 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Hover Effects */
|
|
91
|
+
.bd-img.hover-zoom:hover {
|
|
92
|
+
transform: scale(1.05);
|
|
93
|
+
transition: transform 0.3s ease;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.bd-img.hover-shadow:hover {
|
|
97
|
+
box-shadow: var(--shadow-lg);
|
|
98
|
+
transition: box-shadow 0.3s ease;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
`
|