@reliability-design/web 1.0.2 → 1.0.6

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 (145) hide show
  1. package/dist/components/rel-accordion/README.md +132 -0
  2. package/dist/components/rel-accordion/rel-accordion.ts +61 -29
  3. package/dist/components/rel-alert/README.md +141 -0
  4. package/dist/components/rel-alert/rel-alert.ts +110 -67
  5. package/dist/components/rel-avatar/README.md +119 -0
  6. package/dist/components/rel-avatar/rel-avatar.ts +8 -15
  7. package/dist/components/rel-badge/README.md +86 -0
  8. package/dist/components/rel-badge/rel-badge.ts +28 -21
  9. package/dist/components/rel-breadcrumb/README.md +102 -0
  10. package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +24 -18
  11. package/dist/components/rel-button/README.md +130 -0
  12. package/dist/components/rel-button/rel-button.ts +39 -59
  13. package/dist/components/rel-calendar/README.md +109 -0
  14. package/dist/components/rel-calendar/index.ts +1 -0
  15. package/dist/components/rel-calendar/rel-calendar.ts +467 -0
  16. package/dist/components/rel-card/README.md +94 -0
  17. package/dist/components/rel-card/rel-card.ts +21 -11
  18. package/dist/components/rel-cardmedia/README.md +127 -0
  19. package/dist/components/rel-cardmedia/rel-cardmedia.ts +22 -18
  20. package/dist/components/rel-carousel/README.md +166 -0
  21. package/dist/components/rel-carousel/index.ts +1 -0
  22. package/dist/components/rel-carousel/rel-carousel.ts +469 -0
  23. package/dist/components/rel-chart/README.md +286 -0
  24. package/dist/components/rel-chart/index.ts +1 -0
  25. package/dist/components/rel-chart/rel-chart.ts +736 -0
  26. package/dist/components/rel-checkbox/README.md +77 -0
  27. package/dist/components/rel-checkbox/rel-checkbox.ts +36 -45
  28. package/dist/components/rel-chip/README.md +114 -0
  29. package/dist/components/rel-chip/rel-chip.ts +47 -122
  30. package/dist/components/rel-container/README.md +99 -0
  31. package/dist/components/rel-container/rel-container.ts +1 -6
  32. package/dist/components/rel-date-picker/README.md +253 -0
  33. package/dist/components/rel-date-picker/index.ts +1 -0
  34. package/dist/components/rel-date-picker/rel-date-picker.ts +916 -0
  35. package/dist/components/rel-divider/README.md +100 -0
  36. package/dist/components/rel-divider/rel-divider.ts +37 -37
  37. package/dist/components/rel-drawer/README.md +200 -0
  38. package/dist/components/rel-drawer/index.ts +1 -0
  39. package/dist/components/rel-drawer/rel-drawer.ts +621 -0
  40. package/dist/components/rel-kbd/README.md +151 -0
  41. package/dist/components/rel-kbd/rel-kbd.ts +118 -0
  42. package/dist/components/rel-layout/README.md +88 -0
  43. package/dist/components/rel-layout/rel-layout.ts +12 -14
  44. package/dist/components/rel-menu/README.md +151 -0
  45. package/dist/components/rel-menu/rel-menu.ts +18 -10
  46. package/dist/components/rel-menubar/README.md +329 -0
  47. package/dist/components/rel-menubar/index.ts +2 -0
  48. package/dist/components/rel-menubar/rel-menubar-menu.ts +16 -0
  49. package/dist/components/rel-menubar/rel-menubar.ts +576 -0
  50. package/dist/components/rel-nav-menu/README.md +289 -0
  51. package/dist/components/rel-nav-menu/index.ts +3 -0
  52. package/dist/components/rel-nav-menu/rel-nav-menu-item.ts +143 -0
  53. package/dist/components/rel-nav-menu/rel-nav-menu-panel.ts +53 -0
  54. package/dist/components/rel-nav-menu/rel-nav-menu.ts +331 -0
  55. package/dist/components/rel-navbar/README.md +126 -0
  56. package/dist/components/rel-navbar/rel-navbar.ts +91 -0
  57. package/dist/components/rel-otp/README.md +440 -0
  58. package/dist/components/rel-otp/index.ts +1 -0
  59. package/dist/components/rel-otp/rel-otp.ts +504 -0
  60. package/dist/components/rel-pagination/README.md +410 -0
  61. package/dist/components/rel-pagination/index.ts +1 -0
  62. package/dist/components/rel-pagination/rel-pagination.ts +376 -0
  63. package/dist/components/rel-popover/README.md +568 -0
  64. package/dist/components/rel-popover/index.ts +2 -0
  65. package/dist/components/rel-popover/rel-popover-content.ts +55 -0
  66. package/dist/components/rel-popover/rel-popover.ts +327 -0
  67. package/dist/components/rel-progress/README.md +110 -0
  68. package/dist/components/rel-progress/rel-progress.ts +58 -20
  69. package/dist/components/rel-quote-page/README.md +166 -0
  70. package/dist/components/rel-quote-page/rel-quote-page.ts +816 -0
  71. package/dist/components/rel-radio/README.md +120 -0
  72. package/dist/components/rel-radio/rel-radio.ts +41 -73
  73. package/dist/components/rel-resizable/README.md +140 -0
  74. package/dist/components/rel-resizable/index.ts +3 -0
  75. package/dist/components/rel-resizable/rel-resizable-group.ts +374 -0
  76. package/dist/components/rel-resizable/rel-resizable-handle.ts +149 -0
  77. package/dist/components/rel-resizable/rel-resizable-panel.ts +47 -0
  78. package/dist/components/rel-segmented-button/README.md +141 -0
  79. package/dist/components/rel-segmented-button/rel-segmented-button.ts +18 -13
  80. package/dist/components/rel-select/README.md +107 -0
  81. package/dist/components/rel-select/rel-select.ts +14 -14
  82. package/dist/components/rel-sheet/README.md +224 -0
  83. package/dist/components/rel-sheet/rel-sheet.ts +683 -0
  84. package/dist/components/rel-sidebar/README.md +209 -0
  85. package/dist/components/rel-sidebar/rel-sidebar.ts +1158 -0
  86. package/dist/components/rel-slider/README.md +135 -0
  87. package/dist/components/rel-slider/rel-slider.ts +19 -7
  88. package/dist/components/rel-snackbar/README.md +134 -0
  89. package/dist/components/rel-snackbar/rel-snackbar.ts +73 -2
  90. package/dist/components/rel-stepper/README.md +160 -0
  91. package/dist/components/rel-stepper/rel-stepper.ts +29 -8
  92. package/dist/components/rel-switch/README.md +102 -0
  93. package/dist/components/rel-switch/rel-switch.ts +22 -11
  94. package/dist/components/rel-tab/README.md +163 -0
  95. package/dist/components/rel-tab/rel-tab.ts +46 -22
  96. package/dist/components/rel-table/README.md +178 -0
  97. package/dist/components/rel-table/rel-table-body.ts +16 -0
  98. package/dist/components/rel-table/rel-table-caption.ts +22 -0
  99. package/dist/components/rel-table/rel-table-cell.ts +49 -0
  100. package/dist/components/rel-table/rel-table-footer.ts +18 -0
  101. package/dist/components/rel-table/rel-table-head.ts +33 -0
  102. package/dist/components/rel-table/rel-table-header.ts +16 -0
  103. package/dist/components/rel-table/rel-table-row.ts +32 -0
  104. package/dist/components/rel-table/rel-table.ts +47 -0
  105. package/dist/components/rel-textfield/README.md +90 -0
  106. package/dist/components/rel-textfield/rel-textfield.ts +37 -21
  107. package/dist/components/rel-toast/README.md +148 -0
  108. package/dist/components/rel-toast/rel-toast.ts +32 -14
  109. package/dist/components/rel-tooltip/README.md +103 -0
  110. package/dist/components/rel-tooltip/rel-tooltip.ts +9 -9
  111. package/dist/index.d.mts +846 -7
  112. package/dist/index.d.ts +846 -7
  113. package/dist/index.js +10860 -1803
  114. package/dist/index.js.map +1 -1
  115. package/dist/index.mjs +10820 -1809
  116. package/dist/index.mjs.map +1 -1
  117. package/dist/styles/vars.css +293 -183
  118. package/dist/vars-ITL2K3KO.css +294 -0
  119. package/package.json +2 -2
  120. package/dist/components/rel-accordion/rel-accordion.stories.ts +0 -313
  121. package/dist/components/rel-alert/rel-alert.stories.ts +0 -412
  122. package/dist/components/rel-avatar/rel-avatar.stories.ts +0 -327
  123. package/dist/components/rel-badge/rel-badge.stories.ts +0 -350
  124. package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +0 -306
  125. package/dist/components/rel-button/rel-button.stories.ts +0 -356
  126. package/dist/components/rel-card/rel-card.stories.ts +0 -299
  127. package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +0 -368
  128. package/dist/components/rel-checkbox/rel-checkbox.stories.ts +0 -414
  129. package/dist/components/rel-chip/rel-chip.stories.ts +0 -552
  130. package/dist/components/rel-container/rel-container.stories.ts +0 -239
  131. package/dist/components/rel-divider/rel-divider.stories.ts +0 -229
  132. package/dist/components/rel-layout/rel-layout.stories.ts +0 -713
  133. package/dist/components/rel-menu/rel-menu.stories.ts +0 -910
  134. package/dist/components/rel-progress/rel-progress.stories.ts +0 -817
  135. package/dist/components/rel-radio/rel-radio.stories.ts +0 -1048
  136. package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +0 -1079
  137. package/dist/components/rel-select/rel-select.stories.ts +0 -1201
  138. package/dist/components/rel-slider/rel-slider.stories.ts +0 -730
  139. package/dist/components/rel-snackbar/rel-snackbar.stories.ts +0 -808
  140. package/dist/components/rel-stepper/rel-stepper.stories.ts +0 -752
  141. package/dist/components/rel-switch/rel-switch.stories.ts +0 -441
  142. package/dist/components/rel-tab/rel-tab.stories.ts +0 -492
  143. package/dist/components/rel-textfield/rel-textfield.stories.ts +0 -710
  144. package/dist/components/rel-toast/rel-toast.stories.ts +0 -394
  145. package/dist/components/rel-tooltip/rel-tooltip.stories.ts +0 -364
