@reliability-design/web 1.0.2 → 1.0.3

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 (54) hide show
  1. package/dist/components/rel-accordion/rel-accordion.ts +27 -22
  2. package/dist/components/rel-alert/rel-alert.ts +98 -66
  3. package/dist/components/rel-avatar/rel-avatar.ts +8 -15
  4. package/dist/components/rel-badge/rel-badge.ts +23 -16
  5. package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +12 -12
  6. package/dist/components/rel-button/rel-button.ts +39 -59
  7. package/dist/components/rel-card/rel-card.ts +11 -10
  8. package/dist/components/rel-cardmedia/rel-cardmedia.ts +11 -17
  9. package/dist/components/rel-checkbox/rel-checkbox.ts +18 -35
  10. package/dist/components/rel-chip/rel-chip.ts +37 -128
  11. package/dist/components/rel-container/rel-container.ts +1 -6
  12. package/dist/components/rel-divider/rel-divider.ts +37 -37
  13. package/dist/components/rel-layout/rel-layout.ts +12 -14
  14. package/dist/components/rel-progress/rel-progress.ts +26 -15
  15. package/dist/components/rel-radio/rel-radio.ts +32 -72
  16. package/dist/components/rel-snackbar/rel-snackbar.ts +6 -0
  17. package/dist/components/rel-stepper/rel-stepper.ts +23 -2
  18. package/dist/components/rel-switch/rel-switch.ts +7 -5
  19. package/dist/components/rel-tab/rel-tab.ts +10 -8
  20. package/dist/components/rel-textfield/rel-textfield.ts +2 -2
  21. package/dist/index.d.mts +11 -7
  22. package/dist/index.d.ts +11 -7
  23. package/dist/index.js +367 -475
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +383 -489
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/vars-6ZIUPIU4.css +184 -0
  28. package/package.json +2 -2
  29. package/dist/components/rel-accordion/rel-accordion.stories.ts +0 -313
  30. package/dist/components/rel-alert/rel-alert.stories.ts +0 -412
  31. package/dist/components/rel-avatar/rel-avatar.stories.ts +0 -327
  32. package/dist/components/rel-badge/rel-badge.stories.ts +0 -350
  33. package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +0 -306
  34. package/dist/components/rel-button/rel-button.stories.ts +0 -356
  35. package/dist/components/rel-card/rel-card.stories.ts +0 -299
  36. package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +0 -368
  37. package/dist/components/rel-checkbox/rel-checkbox.stories.ts +0 -414
  38. package/dist/components/rel-chip/rel-chip.stories.ts +0 -552
  39. package/dist/components/rel-container/rel-container.stories.ts +0 -239
  40. package/dist/components/rel-divider/rel-divider.stories.ts +0 -229
  41. package/dist/components/rel-layout/rel-layout.stories.ts +0 -713
  42. package/dist/components/rel-menu/rel-menu.stories.ts +0 -910
  43. package/dist/components/rel-progress/rel-progress.stories.ts +0 -817
  44. package/dist/components/rel-radio/rel-radio.stories.ts +0 -1048
  45. package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +0 -1079
  46. package/dist/components/rel-select/rel-select.stories.ts +0 -1201
  47. package/dist/components/rel-slider/rel-slider.stories.ts +0 -730
  48. package/dist/components/rel-snackbar/rel-snackbar.stories.ts +0 -808
  49. package/dist/components/rel-stepper/rel-stepper.stories.ts +0 -752
  50. package/dist/components/rel-switch/rel-switch.stories.ts +0 -441
  51. package/dist/components/rel-tab/rel-tab.stories.ts +0 -492
  52. package/dist/components/rel-textfield/rel-textfield.stories.ts +0 -710
  53. package/dist/components/rel-toast/rel-toast.stories.ts +0 -394
  54. package/dist/components/rel-tooltip/rel-tooltip.stories.ts +0 -364
