euv-ui 0.37.2

Reusable UI component library for the euv framework, providing buttons, cards, modals, inputs, and more.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
use super::*;

class! {
    // ═══════════════════════════════════════════════════════════════════════════
    // Field — the parts of a group of form fields.
    // ═══════════════════════════════════════════════════════════════════════════

    // The set of fields that belong together. The reference stacks the
    // fields one under the other and gives the set a 24px gap, which is
    // the breathing room the reference gives a field group.




    // The legend of a set of fields.
    pub c_euv_field_legend {
        margin-bottom: var!(space-md);
        font-weight: var!(font-weight-medium);
    }

    // The legend of a set of fields, written at the size of a heading.
    pub c_euv_field_legend_legend {
        font-size: var!(font-base);
    }

    // The legend of a set of fields, written at the size of a caption.
    pub c_euv_field_legend_label {
        font-size: var!(font-sm);
    }

    // The group of fields. The reference stacks the rows of a group one
    // under the other and gives them a 28px gap.




    // A group whose rows are stacked one under the other.
    pub c_euv_field_group_vertical {
        flex-direction: "column";
    }

    // A group whose rows sit side by side.
    pub c_euv_field_group_horizontal {
        flex-direction: "row";
        align-items: "center";
    }

    // A group whose rows stack until the group is wide enough to hold
    // them side by side.
    pub c_euv_field_group_responsive {
        flex-direction: "column";
        @media ((min-width: 768px)) {
            flex-direction: "row";
            align-items: "center";
        }
    }

    // The body of one field, below its label.




    // The caption of the control of one field.




    // The caption of a field that carries a row of its own.




    // The explanation of one field.
    pub c_euv_field_description {
        margin: "0px";
        color: var!(muted-foreground);
        font-size: var!(font-sm);
        font-weight: var!(font-weight-normal);
        line-height: "1.5";
    }

    // The report of what is wrong with one field.
    pub c_euv_field_error {
        color: var!(destructive);
        font-size: var!(font-sm);
        font-weight: var!(font-weight-normal);
    }

    // The rule that divides one part of a group of fields from the next.
    pub c_euv_field_separator {
        position: "relative";
        // The reference pulls the rule 8px into the rows above and
        // below it, so the rule sits between them instead of adding to
        // the space they already keep.
        margin-top: format!("calc(0px - {})", var!(space-sm));
        margin-bottom: format!("calc(0px - {})", var!(space-sm));
        height: "20px";
        font-size: var!(font-sm);
    }

    // The rule itself. It runs behind the text that sits in the middle
    // of it, so the text stays readable against the line.
    pub c_euv_field_separator_line {
        position: "absolute";
        top: "50%";
        left: "0px";
        right: "0px";
        border-top: format!("{} solid {}", var!(border-width), var!(border));
    }

    // The text that sits in the middle of the rule.
    pub c_euv_field_separator_content {
        position: "relative";
        display: "block";
        width: "fit-content";
        margin-left: "auto";
        margin-right: "auto";
        padding-left: var!(space-sm);
        padding-right: var!(space-sm);
        background: var!(background);
        color: var!(muted-foreground);
    }

    // ═══════════════════════════════════════════════════════════════════════════
    // Empty — the parts of an empty state.
    // ═══════════════════════════════════════════════════════════════════════════

    // The head of an empty state.
    pub c_euv_empty_header {
        display: "flex";
        max-width: "384px";
        flex-direction: "column";
        align-items: "center";
        gap: var!(space-sm);
        text-align: "center";
    }

    // The picture that marks an empty state.
    pub c_euv_empty_media {
        margin-bottom: var!(space-sm);
        display: "flex";
        flex-shrink: "0";
        align-items: "center";
        justify-content: "center";
    }

    // The picture that sits on the background as it is.
    pub c_euv_empty_media_default {
        flex-shrink: "0";
    }

    // The picture that sits in a rounded box.
    pub c_euv_empty_media_icon {
        width: "40px";
        height: "40px";
        background: var!(muted);
        color: var!(foreground);
        border-radius: var!(radius-lg);
    }

    // The headline of an empty state.
    pub c_euv_empty_title {
        font-size: var!(font-lg);
        font-weight: var!(font-weight-medium);
        letter-spacing: var!(letter-spacing-tight);
    }

    // The explanation of an empty state.
    pub c_euv_empty_description {
        color: var!(muted-foreground);
        font-size: var!(font-sm);
        line-height: "1.625";
    }

    // The actions of an empty state.




    // ═══════════════════════════════════════════════════════════════════════════
    // Message — the parts of one message.
    // ═══════════════════════════════════════════════════════════════════════════

    // The cluster of messages.




    // The head of one message.




    // The picture of the sender of one message.
    pub c_euv_message_avatar {
        display: "flex";
        width: "fit-content";
        flex-shrink: "0";
        align-items: "center";
        justify-content: "center";
        align-self: "flex-end";
        overflow: "hidden";
        border-radius: var!(radius-full);
        background: var!(muted);
    }

