@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,190 +1,302 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
-
import '../heading/heading.js';
|
|
3
2
|
import './badge.js';
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
|
-
title : '
|
|
7
|
-
component : 'bd-badge',
|
|
5
|
+
title : 'Components/Badge',
|
|
8
6
|
tags : ['autodocs'],
|
|
9
7
|
parameters: {
|
|
10
8
|
docs: {
|
|
11
9
|
description: {
|
|
12
10
|
component: `
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
**BdBadge** is a Lit web component that renders a styled pill/badge with optional icon, size, color, and variant support.
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
\`\`\`html
|
|
15
|
+
<bd-badge color="#026DFF" size="md">New</bd-badge>
|
|
16
|
+
<bd-badge size="lg" icon="individual">Personal</bd-badge>
|
|
17
|
+
<bd-badge size="sm" icon="family">Family</bd-badge>
|
|
18
|
+
\`\`\`
|
|
19
|
+
|
|
20
|
+
### Props
|
|
21
|
+
| Prop | Values | Default |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| \`color\` | Any hex or CSS color | \`#026DFF\` |
|
|
24
|
+
| \`variant\` | Any string class name | \`''\` |
|
|
25
|
+
| \`size\` | \`sm\`, \`md\`, \`lg\` | \`md\` |
|
|
26
|
+
| \`fontsize\` | \`12\`, \`14\`, \`16\` | \`14\` |
|
|
27
|
+
| \`icon\` | \`individual\`, \`family\`, \`''\` | \`''\` |
|
|
28
|
+
|
|
29
|
+
### Notes
|
|
30
|
+
- \`color\` sets the \`--badge-bg\` CSS custom property via \`updated()\`
|
|
31
|
+
- \`size\` controls padding, border-radius, and default font size
|
|
32
|
+
- \`fontsize\` overrides the font size independently from \`size\`
|
|
33
|
+
- \`icon\` renders an SVG icon span before the slotted text
|
|
34
|
+
`
|
|
16
35
|
}
|
|
17
36
|
}
|
|
18
37
|
},
|
|
19
38
|
argTypes: {
|
|
20
|
-
children: {
|
|
21
|
-
control : 'text',
|
|
22
|
-
description : 'Conținutul afișat în interiorul badge-ului (prin slot).',
|
|
23
|
-
defaultValue: 'Badge'
|
|
24
|
-
},
|
|
25
39
|
color: {
|
|
26
|
-
control
|
|
27
|
-
description
|
|
28
|
-
|
|
40
|
+
control : 'color',
|
|
41
|
+
description: 'Background color of the badge. Sets the `--badge-bg` CSS variable.',
|
|
42
|
+
table : {
|
|
43
|
+
type : { summary: 'string' },
|
|
44
|
+
defaultValue: { summary: '#026DFF' },
|
|
45
|
+
category : 'Appearance'
|
|
46
|
+
}
|
|
29
47
|
},
|
|
30
48
|
variant: {
|
|
31
|
-
control :
|
|
32
|
-
|
|
33
|
-
|
|
49
|
+
control : 'text',
|
|
50
|
+
description: 'Additional CSS class applied to the inner `<span>` for custom variants.',
|
|
51
|
+
table : {
|
|
52
|
+
type : { summary: 'string' },
|
|
53
|
+
defaultValue: { summary: '' },
|
|
54
|
+
category : 'Appearance'
|
|
55
|
+
}
|
|
34
56
|
},
|
|
35
57
|
size: {
|
|
36
58
|
control : { type: 'select' },
|
|
37
59
|
options : ['sm', 'md', 'lg'],
|
|
38
|
-
description: '
|
|
60
|
+
description: 'Controls padding, border-radius, and default font size.',
|
|
61
|
+
table : {
|
|
62
|
+
type : { summary: "'sm' | 'md' | 'lg'" },
|
|
63
|
+
defaultValue: { summary: 'md' },
|
|
64
|
+
category : 'Size'
|
|
65
|
+
}
|
|
39
66
|
},
|
|
40
67
|
fontsize: {
|
|
41
68
|
control : { type: 'select' },
|
|
42
69
|
options : ['12', '14', '16'],
|
|
43
|
-
description: '
|
|
70
|
+
description: 'Explicitly overrides the font size, independent of `size`.',
|
|
71
|
+
table : {
|
|
72
|
+
type : { summary: "'12' | '14' | '16'" },
|
|
73
|
+
defaultValue: { summary: '14' },
|
|
74
|
+
category : 'Size'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
icon: {
|
|
78
|
+
control : { type: 'select' },
|
|
79
|
+
options : ['', 'individual', 'family'],
|
|
80
|
+
description: 'Renders an icon before the slotted text. Empty string means no icon.',
|
|
81
|
+
table : {
|
|
82
|
+
type : { summary: "'individual' | 'family' | ''" },
|
|
83
|
+
defaultValue: { summary: '' },
|
|
84
|
+
category : 'Icon'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
label: {
|
|
88
|
+
control : 'text',
|
|
89
|
+
description: 'Slotted text content displayed inside the badge.',
|
|
90
|
+
table : {
|
|
91
|
+
type : { summary: 'string' },
|
|
92
|
+
defaultValue: { summary: 'Badge' },
|
|
93
|
+
category : 'Content'
|
|
94
|
+
}
|
|
44
95
|
}
|
|
45
96
|
}
|
|
46
97
|
};
|
|
47
98
|
|
|
48
|
-
|
|
49
|
-
const Template = ({ children, color, variant, size, fontsize }) => html`
|
|
99
|
+
const render = (args) => html`
|
|
50
100
|
<bd-badge
|
|
51
|
-
color="${color}"
|
|
52
|
-
variant="${variant}"
|
|
53
|
-
size="${size}"
|
|
54
|
-
fontsize="${fontsize}"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</bd-badge>
|
|
101
|
+
color="${args.color}"
|
|
102
|
+
variant="${args.variant}"
|
|
103
|
+
size="${args.size}"
|
|
104
|
+
fontsize="${args.fontsize}"
|
|
105
|
+
icon="${args.icon}"
|
|
106
|
+
>${args.label}</bd-badge>
|
|
58
107
|
`;
|
|
59
108
|
|
|
60
|
-
|
|
61
|
-
Default.args = {
|
|
62
|
-
children: 'Badge',
|
|
109
|
+
const defaultArgs = {
|
|
63
110
|
color : '#026DFF',
|
|
64
111
|
variant : '',
|
|
65
112
|
size : 'md',
|
|
66
|
-
fontsize: '14'
|
|
113
|
+
fontsize: '14',
|
|
114
|
+
icon : '',
|
|
115
|
+
label : 'Badge'
|
|
67
116
|
};
|
|
68
117
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
118
|
+
// ─── Size Stories ──────────────────────────────────────────────────────────
|
|
119
|
+
|
|
120
|
+
export const SizeSmall = {
|
|
121
|
+
name : 'Size — Small (sm)',
|
|
122
|
+
render : () => html`<bd-badge size="sm">Small Badge</bd-badge>`,
|
|
123
|
+
parameters: {
|
|
124
|
+
docs: {
|
|
125
|
+
description: {
|
|
126
|
+
story: 'Small badge with compact padding and smallest border-radius.'
|
|
127
|
+
}
|
|
73
128
|
}
|
|
74
129
|
}
|
|
75
130
|
};
|
|
76
131
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
132
|
+
export const SizeMedium = {
|
|
133
|
+
name : 'Size — Medium (md)',
|
|
134
|
+
render : () => html`<bd-badge size="md">Medium Badge</bd-badge>`,
|
|
135
|
+
parameters: {
|
|
136
|
+
docs: {
|
|
137
|
+
description: {
|
|
138
|
+
story: 'Default medium size badge.'
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
83
143
|
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
144
|
+
export const SizeLarge = {
|
|
145
|
+
name : 'Size — Large (lg)',
|
|
146
|
+
render : () => html`<bd-badge size="lg">Large Badge</bd-badge>`,
|
|
147
|
+
parameters: {
|
|
148
|
+
docs: {
|
|
149
|
+
description: {
|
|
150
|
+
story: 'Large badge with more padding and a larger border-radius.'
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
};
|
|
90
155
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
156
|
+
export const AllSizes = {
|
|
157
|
+
name : 'All Sizes',
|
|
158
|
+
render: () => html`
|
|
159
|
+
<div style="display: flex; align-items: center; gap: 12px; flex-wrap: wrap;">
|
|
160
|
+
<bd-badge size="sm">Small</bd-badge>
|
|
161
|
+
<bd-badge size="md">Medium</bd-badge>
|
|
162
|
+
<bd-badge size="lg">Large</bd-badge>
|
|
163
|
+
</div>
|
|
164
|
+
`,
|
|
165
|
+
parameters: {
|
|
166
|
+
docs: {
|
|
167
|
+
description: {
|
|
168
|
+
story: 'All three sizes rendered side by side for visual comparison.'
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
107
172
|
};
|
|
108
173
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
174
|
+
// ─── Color Stories ─────────────────────────────────────────────────────────
|
|
175
|
+
|
|
176
|
+
export const DefaultColor = {
|
|
177
|
+
name : 'Color — Default Blue',
|
|
178
|
+
render : () => html`<bd-badge color="#026DFF">Default</bd-badge>`,
|
|
179
|
+
parameters: {
|
|
180
|
+
docs: {
|
|
181
|
+
description: { story: 'Default blue badge using the `#026DFF` color.' }
|
|
182
|
+
}
|
|
112
183
|
}
|
|
113
184
|
};
|
|
114
185
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
186
|
+
export const CustomColors = {
|
|
187
|
+
name : 'Color — Custom Colors',
|
|
188
|
+
render: () => html`
|
|
189
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
|
|
190
|
+
<bd-badge color="#026DFF">Blue</bd-badge>
|
|
191
|
+
<bd-badge color="#E53935">Red</bd-badge>
|
|
192
|
+
<bd-badge color="#43A047">Green</bd-badge>
|
|
193
|
+
<bd-badge color="#FB8C00">Orange</bd-badge>
|
|
194
|
+
<bd-badge color="#8E24AA">Purple</bd-badge>
|
|
195
|
+
<bd-badge color="#333333">Dark</bd-badge>
|
|
196
|
+
</div>
|
|
197
|
+
`,
|
|
198
|
+
parameters: {
|
|
199
|
+
docs: {
|
|
200
|
+
description: {
|
|
201
|
+
story: 'Multiple badges with different `color` values applied via the `--badge-bg` CSS variable.'
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
131
205
|
};
|
|
132
206
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
207
|
+
// ─── Font Size Stories ─────────────────────────────────────────────────────
|
|
208
|
+
|
|
209
|
+
export const FontSizes = {
|
|
210
|
+
name : 'Font Sizes (12 / 14 / 16)',
|
|
211
|
+
render: () => html`
|
|
212
|
+
<div style="display: flex; align-items: center; gap: 12px; flex-wrap: wrap;">
|
|
213
|
+
<bd-badge fontsize="12">Font 12</bd-badge>
|
|
214
|
+
<bd-badge fontsize="14">Font 14</bd-badge>
|
|
215
|
+
<bd-badge fontsize="16">Font 16</bd-badge>
|
|
216
|
+
</div>
|
|
217
|
+
`,
|
|
218
|
+
parameters: {
|
|
219
|
+
docs: {
|
|
220
|
+
description: {
|
|
221
|
+
story: 'All three `fontsize` values rendered. Font size overrides the default derived from `size`.'
|
|
222
|
+
}
|
|
223
|
+
}
|
|
136
224
|
}
|
|
137
225
|
};
|
|
138
226
|
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
fontSizes.map(item => html`
|
|
152
|
-
<bd-badge fontsize="${item.fontsize}">${item.label}</bd-badge>
|
|
153
|
-
`)
|
|
154
|
-
);
|
|
227
|
+
// ─── Icon Stories ──────────────────────────────────────────────────────────
|
|
228
|
+
|
|
229
|
+
export const IconIndividual = {
|
|
230
|
+
name : 'Icon — Individual',
|
|
231
|
+
render : () => html`<bd-badge icon="individual" size="md">Individual</bd-badge>`,
|
|
232
|
+
parameters: {
|
|
233
|
+
docs: {
|
|
234
|
+
description: {
|
|
235
|
+
story: '`icon="individual"` renders the individual user icon before the slotted text.'
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
155
239
|
};
|
|
156
240
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
241
|
+
export const IconFamily = {
|
|
242
|
+
name : 'Icon — Family',
|
|
243
|
+
render : () => html`<bd-badge icon="family" size="md">Family</bd-badge>`,
|
|
244
|
+
parameters: {
|
|
245
|
+
docs: {
|
|
246
|
+
description: {
|
|
247
|
+
story: '`icon="family"` renders the family icon before the slotted text.'
|
|
248
|
+
}
|
|
249
|
+
}
|
|
160
250
|
}
|
|
161
251
|
};
|
|
162
252
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
<bd-badge variant="${item.variant}" size="${item.size}">
|
|
180
|
-
${item.label}
|
|
181
|
-
</bd-badge>
|
|
182
|
-
`)
|
|
183
|
-
);
|
|
253
|
+
export const AllIcons = {
|
|
254
|
+
name : 'All Icons',
|
|
255
|
+
render: () => html`
|
|
256
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
|
|
257
|
+
<bd-badge>No Icon</bd-badge>
|
|
258
|
+
<bd-badge icon="individual">Individual</bd-badge>
|
|
259
|
+
<bd-badge icon="family">Family</bd-badge>
|
|
260
|
+
</div>
|
|
261
|
+
`,
|
|
262
|
+
parameters: {
|
|
263
|
+
docs: {
|
|
264
|
+
description: {
|
|
265
|
+
story: 'All three icon states: no icon, individual, and family — displayed side by side.'
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
184
269
|
};
|
|
185
270
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
271
|
+
// ─── Combined Stories ──────────────────────────────────────────────────────
|
|
272
|
+
|
|
273
|
+
export const CombinedVariants = {
|
|
274
|
+
name : 'Combined Variants',
|
|
275
|
+
render: () => html`
|
|
276
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
277
|
+
<bd-badge size="sm" color="#E53935">Sale</bd-badge>
|
|
278
|
+
<bd-badge size="md" color="#43A047" icon="individual">Personal Plan</bd-badge>
|
|
279
|
+
<bd-badge size="lg" color="#026DFF" icon="family" fontsize="16">Family Plan</bd-badge>
|
|
280
|
+
</div>
|
|
281
|
+
`,
|
|
282
|
+
parameters: {
|
|
283
|
+
docs: {
|
|
284
|
+
description: {
|
|
285
|
+
story: 'Three badges combining different sizes, colors, icons, and font sizes for a real-world usage example.'
|
|
286
|
+
}
|
|
287
|
+
}
|
|
189
288
|
}
|
|
190
289
|
};
|
|
290
|
+
|
|
291
|
+
export const Playground = {
|
|
292
|
+
name : '🛝 Playground',
|
|
293
|
+
args : { ...defaultArgs },
|
|
294
|
+
render,
|
|
295
|
+
parameters: {
|
|
296
|
+
docs: {
|
|
297
|
+
description: {
|
|
298
|
+
story: 'Fully interactive. Use Controls to adjust color, size, fontsize, icon, variant, and slotted label in real time.'
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
};
|