@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.
Files changed (39) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/package.json +3 -2
  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,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 : 'Atoms/Badge',
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
- Un **badge** care poate afișa un text sau un element în slot.
14
- Badge-ul acceptă culori personalizate, variante predefinite, dimensiuni diferite și mărimi de font.
15
- Acest Storybook include toate exemplele posibile pentru testare completă.`
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 : 'color',
27
- description : 'Culoarea de fundal a badge-ului.',
28
- defaultValue: '#026DFF'
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 : { type: 'select' },
32
- options : ['', 'bd-light-blue', 'bd-light-green'],
33
- description: 'Variantă de stil predefinită pentru badge.'
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: 'Dimensiunea badge-ului.'
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: 'Mărimea fontului textului.'
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
- // TEMPLATE DE BAZĂ
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
- ${children}
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
- export const Default = Template.bind({});
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
- Default.parameters = {
70
- docs: {
71
- description: {
72
- story: 'Exemplul de bază pentru componenta Badge.'
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
- // TEMPLATE SECȚIUNI
78
- const GridTemplate = (items) => html`
79
- <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;">
80
- ${items}
81
- </div>
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 SectionTemplate = (title, items) => html`
85
- <div style="margin-bottom: 32px;">
86
- <bd-h as="h3" style="margin-bottom: 16px; color: #333;">${title}</bd-h>
87
- ${GridTemplate(items)}
88
- </div>
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
- // 🔵 TOATE VARIANTELE
93
- // ===================
94
- export const Variants = () => {
95
- const variants = [
96
- { variant: '', label: 'Default' },
97
- { variant: 'bd-light-blue', label: 'Light Blue' },
98
- { variant: 'bd-light-green', label: 'Light Green' }
99
- ];
100
-
101
- return SectionTemplate(
102
- 'Variante disponibile',
103
- variants.map(item => html`
104
- <bd-badge variant="${item.variant}">${item.label}</bd-badge>
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
- Variants.parameters = {
110
- docs: {
111
- description: { story: 'Toate variantele vizuale ale componentei bd-badge.' }
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
- // 🔶 TOATE DIMENSIUNILE
117
- // ===================
118
- export const Sizes = () => {
119
- const sizes = [
120
- { size: 'sm', label: 'Small' },
121
- { size: 'md', label: 'Medium' },
122
- { size: 'lg', label: 'Large' }
123
- ];
124
-
125
- return SectionTemplate(
126
- 'Dimensiuni disponibile',
127
- sizes.map(item => html`
128
- <bd-badge size="${item.size}">${item.label}</bd-badge>
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
- Sizes.parameters = {
134
- docs: {
135
- description: { story: 'Dimensiuni disponibile pentru badge.' }
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
- // 🔤 TOATE MĂRIMILE DE FONT
141
- // ==========================
142
- export const FontSizes = () => {
143
- const fontSizes = [
144
- { fontsize: '12', label: 'Font 12' },
145
- { fontsize: '14', label: 'Font 14' },
146
- { fontsize: '16', label: 'Font 16' }
147
- ];
148
-
149
- return SectionTemplate(
150
- 'Mărimi de font disponibile',
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
- FontSizes.parameters = {
158
- docs: {
159
- description: { story: 'Toate mărimile de font suportate de badge.' }
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
- // 🧪 COMBINAȚII: VARIANTE × DIMENSIUNI
165
- // =======================================
166
- export const Combinations = () => {
167
- const combinations = [
168
- { variant: 'bd-light-blue', size: 'sm', label: 'Light Blue Small' },
169
- { variant: 'bd-light-blue', size: 'md', label: 'Light Blue Medium' },
170
- { variant: 'bd-light-blue', size: 'lg', label: 'Light Blue Large' },
171
- { variant: 'bd-light-green', size: 'sm', label: 'Light Green Small' },
172
- { variant: 'bd-light-green', size: 'md', label: 'Light Green Medium' },
173
- { variant: 'bd-light-green', size: 'lg', label: 'Light Green Large' }
174
- ];
175
-
176
- return SectionTemplate(
177
- 'Combinații între variante și dimensiuni',
178
- combinations.map(item => html`
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
- Combinations.parameters = {
187
- docs: {
188
- description: { story: 'Combinații ale tuturor variantelor și dimensiunilor.' }
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
+ };