@@ -1,412 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components-vite';
2
- import { html } from 'lit';
3
- import './rel-alert';
4
-
5
- /**
6
- * The Alert component provides contextual feedback messages for user actions.
7
- * Built with Lit web components for framework-agnostic usage.
8
- *
9
- * ## Features
10
- * - **5 Types**: info, success, warning, error, neutral
11
- * - **Custom Icons**: Semantic icons for each alert type
12
- * - **Two-Line Messages**: Primary and secondary message support
13
- * - **Optional Links**: Inline action links within alerts
14
- * - **Dismissible**: Optional close button to dismiss alerts
15
- * - **Semantic Colors**: Token-based color system matching alert type
16
- */
17
- const meta: Meta = {
18
- title: 'Components/Alert',
19
- tags: ['autodocs'],
20
- component: 'rel-alert',
21
- argTypes: {
22
- type: {
23
- control: { type: 'select' },
24
- options: ['info', 'success', 'warning', 'error', 'neutral'],
25
- description: 'Alert type determines color and icon',
26
- table: {
27
- defaultValue: { summary: 'neutral' },
28
- type: { summary: 'string' },
29
- },
30
- },
31
- message1: {
32
- control: 'text',
33
- description: 'Primary message (required)',
34
- table: {
35
- type: { summary: 'string' },
36
- },
37
- },
38
- message2: {
39
- control: 'text',
40
- description: 'Secondary message (optional)',
41
- table: {
42
- type: { summary: 'string' },
43
- },
44
- },
45
- urlText: {
46
- control: 'text',
47
- description: 'Link text (optional)',
48
- table: {
49
- type: { summary: 'string' },
50
- },
51
- },
52
- urlHref: {
53
- control: 'text',
54
- description: 'Link URL (optional)',
55
- table: {
56
- type: { summary: 'string' },
57
- },
58
- },
59
- dismissible: {
60
- control: 'boolean',
61
- description: 'Show close button',
62
- table: {
63
- defaultValue: { summary: true },
64
- type: { summary: 'boolean' },
65
- },
66
- },
67
- },
68
- render: (args) => html`
69
- <rel-alert
70
- type="${args.type || 'neutral'}"
71
- message1="${args.message1 || 'Alert message'}"
72
- message2="${args.message2 || ''}"
73
- urlText="${args.urlText || ''}"
74
- urlHref="${args.urlHref || ''}"
75
- ?dismissible="${args.dismissible !== false}"
76
- ></rel-alert>
77
- `,
78
- };
79
-
80
- export default meta;
81
- type Story = StoryObj;
82
-
83
- /**
84
- * Info alert - used for informational messages
85
- */
86
- export const Info: Story = {
87
- args: {
88
- type: 'info',
89
- message1: 'New features are available',
90
- message2: 'Check out our latest updates and improvements to the platform.',
91
- dismissible: true,
92
- },
93
- };
94
-
95
- /**
96
- * Success alert - used for positive confirmations
97
- */
98
- export const Success: Story = {
99
- args: {
100
- type: 'success',
101
- message1: 'Payment successful',
102
- message2: 'Your transaction has been completed and receipt sent to your email.',
103
- dismissible: true,
104
- },
105
- };
106
-
107
- /**
108
- * Warning alert - used for important notices
109
- */
110
- export const Warning: Story = {
111
- args: {
112
- type: 'warning',
113
- message1: 'Your session expires soon',
114
- message2: 'Please save your work to avoid losing any changes.',
115
- dismissible: true,
116
- },
117
- };
118
-
119
- /**
120
- * Error alert - used for errors and failures
121
- */
122
- export const Error: Story = {
123
- args: {
124
- type: 'error',
125
- message1: 'Failed to process request',
126
- message2: 'An error occurred while processing your request. Please try again.',
127
- dismissible: true,
128
- },
129
- };
130
-
131
- /**
132
- * Neutral alert - used for general messages
133
- */
134
- export const Neutral: Story = {
135
- args: {
136
- type: 'neutral',
137
- message1: 'System maintenance scheduled',
138
- message2: 'Our systems will be offline for maintenance on Sunday at 2:00 AM.',
139
- dismissible: true,
140
- },
141
- };
142
-
143
- /**
144
- * Alert with link - includes an action link
145
- */
146
- export const WithLink: Story = {
147
- args: {
148
- type: 'info',
149
- message1: 'Terms of Service updated',
150
- message2: 'We have updated our terms and privacy policy.',
151
- urlText: 'Read more',
152
- urlHref: '#',
153
- dismissible: true,
154
- },
155
- };
156
-
157
- /**
158
- * Single message - alert with only primary message
159
- */
160
- export const SingleMessage: Story = {
161
- args: {
162
- type: 'success',
163
- message1: 'Changes saved successfully',
164
- dismissible: true,
165
- },
166
- };
167
-
168
- /**
169
- * Non-dismissible - alert without close button
170
- */
171
- export const NonDismissible: Story = {
172
- args: {
173
- type: 'error',
174
- message1: 'Critical system error',
175
- message2: 'Please contact support immediately.',
176
- dismissible: false,
177
- },
178
- };
179
-
180
- /**
181
- * All alert types - showcase of all 5 alert types
182
- */
183
- export const AllTypes: Story = {
184
- render: () => html`
185
- <div style="display: flex; flex-direction: column; gap: 16px; padding: 24px; background: #000;">
186
- <rel-alert
187
- type="info"
188
- message1="Information alert"
189
- message2="This is an informational message for the user."
190
- ></rel-alert>
191
-
192
- <rel-alert
193
- type="success"
194
- message1="Success alert"
195
- message2="Operation completed successfully."
196
- ></rel-alert>
197
-
198
- <rel-alert
199
- type="warning"
200
- message1="Warning alert"
201
- message2="Please review this important notice."
202
- ></rel-alert>
203
-
204
- <rel-alert
205
- type="error"
206
- message1="Error alert"
207
- message2="An error occurred during the operation."
208
- ></rel-alert>
209
-
210
- <rel-alert
211
- type="neutral"
212
- message1="Neutral alert"
213
- message2="This is a general message."
214
- ></rel-alert>
215
- </div>
216
- `,
217
- };
218
-
219
- /**
220
- * Message variations - different message configurations
221
- */
222
- export const MessageVariations: Story = {
223
- render: () => html`
224
- <div style="display: flex; flex-direction: column; gap: 16px; padding: 24px; background: #000;">
225
- <rel-alert
226
- type="info"
227
- message1="Single message only"
228
- ></rel-alert>
229
-
230
- <rel-alert
231
- type="success"
232
- message1="Primary message"
233
- message2="With secondary message"
234
- ></rel-alert>
235
-
236
- <rel-alert
237
- type="warning"
238
- message1="Message with link"
239
- message2="Click the link below for more information."
240
- urlText="Learn more"
241
- urlHref="#"
242
- ></rel-alert>
243
- </div>
244
- `,
245
- };
246
-
247
- /**
248
- * Dismissible variations - with and without close button
249
- */
250
- export const DismissibleVariations: Story = {
251
- render: () => html`
252
- <div style="display: flex; flex-direction: column; gap: 16px; padding: 24px; background: #000;">
253
- <rel-alert
254
- type="info"
255
- message1="Dismissible alert"
256
- message2="Click the X to close this alert."
257
- dismissible
258
- ></rel-alert>
259
-
260
- <rel-alert
261
- type="error"
262
- message1="Non-dismissible alert"
263
- message2="This alert cannot be closed."
264
- .dismissible="${false}"
265
- ></rel-alert>
266
- </div>
267
- `,
268
- };
269
-
270
- /**
271
- * Real-world examples - practical use cases
272
- */
273
- export const RealWorldExamples: Story = {
274
- render: () => html`
275
- <div style="display: flex; flex-direction: column; gap: 16px; padding: 24px; background: #000;">
276
- <rel-alert
277
- type="success"
278
- message1="Account created successfully"
279
- message2="Welcome to Reliability! Check your email for verification."
280
- urlText="Go to dashboard"
281
- urlHref="#"
282
- ></rel-alert>
283
-
284
- <rel-alert
285
- type="warning"
286
- message1="Storage almost full"
287
- message2="You are using 95% of your storage limit."
288
- urlText="Upgrade plan"
289
- urlHref="#"
290
- ></rel-alert>
291
-
292
- <rel-alert
293
- type="error"
294
- message1="Network connection lost"
295
- message2="Check your internet connection and try again."
296
- .dismissible="${false}"
297
- ></rel-alert>
298
-
299
- <rel-alert
300
- type="info"
301
- message1="New version available"
302
- message2="Version 2.0 is now available with new features."
303
- urlText="See what's new"
304
- urlHref="#"
305
- ></rel-alert>
306
- </div>
307
- `,
308
- };
309
-
310
- /**
311
- * Non-dismissible info alert - informational alert without close button
312
- */
313
- export const NonDismissibleInfo: Story = {
314
- args: {
315
- type: 'info',
316
- message1: 'System update in progress',
317
- message2: 'Please do not close this window during the update.',
318
- dismissible: false,
319
- },
320
- };
321
-
322
- /**
323
- * Non-dismissible success alert - success message without close button
324
- */
325
- export const NonDismissibleSuccess: Story = {
326
- args: {
327
- type: 'success',
328
- message1: 'Backup completed',
329
- message2: 'All your data has been successfully backed up.',
330
- dismissible: false,
331
- },
332
- };
333
-
334
- /**
335
- * Non-dismissible warning alert - warning message without close button
336
- */
337
- export const NonDismissibleWarning: Story = {
338
- args: {
339
- type: 'warning',
340
- message1: 'Scheduled maintenance',
341
- message2: 'System will be unavailable from 2:00 AM to 4:00 AM.',
342
- dismissible: false,
343
- },
344
- };
345
-
346
- /**
347
- * Non-dismissible neutral alert - neutral message without close button
348
- */
349
- export const NonDismissibleNeutral: Story = {
350
- args: {
351
- type: 'neutral',
352
- message1: 'Read-only mode active',
353
- message2: 'You are currently viewing in read-only mode.',
354
- dismissible: false,
355
- },
356
- };
357
-
358
- /**
359
- * Success alert with link - success message with action link
360
- */
361
- export const SuccessWithLink: Story = {
362
- args: {
363
- type: 'success',
364
- message1: 'Profile updated',
365
- message2: 'Your profile information has been saved successfully.',
366
- urlText: 'View profile',
367
- urlHref: '#',
368
- dismissible: true,
369
- },
370
- };
371
-
372
- /**
373
- * Warning alert with link - warning message with action link
374
- */
375
- export const WarningWithLink: Story = {
376
- args: {
377
- type: 'warning',
378
- message1: 'Password expires soon',
379
- message2: 'Your password will expire in 3 days.',
380
- urlText: 'Change password',
381
- urlHref: '#',
382
- dismissible: true,
383
- },
384
- };
385
-
386
- /**
387
- * Error alert with link - error message with action link
388
- */
389
- export const ErrorWithLink: Story = {
390
- args: {
391
- type: 'error',
392
- message1: 'Payment failed',
393
- message2: 'There was an issue processing your payment.',
394
- urlText: 'Try again',
395
- urlHref: '#',
396
- dismissible: true,
397
- },
398
- };
399
-
400
- /**
401
- * Neutral alert with link - neutral message with action link
402
- */
403
- export const NeutralWithLink: Story = {
404
- args: {
405
- type: 'neutral',
406
- message1: 'Cookie policy',
407
- message2: 'We use cookies to improve your experience.',
408
- urlText: 'Learn more',
409
- urlHref: '#',
410
- dismissible: true,
411
- },
412
- };