@repobit/dex-system-design 0.22.12 → 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 +32 -0
- package/package.json +3 -2
- 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,40 +1,186 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import "../../components/modal/modal.js";
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import './modal.js';
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
|
-
title
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
title : 'Components/Modal',
|
|
6
|
+
tags : ['autodocs'],
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: `
|
|
11
|
+
**BdModal** is a Lit modal dialog component with icon, title, and description support.
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
\`\`\`html
|
|
15
|
+
<bd-modal
|
|
16
|
+
.open="${true}"
|
|
17
|
+
title="VPN Protection"
|
|
18
|
+
icon="/assets/vpn.svg"
|
|
19
|
+
modalText="Our VPN encrypts your connection."
|
|
20
|
+
@close-modal="${() => {}}"
|
|
21
|
+
></bd-modal>
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
### Behavior
|
|
25
|
+
- Clicking the backdrop (\`.bd-modal\`) fires \`close-modal\` event
|
|
26
|
+
- Clicking inside \`.bd-modal-content\` stops propagation (does not close)
|
|
27
|
+
- The Close button also fires \`close-modal\`
|
|
28
|
+
- \`aria-hidden\` is set to \`"false"\` when open, \`"true"\` when closed
|
|
29
|
+
|
|
30
|
+
### Events
|
|
31
|
+
- \`close-modal\` — CustomEvent, bubbles and composed, fired on backdrop click or close button click
|
|
32
|
+
|
|
33
|
+
### Accessibility
|
|
34
|
+
- \`aria-labelledby="modal-title"\` links to the \`<bd-h>\` heading
|
|
35
|
+
- \`aria-describedby="modal-description"\` links to the \`<bd-p>\` text
|
|
36
|
+
`
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
argTypes: {
|
|
41
|
+
open: {
|
|
42
|
+
control : 'boolean',
|
|
43
|
+
description: 'Controls visibility. Sets `aria-hidden` on the modal wrapper.',
|
|
44
|
+
table : { type: { summary: 'boolean' }, defaultValue: { summary: 'false' }, category: 'State' }
|
|
45
|
+
},
|
|
46
|
+
title: {
|
|
47
|
+
control : 'text',
|
|
48
|
+
description: 'Modal title rendered as `<bd-h as="h2">`',
|
|
49
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Content' }
|
|
50
|
+
},
|
|
51
|
+
modalText: {
|
|
52
|
+
control : 'text',
|
|
53
|
+
description: 'Modal body text rendered as `<bd-p kind="regular">`',
|
|
54
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Content' }
|
|
55
|
+
},
|
|
56
|
+
icon: {
|
|
57
|
+
control : 'text',
|
|
58
|
+
description: 'Optional icon image URL shown above the title',
|
|
59
|
+
table : { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Content' }
|
|
60
|
+
}
|
|
14
61
|
}
|
|
15
62
|
};
|
|
16
63
|
|
|
17
|
-
const
|
|
64
|
+
const defaultArgs = {
|
|
65
|
+
open : true,
|
|
66
|
+
title : 'VPN Protection',
|
|
67
|
+
modalText: 'Our VPN encrypts your internet traffic and hides your IP address, keeping you safe on public networks.',
|
|
68
|
+
icon : '/assets/vpn.svg'
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const render = (args) => html`
|
|
18
72
|
<bd-modal
|
|
19
|
-
|
|
20
|
-
title
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@close-modal=${onClose}
|
|
73
|
+
.open="${args.open}"
|
|
74
|
+
title="${args.title}"
|
|
75
|
+
modalText="${args.modalText}"
|
|
76
|
+
icon="${args.icon}"
|
|
24
77
|
></bd-modal>
|
|
25
78
|
`;
|
|
26
79
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
80
|
+
// ─── Stories ───────────────────────────────────────────────────────────────
|
|
81
|
+
|
|
82
|
+
export const Default = {
|
|
83
|
+
name : 'Default (Open)',
|
|
84
|
+
render: () => html`
|
|
85
|
+
<bd-modal
|
|
86
|
+
.open="${true}"
|
|
87
|
+
title="VPN Protection"
|
|
88
|
+
modalText="Our VPN encrypts your internet traffic and hides your IP address, keeping you safe on public Wi-Fi networks and preventing tracking."
|
|
89
|
+
icon="/assets/vpn.svg"
|
|
90
|
+
></bd-modal>
|
|
91
|
+
`,
|
|
92
|
+
parameters: { docs: { description: { story: 'Modal rendered in the open state with icon, title, and body text.' } } }
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const Closed = {
|
|
96
|
+
name : 'Closed State',
|
|
97
|
+
render: () => html`
|
|
98
|
+
<p style="font-size:14px;">The modal below is closed — it has <code>aria-hidden="true"</code> but is still in the DOM.</p>
|
|
99
|
+
<bd-modal
|
|
100
|
+
.open="${false}"
|
|
101
|
+
title="VPN Protection"
|
|
102
|
+
modalText="This modal is closed."
|
|
103
|
+
icon="/assets/vpn.svg"
|
|
104
|
+
></bd-modal>
|
|
105
|
+
`,
|
|
106
|
+
parameters: { docs: { description: { story: 'Modal with `open=false` — renders in the DOM with `aria-hidden="true"`. Visibility depends on CSS handling of the open state.' } } }
|
|
33
107
|
};
|
|
34
108
|
|
|
35
|
-
export const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
109
|
+
export const NoIcon = {
|
|
110
|
+
name : 'No Icon',
|
|
111
|
+
render: () => html`
|
|
112
|
+
<bd-modal
|
|
113
|
+
.open="${true}"
|
|
114
|
+
title="Antivirus Protection"
|
|
115
|
+
modalText="Real-time detection and removal of viruses, malware, ransomware, and other threats."
|
|
116
|
+
></bd-modal>
|
|
117
|
+
`,
|
|
118
|
+
parameters: { docs: { description: { story: 'Modal without an `icon` prop — the `<img>` is conditionally omitted.' } } }
|
|
40
119
|
};
|
|
120
|
+
|
|
121
|
+
export const LongText = {
|
|
122
|
+
name : 'Long Modal Text',
|
|
123
|
+
render: () => html`
|
|
124
|
+
<bd-modal
|
|
125
|
+
.open="${true}"
|
|
126
|
+
title="Behavioral Analysis"
|
|
127
|
+
icon="/assets/analysis.svg"
|
|
128
|
+
modalText="Bitdefender's behavioral detection technology monitors active applications in real time for suspicious activity. Unlike traditional signature-based detection, behavioral analysis can identify zero-day threats and novel malware variants by observing what a program does, not just what it looks like. When suspicious behavior is detected — such as a process attempting to encrypt files, modify system registries, or communicate with known malicious servers — Bitdefender immediately quarantines the threat before damage can occur."
|
|
129
|
+
></bd-modal>
|
|
130
|
+
`,
|
|
131
|
+
parameters: { docs: { description: { story: 'Modal with a long `modalText` paragraph. Tests content overflow and scroll behavior.' } } }
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const DifferentTitles = {
|
|
135
|
+
name : 'Various Content Types',
|
|
136
|
+
render: () => html`
|
|
137
|
+
<div style="display:flex; flex-direction:column; gap:32px;">
|
|
138
|
+
<bd-modal .open="${true}" title="VPN Protection" icon="/assets/vpn.svg" modalText="Unlimited encrypted VPN traffic across 200+ servers."></bd-modal>
|
|
139
|
+
<bd-modal .open="${true}" title="Password Manager" modalText="Store and autofill passwords securely across all your devices."></bd-modal>
|
|
140
|
+
<bd-modal .open="${true}" title="Parental Controls" icon="/assets/parental.svg" modalText="Monitor your children's online activity and set screen time limits."></bd-modal>
|
|
141
|
+
</div>
|
|
142
|
+
`,
|
|
143
|
+
parameters: { docs: { description: { story: 'Three modals stacked for visual comparison of different content configurations.' } } }
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const CloseInteraction = {
|
|
147
|
+
name : 'Close Interaction Demo',
|
|
148
|
+
render: () => {
|
|
149
|
+
let modalEl;
|
|
150
|
+
const handleClose = () => { if (modalEl) modalEl.open = false; };
|
|
151
|
+
return html`
|
|
152
|
+
<button @click="${() => { if (modalEl) modalEl.open = true; }}" style="margin-bottom:16px; padding:8px 16px;">Open Modal</button>
|
|
153
|
+
<bd-modal
|
|
154
|
+
.open="${false}"
|
|
155
|
+
title="Interactive Modal"
|
|
156
|
+
modalText="Click the backdrop or the Close button to dismiss this modal. The close-modal event is dispatched."
|
|
157
|
+
@close-modal="${handleClose}"
|
|
158
|
+
${(el) => { modalEl = el; }}
|
|
159
|
+
></bd-modal>
|
|
160
|
+
`;
|
|
161
|
+
},
|
|
162
|
+
parameters: { docs: { description: { story: 'Interactive demo: click the button to open, then click backdrop or Close button to dismiss via the `close-modal` event.' } } }
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const MobileView = {
|
|
166
|
+
name : 'Mobile View (375px)',
|
|
167
|
+
render: () => html`
|
|
168
|
+
<bd-modal
|
|
169
|
+
.open="${true}"
|
|
170
|
+
title="VPN Protection"
|
|
171
|
+
modalText="Unlimited encrypted VPN traffic and IP masking."
|
|
172
|
+
icon="/assets/vpn.svg"
|
|
173
|
+
></bd-modal>
|
|
174
|
+
`,
|
|
175
|
+
parameters: {
|
|
176
|
+
viewport: { defaultViewport: 'mobile1' },
|
|
177
|
+
docs : { description: { story: 'Modal at 375px. Tests content padding, font scaling, and button layout on small screens.' } }
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const Playground = {
|
|
182
|
+
name : '🛝 Playground',
|
|
183
|
+
args : { ...defaultArgs },
|
|
184
|
+
render,
|
|
185
|
+
parameters: { docs: { description: { story: 'Fully interactive. Toggle `open`, change title, modalText, and icon via Controls.' } } }
|
|
186
|
+
};
|
|
@@ -34,11 +34,20 @@ export default css`
|
|
|
34
34
|
line-height: var(--typography-body-small-lineHeight);
|
|
35
35
|
letter-spacing: var(--typography-body-small-letterSpacing);
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
:host([kind="xsmall"]) p {
|
|
38
|
+
font-size: var(--typography-label-xsmall-fontSize);
|
|
39
|
+
font-weight: var(--typography-body-small-fontWeight);
|
|
40
|
+
line-height: var(--typography-body-small-lineHeight);
|
|
41
|
+
letter-spacing: var(--typography-body-small-letterSpacing);
|
|
42
|
+
}
|
|
38
43
|
:host([kind="lead"]) p {
|
|
39
44
|
font-size: var(--typography-body-lead-fontSize);
|
|
40
45
|
font-weight: var(--typography-body-lead-fontWeight);
|
|
41
46
|
line-height: var(--typography-body-lead-lineHeight);
|
|
42
47
|
letter-spacing: var(--typography-body-lead-letterSpacing);
|
|
43
48
|
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
44
53
|
`;
|