@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,299 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components-vite';
2
- import { html } from 'lit';
3
- import './rel-card';
4
-
5
- /**
6
- * The Card component provides a container for content with elevation and rounded corners.
7
- * Built with Lit web components for framework-agnostic usage.
8
- *
9
- * ## Features
10
- * - **Elevated Shadow**: Drop shadow for depth
11
- * - **Rounded Corners**: Smooth border radius
12
- * - **Hover Effect**: Lifts on hover with enhanced shadow
13
- * - **Flexible Content**: Accepts any slotted content
14
- * - **Consistent Padding**: Built-in spacing
15
- * - **White Background**: Clean, professional appearance
16
- */
17
- const meta: Meta = {
18
- title: 'Components/Card',
19
- tags: ['autodocs'],
20
- component: 'rel-card',
21
- render: (args) => html`
22
- <rel-card>
23
- ${args.content || html`
24
- <h3 style="margin: 0 0 12px 0; font-size: 20px; color: #000;">Card Title</h3>
25
- <p style="margin: 0; color: #666; line-height: 1.6;">
26
- This is a basic card with some content. Cards are used to group related information together.
27
- </p>
28
- `}
29
- </rel-card>
30
- `,
31
- };
32
-
33
- export default meta;
34
- type Story = StoryObj;
35
-
36
- /**
37
- * Default card - basic card with text content
38
- */
39
- export const Default: Story = {};
40
-
41
- /**
42
- * Simple text card
43
- */
44
- export const SimpleText: Story = {
45
- render: () => html`
46
- <rel-card>
47
- <h3 style="margin: 0 0 12px 0; font-size: 20px; color: #000;">Welcome</h3>
48
- <p style="margin: 0; color: #666; line-height: 1.6;">
49
- Thank you for using our design system. This card demonstrates simple text content.
50
- </p>
51
- </rel-card>
52
- `,
53
- };
54
-
55
- /**
56
- * Card with image
57
- */
58
- export const WithImage: Story = {
59
- render: () => html`
60
- <rel-card>
61
- <img
62
- src="https://picsum.photos/400/200"
63
- alt="Placeholder"
64
- style="width: 100%; height: auto; border-radius: 8px; margin-bottom: 16px;"
65
- />
66
- <h3 style="margin: 0 0 8px 0; font-size: 18px; color: #000;">Beautiful Scenery</h3>
67
- <p style="margin: 0; color: #666; font-size: 14px;">
68
- A stunning landscape captured in the perfect moment.
69
- </p>
70
- </rel-card>
71
- `,
72
- };
73
-
74
- /**
75
- * Product card - e-commerce style
76
- */
77
- export const ProductCard: Story = {
78
- render: () => html`
79
- <rel-card>
80
- <img
81
- src="https://picsum.photos/300/300"
82
- alt="Product"
83
- style="width: 100%; height: auto; border-radius: 8px; margin-bottom: 12px;"
84
- />
85
- <h3 style="margin: 0 0 8px 0; font-size: 18px; color: #000;">Premium Headphones</h3>
86
- <p style="margin: 0 0 12px 0; color: #666; font-size: 14px;">
87
- High-quality wireless headphones with active noise cancellation.
88
- </p>
89
- <div style="display: flex; justify-content: space-between; align-items: center;">
90
- <span style="font-size: 24px; font-weight: 700; color: #000;">$299</span>
91
- <button style="background: #00F49C; border: none; color: #000; padding: 8px 16px; border-radius: 1000px; cursor: pointer; font-weight: 600;">
92
- Add to Cart
93
- </button>
94
- </div>
95
- </rel-card>
96
- `,
97
- };
98
-
99
- /**
100
- * User profile card
101
- */
102
- export const UserProfile: Story = {
103
- render: () => html`
104
- <rel-card>
105
- <div style="display: flex; align-items: center; gap: 16px; margin-bottom: 16px;">
106
- <img
107
- src="https://i.pravatar.cc/80?img=1"
108
- alt="User avatar"
109
- style="width: 60px; height: 60px; border-radius: 50%;"
110
- />
111
- <div>
112
- <h3 style="margin: 0 0 4px 0; font-size: 18px; color: #000;">John Doe</h3>
113
- <p style="margin: 0; color: #666; font-size: 14px;">Senior Developer</p>
114
- </div>
115
- </div>
116
- <p style="margin: 0 0 16px 0; color: #666; font-size: 14px; line-height: 1.6;">
117
- Passionate about building great user experiences and modern web applications.
118
- </p>
119
- <div style="display: flex; gap: 8px;">
120
- <button style="flex: 1; background: #00F49C; border: none; color: #000; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 600;">
121
- Follow
122
- </button>
123
- <button style="flex: 1; background: #fff; border: 1px solid #ddd; color: #000; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 600;">
124
- Message
125
- </button>
126
- </div>
127
- </rel-card>
128
- `,
129
- };
130
-
131
- /**
132
- * Stats card - dashboard metrics
133
- */
134
- export const StatsCard: Story = {
135
- render: () => html`
136
- <rel-card>
137
- <div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;">
138
- <h4 style="margin: 0; font-size: 14px; color: #666; font-weight: 500;">Total Revenue</h4>
139
- <span style="font-size: 20px;">💰</span>
140
- </div>
141
- <p style="margin: 0 0 4px 0; font-size: 32px; font-weight: 700; color: #000;">$45,231</p>
142
- <p style="margin: 0; font-size: 12px; color: #00A86B;">↑ 12.5% from last month</p>
143
- </rel-card>
144
- `,
145
- };
146
-
147
- /**
148
- * Notification card
149
- */
150
- export const NotificationCard: Story = {
151
- render: () => html`
152
- <rel-card>
153
- <div style="display: flex; gap: 12px;">
154
- <div style="width: 40px; height: 40px; background: #E1F2FF; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px;">
155
- 🔔
156
- </div>
157
- <div style="flex: 1;">
158
- <h4 style="margin: 0 0 4px 0; font-size: 14px; font-weight: 600; color: #000;">New message received</h4>
159
- <p style="margin: 0 0 4px 0; color: #666; font-size: 14px;">Sarah Wilson sent you a message</p>
160
- <p style="margin: 0; color: #999; font-size: 12px;">2 minutes ago</p>
161
- </div>
162
- </div>
163
- </rel-card>
164
- `,
165
- };
166
-
167
- /**
168
- * Form card - card with form elements
169
- */
170
- export const FormCard: Story = {
171
- render: () => html`
172
- <rel-card>
173
- <h3 style="margin: 0 0 16px 0; font-size: 20px; color: #000;">Contact Us</h3>
174
- <form style="display: flex; flex-direction: column; gap: 12px;">
175
- <div>
176
- <label style="display: block; margin-bottom: 4px; color: #666; font-size: 14px;">Name</label>
177
- <input type="text" placeholder="Your name" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;" />
178
- </div>
179
- <div>
180
- <label style="display: block; margin-bottom: 4px; color: #666; font-size: 14px;">Email</label>
181
- <input type="email" placeholder="your@email.com" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;" />
182
- </div>
183
- <div>
184
- <label style="display: block; margin-bottom: 4px; color: #666; font-size: 14px;">Message</label>
185
- <textarea placeholder="Your message" rows="4" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; resize: vertical;"></textarea>
186
- </div>
187
- <button type="submit" style="background: #00F49C; border: none; color: #000; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600;">
188
- Send Message
189
- </button>
190
- </form>
191
- </rel-card>
192
- `,
193
- };
194
-
195
- /**
196
- * Pricing card
197
- */
198
- export const PricingCard: Story = {
199
- render: () => html`
200
- <rel-card>
201
- <div style="text-align: center;">
202
- <h3 style="margin: 0 0 8px 0; font-size: 20px; color: #000;">Pro Plan</h3>
203
- <p style="margin: 0 0 16px 0; color: #666; font-size: 14px;">For growing teams</p>
204
- <div style="margin-bottom: 24px;">
205
- <span style="font-size: 48px; font-weight: 700; color: #000;">$49</span>
206
- <span style="color: #666; font-size: 14px;">/month</span>
207
- </div>
208
- <ul style="list-style: none; padding: 0; margin: 0 0 24px 0; text-align: left;">
209
- <li style="padding: 8px 0; color: #666; font-size: 14px;">✓ Unlimited projects</li>
210
- <li style="padding: 8px 0; color: #666; font-size: 14px;">✓ Advanced analytics</li>
211
- <li style="padding: 8px 0; color: #666; font-size: 14px;">✓ Priority support</li>
212
- <li style="padding: 8px 0; color: #666; font-size: 14px;">✓ Custom integrations</li>
213
- </ul>
214
- <button style="width: 100%; background: #00F49C; border: none; color: #000; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 600;">
215
- Get Started
216
- </button>
217
- </div>
218
- </rel-card>
219
- `,
220
- };
221
-
222
- /**
223
- * Blog post card
224
- */
225
- export const BlogPostCard: Story = {
226
- render: () => html`
227
- <rel-card>
228
- <img
229
- src="https://picsum.photos/400/250"
230
- alt="Blog post"
231
- style="width: 100%; height: auto; border-radius: 8px; margin-bottom: 16px;"
232
- />
233
- <div style="display: flex; gap: 8px; margin-bottom: 12px;">
234
- <span style="padding: 4px 8px; background: #E1F2FF; color: #0091EA; border-radius: 4px; font-size: 12px; font-weight: 600;">Technology</span>
235
- <span style="padding: 4px 8px; background: #E8F5E8; color: #00A86B; border-radius: 4px; font-size: 12px; font-weight: 600;">Design</span>
236
- </div>
237
- <h3 style="margin: 0 0 8px 0; font-size: 20px; color: #000;">Getting Started with Web Components</h3>
238
- <p style="margin: 0 0 12px 0; color: #666; font-size: 14px; line-height: 1.6;">
239
- Learn how to build reusable, framework-agnostic UI components using modern web standards.
240
- </p>
241
- <div style="display: flex; align-items: center; justify-content: space-between;">
242
- <div style="display: flex; align-items: center; gap: 8px;">
243
- <img src="https://i.pravatar.cc/32?img=2" alt="Author" style="width: 32px; height: 32px; border-radius: 50%;" />
244
- <span style="color: #666; font-size: 14px;">Sarah Wilson</span>
245
- </div>
246
- <span style="color: #999; font-size: 12px;">5 min read</span>
247
- </div>
248
- </rel-card>
249
- `,
250
- };
251
-
252
- /**
253
- * Card grid - multiple cards in a grid layout
254
- */
255
- export const CardGrid: Story = {
256
- render: () => html`
257
- <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; padding: 24px; background: #f5f5f5;">
258
- <rel-card>
259
- <h3 style="margin: 0 0 12px 0; font-size: 18px; color: #000;">Card 1</h3>
260
- <p style="margin: 0; color: #666; font-size: 14px;">First card in the grid layout.</p>
261
- </rel-card>
262
-
263
- <rel-card>
264
- <h3 style="margin: 0 0 12px 0; font-size: 18px; color: #000;">Card 2</h3>
265
- <p style="margin: 0; color: #666; font-size: 14px;">Second card in the grid layout.</p>
266
- </rel-card>
267
-
268
- <rel-card>
269
- <h3 style="margin: 0 0 12px 0; font-size: 18px; color: #000;">Card 3</h3>
270
- <p style="margin: 0; color: #666; font-size: 14px;">Third card in the grid layout.</p>
271
- </rel-card>
272
-
273
- <rel-card>
274
- <h3 style="margin: 0 0 12px 0; font-size: 18px; color: #000;">Card 4</h3>
275
- <p style="margin: 0; color: #666; font-size: 14px;">Fourth card in the grid layout.</p>
276
- </rel-card>
277
- </div>
278
- `,
279
- };
280
-
281
- /**
282
- * Empty state card
283
- */
284
- export const EmptyState: Story = {
285
- render: () => html`
286
- <rel-card>
287
- <div style="text-align: center; padding: 40px 20px;">
288
- <div style="font-size: 64px; margin-bottom: 16px;">📭</div>
289
- <h3 style="margin: 0 0 8px 0; font-size: 20px; color: #000;">No messages yet</h3>
290
- <p style="margin: 0 0 24px 0; color: #666; font-size: 14px;">
291
- When you receive messages, they'll appear here.
292
- </p>
293
- <button style="background: #00F49C; border: none; color: #000; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600;">
294
- Compose Message
295
- </button>
296
- </div>
297
- </rel-card>
298
- `,
299
- };
@@ -1,368 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/web-components-vite';
2
- import { html } from 'lit';
3
- import './rel-cardmedia';
4
-
5
- /**
6
- * The Card Media component combines images with content in an elevated card format.
7
- * Built with Lit web components for framework-agnostic usage.
8
- *
9
- * ## Features
10
- * - **Image Support**: Display images at the top of the card
11
- * - **Title & Subtitle**: Built-in typography for headers and descriptions
12
- * - **Slotted Content**: Add buttons, links, or additional content
13
- * - **Elevated Shadow**: Drop shadow for depth
14
- * - **Hover Effect**: Lifts on hover with enhanced shadow
15
- * - **Rounded Corners**: Smooth border radius
16
- */
17
- const meta: Meta = {
18
- title: 'Components/CardMedia',
19
- tags: ['autodocs'],
20
- component: 'rel-card-media',
21
- argTypes: {
22
- imageSrc: {
23
- control: 'text',
24
- description: 'Image source URL',
25
- table: {
26
- type: { summary: 'string' },
27
- },
28
- },
29
- imageAlt: {
30
- control: 'text',
31
- description: 'Image alt text for accessibility',
32
- table: {
33
- defaultValue: { summary: 'Card image' },
34
- type: { summary: 'string' },
35
- },
36
- },
37
- title: {
38
- control: 'text',
39
- description: 'Card title',
40
- table: {
41
- type: { summary: 'string' },
42
- },
43
- },
44
- subtitle: {
45
- control: 'text',
46
- description: 'Card subtitle or description',
47
- table: {
48
- type: { summary: 'string' },
49
- },
50
- },
51
- },
52
- render: (args) => html`
53
- <rel-card-media
54
- imageSrc="${args.imageSrc || 'https://picsum.photos/400/250'}"
55
- imageAlt="${args.imageAlt || 'Card image'}"
56
- title="${args.title || 'Card Title'}"
57
- subtitle="${args.subtitle || 'Card subtitle or description'}"
58
- >
59
- ${args.content || ''}
60
- </rel-card-media>
61
- `,
62
- };
63
-
64
- export default meta;
65
- type Story = StoryObj;
66
-
67
- /**
68
- * Default card media - basic image card
69
- */
70
- export const Default: Story = {
71
- args: {
72
- imageSrc: 'https://picsum.photos/400/250',
73
- imageAlt: 'Beautiful scenery',
74
- title: 'Beautiful Landscape',
75
- subtitle: 'Captured in the perfect moment',
76
- },
77
- };
78
-
79
- /**
80
- * Product card - e-commerce product display
81
- */
82
- export const ProductCard: Story = {
83
- render: () => html`
84
- <rel-card-media
85
- imageSrc="https://picsum.photos/400/400"
86
- imageAlt="Product"
87
- title="Premium Wireless Headphones"
88
- subtitle="High-quality audio with active noise cancellation"
89
- >
90
- <div style="margin-top: 12px; display: flex; justify-content: space-between; align-items: center;">
91
- <span style="font-size: 24px; font-weight: 700; color: #000;">$299</span>
92
- <button style="background: #00F49C; border: none; color: #000; padding: 8px 16px; border-radius: 1000px; cursor: pointer; font-weight: 600;">
93
- Add to Cart
94
- </button>
95
- </div>
96
- </rel-card-media>
97
- `,
98
- };
99
-
100
- /**
101
- * Blog post card - article preview
102
- */
103
- export const BlogPostCard: Story = {
104
- render: () => html`
105
- <rel-card-media
106
- imageSrc="https://picsum.photos/500/300"
107
- imageAlt="Blog post cover"
108
- title="Getting Started with Web Components"
109
- subtitle="Learn how to build reusable UI components using modern web standards."
110
- >
111
- <div style="margin-top: 12px; display: flex; align-items: center; justify-content: space-between;">
112
- <div style="display: flex; align-items: center; gap: 8px;">
113
- <img src="https://i.pravatar.cc/32?img=3" alt="Author" style="width: 32px; height: 32px; border-radius: 50%;" />
114
- <span style="color: #666; font-size: 14px;">Sarah Wilson</span>
115
- </div>
116
- <span style="color: #999; font-size: 12px;">5 min read</span>
117
- </div>
118
- </rel-card-media>
119
- `,
120
- };
121
-
122
- /**
123
- * Recipe card - food recipe display
124
- */
125
- export const RecipeCard: Story = {
126
- render: () => html`
127
- <rel-card-media
128
- imageSrc="https://picsum.photos/400/300"
129
- imageAlt="Delicious food"
130
- title="Homemade Pizza"
131
- subtitle="A classic Italian favorite with fresh ingredients"
132
- >
133
- <div style="margin-top: 12px;">
134
- <div style="display: flex; gap: 16px; margin-bottom: 12px;">
135
- <span style="color: #666; font-size: 12px;">⏱️ 45 min</span>
136
- <span style="color: #666; font-size: 12px;">👥 4 servings</span>
137
- <span style="color: #666; font-size: 12px;">🔥 Medium</span>
138
- </div>
139
- <button style="width: 100%; background: #00F49C; border: none; color: #000; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600;">
140
- View Recipe
141
- </button>
142
- </div>
143
- </rel-card-media>
144
- `,
145
- };
146
-
147
- /**
148
- * Property listing - real estate card
149
- */
150
- export const PropertyListing: Story = {
151
- render: () => html`
152
- <rel-card-media
153
- imageSrc="https://picsum.photos/500/350"
154
- imageAlt="Property"
155
- title="Modern Downtown Apartment"
156
- subtitle="2 bed • 2 bath • 1,200 sq ft"
157
- >
158
- <div style="margin-top: 12px;">
159
- <div style="margin-bottom: 12px;">
160
- <span style="font-size: 28px; font-weight: 700; color: #000;">$450,000</span>
161
- </div>
162
- <p style="margin: 0 0 12px 0; color: #666; font-size: 14px;">
163
- 📍 123 Main Street, Downtown District
164
- </p>
165
- <div style="display: flex; gap: 8px;">
166
- <button style="flex: 1; background: #00F49C; border: none; color: #000; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600;">
167
- Schedule Tour
168
- </button>
169
- <button style="flex: 1; background: #fff; border: 1px solid #ddd; color: #000; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600;">
170
- Save
171
- </button>
172
- </div>
173
- </div>
174
- </rel-card-media>
175
- `,
176
- };
177
-
178
- /**
179
- * Event card - upcoming event display
180
- */
181
- export const EventCard: Story = {
182
- render: () => html`
183
- <rel-card-media
184
- imageSrc="https://picsum.photos/450/280"
185
- imageAlt="Event"
186
- title="Tech Conference 2024"
187
- subtitle="Join industry leaders for 3 days of innovation and networking"
188
- >
189
- <div style="margin-top: 12px;">
190
- <div style="background: #E1F2FF; padding: 12px; border-radius: 8px; margin-bottom: 12px;">
191
- <p style="margin: 0 0 4px 0; color: #0091EA; font-size: 14px; font-weight: 600;">📅 March 15-17, 2024</p>
192
- <p style="margin: 0; color: #0091EA; font-size: 14px;">📍 San Francisco Convention Center</p>
193
- </div>
194
- <button style="width: 100%; background: #00F49C; border: none; color: #000; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600;">
195
- Register Now
196
- </button>
197
- </div>
198
- </rel-card-media>
199
- `,
200
- };
201
-
202
- /**
203
- * Course card - online course preview
204
- */
205
- export const CourseCard: Story = {
206
- render: () => html`
207
- <rel-card-media
208
- imageSrc="https://picsum.photos/420/260"
209
- imageAlt="Course"
210
- title="Complete Web Development Bootcamp"
211
- subtitle="Learn HTML, CSS, JavaScript, and modern frameworks from scratch"
212
- >
213
- <div style="margin-top: 12px;">
214
- <div style="display: flex; gap: 8px; margin-bottom: 12px;">
215
- <span style="padding: 4px 8px; background: #FFE9D9; color: #FF6D00; border-radius: 4px; font-size: 12px; font-weight: 600;">Beginner</span>
216
- <span style="padding: 4px 8px; background: #E1F2FF; color: #0091EA; border-radius: 4px; font-size: 12px; font-weight: 600;">40 hours</span>
217
- </div>
218
- <div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;">
219
- <div style="display: flex; align-items: center; gap: 4px;">
220
- <span style="color: #FFD700;">★★★★★</span>
221
- <span style="color: #666; font-size: 12px;">(2,543 reviews)</span>
222
- </div>
223
- <span style="font-size: 20px; font-weight: 700; color: #000;">$89</span>
224
- </div>
225
- <button style="width: 100%; background: #00F49C; border: none; color: #000; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600;">
226
- Enroll Now
227
- </button>
228
- </div>
229
- </rel-card-media>
230
- `,
231
- };
232
-
233
- /**
234
- * Team member card - employee profile
235
- */
236
- export const TeamMemberCard: Story = {
237
- render: () => html`
238
- <rel-card-media
239
- imageSrc="https://i.pravatar.cc/400?img=5"
240
- imageAlt="Team member"
241
- title="Alex Johnson"
242
- subtitle="Senior Product Designer"
243
- >
244
- <div style="margin-top: 12px;">
245
- <p style="margin: 0 0 12px 0; color: #666; font-size: 14px; line-height: 1.6;">
246
- Passionate about creating intuitive user experiences and building design systems that scale.
247
- </p>
248
- <div style="display: flex; gap: 8px;">
249
- <button style="flex: 1; background: #00F49C; border: none; color: #000; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 600;">
250
- View Profile
251
- </button>
252
- <button style="background: #fff; border: 1px solid #ddd; color: #000; padding: 8px 12px; border-radius: 8px; cursor: pointer;">
253
- 💬
254
- </button>
255
- </div>
256
- </div>
257
- </rel-card-media>
258
- `,
259
- };
260
-
261
- /**
262
- * Travel destination card
263
- */
264
- export const TravelCard: Story = {
265
- render: () => html`
266
- <rel-card-media
267
- imageSrc="https://picsum.photos/480/320"
268
- imageAlt="Travel destination"
269
- title="Santorini, Greece"
270
- subtitle="Experience the beauty of the Greek islands"
271
- >
272
- <div style="margin-top: 12px;">
273
- <div style="margin-bottom: 12px;">
274
- <span style="color: #FFD700; font-size: 16px;">★★★★★</span>
275
- <span style="color: #666; font-size: 14px; margin-left: 4px;">4.9 (1,234 reviews)</span>
276
- </div>
277
- <p style="margin: 0 0 12px 0; color: #666; font-size: 14px;">
278
- 7 days • All inclusive • Flights & hotel
279
- </p>
280
- <div style="display: flex; align-items: center; justify-content: space-between;">
281
- <div>
282
- <span style="color: #999; font-size: 12px; text-decoration: line-through;">$1,999</span>
283
- <span style="font-size: 24px; font-weight: 700; color: #000; margin-left: 8px;">$1,499</span>
284
- </div>
285
- <button style="background: #00F49C; border: none; color: #000; padding: 8px 16px; border-radius: 1000px; cursor: pointer; font-weight: 600;">
286
- Book Now
287
- </button>
288
- </div>
289
- </div>
290
- </rel-card-media>
291
- `,
292
- };
293
-
294
- /**
295
- * News article card
296
- */
297
- export const NewsCard: Story = {
298
- render: () => html`
299
- <rel-card-media
300
- imageSrc="https://picsum.photos/460/290"
301
- imageAlt="News"
302
- title="Major Tech Breakthrough Announced"
303
- subtitle="Scientists discover revolutionary new material"
304
- >
305
- <div style="margin-top: 12px;">
306
- <div style="display: flex; gap: 8px; margin-bottom: 12px;">
307
- <span style="padding: 4px 8px; background: #FFE8EB; color: #CC0000; border-radius: 4px; font-size: 12px; font-weight: 600;">Breaking</span>
308
- <span style="padding: 4px 8px; background: #E1F2FF; color: #0091EA; border-radius: 4px; font-size: 12px; font-weight: 600;">Science</span>
309
- </div>
310
- <p style="margin: 0 0 12px 0; color: #999; font-size: 12px;">
311
- Published 2 hours ago by Tech News Daily
312
- </p>
313
- <button style="width: 100%; background: #fff; border: 1px solid #ddd; color: #000; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600;">
314
- Read Full Article
315
- </button>
316
- </div>
317
- </rel-card-media>
318
- `,
319
- };
320
-
321
- /**
322
- * Card grid - multiple media cards
323
- */
324
- export const CardGrid: Story = {
325
- render: () => html`
326
- <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; padding: 24px; background: #f5f5f5;">
327
- <rel-card-media
328
- imageSrc="https://picsum.photos/400/250?random=1"
329
- title="Mountain Adventure"
330
- subtitle="Explore breathtaking peaks"
331
- ></rel-card-media>
332
-
333
- <rel-card-media
334
- imageSrc="https://picsum.photos/400/250?random=2"
335
- title="Ocean Paradise"
336
- subtitle="Discover tropical beaches"
337
- ></rel-card-media>
338
-
339
- <rel-card-media
340
- imageSrc="https://picsum.photos/400/250?random=3"
341
- title="City Lights"
342
- subtitle="Experience urban energy"
343
- ></rel-card-media>
344
-
345
- <rel-card-media
346
- imageSrc="https://picsum.photos/400/250?random=4"
347
- title="Forest Escape"
348
- subtitle="Connect with nature"
349
- ></rel-card-media>
350
- </div>
351
- `,
352
- };
353
-
354
- /**
355
- * Without image - card with only content
356
- */
357
- export const WithoutImage: Story = {
358
- render: () => html`
359
- <rel-card-media
360
- title="Text-Only Card"
361
- subtitle="This card has no image, only content"
362
- >
363
- <p style="margin-top: 12px; color: #666; font-size: 14px; line-height: 1.6;">
364
- Cards don't always need images. This example shows how the card looks with just text content.
365
- </p>
366
- </rel-card-media>
367
- `,
368
- };