@repobit/dex-system-design 0.22.11 → 0.23.1
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 +40 -0
- package/package.json +4 -3
- package/src/components/Button/button.stories.js +292 -120
- package/src/components/accordion/accordion-bg.css.js +7 -2
- package/src/components/accordion/accordion-bg.stories.js +268 -449
- package/src/components/accordion/accordion.stories.js +259 -265
- package/src/components/anchor/anchor.stories.js +160 -159
- package/src/components/awards/awards-icon.js +44 -0
- package/src/components/awards/awards.css.js +328 -0
- package/src/components/awards/awards.js +224 -0
- package/src/components/awards/awards.stories.js +447 -0
- package/src/components/back/back.stories.js +100 -375
- package/src/components/badge/badge.stories.js +241 -129
- package/src/components/breadcrumb/breadcrumb.stories.js +218 -219
- package/src/components/cards/card.stories.js +174 -622
- package/src/components/carousel/carousel.stories.js +196 -225
- package/src/components/checkbox/checkbox.stories.js +136 -51
- package/src/components/compare/compare.css.js +237 -0
- package/src/components/compare/compare.js +253 -0
- package/src/components/compare/compare.stories.js +372 -0
- package/src/components/display/display.stories.js +91 -297
- package/src/components/divider/divider.stories.js +160 -342
- package/src/components/footer/footer.stories.js +177 -402
- package/src/components/header/header.stories.js +130 -338
- package/src/components/heading/heading.js +8 -5
- package/src/components/heading/heading.stories.js +162 -471
- package/src/components/highlight/highlight.stories.js +153 -38
- package/src/components/image/image.stories.js +135 -563
- package/src/components/input/custom-form.stories.js +761 -224
- package/src/components/link/link.js +29 -12
- package/src/components/link/link.stories.js +130 -468
- package/src/components/modal/modal.stories.js +174 -28
- package/src/components/paragraph/paragraph.css.js +10 -1
- package/src/components/paragraph/paragraph.stories.js +85 -410
- package/src/components/picture/picture.stories.js +147 -561
- package/src/components/radio/radio.stories.js +230 -81
- package/src/components/tabs/tabs.stories.js +126 -10
- package/src/components/termsOfUse/terms.stories.js +223 -8
- package/src/tokens/tokens.js +1 -0
|
@@ -1,53 +1,168 @@
|
|
|
1
|
-
import { html } from
|
|
2
|
-
import
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import './highlight.js';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
title : 'Components/Highlight',
|
|
6
|
+
tags : ['autodocs'],
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: `
|
|
11
|
+
**BdHighlightSection** renders a styled headline paragraph with optional decorative highlighting around a specific word or phrase.
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
\`\`\`html
|
|
15
|
+
<bd-highlight highlight-text="family member">
|
|
16
|
+
Customized protection for each family member
|
|
17
|
+
</bd-highlight>
|
|
18
|
+
|
|
19
|
+
<bd-highlight highlight-text="award-winning" sub-title="Why Bitdefender">
|
|
20
|
+
Trusted award-winning security
|
|
21
|
+
</bd-highlight>
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
### Behavior
|
|
25
|
+
- The component reads \`this.textContent\` and splits it on \`highlight-text\`
|
|
26
|
+
- If \`highlight-text\` is not found in the text, the full slot content is rendered without decoration
|
|
27
|
+
- If found, the highlighted word gets a \`<span class="highlight">\` wrapper with decorative SVG elements (ellipses + rectangles) added on both sides
|
|
28
|
+
- The right-side decoration is injected via \`updated()\` using direct DOM manipulation
|
|
29
|
+
|
|
30
|
+
### Notes
|
|
31
|
+
- \`sub-title\` renders an \`<h6>\` above the headline
|
|
32
|
+
- SVG decorations are injected via \`anchor.appendChild()\` in \`updated()\` — not re-injected on re-render if already present
|
|
33
|
+
`
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
argTypes: {
|
|
38
|
+
highlightText: {
|
|
39
|
+
control : 'text',
|
|
40
|
+
description: 'The word or phrase to highlight within the slotted text. Must exactly match a substring of the text content.',
|
|
41
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Content' }
|
|
42
|
+
},
|
|
43
|
+
subTitle: {
|
|
44
|
+
control : 'text',
|
|
45
|
+
description: 'Optional subtitle rendered as `<h6>` above the headline',
|
|
46
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Content' }
|
|
47
|
+
}
|
|
11
48
|
}
|
|
12
49
|
};
|
|
13
50
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
51
|
+
// ─── Stories ───────────────────────────────────────────────────────────────
|
|
52
|
+
|
|
53
|
+
export const Default = {
|
|
54
|
+
name : 'Default — With Highlight',
|
|
55
|
+
render: () => html`
|
|
56
|
+
<bd-highlight highlight-text="family member">
|
|
57
|
+
Customized online protection for each family member - Smart, Private & Safe
|
|
58
|
+
</bd-highlight>
|
|
59
|
+
`,
|
|
60
|
+
parameters: { docs: { description: { story: 'The phrase "family member" is found in the text and wrapped with decorative SVG highlight elements.' } } }
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const WithSubTitle = {
|
|
64
|
+
name : 'With Sub-Title',
|
|
65
|
+
render: () => html`
|
|
66
|
+
<bd-highlight highlight-text="award-winning" sub-title="Why Bitdefender">
|
|
67
|
+
Trusted award-winning cybersecurity since 2001
|
|
68
|
+
</bd-highlight>
|
|
69
|
+
`,
|
|
70
|
+
parameters: { docs: { description: { story: '`sub-title` renders an `<h6>` label above the highlighted headline.' } } }
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const NoHighlight = {
|
|
74
|
+
name : 'No Highlight Match',
|
|
75
|
+
render: () => html`
|
|
76
|
+
<bd-highlight highlight-text="nonexistent phrase">
|
|
77
|
+
World-class security software you can trust
|
|
78
|
+
</bd-highlight>
|
|
79
|
+
`,
|
|
80
|
+
parameters: { docs: { description: { story: '`highlight-text` does not match any substring in the text — full content is rendered via `<slot>` without decoration.' } } }
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const EmptyHighlightText = {
|
|
84
|
+
name : 'Empty highlight-text',
|
|
85
|
+
render: () => html`
|
|
86
|
+
<bd-highlight highlight-text="">
|
|
87
|
+
Protect what matters most to you and your family
|
|
88
|
+
</bd-highlight>
|
|
89
|
+
`,
|
|
90
|
+
parameters: { docs: { description: { story: '`highlight-text` is empty string — the condition `!highlightText` triggers the fallback, rendering the full slot without any decoration.' } } }
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const NoSubTitle = {
|
|
94
|
+
name : 'No Sub-Title',
|
|
95
|
+
render: () => html`
|
|
96
|
+
<bd-highlight highlight-text="devices">
|
|
97
|
+
Complete protection for all your devices
|
|
98
|
+
</bd-highlight>
|
|
99
|
+
`,
|
|
100
|
+
parameters: { docs: { description: { story: 'No `sub-title` prop — the `<h6>` is conditionally omitted.' } } }
|
|
101
|
+
};
|
|
19
102
|
|
|
20
|
-
export const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
103
|
+
export const HighlightFirstWord = {
|
|
104
|
+
name : 'Highlight First Word',
|
|
105
|
+
render: () => html`
|
|
106
|
+
<bd-highlight highlight-text="Complete">
|
|
107
|
+
Complete protection for all your devices
|
|
108
|
+
</bd-highlight>
|
|
109
|
+
`,
|
|
110
|
+
parameters: { docs: { description: { story: 'The highlighted phrase appears at the very start of the text — `before` is empty string.' } } }
|
|
25
111
|
};
|
|
26
112
|
|
|
27
|
-
export const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
113
|
+
export const HighlightLastWord = {
|
|
114
|
+
name : 'Highlight Last Word',
|
|
115
|
+
render: () => html`
|
|
116
|
+
<bd-highlight highlight-text="devices">
|
|
117
|
+
Complete protection for all your devices
|
|
118
|
+
</bd-highlight>
|
|
119
|
+
`,
|
|
120
|
+
parameters: { docs: { description: { story: 'The highlighted phrase appears at the very end of the text — `after` is empty string.' } } }
|
|
32
121
|
};
|
|
33
122
|
|
|
34
|
-
export const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
123
|
+
export const HighlightMultiWord = {
|
|
124
|
+
name : 'Highlight Multi-Word Phrase',
|
|
125
|
+
render: () => html`
|
|
126
|
+
<bd-highlight highlight-text="all your devices">
|
|
127
|
+
Complete protection for all your devices and accounts
|
|
128
|
+
</bd-highlight>
|
|
129
|
+
`,
|
|
130
|
+
parameters: { docs: { description: { story: 'A multi-word phrase is highlighted. The decoration spans the entire phrase.' } } }
|
|
39
131
|
};
|
|
40
132
|
|
|
41
|
-
export const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
133
|
+
export const WithSubTitleAndHighlight = {
|
|
134
|
+
name : 'Sub-Title + Highlight Combined',
|
|
135
|
+
render: () => html`
|
|
136
|
+
<bd-highlight highlight-text="family" sub-title="Designed for families">
|
|
137
|
+
Smart security made for every family member
|
|
138
|
+
</bd-highlight>
|
|
139
|
+
`,
|
|
140
|
+
parameters: { docs: { description: { story: 'Both `sub-title` and `highlight-text` props active at the same time.' } } }
|
|
46
141
|
};
|
|
47
142
|
|
|
48
|
-
export const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
143
|
+
export const MobileView = {
|
|
144
|
+
name : 'Mobile View (375px)',
|
|
145
|
+
render: () => html`
|
|
146
|
+
<bd-highlight highlight-text="family member" sub-title="Family Protection">
|
|
147
|
+
Customized online protection for each family member - Smart, Private & Safe
|
|
148
|
+
</bd-highlight>
|
|
149
|
+
`,
|
|
150
|
+
parameters: {
|
|
151
|
+
viewport: { defaultViewport: 'mobile1' },
|
|
152
|
+
docs : { description: { story: 'Highlight component at 375px. Tests text wrap and SVG decoration alignment on small screens.' } }
|
|
153
|
+
}
|
|
53
154
|
};
|
|
155
|
+
|
|
156
|
+
export const Playground = {
|
|
157
|
+
name: '🛝 Playground',
|
|
158
|
+
args: {
|
|
159
|
+
highlightText: 'family member',
|
|
160
|
+
subTitle : 'Why Bitdefender'
|
|
161
|
+
},
|
|
162
|
+
render: (args) => html`
|
|
163
|
+
<bd-highlight highlight-text="${args.highlightText}" sub-title="${args.subTitle}">
|
|
164
|
+
Customized online protection for each family member - Smart, Private & Safe
|
|
165
|
+
</bd-highlight>
|
|
166
|
+
`,
|
|
167
|
+
parameters: { docs: { description: { story: 'Interactive playground. Change `highlight-text` to any substring of the content to see it highlighted, or set it to a non-matching string to see the fallback.' } } }
|
|
168
|
+
};
|