@@ -1,394 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components-vite';
2
- import { html } from 'lit';
3
- import './rel-toast';
4
-
5
- /**
6
- * The Toast component displays brief, temporary notifications at the bottom of the screen.
7
- * Built with Lit web components for framework-agnostic usage.
8
- *
9
- * ## Features
10
- * - **2 Types**: default (dark), error (red)
11
- * - **Action Button**: Optional action with custom label
12
- * - **Auto Dismiss**: Configurable duration (default 4000ms)
13
- * - **Manual Dismiss**: Close button always available
14
- * - **Animations**: Smooth fade-in-up animation
15
- * - **Programmatic Control**: show() and close() methods
16
- */
17
- const meta: Meta = {
18
- title: 'Components/Toast',
19
- tags: ['autodocs'],
20
- component: 'rel-toast',
21
- argTypes: {
22
- message: {
23
- control: 'text',
24
- description: 'Message to display in the toast',
25
- table: {
26
- type: { summary: 'string' },
27
- },
28
- },
29
- type: {
30
- control: { type: 'select' },
31
- options: ['default', 'error'],
32
- description: 'Visual style of the toast',
33
- table: {
34
- defaultValue: { summary: 'default' },
35
- type: { summary: 'string' },
36
- },
37
- },
38
- actionLabel: {
39
- control: 'text',
40
- description: 'Label for the action button (optional)',
41
- table: {
42
- type: { summary: 'string' },
43
- },
44
- },
45
- duration: {
46
- control: 'number',
47
- description: 'Auto-dismiss duration in milliseconds (0 = no auto-dismiss)',
48
- table: {
49
- defaultValue: { summary: 4000 },
50
- type: { summary: 'number' },
51
- },
52
- },
53
- },
54
- };
55
-
56
- export default meta;
57
- type Story = StoryObj;
58
-
59
- /**
60
- * Default toast - standard notification with dark background
61
- */
62
- export const Default: Story = {
63
- render: () => {
64
- const showToast = () => {
65
- const toast = document.querySelector('rel-toast') as any;
66
- if (toast) toast.show();
67
- };
68
- return html`
69
- <div>
70
- <button @click="${showToast}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
71
- Show Toast
72
- </button>
73
- <rel-toast message="This is a toast notification"></rel-toast>
74
- </div>
75
- `;
76
- },
77
- };
78
-
79
- /**
80
- * Error toast - error notification with red background
81
- */
82
- export const ErrorToast: Story = {
83
- render: () => {
84
- const showToast = () => {
85
- const toast = document.querySelector('rel-toast') as any;
86
- if (toast) toast.show();
87
- };
88
- return html`
89
- <div>
90
- <button @click="${showToast}" style="padding: 12px 24px; background: #d50000; color: white; border: none; border-radius: 6px; cursor: pointer;">
91
- Show Error Toast
92
- </button>
93
- <rel-toast message="An error occurred!" type="error"></rel-toast>
94
- </div>
95
- `;
96
- },
97
- };
98
-
99
- /**
100
- * With action button - toast with actionable button
101
- */
102
- export const WithAction: Story = {
103
- render: () => {
104
- const showToast = () => {
105
- const toast = document.querySelector('rel-toast') as any;
106
- if (toast) toast.show();
107
- };
108
- const handleAction = () => {
109
- alert('Action clicked!');
110
- };
111
- return html`
112
- <div>
113
- <button @click="${showToast}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
114
- Show Toast with Action
115
- </button>
116
- <rel-toast
117
- message="Item added to cart"
118
- actionLabel="UNDO"
119
- @action="${handleAction}"
120
- ></rel-toast>
121
- </div>
122
- `;
123
- },
124
- };
125
-
126
- /**
127
- * Without action - simple toast with just message and close button
128
- */
129
- export const WithoutAction: Story = {
130
- render: () => {
131
- const showToast = () => {
132
- const toast = document.querySelector('rel-toast') as any;
133
- if (toast) toast.show();
134
- };
135
- return html`
136
- <div>
137
- <button @click="${showToast}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
138
- Show Simple Toast
139
- </button>
140
- <rel-toast message="Changes saved successfully"></rel-toast>
141
- </div>
142
- `;
143
- },
144
- };
145
-
146
- /**
147
- * Long duration - toast that stays visible for 8 seconds
148
- */
149
- export const LongDuration: Story = {
150
- render: () => {
151
- const showToast = () => {
152
- const toast = document.querySelector('rel-toast') as any;
153
- if (toast) toast.show();
154
- };
155
- return html`
156
- <div>
157
- <button @click="${showToast}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
158
- Show Long Toast (8s)
159
- </button>
160
- <rel-toast message="This toast will stay for 8 seconds" duration="8000"></rel-toast>
161
- </div>
162
- `;
163
- },
164
- };
165
-
166
- /**
167
- * Short duration - toast that dismisses quickly (2 seconds)
168
- */
169
- export const ShortDuration: Story = {
170
- render: () => {
171
- const showToast = () => {
172
- const toast = document.querySelector('rel-toast') as any;
173
- if (toast) toast.show();
174
- };
175
- return html`
176
- <div>
177
- <button @click="${showToast}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
178
- Show Quick Toast (2s)
179
- </button>
180
- <rel-toast message="Quick message" duration="2000"></rel-toast>
181
- </div>
182
- `;
183
- },
184
- };
185
-
186
- /**
187
- * No auto-dismiss - toast stays until manually closed
188
- */
189
- export const NoAutoDismiss: Story = {
190
- render: () => {
191
- const showToast = () => {
192
- const toast = document.querySelector('rel-toast') as any;
193
- if (toast) toast.show();
194
- };
195
- return html`
196
- <div>
197
- <button @click="${showToast}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
198
- Show Persistent Toast
199
- </button>
200
- <rel-toast message="This toast won't auto-dismiss. Click X to close." duration="0"></rel-toast>
201
- </div>
202
- `;
203
- },
204
- };
205
-
206
- /**
207
- * Save notification - realistic save confirmation
208
- */
209
- export const SaveNotification: Story = {
210
- render: () => {
211
- const showToast = () => {
212
- const toast = document.querySelector('rel-toast') as any;
213
- if (toast) toast.show();
214
- };
215
- return html`
216
- <div>
217
- <button @click="${showToast}" style="padding: 12px 24px; background: #0edb90; color: #111; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;">
218
- Save Changes
219
- </button>
220
- <rel-toast message="Your changes have been saved"></rel-toast>
221
- </div>
222
- `;
223
- },
224
- };
225
-
226
- /**
227
- * Delete notification - error toast with undo action
228
- */
229
- export const DeleteNotification: Story = {
230
- render: () => {
231
- const showToast = () => {
232
- const toast = document.querySelector('rel-toast') as any;
233
- if (toast) toast.show();
234
- };
235
- const handleUndo = () => {
236
- alert('Delete undone!');
237
- };
238
- return html`
239
- <div>
240
- <button @click="${showToast}" style="padding: 12px 24px; background: #d50000; color: white; border: none; border-radius: 6px; cursor: pointer;">
241
- Delete Item
242
- </button>
243
- <rel-toast
244
- message="Item deleted"
245
- type="error"
246
- actionLabel="UNDO"
247
- @action="${handleUndo}"
248
- ></rel-toast>
249
- </div>
250
- `;
251
- },
252
- };
253
-
254
- /**
255
- * Network error - error toast for connection issues
256
- */
257
- export const NetworkError: Story = {
258
- render: () => {
259
- const showToast = () => {
260
- const toast = document.querySelector('rel-toast') as any;
261
- if (toast) toast.show();
262
- };
263
- const handleRetry = () => {
264
- alert('Retrying...');
265
- };
266
- return html`
267
- <div>
268
- <button @click="${showToast}" style="padding: 12px 24px; background: #d50000; color: white; border: none; border-radius: 6px; cursor: pointer;">
269
- Simulate Network Error
270
- </button>
271
- <rel-toast
272
- message="Network connection failed"
273
- type="error"
274
- actionLabel="RETRY"
275
- duration="0"
276
- @action="${handleRetry}"
277
- ></rel-toast>
278
- </div>
279
- `;
280
- },
281
- };
282
-
283
- /**
284
- * Copy notification - confirmation for copy action
285
- */
286
- export const CopyNotification: Story = {
287
- render: () => {
288
- const showToast = () => {
289
- const toast = document.querySelector('rel-toast') as any;
290
- if (toast) toast.show();
291
- };
292
- return html`
293
- <div>
294
- <button @click="${showToast}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
295
- Copy to Clipboard
296
- </button>
297
- <rel-toast message="Copied to clipboard" duration="2000"></rel-toast>
298
- </div>
299
- `;
300
- },
301
- };
302
-
303
- /**
304
- * Multiple toasts demo - shows handling of sequential toasts
305
- */
306
- export const MultipleToasts: Story = {
307
- render: () => {
308
- let toastCount = 0;
309
- const showToast = () => {
310
- toastCount++;
311
- const container = document.querySelector('#toast-container');
312
- if (container) {
313
- const toast = document.createElement('rel-toast') as any;
314
- toast.setAttribute('message', `Toast notification #${toastCount}`);
315
- toast.style.position = 'fixed';
316
- toast.style.bottom = `${24 + (toastCount - 1) * 70}px`;
317
- container.appendChild(toast);
318
- toast.show();
319
-
320
- // Clean up after toast dismisses
321
- toast.addEventListener('dismissed', () => {
322
- setTimeout(() => {
323
- container.removeChild(toast);
324
- toastCount--;
325
- }, 300);
326
- });
327
- }
328
- };
329
- return html`
330
- <div>
331
- <button @click="${showToast}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
332
- Show Multiple Toasts
333
- </button>
334
- <div id="toast-container"></div>
335
- </div>
336
- `;
337
- },
338
- };
339
-
340
- /**
341
- * All types showcase - displays both toast types
342
- */
343
- export const AllTypes: Story = {
344
- render: () => {
345
- const showDefaultToast = () => {
346
- const toast = document.querySelector('#default-toast') as any;
347
- if (toast) toast.show();
348
- };
349
- const showErrorToast = () => {
350
- const toast = document.querySelector('#error-toast') as any;
351
- if (toast) toast.show();
352
- };
353
- return html`
354
- <div style="display: flex; gap: 16px;">
355
- <button @click="${showDefaultToast}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
356
- Show Default
357
- </button>
358
- <button @click="${showErrorToast}" style="padding: 12px 24px; background: #d50000; color: white; border: none; border-radius: 6px; cursor: pointer;">
359
- Show Error
360
- </button>
361
- <rel-toast id="default-toast" message="Default toast notification" type="default"></rel-toast>
362
- <rel-toast id="error-toast" message="Error toast notification" type="error"></rel-toast>
363
- </div>
364
- `;
365
- },
366
- };
367
-
368
- /**
369
- * Action variations - toasts with and without actions
370
- */
371
- export const ActionVariations: Story = {
372
- render: () => {
373
- const showWithAction = () => {
374
- const toast = document.querySelector('#with-action') as any;
375
- if (toast) toast.show();
376
- };
377
- const showWithoutAction = () => {
378
- const toast = document.querySelector('#without-action') as any;
379
- if (toast) toast.show();
380
- };
381
- return html`
382
- <div style="display: flex; gap: 16px;">
383
- <button @click="${showWithAction}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
384
- With Action
385
- </button>
386
- <button @click="${showWithoutAction}" style="padding: 12px 24px; background: #111; color: white; border: none; border-radius: 6px; cursor: pointer;">
387
- Without Action
388
- </button>
389
- <rel-toast id="with-action" message="Item added" actionLabel="UNDO"></rel-toast>
390
- <rel-toast id="without-action" message="Operation completed"></rel-toast>
391
- </div>
392
- `;
393
- },
394
- };