@nuxt/ui 3.0.0-alpha.4 → 3.0.0-alpha.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.
- package/README.md +6 -4
- package/dist/module.d.mts +19 -5
- package/dist/module.d.ts +19 -5
- package/dist/module.json +2 -1
- package/dist/module.mjs +359 -312
- package/dist/runtime/components/Alert.vue +2 -2
- package/dist/runtime/components/Breadcrumb.vue +2 -2
- package/dist/runtime/components/Button.vue +2 -1
- package/dist/runtime/components/Carousel.vue +306 -0
- package/dist/runtime/components/CommandPalette.vue +2 -2
- package/dist/runtime/components/ContextMenu.vue +2 -2
- package/dist/runtime/components/DropdownMenu.vue +2 -2
- package/dist/runtime/components/Form.vue +4 -2
- package/dist/runtime/components/Modal.vue +2 -2
- package/dist/runtime/components/NavigationMenu.vue +3 -3
- package/dist/runtime/components/Pagination.vue +2 -2
- package/dist/runtime/components/Slideover.vue +2 -2
- package/dist/runtime/components/Toast.vue +2 -2
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/plugins/colors.js +12 -8
- package/dist/runtime/types/form.d.ts +2 -1
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/utils/form.d.ts +4 -1
- package/dist/runtime/utils/form.js +11 -1
- package/package.json +22 -9
package/dist/module.mjs
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { defuFn, defu } from 'defu';
|
|
2
|
-
import { addTemplate, addTypeTemplate, defineNuxtModule, createResolver, addVitePlugin,
|
|
2
|
+
import { addTemplate, addTypeTemplate, defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
|
|
3
3
|
import 'node:url';
|
|
4
4
|
import { kebabCase } from 'scule';
|
|
5
|
+
import { pick } from '../dist/runtime/utils/index.js';
|
|
5
6
|
|
|
6
7
|
const accordion = {
|
|
7
8
|
slots: {
|
|
8
9
|
root: "w-full",
|
|
9
|
-
item: "border-b border-
|
|
10
|
+
item: "border-b border-[--ui-border] last:border-b-0",
|
|
10
11
|
header: "flex",
|
|
11
|
-
trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-
|
|
12
|
+
trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-[--ui-primary] min-w-0",
|
|
12
13
|
content: "data-[state=open]:animate-[accordion-down_200ms_ease-out] data-[state=closed]:animate-[accordion-up_200ms_ease-out] overflow-hidden focus:outline-none",
|
|
13
14
|
body: "text-sm pb-3.5",
|
|
14
15
|
leadingIcon: "shrink-0 size-5",
|
|
15
16
|
trailingIcon: "shrink-0 size-5 ms-auto group-data-[state=open]:rotate-180 transition-transform duration-200",
|
|
16
|
-
label: "
|
|
17
|
+
label: "text-left break-words"
|
|
17
18
|
},
|
|
18
19
|
variants: {
|
|
19
20
|
disabled: {
|
|
@@ -26,7 +27,7 @@ const accordion = {
|
|
|
26
27
|
|
|
27
28
|
const alert = (options) => ({
|
|
28
29
|
slots: {
|
|
29
|
-
root: "relative overflow-hidden w-full rounded-
|
|
30
|
+
root: "relative overflow-hidden w-full rounded-[calc(var(--ui-radius)*2)] p-4 flex gap-2.5",
|
|
30
31
|
wrapper: "min-w-0 flex-1 flex flex-col gap-1",
|
|
31
32
|
title: "text-sm font-medium",
|
|
32
33
|
description: "text-sm opacity-90",
|
|
@@ -39,7 +40,7 @@ const alert = (options) => ({
|
|
|
39
40
|
variants: {
|
|
40
41
|
color: {
|
|
41
42
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
42
|
-
|
|
43
|
+
neutral: ""
|
|
43
44
|
},
|
|
44
45
|
variant: {
|
|
45
46
|
solid: "",
|
|
@@ -62,63 +63,63 @@ const alert = (options) => ({
|
|
|
62
63
|
color,
|
|
63
64
|
variant: "solid",
|
|
64
65
|
class: {
|
|
65
|
-
root: `bg
|
|
66
|
+
root: `bg-[--ui-${color}] text-[--ui-bg]`
|
|
66
67
|
}
|
|
67
68
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
68
69
|
color,
|
|
69
70
|
variant: "outline",
|
|
70
71
|
class: {
|
|
71
|
-
root: `text
|
|
72
|
+
root: `text-[--ui-${color}] ring ring-inset ring-[--ui-${color}]/25`
|
|
72
73
|
}
|
|
73
74
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
74
75
|
color,
|
|
75
76
|
variant: "soft",
|
|
76
77
|
class: {
|
|
77
|
-
root: `bg
|
|
78
|
+
root: `bg-[--ui-${color}]/10 text-[--ui-${color}]`
|
|
78
79
|
}
|
|
79
80
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
80
81
|
color,
|
|
81
82
|
variant: "subtle",
|
|
82
83
|
class: {
|
|
83
|
-
root: `bg
|
|
84
|
+
root: `bg-[--ui-${color}]/10 text-[--ui-${color}] ring ring-inset ring-[--ui-${color}]/25`
|
|
84
85
|
}
|
|
85
86
|
})), {
|
|
86
|
-
color: "
|
|
87
|
+
color: "neutral",
|
|
87
88
|
variant: "solid",
|
|
88
89
|
class: {
|
|
89
|
-
root: "text-
|
|
90
|
+
root: "text-[--ui-bg] bg-[--ui-bg-inverted]"
|
|
90
91
|
}
|
|
91
92
|
}, {
|
|
92
|
-
color: "
|
|
93
|
+
color: "neutral",
|
|
93
94
|
variant: "outline",
|
|
94
95
|
class: {
|
|
95
|
-
root: "text-
|
|
96
|
+
root: "text-[--ui-text-highlighted] bg-[--ui-bg] ring ring-inset ring-[--ui-border]"
|
|
96
97
|
}
|
|
97
98
|
}, {
|
|
98
|
-
color: "
|
|
99
|
+
color: "neutral",
|
|
99
100
|
variant: "soft",
|
|
100
101
|
class: {
|
|
101
|
-
root: "text-
|
|
102
|
+
root: "text-[--ui-text-highlighted] bg-[--ui-bg-elevated]/50"
|
|
102
103
|
}
|
|
103
104
|
}, {
|
|
104
|
-
color: "
|
|
105
|
+
color: "neutral",
|
|
105
106
|
variant: "subtle",
|
|
106
107
|
class: {
|
|
107
|
-
root: "text-
|
|
108
|
+
root: "text-[--ui-text-highlighted] bg-[--ui-bg-elevated]/50 ring ring-inset ring-[--ui-border-accented]"
|
|
108
109
|
}
|
|
109
110
|
}],
|
|
110
111
|
defaultVariants: {
|
|
111
112
|
color: "primary",
|
|
112
|
-
variant: "
|
|
113
|
+
variant: "solid"
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
116
|
|
|
116
117
|
const avatar = {
|
|
117
118
|
slots: {
|
|
118
|
-
root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-
|
|
119
|
+
root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-[--ui-bg-elevated]",
|
|
119
120
|
image: "h-full w-full rounded-[inherit] object-cover",
|
|
120
|
-
fallback: "font-medium leading-none text-
|
|
121
|
-
icon: "text-
|
|
121
|
+
fallback: "font-medium leading-none text-[--ui-text-muted] truncate",
|
|
122
|
+
icon: "text-[--ui-text-muted] shrink-0"
|
|
122
123
|
},
|
|
123
124
|
variants: {
|
|
124
125
|
size: {
|
|
@@ -159,7 +160,7 @@ const avatar = {
|
|
|
159
160
|
const avatarGroup = {
|
|
160
161
|
slots: {
|
|
161
162
|
root: "inline-flex flex-row-reverse justify-end",
|
|
162
|
-
base: "relative rounded-full ring-
|
|
163
|
+
base: "relative rounded-full ring-[--ui-bg] first:me-0"
|
|
163
164
|
},
|
|
164
165
|
variants: {
|
|
165
166
|
size: {
|
|
@@ -198,11 +199,11 @@ const avatarGroup = {
|
|
|
198
199
|
};
|
|
199
200
|
|
|
200
201
|
const badge = (options) => ({
|
|
201
|
-
base: "rounded-
|
|
202
|
+
base: "rounded-[calc(var(--ui-radius)*1.5)] font-medium inline-flex items-center",
|
|
202
203
|
variants: {
|
|
203
204
|
color: {
|
|
204
205
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
205
|
-
|
|
206
|
+
neutral: ""
|
|
206
207
|
},
|
|
207
208
|
variant: {
|
|
208
209
|
solid: "",
|
|
@@ -219,35 +220,35 @@ const badge = (options) => ({
|
|
|
219
220
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
220
221
|
color,
|
|
221
222
|
variant: "solid",
|
|
222
|
-
class: `bg
|
|
223
|
+
class: `bg-[--ui-${color}] text-[--ui-bg]`
|
|
223
224
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
224
225
|
color,
|
|
225
226
|
variant: "outline",
|
|
226
|
-
class: `text
|
|
227
|
+
class: `text-[--ui-${color}] ring ring-inset ring-[--ui-${color}]/50`
|
|
227
228
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
228
229
|
color,
|
|
229
230
|
variant: "soft",
|
|
230
|
-
class: `bg
|
|
231
|
+
class: `bg-[--ui-${color}]/10 text-[--ui-${color}]`
|
|
231
232
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
232
233
|
color,
|
|
233
234
|
variant: "subtle",
|
|
234
|
-
class: `bg
|
|
235
|
+
class: `bg-[--ui-${color}]/10 text-[--ui-${color}] ring ring-inset ring-[--ui-${color}]/25`
|
|
235
236
|
})), {
|
|
236
|
-
color: "
|
|
237
|
+
color: "neutral",
|
|
237
238
|
variant: "solid",
|
|
238
|
-
class: "text-
|
|
239
|
+
class: "text-[--ui-bg] bg-[--ui-bg-inverted]"
|
|
239
240
|
}, {
|
|
240
|
-
color: "
|
|
241
|
+
color: "neutral",
|
|
241
242
|
variant: "outline",
|
|
242
|
-
class: "ring ring-inset ring-
|
|
243
|
+
class: "ring ring-inset ring-[--ui-border-accented] text-[--ui-text] bg-[--ui-bg]"
|
|
243
244
|
}, {
|
|
244
|
-
color: "
|
|
245
|
+
color: "neutral",
|
|
245
246
|
variant: "soft",
|
|
246
|
-
class: "text-
|
|
247
|
+
class: "text-[--ui-text] bg-[--ui-bg-elevated]"
|
|
247
248
|
}, {
|
|
248
|
-
color: "
|
|
249
|
+
color: "neutral",
|
|
249
250
|
variant: "subtle",
|
|
250
|
-
class: "ring ring-inset ring-
|
|
251
|
+
class: "ring ring-inset ring-[--ui-border-accented] text-[--ui-text] bg-[--ui-bg-elevated]"
|
|
251
252
|
}],
|
|
252
253
|
defaultVariants: {
|
|
253
254
|
color: "primary",
|
|
@@ -261,21 +262,21 @@ const breadcrumb = (options) => ({
|
|
|
261
262
|
root: "relative min-w-0",
|
|
262
263
|
list: "flex items-center gap-1.5",
|
|
263
264
|
item: "flex min-w-0",
|
|
264
|
-
link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-
|
|
265
|
+
link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-[--ui-primary]",
|
|
265
266
|
linkLeadingIcon: "shrink-0 size-5",
|
|
266
267
|
linkLeadingAvatar: "shrink-0",
|
|
267
268
|
linkLeadingAvatarSize: "2xs",
|
|
268
269
|
linkLabel: "truncate",
|
|
269
270
|
separator: "flex",
|
|
270
|
-
separatorIcon: "shrink-0 size-5 text-
|
|
271
|
+
separatorIcon: "shrink-0 size-5 text-[--ui-text-muted]"
|
|
271
272
|
},
|
|
272
273
|
variants: {
|
|
273
274
|
active: {
|
|
274
275
|
true: {
|
|
275
|
-
link: "text-
|
|
276
|
+
link: "text-[--ui-primary] font-semibold"
|
|
276
277
|
},
|
|
277
278
|
false: {
|
|
278
|
-
link: "text-
|
|
279
|
+
link: "text-[--ui-text-muted] font-medium"
|
|
279
280
|
}
|
|
280
281
|
},
|
|
281
282
|
disabled: {
|
|
@@ -292,7 +293,7 @@ const breadcrumb = (options) => ({
|
|
|
292
293
|
active: false,
|
|
293
294
|
to: true,
|
|
294
295
|
class: {
|
|
295
|
-
link: ["hover:text-
|
|
296
|
+
link: ["hover:text-[--ui-text]", options.theme.transitions && "transition-colors"]
|
|
296
297
|
}
|
|
297
298
|
}]
|
|
298
299
|
});
|
|
@@ -334,7 +335,7 @@ const buttonGroup = {
|
|
|
334
335
|
|
|
335
336
|
const button = (options) => ({
|
|
336
337
|
slots: {
|
|
337
|
-
base: ["rounded-
|
|
338
|
+
base: ["rounded-[calc(var(--ui-radius)*1.5)] font-medium inline-flex items-center focus:outline-none disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
338
339
|
label: "truncate",
|
|
339
340
|
leadingIcon: "shrink-0",
|
|
340
341
|
leadingAvatar: "shrink-0",
|
|
@@ -344,7 +345,7 @@ const button = (options) => ({
|
|
|
344
345
|
...buttonGroupVariant,
|
|
345
346
|
color: {
|
|
346
347
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
347
|
-
|
|
348
|
+
neutral: ""
|
|
348
349
|
},
|
|
349
350
|
variant: {
|
|
350
351
|
solid: "",
|
|
@@ -383,7 +384,7 @@ const button = (options) => ({
|
|
|
383
384
|
},
|
|
384
385
|
block: {
|
|
385
386
|
true: {
|
|
386
|
-
base: "w-full",
|
|
387
|
+
base: "w-full justify-center",
|
|
387
388
|
trailingIcon: "ms-auto"
|
|
388
389
|
}
|
|
389
390
|
},
|
|
@@ -403,51 +404,51 @@ const button = (options) => ({
|
|
|
403
404
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
404
405
|
color,
|
|
405
406
|
variant: "solid",
|
|
406
|
-
class: `text-
|
|
407
|
+
class: `text-[--ui-bg] bg-[--ui-${color}] hover:bg-[--ui-${color}]/75 disabled:bg-[--ui-${color}] aria-disabled:bg-[--ui-${color}] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[--ui-${color}]`
|
|
407
408
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
408
409
|
color,
|
|
409
410
|
variant: "outline",
|
|
410
|
-
class: `ring ring-inset ring
|
|
411
|
+
class: `ring ring-inset ring-[--ui-${color}]/50 text-[--ui-${color}] hover:bg-[--ui-${color}]/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-[--ui-${color}]`
|
|
411
412
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
412
413
|
color,
|
|
413
414
|
variant: "soft",
|
|
414
|
-
class: `text
|
|
415
|
+
class: `text-[--ui-${color}] bg-[--ui-${color}]/10 hover:bg-[--ui-${color}]/15 focus-visible:bg-[--ui-${color}]/15 disabled:bg-[--ui-${color}]/10 aria-disabled:bg-[--ui-${color}]/10`
|
|
415
416
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
416
417
|
color,
|
|
417
418
|
variant: "subtle",
|
|
418
|
-
class: `text
|
|
419
|
+
class: `text-[--ui-${color}] ring ring-inset ring-[--ui-${color}]/25 bg-[--ui-${color}]/10 hover:bg-[--ui-${color}]/15 disabled:bg-[--ui-${color}]/10 aria-disabled:bg-[--ui-${color}]/10 focus-visible:ring-2 focus-visible:ring-[--ui-${color}]`
|
|
419
420
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
420
421
|
color,
|
|
421
422
|
variant: "ghost",
|
|
422
|
-
class: `text
|
|
423
|
+
class: `text-[--ui-${color}] hover:bg-[--ui-${color}]/10 focus-visible:bg-[--ui-${color}]/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent`
|
|
423
424
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
424
425
|
color,
|
|
425
426
|
variant: "link",
|
|
426
|
-
class: `text-${color}
|
|
427
|
+
class: `text-[--ui-${color}] hover:text-[--ui-${color}] disabled:text-[--ui-${color}] aria-disabled:text-[--ui-${color}] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-${color}]`
|
|
427
428
|
})), {
|
|
428
|
-
color: "
|
|
429
|
+
color: "neutral",
|
|
429
430
|
variant: "solid",
|
|
430
|
-
class: "text-
|
|
431
|
+
class: "text-[--ui-bg] bg-[--ui-bg-inverted] hover:bg-[--ui-bg-inverted]/80 disabled:bg-[--ui-bg-inverted] aria-disabled:bg-[--ui-bg-inverted] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[--ui-border-inverted]"
|
|
431
432
|
}, {
|
|
432
|
-
color: "
|
|
433
|
+
color: "neutral",
|
|
433
434
|
variant: "outline",
|
|
434
|
-
class: "ring ring-inset ring-
|
|
435
|
+
class: "ring ring-inset ring-[--ui-border-accented] text-[--ui-text] bg-[--ui-bg] hover:bg-[--ui-bg-elevated] disabled:bg-[--ui-bg] aria-disabled:bg-[--ui-bg] focus-visible:ring-2 focus-visible:ring-[--ui-border-inverted]"
|
|
435
436
|
}, {
|
|
436
|
-
color: "
|
|
437
|
+
color: "neutral",
|
|
437
438
|
variant: "soft",
|
|
438
|
-
class: "text-
|
|
439
|
+
class: "text-[--ui-text] bg-[--ui-bg-elevated] hover:bg-[--ui-bg-accented]/75 focus-visible:bg-[--ui-bg-accented]/75 disabled:bg-[--ui-bg-elevated] aria-disabled:bg-[--ui-bg-elevated]"
|
|
439
440
|
}, {
|
|
440
|
-
color: "
|
|
441
|
+
color: "neutral",
|
|
441
442
|
variant: "subtle",
|
|
442
|
-
class: "ring ring-inset ring-
|
|
443
|
+
class: "ring ring-inset ring-[--ui-border-accented] text-[--ui-text] bg-[--ui-bg-elevated] hover:bg-[--ui-bg-accented]/75 disabled:bg-[--ui-bg-elevated] aria-disabled:bg-[--ui-bg-elevated] focus-visible:ring-2 focus-visible:ring-[--ui-border-inverted]"
|
|
443
444
|
}, {
|
|
444
|
-
color: "
|
|
445
|
+
color: "neutral",
|
|
445
446
|
variant: "ghost",
|
|
446
|
-
class: "text-
|
|
447
|
+
class: "text-[--ui-text] hover:bg-[--ui-bg-elevated] focus-visible:bg-[--ui-bg-elevated] hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent"
|
|
447
448
|
}, {
|
|
448
|
-
color: "
|
|
449
|
+
color: "neutral",
|
|
449
450
|
variant: "link",
|
|
450
|
-
class: "text-
|
|
451
|
+
class: "text-[--ui-text-muted] hover:text-[--ui-text] disabled:text-[--ui-text-muted] aria-disabled:text-[--ui-text-muted] focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-[--ui-border-inverted]"
|
|
451
452
|
}, {
|
|
452
453
|
size: "xs",
|
|
453
454
|
square: true,
|
|
@@ -491,27 +492,66 @@ const button = (options) => ({
|
|
|
491
492
|
|
|
492
493
|
const card = {
|
|
493
494
|
slots: {
|
|
494
|
-
root: "bg-
|
|
495
|
+
root: "bg-[--ui-bg] ring ring-[--ui-border] divide-y divide-[--ui-border] rounded-[calc(var(--ui-radius)*2)] shadow",
|
|
495
496
|
header: "p-4 sm:px-6",
|
|
496
497
|
body: "p-4 sm:p-6",
|
|
497
498
|
footer: "p-4 sm:px-6"
|
|
498
499
|
}
|
|
499
500
|
};
|
|
500
501
|
|
|
502
|
+
const carousel = (options) => ({
|
|
503
|
+
slots: {
|
|
504
|
+
root: "relative focus:outline-none",
|
|
505
|
+
viewport: "overflow-hidden",
|
|
506
|
+
container: "flex items-start",
|
|
507
|
+
item: "min-w-0 shrink-0 basis-full",
|
|
508
|
+
controls: "",
|
|
509
|
+
arrows: "",
|
|
510
|
+
prev: "absolute rounded-full",
|
|
511
|
+
next: "absolute rounded-full",
|
|
512
|
+
dots: "absolute inset-x-0 -bottom-7 flex flex-wrap items-center justify-center gap-3",
|
|
513
|
+
dot: ["cursor-pointer size-3 bg-[--ui-border-accented] rounded-full", options.theme.transitions && "transition"]
|
|
514
|
+
},
|
|
515
|
+
variants: {
|
|
516
|
+
orientation: {
|
|
517
|
+
vertical: {
|
|
518
|
+
container: "flex-col -mt-4",
|
|
519
|
+
item: "pt-4",
|
|
520
|
+
prev: "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
521
|
+
next: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90"
|
|
522
|
+
},
|
|
523
|
+
horizontal: {
|
|
524
|
+
container: "flex-row -ml-4",
|
|
525
|
+
item: "pl-4",
|
|
526
|
+
prev: "-left-12 top-1/2 -translate-y-1/2",
|
|
527
|
+
next: "-right-12 top-1/2 -translate-y-1/2"
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
active: {
|
|
531
|
+
true: {
|
|
532
|
+
dot: "bg-[--ui-border-inverted]"
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
defaultVariants: {
|
|
537
|
+
orientation: "horizontal"
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
|
|
501
541
|
const checkbox = (options) => ({
|
|
502
542
|
slots: {
|
|
503
543
|
root: "relative flex items-start",
|
|
504
|
-
base: "shrink-0 flex items-center justify-center rounded
|
|
544
|
+
base: "shrink-0 flex items-center justify-center rounded-[--ui-radius] text-[--ui-bg] ring ring-inset ring-[--ui-border-accented] focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
505
545
|
container: "flex items-center",
|
|
506
546
|
wrapper: "ms-2",
|
|
507
547
|
icon: "shrink-0 size-full",
|
|
508
|
-
label: "block font-medium text-
|
|
509
|
-
description: "text-
|
|
548
|
+
label: "block font-medium text-[--ui-text]",
|
|
549
|
+
description: "text-[--ui-text-muted]"
|
|
510
550
|
},
|
|
511
551
|
variants: {
|
|
512
552
|
color: {
|
|
513
|
-
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `focus-visible:outline
|
|
514
|
-
|
|
553
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `focus-visible:outline-[--ui-${color}]`])),
|
|
554
|
+
neutral: "focus-visible:outline-[--ui-border-inverted]"
|
|
515
555
|
},
|
|
516
556
|
size: {
|
|
517
557
|
xs: {
|
|
@@ -542,7 +582,7 @@ const checkbox = (options) => ({
|
|
|
542
582
|
},
|
|
543
583
|
required: {
|
|
544
584
|
true: {
|
|
545
|
-
label: "after:content-['*'] after:ms-0.5 after:text-
|
|
585
|
+
label: "after:content-['*'] after:ms-0.5 after:text-[--ui-error]"
|
|
546
586
|
}
|
|
547
587
|
},
|
|
548
588
|
disabled: {
|
|
@@ -559,11 +599,11 @@ const checkbox = (options) => ({
|
|
|
559
599
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
560
600
|
color,
|
|
561
601
|
checked: true,
|
|
562
|
-
class: `ring-2 ring
|
|
602
|
+
class: `ring-2 ring-[--ui-${color}] bg-[--ui-${color}]`
|
|
563
603
|
})), {
|
|
564
|
-
color: "
|
|
604
|
+
color: "neutral",
|
|
565
605
|
checked: true,
|
|
566
|
-
class: "ring-2 ring-
|
|
606
|
+
class: "ring-2 ring-[--ui-border-inverted] bg-[--ui-bg-inverted]"
|
|
567
607
|
}],
|
|
568
608
|
defaultVariants: {
|
|
569
609
|
size: "md",
|
|
@@ -574,12 +614,12 @@ const checkbox = (options) => ({
|
|
|
574
614
|
const chip = (options) => ({
|
|
575
615
|
slots: {
|
|
576
616
|
root: "relative inline-flex items-center justify-center shrink-0",
|
|
577
|
-
base: "rounded-full ring ring-
|
|
617
|
+
base: "rounded-full ring ring-[--ui-bg] flex items-center justify-center text-[--ui-bg] font-medium whitespace-nowrap"
|
|
578
618
|
},
|
|
579
619
|
variants: {
|
|
580
620
|
color: {
|
|
581
|
-
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg
|
|
582
|
-
|
|
621
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg-[--ui-${color}]`])),
|
|
622
|
+
neutral: "bg-[--ui-text-muted]"
|
|
583
623
|
},
|
|
584
624
|
size: {
|
|
585
625
|
"3xs": "h-[4px] min-w-[4px] text-[4px]",
|
|
@@ -638,29 +678,29 @@ const collapsible = {
|
|
|
638
678
|
|
|
639
679
|
const commandPalette = (options) => ({
|
|
640
680
|
slots: {
|
|
641
|
-
root: "flex flex-col min-h-0 min-w-0 divide-y divide-
|
|
681
|
+
root: "flex flex-col min-h-0 min-w-0 divide-y divide-[--ui-border]",
|
|
642
682
|
input: "[&>input]:h-12",
|
|
643
683
|
close: "",
|
|
644
684
|
content: "relative overflow-hidden",
|
|
645
|
-
viewport: "divide-y divide-
|
|
685
|
+
viewport: "divide-y divide-[--ui-border] scroll-py-1",
|
|
646
686
|
group: "p-1 isolate",
|
|
647
687
|
empty: "py-6 text-center text-sm",
|
|
648
|
-
label: "px-2 py-1.5 text-xs font-semibold text-
|
|
649
|
-
item: ["group relative w-full flex items-center gap-2 px-2 py-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-
|
|
650
|
-
itemLeadingIcon: ["shrink-0 size-5 text-
|
|
688
|
+
label: "px-2 py-1.5 text-xs font-semibold text-[--ui-text-highlighted]",
|
|
689
|
+
item: ["group relative w-full flex items-center gap-2 px-2 py-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-[--ui-text] data-highlighted:text-[--ui-text-highlighted] data-highlighted:before:bg-[--ui-bg-elevated]/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
690
|
+
itemLeadingIcon: ["shrink-0 size-5 text-[--ui-text-dimmed] group-data-highlighted:text-[--ui-text]", options.theme.transitions && "transition-colors"],
|
|
651
691
|
itemLeadingAvatar: "shrink-0",
|
|
652
692
|
itemLeadingAvatarSize: "2xs",
|
|
653
693
|
itemLeadingChip: "shrink-0 size-5",
|
|
654
694
|
itemLeadingChipSize: "md",
|
|
655
695
|
itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
656
696
|
itemTrailingIcon: "shrink-0 size-5",
|
|
657
|
-
itemTrailingHighlightedIcon: "shrink-0 size-5 text-
|
|
697
|
+
itemTrailingHighlightedIcon: "shrink-0 size-5 text-[--ui-text-dimmed] hidden group-data-highlighted:inline-flex",
|
|
658
698
|
itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0 gap-0.5",
|
|
659
699
|
itemTrailingKbdsSize: "md",
|
|
660
700
|
itemLabel: "truncate space-x-1",
|
|
661
|
-
itemLabelBase: "text-
|
|
662
|
-
itemLabelPrefix: "text-
|
|
663
|
-
itemLabelSuffix: "text-
|
|
701
|
+
itemLabelBase: "text-[--ui-text-highlighted] [&>mark]:text-[--ui-bg] [&>mark]:bg-[--ui-primary]",
|
|
702
|
+
itemLabelPrefix: "text-[--ui-text]",
|
|
703
|
+
itemLabelSuffix: "text-[--ui-text-dimmed] [&>mark]:text-[--ui-bg] [&>mark]:bg-[--ui-primary]"
|
|
664
704
|
}
|
|
665
705
|
});
|
|
666
706
|
|
|
@@ -670,11 +710,11 @@ const container = {
|
|
|
670
710
|
|
|
671
711
|
const contextMenu = (options) => ({
|
|
672
712
|
slots: {
|
|
673
|
-
content: "min-w-32 bg-
|
|
713
|
+
content: "min-w-32 bg-[--ui-bg] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[--ui-border] divide-y divide-[--ui-border] overflow-y-auto scroll-py-1 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
674
714
|
group: "p-1 isolate",
|
|
675
|
-
label: "w-full flex items-center font-semibold text-
|
|
676
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
677
|
-
item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-
|
|
715
|
+
label: "w-full flex items-center font-semibold text-[--ui-text-highlighted]",
|
|
716
|
+
separator: "-mx-1 my-1 h-px bg-[--ui-border]",
|
|
717
|
+
item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
|
|
678
718
|
itemLeadingIcon: "shrink-0",
|
|
679
719
|
itemLeadingAvatar: "shrink-0",
|
|
680
720
|
itemLeadingAvatarSize: "",
|
|
@@ -683,17 +723,17 @@ const contextMenu = (options) => ({
|
|
|
683
723
|
itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
|
|
684
724
|
itemTrailingKbdsSize: "",
|
|
685
725
|
itemLabel: "truncate",
|
|
686
|
-
itemLabelExternalIcon: "size-3 align-top text-
|
|
726
|
+
itemLabelExternalIcon: "size-3 align-top text-[--ui-text-dimmed]"
|
|
687
727
|
},
|
|
688
728
|
variants: {
|
|
689
729
|
active: {
|
|
690
730
|
true: {
|
|
691
|
-
item: "text-
|
|
692
|
-
itemLeadingIcon: "text-
|
|
731
|
+
item: "text-[--ui-text-highlighted] before:bg-[--ui-bg-elevated]",
|
|
732
|
+
itemLeadingIcon: "text-[--ui-text]"
|
|
693
733
|
},
|
|
694
734
|
false: {
|
|
695
|
-
item: ["text-
|
|
696
|
-
itemLeadingIcon: ["text-
|
|
735
|
+
item: ["text-[--ui-text] data-highlighted:text-[--ui-text-highlighted] data-[state=open]:text-[--ui-text-highlighted] data-highlighted:before:bg-[--ui-bg-elevated]/50 data-[state=open]:before:bg-[--ui-bg-elevated]/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
736
|
+
itemLeadingIcon: ["text-[--ui-text-dimmed] group-data-highlighted:text-[--ui-text] group-data-[state=open]:text-[--ui-text]", options.theme.transitions && "transition-colors"]
|
|
697
737
|
}
|
|
698
738
|
},
|
|
699
739
|
size: {
|
|
@@ -751,20 +791,20 @@ const contextMenu = (options) => ({
|
|
|
751
791
|
|
|
752
792
|
const drawer = {
|
|
753
793
|
slots: {
|
|
754
|
-
overlay: "fixed inset-0 z-50 bg-
|
|
755
|
-
content: "fixed z-50 bg-
|
|
756
|
-
handle: "shrink-0 rounded-full bg-
|
|
794
|
+
overlay: "fixed inset-0 z-50 bg-[--ui-bg-elevated]/75",
|
|
795
|
+
content: "fixed z-50 bg-[--ui-bg] ring ring-[--ui-border] flex focus:outline-none",
|
|
796
|
+
handle: "shrink-0 rounded-full bg-[--ui-bg-accented]",
|
|
757
797
|
container: "w-full flex flex-col gap-4 p-4 overflow-y-auto",
|
|
758
798
|
header: "",
|
|
759
|
-
title: "text-
|
|
760
|
-
description: "mt-1 text-
|
|
799
|
+
title: "text-[--ui-text-highlighted] font-semibold",
|
|
800
|
+
description: "mt-1 text-[--ui-text-muted] text-sm",
|
|
761
801
|
body: "flex-1",
|
|
762
802
|
footer: "flex flex-col gap-1.5"
|
|
763
803
|
},
|
|
764
804
|
variants: {
|
|
765
805
|
direction: {
|
|
766
806
|
top: {
|
|
767
|
-
content: "top-0 mb-24 flex-col-reverse rounded-b-
|
|
807
|
+
content: "top-0 mb-24 flex-col-reverse rounded-b-[calc(var(--ui-radius)*2)]",
|
|
768
808
|
handle: "mb-4"
|
|
769
809
|
},
|
|
770
810
|
right: {
|
|
@@ -772,7 +812,7 @@ const drawer = {
|
|
|
772
812
|
handle: "ml-4"
|
|
773
813
|
},
|
|
774
814
|
bottom: {
|
|
775
|
-
content: "bottom-0 mt-24 flex-col rounded-t-
|
|
815
|
+
content: "bottom-0 mt-24 flex-col rounded-t-[calc(var(--ui-radius)*2)]",
|
|
776
816
|
handle: "mt-4"
|
|
777
817
|
},
|
|
778
818
|
left: {
|
|
@@ -790,7 +830,7 @@ const drawer = {
|
|
|
790
830
|
}, {
|
|
791
831
|
direction: ["right", "left"],
|
|
792
832
|
class: {
|
|
793
|
-
content: "inset-y-4 w-auto max-w-[calc(100%-2rem)] rounded-
|
|
833
|
+
content: "inset-y-4 w-auto max-w-[calc(100%-2rem)] rounded-[calc(var(--ui-radius)*2)] after:hidden",
|
|
794
834
|
handle: "h-12 w-1.5 mt-auto mb-auto"
|
|
795
835
|
}
|
|
796
836
|
}]
|
|
@@ -798,12 +838,12 @@ const drawer = {
|
|
|
798
838
|
|
|
799
839
|
const dropdownMenu = (options) => ({
|
|
800
840
|
slots: {
|
|
801
|
-
content: "min-w-32 bg-
|
|
802
|
-
arrow: "fill-
|
|
841
|
+
content: "min-w-32 bg-[--ui-bg] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[--ui-border] divide-y divide-[--ui-border] overflow-y-auto scroll-py-1 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
842
|
+
arrow: "fill-[--ui-border]",
|
|
803
843
|
group: "p-1 isolate",
|
|
804
|
-
label: "w-full flex items-center font-semibold text-
|
|
805
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
806
|
-
item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-
|
|
844
|
+
label: "w-full flex items-center font-semibold text-[--ui-text-highlighted]",
|
|
845
|
+
separator: "-mx-1 my-1 h-px bg-[--ui-border]",
|
|
846
|
+
item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
|
|
807
847
|
itemLeadingIcon: "shrink-0",
|
|
808
848
|
itemLeadingAvatar: "shrink-0",
|
|
809
849
|
itemLeadingAvatarSize: "",
|
|
@@ -812,17 +852,17 @@ const dropdownMenu = (options) => ({
|
|
|
812
852
|
itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
|
|
813
853
|
itemTrailingKbdsSize: "",
|
|
814
854
|
itemLabel: "truncate",
|
|
815
|
-
itemLabelExternalIcon: "size-3 align-top text-
|
|
855
|
+
itemLabelExternalIcon: "size-3 align-top text-[--ui-text-dimmed]"
|
|
816
856
|
},
|
|
817
857
|
variants: {
|
|
818
858
|
active: {
|
|
819
859
|
true: {
|
|
820
|
-
item: "text-
|
|
821
|
-
itemLeadingIcon: "text-
|
|
860
|
+
item: "text-[--ui-text-highlighted] before:bg-[--ui-bg-elevated]",
|
|
861
|
+
itemLeadingIcon: "text-[--ui-text]"
|
|
822
862
|
},
|
|
823
863
|
false: {
|
|
824
|
-
item: ["text-
|
|
825
|
-
itemLeadingIcon: ["text-
|
|
864
|
+
item: ["text-[--ui-text] data-highlighted:text-[--ui-text-highlighted] data-[state=open]:text-[--ui-text-highlighted] data-highlighted:before:bg-[--ui-bg-elevated]/50 data-[state=open]:before:bg-[--ui-bg-elevated]/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
865
|
+
itemLeadingIcon: ["text-[--ui-text-dimmed] group-data-highlighted:text-[--ui-text] group-data-[state=open]:text-[--ui-text]", options.theme.transitions && "transition-colors"]
|
|
826
866
|
}
|
|
827
867
|
},
|
|
828
868
|
size: {
|
|
@@ -887,12 +927,12 @@ const formField = {
|
|
|
887
927
|
root: "",
|
|
888
928
|
wrapper: "",
|
|
889
929
|
labelWrapper: "flex content-center items-center justify-between",
|
|
890
|
-
label: "block font-medium text-
|
|
930
|
+
label: "block font-medium text-[--ui-text]",
|
|
891
931
|
container: "mt-1 relative",
|
|
892
|
-
description: "text-
|
|
893
|
-
error: "mt-2 text-
|
|
894
|
-
hint: "text-
|
|
895
|
-
help: "mt-2 text-
|
|
932
|
+
description: "text-[--ui-text-muted]",
|
|
933
|
+
error: "mt-2 text-[--ui-error]",
|
|
934
|
+
hint: "text-[--ui-text-muted]",
|
|
935
|
+
help: "mt-2 text-[--ui-text-muted]"
|
|
896
936
|
},
|
|
897
937
|
variants: {
|
|
898
938
|
size: {
|
|
@@ -904,7 +944,7 @@ const formField = {
|
|
|
904
944
|
},
|
|
905
945
|
required: {
|
|
906
946
|
true: {
|
|
907
|
-
label: `after:content-['*'] after:ms-0.5 after:text-
|
|
947
|
+
label: `after:content-['*'] after:ms-0.5 after:text-[--ui-error]`
|
|
908
948
|
}
|
|
909
949
|
}
|
|
910
950
|
},
|
|
@@ -916,12 +956,12 @@ const formField = {
|
|
|
916
956
|
const input = (options) => ({
|
|
917
957
|
slots: {
|
|
918
958
|
root: "relative inline-flex items-center",
|
|
919
|
-
base: ["w-full rounded-
|
|
959
|
+
base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder-[--ui-text-dimmed] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
920
960
|
leading: "absolute inset-y-0 start-0 flex items-center",
|
|
921
|
-
leadingIcon: "shrink-0 text-
|
|
961
|
+
leadingIcon: "shrink-0 text-[--ui-text-dimmed]",
|
|
922
962
|
leadingAvatar: "shrink-0",
|
|
923
963
|
trailing: "absolute inset-y-0 end-0 flex items-center",
|
|
924
|
-
trailingIcon: "shrink-0 text-
|
|
964
|
+
trailingIcon: "shrink-0 text-[--ui-text-dimmed]"
|
|
925
965
|
},
|
|
926
966
|
variants: {
|
|
927
967
|
...buttonGroupVariantWithRoot,
|
|
@@ -963,15 +1003,15 @@ const input = (options) => ({
|
|
|
963
1003
|
}
|
|
964
1004
|
},
|
|
965
1005
|
variant: {
|
|
966
|
-
outline: "text-
|
|
967
|
-
soft: "text-
|
|
968
|
-
subtle: "text-
|
|
969
|
-
ghost: "text-
|
|
970
|
-
none: "text-
|
|
1006
|
+
outline: "text-[--ui-text-highlighted] bg-[--ui-bg] ring ring-inset ring-[--ui-border-accented]",
|
|
1007
|
+
soft: "text-[--ui-text-highlighted] bg-[--ui-bg-elevated]/50 hover:bg-[--ui-bg-elevated] focus:bg-[--ui-bg-elevated] disabled:bg-[--ui-bg-elevated]/50",
|
|
1008
|
+
subtle: "text-[--ui-text-highlighted] bg-[--ui-bg-elevated] ring ring-inset ring-[--ui-border-accented]",
|
|
1009
|
+
ghost: "text-[--ui-text-highlighted] hover:bg-[--ui-bg-elevated] focus:bg-[--ui-bg-elevated] disabled:bg-transparent dark:disabled:bg-transparent",
|
|
1010
|
+
none: "text-[--ui-text-highlighted]"
|
|
971
1011
|
},
|
|
972
1012
|
color: {
|
|
973
1013
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
974
|
-
|
|
1014
|
+
neutral: ""
|
|
975
1015
|
},
|
|
976
1016
|
leading: {
|
|
977
1017
|
true: ""
|
|
@@ -986,25 +1026,25 @@ const input = (options) => ({
|
|
|
986
1026
|
true: ""
|
|
987
1027
|
},
|
|
988
1028
|
type: {
|
|
989
|
-
file: "file:mr-1.5 file:font-medium file:text-
|
|
1029
|
+
file: "file:mr-1.5 file:font-medium file:text-[--ui-text-muted] file:outline-none"
|
|
990
1030
|
}
|
|
991
1031
|
},
|
|
992
1032
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
993
1033
|
color,
|
|
994
1034
|
variant: ["outline", "subtle"],
|
|
995
|
-
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring
|
|
1035
|
+
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-${color}]`
|
|
996
1036
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
997
1037
|
color,
|
|
998
1038
|
highlight: true,
|
|
999
|
-
class: `ring ring-inset ring
|
|
1039
|
+
class: `ring ring-inset ring-[--ui-${color}]`
|
|
1000
1040
|
})), {
|
|
1001
|
-
color: "
|
|
1041
|
+
color: "neutral",
|
|
1002
1042
|
variant: ["outline", "subtle"],
|
|
1003
|
-
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
1043
|
+
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-border-inverted]"
|
|
1004
1044
|
}, {
|
|
1005
|
-
color: "
|
|
1045
|
+
color: "neutral",
|
|
1006
1046
|
highlight: true,
|
|
1007
|
-
class: "ring ring-inset ring-
|
|
1047
|
+
class: "ring ring-inset ring-[--ui-border-inverted]"
|
|
1008
1048
|
}, {
|
|
1009
1049
|
leading: true,
|
|
1010
1050
|
size: "xs",
|
|
@@ -1069,17 +1109,17 @@ const input = (options) => ({
|
|
|
1069
1109
|
const inputMenu = (options) => {
|
|
1070
1110
|
return defuFn({
|
|
1071
1111
|
slots: {
|
|
1072
|
-
base: () => ["rounded-
|
|
1112
|
+
base: () => ["rounded-[calc(var(--ui-radius)*1.5)]", options.theme.transitions && "transition-colors"],
|
|
1073
1113
|
trailing: "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
|
|
1074
|
-
arrow: "fill-
|
|
1075
|
-
content: "max-h-60 w-[--radix-popper-anchor-width] bg-
|
|
1076
|
-
viewport: "divide-y divide-
|
|
1114
|
+
arrow: "fill-[--ui-border]",
|
|
1115
|
+
content: "max-h-60 w-[--radix-popper-anchor-width] bg-[--ui-bg] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[--ui-border] overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
1116
|
+
viewport: "divide-y divide-[--ui-border] scroll-py-1",
|
|
1077
1117
|
group: "p-1 isolate",
|
|
1078
|
-
empty: "py-2 text-center text-sm text-
|
|
1079
|
-
label: "font-semibold text-
|
|
1080
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
1081
|
-
item: ["group relative w-full flex items-center gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-
|
|
1082
|
-
itemLeadingIcon: ["shrink-0 text-
|
|
1118
|
+
empty: "py-2 text-center text-sm text-[--ui-text-muted]",
|
|
1119
|
+
label: "font-semibold text-[--ui-text-highlighted]",
|
|
1120
|
+
separator: "-mx-1 my-1 h-px bg-[--ui-border]",
|
|
1121
|
+
item: ["group relative w-full flex items-center gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-[--ui-text] data-highlighted:text-[--ui-text-highlighted] data-highlighted:before:bg-[--ui-bg-elevated]/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1122
|
+
itemLeadingIcon: ["shrink-0 text-[--ui-text-dimmed] group-data-highlighted:text-[--ui-text]", options.theme.transitions && "transition-colors"],
|
|
1083
1123
|
itemLeadingAvatar: "shrink-0",
|
|
1084
1124
|
itemLeadingAvatarSize: "",
|
|
1085
1125
|
itemLeadingChip: "shrink-0",
|
|
@@ -1087,11 +1127,11 @@ const inputMenu = (options) => {
|
|
|
1087
1127
|
itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
1088
1128
|
itemTrailingIcon: "shrink-0",
|
|
1089
1129
|
itemLabel: "truncate",
|
|
1090
|
-
tagsItem: "px-1.5 py-0.5 rounded font-medium inline-flex items-center gap-0.5 ring ring-inset ring-
|
|
1130
|
+
tagsItem: "px-1.5 py-0.5 rounded-[--ui-radius] font-medium inline-flex items-center gap-0.5 ring ring-inset ring-[--ui-border-accented] bg-[--ui-bg-elevated] text-[--ui-text] data-disabled:cursor-not-allowed data-disabled:opacity-75",
|
|
1091
1131
|
tagsItemText: "truncate",
|
|
1092
|
-
tagsItemDelete: ["inline-flex items-center rounded-
|
|
1132
|
+
tagsItemDelete: ["inline-flex items-center rounded-[calc(var(--ui-radius)/2)] text-[--ui-text-dimmed] hover:text-[--ui-text] hover:bg-[--ui-bg-accented]/75 disabled:pointer-events-none", options.theme.transitions && "transition-colors"],
|
|
1093
1133
|
tagsItemDeleteIcon: "",
|
|
1094
|
-
tagsInput: "border-0 placeholder-
|
|
1134
|
+
tagsInput: "border-0 placeholder-[--ui-text-dimmed] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
|
|
1095
1135
|
},
|
|
1096
1136
|
variants: {
|
|
1097
1137
|
multiple: {
|
|
@@ -1100,7 +1140,7 @@ const inputMenu = (options) => {
|
|
|
1100
1140
|
base: ""
|
|
1101
1141
|
},
|
|
1102
1142
|
false: {
|
|
1103
|
-
base: "w-full rounded-
|
|
1143
|
+
base: "w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
|
|
1104
1144
|
}
|
|
1105
1145
|
},
|
|
1106
1146
|
size: {
|
|
@@ -1165,23 +1205,23 @@ const inputMenu = (options) => {
|
|
|
1165
1205
|
color,
|
|
1166
1206
|
multiple: true,
|
|
1167
1207
|
variant: ["outline", "subtle"],
|
|
1168
|
-
class: `has-[:focus-visible]:ring-2 has-[:focus-visible]:ring
|
|
1208
|
+
class: `has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[--${color}]`
|
|
1169
1209
|
})), {
|
|
1170
|
-
color: "
|
|
1210
|
+
color: "neutral",
|
|
1171
1211
|
multiple: true,
|
|
1172
1212
|
variant: ["outline", "subtle"],
|
|
1173
|
-
class: "has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-
|
|
1213
|
+
class: "has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[--ui-border-inverted]"
|
|
1174
1214
|
}]
|
|
1175
1215
|
}, input(options));
|
|
1176
1216
|
};
|
|
1177
1217
|
|
|
1178
1218
|
const kbd = {
|
|
1179
|
-
base: "inline-flex items-center justify-center px-1 rounded font-medium font-sans",
|
|
1219
|
+
base: "inline-flex items-center justify-center px-1 rounded-[--ui-radius] font-medium font-sans",
|
|
1180
1220
|
variants: {
|
|
1181
1221
|
variant: {
|
|
1182
|
-
solid: "bg-
|
|
1183
|
-
outline: "bg-
|
|
1184
|
-
subtle: "bg-
|
|
1222
|
+
solid: "bg-[--ui-bg-inverted] text-[--ui-bg]",
|
|
1223
|
+
outline: "bg-[--ui-bg] text-[--ui-text-highlighted] ring ring-inset ring-[--ui-border-accented]",
|
|
1224
|
+
subtle: "bg-[--ui-bg-elevated] text-[--ui-text] ring ring-inset ring-[--ui-border-accented]"
|
|
1185
1225
|
},
|
|
1186
1226
|
size: {
|
|
1187
1227
|
sm: "h-4 min-w-[16px] text-[10px]",
|
|
@@ -1196,11 +1236,11 @@ const kbd = {
|
|
|
1196
1236
|
};
|
|
1197
1237
|
|
|
1198
1238
|
const link = (options) => ({
|
|
1199
|
-
base: "focus-visible:outline-
|
|
1239
|
+
base: "focus-visible:outline-[--ui-primary]",
|
|
1200
1240
|
variants: {
|
|
1201
1241
|
active: {
|
|
1202
|
-
true: "text-
|
|
1203
|
-
false: ["text-
|
|
1242
|
+
true: "text-[--ui-primary]",
|
|
1243
|
+
false: ["text-[--ui-text-muted] hover:text-[--ui-text]", options.theme.transitions && "transition-colors"]
|
|
1204
1244
|
},
|
|
1205
1245
|
disabled: {
|
|
1206
1246
|
true: "cursor-not-allowed opacity-75"
|
|
@@ -1210,13 +1250,13 @@ const link = (options) => ({
|
|
|
1210
1250
|
|
|
1211
1251
|
const modal = {
|
|
1212
1252
|
slots: {
|
|
1213
|
-
overlay: "fixed inset-0 z-50 bg-
|
|
1214
|
-
content: "fixed z-50 w-full h-dvh bg-
|
|
1253
|
+
overlay: "fixed inset-0 z-50 bg-[--ui-bg-elevated]/75",
|
|
1254
|
+
content: "fixed z-50 w-full h-dvh bg-[--ui-bg] divide-y divide-[--ui-border] flex flex-col focus:outline-none",
|
|
1215
1255
|
header: "px-4 py-5 sm:px-6",
|
|
1216
1256
|
body: "flex-1 p-4 sm:p-6",
|
|
1217
1257
|
footer: "flex items-center gap-1.5 p-4 sm:px-6",
|
|
1218
|
-
title: "text-
|
|
1219
|
-
description: "mt-1 text-
|
|
1258
|
+
title: "text-[--ui-text-highlighted] font-semibold",
|
|
1259
|
+
description: "mt-1 text-[--ui-text-muted] text-sm",
|
|
1220
1260
|
close: "absolute top-4 right-4"
|
|
1221
1261
|
},
|
|
1222
1262
|
variants: {
|
|
@@ -1231,7 +1271,7 @@ const modal = {
|
|
|
1231
1271
|
content: "inset-0"
|
|
1232
1272
|
},
|
|
1233
1273
|
false: {
|
|
1234
|
-
content: "top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] sm:max-w-lg sm:h-auto sm:my-8 sm:rounded-
|
|
1274
|
+
content: "top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] sm:max-w-lg sm:h-auto sm:my-8 sm:rounded-[calc(var(--ui-radius)*2)] sm:shadow-lg sm:ring ring-[--ui-border]"
|
|
1235
1275
|
}
|
|
1236
1276
|
}
|
|
1237
1277
|
}
|
|
@@ -1242,7 +1282,7 @@ const navigationMenu = (options) => ({
|
|
|
1242
1282
|
root: "relative flex gap-1.5",
|
|
1243
1283
|
list: "isolate min-w-0",
|
|
1244
1284
|
item: "min-w-0",
|
|
1245
|
-
link: "group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-
|
|
1285
|
+
link: "group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-[calc(var(--ui-radius)*1.5)] focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
|
|
1246
1286
|
linkLeadingIcon: "shrink-0 size-5",
|
|
1247
1287
|
linkLeadingAvatar: "shrink-0",
|
|
1248
1288
|
linkLeadingAvatarSize: "2xs",
|
|
@@ -1251,37 +1291,37 @@ const navigationMenu = (options) => ({
|
|
|
1251
1291
|
linkTrailingBadgeSize: "sm",
|
|
1252
1292
|
linkTrailingIcon: "size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",
|
|
1253
1293
|
linkLabel: "truncate",
|
|
1254
|
-
linkLabelExternalIcon: "size-3 align-top text-
|
|
1294
|
+
linkLabelExternalIcon: "size-3 align-top text-[--ui-text-dimmed]",
|
|
1255
1295
|
childList: "grid grid-cols-2 gap-2 p-2",
|
|
1256
1296
|
childItem: "",
|
|
1257
|
-
childLink: "group size-full px-3 py-2 rounded-
|
|
1297
|
+
childLink: "group size-full px-3 py-2 rounded-[calc(var(--ui-radius)*1.5)] flex items-start gap-2 text-left",
|
|
1258
1298
|
childLinkWrapper: "flex flex-col items-start",
|
|
1259
1299
|
childLinkIcon: "size-5 shrink-0",
|
|
1260
1300
|
childLinkLabel: "font-semibold text-sm relative inline-flex",
|
|
1261
|
-
childLinkLabelExternalIcon: "size-3 align-top text-
|
|
1262
|
-
childLinkDescription: "text-sm text-
|
|
1263
|
-
separator: "px-2 h-px bg-
|
|
1301
|
+
childLinkLabelExternalIcon: "size-3 align-top text-[--ui-text-dimmed]",
|
|
1302
|
+
childLinkDescription: "text-sm text-[--ui-text-muted]",
|
|
1303
|
+
separator: "px-2 h-px bg-[--ui-border]",
|
|
1264
1304
|
viewportWrapper: "absolute top-full inset-x-0 flex w-full",
|
|
1265
1305
|
// FIXME: add `sm:w-[var(--radix-navigation-menu-viewport-width)]` / `transition-[width,height]` / `origin-[top_center]` once position is based on trigger
|
|
1266
|
-
viewport: "relative overflow-hidden bg-
|
|
1306
|
+
viewport: "relative overflow-hidden bg-[--ui-bg] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[--ui-border] h-[--radix-navigation-menu-viewport-height] w-full data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
1267
1307
|
content: "absolute top-0 left-0 w-full data-[motion=from-start]:animate-[enter-from-left_200ms_ease] data-[motion=from-end]:animate-[enter-from-right_200ms_ease] data-[motion=to-start]:animate-[exit-to-left_200ms_ease] data-[motion=to-end]:animate-[exit-to-right_200ms_ease]",
|
|
1268
1308
|
indicator: "data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] bottom-0 z-[1] flex h-2.5 items-end justify-center overflow-hidden transition-transform duration-200 ease-out",
|
|
1269
|
-
arrow: "relative top-[50%] size-2.5 rotate-45 border border-
|
|
1309
|
+
arrow: "relative top-[50%] size-2.5 rotate-45 border border-[--ui-border] bg-[--ui-bg] z-[1] rounded-[calc(var(--ui-radius)/2)]"
|
|
1270
1310
|
},
|
|
1271
1311
|
variants: {
|
|
1272
1312
|
color: {
|
|
1273
1313
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1274
|
-
link: `focus-visible:before:ring
|
|
1275
|
-
childLink: `focus-visible:outline
|
|
1314
|
+
link: `focus-visible:before:ring-[--ui-${color}]`,
|
|
1315
|
+
childLink: `focus-visible:outline-[--ui-${color}]`
|
|
1276
1316
|
}])),
|
|
1277
|
-
|
|
1278
|
-
link: "focus-visible:before:ring-
|
|
1279
|
-
childLink: "focus-visible:outline-
|
|
1317
|
+
neutral: {
|
|
1318
|
+
link: "focus-visible:before:ring-[--ui-border-inverted]",
|
|
1319
|
+
childLink: "focus-visible:outline-[--ui-border-inverted]"
|
|
1280
1320
|
}
|
|
1281
1321
|
},
|
|
1282
1322
|
highlightColor: {
|
|
1283
1323
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
1284
|
-
|
|
1324
|
+
neutral: ""
|
|
1285
1325
|
},
|
|
1286
1326
|
variant: {
|
|
1287
1327
|
pill: "",
|
|
@@ -1301,14 +1341,14 @@ const navigationMenu = (options) => ({
|
|
|
1301
1341
|
},
|
|
1302
1342
|
active: {
|
|
1303
1343
|
true: {
|
|
1304
|
-
childLink: "bg-
|
|
1305
|
-
childLinkIcon: "text-
|
|
1344
|
+
childLink: "bg-[--ui-bg-elevated] text-[--ui-text-highlighted]",
|
|
1345
|
+
childLinkIcon: "text-[--ui-text]"
|
|
1306
1346
|
},
|
|
1307
1347
|
false: {
|
|
1308
|
-
link: "text-
|
|
1309
|
-
linkLeadingIcon: "text-
|
|
1310
|
-
childLink: ["hover:bg-
|
|
1311
|
-
childLinkIcon: ["text-
|
|
1348
|
+
link: "text-[--ui-text-muted]",
|
|
1349
|
+
linkLeadingIcon: "text-[--ui-text-dimmed]",
|
|
1350
|
+
childLink: ["hover:bg-[--ui-bg-elevated]/50 text-[--ui-text] hover:text-[--ui-text-highlighted]", options.theme.transitions && "transition-colors"],
|
|
1351
|
+
childLinkIcon: ["text-[--ui-text-dimmed] group-hover:text-[--ui-text]", options.theme.transitions && "transition-colors"]
|
|
1312
1352
|
}
|
|
1313
1353
|
},
|
|
1314
1354
|
disabled: {
|
|
@@ -1339,76 +1379,76 @@ const navigationMenu = (options) => ({
|
|
|
1339
1379
|
active: false,
|
|
1340
1380
|
variant: "pill",
|
|
1341
1381
|
class: {
|
|
1342
|
-
link: ["hover:text-
|
|
1343
|
-
linkLeadingIcon: ["group-hover:text-
|
|
1382
|
+
link: ["hover:text-[--ui-text-highlighted] hover:before:bg-[--ui-bg-elevated]/50 data-[state=open]:text-[--ui-text-highlighted] data-[state=open]:before:bg-[--ui-bg-elevated]/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1383
|
+
linkLeadingIcon: ["group-hover:text-[--ui-text] group-data-[state=open]:text-[--ui-text]", options.theme.transitions && "transition-colors"]
|
|
1344
1384
|
}
|
|
1345
1385
|
}, ...(options.theme.colors || []).map((color) => ({
|
|
1346
1386
|
color,
|
|
1347
1387
|
variant: "pill",
|
|
1348
1388
|
active: true,
|
|
1349
1389
|
class: {
|
|
1350
|
-
link: `text
|
|
1351
|
-
linkLeadingIcon: `text
|
|
1390
|
+
link: `text-[--ui-${color}]`,
|
|
1391
|
+
linkLeadingIcon: `text-[--ui-${color}]`
|
|
1352
1392
|
}
|
|
1353
1393
|
})), {
|
|
1354
|
-
color: "
|
|
1394
|
+
color: "neutral",
|
|
1355
1395
|
variant: "pill",
|
|
1356
1396
|
active: true,
|
|
1357
1397
|
class: {
|
|
1358
|
-
link: "text-
|
|
1359
|
-
linkLeadingIcon: "text-
|
|
1398
|
+
link: "text-[--ui-text-highlighted]",
|
|
1399
|
+
linkLeadingIcon: "text-[--ui-text-highlighted]"
|
|
1360
1400
|
}
|
|
1361
1401
|
}, {
|
|
1362
1402
|
variant: "pill",
|
|
1363
1403
|
active: true,
|
|
1364
1404
|
highlight: false,
|
|
1365
1405
|
class: {
|
|
1366
|
-
link: "before:bg-
|
|
1406
|
+
link: "before:bg-[--ui-bg-elevated]"
|
|
1367
1407
|
}
|
|
1368
1408
|
}, {
|
|
1369
1409
|
variant: "pill",
|
|
1370
1410
|
active: true,
|
|
1371
1411
|
highlight: true,
|
|
1372
1412
|
class: {
|
|
1373
|
-
link: ["hover:before:bg-
|
|
1413
|
+
link: ["hover:before:bg-[--ui-bg-elevated]/50", options.theme.transitions && "before:transition-colors"]
|
|
1374
1414
|
}
|
|
1375
1415
|
}, {
|
|
1376
1416
|
disabled: false,
|
|
1377
1417
|
active: false,
|
|
1378
1418
|
variant: "link",
|
|
1379
1419
|
class: {
|
|
1380
|
-
link: ["hover:text-
|
|
1381
|
-
linkLeadingIcon: ["group-hover:text-
|
|
1420
|
+
link: ["hover:text-[--ui-text-highlighted] data-[state=open]:text-[--ui-text-highlighted]", options.theme.transitions && "transition-colors"],
|
|
1421
|
+
linkLeadingIcon: ["group-hover:text-[--ui-text] group-data-[state=open]:text-[--ui-text]", options.theme.transitions && "transition-colors"]
|
|
1382
1422
|
}
|
|
1383
1423
|
}, ...(options.theme.colors || []).map((color) => ({
|
|
1384
1424
|
color,
|
|
1385
1425
|
variant: "link",
|
|
1386
1426
|
active: true,
|
|
1387
1427
|
class: {
|
|
1388
|
-
link: `text
|
|
1389
|
-
linkLeadingIcon: `text
|
|
1428
|
+
link: `text-[--ui-${color}]`,
|
|
1429
|
+
linkLeadingIcon: `text-[--ui-${color}]`
|
|
1390
1430
|
}
|
|
1391
1431
|
})), {
|
|
1392
|
-
color: "
|
|
1432
|
+
color: "neutral",
|
|
1393
1433
|
variant: "link",
|
|
1394
1434
|
active: true,
|
|
1395
1435
|
class: {
|
|
1396
|
-
link: "text-
|
|
1397
|
-
linkLeadingIcon: "text-
|
|
1436
|
+
link: "text-[--ui-text-highlighted]",
|
|
1437
|
+
linkLeadingIcon: "text-[--ui-text-highlighted]"
|
|
1398
1438
|
}
|
|
1399
1439
|
}, ...(options.theme.colors || []).map((highlightColor) => ({
|
|
1400
1440
|
highlightColor,
|
|
1401
1441
|
highlight: true,
|
|
1402
1442
|
active: true,
|
|
1403
1443
|
class: {
|
|
1404
|
-
link: `after:bg
|
|
1444
|
+
link: `after:bg-[--ui-${highlightColor}]`
|
|
1405
1445
|
}
|
|
1406
1446
|
})), {
|
|
1407
|
-
highlightColor: "
|
|
1447
|
+
highlightColor: "neutral",
|
|
1408
1448
|
highlight: true,
|
|
1409
1449
|
active: true,
|
|
1410
1450
|
class: {
|
|
1411
|
-
link: "after:bg-
|
|
1451
|
+
link: "after:bg-[--ui-bg-inverted]"
|
|
1412
1452
|
}
|
|
1413
1453
|
}],
|
|
1414
1454
|
defaultVariants: {
|
|
@@ -1429,17 +1469,17 @@ const pagination = {
|
|
|
1429
1469
|
|
|
1430
1470
|
const popover = {
|
|
1431
1471
|
slots: {
|
|
1432
|
-
content: "bg-
|
|
1433
|
-
arrow: "fill-
|
|
1472
|
+
content: "bg-[--ui-bg] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[--ui-border] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] focus:outline-none",
|
|
1473
|
+
arrow: "fill-[--ui-border]"
|
|
1434
1474
|
}
|
|
1435
1475
|
};
|
|
1436
1476
|
|
|
1437
1477
|
const progress = (options) => ({
|
|
1438
1478
|
slots: {
|
|
1439
1479
|
root: "gap-2",
|
|
1440
|
-
base: "relative overflow-hidden rounded-full bg-
|
|
1480
|
+
base: "relative overflow-hidden rounded-full bg-[--ui-bg-accented]",
|
|
1441
1481
|
indicator: "rounded-full size-full transition-transform duration-200 ease-out",
|
|
1442
|
-
status: "flex justify-end text-
|
|
1482
|
+
status: "flex justify-end text-[--ui-text-dimmed] transition-[width] duration-200",
|
|
1443
1483
|
steps: "grid items-end",
|
|
1444
1484
|
step: "truncate text-end row-start-1 col-start-1 transition-opacity"
|
|
1445
1485
|
},
|
|
@@ -1452,12 +1492,12 @@ const progress = (options) => ({
|
|
|
1452
1492
|
},
|
|
1453
1493
|
color: {
|
|
1454
1494
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1455
|
-
indicator: `bg
|
|
1456
|
-
steps: `text
|
|
1495
|
+
indicator: `bg-[--ui-${color}]`,
|
|
1496
|
+
steps: `text-[--ui-${color}]`
|
|
1457
1497
|
}])),
|
|
1458
|
-
|
|
1459
|
-
indicator: "bg-
|
|
1460
|
-
steps: "text-
|
|
1498
|
+
neutral: {
|
|
1499
|
+
indicator: "bg-[--ui-bg-inverted]",
|
|
1500
|
+
steps: "text-[--ui-bg]"
|
|
1461
1501
|
}
|
|
1462
1502
|
},
|
|
1463
1503
|
size: {
|
|
@@ -1495,7 +1535,7 @@ const progress = (options) => ({
|
|
|
1495
1535
|
step: "opacity-100"
|
|
1496
1536
|
},
|
|
1497
1537
|
first: {
|
|
1498
|
-
step: "opacity-100 text-
|
|
1538
|
+
step: "opacity-100 text-[--ui-text-muted]"
|
|
1499
1539
|
},
|
|
1500
1540
|
other: {
|
|
1501
1541
|
step: "opacity-0"
|
|
@@ -1652,24 +1692,24 @@ const radioGroup = (options) => ({
|
|
|
1652
1692
|
slots: {
|
|
1653
1693
|
root: "relative",
|
|
1654
1694
|
fieldset: "flex",
|
|
1655
|
-
legend: "mb-1 block font-medium text-
|
|
1695
|
+
legend: "mb-1 block font-medium text-[--ui-text]",
|
|
1656
1696
|
item: "flex items-start",
|
|
1657
|
-
base: "rounded-full ring ring-inset ring-
|
|
1658
|
-
indicator: "flex items-center justify-center size-full rounded-full after:bg-
|
|
1697
|
+
base: "rounded-full ring ring-inset ring-[--ui-border-accented] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-offset-[--ui-bg]",
|
|
1698
|
+
indicator: "flex items-center justify-center size-full rounded-full after:bg-[--ui-bg] after:rounded-full",
|
|
1659
1699
|
container: "flex items-center",
|
|
1660
1700
|
wrapper: "ms-2",
|
|
1661
|
-
label: "block font-medium text-
|
|
1662
|
-
description: "text-
|
|
1701
|
+
label: "block font-medium text-[--ui-text]",
|
|
1702
|
+
description: "text-[--ui-text-muted]"
|
|
1663
1703
|
},
|
|
1664
1704
|
variants: {
|
|
1665
1705
|
color: {
|
|
1666
1706
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1667
|
-
base: `focus-visible:outline
|
|
1668
|
-
indicator: `bg
|
|
1707
|
+
base: `focus-visible:outline-[--ui-${color}]`,
|
|
1708
|
+
indicator: `bg-[--ui-${color}]`
|
|
1669
1709
|
}])),
|
|
1670
|
-
|
|
1671
|
-
base: "focus-visible:outline-
|
|
1672
|
-
indicator: "bg-
|
|
1710
|
+
neutral: {
|
|
1711
|
+
base: "focus-visible:outline-[--ui-border-inverted]",
|
|
1712
|
+
indicator: "bg-[--ui-bg-inverted]"
|
|
1673
1713
|
}
|
|
1674
1714
|
},
|
|
1675
1715
|
orientation: {
|
|
@@ -1731,7 +1771,7 @@ const radioGroup = (options) => ({
|
|
|
1731
1771
|
},
|
|
1732
1772
|
required: {
|
|
1733
1773
|
true: {
|
|
1734
|
-
legend: "after:content-['*'] after:ms-0.5 after:text-
|
|
1774
|
+
legend: "after:content-['*'] after:ms-0.5 after:text-[--ui-error]"
|
|
1735
1775
|
}
|
|
1736
1776
|
}
|
|
1737
1777
|
},
|
|
@@ -1745,17 +1785,17 @@ const select = (options) => {
|
|
|
1745
1785
|
return defuFn({
|
|
1746
1786
|
slots: {
|
|
1747
1787
|
root: () => void 0,
|
|
1748
|
-
base: () => ["relative group rounded-
|
|
1788
|
+
base: () => ["relative group rounded-[calc(var(--ui-radius)*1.5)] inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
1749
1789
|
value: "truncate group-data-placeholder:text-current/50",
|
|
1750
|
-
arrow: "fill-
|
|
1751
|
-
content: "max-h-60 w-[--radix-popper-anchor-width] bg-
|
|
1752
|
-
viewport: "divide-y divide-
|
|
1790
|
+
arrow: "fill-[--ui-border]",
|
|
1791
|
+
content: "max-h-60 w-[--radix-popper-anchor-width] bg-[--ui-bg] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[--ui-border] overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
1792
|
+
viewport: "divide-y divide-[--ui-border] scroll-py-1",
|
|
1753
1793
|
group: "p-1 isolate",
|
|
1754
|
-
empty: "py-2 text-center text-sm text-
|
|
1755
|
-
label: "font-semibold text-
|
|
1756
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
1757
|
-
item: ["group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-
|
|
1758
|
-
itemLeadingIcon: ["shrink-0 text-
|
|
1794
|
+
empty: "py-2 text-center text-sm text-[--ui-text-muted]",
|
|
1795
|
+
label: "font-semibold text-[--ui-text-highlighted]",
|
|
1796
|
+
separator: "-mx-1 my-1 h-px bg-[--ui-border]",
|
|
1797
|
+
item: ["group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-[--ui-text] data-highlighted:text-[--ui-text-highlighted] data-highlighted:before:bg-[--ui-bg-elevated]/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1798
|
+
itemLeadingIcon: ["shrink-0 text-[--ui-text-dimmed] group-data-highlighted:text-[--ui-text]", options.theme.transitions && "transition-colors"],
|
|
1759
1799
|
itemLeadingAvatar: "shrink-0",
|
|
1760
1800
|
itemLeadingAvatarSize: "",
|
|
1761
1801
|
itemLeadingChip: "shrink-0",
|
|
@@ -1822,7 +1862,7 @@ const selectMenu = (options) => {
|
|
|
1822
1862
|
slots: {
|
|
1823
1863
|
value: "truncate",
|
|
1824
1864
|
placeholder: "truncate text-current/50",
|
|
1825
|
-
input: "placeholder-
|
|
1865
|
+
input: "placeholder-[--ui-text-dimmed] border-0 border-b border-[--ui-border] focus:outline-none"
|
|
1826
1866
|
},
|
|
1827
1867
|
variants: {
|
|
1828
1868
|
size: {
|
|
@@ -1850,7 +1890,7 @@ const separator = (options) => ({
|
|
|
1850
1890
|
slots: {
|
|
1851
1891
|
root: "flex items-center align-center text-center",
|
|
1852
1892
|
border: "",
|
|
1853
|
-
container: "font-medium text-
|
|
1893
|
+
container: "font-medium text-[--ui-text] flex",
|
|
1854
1894
|
icon: "shrink-0 size-5",
|
|
1855
1895
|
avatar: "shrink-0",
|
|
1856
1896
|
avatarSize: "2xs",
|
|
@@ -1858,8 +1898,8 @@ const separator = (options) => ({
|
|
|
1858
1898
|
},
|
|
1859
1899
|
variants: {
|
|
1860
1900
|
color: {
|
|
1861
|
-
...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border
|
|
1862
|
-
|
|
1901
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-[--ui-${color}]` }])),
|
|
1902
|
+
neutral: { border: "border-[--ui-border]" }
|
|
1863
1903
|
},
|
|
1864
1904
|
orientation: {
|
|
1865
1905
|
horizontal: {
|
|
@@ -1934,25 +1974,25 @@ const separator = (options) => ({
|
|
|
1934
1974
|
class: { border: "border-s-[5px]" }
|
|
1935
1975
|
}],
|
|
1936
1976
|
defaultVariants: {
|
|
1937
|
-
color: "
|
|
1977
|
+
color: "neutral",
|
|
1938
1978
|
size: "xs",
|
|
1939
1979
|
type: "solid"
|
|
1940
1980
|
}
|
|
1941
1981
|
});
|
|
1942
1982
|
|
|
1943
1983
|
const skeleton = {
|
|
1944
|
-
base: "animate-pulse rounded-
|
|
1984
|
+
base: "animate-pulse rounded-[calc(var(--ui-radius)*1.5)] bg-[--ui-bg-elevated]"
|
|
1945
1985
|
};
|
|
1946
1986
|
|
|
1947
1987
|
const slideover = {
|
|
1948
1988
|
slots: {
|
|
1949
|
-
overlay: "fixed inset-0 z-50 bg-
|
|
1950
|
-
content: "fixed z-50 bg-
|
|
1989
|
+
overlay: "fixed inset-0 z-50 bg-[--ui-bg-elevated]/75",
|
|
1990
|
+
content: "fixed z-50 bg-[--ui-bg] divide-y divide-[--ui-border] sm:ring ring-[--ui-border] sm:shadow-lg flex flex-col focus:outline-none",
|
|
1951
1991
|
header: "px-4 py-5 sm:px-6",
|
|
1952
1992
|
body: "flex-1 overflow-y-auto p-4 sm:p-6",
|
|
1953
1993
|
footer: "flex items-center gap-1.5 p-4 sm:px-6",
|
|
1954
|
-
title: "text-
|
|
1955
|
-
description: "mt-1 text-
|
|
1994
|
+
title: "text-[--ui-text-highlighted] font-semibold",
|
|
1995
|
+
description: "mt-1 text-[--ui-text-muted] text-sm",
|
|
1956
1996
|
close: "absolute top-4 right-4"
|
|
1957
1997
|
},
|
|
1958
1998
|
variants: {
|
|
@@ -2006,19 +2046,19 @@ const slideover = {
|
|
|
2006
2046
|
const slider = (options) => ({
|
|
2007
2047
|
slots: {
|
|
2008
2048
|
root: "relative flex items-center select-none touch-none",
|
|
2009
|
-
track: "relative bg-
|
|
2049
|
+
track: "relative bg-[--ui-bg-accented] overflow-hidden rounded-full grow",
|
|
2010
2050
|
range: "absolute rounded-full",
|
|
2011
|
-
thumb: "rounded-full bg-
|
|
2051
|
+
thumb: "rounded-full bg-[--ui-bg] ring-2 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2"
|
|
2012
2052
|
},
|
|
2013
2053
|
variants: {
|
|
2014
2054
|
color: {
|
|
2015
2055
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2016
|
-
range: `bg
|
|
2017
|
-
thumb: `ring
|
|
2056
|
+
range: `bg-[--ui-${color}]`,
|
|
2057
|
+
thumb: `ring-[--ui-${color}] focus-visible:outline-[--ui-${color}]`
|
|
2018
2058
|
}])),
|
|
2019
|
-
|
|
2020
|
-
range: "bg-
|
|
2021
|
-
thumb: "ring-
|
|
2059
|
+
neutral: {
|
|
2060
|
+
range: "bg-[--ui-bg-inverted]",
|
|
2061
|
+
thumb: "ring-[--ui-border-inverted] focus-visible:outline-[--ui-border-inverted]/50"
|
|
2022
2062
|
}
|
|
2023
2063
|
},
|
|
2024
2064
|
size: {
|
|
@@ -2124,23 +2164,23 @@ const slider = (options) => ({
|
|
|
2124
2164
|
const _switch = (options) => ({
|
|
2125
2165
|
slots: {
|
|
2126
2166
|
root: "relative flex items-start",
|
|
2127
|
-
base: ["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-
|
|
2167
|
+
base: ["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-[--ui-bg] data-[state=unchecked]:bg-[--ui-bg-accented]", options.theme.transitions && "transition-colors duration-200"],
|
|
2128
2168
|
container: "flex items-center",
|
|
2129
|
-
thumb: "group pointer-events-none block rounded-full bg-
|
|
2130
|
-
icon: ["absolute shrink-0 group-data-[state=unchecked]:text-
|
|
2169
|
+
thumb: "group pointer-events-none block rounded-full bg-[--ui-bg] shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 flex items-center justify-center",
|
|
2170
|
+
icon: ["absolute shrink-0 group-data-[state=unchecked]:text-[--ui-text-dimmed] opacity-0 size-10/12", options.theme.transitions && "transition-[color,opacity] duration-200"],
|
|
2131
2171
|
wrapper: "ms-2",
|
|
2132
|
-
label: "block font-medium text-
|
|
2133
|
-
description: "text-
|
|
2172
|
+
label: "block font-medium text-[--ui-text]",
|
|
2173
|
+
description: "text-[--ui-text-muted]"
|
|
2134
2174
|
},
|
|
2135
2175
|
variants: {
|
|
2136
2176
|
color: {
|
|
2137
2177
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2138
|
-
base: `data-[state=checked]:bg
|
|
2139
|
-
icon: `group-data-[state=checked]:text
|
|
2178
|
+
base: `data-[state=checked]:bg-[--ui-${color}] focus-visible:ring-[--ui-${color}]`,
|
|
2179
|
+
icon: `group-data-[state=checked]:text-[--ui-${color}]`
|
|
2140
2180
|
}])),
|
|
2141
|
-
|
|
2142
|
-
base: "data-[state=checked]:bg-
|
|
2143
|
-
icon: "group-data-[state=checked]:text-
|
|
2181
|
+
neutral: {
|
|
2182
|
+
base: "data-[state=checked]:bg-[--ui-bg-inverted] focus-visible:ring-[--ui-border-inverted]",
|
|
2183
|
+
icon: "group-data-[state=checked]:text-[--ui-text-highlighted]"
|
|
2144
2184
|
}
|
|
2145
2185
|
},
|
|
2146
2186
|
size: {
|
|
@@ -2192,7 +2232,7 @@ const _switch = (options) => ({
|
|
|
2192
2232
|
},
|
|
2193
2233
|
required: {
|
|
2194
2234
|
true: {
|
|
2195
|
-
label: "after:content-['*'] after:ms-0.5 after:text-
|
|
2235
|
+
label: "after:content-['*'] after:ms-0.5 after:text-[--ui-error]"
|
|
2196
2236
|
}
|
|
2197
2237
|
},
|
|
2198
2238
|
disabled: {
|
|
@@ -2214,7 +2254,7 @@ const tabs = (options) => ({
|
|
|
2214
2254
|
root: "flex items-center gap-2",
|
|
2215
2255
|
list: "relative flex p-1 group",
|
|
2216
2256
|
indicator: "absolute transition-[translate,width] duration-200",
|
|
2217
|
-
trigger: ["relative inline-flex items-center shrink-0 data-[state=inactive]:text-
|
|
2257
|
+
trigger: ["relative inline-flex items-center shrink-0 data-[state=inactive]:text-[--ui-text-muted] hover:data-[state=inactive]:text-[--ui-text] font-medium rounded-[calc(var(--ui-radius)*1.5)] disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none", options.theme.transitions && "transition-colors"],
|
|
2218
2258
|
content: "focus:outline-none w-full",
|
|
2219
2259
|
leadingIcon: "shrink-0",
|
|
2220
2260
|
leadingAvatar: "shrink-0",
|
|
@@ -2224,16 +2264,16 @@ const tabs = (options) => ({
|
|
|
2224
2264
|
variants: {
|
|
2225
2265
|
color: {
|
|
2226
2266
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
2227
|
-
|
|
2267
|
+
neutral: ""
|
|
2228
2268
|
},
|
|
2229
2269
|
variant: {
|
|
2230
2270
|
pill: {
|
|
2231
|
-
list: "bg-
|
|
2271
|
+
list: "bg-[--ui-bg-elevated] rounded-[calc(var(--ui-radius)*2)]",
|
|
2232
2272
|
trigger: "flex-1",
|
|
2233
|
-
indicator: "rounded-
|
|
2273
|
+
indicator: "rounded-[calc(var(--ui-radius)*1.5)] shadow-sm"
|
|
2234
2274
|
},
|
|
2235
2275
|
link: {
|
|
2236
|
-
list: "border-
|
|
2276
|
+
list: "border-[--ui-border]",
|
|
2237
2277
|
indicator: "rounded-full"
|
|
2238
2278
|
}
|
|
2239
2279
|
},
|
|
@@ -2308,29 +2348,29 @@ const tabs = (options) => ({
|
|
|
2308
2348
|
color,
|
|
2309
2349
|
variant: "pill",
|
|
2310
2350
|
class: {
|
|
2311
|
-
indicator: `bg
|
|
2312
|
-
trigger: `data-[state=active]:text-
|
|
2351
|
+
indicator: `bg-[--ui-${color}]`,
|
|
2352
|
+
trigger: `data-[state=active]:text-[--ui-bg] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[--ui-${color}]`
|
|
2313
2353
|
}
|
|
2314
2354
|
})), {
|
|
2315
|
-
color: "
|
|
2355
|
+
color: "neutral",
|
|
2316
2356
|
variant: "pill",
|
|
2317
2357
|
class: {
|
|
2318
|
-
indicator: "bg-
|
|
2319
|
-
trigger: "data-[state=active]:text-
|
|
2358
|
+
indicator: "bg-[--ui-bg-inverted]",
|
|
2359
|
+
trigger: "data-[state=active]:text-[--ui-bg] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[--ui-border-inverted]"
|
|
2320
2360
|
}
|
|
2321
2361
|
}, ...(options.theme.colors || []).map((color) => ({
|
|
2322
2362
|
color,
|
|
2323
2363
|
variant: "link",
|
|
2324
2364
|
class: {
|
|
2325
|
-
indicator: `bg
|
|
2326
|
-
trigger: `data-[state=active]:text
|
|
2365
|
+
indicator: `bg-[--ui-${color}]`,
|
|
2366
|
+
trigger: `data-[state=active]:text-[--ui-${color}] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-${color}]`
|
|
2327
2367
|
}
|
|
2328
2368
|
})), {
|
|
2329
|
-
color: "
|
|
2369
|
+
color: "neutral",
|
|
2330
2370
|
variant: "link",
|
|
2331
2371
|
class: {
|
|
2332
|
-
indicator: "bg-
|
|
2333
|
-
trigger: "data-[state=active]:text-
|
|
2372
|
+
indicator: "bg-[--ui-bg-inverted]",
|
|
2373
|
+
trigger: "data-[state=active]:text-[--ui-text-highlighted] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-border-inverted]"
|
|
2334
2374
|
}
|
|
2335
2375
|
}],
|
|
2336
2376
|
defaultVariants: {
|
|
@@ -2346,10 +2386,10 @@ const textarea = (options) => {
|
|
|
2346
2386
|
|
|
2347
2387
|
const toast = (options) => ({
|
|
2348
2388
|
slots: {
|
|
2349
|
-
root: "relative group overflow-hidden bg-
|
|
2389
|
+
root: "relative group overflow-hidden bg-[--ui-bg] shadow-lg rounded-[calc(var(--ui-radius)*2)] ring ring-[--ui-border] p-4 flex gap-2.5 focus:outline-none",
|
|
2350
2390
|
wrapper: "w-0 flex-1 flex flex-col gap-1",
|
|
2351
|
-
title: "text-sm font-medium text-
|
|
2352
|
-
description: "text-sm text-
|
|
2391
|
+
title: "text-sm font-medium text-[--ui-text-highlighted]",
|
|
2392
|
+
description: "text-sm text-[--ui-text-muted]",
|
|
2353
2393
|
icon: "shrink-0 size-5",
|
|
2354
2394
|
avatar: "shrink-0",
|
|
2355
2395
|
avatarSize: "2xl",
|
|
@@ -2360,14 +2400,14 @@ const toast = (options) => ({
|
|
|
2360
2400
|
variants: {
|
|
2361
2401
|
color: {
|
|
2362
2402
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2363
|
-
root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring
|
|
2364
|
-
icon: `text
|
|
2365
|
-
progress: `bg
|
|
2403
|
+
root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-${color}]`,
|
|
2404
|
+
icon: `text-[--ui-${color}]`,
|
|
2405
|
+
progress: `bg-[--ui-${color}]`
|
|
2366
2406
|
}])),
|
|
2367
|
-
|
|
2368
|
-
root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
2369
|
-
icon: "text-
|
|
2370
|
-
progress: "bg-
|
|
2407
|
+
neutral: {
|
|
2408
|
+
root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-border-inverted]",
|
|
2409
|
+
icon: "text-[--ui-text-highlighted]",
|
|
2410
|
+
progress: "bg-[--ui-bg-inverted]"
|
|
2371
2411
|
}
|
|
2372
2412
|
},
|
|
2373
2413
|
multiline: {
|
|
@@ -2445,8 +2485,8 @@ const toaster = {
|
|
|
2445
2485
|
|
|
2446
2486
|
const tooltip = {
|
|
2447
2487
|
slots: {
|
|
2448
|
-
content: "flex items-center gap-1 bg-
|
|
2449
|
-
arrow: "fill-
|
|
2488
|
+
content: "flex items-center gap-1 bg-[--ui-bg] text-[--ui-text-highlighted] shadow rounded-[--ui-radius] ring ring-[--ui-border] h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
2489
|
+
arrow: "fill-[--ui-border]",
|
|
2450
2490
|
text: "truncate",
|
|
2451
2491
|
kbds: `hidden lg:inline-flex items-center shrink-0 gap-0.5 before:content-['\xB7'] before:mr-0.5`,
|
|
2452
2492
|
kbdsSize: "sm"
|
|
@@ -2464,6 +2504,7 @@ const theme = {
|
|
|
2464
2504
|
button: button,
|
|
2465
2505
|
buttonGroup: buttonGroup,
|
|
2466
2506
|
card: card,
|
|
2507
|
+
carousel: carousel,
|
|
2467
2508
|
checkbox: checkbox,
|
|
2468
2509
|
chip: chip,
|
|
2469
2510
|
collapsible: collapsible,
|
|
@@ -2528,15 +2569,17 @@ function addTemplates(options, nuxt) {
|
|
|
2528
2569
|
filename: "types/ui.d.ts",
|
|
2529
2570
|
getContents: () => `import * as ui from '#build/ui'
|
|
2530
2571
|
import type { DeepPartial } from '#ui/types/utils'
|
|
2572
|
+
import colors from 'tailwindcss/colors'
|
|
2531
2573
|
|
|
2532
|
-
const colors = ${JSON.stringify(options.theme?.colors || [])} as const;
|
|
2533
2574
|
const icons = ${JSON.stringify(nuxt.options.appConfig.ui.icons)};
|
|
2534
2575
|
|
|
2576
|
+
type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone'
|
|
2577
|
+
type Color = Exclude<keyof typeof colors, 'inherit' | 'current' | 'transparent' | 'black' | 'white' | NeutralColor>
|
|
2578
|
+
|
|
2535
2579
|
type AppConfigUI = {
|
|
2536
2580
|
colors?: {
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
gray?: 'slate' | 'cool' | 'zinc' | 'neutral' | 'stone'
|
|
2581
|
+
${options.theme?.colors?.map((color) => `${color}?: Color`).join("\n ")}
|
|
2582
|
+
neutral?: NeutralColor
|
|
2540
2583
|
}
|
|
2541
2584
|
icons?: Partial<typeof icons>
|
|
2542
2585
|
} & DeepPartial<typeof ui, string>
|
|
@@ -2558,6 +2601,8 @@ const icons = {
|
|
|
2558
2601
|
chevronDown: "i-heroicons-chevron-down-20-solid",
|
|
2559
2602
|
chevronLeft: "i-heroicons-chevron-left-20-solid",
|
|
2560
2603
|
chevronRight: "i-heroicons-chevron-right-20-solid",
|
|
2604
|
+
arrowLeft: "i-heroicons-arrow-left-20-solid",
|
|
2605
|
+
arrowRight: "i-heroicons-arrow-right-20-solid",
|
|
2561
2606
|
check: "i-heroicons-check-20-solid",
|
|
2562
2607
|
close: "i-heroicons-x-mark-20-solid",
|
|
2563
2608
|
ellipsis: "i-heroicons-ellipsis-horizontal-20-solid",
|
|
@@ -2573,11 +2618,13 @@ const module = defineNuxtModule({
|
|
|
2573
2618
|
configKey: "ui",
|
|
2574
2619
|
compatibility: {
|
|
2575
2620
|
nuxt: ">=3.13.1"
|
|
2576
|
-
}
|
|
2621
|
+
},
|
|
2622
|
+
docs: "https://ui3.nuxt.dev/getting-started/installation"
|
|
2577
2623
|
},
|
|
2578
2624
|
defaults: {
|
|
2579
2625
|
prefix: "U",
|
|
2580
2626
|
fonts: true,
|
|
2627
|
+
colorMode: true,
|
|
2581
2628
|
theme: {
|
|
2582
2629
|
colors: void 0,
|
|
2583
2630
|
transitions: true
|
|
@@ -2586,15 +2633,19 @@ const module = defineNuxtModule({
|
|
|
2586
2633
|
async setup(options, nuxt) {
|
|
2587
2634
|
const { resolve } = createResolver(import.meta.url);
|
|
2588
2635
|
options.theme = options.theme || {};
|
|
2589
|
-
options.theme.colors = options.theme.colors?.length ? [.../* @__PURE__ */ new Set(["primary",
|
|
2636
|
+
options.theme.colors = options.theme.colors?.length ? [.../* @__PURE__ */ new Set(["primary", ...options.theme.colors])] : ["primary", "secondary", "success", "info", "warning", "error"];
|
|
2590
2637
|
nuxt.options.ui = options;
|
|
2591
2638
|
nuxt.options.alias["#ui"] = resolve("./runtime");
|
|
2592
2639
|
nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, {
|
|
2593
|
-
colors: {
|
|
2640
|
+
colors: pick({
|
|
2594
2641
|
primary: "green",
|
|
2642
|
+
secondary: "blue",
|
|
2643
|
+
success: "green",
|
|
2644
|
+
info: "blue",
|
|
2645
|
+
warning: "yellow",
|
|
2595
2646
|
error: "red",
|
|
2596
|
-
|
|
2597
|
-
},
|
|
2647
|
+
neutral: "slate"
|
|
2648
|
+
}, [...options.theme?.colors || [], "neutral"]),
|
|
2598
2649
|
icons
|
|
2599
2650
|
});
|
|
2600
2651
|
nuxt.options.app.rootAttrs = nuxt.options.app.rootAttrs || {};
|
|
@@ -2605,27 +2656,23 @@ const module = defineNuxtModule({
|
|
|
2605
2656
|
} else {
|
|
2606
2657
|
nuxt.options.postcss.plugins["@tailwindcss/postcss"] = {};
|
|
2607
2658
|
}
|
|
2608
|
-
|
|
2609
|
-
if (!hasNuxtModule(
|
|
2610
|
-
await installModule(
|
|
2659
|
+
async function registerModule(name, options2) {
|
|
2660
|
+
if (!hasNuxtModule(name)) {
|
|
2661
|
+
await installModule(name, options2);
|
|
2611
2662
|
} else {
|
|
2612
|
-
nuxt.options
|
|
2663
|
+
nuxt.options[name] = defu(nuxt.options[name], options2);
|
|
2613
2664
|
}
|
|
2614
2665
|
}
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
nuxt.options.icon = defu(nuxt.options.icon, { cssLayer: "components" });
|
|
2666
|
+
await registerModule("@nuxt/icon", { cssLayer: "components" });
|
|
2667
|
+
if (options.fonts) {
|
|
2668
|
+
await registerModule("@nuxt/fonts", { experimental: { processCSSVariables: true } });
|
|
2619
2669
|
}
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
}
|
|
2623
|
-
addPlugin({
|
|
2624
|
-
|
|
2625
|
-
});
|
|
2626
|
-
addPlugin({
|
|
2627
|
-
src: resolve("./runtime/plugins/slideover")
|
|
2628
|
-
});
|
|
2670
|
+
if (options.colorMode) {
|
|
2671
|
+
await registerModule("@nuxtjs/color-mode", { classSuffix: "", disableTransition: true });
|
|
2672
|
+
}
|
|
2673
|
+
addPlugin({ src: resolve("./runtime/plugins/colors") });
|
|
2674
|
+
addPlugin({ src: resolve("./runtime/plugins/modal") });
|
|
2675
|
+
addPlugin({ src: resolve("./runtime/plugins/slideover") });
|
|
2629
2676
|
addComponentsDir({
|
|
2630
2677
|
path: resolve("./runtime/components"),
|
|
2631
2678
|
prefix: options.prefix,
|