sv5ui 0.0.1
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/LICENSE +21 -0
- package/README.md +124 -0
- package/dist/Alert/Alert.svelte +120 -0
- package/dist/Alert/Alert.svelte.d.ts +5 -0
- package/dist/Alert/alert.types.d.ts +99 -0
- package/dist/Alert/alert.types.js +1 -0
- package/dist/Alert/alert.variants.d.ts +213 -0
- package/dist/Alert/alert.variants.js +293 -0
- package/dist/Alert/index.d.ts +2 -0
- package/dist/Alert/index.js +1 -0
- package/dist/Avatar/Avatar.svelte +70 -0
- package/dist/Avatar/Avatar.svelte.d.ts +6 -0
- package/dist/Avatar/avatar.types.d.ts +40 -0
- package/dist/Avatar/avatar.types.js +1 -0
- package/dist/Avatar/avatar.variants.d.ts +178 -0
- package/dist/Avatar/avatar.variants.js +28 -0
- package/dist/Avatar/index.d.ts +2 -0
- package/dist/Avatar/index.js +1 -0
- package/dist/AvatarGroup/AvatarGroup.svelte +66 -0
- package/dist/AvatarGroup/AvatarGroup.svelte.d.ts +5 -0
- package/dist/AvatarGroup/avatar-group.types.d.ts +34 -0
- package/dist/AvatarGroup/avatar-group.types.js +1 -0
- package/dist/AvatarGroup/avatar-group.variants.d.ts +173 -0
- package/dist/AvatarGroup/avatar-group.variants.js +45 -0
- package/dist/AvatarGroup/index.d.ts +2 -0
- package/dist/AvatarGroup/index.js +1 -0
- package/dist/Badge/Badge.svelte +74 -0
- package/dist/Badge/Badge.svelte.d.ts +5 -0
- package/dist/Badge/badge.types.d.ts +74 -0
- package/dist/Badge/badge.types.js +1 -0
- package/dist/Badge/badge.variants.d.ts +303 -0
- package/dist/Badge/badge.variants.js +245 -0
- package/dist/Badge/index.d.ts +2 -0
- package/dist/Badge/index.js +1 -0
- package/dist/Button/Button.svelte +103 -0
- package/dist/Button/Button.svelte.d.ts +6 -0
- package/dist/Button/button.types.d.ts +97 -0
- package/dist/Button/button.types.js +1 -0
- package/dist/Button/button.variants.d.ts +388 -0
- package/dist/Button/button.variants.js +461 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/index.js +1 -0
- package/dist/Card/Card.svelte +53 -0
- package/dist/Card/Card.svelte.d.ts +5 -0
- package/dist/Card/card.types.d.ts +32 -0
- package/dist/Card/card.types.js +1 -0
- package/dist/Card/card.variants.d.ts +108 -0
- package/dist/Card/card.variants.js +32 -0
- package/dist/Card/index.d.ts +2 -0
- package/dist/Card/index.js +1 -0
- package/dist/Chip/Chip.svelte +50 -0
- package/dist/Chip/Chip.svelte.d.ts +5 -0
- package/dist/Chip/chip.types.d.ts +62 -0
- package/dist/Chip/chip.types.js +1 -0
- package/dist/Chip/chip.variants.d.ts +328 -0
- package/dist/Chip/chip.variants.js +58 -0
- package/dist/Chip/index.d.ts +2 -0
- package/dist/Chip/index.js +1 -0
- package/dist/Container/Container.svelte +27 -0
- package/dist/Container/Container.svelte.d.ts +5 -0
- package/dist/Container/container.types.d.ts +19 -0
- package/dist/Container/container.types.js +1 -0
- package/dist/Container/container.variants.d.ts +29 -0
- package/dist/Container/container.variants.js +9 -0
- package/dist/Container/index.d.ts +2 -0
- package/dist/Container/index.js +1 -0
- package/dist/Empty/Empty.svelte +83 -0
- package/dist/Empty/Empty.svelte.d.ts +5 -0
- package/dist/Empty/empty.types.d.ts +74 -0
- package/dist/Empty/empty.types.js +1 -0
- package/dist/Empty/empty.variants.d.ts +288 -0
- package/dist/Empty/empty.variants.js +364 -0
- package/dist/Empty/index.d.ts +2 -0
- package/dist/Empty/index.js +1 -0
- package/dist/Icon/Icon.svelte +40 -0
- package/dist/Icon/Icon.svelte.d.ts +6 -0
- package/dist/Icon/icon.types.d.ts +37 -0
- package/dist/Icon/icon.types.js +1 -0
- package/dist/Icon/index.d.ts +2 -0
- package/dist/Icon/index.js +1 -0
- package/dist/Kbd/Kbd.svelte +35 -0
- package/dist/Kbd/Kbd.svelte.d.ts +5 -0
- package/dist/Kbd/index.d.ts +3 -0
- package/dist/Kbd/index.js +2 -0
- package/dist/Kbd/kbd.types.d.ts +77 -0
- package/dist/Kbd/kbd.types.js +1 -0
- package/dist/Kbd/kbd.variants.d.ts +118 -0
- package/dist/Kbd/kbd.variants.js +96 -0
- package/dist/Kbd/useKbd.svelte.d.ts +29 -0
- package/dist/Kbd/useKbd.svelte.js +245 -0
- package/dist/Link/Link.svelte +117 -0
- package/dist/Link/Link.svelte.d.ts +5 -0
- package/dist/Link/index.d.ts +2 -0
- package/dist/Link/index.js +1 -0
- package/dist/Link/link.types.d.ts +68 -0
- package/dist/Link/link.types.js +1 -0
- package/dist/Link/link.variants.d.ts +138 -0
- package/dist/Link/link.variants.js +145 -0
- package/dist/Progress/Progress.svelte +89 -0
- package/dist/Progress/Progress.svelte.d.ts +6 -0
- package/dist/Progress/index.d.ts +2 -0
- package/dist/Progress/index.js +1 -0
- package/dist/Progress/progress.types.d.ts +63 -0
- package/dist/Progress/progress.types.js +1 -0
- package/dist/Progress/progress.variants.d.ts +483 -0
- package/dist/Progress/progress.variants.js +190 -0
- package/dist/Separator/Separator.svelte +67 -0
- package/dist/Separator/Separator.svelte.d.ts +6 -0
- package/dist/Separator/index.d.ts +2 -0
- package/dist/Separator/index.js +1 -0
- package/dist/Separator/separator.types.d.ts +48 -0
- package/dist/Separator/separator.types.js +1 -0
- package/dist/Separator/separator.variants.d.ts +488 -0
- package/dist/Separator/separator.variants.js +104 -0
- package/dist/Skeleton/Skeleton.svelte +31 -0
- package/dist/Skeleton/Skeleton.svelte.d.ts +5 -0
- package/dist/Skeleton/index.d.ts +2 -0
- package/dist/Skeleton/index.js +1 -0
- package/dist/Skeleton/skeleton.types.d.ts +18 -0
- package/dist/Skeleton/skeleton.types.js +1 -0
- package/dist/Skeleton/skeleton.variants.d.ts +18 -0
- package/dist/Skeleton/skeleton.variants.js +12 -0
- package/dist/Timeline/Timeline.svelte +106 -0
- package/dist/Timeline/Timeline.svelte.d.ts +5 -0
- package/dist/Timeline/index.d.ts +2 -0
- package/dist/Timeline/index.js +1 -0
- package/dist/Timeline/timeline.types.d.ts +130 -0
- package/dist/Timeline/timeline.types.js +1 -0
- package/dist/Timeline/timeline.variants.d.ts +413 -0
- package/dist/Timeline/timeline.variants.js +121 -0
- package/dist/User/User.svelte +94 -0
- package/dist/User/User.svelte.d.ts +5 -0
- package/dist/User/index.d.ts +2 -0
- package/dist/User/index.js +1 -0
- package/dist/User/user.types.d.ts +74 -0
- package/dist/User/user.types.js +1 -0
- package/dist/User/user.variants.d.ts +308 -0
- package/dist/User/user.variants.js +73 -0
- package/dist/config.d.ts +59 -0
- package/dist/config.js +94 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +20 -0
- package/dist/theme.css +410 -0
- package/package.json +104 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const timelineVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
orientation: {
|
|
4
|
+
horizontal: {
|
|
5
|
+
root: string;
|
|
6
|
+
item: string;
|
|
7
|
+
separator: string;
|
|
8
|
+
};
|
|
9
|
+
vertical: {
|
|
10
|
+
root: string;
|
|
11
|
+
container: string;
|
|
12
|
+
separator: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
color: {
|
|
16
|
+
primary: {
|
|
17
|
+
indicator: string;
|
|
18
|
+
};
|
|
19
|
+
secondary: {
|
|
20
|
+
indicator: string;
|
|
21
|
+
};
|
|
22
|
+
tertiary: {
|
|
23
|
+
indicator: string;
|
|
24
|
+
};
|
|
25
|
+
success: {
|
|
26
|
+
indicator: string;
|
|
27
|
+
};
|
|
28
|
+
warning: {
|
|
29
|
+
indicator: string;
|
|
30
|
+
};
|
|
31
|
+
error: {
|
|
32
|
+
indicator: string;
|
|
33
|
+
};
|
|
34
|
+
info: {
|
|
35
|
+
indicator: string;
|
|
36
|
+
};
|
|
37
|
+
surface: {
|
|
38
|
+
indicator: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
size: {
|
|
42
|
+
'3xs': {
|
|
43
|
+
indicator: string;
|
|
44
|
+
};
|
|
45
|
+
'2xs': {
|
|
46
|
+
indicator: string;
|
|
47
|
+
};
|
|
48
|
+
xs: {
|
|
49
|
+
indicator: string;
|
|
50
|
+
};
|
|
51
|
+
sm: {
|
|
52
|
+
indicator: string;
|
|
53
|
+
};
|
|
54
|
+
md: {
|
|
55
|
+
indicator: string;
|
|
56
|
+
};
|
|
57
|
+
lg: {
|
|
58
|
+
indicator: string;
|
|
59
|
+
};
|
|
60
|
+
xl: {
|
|
61
|
+
indicator: string;
|
|
62
|
+
};
|
|
63
|
+
'2xl': {
|
|
64
|
+
indicator: string;
|
|
65
|
+
};
|
|
66
|
+
'3xl': {
|
|
67
|
+
indicator: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
reverse: {
|
|
71
|
+
true: string;
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
root: string;
|
|
75
|
+
item: string;
|
|
76
|
+
container: string;
|
|
77
|
+
indicator: string;
|
|
78
|
+
separator: string;
|
|
79
|
+
wrapper: string;
|
|
80
|
+
date: string;
|
|
81
|
+
title: string;
|
|
82
|
+
description: string;
|
|
83
|
+
}, undefined, {
|
|
84
|
+
orientation: {
|
|
85
|
+
horizontal: {
|
|
86
|
+
root: string;
|
|
87
|
+
item: string;
|
|
88
|
+
separator: string;
|
|
89
|
+
};
|
|
90
|
+
vertical: {
|
|
91
|
+
root: string;
|
|
92
|
+
container: string;
|
|
93
|
+
separator: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
color: {
|
|
97
|
+
primary: {
|
|
98
|
+
indicator: string;
|
|
99
|
+
};
|
|
100
|
+
secondary: {
|
|
101
|
+
indicator: string;
|
|
102
|
+
};
|
|
103
|
+
tertiary: {
|
|
104
|
+
indicator: string;
|
|
105
|
+
};
|
|
106
|
+
success: {
|
|
107
|
+
indicator: string;
|
|
108
|
+
};
|
|
109
|
+
warning: {
|
|
110
|
+
indicator: string;
|
|
111
|
+
};
|
|
112
|
+
error: {
|
|
113
|
+
indicator: string;
|
|
114
|
+
};
|
|
115
|
+
info: {
|
|
116
|
+
indicator: string;
|
|
117
|
+
};
|
|
118
|
+
surface: {
|
|
119
|
+
indicator: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
size: {
|
|
123
|
+
'3xs': {
|
|
124
|
+
indicator: string;
|
|
125
|
+
};
|
|
126
|
+
'2xs': {
|
|
127
|
+
indicator: string;
|
|
128
|
+
};
|
|
129
|
+
xs: {
|
|
130
|
+
indicator: string;
|
|
131
|
+
};
|
|
132
|
+
sm: {
|
|
133
|
+
indicator: string;
|
|
134
|
+
};
|
|
135
|
+
md: {
|
|
136
|
+
indicator: string;
|
|
137
|
+
};
|
|
138
|
+
lg: {
|
|
139
|
+
indicator: string;
|
|
140
|
+
};
|
|
141
|
+
xl: {
|
|
142
|
+
indicator: string;
|
|
143
|
+
};
|
|
144
|
+
'2xl': {
|
|
145
|
+
indicator: string;
|
|
146
|
+
};
|
|
147
|
+
'3xl': {
|
|
148
|
+
indicator: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
reverse: {
|
|
152
|
+
true: string;
|
|
153
|
+
};
|
|
154
|
+
}, {
|
|
155
|
+
root: string;
|
|
156
|
+
item: string;
|
|
157
|
+
container: string;
|
|
158
|
+
indicator: string;
|
|
159
|
+
separator: string;
|
|
160
|
+
wrapper: string;
|
|
161
|
+
date: string;
|
|
162
|
+
title: string;
|
|
163
|
+
description: string;
|
|
164
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
165
|
+
orientation: {
|
|
166
|
+
horizontal: {
|
|
167
|
+
root: string;
|
|
168
|
+
item: string;
|
|
169
|
+
separator: string;
|
|
170
|
+
};
|
|
171
|
+
vertical: {
|
|
172
|
+
root: string;
|
|
173
|
+
container: string;
|
|
174
|
+
separator: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
color: {
|
|
178
|
+
primary: {
|
|
179
|
+
indicator: string;
|
|
180
|
+
};
|
|
181
|
+
secondary: {
|
|
182
|
+
indicator: string;
|
|
183
|
+
};
|
|
184
|
+
tertiary: {
|
|
185
|
+
indicator: string;
|
|
186
|
+
};
|
|
187
|
+
success: {
|
|
188
|
+
indicator: string;
|
|
189
|
+
};
|
|
190
|
+
warning: {
|
|
191
|
+
indicator: string;
|
|
192
|
+
};
|
|
193
|
+
error: {
|
|
194
|
+
indicator: string;
|
|
195
|
+
};
|
|
196
|
+
info: {
|
|
197
|
+
indicator: string;
|
|
198
|
+
};
|
|
199
|
+
surface: {
|
|
200
|
+
indicator: string;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
size: {
|
|
204
|
+
'3xs': {
|
|
205
|
+
indicator: string;
|
|
206
|
+
};
|
|
207
|
+
'2xs': {
|
|
208
|
+
indicator: string;
|
|
209
|
+
};
|
|
210
|
+
xs: {
|
|
211
|
+
indicator: string;
|
|
212
|
+
};
|
|
213
|
+
sm: {
|
|
214
|
+
indicator: string;
|
|
215
|
+
};
|
|
216
|
+
md: {
|
|
217
|
+
indicator: string;
|
|
218
|
+
};
|
|
219
|
+
lg: {
|
|
220
|
+
indicator: string;
|
|
221
|
+
};
|
|
222
|
+
xl: {
|
|
223
|
+
indicator: string;
|
|
224
|
+
};
|
|
225
|
+
'2xl': {
|
|
226
|
+
indicator: string;
|
|
227
|
+
};
|
|
228
|
+
'3xl': {
|
|
229
|
+
indicator: string;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
reverse: {
|
|
233
|
+
true: string;
|
|
234
|
+
};
|
|
235
|
+
}, {
|
|
236
|
+
root: string;
|
|
237
|
+
item: string;
|
|
238
|
+
container: string;
|
|
239
|
+
indicator: string;
|
|
240
|
+
separator: string;
|
|
241
|
+
wrapper: string;
|
|
242
|
+
date: string;
|
|
243
|
+
title: string;
|
|
244
|
+
description: string;
|
|
245
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
246
|
+
export type TimelineVariantProps = VariantProps<typeof timelineVariants>;
|
|
247
|
+
export type TimelineSlots = keyof ReturnType<typeof timelineVariants>;
|
|
248
|
+
export declare const timelineDefaults: {
|
|
249
|
+
defaultVariants: import("tailwind-variants").TVDefaultVariants<{
|
|
250
|
+
orientation: {
|
|
251
|
+
horizontal: {
|
|
252
|
+
root: string;
|
|
253
|
+
item: string;
|
|
254
|
+
separator: string;
|
|
255
|
+
};
|
|
256
|
+
vertical: {
|
|
257
|
+
root: string;
|
|
258
|
+
container: string;
|
|
259
|
+
separator: string;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
color: {
|
|
263
|
+
primary: {
|
|
264
|
+
indicator: string;
|
|
265
|
+
};
|
|
266
|
+
secondary: {
|
|
267
|
+
indicator: string;
|
|
268
|
+
};
|
|
269
|
+
tertiary: {
|
|
270
|
+
indicator: string;
|
|
271
|
+
};
|
|
272
|
+
success: {
|
|
273
|
+
indicator: string;
|
|
274
|
+
};
|
|
275
|
+
warning: {
|
|
276
|
+
indicator: string;
|
|
277
|
+
};
|
|
278
|
+
error: {
|
|
279
|
+
indicator: string;
|
|
280
|
+
};
|
|
281
|
+
info: {
|
|
282
|
+
indicator: string;
|
|
283
|
+
};
|
|
284
|
+
surface: {
|
|
285
|
+
indicator: string;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
size: {
|
|
289
|
+
'3xs': {
|
|
290
|
+
indicator: string;
|
|
291
|
+
};
|
|
292
|
+
'2xs': {
|
|
293
|
+
indicator: string;
|
|
294
|
+
};
|
|
295
|
+
xs: {
|
|
296
|
+
indicator: string;
|
|
297
|
+
};
|
|
298
|
+
sm: {
|
|
299
|
+
indicator: string;
|
|
300
|
+
};
|
|
301
|
+
md: {
|
|
302
|
+
indicator: string;
|
|
303
|
+
};
|
|
304
|
+
lg: {
|
|
305
|
+
indicator: string;
|
|
306
|
+
};
|
|
307
|
+
xl: {
|
|
308
|
+
indicator: string;
|
|
309
|
+
};
|
|
310
|
+
'2xl': {
|
|
311
|
+
indicator: string;
|
|
312
|
+
};
|
|
313
|
+
'3xl': {
|
|
314
|
+
indicator: string;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
reverse: {
|
|
318
|
+
true: string;
|
|
319
|
+
};
|
|
320
|
+
}, {
|
|
321
|
+
root: string;
|
|
322
|
+
item: string;
|
|
323
|
+
container: string;
|
|
324
|
+
indicator: string;
|
|
325
|
+
separator: string;
|
|
326
|
+
wrapper: string;
|
|
327
|
+
date: string;
|
|
328
|
+
title: string;
|
|
329
|
+
description: string;
|
|
330
|
+
}, {
|
|
331
|
+
orientation: {
|
|
332
|
+
horizontal: {
|
|
333
|
+
root: string;
|
|
334
|
+
item: string;
|
|
335
|
+
separator: string;
|
|
336
|
+
};
|
|
337
|
+
vertical: {
|
|
338
|
+
root: string;
|
|
339
|
+
container: string;
|
|
340
|
+
separator: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
color: {
|
|
344
|
+
primary: {
|
|
345
|
+
indicator: string;
|
|
346
|
+
};
|
|
347
|
+
secondary: {
|
|
348
|
+
indicator: string;
|
|
349
|
+
};
|
|
350
|
+
tertiary: {
|
|
351
|
+
indicator: string;
|
|
352
|
+
};
|
|
353
|
+
success: {
|
|
354
|
+
indicator: string;
|
|
355
|
+
};
|
|
356
|
+
warning: {
|
|
357
|
+
indicator: string;
|
|
358
|
+
};
|
|
359
|
+
error: {
|
|
360
|
+
indicator: string;
|
|
361
|
+
};
|
|
362
|
+
info: {
|
|
363
|
+
indicator: string;
|
|
364
|
+
};
|
|
365
|
+
surface: {
|
|
366
|
+
indicator: string;
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
size: {
|
|
370
|
+
'3xs': {
|
|
371
|
+
indicator: string;
|
|
372
|
+
};
|
|
373
|
+
'2xs': {
|
|
374
|
+
indicator: string;
|
|
375
|
+
};
|
|
376
|
+
xs: {
|
|
377
|
+
indicator: string;
|
|
378
|
+
};
|
|
379
|
+
sm: {
|
|
380
|
+
indicator: string;
|
|
381
|
+
};
|
|
382
|
+
md: {
|
|
383
|
+
indicator: string;
|
|
384
|
+
};
|
|
385
|
+
lg: {
|
|
386
|
+
indicator: string;
|
|
387
|
+
};
|
|
388
|
+
xl: {
|
|
389
|
+
indicator: string;
|
|
390
|
+
};
|
|
391
|
+
'2xl': {
|
|
392
|
+
indicator: string;
|
|
393
|
+
};
|
|
394
|
+
'3xl': {
|
|
395
|
+
indicator: string;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
reverse: {
|
|
399
|
+
true: string;
|
|
400
|
+
};
|
|
401
|
+
}, {
|
|
402
|
+
root: string;
|
|
403
|
+
item: string;
|
|
404
|
+
container: string;
|
|
405
|
+
indicator: string;
|
|
406
|
+
separator: string;
|
|
407
|
+
wrapper: string;
|
|
408
|
+
date: string;
|
|
409
|
+
title: string;
|
|
410
|
+
description: string;
|
|
411
|
+
}>;
|
|
412
|
+
slots: Partial<Record<TimelineSlots, string>>;
|
|
413
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
export const timelineVariants = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
root: 'flex gap-1.5',
|
|
5
|
+
item: 'group relative flex flex-1 gap-3',
|
|
6
|
+
container: 'relative flex items-center gap-1.5',
|
|
7
|
+
indicator: 'inline-flex items-center justify-center shrink-0 rounded-full bg-surface-container-highest text-on-surface-variant',
|
|
8
|
+
separator: 'flex-1 rounded-full bg-surface-container-highest',
|
|
9
|
+
wrapper: 'w-full',
|
|
10
|
+
date: 'text-on-surface-variant text-xs',
|
|
11
|
+
title: 'font-medium text-on-surface text-sm',
|
|
12
|
+
description: 'text-on-surface-variant text-wrap text-sm'
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
orientation: {
|
|
16
|
+
horizontal: {
|
|
17
|
+
root: 'flex-row w-full',
|
|
18
|
+
item: 'flex-col',
|
|
19
|
+
separator: 'h-0.5'
|
|
20
|
+
},
|
|
21
|
+
vertical: {
|
|
22
|
+
root: 'flex-col',
|
|
23
|
+
container: 'flex-col',
|
|
24
|
+
separator: 'w-0.5'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
color: {
|
|
28
|
+
primary: {
|
|
29
|
+
indicator: 'group-data-[state=completed]:bg-primary group-data-[state=completed]:text-on-primary group-data-[state=active]:bg-primary group-data-[state=active]:text-on-primary'
|
|
30
|
+
},
|
|
31
|
+
secondary: {
|
|
32
|
+
indicator: 'group-data-[state=completed]:bg-secondary group-data-[state=completed]:text-on-secondary group-data-[state=active]:bg-secondary group-data-[state=active]:text-on-secondary'
|
|
33
|
+
},
|
|
34
|
+
tertiary: {
|
|
35
|
+
indicator: 'group-data-[state=completed]:bg-tertiary group-data-[state=completed]:text-on-tertiary group-data-[state=active]:bg-tertiary group-data-[state=active]:text-on-tertiary'
|
|
36
|
+
},
|
|
37
|
+
success: {
|
|
38
|
+
indicator: 'group-data-[state=completed]:bg-success group-data-[state=completed]:text-on-success group-data-[state=active]:bg-success group-data-[state=active]:text-on-success'
|
|
39
|
+
},
|
|
40
|
+
warning: {
|
|
41
|
+
indicator: 'group-data-[state=completed]:bg-warning group-data-[state=completed]:text-on-warning group-data-[state=active]:bg-warning group-data-[state=active]:text-on-warning'
|
|
42
|
+
},
|
|
43
|
+
error: {
|
|
44
|
+
indicator: 'group-data-[state=completed]:bg-error group-data-[state=completed]:text-on-error group-data-[state=active]:bg-error group-data-[state=active]:text-on-error'
|
|
45
|
+
},
|
|
46
|
+
info: {
|
|
47
|
+
indicator: 'group-data-[state=completed]:bg-info group-data-[state=completed]:text-on-info group-data-[state=active]:bg-info group-data-[state=active]:text-on-info'
|
|
48
|
+
},
|
|
49
|
+
surface: {
|
|
50
|
+
indicator: 'group-data-[state=completed]:bg-inverse-surface group-data-[state=completed]:text-inverse-on-surface group-data-[state=active]:bg-inverse-surface group-data-[state=active]:text-inverse-on-surface'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
'3xs': { indicator: 'size-4 *:size-2.5' },
|
|
55
|
+
'2xs': { indicator: 'size-5 *:size-3' },
|
|
56
|
+
xs: { indicator: 'size-6 *:size-3.5' },
|
|
57
|
+
sm: { indicator: 'size-7 *:size-4' },
|
|
58
|
+
md: { indicator: 'size-8 *:size-5' },
|
|
59
|
+
lg: { indicator: 'size-9 *:size-5' },
|
|
60
|
+
xl: { indicator: 'size-10 *:size-6' },
|
|
61
|
+
'2xl': { indicator: 'size-11 *:size-6' },
|
|
62
|
+
'3xl': { indicator: 'size-12 *:size-7' }
|
|
63
|
+
},
|
|
64
|
+
reverse: {
|
|
65
|
+
true: ''
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
compoundVariants: [
|
|
69
|
+
// Orientation + reverse (visual direction)
|
|
70
|
+
{ orientation: 'vertical', reverse: true, class: { root: 'flex-col-reverse' } },
|
|
71
|
+
{ orientation: 'horizontal', reverse: true, class: { root: 'flex-row-reverse' } },
|
|
72
|
+
// Color + separator styling (reverse=false: completed gets color)
|
|
73
|
+
{ color: 'primary', reverse: false, class: { separator: 'group-data-[state=completed]:bg-primary' } },
|
|
74
|
+
{ color: 'secondary', reverse: false, class: { separator: 'group-data-[state=completed]:bg-secondary' } },
|
|
75
|
+
{ color: 'tertiary', reverse: false, class: { separator: 'group-data-[state=completed]:bg-tertiary' } },
|
|
76
|
+
{ color: 'success', reverse: false, class: { separator: 'group-data-[state=completed]:bg-success' } },
|
|
77
|
+
{ color: 'warning', reverse: false, class: { separator: 'group-data-[state=completed]:bg-warning' } },
|
|
78
|
+
{ color: 'error', reverse: false, class: { separator: 'group-data-[state=completed]:bg-error' } },
|
|
79
|
+
{ color: 'info', reverse: false, class: { separator: 'group-data-[state=completed]:bg-info' } },
|
|
80
|
+
{ color: 'surface', reverse: false, class: { separator: 'group-data-[state=completed]:bg-inverse-surface' } },
|
|
81
|
+
// Color + separator styling (reverse=true: active AND completed get color)
|
|
82
|
+
{ color: 'primary', reverse: true, class: { separator: 'group-data-[state=active]:bg-primary group-data-[state=completed]:bg-primary' } },
|
|
83
|
+
{ color: 'secondary', reverse: true, class: { separator: 'group-data-[state=active]:bg-secondary group-data-[state=completed]:bg-secondary' } },
|
|
84
|
+
{ color: 'tertiary', reverse: true, class: { separator: 'group-data-[state=active]:bg-tertiary group-data-[state=completed]:bg-tertiary' } },
|
|
85
|
+
{ color: 'success', reverse: true, class: { separator: 'group-data-[state=active]:bg-success group-data-[state=completed]:bg-success' } },
|
|
86
|
+
{ color: 'warning', reverse: true, class: { separator: 'group-data-[state=active]:bg-warning group-data-[state=completed]:bg-warning' } },
|
|
87
|
+
{ color: 'error', reverse: true, class: { separator: 'group-data-[state=active]:bg-error group-data-[state=completed]:bg-error' } },
|
|
88
|
+
{ color: 'info', reverse: true, class: { separator: 'group-data-[state=active]:bg-info group-data-[state=completed]:bg-info' } },
|
|
89
|
+
{ color: 'surface', reverse: true, class: { separator: 'group-data-[state=active]:bg-inverse-surface group-data-[state=completed]:bg-inverse-surface' } },
|
|
90
|
+
// Horizontal + size
|
|
91
|
+
{ orientation: 'horizontal', size: '3xs', class: { wrapper: 'pe-4.5' } },
|
|
92
|
+
{ orientation: 'horizontal', size: '2xs', class: { wrapper: 'pe-5' } },
|
|
93
|
+
{ orientation: 'horizontal', size: 'xs', class: { wrapper: 'pe-5.5' } },
|
|
94
|
+
{ orientation: 'horizontal', size: 'sm', class: { wrapper: 'pe-6' } },
|
|
95
|
+
{ orientation: 'horizontal', size: 'md', class: { wrapper: 'pe-6.5' } },
|
|
96
|
+
{ orientation: 'horizontal', size: 'lg', class: { wrapper: 'pe-7' } },
|
|
97
|
+
{ orientation: 'horizontal', size: 'xl', class: { wrapper: 'pe-7.5' } },
|
|
98
|
+
{ orientation: 'horizontal', size: '2xl', class: { wrapper: 'pe-8' } },
|
|
99
|
+
{ orientation: 'horizontal', size: '3xl', class: { wrapper: 'pe-8.5' } },
|
|
100
|
+
// Vertical + size (mt aligns text with indicator center, pb adds spacing)
|
|
101
|
+
{ orientation: 'vertical', size: '3xs', class: { wrapper: '-mt-0.5 pb-4.5' } },
|
|
102
|
+
{ orientation: 'vertical', size: '2xs', class: { wrapper: 'pb-5' } },
|
|
103
|
+
{ orientation: 'vertical', size: 'xs', class: { wrapper: 'mt-0.5 pb-5.5' } },
|
|
104
|
+
{ orientation: 'vertical', size: 'sm', class: { wrapper: 'mt-1 pb-6' } },
|
|
105
|
+
{ orientation: 'vertical', size: 'md', class: { wrapper: 'mt-1.5 pb-6.5' } },
|
|
106
|
+
{ orientation: 'vertical', size: 'lg', class: { wrapper: 'mt-2 pb-7' } },
|
|
107
|
+
{ orientation: 'vertical', size: 'xl', class: { wrapper: 'mt-2.5 pb-7.5' } },
|
|
108
|
+
{ orientation: 'vertical', size: '2xl', class: { wrapper: 'mt-3 pb-8' } },
|
|
109
|
+
{ orientation: 'vertical', size: '3xl', class: { wrapper: 'mt-3.5 pb-8.5' } }
|
|
110
|
+
],
|
|
111
|
+
defaultVariants: {
|
|
112
|
+
orientation: 'vertical',
|
|
113
|
+
color: 'primary',
|
|
114
|
+
size: 'md',
|
|
115
|
+
reverse: false
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
export const timelineDefaults = {
|
|
119
|
+
defaultVariants: timelineVariants.defaultVariants,
|
|
120
|
+
slots: {}
|
|
121
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { UserProps } from './user.types.js'
|
|
3
|
+
|
|
4
|
+
export type Props = UserProps
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { userVariants, userDefaults } from './user.variants.js'
|
|
9
|
+
import { getComponentConfig } from '../config.js'
|
|
10
|
+
import Avatar from '../Avatar/Avatar.svelte'
|
|
11
|
+
import Chip from '../Chip/Chip.svelte'
|
|
12
|
+
import Link from '../Link/Link.svelte'
|
|
13
|
+
|
|
14
|
+
const config = getComponentConfig('user', userDefaults)
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
as = 'div',
|
|
18
|
+
ui,
|
|
19
|
+
name,
|
|
20
|
+
description,
|
|
21
|
+
avatar,
|
|
22
|
+
chip,
|
|
23
|
+
size = config.defaultVariants.size,
|
|
24
|
+
orientation = config.defaultVariants.orientation,
|
|
25
|
+
href,
|
|
26
|
+
class: className,
|
|
27
|
+
avatarSlot,
|
|
28
|
+
nameSlot,
|
|
29
|
+
descriptionSlot,
|
|
30
|
+
...restProps
|
|
31
|
+
}: Props = $props()
|
|
32
|
+
|
|
33
|
+
const isClickable = $derived(!!href || !!restProps.onclick)
|
|
34
|
+
|
|
35
|
+
const classes = $derived.by(() => {
|
|
36
|
+
const slots = userVariants({ size, orientation, clickable: isClickable })
|
|
37
|
+
return {
|
|
38
|
+
root: slots.root({ class: [config.slots.root, className, ui?.root] }),
|
|
39
|
+
wrapper: slots.wrapper({ class: [config.slots.wrapper, ui?.wrapper] }),
|
|
40
|
+
name: slots.name({ class: [config.slots.name, ui?.name] }),
|
|
41
|
+
description: slots.description({ class: [config.slots.description, ui?.description] }),
|
|
42
|
+
avatar: slots.avatar({ class: [config.slots.avatar, ui?.avatar] })
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const mergedAvatarProps = $derived(
|
|
47
|
+
avatar ? { size: size as typeof avatar.size, ...avatar } : undefined
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
const chipProps = $derived.by(() => {
|
|
51
|
+
if (!chip || !avatar) return null
|
|
52
|
+
return chip === true ? {} : chip
|
|
53
|
+
})
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
{#snippet userContent()}
|
|
57
|
+
{#if avatarSlot}
|
|
58
|
+
{@render avatarSlot()}
|
|
59
|
+
{:else if mergedAvatarProps}
|
|
60
|
+
{#if chipProps}
|
|
61
|
+
<Chip {size} inset {...chipProps}>
|
|
62
|
+
<Avatar {...mergedAvatarProps} class={classes.avatar} />
|
|
63
|
+
</Chip>
|
|
64
|
+
{:else}
|
|
65
|
+
<Avatar {...mergedAvatarProps} class={classes.avatar} />
|
|
66
|
+
{/if}
|
|
67
|
+
{/if}
|
|
68
|
+
|
|
69
|
+
{#if name || description || nameSlot || descriptionSlot}
|
|
70
|
+
<div class={classes.wrapper}>
|
|
71
|
+
{#if nameSlot}
|
|
72
|
+
{@render nameSlot()}
|
|
73
|
+
{:else if name}
|
|
74
|
+
<div class={classes.name}>{name}</div>
|
|
75
|
+
{/if}
|
|
76
|
+
|
|
77
|
+
{#if descriptionSlot}
|
|
78
|
+
{@render descriptionSlot()}
|
|
79
|
+
{:else if description}
|
|
80
|
+
<div class={classes.description}>{description}</div>
|
|
81
|
+
{/if}
|
|
82
|
+
</div>
|
|
83
|
+
{/if}
|
|
84
|
+
{/snippet}
|
|
85
|
+
|
|
86
|
+
{#if href}
|
|
87
|
+
<Link {href} raw class={classes.root}>
|
|
88
|
+
{@render userContent()}
|
|
89
|
+
</Link>
|
|
90
|
+
{:else}
|
|
91
|
+
<svelte:element this={as} class={classes.root} {...restProps}>
|
|
92
|
+
{@render userContent()}
|
|
93
|
+
</svelte:element>
|
|
94
|
+
{/if}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as User } from './User.svelte';
|