@reliability-design/web 1.0.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 (60) hide show
  1. package/dist/components/rel-accordion/rel-accordion.stories.ts +313 -0
  2. package/dist/components/rel-accordion/rel-accordion.ts +114 -0
  3. package/dist/components/rel-alert/rel-alert.stories.ts +412 -0
  4. package/dist/components/rel-alert/rel-alert.ts +194 -0
  5. package/dist/components/rel-avatar/rel-avatar.stories.ts +327 -0
  6. package/dist/components/rel-avatar/rel-avatar.ts +100 -0
  7. package/dist/components/rel-badge/rel-badge.stories.ts +350 -0
  8. package/dist/components/rel-badge/rel-badge.ts +70 -0
  9. package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +306 -0
  10. package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +97 -0
  11. package/dist/components/rel-button/rel-button.stories.ts +356 -0
  12. package/dist/components/rel-button/rel-button.ts +204 -0
  13. package/dist/components/rel-card/rel-card.stories.ts +299 -0
  14. package/dist/components/rel-card/rel-card.ts +33 -0
  15. package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +368 -0
  16. package/dist/components/rel-cardmedia/rel-cardmedia.ts +80 -0
  17. package/dist/components/rel-checkbox/rel-checkbox.stories.ts +414 -0
  18. package/dist/components/rel-checkbox/rel-checkbox.ts +164 -0
  19. package/dist/components/rel-chip/rel-chip.stories.ts +552 -0
  20. package/dist/components/rel-chip/rel-chip.ts +261 -0
  21. package/dist/components/rel-container/rel-container.stories.ts +239 -0
  22. package/dist/components/rel-container/rel-container.ts +74 -0
  23. package/dist/components/rel-divider/rel-divider.stories.ts +229 -0
  24. package/dist/components/rel-divider/rel-divider.ts +44 -0
  25. package/dist/components/rel-layout/rel-layout.stories.ts +713 -0
  26. package/dist/components/rel-layout/rel-layout.ts +60 -0
  27. package/dist/components/rel-menu/rel-menu.stories.ts +910 -0
  28. package/dist/components/rel-menu/rel-menu.ts +319 -0
  29. package/dist/components/rel-progress/rel-progress.stories.ts +817 -0
  30. package/dist/components/rel-progress/rel-progress.ts +182 -0
  31. package/dist/components/rel-radio/rel-radio.stories.ts +1048 -0
  32. package/dist/components/rel-radio/rel-radio.ts +187 -0
  33. package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +1079 -0
  34. package/dist/components/rel-segmented-button/rel-segmented-button.ts +150 -0
  35. package/dist/components/rel-select/rel-select.stories.ts +1201 -0
  36. package/dist/components/rel-select/rel-select.ts +261 -0
  37. package/dist/components/rel-slider/rel-slider.stories.ts +730 -0
  38. package/dist/components/rel-slider/rel-slider.ts +440 -0
  39. package/dist/components/rel-snackbar/rel-snackbar.stories.ts +808 -0
  40. package/dist/components/rel-snackbar/rel-snackbar.ts +212 -0
  41. package/dist/components/rel-stepper/rel-stepper.stories.ts +752 -0
  42. package/dist/components/rel-stepper/rel-stepper.ts +425 -0
  43. package/dist/components/rel-switch/rel-switch.stories.ts +441 -0
  44. package/dist/components/rel-switch/rel-switch.ts +161 -0
  45. package/dist/components/rel-tab/rel-tab.stories.ts +492 -0
  46. package/dist/components/rel-tab/rel-tab.ts +145 -0
  47. package/dist/components/rel-textfield/rel-textfield.stories.ts +710 -0
  48. package/dist/components/rel-textfield/rel-textfield.ts +224 -0
  49. package/dist/components/rel-toast/rel-toast.stories.ts +394 -0
  50. package/dist/components/rel-toast/rel-toast.ts +154 -0
  51. package/dist/components/rel-tooltip/rel-tooltip.stories.ts +364 -0
  52. package/dist/components/rel-tooltip/rel-tooltip.ts +80 -0
  53. package/dist/index.d.mts +372 -0
  54. package/dist/index.d.ts +372 -0
  55. package/dist/index.js +4593 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/index.mjs +4544 -0
  58. package/dist/index.mjs.map +1 -0
  59. package/dist/styles/vars.css +184 -0
  60. package/package.json +32 -0