    // The body of one message.




    // The trailing actions of one message.




    // The surface the words of one message sit on.
    pub c_euv_message_bubble {
        display: "flex";
        width: "fit-content";
        max-width: "100%";
        min-width: "0px";
        flex-direction: "column";
    }

    // ═══════════════════════════════════════════════════════════════════════════
    // Kbd — the parts of a keyboard shortcut.
    // ═══════════════════════════════════════════════════════════════════════════

    // The group of keys of one shortcut.
    pub c_euv_kbd_group {
        display: "inline-flex";
        align-items: "center";
        gap: var!(space-xs);
    }
}

#[cfg(not(feature = "theme-shadcn"))]
class! {
    pub c_euv_field_set {
        display: "flex";
        flex-direction: "column";
        gap: var!(space-2xl);
    }

    pub c_euv_field_group {
        display: "flex";
        width: "100%";
        flex-direction: "column";
        gap: format!("calc({} + {})", var!(space-2xl), var!(space-xs));
    }

    pub c_euv_field_content {
        display: "flex";
        flex: "1 1 0%";
        flex-direction: "column";
        // The reference sets a 6px gap between the description and the
        // control; 6px sits between the 4px and 8px steps of the scale.
        gap: var!(space-xs-sm);
        line-height: "1.375";
    }

    pub c_euv_field_label {
        display: "flex";
        width: "fit-content";
        gap: var!(space-sm);
        line-height: "1.375";
    }

    pub c_euv_field_title {
        display: "flex";
        width: "fit-content";
        align-items: "center";
        gap: var!(space-sm);
        font-size: var!(font-sm);
        font-weight: var!(font-weight-medium);
        line-height: "1.375";
    }

    pub c_euv_empty_content {
        display: "flex";
        width: "100%";
        min-width: "0px";
        max-width: "384px";
        flex-direction: "column";
        align-items: "center";
        gap: var!(space-lg);
        text-align: "center";
        font-size: var!(font-sm);
    }

    pub c_euv_message_group {
        display: "flex";
        min-width: "0px";
        flex-direction: "column";
    }

    pub c_euv_message_header {
        display: "flex";
        max-width: "100%";
        min-width: "0px";
        align-items: "center";
    }

    pub c_euv_message_content {
        display: "flex";
        width: "100%";
        min-width: "0px";
        flex-direction: "column";
        overflow-wrap: "break-word";
    }

    pub c_euv_message_footer {
        display: "flex";
        max-width: "100%";
        min-width: "0px";
        align-items: "center";
    }
}

#[cfg(feature = "theme-shadcn")]
class! {
    pub c_euv_field_set {
        display: "flex";
        flex-direction: "column";
        gap: var!(space-2xl);

        gap: var!(space-lg);
    }

    pub c_euv_field_group {
        display: "flex";
        width: "100%";
        flex-direction: "column";
        gap: format!("calc({} + {})", var!(space-2xl), var!(space-xs));

        gap: var!(space-xl);
    }

    pub c_euv_field_content {
        display: "flex";
        flex: "1 1 0%";
        flex-direction: "column";
        // The reference sets a 6px gap between the description and the
        // control; 6px sits between the 4px and 8px steps of the scale.
        gap: var!(space-xs-sm);
        line-height: "1.375";

        gap: var!(space-2xs);
    }

    pub c_euv_field_label {
        display: "flex";
        width: "fit-content";
        gap: var!(space-sm);
        line-height: "1.375";

        align-items: "center";
    }

    pub c_euv_field_title {
        display: "flex";
        width: "fit-content";
        align-items: "center";
        gap: var!(space-sm);
        font-size: var!(font-sm);
        font-weight: var!(font-weight-medium);
        line-height: "1.375";

        align-items: "center";
    }

    pub c_euv_empty_content {
        display: "flex";
        width: "100%";
        min-width: "0px";
        max-width: "384px";
        flex-direction: "column";
        align-items: "center";
        gap: var!(space-lg);
        text-align: "center";
        font-size: var!(font-sm);

        gap: var!(space-sm);
        justify-content: "center";
    }

    pub c_euv_message_group {
        display: "flex";
        min-width: "0px";
        flex-direction: "column";

        gap: var!(space-sm);
    }

    pub c_euv_message_header {
        display: "flex";
        max-width: "100%";
        min-width: "0px";
        align-items: "center";

        color: var!(muted-foreground);
        font-weight: var!(font-weight-medium);
        padding-left: var!(space-md);
    }

    pub c_euv_message_content {
        display: "flex";
        width: "100%";
        min-width: "0px";
        flex-direction: "column";
        overflow-wrap: "break-word";

        gap: var!(space-sm-md);
    }

    pub c_euv_message_footer {
        display: "flex";
        max-width: "100%";
        min-width: "0px";
        align-items: "center";

        color: var!(muted-foreground);
        font-weight: var!(font-weight-medium);
        padding-left: var!(space-md);
    }
}