@repobit/dex-system-design 0.22.12 → 0.23.2

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/package.json +4 -3
  3. package/src/components/Button/button.stories.js +292 -120
  4. package/src/components/accordion/accordion-bg.css.js +7 -2
  5. package/src/components/accordion/accordion-bg.stories.js +268 -449
  6. package/src/components/accordion/accordion.stories.js +259 -265
  7. package/src/components/anchor/anchor.stories.js +160 -159
  8. package/src/components/awards/awards-icon.js +44 -0
  9. package/src/components/awards/awards.css.js +328 -0
  10. package/src/components/awards/awards.js +224 -0
  11. package/src/components/awards/awards.stories.js +447 -0
  12. package/src/components/back/back.stories.js +100 -375
  13. package/src/components/badge/badge.stories.js +241 -129
  14. package/src/components/breadcrumb/breadcrumb.stories.js +218 -219
  15. package/src/components/cards/card.stories.js +174 -622
  16. package/src/components/carousel/carousel.stories.js +196 -225
  17. package/src/components/checkbox/checkbox.stories.js +136 -51
  18. package/src/components/compare/compare.css.js +237 -0
  19. package/src/components/compare/compare.js +253 -0
  20. package/src/components/compare/compare.stories.js +372 -0
  21. package/src/components/display/display.stories.js +91 -297
  22. package/src/components/divider/divider.stories.js +160 -342
  23. package/src/components/footer/footer.stories.js +177 -402
  24. package/src/components/header/header.stories.js +130 -338
  25. package/src/components/heading/heading.js +8 -5
  26. package/src/components/heading/heading.stories.js +162 -471
  27. package/src/components/highlight/highlight.stories.js +153 -38
  28. package/src/components/image/image.stories.js +135 -563
  29. package/src/components/input/custom-form.stories.js +761 -224
  30. package/src/components/link/link.js +29 -12
  31. package/src/components/link/link.stories.js +130 -468
  32. package/src/components/modal/modal.stories.js +174 -28
  33. package/src/components/paragraph/paragraph.css.js +10 -1
  34. package/src/components/paragraph/paragraph.stories.js +85 -410
  35. package/src/components/picture/picture.stories.js +147 -561
  36. package/src/components/radio/radio.stories.js +230 -81
  37. package/src/components/tabs/tabs.stories.js +126 -10
  38. package/src/components/termsOfUse/terms.stories.js +223 -8
  39. package/src/tokens/tokens.js +1 -0
@@ -1,53 +1,168 @@
1
- import { html } from "lit";
2
- import "./highlight.js";
1
+ import { html } from 'lit';
2
+ import './highlight.js';
3
3
 
4
4
  export default {
5
- title : "Atoms/Highlight",
6
- component: "highlight",
7
- tags : ["autodocs"],
8
- argTypes : {
9
- highlightText: { control: "text" },
10
- defaultSlot : { control: "text", name: "Text Content" }
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
- const Template = ({ highlightText, defaultSlot }) => html`
15
- <bd-highlight highlight-text="${highlightText}">
16
- ${defaultSlot}
17
- </bd-highlight>
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 Default = Template.bind({});
21
- Default.args = {
22
- highlightText: "next generation of digital security",
23
- defaultSlot:
24
- "Introducing the next generation of digital security: your personalized shield for a worry-free online experience."
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 LongText = Template.bind({});
28
- LongText.args = {
29
- highlightText: "next generation of digital security test test testtest123",
30
- defaultSlot:
31
- "Introducing the next generation of digital security test test testtest123: your personalized shield for a worry-free online experience."
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 ShortText = Template.bind({});
35
- ShortText.args = {
36
- highlightText: "Introducing",
37
- defaultSlot:
38
- "Introducing the next generation of digital security: your personalized shield for a worry-free online experience."
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 MissingHighlight = Template.bind({});
42
- MissingHighlight.args = {
43
- highlightText: "something not in the text",
44
- defaultSlot:
45
- "Introducing the next generation of digital security: your personalized shield for a worry-free online experience."
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 MultipleOccurrences = Template.bind({});
49
- MultipleOccurrences.args = {
50
- highlightText: "security",
51
- defaultSlot:
52
- "This security system improves your security and brings peace of mind to your digital experience."
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
+ };