@@ -0,0 +1,1201 @@
1
+ import type { Meta, StoryObj } from '@storybook/web-components-vite';
2
+ import { html } from 'lit';
3
+ import './rel-select';
4
+
5
+ /**
6
+ * The Select component provides a dropdown selection interface with various states and customization options.
7
+ * Built with Lit web components for framework-agnostic usage with full token support.
8
+ *
9
+ * ## Features
10
+ * - **Multiple Sizes**: Small, medium, and large sizes
11
+ * - **State Management**: Default, error, and disabled states
12
+ * - **Icon Support**: Optional left and right icons
13
+ * - **Border Styles**: Rounded or sharp borders
14
+ * - **Supporting Text**: Helper text with error styling
15
+ * - **Token-Based Styling**: Uses design system tokens
16
+ * - **Accessible**: Proper select semantics and keyboard support
17
+ */
18
+ const meta: Meta = {
19
+ title: 'Components/Select',
20
+ tags: ['autodocs'],
21
+ component: 'rel-select',
22
+ argTypes: {
23
+ size: {
24
+ control: { type: 'select' },
25
+ options: ['small', 'medium', 'large'],
26
+ description: 'Size of the select component',
27
+ table: {
28
+ defaultValue: { summary: 'medium' },
29
+ type: { summary: 'small | medium | large' },
30
+ },
31
+ },
32
+ state: {
33
+ control: { type: 'select' },
34
+ options: ['default', 'error', 'disabled'],
35
+ description: 'State of the select component',
36
+ table: {
37
+ defaultValue: { summary: 'default' },
38
+ type: { summary: 'default | error | disabled' },
39
+ },
40
+ },
41
+ border: {
42
+ control: { type: 'select' },
43
+ options: ['rounded', 'sharp'],
44
+ description: 'Border style',
45
+ table: {
46
+ defaultValue: { summary: 'rounded' },
47
+ type: { summary: 'rounded | sharp' },
48
+ },
49
+ },
50
+ },
51
+ };
52
+
53
+ export default meta;
54
+ type Story = StoryObj;
55
+
56
+ /**
57
+ * Default select with basic options
58
+ */
59
+ export const Default: Story = {
60
+ render: () => {
61
+ const select = document.createElement('rel-select') as any;
62
+ select.label = 'Country';
63
+ select.options = ['United States', 'Canada', 'United Kingdom', 'Australia', 'Germany'];
64
+ select.supportingText = 'Select your country';
65
+ select.addEventListener('changed', (e: CustomEvent) => {
66
+ console.log('Selected:', e.detail.value);
67
+ });
68
+
69
+ return select;
70
+ },
71
+ };
72
+
73
+ /**
74
+ * Small size select
75
+ */
76
+ export const Small: Story = {
77
+ render: () => {
78
+ const select = document.createElement('rel-select') as any;
79
+ select.label = 'Size';
80
+ select.options = ['XS', 'S', 'M', 'L', 'XL'];
81
+ select.size = 'small';
82
+ select.selected = 'M';
83
+
84
+ return select;
85
+ },
86
+ };
87
+
88
+ /**
89
+ * Medium size select
90
+ */
91
+ export const Medium: Story = {
92
+ render: () => {
93
+ const select = document.createElement('rel-select') as any;
94
+ select.label = 'Priority';
95
+ select.options = ['Low', 'Medium', 'High', 'Urgent'];
96
+ select.size = 'medium';
97
+ select.selected = 'Medium';
98
+
99
+ return select;
100
+ },
101
+ };
102
+
103
+ /**
104
+ * Large size select
105
+ */
106
+ export const Large: Story = {
107
+ render: () => {
108
+ const select = document.createElement('rel-select') as any;
109
+ select.label = 'Category';
110
+ select.options = ['Technology', 'Business', 'Health', 'Education', 'Entertainment'];
111
+ select.size = 'large';
112
+
113
+ return select;
114
+ },
115
+ };
116
+
117
+ /**
118
+ * Select with error state
119
+ */
120
+ export const ErrorState: Story = {
121
+ render: () => {
122
+ const select = document.createElement('rel-select') as any;
123
+ select.label = 'Payment Method';
124
+ select.options = ['Credit Card', 'Debit Card', 'PayPal', 'Bank Transfer'];
125
+ select.state = 'error';
126
+ select.supportingText = 'Please select a payment method';
127
+
128
+ return select;
129
+ },
130
+ };
131
+
132
+ /**
133
+ * Disabled select
134
+ */
135
+ export const Disabled: Story = {
136
+ render: () => {
137
+ const select = document.createElement('rel-select') as any;
138
+ select.label = 'Status';
139
+ select.options = ['Active', 'Inactive', 'Pending'];
140
+ select.state = 'disabled';
141
+ select.selected = 'Active';
142
+ select.supportingText = 'This field cannot be changed';
143
+
144
+ return select;
145
+ },
146
+ };
147
+
148
+ /**
149
+ * Select with left icon
150
+ */
151
+ export const WithLeftIcon: Story = {
152
+ render: () => {
153
+ const select = document.createElement('rel-select') as any;
154
+ select.label = 'Language';
155
+ select.options = ['English', 'Spanish', 'French', 'German', 'Japanese'];
156
+ select.leftIcon = '🌐';
157
+
158
+ return select;
159
+ },
160
+ };
161
+
162
+ /**
163
+ * Select with right icon
164
+ */
165
+ export const WithRightIcon: Story = {
166
+ render: () => {
167
+ const select = document.createElement('rel-select') as any;
168
+ select.label = 'Currency';
169
+ select.options = ['USD', 'EUR', 'GBP', 'JPY', 'CAD'];
170
+ select.rightIcon = '💰';
171
+
172
+ return select;
173
+ },
174
+ };
175
+
176
+ /**
177
+ * Select with sharp borders
178
+ */
179
+ export const SharpBorders: Story = {
180
+ render: () => {
181
+ const select = document.createElement('rel-select') as any;
182
+ select.label = 'Theme';
183
+ select.options = ['Light', 'Dark', 'Auto'];
184
+ select.border = 'sharp';
185
+ select.selected = 'Auto';
186
+
187
+ return select;
188
+ },
189
+ };
190
+
191
+ /**
192
+ * Country selector
193
+ */
194
+ export const CountrySelector: Story = {
195
+ render: () => html`
196
+ <div style="max-width: 400px; background: white; padding: 24px; border-radius: 12px; box-shadow: var(--rel-shadows-shadow-200);">
197
+ <h3 style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 18px;">Shipping Information</h3>
198
+ ${(() => {
199
+ const select = document.createElement('rel-select') as any;
200
+ select.label = 'Country';
201
+ select.options = [
202
+ 'United States',
203
+ 'Canada',
204
+ 'United Kingdom',
205
+ 'Australia',
206
+ 'Germany',
207
+ 'France',
208
+ 'Japan',
209
+ 'Brazil',
210
+ 'India',
211
+ 'China',
212
+ ];
213
+ select.supportingText = 'Select your shipping destination';
214
+ select.addEventListener('changed', (e: CustomEvent) => {
215
+ console.log('Shipping to:', e.detail.value);
216
+ });
217
+
218
+ return select;
219
+ })()}
220
+ </div>
221
+ `,
222
+ };
223
+
224
+ /**
225
+ * Form with multiple selects
226
+ */
227
+ export const FormExample: Story = {
228
+ render: () => html`
229
+ <div style="max-width: 500px; background: white; padding: 24px; border-radius: 12px; box-shadow: var(--rel-shadows-shadow-200);">
230
+ <h3 style="margin: 0 0 20px; color: var(--rel-colors-gray-heading); font-size: 18px;">User Profile</h3>
231
+
232
+ <div style="margin-bottom: 20px;">
233
+ ${(() => {
234
+ const select = document.createElement('rel-select') as any;
235
+ select.label = 'Country';
236
+ select.options = ['United States', 'Canada', 'United Kingdom', 'Australia'];
237
+ select.supportingText = 'Your country of residence';
238
+
239
+ return select;
240
+ })()}
241
+ </div>
242
+
243
+ <div style="margin-bottom: 20px;">
244
+ ${(() => {
245
+ const select = document.createElement('rel-select') as any;
246
+ select.label = 'Language';
247
+ select.options = ['English', 'Spanish', 'French', 'German'];
248
+ select.selected = 'English';
249
+ select.supportingText = 'Preferred language';
250
+
251
+ return select;
252
+ })()}
253
+ </div>
254
+
255
+ <div style="margin-bottom: 20px;">
256
+ ${(() => {
257
+ const select = document.createElement('rel-select') as any;
258
+ select.label = 'Timezone';
259
+ select.options = ['EST (UTC-5)', 'PST (UTC-8)', 'GMT (UTC+0)', 'JST (UTC+9)'];
260
+ select.supportingText = 'Your local timezone';
261
+
262
+ return select;
263
+ })()}
264
+ </div>
265
+ </div>
266
+ `,
267
+ };
268
+
269
+ /**
270
+ * Product filter
271
+ */
272
+ export const ProductFilter: Story = {
273
+ render: () => html`
274
+ <div style="max-width: 600px; background: white; padding: 24px; border-radius: 12px; box-shadow: var(--rel-shadows-shadow-200);">
275
+ <h3 style="margin: 0 0 20px; color: var(--rel-colors-gray-heading); font-size: 18px;">Filter Products</h3>
276
+
277
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 16px;">
278
+ <div>
279
+ ${(() => {
280
+ const select = document.createElement('rel-select') as any;
281
+ select.label = 'Category';
282
+ select.options = ['All', 'Electronics', 'Clothing', 'Books', 'Home & Garden'];
283
+ select.selected = 'All';
284
+
285
+ return select;
286
+ })()}
287
+ </div>
288
+
289
+ <div>
290
+ ${(() => {
291
+ const select = document.createElement('rel-select') as any;
292
+ select.label = 'Sort By';
293
+ select.options = ['Newest', 'Price: Low to High', 'Price: High to Low', 'Best Rating'];
294
+ select.selected = 'Newest';
295
+
296
+ return select;
297
+ })()}
298
+ </div>
299
+
300
+ <div>
301
+ ${(() => {
302
+ const select = document.createElement('rel-select') as any;
303
+ select.label = 'Price Range';
304
+ select.options = ['All', 'Under $25', '$25 - $50', '$50 - $100', 'Over $100'];
305
+ select.selected = 'All';
306
+
307
+ return select;
308
+ })()}
309
+ </div>
310
+
311
+ <div>
312
+ ${(() => {
313
+ const select = document.createElement('rel-select') as any;
314
+ select.label = 'Brand';
315
+ select.options = ['All Brands', 'Brand A', 'Brand B', 'Brand C', 'Brand D'];
316
+ select.selected = 'All Brands';
317
+
318
+ return select;
319
+ })()}
320
+ </div>
321
+ </div>
322
+ </div>
323
+ `,
324
+ };
325
+
326
+ /**
327
+ * Settings page
328
+ */
329
+ export const SettingsPage: Story = {
330
+ render: () => html`
331
+ <div style="max-width: 600px; background: white; padding: 24px; border-radius: 12px; box-shadow: var(--rel-shadows-shadow-200);">
332
+ <h3 style="margin: 0 0 20px; color: var(--rel-colors-gray-heading); font-size: 18px;">Notification Settings</h3>
333
+
334
+ <div style="margin-bottom: 20px;">
335
+ ${(() => {
336
+ const select = document.createElement('rel-select') as any;
337
+ select.label = 'Email Frequency';
338
+ select.options = ['Instant', 'Daily Digest', 'Weekly Digest', 'Never'];
339
+ select.selected = 'Daily Digest';
340
+ select.supportingText = 'How often you receive email notifications';
341
+
342
+ return select;
343
+ })()}
344
+ </div>
345
+
346
+ <div style="margin-bottom: 20px;">
347
+ ${(() => {
348
+ const select = document.createElement('rel-select') as any;
349
+ select.label = 'Push Notifications';
350
+ select.options = ['All', 'Important Only', 'Mentions Only', 'Off'];
351
+ select.selected = 'Important Only';
352
+ select.supportingText = 'Control mobile push notifications';
353
+
354
+ return select;
355
+ })()}
356
+ </div>
357
+
358
+ <div>
359
+ ${(() => {
360
+ const select = document.createElement('rel-select') as any;
361
+ select.label = 'Sound';
362
+ select.options = ['Enabled', 'Disabled'];
363
+ select.selected = 'Enabled';
364
+ select.supportingText = 'Play sound for notifications';
365
+
366
+ return select;
367
+ })()}
368
+ </div>
369
+ </div>
370
+ `,
371
+ };
372
+
373
+ /**
374
+ * Date and time selector
375
+ */
376
+ export const DateTimeSelector: Story = {
377
+ render: () => html`
378
+ <div style="max-width: 500px; background: white; padding: 24px; border-radius: 12px; box-shadow: var(--rel-shadows-shadow-200);">
379
+ <h3 style="margin: 0 0 20px; color: var(--rel-colors-gray-heading); font-size: 18px;">Schedule Meeting</h3>
380
+
381
+ <div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px;">
382
+ <div>
383
+ ${(() => {
384
+ const select = document.createElement('rel-select') as any;
385
+ select.label = 'Month';
386
+ select.options = ['January', 'February', 'March', 'April', 'May', 'June'];
387
+ select.size = 'small';
388
+ select.selected = 'March';
389
+
390
+ return select;
391
+ })()}
392
+ </div>
393
+
394
+ <div>
395
+ ${(() => {
396
+ const select = document.createElement('rel-select') as any;
397
+ select.label = 'Day';
398
+ select.options = Array.from({ length: 31 }, (_, i) => String(i + 1));
399
+ select.size = 'small';
400
+ select.selected = '15';
401
+
402
+ return select;
403
+ })()}
404
+ </div>
405
+
406
+ <div>
407
+ ${(() => {
408
+ const select = document.createElement('rel-select') as any;
409
+ select.label = 'Year';
410
+ select.options = ['2024', '2025', '2026'];
411
+ select.size = 'small';
412
+ select.selected = '2025';
413
+
414
+ return select;
415
+ })()}
416
+ </div>
417
+ </div>
418
+
419
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px;">
420
+ <div>
421
+ ${(() => {
422
+ const select = document.createElement('rel-select') as any;
423
+ select.label = 'Time';
424
+ select.options = [
425
+ '9:00 AM',
426
+ '10:00 AM',
427
+ '11:00 AM',
428
+ '12:00 PM',
429
+ '1:00 PM',
430
+ '2:00 PM',
431
+ '3:00 PM',
432
+ '4:00 PM',
433
+ ];
434
+ select.selected = '10:00 AM';
435
+
436
+ return select;
437
+ })()}
438
+ </div>
439
+
440
+ <div>
441
+ ${(() => {
442
+ const select = document.createElement('rel-select') as any;
443
+ select.label = 'Duration';
444
+ select.options = ['15 min', '30 min', '1 hour', '2 hours'];
445
+ select.selected = '1 hour';
446
+
447
+ return select;
448
+ })()}
449
+ </div>
450
+ </div>
451
+ </div>
452
+ `,
453
+ };
454
+
455
+ /**
456
+ * All states showcase
457
+ */
458
+ export const AllStates: Story = {
459
+ render: () => html`
460
+ <div style="display: flex; flex-direction: column; gap: 32px;">
461
+ <div>
462
+ <h4 style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;">Default State</h4>
463
+ ${(() => {
464
+ const select = document.createElement('rel-select') as any;
465
+ select.label = 'Status';
466
+ select.options = ['Active', 'Inactive', 'Pending'];
467
+ select.supportingText = 'Select a status';
468
+
469
+ return select;
470
+ })()}
471
+ </div>
472
+
473
+ <div>
474
+ <h4 style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;">Error State</h4>
475
+ ${(() => {
476
+ const select = document.createElement('rel-select') as any;
477
+ select.label = 'Status';
478
+ select.options = ['Active', 'Inactive', 'Pending'];
479
+ select.state = 'error';
480
+ select.supportingText = 'This field is required';
481
+
482
+ return select;
483
+ })()}
484
+ </div>
485
+
486
+ <div>
487
+ <h4 style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;">Disabled State</h4>
488
+ ${(() => {
489
+ const select = document.createElement('rel-select') as any;
490
+ select.label = 'Status';
491
+ select.options = ['Active', 'Inactive', 'Pending'];
492
+ select.state = 'disabled';
493
+ select.selected = 'Active';
494
+ select.supportingText = 'This field is disabled';
495
+
496
+ return select;
497
+ })()}
498
+ </div>
499
+
500
+ <div>
501
+ <h4 style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;">Small Size</h4>
502
+ ${(() => {
503
+ const select = document.createElement('rel-select') as any;
504
+ select.label = 'Size';
505
+ select.options = ['XS', 'S', 'M', 'L', 'XL'];
506
+ select.size = 'small';
507
+ select.selected = 'M';
508
+
509
+ return select;
510
+ })()}
511
+ </div>
512
+
513
+ <div>
514
+ <h4 style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;">Medium Size</h4>
515
+ ${(() => {
516
+ const select = document.createElement('rel-select') as any;
517
+ select.label = 'Priority';
518
+ select.options = ['Low', 'Medium', 'High'];
519
+ select.size = 'medium';
520
+ select.selected = 'Medium';
521
+
522
+ return select;
523
+ })()}
524
+ </div>
525
+
526
+ <div>
527
+ <h4 style="margin: 0 0 16px; color: var(--rel-colors-gray-heading); font-size: 16px;">Large Size</h4>
528
+ ${(() => {
529
+ const select = document.createElement('rel-select') as any;
530
+ select.label = 'Category';
531
+ select.options = ['Technology', 'Business', 'Health'];
532
+ select.size = 'large';
533
+
534
+ return select;
535
+ })()}
536
+ </div>
537
+ </div>
538
+ `,
539
+ };
540
+
541
+ /**
542
+ * Default state with supporting text
543
+ */
544
+ export const DefaultWithSupportingText: Story = {
545
+ render: () => {
546
+ const select = document.createElement('rel-select') as any;
547
+ select.label = 'Subscription Plan';
548
+ select.options = ['Free', 'Basic', 'Premium', 'Enterprise'];
549
+ select.state = 'default';
550
+ select.supportingText = 'Choose the plan that best fits your needs';
551
+
552
+ return select;
553
+ },
554
+ };
555
+
556
+ /**
557
+ * Error state without supporting text
558
+ */
559
+ export const ErrorWithoutSupportingText: Story = {
560
+ render: () => {
561
+ const select = document.createElement('rel-select') as any;
562
+ select.label = 'Required Field';
563
+ select.options = ['Option 1', 'Option 2', 'Option 3'];
564
+ select.state = 'error';
565
+
566
+ return select;
567
+ },
568
+ };
569
+
570
+ /**
571
+ * Error state with supporting text
572
+ */
573
+ export const ErrorWithSupportingText: Story = {
574
+ render: () => {
575
+ const select = document.createElement('rel-select') as any;
576
+ select.label = 'Department';
577
+ select.options = ['Engineering', 'Marketing', 'Sales', 'Support'];
578
+ select.state = 'error';
579
+ select.supportingText = 'Please select a department to continue';
580
+
581
+ return select;
582
+ },
583
+ };
584
+
585
+ /**
586
+ * Disabled state with supporting text
587
+ */
588
+ export const DisabledWithSupportingText: Story = {
589
+ render: () => {
590
+ const select = document.createElement('rel-select') as any;
591
+ select.label = 'Account Type';
592
+ select.options = ['Personal', 'Business', 'Enterprise'];
593
+ select.state = 'disabled';
594
+ select.selected = 'Business';
595
+ select.supportingText = 'Account type cannot be changed after registration';
596
+
597
+ return select;
598
+ },
599
+ };
600
+
601
+ /**
602
+ * Small size with all states
603
+ */
604
+ export const SmallAllStates: Story = {
605
+ render: () => html`
606
+ <div style="display: flex; flex-direction: column; gap: 24px;">
607
+ <div>
608
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Small - Default</h4>
609
+ ${(() => {
610
+ const select = document.createElement('rel-select') as any;
611
+ select.label = 'Size';
612
+ select.options = ['XS', 'S', 'M', 'L', 'XL'];
613
+ select.size = 'small';
614
+ select.state = 'default';
615
+
616
+ return select;
617
+ })()}
618
+ </div>
619
+
620
+ <div>
621
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Small - Error</h4>
622
+ ${(() => {
623
+ const select = document.createElement('rel-select') as any;
624
+ select.label = 'Size';
625
+ select.options = ['XS', 'S', 'M', 'L', 'XL'];
626
+ select.size = 'small';
627
+ select.state = 'error';
628
+ select.supportingText = 'Please select a size';
629
+
630
+ return select;
631
+ })()}
632
+ </div>
633
+
634
+ <div>
635
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Small - Disabled</h4>
636
+ ${(() => {
637
+ const select = document.createElement('rel-select') as any;
638
+ select.label = 'Size';
639
+ select.options = ['XS', 'S', 'M', 'L', 'XL'];
640
+ select.size = 'small';
641
+ select.state = 'disabled';
642
+ select.selected = 'M';
643
+
644
+ return select;
645
+ })()}
646
+ </div>
647
+ </div>
648
+ `,
649
+ };
650
+
651
+ /**
652
+ * Medium size with all states
653
+ */
654
+ export const MediumAllStates: Story = {
655
+ render: () => html`
656
+ <div style="display: flex; flex-direction: column; gap: 24px;">
657
+ <div>
658
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Medium - Default</h4>
659
+ ${(() => {
660
+ const select = document.createElement('rel-select') as any;
661
+ select.label = 'Priority';
662
+ select.options = ['Low', 'Medium', 'High', 'Urgent'];
663
+ select.size = 'medium';
664
+ select.state = 'default';
665
+
666
+ return select;
667
+ })()}
668
+ </div>
669
+
670
+ <div>
671
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Medium - Error</h4>
672
+ ${(() => {
673
+ const select = document.createElement('rel-select') as any;
674
+ select.label = 'Priority';
675
+ select.options = ['Low', 'Medium', 'High', 'Urgent'];
676
+ select.size = 'medium';
677
+ select.state = 'error';
678
+ select.supportingText = 'Priority is required';
679
+
680
+ return select;
681
+ })()}
682
+ </div>
683
+
684
+ <div>
685
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Medium - Disabled</h4>
686
+ ${(() => {
687
+ const select = document.createElement('rel-select') as any;
688
+ select.label = 'Priority';
689
+ select.options = ['Low', 'Medium', 'High', 'Urgent'];
690
+ select.size = 'medium';
691
+ select.state = 'disabled';
692
+ select.selected = 'High';
693
+
694
+ return select;
695
+ })()}
696
+ </div>
697
+ </div>
698
+ `,
699
+ };
700
+
701
+ /**
702
+ * Large size with all states
703
+ */
704
+ export const LargeAllStates: Story = {
705
+ render: () => html`
706
+ <div style="display: flex; flex-direction: column; gap: 24px;">
707
+ <div>
708
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Large - Default</h4>
709
+ ${(() => {
710
+ const select = document.createElement('rel-select') as any;
711
+ select.label = 'Category';
712
+ select.options = ['Technology', 'Business', 'Health', 'Education'];
713
+ select.size = 'large';
714
+ select.state = 'default';
715
+
716
+ return select;
717
+ })()}
718
+ </div>
719
+
720
+ <div>
721
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Large - Error</h4>
722
+ ${(() => {
723
+ const select = document.createElement('rel-select') as any;
724
+ select.label = 'Category';
725
+ select.options = ['Technology', 'Business', 'Health', 'Education'];
726
+ select.size = 'large';
727
+ select.state = 'error';
728
+ select.supportingText = 'Please select a category';
729
+
730
+ return select;
731
+ })()}
732
+ </div>
733
+
734
+ <div>
735
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Large - Disabled</h4>
736
+ ${(() => {
737
+ const select = document.createElement('rel-select') as any;
738
+ select.label = 'Category';
739
+ select.options = ['Technology', 'Business', 'Health', 'Education'];
740
+ select.size = 'large';
741
+ select.state = 'disabled';
742
+ select.selected = 'Technology';
743
+
744
+ return select;
745
+ })()}
746
+ </div>
747
+ </div>
748
+ `,
749
+ };
750
+
751
+ /**
752
+ * Rounded border (default)
753
+ */
754
+ export const RoundedBorder: Story = {
755
+ render: () => {
756
+ const select = document.createElement('rel-select') as any;
757
+ select.label = 'Theme Style';
758
+ select.options = ['Modern', 'Classic', 'Minimalist', 'Bold'];
759
+ select.border = 'rounded';
760
+ select.supportingText = 'Rounded borders for a softer look';
761
+
762
+ return select;
763
+ },
764
+ };
765
+
766
+ /**
767
+ * Sharp border
768
+ */
769
+ export const SharpBorder: Story = {
770
+ render: () => {
771
+ const select = document.createElement('rel-select') as any;
772
+ select.label = 'Layout Mode';
773
+ select.options = ['Grid', 'List', 'Compact', 'Detailed'];
774
+ select.border = 'sharp';
775
+ select.supportingText = 'Sharp borders for a more angular design';
776
+
777
+ return select;
778
+ },
779
+ };
780
+
781
+ /**
782
+ * Border styles comparison
783
+ */
784
+ export const BorderStylesComparison: Story = {
785
+ render: () => html`
786
+ <div style="display: flex; gap: 24px;">
787
+ <div style="flex: 1;">
788
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Rounded</h4>
789
+ ${(() => {
790
+ const select = document.createElement('rel-select') as any;
791
+ select.label = 'Option';
792
+ select.options = ['Choice 1', 'Choice 2', 'Choice 3'];
793
+ select.border = 'rounded';
794
+
795
+ return select;
796
+ })()}
797
+ </div>
798
+
799
+ <div style="flex: 1;">
800
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Sharp</h4>
801
+ ${(() => {
802
+ const select = document.createElement('rel-select') as any;
803
+ select.label = 'Option';
804
+ select.options = ['Choice 1', 'Choice 2', 'Choice 3'];
805
+ select.border = 'sharp';
806
+
807
+ return select;
808
+ })()}
809
+ </div>
810
+ </div>
811
+ `,
812
+ };
813
+
814
+ /**
815
+ * Left icon with small size
816
+ */
817
+ export const LeftIconSmall: Story = {
818
+ render: () => {
819
+ const select = document.createElement('rel-select') as any;
820
+ select.label = 'Location';
821
+ select.options = ['New York', 'London', 'Tokyo', 'Paris'];
822
+ select.size = 'small';
823
+ select.leftIcon = '📍';
824
+ select.supportingText = 'Select your location';
825
+
826
+ return select;
827
+ },
828
+ };
829
+
830
+ /**
831
+ * Left icon with medium size
832
+ */
833
+ export const LeftIconMedium: Story = {
834
+ render: () => {
835
+ const select = document.createElement('rel-select') as any;
836
+ select.label = 'Email Account';
837
+ select.options = ['Primary', 'Work', 'Personal', 'Other'];
838
+ select.size = 'medium';
839
+ select.leftIcon = '📧';
840
+
841
+ return select;
842
+ },
843
+ };
844
+
845
+ /**
846
+ * Left icon with large size
847
+ */
848
+ export const LeftIconLarge: Story = {
849
+ render: () => {
850
+ const select = document.createElement('rel-select') as any;
851
+ select.label = 'Workspace';
852
+ select.options = ['Home Office', 'Corporate', 'Remote', 'Hybrid'];
853
+ select.size = 'large';
854
+ select.leftIcon = '🏢';
855
+
856
+ return select;
857
+ },
858
+ };
859
+
860
+ /**
861
+ * Right icon with small size
862
+ */
863
+ export const RightIconSmall: Story = {
864
+ render: () => {
865
+ const select = document.createElement('rel-select') as any;
866
+ select.label = 'Security Level';
867
+ select.options = ['Low', 'Medium', 'High', 'Maximum'];
868
+ select.size = 'small';
869
+ select.rightIcon = '🔒';
870
+
871
+ return select;
872
+ },
873
+ };
874
+
875
+ /**
876
+ * Right icon with medium size
877
+ */
878
+ export const RightIconMedium: Story = {
879
+ render: () => {
880
+ const select = document.createElement('rel-select') as any;
881
+ select.label = 'Notification Sound';
882
+ select.options = ['Bell', 'Chime', 'Ding', 'Silent'];
883
+ select.size = 'medium';
884
+ select.rightIcon = '🔔';
885
+
886
+ return select;
887
+ },
888
+ };
889
+
890
+ /**
891
+ * Right icon with large size
892
+ */
893
+ export const RightIconLarge: Story = {
894
+ render: () => {
895
+ const select = document.createElement('rel-select') as any;
896
+ select.label = 'Payment Method';
897
+ select.options = ['Credit Card', 'Debit Card', 'PayPal', 'Bank Transfer'];
898
+ select.size = 'large';
899
+ select.rightIcon = '💳';
900
+
901
+ return select;
902
+ },
903
+ };
904
+
905
+ /**
906
+ * Both left and right icons
907
+ */
908
+ export const BothIcons: Story = {
909
+ render: () => {
910
+ const select = document.createElement('rel-select') as any;
911
+ select.label = 'Currency Exchange';
912
+ select.options = ['USD', 'EUR', 'GBP', 'JPY', 'CAD', 'AUD'];
913
+ select.leftIcon = '💱';
914
+ select.rightIcon = '💰';
915
+ select.supportingText = 'Select currency for conversion';
916
+
917
+ return select;
918
+ },
919
+ };
920
+
921
+ /**
922
+ * Long option list
923
+ */
924
+ export const LongOptionList: Story = {
925
+ render: () => {
926
+ const select = document.createElement('rel-select') as any;
927
+ select.label = 'Country';
928
+ select.options = [
929
+ 'Afghanistan', 'Albania', 'Algeria', 'Andorra', 'Angola',
930
+ 'Argentina', 'Armenia', 'Australia', 'Austria', 'Azerbaijan',
931
+ 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus',
932
+ 'Belgium', 'Belize', 'Benin', 'Bhutan', 'Bolivia',
933
+ 'Bosnia and Herzegovina', 'Botswana', 'Brazil', 'Brunei', 'Bulgaria',
934
+ 'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon', 'Canada',
935
+ 'Cape Verde', 'Central African Republic', 'Chad', 'Chile', 'China',
936
+ 'Colombia', 'Comoros', 'Congo', 'Costa Rica', 'Croatia',
937
+ 'Cuba', 'Cyprus', 'Czech Republic', 'Denmark', 'Djibouti',
938
+ 'Dominica', 'Dominican Republic', 'East Timor', 'Ecuador', 'Egypt'
939
+ ];
940
+ select.supportingText = 'Select your country from the list';
941
+
942
+ return select;
943
+ },
944
+ };
945
+
946
+ /**
947
+ * Long option list with left icon
948
+ */
949
+ export const LongListWithIcon: Story = {
950
+ render: () => {
951
+ const select = document.createElement('rel-select') as any;
952
+ select.label = 'City';
953
+ select.options = [
954
+ 'New York', 'Los Angeles', 'Chicago', 'Houston', 'Phoenix',
955
+ 'Philadelphia', 'San Antonio', 'San Diego', 'Dallas', 'San Jose',
956
+ 'Austin', 'Jacksonville', 'Fort Worth', 'Columbus', 'Charlotte',
957
+ 'San Francisco', 'Indianapolis', 'Seattle', 'Denver', 'Boston',
958
+ 'Nashville', 'Detroit', 'Portland', 'Las Vegas', 'Memphis',
959
+ 'Louisville', 'Baltimore', 'Milwaukee', 'Albuquerque', 'Tucson'
960
+ ];
961
+ select.leftIcon = '🏙️';
962
+ select.supportingText = 'Choose your preferred city';
963
+
964
+ return select;
965
+ },
966
+ };
967
+
968
+ /**
969
+ * Small select with sharp border and left icon
970
+ */
971
+ export const SmallSharpWithLeftIcon: Story = {
972
+ render: () => {
973
+ const select = document.createElement('rel-select') as any;
974
+ select.label = 'Icon Set';
975
+ select.options = ['Outlined', 'Filled', 'Rounded', 'Sharp'];
976
+ select.size = 'small';
977
+ select.border = 'sharp';
978
+ select.leftIcon = '🎨';
979
+
980
+ return select;
981
+ },
982
+ };
983
+
984
+ /**
985
+ * Large select with rounded border and right icon
986
+ */
987
+ export const LargeRoundedWithRightIcon: Story = {
988
+ render: () => {
989
+ const select = document.createElement('rel-select') as any;
990
+ select.label = 'Package Size';
991
+ select.options = ['Small Box', 'Medium Box', 'Large Box', 'Extra Large Box'];
992
+ select.size = 'large';
993
+ select.border = 'rounded';
994
+ select.rightIcon = '📦';
995
+ select.supportingText = 'Select appropriate package size';
996
+
997
+ return select;
998
+ },
999
+ };
1000
+
1001
+ /**
1002
+ * Error state with left icon and supporting text
1003
+ */
1004
+ export const ErrorWithLeftIconAndText: Story = {
1005
+ render: () => {
1006
+ const select = document.createElement('rel-select') as any;
1007
+ select.label = 'Shipping Method';
1008
+ select.options = ['Standard', 'Express', 'Overnight', 'International'];
1009
+ select.state = 'error';
1010
+ select.leftIcon = '🚚';
1011
+ select.supportingText = 'Please select a shipping method to proceed';
1012
+
1013
+ return select;
1014
+ },
1015
+ };
1016
+
1017
+ /**
1018
+ * Disabled state with both icons
1019
+ */
1020
+ export const DisabledWithBothIcons: Story = {
1021
+ render: () => {
1022
+ const select = document.createElement('rel-select') as any;
1023
+ select.label = 'Transaction Type';
1024
+ select.options = ['Purchase', 'Refund', 'Transfer', 'Withdrawal'];
1025
+ select.state = 'disabled';
1026
+ select.selected = 'Purchase';
1027
+ select.leftIcon = '💰';
1028
+ select.rightIcon = '🔒';
1029
+ select.supportingText = 'Transaction type is locked';
1030
+
1031
+ return select;
1032
+ },
1033
+ };
1034
+
1035
+ /**
1036
+ * All size variations with icons
1037
+ */
1038
+ export const AllSizesWithIcons: Story = {
1039
+ render: () => html`
1040
+ <div style="display: flex; flex-direction: column; gap: 24px;">
1041
+ <div>
1042
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Small with Icon</h4>
1043
+ ${(() => {
1044
+ const select = document.createElement('rel-select') as any;
1045
+ select.label = 'Status';
1046
+ select.options = ['Online', 'Away', 'Busy', 'Offline'];
1047
+ select.size = 'small';
1048
+ select.leftIcon = '🟢';
1049
+
1050
+ return select;
1051
+ })()}
1052
+ </div>
1053
+
1054
+ <div>
1055
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Medium with Icon</h4>
1056
+ ${(() => {
1057
+ const select = document.createElement('rel-select') as any;
1058
+ select.label = 'Status';
1059
+ select.options = ['Online', 'Away', 'Busy', 'Offline'];
1060
+ select.size = 'medium';
1061
+ select.leftIcon = '🟢';
1062
+
1063
+ return select;
1064
+ })()}
1065
+ </div>
1066
+
1067
+ <div>
1068
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Large with Icon</h4>
1069
+ ${(() => {
1070
+ const select = document.createElement('rel-select') as any;
1071
+ select.label = 'Status';
1072
+ select.options = ['Online', 'Away', 'Busy', 'Offline'];
1073
+ select.size = 'large';
1074
+ select.leftIcon = '🟢';
1075
+
1076
+ return select;
1077
+ })()}
1078
+ </div>
1079
+ </div>
1080
+ `,
1081
+ };
1082
+
1083
+ /**
1084
+ * Complex combination - Large, Sharp, Error, Both Icons, Supporting Text
1085
+ */
1086
+ export const ComplexCombination: Story = {
1087
+ render: () => {
1088
+ const select = document.createElement('rel-select') as any;
1089
+ select.label = 'Security Clearance';
1090
+ select.options = ['Level 1', 'Level 2', 'Level 3', 'Level 4', 'Level 5'];
1091
+ select.size = 'large';
1092
+ select.border = 'sharp';
1093
+ select.state = 'error';
1094
+ select.leftIcon = '🔐';
1095
+ select.rightIcon = '⚠️';
1096
+ select.supportingText = 'Security clearance level is required for access';
1097
+
1098
+ return select;
1099
+ },
1100
+ };
1101
+
1102
+ /**
1103
+ * All combinations showcase
1104
+ */
1105
+ export const AllCombinations: Story = {
1106
+ render: () => html`
1107
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px;">
1108
+ <div>
1109
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Small + Rounded + Icon</h4>
1110
+ ${(() => {
1111
+ const select = document.createElement('rel-select') as any;
1112
+ select.label = 'Theme';
1113
+ select.options = ['Light', 'Dark', 'Auto'];
1114
+ select.size = 'small';
1115
+ select.border = 'rounded';
1116
+ select.leftIcon = '🎨';
1117
+
1118
+ return select;
1119
+ })()}
1120
+ </div>
1121
+
1122
+ <div>
1123
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Small + Sharp + Error</h4>
1124
+ ${(() => {
1125
+ const select = document.createElement('rel-select') as any;
1126
+ select.label = 'Theme';
1127
+ select.options = ['Light', 'Dark', 'Auto'];
1128
+ select.size = 'small';
1129
+ select.border = 'sharp';
1130
+ select.state = 'error';
1131
+ select.supportingText = 'Required field';
1132
+
1133
+ return select;
1134
+ })()}
1135
+ </div>
1136
+
1137
+ <div>
1138
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Medium + Rounded + Disabled</h4>
1139
+ ${(() => {
1140
+ const select = document.createElement('rel-select') as any;
1141
+ select.label = 'Plan';
1142
+ select.options = ['Free', 'Pro', 'Enterprise'];
1143
+ select.size = 'medium';
1144
+ select.border = 'rounded';
1145
+ select.state = 'disabled';
1146
+ select.selected = 'Pro';
1147
+
1148
+ return select;
1149
+ })()}
1150
+ </div>
1151
+
1152
+ <div>
1153
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Medium + Sharp + Both Icons</h4>
1154
+ ${(() => {
1155
+ const select = document.createElement('rel-select') as any;
1156
+ select.label = 'Currency';
1157
+ select.options = ['USD', 'EUR', 'GBP'];
1158
+ select.size = 'medium';
1159
+ select.border = 'sharp';
1160
+ select.leftIcon = '💱';
1161
+ select.rightIcon = '💰';
1162
+
1163
+ return select;
1164
+ })()}
1165
+ </div>
1166
+
1167
+ <div>
1168
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Large + Rounded + Error + Icon</h4>
1169
+ ${(() => {
1170
+ const select = document.createElement('rel-select') as any;
1171
+ select.label = 'Department';
1172
+ select.options = ['Sales', 'Engineering', 'Marketing'];
1173
+ select.size = 'large';
1174
+ select.border = 'rounded';
1175
+ select.state = 'error';
1176
+ select.leftIcon = '🏢';
1177
+ select.supportingText = 'Department selection required';
1178
+
1179
+ return select;
1180
+ })()}
1181
+ </div>
1182
+
1183
+ <div>
1184
+ <h4 style="margin: 0 0 12px; color: var(--rel-colors-gray-heading); font-size: 14px;">Large + Sharp + Disabled + Icon</h4>
1185
+ ${(() => {
1186
+ const select = document.createElement('rel-select') as any;
1187
+ select.label = 'Role';
1188
+ select.options = ['Admin', 'User', 'Guest'];
1189
+ select.size = 'large';
1190
+ select.border = 'sharp';
1191
+ select.state = 'disabled';
1192
+ select.selected = 'User';
1193
+ select.rightIcon = '👤';
1194
+ select.supportingText = 'Role cannot be changed';
1195
+
1196
+ return select;
1197
+ })()}
1198
+ </div>
1199
+ </div>
1200
+ `,
1201
+ };