@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.
- package/dist/components/rel-accordion/rel-accordion.stories.ts +313 -0
- package/dist/components/rel-accordion/rel-accordion.ts +114 -0
- package/dist/components/rel-alert/rel-alert.stories.ts +412 -0
- package/dist/components/rel-alert/rel-alert.ts +194 -0
- package/dist/components/rel-avatar/rel-avatar.stories.ts +327 -0
- package/dist/components/rel-avatar/rel-avatar.ts +100 -0
- package/dist/components/rel-badge/rel-badge.stories.ts +350 -0
- package/dist/components/rel-badge/rel-badge.ts +70 -0
- package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +306 -0
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +97 -0
- package/dist/components/rel-button/rel-button.stories.ts +356 -0
- package/dist/components/rel-button/rel-button.ts +204 -0
- package/dist/components/rel-card/rel-card.stories.ts +299 -0
- package/dist/components/rel-card/rel-card.ts +33 -0
- package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +368 -0
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +80 -0
- package/dist/components/rel-checkbox/rel-checkbox.stories.ts +414 -0
- package/dist/components/rel-checkbox/rel-checkbox.ts +164 -0
- package/dist/components/rel-chip/rel-chip.stories.ts +552 -0
- package/dist/components/rel-chip/rel-chip.ts +261 -0
- package/dist/components/rel-container/rel-container.stories.ts +239 -0
- package/dist/components/rel-container/rel-container.ts +74 -0
- package/dist/components/rel-divider/rel-divider.stories.ts +229 -0
- package/dist/components/rel-divider/rel-divider.ts +44 -0
- package/dist/components/rel-layout/rel-layout.stories.ts +713 -0
- package/dist/components/rel-layout/rel-layout.ts +60 -0
- package/dist/components/rel-menu/rel-menu.stories.ts +910 -0
- package/dist/components/rel-menu/rel-menu.ts +319 -0
- package/dist/components/rel-progress/rel-progress.stories.ts +817 -0
- package/dist/components/rel-progress/rel-progress.ts +182 -0
- package/dist/components/rel-radio/rel-radio.stories.ts +1048 -0
- package/dist/components/rel-radio/rel-radio.ts +187 -0
- package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +1079 -0
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +150 -0
- package/dist/components/rel-select/rel-select.stories.ts +1201 -0
- package/dist/components/rel-select/rel-select.ts +261 -0
- package/dist/components/rel-slider/rel-slider.stories.ts +730 -0
- package/dist/components/rel-slider/rel-slider.ts +440 -0
- package/dist/components/rel-snackbar/rel-snackbar.stories.ts +808 -0
- package/dist/components/rel-snackbar/rel-snackbar.ts +212 -0
- package/dist/components/rel-stepper/rel-stepper.stories.ts +752 -0
- package/dist/components/rel-stepper/rel-stepper.ts +425 -0
- package/dist/components/rel-switch/rel-switch.stories.ts +441 -0
- package/dist/components/rel-switch/rel-switch.ts +161 -0
- package/dist/components/rel-tab/rel-tab.stories.ts +492 -0
- package/dist/components/rel-tab/rel-tab.ts +145 -0
- package/dist/components/rel-textfield/rel-textfield.stories.ts +710 -0
- package/dist/components/rel-textfield/rel-textfield.ts +224 -0
- package/dist/components/rel-toast/rel-toast.stories.ts +394 -0
- package/dist/components/rel-toast/rel-toast.ts +154 -0
- package/dist/components/rel-tooltip/rel-tooltip.stories.ts +364 -0
- package/dist/components/rel-tooltip/rel-tooltip.ts +80 -0
- package/dist/index.d.mts +372 -0
- package/dist/index.d.ts +372 -0
- package/dist/index.js +4593 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4544 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles/vars.css +184 -0
- package/package.json +32 -0
|
@@ -0,0 +1,299 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LitElement, html, css } from "lit";
|
|
2
|
+
import { customElement } from "lit/decorators.js";
|
|
3
|
+
|
|
4
|
+
@customElement("rel-card")
|
|
5
|
+
export class RelCard extends LitElement {
|
|
6
|
+
static styles = css`
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.card {
|
|
12
|
+
background-color: var(--rel-colors-white, #ffffff);
|
|
13
|
+
border-radius: var(--rel-borderRadius-lg, 12px);
|
|
14
|
+
padding: var(--rel-spacing-space-md, 16px);
|
|
15
|
+
|
|
16
|
+
box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.3),
|
|
17
|
+
0px 6px 10px 4px rgba(0, 0, 0, 0.15);
|
|
18
|
+
|
|
19
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
20
|
+
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.card:hover {
|
|
24
|
+
transform: translateY(-3px);
|
|
25
|
+
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.35),
|
|
26
|
+
0px 8px 14px 4px rgba(0, 0, 0, 0.2);
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
render() {
|
|
31
|
+
return html` <div class="card"><slot></slot></div> `;
|
|
32
|
+
}
|
|
33
|
+
}
|