@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.
- package/dist/components/rel-accordion/rel-accordion.ts +27 -22
- package/dist/components/rel-alert/rel-alert.ts +98 -66
- package/dist/components/rel-avatar/rel-avatar.ts +8 -15
- package/dist/components/rel-badge/rel-badge.ts +23 -16
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +12 -12
- package/dist/components/rel-button/rel-button.ts +39 -59
- package/dist/components/rel-card/rel-card.ts +11 -10
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +11 -17
- package/dist/components/rel-checkbox/rel-checkbox.ts +18 -35
- package/dist/components/rel-chip/rel-chip.ts +37 -128
- package/dist/components/rel-container/rel-container.ts +1 -6
- package/dist/components/rel-divider/rel-divider.ts +37 -37
- package/dist/components/rel-layout/rel-layout.ts +12 -14
- package/dist/components/rel-progress/rel-progress.ts +26 -15
- package/dist/components/rel-radio/rel-radio.ts +32 -72
- package/dist/components/rel-snackbar/rel-snackbar.ts +6 -0
- package/dist/components/rel-stepper/rel-stepper.ts +23 -2
- package/dist/components/rel-switch/rel-switch.ts +7 -5
- package/dist/components/rel-tab/rel-tab.ts +10 -8
- package/dist/components/rel-textfield/rel-textfield.ts +2 -2
- package/dist/index.d.mts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +367 -475
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +383 -489
- package/dist/index.mjs.map +1 -1
- package/dist/vars-6ZIUPIU4.css +184 -0
- package/package.json +2 -2
- package/dist/components/rel-accordion/rel-accordion.stories.ts +0 -313
- package/dist/components/rel-alert/rel-alert.stories.ts +0 -412
- package/dist/components/rel-avatar/rel-avatar.stories.ts +0 -327
- package/dist/components/rel-badge/rel-badge.stories.ts +0 -350
- package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +0 -306
- package/dist/components/rel-button/rel-button.stories.ts +0 -356
- package/dist/components/rel-card/rel-card.stories.ts +0 -299
- package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +0 -368
- package/dist/components/rel-checkbox/rel-checkbox.stories.ts +0 -414
- package/dist/components/rel-chip/rel-chip.stories.ts +0 -552
- package/dist/components/rel-container/rel-container.stories.ts +0 -239
- package/dist/components/rel-divider/rel-divider.stories.ts +0 -229
- package/dist/components/rel-layout/rel-layout.stories.ts +0 -713
- package/dist/components/rel-menu/rel-menu.stories.ts +0 -910
- package/dist/components/rel-progress/rel-progress.stories.ts +0 -817
- package/dist/components/rel-radio/rel-radio.stories.ts +0 -1048
- package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +0 -1079
- package/dist/components/rel-select/rel-select.stories.ts +0 -1201
- package/dist/components/rel-slider/rel-slider.stories.ts +0 -730
- package/dist/components/rel-snackbar/rel-snackbar.stories.ts +0 -808
- package/dist/components/rel-stepper/rel-stepper.stories.ts +0 -752
- package/dist/components/rel-switch/rel-switch.stories.ts +0 -441
- package/dist/components/rel-tab/rel-tab.stories.ts +0 -492
- package/dist/components/rel-textfield/rel-textfield.stories.ts +0 -710
- package/dist/components/rel-toast/rel-toast.stories.ts +0 -394
- package/dist/components/rel-tooltip/rel-tooltip.stories.ts +0 -364
|
@@ -1,552 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import './rel-chip';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The Chip component is a compact UI element for displaying tags, categories, or user selections.
|
|
7
|
-
* Built with Lit web components for framework-agnostic usage with full token support.
|
|
8
|
-
*
|
|
9
|
-
* ## Features
|
|
10
|
-
* - **5 Tone Variants**: default, blue, yellow, red, green
|
|
11
|
-
* - **Outline Mode**: Transparent background with colored border
|
|
12
|
-
* - **Avatar Support**: Display user profile images
|
|
13
|
-
* - **Icon Support**: Leading and trailing icons
|
|
14
|
-
* - **Removable**: Optional close button with keyboard support
|
|
15
|
-
* - **Keyboard Navigation**: Backspace/Delete to remove when focused
|
|
16
|
-
* - **WCAG Compliant**: Full accessibility support
|
|
17
|
-
*/
|
|
18
|
-
const meta: Meta = {
|
|
19
|
-
title: 'Components/Chip',
|
|
20
|
-
tags: ['autodocs'],
|
|
21
|
-
component: 'rel-chip',
|
|
22
|
-
argTypes: {
|
|
23
|
-
label: {
|
|
24
|
-
control: 'text',
|
|
25
|
-
description: 'Text content of the chip',
|
|
26
|
-
table: {
|
|
27
|
-
defaultValue: { summary: 'Label' },
|
|
28
|
-
type: { summary: 'string' },
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
tone: {
|
|
32
|
-
control: { type: 'select' },
|
|
33
|
-
options: ['default', 'blue', 'yellow', 'red', 'green'],
|
|
34
|
-
description: 'Color tone variant',
|
|
35
|
-
table: {
|
|
36
|
-
defaultValue: { summary: 'default' },
|
|
37
|
-
type: { summary: 'string' },
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
outline: {
|
|
41
|
-
control: 'boolean',
|
|
42
|
-
description: 'Use outline variant with transparent background',
|
|
43
|
-
table: {
|
|
44
|
-
defaultValue: { summary: false },
|
|
45
|
-
type: { summary: 'boolean' },
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
removable: {
|
|
49
|
-
control: 'boolean',
|
|
50
|
-
description: 'Show remove button (X)',
|
|
51
|
-
table: {
|
|
52
|
-
defaultValue: { summary: false },
|
|
53
|
-
type: { summary: 'boolean' },
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
avatar: {
|
|
57
|
-
control: 'text',
|
|
58
|
-
description: 'Avatar image URL',
|
|
59
|
-
table: {
|
|
60
|
-
type: { summary: 'string' },
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
leadingIcon: {
|
|
64
|
-
control: 'text',
|
|
65
|
-
description: 'SVG icon markup for leading position',
|
|
66
|
-
table: {
|
|
67
|
-
type: { summary: 'string' },
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
trailingIcon: {
|
|
71
|
-
control: 'text',
|
|
72
|
-
description: 'SVG icon markup for trailing position',
|
|
73
|
-
table: {
|
|
74
|
-
type: { summary: 'string' },
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
render: (args) => html`
|
|
79
|
-
<rel-chip
|
|
80
|
-
label="${args.label || 'Chip'}"
|
|
81
|
-
tone="${args.tone || 'default'}"
|
|
82
|
-
?outline="${args.outline}"
|
|
83
|
-
?removable="${args.removable}"
|
|
84
|
-
avatar="${args.avatar || ''}"
|
|
85
|
-
leadingIcon="${args.leadingIcon || ''}"
|
|
86
|
-
trailingIcon="${args.trailingIcon || ''}"
|
|
87
|
-
></rel-chip>
|
|
88
|
-
`,
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export default meta;
|
|
92
|
-
type Story = StoryObj;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Default chip with gray background
|
|
96
|
-
*/
|
|
97
|
-
export const Default: Story = {
|
|
98
|
-
args: {
|
|
99
|
-
label: 'Default Chip',
|
|
100
|
-
tone: 'default',
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Tone variants - all available color options
|
|
106
|
-
*/
|
|
107
|
-
export const ToneVariants: Story = {
|
|
108
|
-
render: () => html`
|
|
109
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
110
|
-
<rel-chip label="Default" tone="default"></rel-chip>
|
|
111
|
-
<rel-chip label="Blue" tone="blue"></rel-chip>
|
|
112
|
-
<rel-chip label="Yellow" tone="yellow"></rel-chip>
|
|
113
|
-
<rel-chip label="Red" tone="red"></rel-chip>
|
|
114
|
-
<rel-chip label="Green" tone="green"></rel-chip>
|
|
115
|
-
</div>
|
|
116
|
-
`,
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Outline variants - transparent background with colored border
|
|
121
|
-
*/
|
|
122
|
-
export const OutlineVariants: Story = {
|
|
123
|
-
render: () => html`
|
|
124
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #1a202c; border-radius: 8px;">
|
|
125
|
-
<rel-chip label="Default" tone="default" outline></rel-chip>
|
|
126
|
-
<rel-chip label="Blue" tone="blue" outline></rel-chip>
|
|
127
|
-
<rel-chip label="Yellow" tone="yellow" outline></rel-chip>
|
|
128
|
-
<rel-chip label="Red" tone="red" outline></rel-chip>
|
|
129
|
-
<rel-chip label="Green" tone="green" outline></rel-chip>
|
|
130
|
-
</div>
|
|
131
|
-
`,
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Chips with leading icons
|
|
136
|
-
*/
|
|
137
|
-
export const WithLeadingIcon: Story = {
|
|
138
|
-
render: () => html`
|
|
139
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
140
|
-
<rel-chip
|
|
141
|
-
label="Star Icon"
|
|
142
|
-
tone="blue"
|
|
143
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>'
|
|
144
|
-
></rel-chip>
|
|
145
|
-
<rel-chip
|
|
146
|
-
label="Success"
|
|
147
|
-
tone="green"
|
|
148
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'
|
|
149
|
-
></rel-chip>
|
|
150
|
-
<rel-chip
|
|
151
|
-
label="Warning"
|
|
152
|
-
tone="yellow"
|
|
153
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>'
|
|
154
|
-
></rel-chip>
|
|
155
|
-
</div>
|
|
156
|
-
`,
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Chips with trailing icons
|
|
161
|
-
*/
|
|
162
|
-
export const WithTrailingIcon: Story = {
|
|
163
|
-
render: () => html`
|
|
164
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
165
|
-
<rel-chip
|
|
166
|
-
label="Chevron Right"
|
|
167
|
-
tone="blue"
|
|
168
|
-
trailingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>'
|
|
169
|
-
></rel-chip>
|
|
170
|
-
<rel-chip
|
|
171
|
-
label="Arrow Down"
|
|
172
|
-
tone="default"
|
|
173
|
-
trailingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M7 10l5 5 5-5z"/></svg>'
|
|
174
|
-
></rel-chip>
|
|
175
|
-
</div>
|
|
176
|
-
`,
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Chips with avatar images
|
|
181
|
-
*/
|
|
182
|
-
export const WithAvatar: Story = {
|
|
183
|
-
render: () => html`
|
|
184
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
185
|
-
<rel-chip
|
|
186
|
-
label="John Doe"
|
|
187
|
-
tone="default"
|
|
188
|
-
avatar="https://i.pravatar.cc/40?img=1"
|
|
189
|
-
></rel-chip>
|
|
190
|
-
<rel-chip
|
|
191
|
-
label="Jane Smith"
|
|
192
|
-
tone="blue"
|
|
193
|
-
avatar="https://i.pravatar.cc/40?img=5"
|
|
194
|
-
></rel-chip>
|
|
195
|
-
<rel-chip
|
|
196
|
-
label="Alex Johnson"
|
|
197
|
-
tone="green"
|
|
198
|
-
avatar="https://i.pravatar.cc/40?img=8"
|
|
199
|
-
></rel-chip>
|
|
200
|
-
<rel-chip
|
|
201
|
-
label="Sam Wilson"
|
|
202
|
-
tone="yellow"
|
|
203
|
-
avatar="https://i.pravatar.cc/40?img=12"
|
|
204
|
-
></rel-chip>
|
|
205
|
-
</div>
|
|
206
|
-
`,
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Removable chips with close button
|
|
211
|
-
*/
|
|
212
|
-
export const Removable: Story = {
|
|
213
|
-
render: () => html`
|
|
214
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
215
|
-
<rel-chip label="Removable Chip" tone="default" removable></rel-chip>
|
|
216
|
-
<rel-chip label="Delete Me" tone="red" removable></rel-chip>
|
|
217
|
-
<rel-chip
|
|
218
|
-
label="Remove User"
|
|
219
|
-
tone="blue"
|
|
220
|
-
avatar="https://i.pravatar.cc/40?img=3"
|
|
221
|
-
removable
|
|
222
|
-
></rel-chip>
|
|
223
|
-
<rel-chip
|
|
224
|
-
label="With Icon"
|
|
225
|
-
tone="green"
|
|
226
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'
|
|
227
|
-
removable
|
|
228
|
-
></rel-chip>
|
|
229
|
-
</div>
|
|
230
|
-
`,
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Keyboard interactions - Press Backspace or Delete when focused to remove
|
|
235
|
-
*/
|
|
236
|
-
export const KeyboardInteractions: Story = {
|
|
237
|
-
render: () => html`
|
|
238
|
-
<div style="display: flex; flex-direction: column; gap: 16px; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
239
|
-
<p style="margin: 0; color: #666; font-size: 14px;">
|
|
240
|
-
Tab to focus chips, press Backspace or Delete to remove them
|
|
241
|
-
</p>
|
|
242
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap;">
|
|
243
|
-
<rel-chip label="Press Backspace" tone="yellow" removable></rel-chip>
|
|
244
|
-
<rel-chip label="Press Delete" tone="red" removable></rel-chip>
|
|
245
|
-
<rel-chip label="Keyboard Friendly" tone="blue" removable></rel-chip>
|
|
246
|
-
</div>
|
|
247
|
-
</div>
|
|
248
|
-
`,
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Complex combinations - Avatar + Icon + Removable
|
|
253
|
-
*/
|
|
254
|
-
export const ComplexExamples: Story = {
|
|
255
|
-
render: () => html`
|
|
256
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #1a202c; border-radius: 8px;">
|
|
257
|
-
<rel-chip
|
|
258
|
-
label="Premium User"
|
|
259
|
-
tone="yellow"
|
|
260
|
-
avatar="https://i.pravatar.cc/40?img=7"
|
|
261
|
-
trailingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>'
|
|
262
|
-
removable
|
|
263
|
-
></rel-chip>
|
|
264
|
-
<rel-chip
|
|
265
|
-
label="Admin"
|
|
266
|
-
tone="red"
|
|
267
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z"/></svg>'
|
|
268
|
-
avatar="https://i.pravatar.cc/40?img=9"
|
|
269
|
-
removable
|
|
270
|
-
></rel-chip>
|
|
271
|
-
<rel-chip
|
|
272
|
-
label="Verified"
|
|
273
|
-
tone="green"
|
|
274
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'
|
|
275
|
-
outline
|
|
276
|
-
></rel-chip>
|
|
277
|
-
</div>
|
|
278
|
-
`,
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Default outline - gray outline chip
|
|
283
|
-
*/
|
|
284
|
-
export const OutlineDefault: Story = {
|
|
285
|
-
args: {
|
|
286
|
-
label: 'Default Outline',
|
|
287
|
-
tone: 'default',
|
|
288
|
-
outline: true,
|
|
289
|
-
},
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Blue outline - blue border with transparent background
|
|
294
|
-
*/
|
|
295
|
-
export const OutlineBlue: Story = {
|
|
296
|
-
args: {
|
|
297
|
-
label: 'Blue Outline',
|
|
298
|
-
tone: 'blue',
|
|
299
|
-
outline: true,
|
|
300
|
-
},
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Yellow outline - yellow border with transparent background
|
|
305
|
-
*/
|
|
306
|
-
export const OutlineYellow: Story = {
|
|
307
|
-
args: {
|
|
308
|
-
label: 'Yellow Outline',
|
|
309
|
-
tone: 'yellow',
|
|
310
|
-
outline: true,
|
|
311
|
-
},
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Red outline - red border with transparent background
|
|
316
|
-
*/
|
|
317
|
-
export const OutlineRed: Story = {
|
|
318
|
-
args: {
|
|
319
|
-
label: 'Red Outline',
|
|
320
|
-
tone: 'red',
|
|
321
|
-
outline: true,
|
|
322
|
-
},
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Green outline - green border with transparent background
|
|
327
|
-
*/
|
|
328
|
-
export const OutlineGreen: Story = {
|
|
329
|
-
args: {
|
|
330
|
-
label: 'Green Outline',
|
|
331
|
-
tone: 'green',
|
|
332
|
-
outline: true,
|
|
333
|
-
},
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Removable with outline - all tones removable in outline mode
|
|
338
|
-
*/
|
|
339
|
-
export const RemovableOutline: Story = {
|
|
340
|
-
render: () => html`
|
|
341
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #1a202c; border-radius: 8px;">
|
|
342
|
-
<rel-chip label="Default" tone="default" outline removable></rel-chip>
|
|
343
|
-
<rel-chip label="Blue" tone="blue" outline removable></rel-chip>
|
|
344
|
-
<rel-chip label="Yellow" tone="yellow" outline removable></rel-chip>
|
|
345
|
-
<rel-chip label="Red" tone="red" outline removable></rel-chip>
|
|
346
|
-
<rel-chip label="Green" tone="green" outline removable></rel-chip>
|
|
347
|
-
</div>
|
|
348
|
-
`,
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Avatar with all tones - avatar chips in each color
|
|
353
|
-
*/
|
|
354
|
-
export const AvatarAllTones: Story = {
|
|
355
|
-
render: () => html`
|
|
356
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
357
|
-
<rel-chip label="Default" tone="default" avatar="https://i.pravatar.cc/40?img=1"></rel-chip>
|
|
358
|
-
<rel-chip label="Blue" tone="blue" avatar="https://i.pravatar.cc/40?img=2"></rel-chip>
|
|
359
|
-
<rel-chip label="Yellow" tone="yellow" avatar="https://i.pravatar.cc/40?img=3"></rel-chip>
|
|
360
|
-
<rel-chip label="Red" tone="red" avatar="https://i.pravatar.cc/40?img=4"></rel-chip>
|
|
361
|
-
<rel-chip label="Green" tone="green" avatar="https://i.pravatar.cc/40?img=5"></rel-chip>
|
|
362
|
-
</div>
|
|
363
|
-
`,
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* Avatar outline - avatar chips with outline style
|
|
368
|
-
*/
|
|
369
|
-
export const AvatarOutline: Story = {
|
|
370
|
-
render: () => html`
|
|
371
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #1a202c; border-radius: 8px;">
|
|
372
|
-
<rel-chip label="Default" tone="default" avatar="https://i.pravatar.cc/40?img=6" outline></rel-chip>
|
|
373
|
-
<rel-chip label="Blue" tone="blue" avatar="https://i.pravatar.cc/40?img=7" outline></rel-chip>
|
|
374
|
-
<rel-chip label="Yellow" tone="yellow" avatar="https://i.pravatar.cc/40?img=8" outline></rel-chip>
|
|
375
|
-
<rel-chip label="Red" tone="red" avatar="https://i.pravatar.cc/40?img=9" outline></rel-chip>
|
|
376
|
-
<rel-chip label="Green" tone="green" avatar="https://i.pravatar.cc/40?img=10" outline></rel-chip>
|
|
377
|
-
</div>
|
|
378
|
-
`,
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Icon outline combinations - outline chips with icons
|
|
383
|
-
*/
|
|
384
|
-
export const IconOutlineCombinations: Story = {
|
|
385
|
-
render: () => html`
|
|
386
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #1a202c; border-radius: 8px;">
|
|
387
|
-
<rel-chip
|
|
388
|
-
label="Star"
|
|
389
|
-
tone="blue"
|
|
390
|
-
outline
|
|
391
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>'
|
|
392
|
-
></rel-chip>
|
|
393
|
-
<rel-chip
|
|
394
|
-
label="Success"
|
|
395
|
-
tone="green"
|
|
396
|
-
outline
|
|
397
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'
|
|
398
|
-
></rel-chip>
|
|
399
|
-
<rel-chip
|
|
400
|
-
label="Warning"
|
|
401
|
-
tone="yellow"
|
|
402
|
-
outline
|
|
403
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>'
|
|
404
|
-
></rel-chip>
|
|
405
|
-
<rel-chip
|
|
406
|
-
label="Error"
|
|
407
|
-
tone="red"
|
|
408
|
-
outline
|
|
409
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>'
|
|
410
|
-
></rel-chip>
|
|
411
|
-
</div>
|
|
412
|
-
`,
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Tags example - realistic tag selection interface
|
|
417
|
-
*/
|
|
418
|
-
export const TagsExample: Story = {
|
|
419
|
-
render: () => html`
|
|
420
|
-
<div style="padding: 24px; max-width: 600px;">
|
|
421
|
-
<h4 style="margin-bottom: 12px; font-size: 14px; font-weight: 600; color: #666;">Selected Tags</h4>
|
|
422
|
-
<div style="display: flex; gap: 8px; flex-wrap: wrap; padding: 16px; background: #f9f9f9; border-radius: 8px; min-height: 60px;">
|
|
423
|
-
<rel-chip label="JavaScript" tone="yellow" removable></rel-chip>
|
|
424
|
-
<rel-chip label="React" tone="blue" removable></rel-chip>
|
|
425
|
-
<rel-chip label="TypeScript" tone="blue" removable></rel-chip>
|
|
426
|
-
<rel-chip label="Node.js" tone="green" removable></rel-chip>
|
|
427
|
-
<rel-chip label="Web Components" tone="default" removable></rel-chip>
|
|
428
|
-
</div>
|
|
429
|
-
</div>
|
|
430
|
-
`,
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* User roles - chips representing different user roles
|
|
435
|
-
*/
|
|
436
|
-
export const UserRoles: Story = {
|
|
437
|
-
render: () => html`
|
|
438
|
-
<div style="padding: 24px;">
|
|
439
|
-
<h4 style="margin-bottom: 12px; font-size: 14px; font-weight: 600;">Team Members</h4>
|
|
440
|
-
<div style="display: flex; flex-direction: column; gap: 16px;">
|
|
441
|
-
<div style="display: flex; align-items: center; gap: 12px;">
|
|
442
|
-
<span style="font-weight: 500; min-width: 120px;">Admin</span>
|
|
443
|
-
<rel-chip label="John Doe" tone="red" avatar="https://i.pravatar.cc/40?img=11" removable></rel-chip>
|
|
444
|
-
</div>
|
|
445
|
-
<div style="display: flex; align-items: center; gap: 12px;">
|
|
446
|
-
<span style="font-weight: 500; min-width: 120px;">Moderators</span>
|
|
447
|
-
<rel-chip label="Jane Smith" tone="yellow" avatar="https://i.pravatar.cc/40?img=12" removable></rel-chip>
|
|
448
|
-
<rel-chip label="Bob Wilson" tone="yellow" avatar="https://i.pravatar.cc/40?img=13" removable></rel-chip>
|
|
449
|
-
</div>
|
|
450
|
-
<div style="display: flex; align-items: center; gap: 12px;">
|
|
451
|
-
<span style="font-weight: 500; min-width: 120px;">Members</span>
|
|
452
|
-
<rel-chip label="Alice Johnson" tone="default" avatar="https://i.pravatar.cc/40?img=14" removable></rel-chip>
|
|
453
|
-
<rel-chip label="Charlie Brown" tone="default" avatar="https://i.pravatar.cc/40?img=15" removable></rel-chip>
|
|
454
|
-
<rel-chip label="Diana Prince" tone="default" avatar="https://i.pravatar.cc/40?img=16" removable></rel-chip>
|
|
455
|
-
</div>
|
|
456
|
-
</div>
|
|
457
|
-
</div>
|
|
458
|
-
`,
|
|
459
|
-
};
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Status indicators - chips as status badges
|
|
463
|
-
*/
|
|
464
|
-
export const StatusIndicators: Story = {
|
|
465
|
-
render: () => html`
|
|
466
|
-
<div style="display: flex; flex-direction: column; gap: 16px; padding: 24px;">
|
|
467
|
-
<div style="display: flex; align-items: center; gap: 12px;">
|
|
468
|
-
<span style="min-width: 120px;">Order #1234</span>
|
|
469
|
-
<rel-chip
|
|
470
|
-
label="Completed"
|
|
471
|
-
tone="green"
|
|
472
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'
|
|
473
|
-
></rel-chip>
|
|
474
|
-
</div>
|
|
475
|
-
<div style="display: flex; align-items: center; gap: 12px;">
|
|
476
|
-
<span style="min-width: 120px;">Order #1235</span>
|
|
477
|
-
<rel-chip label="Pending" tone="yellow"></rel-chip>
|
|
478
|
-
</div>
|
|
479
|
-
<div style="display: flex; align-items: center; gap: 12px;">
|
|
480
|
-
<span style="min-width: 120px;">Order #1236</span>
|
|
481
|
-
<rel-chip label="Failed" tone="red"></rel-chip>
|
|
482
|
-
</div>
|
|
483
|
-
<div style="display: flex; align-items: center; gap: 12px;">
|
|
484
|
-
<span style="min-width: 120px;">Order #1237</span>
|
|
485
|
-
<rel-chip label="Processing" tone="blue"></rel-chip>
|
|
486
|
-
</div>
|
|
487
|
-
</div>
|
|
488
|
-
`,
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* All variants showcase - comprehensive display of chip options
|
|
493
|
-
*/
|
|
494
|
-
export const AllVariants: Story = {
|
|
495
|
-
render: () => html`
|
|
496
|
-
<div style="display: flex; flex-direction: column; gap: 32px; padding: 24px;">
|
|
497
|
-
<div>
|
|
498
|
-
<h3 style="margin-bottom: 16px; font-size: 18px; font-weight: 600;">Filled Variants</h3>
|
|
499
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
500
|
-
<rel-chip label="Default" tone="default"></rel-chip>
|
|
501
|
-
<rel-chip label="Blue" tone="blue"></rel-chip>
|
|
502
|
-
<rel-chip label="Yellow" tone="yellow"></rel-chip>
|
|
503
|
-
<rel-chip label="Red" tone="red"></rel-chip>
|
|
504
|
-
<rel-chip label="Green" tone="green"></rel-chip>
|
|
505
|
-
</div>
|
|
506
|
-
</div>
|
|
507
|
-
|
|
508
|
-
<div>
|
|
509
|
-
<h3 style="margin-bottom: 16px; font-size: 18px; font-weight: 600;">Outline Variants</h3>
|
|
510
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #1a202c; border-radius: 8px;">
|
|
511
|
-
<rel-chip label="Default" tone="default" outline></rel-chip>
|
|
512
|
-
<rel-chip label="Blue" tone="blue" outline></rel-chip>
|
|
513
|
-
<rel-chip label="Yellow" tone="yellow" outline></rel-chip>
|
|
514
|
-
<rel-chip label="Red" tone="red" outline></rel-chip>
|
|
515
|
-
<rel-chip label="Green" tone="green" outline></rel-chip>
|
|
516
|
-
</div>
|
|
517
|
-
</div>
|
|
518
|
-
|
|
519
|
-
<div>
|
|
520
|
-
<h3 style="margin-bottom: 16px; font-size: 18px; font-weight: 600;">With Icons</h3>
|
|
521
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
522
|
-
<rel-chip
|
|
523
|
-
label="Leading"
|
|
524
|
-
tone="blue"
|
|
525
|
-
leadingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>'
|
|
526
|
-
></rel-chip>
|
|
527
|
-
<rel-chip
|
|
528
|
-
label="Trailing"
|
|
529
|
-
tone="green"
|
|
530
|
-
trailingIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>'
|
|
531
|
-
></rel-chip>
|
|
532
|
-
</div>
|
|
533
|
-
</div>
|
|
534
|
-
|
|
535
|
-
<div>
|
|
536
|
-
<h3 style="margin-bottom: 16px; font-size: 18px; font-weight: 600;">With Avatar</h3>
|
|
537
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
538
|
-
<rel-chip label="User 1" avatar="https://i.pravatar.cc/40?img=1"></rel-chip>
|
|
539
|
-
<rel-chip label="User 2" tone="blue" avatar="https://i.pravatar.cc/40?img=5"></rel-chip>
|
|
540
|
-
</div>
|
|
541
|
-
</div>
|
|
542
|
-
|
|
543
|
-
<div>
|
|
544
|
-
<h3 style="margin-bottom: 16px; font-size: 18px; font-weight: 600;">Removable</h3>
|
|
545
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: #f5f5f5; border-radius: 8px;">
|
|
546
|
-
<rel-chip label="Remove Me" removable></rel-chip>
|
|
547
|
-
<rel-chip label="Delete" tone="red" removable></rel-chip>
|
|
548
|
-
</div>
|
|
549
|
-
</div>
|
|
550
|
-
</div>
|
|
551
|
-
`,
|
|
552
|
-
};
|