@nuxt/ui 3.0.0-alpha.11 → 3.0.0-alpha.13
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/.nuxt/ui/accordion.ts +2 -2
- package/.nuxt/ui/alert.ts +47 -37
- package/.nuxt/ui/avatar-group.ts +1 -1
- package/.nuxt/ui/avatar.ts +4 -4
- package/.nuxt/ui/badge.ts +37 -28
- package/.nuxt/ui/breadcrumb.ts +5 -5
- package/.nuxt/ui/button.ts +42 -43
- package/.nuxt/ui/calendar.ts +15 -15
- package/.nuxt/ui/card.ts +27 -1
- package/.nuxt/ui/carousel.ts +2 -2
- package/.nuxt/ui/checkbox.ts +18 -18
- package/.nuxt/ui/chip.ts +8 -8
- package/.nuxt/ui/color-picker.ts +2 -2
- package/.nuxt/ui/command-palette.ts +12 -12
- package/.nuxt/ui/container.ts +1 -1
- package/.nuxt/ui/context-menu.ts +32 -32
- package/.nuxt/ui/drawer.ts +72 -11
- package/.nuxt/ui/dropdown-menu.ts +33 -33
- package/.nuxt/ui/form-field.ts +6 -6
- package/.nuxt/ui/input-menu.ts +41 -41
- package/.nuxt/ui/input-number.ts +20 -20
- package/.nuxt/ui/input.ts +23 -23
- package/.nuxt/ui/kbd.ts +4 -4
- package/.nuxt/ui/link.ts +3 -3
- package/.nuxt/ui/modal.ts +5 -5
- package/.nuxt/ui/navigation-menu.ts +144 -77
- package/.nuxt/ui/pin-input.ts +20 -20
- package/.nuxt/ui/popover.ts +2 -2
- package/.nuxt/ui/progress.ts +17 -17
- package/.nuxt/ui/radio-group.ts +20 -20
- package/.nuxt/ui/select-menu.ts +33 -32
- package/.nuxt/ui/select.ts +31 -31
- package/.nuxt/ui/separator.ts +8 -8
- package/.nuxt/ui/skeleton.ts +1 -1
- package/.nuxt/ui/slideover.ts +4 -4
- package/.nuxt/ui/slider.ts +16 -16
- package/.nuxt/ui/stepper.ts +18 -18
- package/.nuxt/ui/switch.ts +20 -20
- package/.nuxt/ui/table.ts +16 -16
- package/.nuxt/ui/tabs.ts +33 -33
- package/.nuxt/ui/textarea.ts +23 -23
- package/.nuxt/ui/toast.ts +42 -32
- package/.nuxt/ui/toaster.ts +4 -4
- package/.nuxt/ui/tooltip.ts +2 -2
- package/.nuxt/ui.css +90 -0
- package/README.md +2 -2
- package/cli/package.json +2 -2
- package/cli/templates.mjs +7 -7
- package/dist/chunks/component-meta.cjs +2590 -2511
- package/dist/chunks/component-meta.mjs +2590 -2511
- package/dist/client/devtools/200.html +1 -1
- package/dist/client/devtools/404.html +1 -1
- package/dist/client/devtools/_nuxt/CG6Dc4jp.js +1 -0
- package/dist/client/devtools/_nuxt/{Dtz-o9GB.js → DrNJgD08.js} +1 -1
- package/dist/client/devtools/_nuxt/{DNZFyo26.js → ElqrUh1r.js} +1 -1
- package/dist/client/devtools/_nuxt/builds/latest.json +1 -1
- package/dist/client/devtools/_nuxt/builds/meta/255c8d0b-7281-4d74-b4b6-ec96e6721aa0.json +1 -0
- package/dist/client/devtools/_nuxt/entry.Hn8drx4g.css +1 -0
- package/dist/client/devtools/_nuxt/error-404.Dew7w9Ee.css +1 -0
- package/dist/client/devtools/_nuxt/error-500.Dep59i31.css +1 -0
- package/dist/client/devtools/_nuxt/mC2e7kOs.js +57 -0
- package/dist/client/devtools/index.html +1 -1
- package/dist/devtools/runtime/examples/CardExample.vue +3 -3
- package/dist/devtools/runtime/examples/CollapsibleExample.vue +1 -1
- package/dist/devtools/runtime/examples/ContainerExample.vue +1 -1
- package/dist/devtools/runtime/examples/ContextMenuExample.vue +1 -1
- package/dist/devtools/runtime/examples/PopoverExample.vue +1 -1
- package/dist/devtools/runtime/examples/TooltipExample.vue +1 -1
- package/dist/module.cjs +2 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -1
- package/dist/runtime/components/Accordion.vue +2 -2
- package/dist/runtime/components/Alert.vue +15 -12
- package/dist/runtime/components/App.vue +3 -3
- package/dist/runtime/components/Avatar.vue +31 -10
- package/dist/runtime/components/AvatarGroup.vue +2 -2
- package/dist/runtime/components/Badge.vue +7 -3
- package/dist/runtime/components/Breadcrumb.vue +2 -2
- package/dist/runtime/components/Button.vue +2 -2
- package/dist/runtime/components/ButtonGroup.vue +2 -2
- package/dist/runtime/components/Calendar.vue +6 -3
- package/dist/runtime/components/Card.vue +8 -4
- package/dist/runtime/components/Carousel.vue +2 -2
- package/dist/runtime/components/Checkbox.vue +4 -4
- package/dist/runtime/components/Chip.vue +2 -2
- package/dist/runtime/components/Collapsible.vue +2 -2
- package/dist/runtime/components/ColorPicker.vue +46 -15
- package/dist/runtime/components/CommandPalette.vue +48 -41
- package/dist/runtime/components/Container.vue +2 -2
- package/dist/runtime/components/ContextMenu.vue +10 -2
- package/dist/runtime/components/ContextMenuContent.vue +4 -2
- package/dist/runtime/components/Drawer.vue +9 -3
- package/dist/runtime/components/DropdownMenu.vue +10 -2
- package/dist/runtime/components/DropdownMenuContent.vue +4 -2
- package/dist/runtime/components/Form.vue +46 -17
- package/dist/runtime/components/FormField.vue +12 -6
- package/dist/runtime/components/Input.vue +5 -4
- package/dist/runtime/components/InputMenu.vue +6 -5
- package/dist/runtime/components/InputNumber.vue +10 -6
- package/dist/runtime/components/Kbd.vue +2 -2
- package/dist/runtime/components/Link.vue +2 -2
- package/dist/runtime/components/Modal.vue +17 -3
- package/dist/runtime/components/NavigationMenu.vue +110 -67
- package/dist/runtime/components/Pagination.vue +2 -2
- package/dist/runtime/components/PinInput.vue +5 -4
- package/dist/runtime/components/Popover.vue +2 -2
- package/dist/runtime/components/Progress.vue +2 -2
- package/dist/runtime/components/RadioGroup.vue +4 -4
- package/dist/runtime/components/Select.vue +9 -7
- package/dist/runtime/components/SelectMenu.vue +67 -64
- package/dist/runtime/components/Separator.vue +2 -2
- package/dist/runtime/components/Skeleton.vue +2 -2
- package/dist/runtime/components/Slideover.vue +17 -3
- package/dist/runtime/components/Slider.vue +4 -4
- package/dist/runtime/components/Stepper.vue +3 -3
- package/dist/runtime/components/Switch.vue +4 -4
- package/dist/runtime/components/Table.vue +96 -18
- package/dist/runtime/components/Tabs.vue +2 -2
- package/dist/runtime/components/Textarea.vue +7 -5
- package/dist/runtime/components/Toast.vue +28 -16
- package/dist/runtime/components/Toaster.vue +4 -4
- package/dist/runtime/components/Tooltip.vue +2 -2
- package/dist/runtime/composables/useFormField.d.ts +6 -2
- package/dist/runtime/composables/useFormField.js +18 -11
- package/dist/runtime/composables/useToast.d.ts +4 -3
- package/dist/runtime/composables/useToast.js +20 -6
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/locale/az.js +54 -0
- package/dist/runtime/locale/bn.js +54 -0
- package/dist/runtime/locale/es.js +2 -2
- package/dist/runtime/locale/he.d.ts +2 -0
- package/dist/runtime/locale/he.js +53 -0
- package/dist/runtime/locale/hi.d.ts +2 -0
- package/dist/runtime/locale/hi.js +54 -0
- package/dist/runtime/locale/hu.d.ts +2 -0
- package/dist/runtime/locale/hu.js +54 -0
- package/dist/runtime/locale/index.d.ts +8 -2
- package/dist/runtime/locale/index.js +8 -2
- package/dist/runtime/locale/km.d.ts +2 -0
- package/dist/runtime/locale/km.js +54 -0
- package/dist/runtime/locale/nb_no.d.ts +2 -0
- package/dist/runtime/locale/nb_no.js +54 -0
- package/dist/runtime/locale/zh_cn.d.ts +2 -0
- package/dist/runtime/locale/{zh_hans.js → zh_cn.js} +1 -1
- package/dist/runtime/locale/zh_tw.d.ts +2 -0
- package/dist/runtime/locale/{zh_hant.js → zh_tw.js} +1 -1
- package/dist/runtime/plugins/colors.js +8 -5
- package/dist/runtime/types/form.d.ts +21 -12
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/utils.d.ts +5 -0
- package/dist/runtime/utils/form.js +3 -5
- package/dist/runtime/utils/tv.js +2 -2
- package/dist/runtime/vue/components/Link.vue +77 -18
- package/dist/shared/{ui.DCjJwb6l.cjs → ui.C5FzRWM5.cjs} +529 -366
- package/dist/shared/{ui.BKsd22-Q.mjs → ui.DCZM2pl8.mjs} +525 -366
- package/dist/unplugin.cjs +44 -20
- package/dist/unplugin.d.cts +10 -0
- package/dist/unplugin.d.mts +10 -0
- package/dist/unplugin.d.ts +10 -0
- package/dist/unplugin.mjs +43 -19
- package/dist/vite.cjs +3 -2
- package/dist/vite.d.cts +2 -0
- package/dist/vite.d.mts +2 -0
- package/dist/vite.d.ts +2 -0
- package/dist/vite.mjs +3 -2
- package/package.json +67 -41
- package/dist/client/devtools/_nuxt/CQ-XZFu7.js +0 -54
- package/dist/client/devtools/_nuxt/builds/meta/1f5fbd7b-9d97-480e-9ae4-e02b4ff7018b.json +0 -1
- package/dist/client/devtools/_nuxt/entry.qOdop8tq.css +0 -1
- package/dist/client/devtools/_nuxt/error-404.D-rS9BDk.css +0 -1
- package/dist/client/devtools/_nuxt/error-500.CfcCHs91.css +0 -1
- /package/dist/runtime/locale/{zh_hans.d.ts → az.d.ts} +0 -0
- /package/dist/runtime/locale/{zh_hant.d.ts → bn.d.ts} +0 -0
|
@@ -3,6 +3,7 @@ import 'node:url';
|
|
|
3
3
|
import { kebabCase } from 'scule';
|
|
4
4
|
import { addTypeTemplate, addTemplate } from '@nuxt/kit';
|
|
5
5
|
import { defuFn, defu } from 'defu';
|
|
6
|
+
import colors from 'tailwindcss/colors';
|
|
6
7
|
|
|
7
8
|
const icons = {
|
|
8
9
|
arrowLeft: "i-lucide-arrow-left",
|
|
@@ -54,9 +55,9 @@ const resolveColors = (colors) => {
|
|
|
54
55
|
const accordion = {
|
|
55
56
|
slots: {
|
|
56
57
|
root: "w-full",
|
|
57
|
-
item: "border-b border-
|
|
58
|
+
item: "border-b border-(--ui-border) last:border-b-0",
|
|
58
59
|
header: "flex",
|
|
59
|
-
trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-
|
|
60
|
+
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",
|
|
60
61
|
content: "data-[state=open]:animate-[accordion-down_200ms_ease-out] data-[state=closed]:animate-[accordion-up_200ms_ease-out] overflow-hidden focus:outline-none",
|
|
61
62
|
body: "text-sm pb-3.5",
|
|
62
63
|
leadingIcon: "shrink-0 size-5",
|
|
@@ -75,14 +76,14 @@ const accordion = {
|
|
|
75
76
|
const alert = (options) => ({
|
|
76
77
|
slots: {
|
|
77
78
|
root: "relative overflow-hidden w-full rounded-[calc(var(--ui-radius)*2)] p-4 flex gap-2.5",
|
|
78
|
-
wrapper: "min-w-0 flex-1 flex flex-col
|
|
79
|
+
wrapper: "min-w-0 flex-1 flex flex-col",
|
|
79
80
|
title: "text-sm font-medium",
|
|
80
81
|
description: "text-sm opacity-90",
|
|
81
82
|
icon: "shrink-0 size-5",
|
|
82
83
|
avatar: "shrink-0",
|
|
83
84
|
avatarSize: "2xl",
|
|
84
|
-
actions: "flex gap-1.5 shrink-0",
|
|
85
|
-
close: "p-0
|
|
85
|
+
actions: "flex flex-wrap gap-1.5 shrink-0",
|
|
86
|
+
close: "p-0"
|
|
86
87
|
},
|
|
87
88
|
variants: {
|
|
88
89
|
color: {
|
|
@@ -95,14 +96,19 @@ const alert = (options) => ({
|
|
|
95
96
|
soft: "",
|
|
96
97
|
subtle: ""
|
|
97
98
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
root: "items-start",
|
|
101
|
-
actions: "items-start mt-1"
|
|
102
|
-
},
|
|
103
|
-
false: {
|
|
99
|
+
orientation: {
|
|
100
|
+
horizontal: {
|
|
104
101
|
root: "items-center",
|
|
105
102
|
actions: "items-center"
|
|
103
|
+
},
|
|
104
|
+
vertical: {
|
|
105
|
+
root: "items-start",
|
|
106
|
+
actions: "items-start mt-2.5"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
title: {
|
|
110
|
+
true: {
|
|
111
|
+
description: "mt-1"
|
|
106
112
|
}
|
|
107
113
|
}
|
|
108
114
|
},
|
|
@@ -110,49 +116,49 @@ const alert = (options) => ({
|
|
|
110
116
|
color,
|
|
111
117
|
variant: "solid",
|
|
112
118
|
class: {
|
|
113
|
-
root: `bg-
|
|
119
|
+
root: `bg-(--ui-${color}) text-(--ui-bg)`
|
|
114
120
|
}
|
|
115
121
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
116
122
|
color,
|
|
117
123
|
variant: "outline",
|
|
118
124
|
class: {
|
|
119
|
-
root: `text-
|
|
125
|
+
root: `text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25`
|
|
120
126
|
}
|
|
121
127
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
122
128
|
color,
|
|
123
129
|
variant: "soft",
|
|
124
130
|
class: {
|
|
125
|
-
root: `bg-
|
|
131
|
+
root: `bg-(--ui-${color})/10 text-(--ui-${color})`
|
|
126
132
|
}
|
|
127
133
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
128
134
|
color,
|
|
129
135
|
variant: "subtle",
|
|
130
136
|
class: {
|
|
131
|
-
root: `bg-
|
|
137
|
+
root: `bg-(--ui-${color})/10 text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25`
|
|
132
138
|
}
|
|
133
139
|
})), {
|
|
134
140
|
color: "neutral",
|
|
135
141
|
variant: "solid",
|
|
136
142
|
class: {
|
|
137
|
-
root: "text-
|
|
143
|
+
root: "text-(--ui-bg) bg-(--ui-bg-inverted)"
|
|
138
144
|
}
|
|
139
145
|
}, {
|
|
140
146
|
color: "neutral",
|
|
141
147
|
variant: "outline",
|
|
142
148
|
class: {
|
|
143
|
-
root: "text-
|
|
149
|
+
root: "text-(--ui-text-highlighted) bg-(--ui-bg) ring ring-inset ring-(--ui-border)"
|
|
144
150
|
}
|
|
145
151
|
}, {
|
|
146
152
|
color: "neutral",
|
|
147
153
|
variant: "soft",
|
|
148
154
|
class: {
|
|
149
|
-
root: "text-
|
|
155
|
+
root: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated)/50"
|
|
150
156
|
}
|
|
151
157
|
}, {
|
|
152
158
|
color: "neutral",
|
|
153
159
|
variant: "subtle",
|
|
154
160
|
class: {
|
|
155
|
-
root: "text-
|
|
161
|
+
root: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated)/50 ring ring-inset ring-(--ui-border-accented)"
|
|
156
162
|
}
|
|
157
163
|
}],
|
|
158
164
|
defaultVariants: {
|
|
@@ -163,10 +169,10 @@ const alert = (options) => ({
|
|
|
163
169
|
|
|
164
170
|
const avatar = {
|
|
165
171
|
slots: {
|
|
166
|
-
root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-
|
|
167
|
-
image: "h-full w-full rounded-[inherit] object-cover",
|
|
168
|
-
fallback: "font-medium leading-none text-
|
|
169
|
-
icon: "text-
|
|
172
|
+
root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-(--ui-bg-elevated)",
|
|
173
|
+
image: "h-full w-full rounded-[inherit] object-cover data-[error]:hidden",
|
|
174
|
+
fallback: "font-medium leading-none text-(--ui-text-muted) truncate",
|
|
175
|
+
icon: "text-(--ui-text-muted) shrink-0"
|
|
170
176
|
},
|
|
171
177
|
variants: {
|
|
172
178
|
size: {
|
|
@@ -207,7 +213,7 @@ const avatar = {
|
|
|
207
213
|
const avatarGroup = {
|
|
208
214
|
slots: {
|
|
209
215
|
root: "inline-flex flex-row-reverse justify-end",
|
|
210
|
-
base: "relative rounded-full ring-
|
|
216
|
+
base: "relative rounded-full ring-(--ui-bg) first:me-0"
|
|
211
217
|
},
|
|
212
218
|
variants: {
|
|
213
219
|
size: {
|
|
@@ -245,6 +251,41 @@ const avatarGroup = {
|
|
|
245
251
|
}
|
|
246
252
|
};
|
|
247
253
|
|
|
254
|
+
const buttonGroupVariant = {
|
|
255
|
+
buttonGroup: {
|
|
256
|
+
horizontal: "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none",
|
|
257
|
+
vertical: "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
const buttonGroupVariantWithRoot = {
|
|
261
|
+
buttonGroup: {
|
|
262
|
+
horizontal: {
|
|
263
|
+
root: "group",
|
|
264
|
+
base: "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"
|
|
265
|
+
},
|
|
266
|
+
vertical: {
|
|
267
|
+
root: "group",
|
|
268
|
+
base: "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
const buttonGroup = {
|
|
273
|
+
base: "relative",
|
|
274
|
+
variants: {
|
|
275
|
+
size: {
|
|
276
|
+
xs: "",
|
|
277
|
+
sm: "",
|
|
278
|
+
md: "",
|
|
279
|
+
lg: "",
|
|
280
|
+
xl: ""
|
|
281
|
+
},
|
|
282
|
+
orientation: {
|
|
283
|
+
horizontal: "inline-flex -space-x-px",
|
|
284
|
+
vertical: "flex flex-col -space-y-px"
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
|
|
248
289
|
const badge = (options) => ({
|
|
249
290
|
slots: {
|
|
250
291
|
base: "font-medium inline-flex items-center",
|
|
@@ -255,6 +296,7 @@ const badge = (options) => ({
|
|
|
255
296
|
trailingIcon: "shrink-0"
|
|
256
297
|
},
|
|
257
298
|
variants: {
|
|
299
|
+
...buttonGroupVariant,
|
|
258
300
|
color: {
|
|
259
301
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
260
302
|
neutral: ""
|
|
@@ -301,35 +343,35 @@ const badge = (options) => ({
|
|
|
301
343
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
302
344
|
color,
|
|
303
345
|
variant: "solid",
|
|
304
|
-
class: `bg-
|
|
346
|
+
class: `bg-(--ui-${color}) text-(--ui-bg)`
|
|
305
347
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
306
348
|
color,
|
|
307
349
|
variant: "outline",
|
|
308
|
-
class: `text-
|
|
350
|
+
class: `text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/50`
|
|
309
351
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
310
352
|
color,
|
|
311
353
|
variant: "soft",
|
|
312
|
-
class: `bg-
|
|
354
|
+
class: `bg-(--ui-${color})/10 text-(--ui-${color})`
|
|
313
355
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
314
356
|
color,
|
|
315
357
|
variant: "subtle",
|
|
316
|
-
class: `bg-
|
|
358
|
+
class: `bg-(--ui-${color})/10 text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25`
|
|
317
359
|
})), {
|
|
318
360
|
color: "neutral",
|
|
319
361
|
variant: "solid",
|
|
320
|
-
class: "text-
|
|
362
|
+
class: "text-(--ui-bg) bg-(--ui-bg-inverted)"
|
|
321
363
|
}, {
|
|
322
364
|
color: "neutral",
|
|
323
365
|
variant: "outline",
|
|
324
|
-
class: "ring ring-inset ring-
|
|
366
|
+
class: "ring ring-inset ring-(--ui-border-accented) text-(--ui-text) bg-(--ui-bg)"
|
|
325
367
|
}, {
|
|
326
368
|
color: "neutral",
|
|
327
369
|
variant: "soft",
|
|
328
|
-
class: "text-
|
|
370
|
+
class: "text-(--ui-text) bg-(--ui-bg-elevated)"
|
|
329
371
|
}, {
|
|
330
372
|
color: "neutral",
|
|
331
373
|
variant: "subtle",
|
|
332
|
-
class: "ring ring-inset ring-
|
|
374
|
+
class: "ring ring-inset ring-(--ui-border-accented) text-(--ui-text) bg-(--ui-bg-elevated)"
|
|
333
375
|
}],
|
|
334
376
|
defaultVariants: {
|
|
335
377
|
color: "primary",
|
|
@@ -343,21 +385,21 @@ const breadcrumb = (options) => ({
|
|
|
343
385
|
root: "relative min-w-0",
|
|
344
386
|
list: "flex items-center gap-1.5",
|
|
345
387
|
item: "flex min-w-0",
|
|
346
|
-
link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-
|
|
388
|
+
link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-(--ui-primary)",
|
|
347
389
|
linkLeadingIcon: "shrink-0 size-5",
|
|
348
390
|
linkLeadingAvatar: "shrink-0",
|
|
349
391
|
linkLeadingAvatarSize: "2xs",
|
|
350
392
|
linkLabel: "truncate",
|
|
351
393
|
separator: "flex",
|
|
352
|
-
separatorIcon: "shrink-0 size-5 text-
|
|
394
|
+
separatorIcon: "shrink-0 size-5 text-(--ui-text-muted)"
|
|
353
395
|
},
|
|
354
396
|
variants: {
|
|
355
397
|
active: {
|
|
356
398
|
true: {
|
|
357
|
-
link: "text-
|
|
399
|
+
link: "text-(--ui-primary) font-semibold"
|
|
358
400
|
},
|
|
359
401
|
false: {
|
|
360
|
-
link: "text-
|
|
402
|
+
link: "text-(--ui-text-muted) font-medium"
|
|
361
403
|
}
|
|
362
404
|
},
|
|
363
405
|
disabled: {
|
|
@@ -374,46 +416,11 @@ const breadcrumb = (options) => ({
|
|
|
374
416
|
active: false,
|
|
375
417
|
to: true,
|
|
376
418
|
class: {
|
|
377
|
-
link: ["hover:text-
|
|
419
|
+
link: ["hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
378
420
|
}
|
|
379
421
|
}]
|
|
380
422
|
});
|
|
381
423
|
|
|
382
|
-
const buttonGroupVariant = {
|
|
383
|
-
buttonGroup: {
|
|
384
|
-
horizontal: "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none",
|
|
385
|
-
vertical: "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
const buttonGroupVariantWithRoot = {
|
|
389
|
-
buttonGroup: {
|
|
390
|
-
horizontal: {
|
|
391
|
-
root: "group",
|
|
392
|
-
base: "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"
|
|
393
|
-
},
|
|
394
|
-
vertical: {
|
|
395
|
-
root: "group",
|
|
396
|
-
base: "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
const buttonGroup = {
|
|
401
|
-
base: "relative",
|
|
402
|
-
variants: {
|
|
403
|
-
size: {
|
|
404
|
-
xs: "",
|
|
405
|
-
sm: "",
|
|
406
|
-
md: "",
|
|
407
|
-
lg: "",
|
|
408
|
-
xl: ""
|
|
409
|
-
},
|
|
410
|
-
orientation: {
|
|
411
|
-
horizontal: "inline-flex -space-x-px",
|
|
412
|
-
vertical: "flex flex-col -space-y-px"
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
|
|
417
424
|
const button = (options) => ({
|
|
418
425
|
slots: {
|
|
419
426
|
base: ["rounded-[calc(var(--ui-radius)*1.5)] font-medium inline-flex items-center focus:outline-hidden disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
@@ -472,7 +479,6 @@ const button = (options) => ({
|
|
|
472
479
|
block: {
|
|
473
480
|
true: {
|
|
474
481
|
base: "w-full justify-center",
|
|
475
|
-
leadingAvatarSize: "xs",
|
|
476
482
|
trailingIcon: "ms-auto"
|
|
477
483
|
}
|
|
478
484
|
},
|
|
@@ -492,51 +498,51 @@ const button = (options) => ({
|
|
|
492
498
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
493
499
|
color,
|
|
494
500
|
variant: "solid",
|
|
495
|
-
class: `text-
|
|
501
|
+
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})`
|
|
496
502
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
497
503
|
color,
|
|
498
504
|
variant: "outline",
|
|
499
|
-
class: `ring ring-inset ring-
|
|
505
|
+
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})`
|
|
500
506
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
501
507
|
color,
|
|
502
508
|
variant: "soft",
|
|
503
|
-
class: `text-
|
|
509
|
+
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`
|
|
504
510
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
505
511
|
color,
|
|
506
512
|
variant: "subtle",
|
|
507
|
-
class: `text-
|
|
513
|
+
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})`
|
|
508
514
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
509
515
|
color,
|
|
510
516
|
variant: "ghost",
|
|
511
|
-
class: `text-
|
|
517
|
+
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`
|
|
512
518
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
513
519
|
color,
|
|
514
520
|
variant: "link",
|
|
515
|
-
class: `text-
|
|
521
|
+
class: `text-(--ui-${color}) hover:text-(--ui-${color})/75 disabled:text-(--ui-${color}) aria-disabled:text-(--ui-${color}) focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
516
522
|
})), {
|
|
517
523
|
color: "neutral",
|
|
518
524
|
variant: "solid",
|
|
519
|
-
class: "text-
|
|
525
|
+
class: "text-(--ui-bg) bg-(--ui-bg-inverted) hover:bg-(--ui-bg-inverted)/90 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)"
|
|
520
526
|
}, {
|
|
521
527
|
color: "neutral",
|
|
522
528
|
variant: "outline",
|
|
523
|
-
class: "ring ring-inset ring-
|
|
529
|
+
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)"
|
|
524
530
|
}, {
|
|
525
531
|
color: "neutral",
|
|
526
532
|
variant: "soft",
|
|
527
|
-
class: "text-
|
|
533
|
+
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)"
|
|
528
534
|
}, {
|
|
529
535
|
color: "neutral",
|
|
530
536
|
variant: "subtle",
|
|
531
|
-
class: "ring ring-inset ring-
|
|
537
|
+
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)"
|
|
532
538
|
}, {
|
|
533
539
|
color: "neutral",
|
|
534
540
|
variant: "ghost",
|
|
535
|
-
class: "text-
|
|
541
|
+
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"
|
|
536
542
|
}, {
|
|
537
543
|
color: "neutral",
|
|
538
544
|
variant: "link",
|
|
539
|
-
class: "text-
|
|
545
|
+
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)"
|
|
540
546
|
}, {
|
|
541
547
|
size: "xs",
|
|
542
548
|
square: true,
|
|
@@ -590,17 +596,17 @@ const calendar = (options) => ({
|
|
|
590
596
|
gridBody: "grid",
|
|
591
597
|
headCell: "rounded-[calc(var(--ui-radius)*1.5)]",
|
|
592
598
|
cell: "relative text-center",
|
|
593
|
-
cellTrigger: ["m-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap focus-visible:ring-2 focus:outline-none data-disabled:text-
|
|
599
|
+
cellTrigger: ["m-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap focus-visible:ring-2 focus:outline-none data-disabled:text-(--ui-text-muted) data-unavailable:line-through data-unavailable:text-(--ui-text-muted) data-unavailable:pointer-events-none data-[selected]:text-(--ui-bg) data-today:font-semibold", options.theme.transitions && "transition"]
|
|
594
600
|
},
|
|
595
601
|
variants: {
|
|
596
602
|
color: {
|
|
597
603
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
598
|
-
headCell: `text-
|
|
599
|
-
cellTrigger: `focus-visible:ring-
|
|
604
|
+
headCell: `text-(--ui-${color})`,
|
|
605
|
+
cellTrigger: `focus-visible:ring-(--ui-${color}) data-[selected]:bg-(--ui-${color}) data-today:not-data-[selected]:text-(--ui-${color}) data-[highlighted]:bg-(--ui-${color})/20 hover:not-data-[selected]:bg-(--ui-${color})/20`
|
|
600
606
|
}])),
|
|
601
607
|
neutral: {
|
|
602
|
-
headCell: "text-
|
|
603
|
-
cellTrigger: "focus-visible:ring-
|
|
608
|
+
headCell: "text-(--ui-bg-inverted)",
|
|
609
|
+
cellTrigger: "focus-visible:ring-(--ui-border-inverted) data-[selected]:bg-(--ui-bg-inverted) data-today:not-data-[selected]:text-(--ui-bg-inverted) data-[highlighted]:bg-(--ui-bg-inverted)/20 hover:not-data-[selected]:bg-(--ui-bg-inverted)/10"
|
|
604
610
|
}
|
|
605
611
|
},
|
|
606
612
|
size: {
|
|
@@ -643,10 +649,29 @@ const calendar = (options) => ({
|
|
|
643
649
|
|
|
644
650
|
const card = {
|
|
645
651
|
slots: {
|
|
646
|
-
root: "
|
|
652
|
+
root: "rounded-[calc(var(--ui-radius)*2)]",
|
|
647
653
|
header: "p-4 sm:px-6",
|
|
648
654
|
body: "p-4 sm:p-6",
|
|
649
655
|
footer: "p-4 sm:px-6"
|
|
656
|
+
},
|
|
657
|
+
variants: {
|
|
658
|
+
variant: {
|
|
659
|
+
solid: {
|
|
660
|
+
root: "bg-(--ui-bg-inverted) text-(--ui-bg)"
|
|
661
|
+
},
|
|
662
|
+
outline: {
|
|
663
|
+
root: "bg-(--ui-bg) ring ring-(--ui-border) divide-y divide-(--ui-border)"
|
|
664
|
+
},
|
|
665
|
+
soft: {
|
|
666
|
+
root: "bg-(--ui-bg-elevated)/50 divide-y divide-(--ui-border)"
|
|
667
|
+
},
|
|
668
|
+
subtle: {
|
|
669
|
+
root: "bg-(--ui-bg-elevated)/50 ring ring-(--ui-border) divide-y divide-(--ui-border)"
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
defaultVariants: {
|
|
674
|
+
variant: "outline"
|
|
650
675
|
}
|
|
651
676
|
};
|
|
652
677
|
|
|
@@ -661,7 +686,7 @@ const carousel = (options) => ({
|
|
|
661
686
|
prev: "absolute rounded-full",
|
|
662
687
|
next: "absolute rounded-full",
|
|
663
688
|
dots: "absolute inset-x-0 -bottom-7 flex flex-wrap items-center justify-center gap-3",
|
|
664
|
-
dot: ["cursor-pointer size-3 bg-
|
|
689
|
+
dot: ["cursor-pointer size-3 bg-(--ui-border-accented) rounded-full", options.theme.transitions && "transition"]
|
|
665
690
|
},
|
|
666
691
|
variants: {
|
|
667
692
|
orientation: {
|
|
@@ -680,7 +705,7 @@ const carousel = (options) => ({
|
|
|
680
705
|
},
|
|
681
706
|
active: {
|
|
682
707
|
true: {
|
|
683
|
-
dot: "bg-
|
|
708
|
+
dot: "bg-(--ui-border-inverted)"
|
|
684
709
|
}
|
|
685
710
|
}
|
|
686
711
|
}
|
|
@@ -689,17 +714,17 @@ const carousel = (options) => ({
|
|
|
689
714
|
const checkbox = (options) => ({
|
|
690
715
|
slots: {
|
|
691
716
|
root: "relative flex items-start",
|
|
692
|
-
base: "shrink-0 flex items-center justify-center rounded-
|
|
717
|
+
base: "shrink-0 flex items-center justify-center rounded-(--ui-radius) text-(--ui-bg) ring ring-inset ring-(--ui-border-accented) focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
693
718
|
container: "flex items-center",
|
|
694
719
|
wrapper: "ms-2",
|
|
695
720
|
icon: "shrink-0 size-full",
|
|
696
|
-
label: "block font-medium text-
|
|
697
|
-
description: "text-
|
|
721
|
+
label: "block font-medium text-(--ui-text)",
|
|
722
|
+
description: "text-(--ui-text-muted)"
|
|
698
723
|
},
|
|
699
724
|
variants: {
|
|
700
725
|
color: {
|
|
701
|
-
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `focus-visible:outline-
|
|
702
|
-
neutral: "focus-visible:outline-
|
|
726
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `focus-visible:outline-(--ui-${color})`])),
|
|
727
|
+
neutral: "focus-visible:outline-(--ui-border-inverted)"
|
|
703
728
|
},
|
|
704
729
|
size: {
|
|
705
730
|
xs: {
|
|
@@ -730,7 +755,7 @@ const checkbox = (options) => ({
|
|
|
730
755
|
},
|
|
731
756
|
required: {
|
|
732
757
|
true: {
|
|
733
|
-
label: "after:content-['*'] after:ms-0.5 after:text-
|
|
758
|
+
label: "after:content-['*'] after:ms-0.5 after:text-(--ui-error)"
|
|
734
759
|
}
|
|
735
760
|
},
|
|
736
761
|
disabled: {
|
|
@@ -747,11 +772,11 @@ const checkbox = (options) => ({
|
|
|
747
772
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
748
773
|
color,
|
|
749
774
|
checked: true,
|
|
750
|
-
class: `ring-2 ring-
|
|
775
|
+
class: `ring-2 ring-(--ui-${color}) bg-(--ui-${color})`
|
|
751
776
|
})), {
|
|
752
777
|
color: "neutral",
|
|
753
778
|
checked: true,
|
|
754
|
-
class: "ring-2 ring-
|
|
779
|
+
class: "ring-2 ring-(--ui-border-inverted) bg-(--ui-bg-inverted)"
|
|
755
780
|
}],
|
|
756
781
|
defaultVariants: {
|
|
757
782
|
size: "md",
|
|
@@ -762,12 +787,12 @@ const checkbox = (options) => ({
|
|
|
762
787
|
const chip = (options) => ({
|
|
763
788
|
slots: {
|
|
764
789
|
root: "relative inline-flex items-center justify-center shrink-0",
|
|
765
|
-
base: "rounded-full ring ring-
|
|
790
|
+
base: "rounded-full ring ring-(--ui-bg) flex items-center justify-center text-(--ui-bg) font-medium whitespace-nowrap"
|
|
766
791
|
},
|
|
767
792
|
variants: {
|
|
768
793
|
color: {
|
|
769
|
-
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg-
|
|
770
|
-
neutral: "bg-
|
|
794
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg-(--ui-${color})`])),
|
|
795
|
+
neutral: "bg-(--ui-text-muted)"
|
|
771
796
|
},
|
|
772
797
|
size: {
|
|
773
798
|
"3xs": "h-[4px] min-w-[4px] text-[4px]",
|
|
@@ -830,9 +855,9 @@ const colorPicker = {
|
|
|
830
855
|
picker: "flex gap-4",
|
|
831
856
|
selector: "rounded-[calc(var(--ui-radius)*1.5)]",
|
|
832
857
|
selectorBackground: "w-full h-full relative rounded-[calc(var(--ui-radius)*1.2)]",
|
|
833
|
-
selectorThumb: "-translate-y-1/2 -translate-x-1/2 absolute size-4 ring-2 ring-
|
|
858
|
+
selectorThumb: "-translate-y-1/2 -translate-x-1/2 absolute size-4 ring-2 ring-(--color-white) rounded-full cursor-pointer data-[disabled]:cursor-not-allowed",
|
|
834
859
|
track: "w-[8px] relative rounded-[calc(var(--ui-radius)*1.5)]",
|
|
835
|
-
trackThumb: "absolute transform -translate-y-1/2 -translate-x-[4px] rtl:translate-x-[4px] size-4 rounded-full ring-2 ring-
|
|
860
|
+
trackThumb: "absolute transform -translate-y-1/2 -translate-x-[4px] rtl:translate-x-[4px] size-4 rounded-full ring-2 ring-(--color-white) cursor-pointer data-[disabled]:cursor-not-allowed"
|
|
836
861
|
},
|
|
837
862
|
variants: {
|
|
838
863
|
size: {
|
|
@@ -866,14 +891,14 @@ const colorPicker = {
|
|
|
866
891
|
|
|
867
892
|
const commandPalette = (options) => ({
|
|
868
893
|
slots: {
|
|
869
|
-
root: "flex flex-col min-h-0 min-w-0 divide-y divide-
|
|
894
|
+
root: "flex flex-col min-h-0 min-w-0 divide-y divide-(--ui-border)",
|
|
870
895
|
input: "[&>input]:h-12",
|
|
871
896
|
close: "",
|
|
872
897
|
content: "relative overflow-hidden flex flex-col",
|
|
873
|
-
viewport: "relative divide-y divide-
|
|
898
|
+
viewport: "relative divide-y divide-(--ui-border) scroll-py-1 overflow-y-auto flex-1 focus:outline-none",
|
|
874
899
|
group: "p-1 isolate",
|
|
875
|
-
empty: "py-6 text-center text-sm text-
|
|
876
|
-
label: "px-2 py-1.5 text-xs font-semibold text-
|
|
900
|
+
empty: "py-6 text-center text-sm text-(--ui-text-muted)",
|
|
901
|
+
label: "px-2 py-1.5 text-xs font-semibold text-(--ui-text-highlighted)",
|
|
877
902
|
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",
|
|
878
903
|
itemLeadingIcon: "shrink-0 size-5",
|
|
879
904
|
itemLeadingAvatar: "shrink-0",
|
|
@@ -882,23 +907,23 @@ const commandPalette = (options) => ({
|
|
|
882
907
|
itemLeadingChipSize: "md",
|
|
883
908
|
itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
884
909
|
itemTrailingIcon: "shrink-0 size-5",
|
|
885
|
-
itemTrailingHighlightedIcon: "shrink-0 size-5 text-
|
|
910
|
+
itemTrailingHighlightedIcon: "shrink-0 size-5 text-(--ui-text-dimmed) hidden group-data-highlighted:inline-flex",
|
|
886
911
|
itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0 gap-0.5",
|
|
887
912
|
itemTrailingKbdsSize: "md",
|
|
888
913
|
itemLabel: "truncate space-x-1 rtl:space-x-reverse",
|
|
889
|
-
itemLabelBase: "text-
|
|
890
|
-
itemLabelPrefix: "text-
|
|
891
|
-
itemLabelSuffix: "text-
|
|
914
|
+
itemLabelBase: "text-(--ui-text-highlighted) [&>mark]:text-(--ui-bg) [&>mark]:bg-(--ui-primary)",
|
|
915
|
+
itemLabelPrefix: "text-(--ui-text)",
|
|
916
|
+
itemLabelSuffix: "text-(--ui-text-dimmed) [&>mark]:text-(--ui-bg) [&>mark]:bg-(--ui-primary)"
|
|
892
917
|
},
|
|
893
918
|
variants: {
|
|
894
919
|
active: {
|
|
895
920
|
true: {
|
|
896
|
-
item: "text-
|
|
897
|
-
itemLeadingIcon: "text-
|
|
921
|
+
item: "text-(--ui-text-highlighted) before:bg-(--ui-bg-elevated)",
|
|
922
|
+
itemLeadingIcon: "text-(--ui-text)"
|
|
898
923
|
},
|
|
899
924
|
false: {
|
|
900
|
-
item: ["text-
|
|
901
|
-
itemLeadingIcon: ["text-
|
|
925
|
+
item: ["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"],
|
|
926
|
+
itemLeadingIcon: ["text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
902
927
|
}
|
|
903
928
|
},
|
|
904
929
|
loading: {
|
|
@@ -910,15 +935,15 @@ const commandPalette = (options) => ({
|
|
|
910
935
|
});
|
|
911
936
|
|
|
912
937
|
const container = {
|
|
913
|
-
base: "max-w-
|
|
938
|
+
base: "max-w-(--ui-container) mx-auto px-4 sm:px-6 lg:px-8"
|
|
914
939
|
};
|
|
915
940
|
|
|
916
941
|
const contextMenu = (options) => ({
|
|
917
942
|
slots: {
|
|
918
|
-
content: "min-w-32 bg-
|
|
943
|
+
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]",
|
|
919
944
|
group: "p-1 isolate",
|
|
920
|
-
label: "w-full flex items-center font-semibold text-
|
|
921
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
945
|
+
label: "w-full flex items-center font-semibold text-(--ui-text-highlighted)",
|
|
946
|
+
separator: "-mx-1 my-1 h-px bg-(--ui-border)",
|
|
922
947
|
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",
|
|
923
948
|
itemLeadingIcon: "shrink-0",
|
|
924
949
|
itemLeadingAvatar: "shrink-0",
|
|
@@ -928,7 +953,7 @@ const contextMenu = (options) => ({
|
|
|
928
953
|
itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
|
|
929
954
|
itemTrailingKbdsSize: "",
|
|
930
955
|
itemLabel: "truncate",
|
|
931
|
-
itemLabelExternalIcon: "inline-block size-3 align-top text-
|
|
956
|
+
itemLabelExternalIcon: "inline-block size-3 align-top text-(--ui-text-dimmed)"
|
|
932
957
|
},
|
|
933
958
|
variants: {
|
|
934
959
|
color: {
|
|
@@ -937,12 +962,12 @@ const contextMenu = (options) => ({
|
|
|
937
962
|
},
|
|
938
963
|
active: {
|
|
939
964
|
true: {
|
|
940
|
-
item: "text-
|
|
941
|
-
itemLeadingIcon: "text-
|
|
965
|
+
item: "text-(--ui-text-highlighted) before:bg-(--ui-bg-elevated)",
|
|
966
|
+
itemLeadingIcon: "text-(--ui-text)"
|
|
942
967
|
},
|
|
943
968
|
false: {
|
|
944
|
-
item: ["text-
|
|
945
|
-
itemLeadingIcon: ["text-
|
|
969
|
+
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"],
|
|
970
|
+
itemLeadingIcon: ["text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text) group-data-[state=open]:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
946
971
|
}
|
|
947
972
|
},
|
|
948
973
|
loading: {
|
|
@@ -1002,15 +1027,15 @@ const contextMenu = (options) => ({
|
|
|
1002
1027
|
color,
|
|
1003
1028
|
active: false,
|
|
1004
1029
|
class: {
|
|
1005
|
-
item: `text-
|
|
1006
|
-
itemLeadingIcon: `text-
|
|
1030
|
+
item: `text-(--ui-${color}) data-highlighted:text-(--ui-${color}) data-highlighted:before:bg-(--ui-${color})/10 data-[state=open]:before:bg-(--ui-${color})/10`,
|
|
1031
|
+
itemLeadingIcon: `text-(--ui-${color})/75 group-data-highlighted:text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
|
1007
1032
|
}
|
|
1008
1033
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
1009
1034
|
color,
|
|
1010
1035
|
active: true,
|
|
1011
1036
|
class: {
|
|
1012
|
-
item: `text-
|
|
1013
|
-
itemLeadingIcon: `text-
|
|
1037
|
+
item: `text-(--ui-${color}) before:bg-(--ui-${color})/10`,
|
|
1038
|
+
itemLeadingIcon: `text-(--ui-${color})`
|
|
1014
1039
|
}
|
|
1015
1040
|
}))],
|
|
1016
1041
|
defaultVariants: {
|
|
@@ -1020,58 +1045,111 @@ const contextMenu = (options) => ({
|
|
|
1020
1045
|
|
|
1021
1046
|
const drawer = {
|
|
1022
1047
|
slots: {
|
|
1023
|
-
overlay: "fixed inset-0 bg-
|
|
1024
|
-
content: "fixed bg-
|
|
1025
|
-
handle: "shrink-0 rounded-full bg-
|
|
1048
|
+
overlay: "fixed inset-0 bg-(--ui-bg-elevated)/75",
|
|
1049
|
+
content: "fixed bg-(--ui-bg) ring ring-(--ui-border) flex focus:outline-none",
|
|
1050
|
+
handle: "shrink-0 rounded-full bg-(--ui-bg-accented)",
|
|
1026
1051
|
container: "w-full flex flex-col gap-4 p-4 overflow-y-auto",
|
|
1027
1052
|
header: "",
|
|
1028
|
-
title: "text-
|
|
1029
|
-
description: "mt-1 text-
|
|
1053
|
+
title: "text-(--ui-text-highlighted) font-semibold",
|
|
1054
|
+
description: "mt-1 text-(--ui-text-muted) text-sm",
|
|
1030
1055
|
body: "flex-1",
|
|
1031
1056
|
footer: "flex flex-col gap-1.5"
|
|
1032
1057
|
},
|
|
1033
1058
|
variants: {
|
|
1034
1059
|
direction: {
|
|
1035
1060
|
top: {
|
|
1036
|
-
content: "
|
|
1061
|
+
content: "mb-24 flex-col-reverse",
|
|
1037
1062
|
handle: "mb-4"
|
|
1038
1063
|
},
|
|
1039
1064
|
right: {
|
|
1040
|
-
content: "
|
|
1065
|
+
content: "flex-row",
|
|
1041
1066
|
handle: "ml-4"
|
|
1042
1067
|
},
|
|
1043
1068
|
bottom: {
|
|
1044
|
-
content: "
|
|
1069
|
+
content: "mt-24 flex-col",
|
|
1045
1070
|
handle: "mt-4"
|
|
1046
1071
|
},
|
|
1047
1072
|
left: {
|
|
1048
|
-
content: "
|
|
1073
|
+
content: "flex-row-reverse",
|
|
1049
1074
|
handle: "mr-4"
|
|
1050
1075
|
}
|
|
1076
|
+
},
|
|
1077
|
+
inset: {
|
|
1078
|
+
true: {
|
|
1079
|
+
content: "rounded-[calc(var(--ui-radius)*2)] after:hidden"
|
|
1080
|
+
}
|
|
1051
1081
|
}
|
|
1052
1082
|
},
|
|
1053
1083
|
compoundVariants: [{
|
|
1054
1084
|
direction: ["top", "bottom"],
|
|
1055
1085
|
class: {
|
|
1056
|
-
content: "
|
|
1086
|
+
content: "h-auto max-h-[96%]",
|
|
1057
1087
|
handle: "w-12 h-1.5 mx-auto"
|
|
1058
1088
|
}
|
|
1059
1089
|
}, {
|
|
1060
1090
|
direction: ["right", "left"],
|
|
1061
1091
|
class: {
|
|
1062
|
-
content: "
|
|
1092
|
+
content: "w-auto max-w-[calc(100%-2rem)]",
|
|
1063
1093
|
handle: "h-12 w-1.5 mt-auto mb-auto"
|
|
1064
1094
|
}
|
|
1095
|
+
}, {
|
|
1096
|
+
direction: "top",
|
|
1097
|
+
inset: true,
|
|
1098
|
+
class: {
|
|
1099
|
+
content: "inset-x-4 top-4"
|
|
1100
|
+
}
|
|
1101
|
+
}, {
|
|
1102
|
+
direction: "top",
|
|
1103
|
+
inset: false,
|
|
1104
|
+
class: {
|
|
1105
|
+
content: "inset-x-0 top-0 rounded-b-[calc(var(--ui-radius)*2)]"
|
|
1106
|
+
}
|
|
1107
|
+
}, {
|
|
1108
|
+
direction: "bottom",
|
|
1109
|
+
inset: true,
|
|
1110
|
+
class: {
|
|
1111
|
+
content: "inset-x-4 bottom-4"
|
|
1112
|
+
}
|
|
1113
|
+
}, {
|
|
1114
|
+
direction: "bottom",
|
|
1115
|
+
inset: false,
|
|
1116
|
+
class: {
|
|
1117
|
+
content: "inset-x-0 bottom-0 rounded-t-[calc(var(--ui-radius)*2)]"
|
|
1118
|
+
}
|
|
1119
|
+
}, {
|
|
1120
|
+
direction: "left",
|
|
1121
|
+
inset: true,
|
|
1122
|
+
class: {
|
|
1123
|
+
content: "inset-y-4 left-4"
|
|
1124
|
+
}
|
|
1125
|
+
}, {
|
|
1126
|
+
direction: "left",
|
|
1127
|
+
inset: false,
|
|
1128
|
+
class: {
|
|
1129
|
+
content: "inset-y-0 left-0 rounded-r-[calc(var(--ui-radius)*2)]"
|
|
1130
|
+
}
|
|
1131
|
+
}, {
|
|
1132
|
+
direction: "right",
|
|
1133
|
+
inset: true,
|
|
1134
|
+
class: {
|
|
1135
|
+
content: "inset-y-4 right-4"
|
|
1136
|
+
}
|
|
1137
|
+
}, {
|
|
1138
|
+
direction: "right",
|
|
1139
|
+
inset: false,
|
|
1140
|
+
class: {
|
|
1141
|
+
content: "inset-y-0 right-0 rounded-l-[calc(var(--ui-radius)*2)]"
|
|
1142
|
+
}
|
|
1065
1143
|
}]
|
|
1066
1144
|
};
|
|
1067
1145
|
|
|
1068
1146
|
const dropdownMenu = (options) => ({
|
|
1069
1147
|
slots: {
|
|
1070
|
-
content: "min-w-32 bg-
|
|
1071
|
-
arrow: "fill-
|
|
1148
|
+
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]",
|
|
1149
|
+
arrow: "fill-(--ui-border)",
|
|
1072
1150
|
group: "p-1 isolate",
|
|
1073
|
-
label: "w-full flex items-center font-semibold text-
|
|
1074
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
1151
|
+
label: "w-full flex items-center font-semibold text-(--ui-text-highlighted)",
|
|
1152
|
+
separator: "-mx-1 my-1 h-px bg-(--ui-border)",
|
|
1075
1153
|
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",
|
|
1076
1154
|
itemLeadingIcon: "shrink-0",
|
|
1077
1155
|
itemLeadingAvatar: "shrink-0",
|
|
@@ -1081,7 +1159,7 @@ const dropdownMenu = (options) => ({
|
|
|
1081
1159
|
itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
|
|
1082
1160
|
itemTrailingKbdsSize: "",
|
|
1083
1161
|
itemLabel: "truncate",
|
|
1084
|
-
itemLabelExternalIcon: "inline-block size-3 align-top text-
|
|
1162
|
+
itemLabelExternalIcon: "inline-block size-3 align-top text-(--ui-text-dimmed)"
|
|
1085
1163
|
},
|
|
1086
1164
|
variants: {
|
|
1087
1165
|
color: {
|
|
@@ -1090,12 +1168,12 @@ const dropdownMenu = (options) => ({
|
|
|
1090
1168
|
},
|
|
1091
1169
|
active: {
|
|
1092
1170
|
true: {
|
|
1093
|
-
item: "text-
|
|
1094
|
-
itemLeadingIcon: "text-
|
|
1171
|
+
item: "text-(--ui-text-highlighted) before:bg-(--ui-bg-elevated)",
|
|
1172
|
+
itemLeadingIcon: "text-(--ui-text)"
|
|
1095
1173
|
},
|
|
1096
1174
|
false: {
|
|
1097
|
-
item: ["text-
|
|
1098
|
-
itemLeadingIcon: ["text-
|
|
1175
|
+
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"],
|
|
1176
|
+
itemLeadingIcon: ["text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text) group-data-[state=open]:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
1099
1177
|
}
|
|
1100
1178
|
},
|
|
1101
1179
|
loading: {
|
|
@@ -1155,15 +1233,15 @@ const dropdownMenu = (options) => ({
|
|
|
1155
1233
|
color,
|
|
1156
1234
|
active: false,
|
|
1157
1235
|
class: {
|
|
1158
|
-
item: `text-
|
|
1159
|
-
itemLeadingIcon: `text-
|
|
1236
|
+
item: `text-(--ui-${color}) data-highlighted:text-(--ui-${color}) data-highlighted:before:bg-(--ui-${color})/10 data-[state=open]:before:bg-(--ui-${color})/10`,
|
|
1237
|
+
itemLeadingIcon: `text-(--ui-${color})/75 group-data-highlighted:text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
|
1160
1238
|
}
|
|
1161
1239
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
1162
1240
|
color,
|
|
1163
1241
|
active: true,
|
|
1164
1242
|
class: {
|
|
1165
|
-
item: `text-
|
|
1166
|
-
itemLeadingIcon: `text-
|
|
1243
|
+
item: `text-(--ui-${color}) before:bg-(--ui-${color})/10`,
|
|
1244
|
+
itemLeadingIcon: `text-(--ui-${color})`
|
|
1167
1245
|
}
|
|
1168
1246
|
}))],
|
|
1169
1247
|
defaultVariants: {
|
|
@@ -1180,12 +1258,12 @@ const formField = {
|
|
|
1180
1258
|
root: "",
|
|
1181
1259
|
wrapper: "",
|
|
1182
1260
|
labelWrapper: "flex content-center items-center justify-between",
|
|
1183
|
-
label: "block font-medium text-
|
|
1261
|
+
label: "block font-medium text-(--ui-text)",
|
|
1184
1262
|
container: "mt-1 relative",
|
|
1185
|
-
description: "text-
|
|
1186
|
-
error: "mt-2 text-
|
|
1187
|
-
hint: "text-
|
|
1188
|
-
help: "mt-2 text-
|
|
1263
|
+
description: "text-(--ui-text-muted)",
|
|
1264
|
+
error: "mt-2 text-(--ui-error)",
|
|
1265
|
+
hint: "text-(--ui-text-muted)",
|
|
1266
|
+
help: "mt-2 text-(--ui-text-muted)"
|
|
1189
1267
|
},
|
|
1190
1268
|
variants: {
|
|
1191
1269
|
size: {
|
|
@@ -1197,7 +1275,7 @@ const formField = {
|
|
|
1197
1275
|
},
|
|
1198
1276
|
required: {
|
|
1199
1277
|
true: {
|
|
1200
|
-
label: `after:content-['*'] after:ms-0.5 after:text-
|
|
1278
|
+
label: `after:content-['*'] after:ms-0.5 after:text-(--ui-error)`
|
|
1201
1279
|
}
|
|
1202
1280
|
}
|
|
1203
1281
|
},
|
|
@@ -1209,13 +1287,13 @@ const formField = {
|
|
|
1209
1287
|
const input = (options) => ({
|
|
1210
1288
|
slots: {
|
|
1211
1289
|
root: "relative inline-flex items-center",
|
|
1212
|
-
base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-
|
|
1290
|
+
base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
1213
1291
|
leading: "absolute inset-y-0 start-0 flex items-center",
|
|
1214
|
-
leadingIcon: "shrink-0 text-
|
|
1292
|
+
leadingIcon: "shrink-0 text-(--ui-text-dimmed)",
|
|
1215
1293
|
leadingAvatar: "shrink-0",
|
|
1216
1294
|
leadingAvatarSize: "",
|
|
1217
1295
|
trailing: "absolute inset-y-0 end-0 flex items-center",
|
|
1218
|
-
trailingIcon: "shrink-0 text-
|
|
1296
|
+
trailingIcon: "shrink-0 text-(--ui-text-dimmed)"
|
|
1219
1297
|
},
|
|
1220
1298
|
variants: {
|
|
1221
1299
|
...buttonGroupVariantWithRoot,
|
|
@@ -1262,11 +1340,11 @@ const input = (options) => ({
|
|
|
1262
1340
|
}
|
|
1263
1341
|
},
|
|
1264
1342
|
variant: {
|
|
1265
|
-
outline: "text-
|
|
1266
|
-
soft: "text-
|
|
1267
|
-
subtle: "text-
|
|
1268
|
-
ghost: "text-
|
|
1269
|
-
none: "text-
|
|
1343
|
+
outline: "text-(--ui-text-highlighted) bg-(--ui-bg) ring ring-inset ring-(--ui-border-accented)",
|
|
1344
|
+
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",
|
|
1345
|
+
subtle: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated) ring ring-inset ring-(--ui-border-accented)",
|
|
1346
|
+
ghost: "text-(--ui-text-highlighted) bg-transparent hover:bg-(--ui-bg-elevated) focus:bg-(--ui-bg-elevated) disabled:bg-transparent dark:disabled:bg-transparent",
|
|
1347
|
+
none: "text-(--ui-text-highlighted) bg-transparent"
|
|
1270
1348
|
},
|
|
1271
1349
|
color: {
|
|
1272
1350
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
@@ -1285,25 +1363,25 @@ const input = (options) => ({
|
|
|
1285
1363
|
true: ""
|
|
1286
1364
|
},
|
|
1287
1365
|
type: {
|
|
1288
|
-
file: "file:me-1.5 file:font-medium file:text-
|
|
1366
|
+
file: "file:me-1.5 file:font-medium file:text-(--ui-text-muted) file:outline-none"
|
|
1289
1367
|
}
|
|
1290
1368
|
},
|
|
1291
1369
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
1292
1370
|
color,
|
|
1293
1371
|
variant: ["outline", "subtle"],
|
|
1294
|
-
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
1372
|
+
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
1295
1373
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
1296
1374
|
color,
|
|
1297
1375
|
highlight: true,
|
|
1298
|
-
class: `ring ring-inset ring-
|
|
1376
|
+
class: `ring ring-inset ring-(--ui-${color})`
|
|
1299
1377
|
})), {
|
|
1300
1378
|
color: "neutral",
|
|
1301
1379
|
variant: ["outline", "subtle"],
|
|
1302
|
-
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
1380
|
+
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)"
|
|
1303
1381
|
}, {
|
|
1304
1382
|
color: "neutral",
|
|
1305
1383
|
highlight: true,
|
|
1306
|
-
class: "ring ring-inset ring-
|
|
1384
|
+
class: "ring ring-inset ring-(--ui-border-inverted)"
|
|
1307
1385
|
}, {
|
|
1308
1386
|
leading: true,
|
|
1309
1387
|
size: "xs",
|
|
@@ -1370,15 +1448,15 @@ const inputMenu = (options) => {
|
|
|
1370
1448
|
slots: {
|
|
1371
1449
|
base: () => ["rounded-[calc(var(--ui-radius)*1.5)]", options.theme.transitions && "transition-colors"],
|
|
1372
1450
|
trailing: "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
|
|
1373
|
-
arrow: "fill-
|
|
1374
|
-
content: "max-h-60 w-
|
|
1375
|
-
viewport: "divide-y divide-
|
|
1451
|
+
arrow: "fill-(--ui-border)",
|
|
1452
|
+
content: "max-h-60 w-(--reka-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] pointer-events-auto",
|
|
1453
|
+
viewport: "divide-y divide-(--ui-border) scroll-py-1",
|
|
1376
1454
|
group: "p-1 isolate",
|
|
1377
|
-
empty: "py-2 text-center text-sm text-
|
|
1378
|
-
label: "font-semibold text-
|
|
1379
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
1380
|
-
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-
|
|
1381
|
-
itemLeadingIcon: ["shrink-0 text-
|
|
1455
|
+
empty: "py-2 text-center text-sm text-(--ui-text-muted)",
|
|
1456
|
+
label: "font-semibold text-(--ui-text-highlighted)",
|
|
1457
|
+
separator: "-mx-1 my-1 h-px bg-(--ui-border)",
|
|
1458
|
+
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"],
|
|
1459
|
+
itemLeadingIcon: ["shrink-0 text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text)", options.theme.transitions && "transition-colors"],
|
|
1382
1460
|
itemLeadingAvatar: "shrink-0",
|
|
1383
1461
|
itemLeadingAvatarSize: "",
|
|
1384
1462
|
itemLeadingChip: "shrink-0",
|
|
@@ -1386,9 +1464,9 @@ const inputMenu = (options) => {
|
|
|
1386
1464
|
itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
1387
1465
|
itemTrailingIcon: "shrink-0",
|
|
1388
1466
|
itemLabel: "truncate",
|
|
1389
|
-
tagsItem: "px-1.5 py-0.5 rounded-
|
|
1467
|
+
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",
|
|
1390
1468
|
tagsItemText: "truncate",
|
|
1391
|
-
tagsItemDelete: ["inline-flex items-center rounded-[calc(var(--ui-radius)/2)] text-
|
|
1469
|
+
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"],
|
|
1392
1470
|
tagsItemDeleteIcon: "",
|
|
1393
1471
|
tagsInput: ""
|
|
1394
1472
|
},
|
|
@@ -1396,10 +1474,10 @@ const inputMenu = (options) => {
|
|
|
1396
1474
|
multiple: {
|
|
1397
1475
|
true: {
|
|
1398
1476
|
root: "flex-wrap",
|
|
1399
|
-
tagsInput: "border-0 bg-transparent placeholder:text-
|
|
1477
|
+
tagsInput: "border-0 bg-transparent placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
|
|
1400
1478
|
},
|
|
1401
1479
|
false: {
|
|
1402
|
-
base: "w-full border-0 placeholder:text-
|
|
1480
|
+
base: "w-full border-0 placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
|
|
1403
1481
|
}
|
|
1404
1482
|
},
|
|
1405
1483
|
size: {
|
|
@@ -1464,12 +1542,12 @@ const inputMenu = (options) => {
|
|
|
1464
1542
|
color,
|
|
1465
1543
|
multiple: true,
|
|
1466
1544
|
variant: ["outline", "subtle"],
|
|
1467
|
-
class: `has-focus-visible:ring-2 has-focus-visible:ring-
|
|
1545
|
+
class: `has-focus-visible:ring-2 has-focus-visible:ring-(--ui-${color})`
|
|
1468
1546
|
})), {
|
|
1469
1547
|
color: "neutral",
|
|
1470
1548
|
multiple: true,
|
|
1471
1549
|
variant: ["outline", "subtle"],
|
|
1472
|
-
class: "has-focus-visible:ring-2 has-focus-visible:ring-
|
|
1550
|
+
class: "has-focus-visible:ring-2 has-focus-visible:ring-(--ui-border-inverted)"
|
|
1473
1551
|
}]
|
|
1474
1552
|
}, input(options));
|
|
1475
1553
|
};
|
|
@@ -1479,7 +1557,7 @@ const inputNumber = (options) => {
|
|
|
1479
1557
|
return {
|
|
1480
1558
|
slots: {
|
|
1481
1559
|
root: "relative inline-flex items-center",
|
|
1482
|
-
base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-
|
|
1560
|
+
base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
1483
1561
|
increment: "absolute flex items-center",
|
|
1484
1562
|
decrement: "absolute flex items-center"
|
|
1485
1563
|
},
|
|
@@ -1522,19 +1600,19 @@ const inputNumber = (options) => {
|
|
|
1522
1600
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
1523
1601
|
color,
|
|
1524
1602
|
variant: ["outline", "subtle"],
|
|
1525
|
-
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
1603
|
+
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
1526
1604
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
1527
1605
|
color,
|
|
1528
1606
|
highlight: true,
|
|
1529
|
-
class: `ring ring-inset ring-
|
|
1607
|
+
class: `ring ring-inset ring-(--ui-${color})`
|
|
1530
1608
|
})), {
|
|
1531
1609
|
color: "neutral",
|
|
1532
1610
|
variant: ["outline", "subtle"],
|
|
1533
|
-
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
1611
|
+
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)"
|
|
1534
1612
|
}, {
|
|
1535
1613
|
color: "neutral",
|
|
1536
1614
|
highlight: true,
|
|
1537
|
-
class: "ring ring-inset ring-
|
|
1615
|
+
class: "ring ring-inset ring-(--ui-border-inverted)"
|
|
1538
1616
|
}, {
|
|
1539
1617
|
orientation: "horizontal",
|
|
1540
1618
|
size: "xs",
|
|
@@ -1585,12 +1663,12 @@ const inputNumber = (options) => {
|
|
|
1585
1663
|
};
|
|
1586
1664
|
|
|
1587
1665
|
const kbd = {
|
|
1588
|
-
base: "inline-flex items-center justify-center px-1 rounded-
|
|
1666
|
+
base: "inline-flex items-center justify-center px-1 rounded-(--ui-radius) font-medium font-sans",
|
|
1589
1667
|
variants: {
|
|
1590
1668
|
variant: {
|
|
1591
|
-
solid: "bg-
|
|
1592
|
-
outline: "bg-
|
|
1593
|
-
subtle: "bg-
|
|
1669
|
+
solid: "bg-(--ui-bg-inverted) text-(--ui-bg)",
|
|
1670
|
+
outline: "bg-(--ui-bg) text-(--ui-text-highlighted) ring ring-inset ring-(--ui-border-accented)",
|
|
1671
|
+
subtle: "bg-(--ui-bg-elevated) text-(--ui-text) ring ring-inset ring-(--ui-border-accented)"
|
|
1594
1672
|
},
|
|
1595
1673
|
size: {
|
|
1596
1674
|
sm: "h-4 min-w-[16px] text-[10px]",
|
|
@@ -1605,11 +1683,11 @@ const kbd = {
|
|
|
1605
1683
|
};
|
|
1606
1684
|
|
|
1607
1685
|
const link = (options) => ({
|
|
1608
|
-
base: "focus-visible:outline-
|
|
1686
|
+
base: "focus-visible:outline-(--ui-primary)",
|
|
1609
1687
|
variants: {
|
|
1610
1688
|
active: {
|
|
1611
|
-
true: "text-
|
|
1612
|
-
false: ["text-
|
|
1689
|
+
true: "text-(--ui-primary)",
|
|
1690
|
+
false: ["text-(--ui-text-muted) hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
1613
1691
|
},
|
|
1614
1692
|
disabled: {
|
|
1615
1693
|
true: "cursor-not-allowed opacity-75"
|
|
@@ -1619,13 +1697,13 @@ const link = (options) => ({
|
|
|
1619
1697
|
|
|
1620
1698
|
const modal = {
|
|
1621
1699
|
slots: {
|
|
1622
|
-
overlay: "fixed inset-0 bg-
|
|
1623
|
-
content: "fixed
|
|
1700
|
+
overlay: "fixed inset-0 bg-(--ui-bg-elevated)/75",
|
|
1701
|
+
content: "fixed bg-(--ui-bg) divide-y divide-(--ui-border) flex flex-col focus:outline-none",
|
|
1624
1702
|
header: "px-4 py-5 sm:px-6",
|
|
1625
1703
|
body: "flex-1 overflow-y-auto p-4 sm:p-6",
|
|
1626
1704
|
footer: "flex items-center gap-1.5 p-4 sm:px-6",
|
|
1627
|
-
title: "text-
|
|
1628
|
-
description: "mt-1 text-
|
|
1705
|
+
title: "text-(--ui-text-highlighted) font-semibold",
|
|
1706
|
+
description: "mt-1 text-(--ui-text-muted) text-sm",
|
|
1629
1707
|
close: "absolute top-4 end-4"
|
|
1630
1708
|
},
|
|
1631
1709
|
variants: {
|
|
@@ -1640,7 +1718,7 @@ const modal = {
|
|
|
1640
1718
|
content: "inset-0"
|
|
1641
1719
|
},
|
|
1642
1720
|
false: {
|
|
1643
|
-
content: "top-
|
|
1721
|
+
content: "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[calc(100vw-2rem)] max-w-lg max-h-[calc(100vh-2rem)] sm:max-h-[calc(100vh-4rem)] rounded-[calc(var(--ui-radius)*2)] shadow-lg ring ring-(--ui-border)"
|
|
1644
1722
|
}
|
|
1645
1723
|
}
|
|
1646
1724
|
}
|
|
@@ -1650,6 +1728,7 @@ const navigationMenu = (options) => ({
|
|
|
1650
1728
|
slots: {
|
|
1651
1729
|
root: "relative flex gap-1.5 [&>div]:min-w-0",
|
|
1652
1730
|
list: "isolate min-w-0",
|
|
1731
|
+
label: "w-full flex items-center gap-1.5 font-semibold text-xs/5 text-(--ui-text-highlighted) px-2.5 py-1.5",
|
|
1653
1732
|
item: "min-w-0",
|
|
1654
1733
|
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",
|
|
1655
1734
|
linkLeadingIcon: "shrink-0 size-5",
|
|
@@ -1660,31 +1739,31 @@ const navigationMenu = (options) => ({
|
|
|
1660
1739
|
linkTrailingBadgeSize: "sm",
|
|
1661
1740
|
linkTrailingIcon: "size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",
|
|
1662
1741
|
linkLabel: "truncate",
|
|
1663
|
-
linkLabelExternalIcon: "inline-block size-3 align-top text-
|
|
1742
|
+
linkLabelExternalIcon: "inline-block size-3 align-top text-(--ui-text-dimmed)",
|
|
1664
1743
|
childList: "",
|
|
1665
1744
|
childItem: "",
|
|
1666
1745
|
childLink: "group size-full px-3 py-2 rounded-[calc(var(--ui-radius)*1.5)] flex items-start gap-2 text-start",
|
|
1667
1746
|
childLinkWrapper: "flex flex-col items-start",
|
|
1668
1747
|
childLinkIcon: "size-5 shrink-0",
|
|
1669
1748
|
childLinkLabel: "font-semibold text-sm relative inline-flex",
|
|
1670
|
-
childLinkLabelExternalIcon: "inline-block size-3 align-top text-
|
|
1671
|
-
childLinkDescription: "text-sm text-
|
|
1672
|
-
separator: "px-2 h-px bg-
|
|
1673
|
-
viewportWrapper: "absolute top-full left-0 flex w-full
|
|
1674
|
-
viewport: "relative overflow-hidden bg-
|
|
1675
|
-
content: "absolute top-0 left-0 w-full
|
|
1676
|
-
indicator: "absolute data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] data-[state=hidden]:opacity-0 bottom-0 z-[1] w-
|
|
1677
|
-
arrow: "relative top-[50%] size-2.5 rotate-45 border border-
|
|
1749
|
+
childLinkLabelExternalIcon: "inline-block size-3 align-top text-(--ui-text-dimmed)",
|
|
1750
|
+
childLinkDescription: "text-sm text-(--ui-text-muted)",
|
|
1751
|
+
separator: "px-2 h-px bg-(--ui-border)",
|
|
1752
|
+
viewportWrapper: "absolute top-full left-0 flex w-full",
|
|
1753
|
+
viewport: "relative overflow-hidden bg-(--ui-bg) shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-(--ui-border) h-(--reka-navigation-menu-viewport-height) w-full transition-[width,height,left] duration-200 origin-[top_center] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
1754
|
+
content: "absolute top-0 left-0 w-full",
|
|
1755
|
+
indicator: "absolute data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] data-[state=hidden]:opacity-0 bottom-0 z-[1] w-(--reka-navigation-menu-indicator-size) translate-x-(--reka-navigation-menu-indicator-position) flex h-2.5 items-end justify-center overflow-hidden transition-[translate,width] duration-200",
|
|
1756
|
+
arrow: "relative top-[50%] size-2.5 rotate-45 border border-(--ui-border) bg-(--ui-bg) z-[1] rounded-[calc(var(--ui-radius)/2)]"
|
|
1678
1757
|
},
|
|
1679
1758
|
variants: {
|
|
1680
1759
|
color: {
|
|
1681
1760
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1682
|
-
link: `focus-visible:before:ring-
|
|
1683
|
-
childLink: `focus-visible:outline-
|
|
1761
|
+
link: `focus-visible:before:ring-(--ui-${color})`,
|
|
1762
|
+
childLink: `focus-visible:outline-(--ui-${color})`
|
|
1684
1763
|
}])),
|
|
1685
1764
|
neutral: {
|
|
1686
|
-
link: "focus-visible:before:ring-
|
|
1687
|
-
childLink: "focus-visible:outline-
|
|
1765
|
+
link: "focus-visible:before:ring-(--ui-border-inverted)",
|
|
1766
|
+
childLink: "focus-visible:outline-(--ui-border-inverted)"
|
|
1688
1767
|
}
|
|
1689
1768
|
},
|
|
1690
1769
|
highlightColor: {
|
|
@@ -1701,25 +1780,34 @@ const navigationMenu = (options) => ({
|
|
|
1701
1780
|
list: "flex items-center",
|
|
1702
1781
|
item: "py-2",
|
|
1703
1782
|
link: "px-2.5 py-1.5 before:inset-x-px before:inset-y-0",
|
|
1704
|
-
childList: "grid
|
|
1783
|
+
childList: "grid p-2"
|
|
1705
1784
|
},
|
|
1706
1785
|
vertical: {
|
|
1707
1786
|
root: "flex-col",
|
|
1708
|
-
link: "flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0"
|
|
1709
|
-
|
|
1710
|
-
|
|
1787
|
+
link: "flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0"
|
|
1788
|
+
}
|
|
1789
|
+
},
|
|
1790
|
+
contentOrientation: {
|
|
1791
|
+
horizontal: {
|
|
1792
|
+
viewport: "",
|
|
1793
|
+
viewportWrapper: "justify-center",
|
|
1794
|
+
content: "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]"
|
|
1795
|
+
},
|
|
1796
|
+
vertical: {
|
|
1797
|
+
viewport: "sm:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left)",
|
|
1798
|
+
content: ""
|
|
1711
1799
|
}
|
|
1712
1800
|
},
|
|
1713
1801
|
active: {
|
|
1714
1802
|
true: {
|
|
1715
|
-
childLink: "bg-
|
|
1716
|
-
childLinkIcon: "text-
|
|
1803
|
+
childLink: "bg-(--ui-bg-elevated) text-(--ui-text-highlighted)",
|
|
1804
|
+
childLinkIcon: "text-(--ui-text)"
|
|
1717
1805
|
},
|
|
1718
1806
|
false: {
|
|
1719
|
-
link: "text-
|
|
1720
|
-
linkLeadingIcon: "text-
|
|
1721
|
-
childLink: ["hover:bg-
|
|
1722
|
-
childLinkIcon: ["text-
|
|
1807
|
+
link: "text-(--ui-text-muted)",
|
|
1808
|
+
linkLeadingIcon: "text-(--ui-text-dimmed)",
|
|
1809
|
+
childLink: ["hover:bg-(--ui-bg-elevated)/50 text-(--ui-text) hover:text-(--ui-text-highlighted)", options.theme.transitions && "transition-colors"],
|
|
1810
|
+
childLinkIcon: ["text-(--ui-text-dimmed) group-hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
1723
1811
|
}
|
|
1724
1812
|
},
|
|
1725
1813
|
disabled: {
|
|
@@ -1732,13 +1820,28 @@ const navigationMenu = (options) => ({
|
|
|
1732
1820
|
},
|
|
1733
1821
|
level: {
|
|
1734
1822
|
true: ""
|
|
1823
|
+
},
|
|
1824
|
+
collapsed: {
|
|
1825
|
+
true: ""
|
|
1735
1826
|
}
|
|
1736
1827
|
},
|
|
1737
1828
|
compoundVariants: [{
|
|
1829
|
+
orientation: "horizontal",
|
|
1830
|
+
contentOrientation: "horizontal",
|
|
1831
|
+
class: {
|
|
1832
|
+
childList: "grid-cols-2 gap-2"
|
|
1833
|
+
}
|
|
1834
|
+
}, {
|
|
1835
|
+
orientation: "horizontal",
|
|
1836
|
+
contentOrientation: "vertical",
|
|
1837
|
+
class: {
|
|
1838
|
+
childList: "gap-1",
|
|
1839
|
+
content: "w-60"
|
|
1840
|
+
}
|
|
1841
|
+
}, {
|
|
1738
1842
|
orientation: "horizontal",
|
|
1739
1843
|
highlight: true,
|
|
1740
1844
|
class: {
|
|
1741
|
-
item: "-mb-px",
|
|
1742
1845
|
link: ["after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full", options.theme.transitions && "after:transition-colors"]
|
|
1743
1846
|
}
|
|
1744
1847
|
}, {
|
|
@@ -1753,8 +1856,17 @@ const navigationMenu = (options) => ({
|
|
|
1753
1856
|
active: false,
|
|
1754
1857
|
variant: "pill",
|
|
1755
1858
|
class: {
|
|
1756
|
-
link: ["hover:text-
|
|
1757
|
-
linkLeadingIcon: ["group-hover:text-
|
|
1859
|
+
link: ["hover:text-(--ui-text-highlighted) hover:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1860
|
+
linkLeadingIcon: ["group-hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
1861
|
+
}
|
|
1862
|
+
}, {
|
|
1863
|
+
disabled: false,
|
|
1864
|
+
active: false,
|
|
1865
|
+
variant: "pill",
|
|
1866
|
+
orientation: "horizontal",
|
|
1867
|
+
class: {
|
|
1868
|
+
link: "data-[state=open]:text-(--ui-text-highlighted)",
|
|
1869
|
+
linkLeadingIcon: "group-data-[state=open]:text-(--ui-text)"
|
|
1758
1870
|
}
|
|
1759
1871
|
}, {
|
|
1760
1872
|
disabled: false,
|
|
@@ -1762,7 +1874,7 @@ const navigationMenu = (options) => ({
|
|
|
1762
1874
|
highlight: true,
|
|
1763
1875
|
orientation: "horizontal",
|
|
1764
1876
|
class: {
|
|
1765
|
-
link: "data-[state=open]:before:bg-
|
|
1877
|
+
link: "data-[state=open]:before:bg-(--ui-bg-elevated)/50"
|
|
1766
1878
|
}
|
|
1767
1879
|
}, {
|
|
1768
1880
|
disabled: false,
|
|
@@ -1771,61 +1883,70 @@ const navigationMenu = (options) => ({
|
|
|
1771
1883
|
active: false,
|
|
1772
1884
|
orientation: "horizontal",
|
|
1773
1885
|
class: {
|
|
1774
|
-
link: "data-[state=open]:before:bg-
|
|
1886
|
+
link: "data-[state=open]:before:bg-(--ui-bg-elevated)/50"
|
|
1775
1887
|
}
|
|
1776
1888
|
}, ...(options.theme.colors || []).map((color) => ({
|
|
1777
1889
|
color,
|
|
1778
1890
|
variant: "pill",
|
|
1779
1891
|
active: true,
|
|
1780
1892
|
class: {
|
|
1781
|
-
link: `text-
|
|
1782
|
-
linkLeadingIcon: `text-
|
|
1893
|
+
link: `text-(--ui-${color})`,
|
|
1894
|
+
linkLeadingIcon: `text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
|
1783
1895
|
}
|
|
1784
1896
|
})), {
|
|
1785
1897
|
color: "neutral",
|
|
1786
1898
|
variant: "pill",
|
|
1787
1899
|
active: true,
|
|
1788
1900
|
class: {
|
|
1789
|
-
link: "text-
|
|
1790
|
-
linkLeadingIcon: "text-
|
|
1901
|
+
link: "text-(--ui-text-highlighted)",
|
|
1902
|
+
linkLeadingIcon: "text-(--ui-text-highlighted) group-data-[state=open]:text-(--ui-text-highlighted)"
|
|
1791
1903
|
}
|
|
1792
1904
|
}, {
|
|
1793
1905
|
variant: "pill",
|
|
1794
1906
|
active: true,
|
|
1795
1907
|
highlight: false,
|
|
1796
1908
|
class: {
|
|
1797
|
-
link: "before:bg-
|
|
1909
|
+
link: "before:bg-(--ui-bg-elevated)"
|
|
1798
1910
|
}
|
|
1799
1911
|
}, {
|
|
1800
1912
|
variant: "pill",
|
|
1801
1913
|
active: true,
|
|
1802
1914
|
highlight: true,
|
|
1803
1915
|
class: {
|
|
1804
|
-
link: ["hover:before:bg-
|
|
1916
|
+
link: ["hover:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "before:transition-colors"]
|
|
1805
1917
|
}
|
|
1806
1918
|
}, {
|
|
1807
1919
|
disabled: false,
|
|
1808
1920
|
active: false,
|
|
1809
1921
|
variant: "link",
|
|
1810
1922
|
class: {
|
|
1811
|
-
link: ["hover:text-
|
|
1812
|
-
linkLeadingIcon: ["group-hover:text-
|
|
1923
|
+
link: ["hover:text-(--ui-text-highlighted)", options.theme.transitions && "transition-colors"],
|
|
1924
|
+
linkLeadingIcon: ["group-hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
1925
|
+
}
|
|
1926
|
+
}, {
|
|
1927
|
+
disabled: false,
|
|
1928
|
+
active: false,
|
|
1929
|
+
variant: "link",
|
|
1930
|
+
orientation: "horizontal",
|
|
1931
|
+
class: {
|
|
1932
|
+
link: "data-[state=open]:text-(--ui-text-highlighted)",
|
|
1933
|
+
linkLeadingIcon: "group-data-[state=open]:text-(--ui-text)"
|
|
1813
1934
|
}
|
|
1814
1935
|
}, ...(options.theme.colors || []).map((color) => ({
|
|
1815
1936
|
color,
|
|
1816
1937
|
variant: "link",
|
|
1817
1938
|
active: true,
|
|
1818
1939
|
class: {
|
|
1819
|
-
link: `text-
|
|
1820
|
-
linkLeadingIcon: `text-
|
|
1940
|
+
link: `text-(--ui-${color})`,
|
|
1941
|
+
linkLeadingIcon: `text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
|
1821
1942
|
}
|
|
1822
1943
|
})), {
|
|
1823
1944
|
color: "neutral",
|
|
1824
1945
|
variant: "link",
|
|
1825
1946
|
active: true,
|
|
1826
1947
|
class: {
|
|
1827
|
-
link: "text-
|
|
1828
|
-
linkLeadingIcon: "text-
|
|
1948
|
+
link: "text-(--ui-text-highlighted)",
|
|
1949
|
+
linkLeadingIcon: "text-(--ui-text-highlighted) group-data-[state=open]:text-(--ui-text-highlighted)"
|
|
1829
1950
|
}
|
|
1830
1951
|
}, ...(options.theme.colors || []).map((highlightColor) => ({
|
|
1831
1952
|
highlightColor,
|
|
@@ -1833,7 +1954,7 @@ const navigationMenu = (options) => ({
|
|
|
1833
1954
|
level: true,
|
|
1834
1955
|
active: true,
|
|
1835
1956
|
class: {
|
|
1836
|
-
link: `after:bg-
|
|
1957
|
+
link: `after:bg-(--ui-${highlightColor})`
|
|
1837
1958
|
}
|
|
1838
1959
|
})), {
|
|
1839
1960
|
highlightColor: "neutral",
|
|
@@ -1841,7 +1962,20 @@ const navigationMenu = (options) => ({
|
|
|
1841
1962
|
level: true,
|
|
1842
1963
|
active: true,
|
|
1843
1964
|
class: {
|
|
1844
|
-
link: "after:bg-
|
|
1965
|
+
link: "after:bg-(--ui-bg-inverted)"
|
|
1966
|
+
}
|
|
1967
|
+
}, {
|
|
1968
|
+
orientation: "vertical",
|
|
1969
|
+
collapsed: false,
|
|
1970
|
+
class: {
|
|
1971
|
+
childList: "ms-5 border-s border-(--ui-border)",
|
|
1972
|
+
childItem: "ps-1.5 -ms-px"
|
|
1973
|
+
}
|
|
1974
|
+
}, {
|
|
1975
|
+
orientation: "vertical",
|
|
1976
|
+
collapsed: true,
|
|
1977
|
+
class: {
|
|
1978
|
+
link: "px-1.5"
|
|
1845
1979
|
}
|
|
1846
1980
|
}],
|
|
1847
1981
|
defaultVariants: {
|
|
@@ -1863,7 +1997,7 @@ const pagination = {
|
|
|
1863
1997
|
const pinInput = (options) => ({
|
|
1864
1998
|
slots: {
|
|
1865
1999
|
root: "relative inline-flex items-center gap-1.5",
|
|
1866
|
-
base: ["rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-
|
|
2000
|
+
base: ["rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-(--ui-text-dimmed) text-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"]
|
|
1867
2001
|
},
|
|
1868
2002
|
variants: {
|
|
1869
2003
|
size: {
|
|
@@ -1884,11 +2018,11 @@ const pinInput = (options) => ({
|
|
|
1884
2018
|
}
|
|
1885
2019
|
},
|
|
1886
2020
|
variant: {
|
|
1887
|
-
outline: "text-
|
|
1888
|
-
soft: "text-
|
|
1889
|
-
subtle: "text-
|
|
1890
|
-
ghost: "text-
|
|
1891
|
-
none: "text-
|
|
2021
|
+
outline: "text-(--ui-text-highlighted) bg-(--ui-bg) ring ring-inset ring-(--ui-border-accented)",
|
|
2022
|
+
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",
|
|
2023
|
+
subtle: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated) ring ring-inset ring-(--ui-border-accented)",
|
|
2024
|
+
ghost: "text-(--ui-text-highlighted) bg-transparent hover:bg-(--ui-bg-elevated) focus:bg-(--ui-bg-elevated) disabled:bg-transparent dark:disabled:bg-transparent",
|
|
2025
|
+
none: "text-(--ui-text-highlighted) bg-transparent"
|
|
1892
2026
|
},
|
|
1893
2027
|
color: {
|
|
1894
2028
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
@@ -1901,19 +2035,19 @@ const pinInput = (options) => ({
|
|
|
1901
2035
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
1902
2036
|
color,
|
|
1903
2037
|
variant: ["outline", "subtle"],
|
|
1904
|
-
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
2038
|
+
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
1905
2039
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
1906
2040
|
color,
|
|
1907
2041
|
highlight: true,
|
|
1908
|
-
class: `ring ring-inset ring-
|
|
2042
|
+
class: `ring ring-inset ring-(--ui-${color})`
|
|
1909
2043
|
})), {
|
|
1910
2044
|
color: "neutral",
|
|
1911
2045
|
variant: ["outline", "subtle"],
|
|
1912
|
-
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
2046
|
+
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)"
|
|
1913
2047
|
}, {
|
|
1914
2048
|
color: "neutral",
|
|
1915
2049
|
highlight: true,
|
|
1916
|
-
class: "ring ring-inset ring-
|
|
2050
|
+
class: "ring ring-inset ring-(--ui-border-inverted)"
|
|
1917
2051
|
}],
|
|
1918
2052
|
defaultVariants: {
|
|
1919
2053
|
size: "md",
|
|
@@ -1924,17 +2058,17 @@ const pinInput = (options) => ({
|
|
|
1924
2058
|
|
|
1925
2059
|
const popover = {
|
|
1926
2060
|
slots: {
|
|
1927
|
-
content: "bg-
|
|
1928
|
-
arrow: "fill-
|
|
2061
|
+
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 pointer-events-auto",
|
|
2062
|
+
arrow: "fill-(--ui-border)"
|
|
1929
2063
|
}
|
|
1930
2064
|
};
|
|
1931
2065
|
|
|
1932
2066
|
const progress = (options) => ({
|
|
1933
2067
|
slots: {
|
|
1934
2068
|
root: "gap-2",
|
|
1935
|
-
base: "relative overflow-hidden rounded-full bg-
|
|
2069
|
+
base: "relative overflow-hidden rounded-full bg-(--ui-bg-accented)",
|
|
1936
2070
|
indicator: "rounded-full size-full transition-transform duration-200 ease-out",
|
|
1937
|
-
status: "flex justify-end text-
|
|
2071
|
+
status: "flex justify-end text-(--ui-text-dimmed) transition-[width] duration-200",
|
|
1938
2072
|
steps: "grid items-end",
|
|
1939
2073
|
step: "truncate text-end row-start-1 col-start-1 transition-opacity"
|
|
1940
2074
|
},
|
|
@@ -1947,12 +2081,12 @@ const progress = (options) => ({
|
|
|
1947
2081
|
},
|
|
1948
2082
|
color: {
|
|
1949
2083
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1950
|
-
indicator: `bg-
|
|
1951
|
-
steps: `text-
|
|
2084
|
+
indicator: `bg-(--ui-${color})`,
|
|
2085
|
+
steps: `text-(--ui-${color})`
|
|
1952
2086
|
}])),
|
|
1953
2087
|
neutral: {
|
|
1954
|
-
indicator: "bg-
|
|
1955
|
-
steps: "text-
|
|
2088
|
+
indicator: "bg-(--ui-bg-inverted)",
|
|
2089
|
+
steps: "text-(--ui-bg)"
|
|
1956
2090
|
}
|
|
1957
2091
|
},
|
|
1958
2092
|
size: {
|
|
@@ -1990,7 +2124,7 @@ const progress = (options) => ({
|
|
|
1990
2124
|
step: "opacity-100"
|
|
1991
2125
|
},
|
|
1992
2126
|
first: {
|
|
1993
|
-
step: "opacity-100 text-
|
|
2127
|
+
step: "opacity-100 text-(--ui-text-muted)"
|
|
1994
2128
|
},
|
|
1995
2129
|
other: {
|
|
1996
2130
|
step: "opacity-0"
|
|
@@ -2147,24 +2281,24 @@ const radioGroup = (options) => ({
|
|
|
2147
2281
|
slots: {
|
|
2148
2282
|
root: "relative",
|
|
2149
2283
|
fieldset: "flex",
|
|
2150
|
-
legend: "mb-1 block font-medium text-
|
|
2284
|
+
legend: "mb-1 block font-medium text-(--ui-text)",
|
|
2151
2285
|
item: "flex items-start",
|
|
2152
|
-
base: "rounded-full ring ring-inset ring-
|
|
2153
|
-
indicator: "flex items-center justify-center size-full rounded-full after:bg-
|
|
2286
|
+
base: "rounded-full ring ring-inset ring-(--ui-border-accented) focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
2287
|
+
indicator: "flex items-center justify-center size-full rounded-full after:bg-(--ui-bg) after:rounded-full",
|
|
2154
2288
|
container: "flex items-center",
|
|
2155
2289
|
wrapper: "ms-2",
|
|
2156
|
-
label: "block font-medium text-
|
|
2157
|
-
description: "text-
|
|
2290
|
+
label: "block font-medium text-(--ui-text)",
|
|
2291
|
+
description: "text-(--ui-text-muted)"
|
|
2158
2292
|
},
|
|
2159
2293
|
variants: {
|
|
2160
2294
|
color: {
|
|
2161
2295
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2162
|
-
base: `focus-visible:outline-
|
|
2163
|
-
indicator: `bg-
|
|
2296
|
+
base: `focus-visible:outline-(--ui-${color})`,
|
|
2297
|
+
indicator: `bg-(--ui-${color})`
|
|
2164
2298
|
}])),
|
|
2165
2299
|
neutral: {
|
|
2166
|
-
base: "focus-visible:outline-
|
|
2167
|
-
indicator: "bg-
|
|
2300
|
+
base: "focus-visible:outline-(--ui-border-inverted)",
|
|
2301
|
+
indicator: "bg-(--ui-bg-inverted)"
|
|
2168
2302
|
}
|
|
2169
2303
|
},
|
|
2170
2304
|
orientation: {
|
|
@@ -2226,7 +2360,7 @@ const radioGroup = (options) => ({
|
|
|
2226
2360
|
},
|
|
2227
2361
|
required: {
|
|
2228
2362
|
true: {
|
|
2229
|
-
legend: "after:content-['*'] after:ms-0.5 after:text-
|
|
2363
|
+
legend: "after:content-['*'] after:ms-0.5 after:text-(--ui-error)"
|
|
2230
2364
|
}
|
|
2231
2365
|
}
|
|
2232
2366
|
},
|
|
@@ -2242,16 +2376,16 @@ const select = (options) => {
|
|
|
2242
2376
|
root: () => undefined,
|
|
2243
2377
|
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"],
|
|
2244
2378
|
value: "truncate pointer-events-none",
|
|
2245
|
-
placeholder: "truncate text-
|
|
2246
|
-
arrow: "fill-
|
|
2247
|
-
content: "max-h-60 w-
|
|
2248
|
-
viewport: "divide-y divide-
|
|
2379
|
+
placeholder: "truncate text-(--ui-text-dimmed)",
|
|
2380
|
+
arrow: "fill-(--ui-border)",
|
|
2381
|
+
content: "max-h-60 w-(--reka-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] pointer-events-auto",
|
|
2382
|
+
viewport: "divide-y divide-(--ui-border) scroll-py-1",
|
|
2249
2383
|
group: "p-1 isolate",
|
|
2250
|
-
empty: "py-2 text-center text-sm text-
|
|
2251
|
-
label: "font-semibold text-
|
|
2252
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
2253
|
-
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-
|
|
2254
|
-
itemLeadingIcon: ["shrink-0 text-
|
|
2384
|
+
empty: "py-2 text-center text-sm text-(--ui-text-muted)",
|
|
2385
|
+
label: "font-semibold text-(--ui-text-highlighted)",
|
|
2386
|
+
separator: "-mx-1 my-1 h-px bg-(--ui-border)",
|
|
2387
|
+
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"],
|
|
2388
|
+
itemLeadingIcon: ["shrink-0 text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text)", options.theme.transitions && "transition-colors"],
|
|
2255
2389
|
itemLeadingAvatar: "shrink-0",
|
|
2256
2390
|
itemLeadingAvatarSize: "",
|
|
2257
2391
|
itemLeadingChip: "shrink-0",
|
|
@@ -2316,7 +2450,8 @@ const select = (options) => {
|
|
|
2316
2450
|
const selectMenu = (options) => {
|
|
2317
2451
|
return defu({
|
|
2318
2452
|
slots: {
|
|
2319
|
-
input: "border-b border-
|
|
2453
|
+
input: "border-b border-(--ui-border)",
|
|
2454
|
+
focusScope: "flex flex-col min-h-0"
|
|
2320
2455
|
}
|
|
2321
2456
|
}, select(options));
|
|
2322
2457
|
};
|
|
@@ -2325,7 +2460,7 @@ const separator = (options) => ({
|
|
|
2325
2460
|
slots: {
|
|
2326
2461
|
root: "flex items-center align-center text-center",
|
|
2327
2462
|
border: "",
|
|
2328
|
-
container: "font-medium text-
|
|
2463
|
+
container: "font-medium text-(--ui-text) flex",
|
|
2329
2464
|
icon: "shrink-0 size-5",
|
|
2330
2465
|
avatar: "shrink-0",
|
|
2331
2466
|
avatarSize: "2xs",
|
|
@@ -2333,8 +2468,8 @@ const separator = (options) => ({
|
|
|
2333
2468
|
},
|
|
2334
2469
|
variants: {
|
|
2335
2470
|
color: {
|
|
2336
|
-
...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-
|
|
2337
|
-
neutral: { border: "border-
|
|
2471
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-(--ui-${color})` }])),
|
|
2472
|
+
neutral: { border: "border-(--ui-border)" }
|
|
2338
2473
|
},
|
|
2339
2474
|
orientation: {
|
|
2340
2475
|
horizontal: {
|
|
@@ -2416,18 +2551,18 @@ const separator = (options) => ({
|
|
|
2416
2551
|
});
|
|
2417
2552
|
|
|
2418
2553
|
const skeleton = {
|
|
2419
|
-
base: "animate-pulse rounded-[calc(var(--ui-radius)*1.5)] bg-
|
|
2554
|
+
base: "animate-pulse rounded-[calc(var(--ui-radius)*1.5)] bg-(--ui-bg-elevated)"
|
|
2420
2555
|
};
|
|
2421
2556
|
|
|
2422
2557
|
const slideover = {
|
|
2423
2558
|
slots: {
|
|
2424
|
-
overlay: "fixed inset-0 bg-
|
|
2425
|
-
content: "fixed bg-
|
|
2559
|
+
overlay: "fixed inset-0 bg-(--ui-bg-elevated)/75",
|
|
2560
|
+
content: "fixed bg-(--ui-bg) divide-y divide-(--ui-border) sm:ring ring-(--ui-border) sm:shadow-lg flex flex-col focus:outline-none",
|
|
2426
2561
|
header: "px-4 py-5 sm:px-6",
|
|
2427
2562
|
body: "flex-1 overflow-y-auto p-4 sm:p-6",
|
|
2428
2563
|
footer: "flex items-center gap-1.5 p-4 sm:px-6",
|
|
2429
|
-
title: "text-
|
|
2430
|
-
description: "mt-1 text-
|
|
2564
|
+
title: "text-(--ui-text-highlighted) font-semibold",
|
|
2565
|
+
description: "mt-1 text-(--ui-text-muted) text-sm",
|
|
2431
2566
|
close: "absolute top-4 end-4"
|
|
2432
2567
|
},
|
|
2433
2568
|
variants: {
|
|
@@ -2481,19 +2616,19 @@ const slideover = {
|
|
|
2481
2616
|
const slider = (options) => ({
|
|
2482
2617
|
slots: {
|
|
2483
2618
|
root: "relative flex items-center select-none touch-none",
|
|
2484
|
-
track: "relative bg-
|
|
2619
|
+
track: "relative bg-(--ui-bg-accented) overflow-hidden rounded-full grow",
|
|
2485
2620
|
range: "absolute rounded-full",
|
|
2486
|
-
thumb: "rounded-full bg-
|
|
2621
|
+
thumb: "rounded-full bg-(--ui-bg) ring-2 focus-visible:outline-2 focus-visible:outline-offset-2"
|
|
2487
2622
|
},
|
|
2488
2623
|
variants: {
|
|
2489
2624
|
color: {
|
|
2490
2625
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2491
|
-
range: `bg-
|
|
2492
|
-
thumb: `ring-
|
|
2626
|
+
range: `bg-(--ui-${color})`,
|
|
2627
|
+
thumb: `ring-(--ui-${color}) focus-visible:outline-(--ui-${color})/50`
|
|
2493
2628
|
}])),
|
|
2494
2629
|
neutral: {
|
|
2495
|
-
range: "bg-
|
|
2496
|
-
thumb: "ring-
|
|
2630
|
+
range: "bg-(--ui-bg-inverted)",
|
|
2631
|
+
thumb: "ring-(--ui-border-inverted) focus-visible:outline-(--ui-border-inverted)/50"
|
|
2497
2632
|
}
|
|
2498
2633
|
},
|
|
2499
2634
|
size: {
|
|
@@ -2602,13 +2737,13 @@ const stepper = (options) => ({
|
|
|
2602
2737
|
header: "flex",
|
|
2603
2738
|
item: "group text-center relative w-full",
|
|
2604
2739
|
container: "relative",
|
|
2605
|
-
trigger: "rounded-full font-medium text-center align-middle flex items-center justify-center font-semibold group-data-[state=completed]:text-
|
|
2740
|
+
trigger: "rounded-full font-medium text-center align-middle flex items-center justify-center font-semibold group-data-[state=completed]:text-(--ui-bg) group-data-[state=active]:text-(--ui-bg) text-(--ui-text-muted) bg-(--ui-bg-elevated) focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
2606
2741
|
indicator: "flex items-center justify-center size-full",
|
|
2607
2742
|
icon: "shrink-0",
|
|
2608
|
-
separator: "absolute rounded-full group-data-[disabled]:opacity-75 bg-
|
|
2743
|
+
separator: "absolute rounded-full group-data-[disabled]:opacity-75 bg-(--ui-border-accented)",
|
|
2609
2744
|
wrapper: "",
|
|
2610
|
-
title: "font-medium text-
|
|
2611
|
-
description: "text-
|
|
2745
|
+
title: "font-medium text-(--ui-text)",
|
|
2746
|
+
description: "text-(--ui-text-muted) text-wrap",
|
|
2612
2747
|
content: "size-full"
|
|
2613
2748
|
},
|
|
2614
2749
|
variants: {
|
|
@@ -2664,12 +2799,12 @@ const stepper = (options) => ({
|
|
|
2664
2799
|
},
|
|
2665
2800
|
color: {
|
|
2666
2801
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2667
|
-
trigger: `group-data-[state=completed]:bg-
|
|
2668
|
-
separator: `group-data-[state=completed]:bg-
|
|
2802
|
+
trigger: `group-data-[state=completed]:bg-(--ui-${color}) group-data-[state=active]:bg-(--ui-${color}) focus-visible:outline-(--ui-${color})`,
|
|
2803
|
+
separator: `group-data-[state=completed]:bg-(--ui-${color})`
|
|
2669
2804
|
}])),
|
|
2670
2805
|
neutral: {
|
|
2671
|
-
trigger: `group-data-[state=completed]:bg-
|
|
2672
|
-
separator: `group-data-[state=completed]:bg-
|
|
2806
|
+
trigger: `group-data-[state=completed]:bg-(--ui-bg-inverted) group-data-[state=active]:bg-(--ui-bg-inverted) focus-visible:outline-(--ui-border-inverted)`,
|
|
2807
|
+
separator: `group-data-[state=completed]:bg-(--ui-bg-inverted)`
|
|
2673
2808
|
}
|
|
2674
2809
|
}
|
|
2675
2810
|
},
|
|
@@ -2723,23 +2858,23 @@ const stepper = (options) => ({
|
|
|
2723
2858
|
const _switch = (options) => ({
|
|
2724
2859
|
slots: {
|
|
2725
2860
|
root: "relative flex items-start",
|
|
2726
|
-
base: ["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-
|
|
2861
|
+
base: ["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-(--ui-bg-accented)", options.theme.transitions && "transition-colors duration-200"],
|
|
2727
2862
|
container: "flex items-center",
|
|
2728
|
-
thumb: "group pointer-events-none rounded-full bg-
|
|
2729
|
-
icon: ["absolute shrink-0 group-data-[state=unchecked]:text-
|
|
2863
|
+
thumb: "group pointer-events-none rounded-full bg-(--ui-bg) shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 data-[state=unchecked]:rtl:-translate-x-0 flex items-center justify-center",
|
|
2864
|
+
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"],
|
|
2730
2865
|
wrapper: "ms-2",
|
|
2731
|
-
label: "block font-medium text-
|
|
2732
|
-
description: "text-
|
|
2866
|
+
label: "block font-medium text-(--ui-text)",
|
|
2867
|
+
description: "text-(--ui-text-muted)"
|
|
2733
2868
|
},
|
|
2734
2869
|
variants: {
|
|
2735
2870
|
color: {
|
|
2736
2871
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2737
|
-
base: `data-[state=checked]:bg-
|
|
2738
|
-
icon: `group-data-[state=checked]:text-
|
|
2872
|
+
base: `data-[state=checked]:bg-(--ui-${color}) focus-visible:outline-(--ui-${color})`,
|
|
2873
|
+
icon: `group-data-[state=checked]:text-(--ui-${color})`
|
|
2739
2874
|
}])),
|
|
2740
2875
|
neutral: {
|
|
2741
|
-
base: "data-[state=checked]:bg-
|
|
2742
|
-
icon: "group-data-[state=checked]:text-
|
|
2876
|
+
base: "data-[state=checked]:bg-(--ui-bg-inverted) focus-visible:outline-(--ui-border-inverted)",
|
|
2877
|
+
icon: "group-data-[state=checked]:text-(--ui-text-highlighted)"
|
|
2743
2878
|
}
|
|
2744
2879
|
},
|
|
2745
2880
|
size: {
|
|
@@ -2791,7 +2926,7 @@ const _switch = (options) => ({
|
|
|
2791
2926
|
},
|
|
2792
2927
|
required: {
|
|
2793
2928
|
true: {
|
|
2794
|
-
label: "after:content-['*'] after:ms-0.5 after:text-
|
|
2929
|
+
label: "after:content-['*'] after:ms-0.5 after:text-(--ui-error)"
|
|
2795
2930
|
}
|
|
2796
2931
|
},
|
|
2797
2932
|
disabled: {
|
|
@@ -2813,23 +2948,23 @@ const table = (options) => ({
|
|
|
2813
2948
|
root: "relative overflow-auto",
|
|
2814
2949
|
base: "min-w-full overflow-clip",
|
|
2815
2950
|
caption: "sr-only",
|
|
2816
|
-
thead: "relative [&>tr]:after:absolute [&>tr]:after:inset-x-0 [&>tr]:after:bottom-0 [&>tr]:after:h-px [&>tr]:after:bg-
|
|
2817
|
-
tbody: "divide-y divide-
|
|
2818
|
-
tr: "data-[selected=true]:bg-
|
|
2819
|
-
th: "px-4 py-3.5 text-sm text-
|
|
2820
|
-
td: "p-4 text-sm text-
|
|
2821
|
-
empty: "py-6 text-center text-sm text-
|
|
2951
|
+
thead: "relative [&>tr]:after:absolute [&>tr]:after:inset-x-0 [&>tr]:after:bottom-0 [&>tr]:after:h-px [&>tr]:after:bg-(--ui-border-accented)",
|
|
2952
|
+
tbody: "divide-y divide-(--ui-border)",
|
|
2953
|
+
tr: "data-[selected=true]:bg-(--ui-bg-elevated)/50",
|
|
2954
|
+
th: "px-4 py-3.5 text-sm text-(--ui-text-highlighted) text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0",
|
|
2955
|
+
td: "p-4 text-sm text-(--ui-text-muted) whitespace-nowrap [&:has([role=checkbox])]:pe-0",
|
|
2956
|
+
empty: "py-6 text-center text-sm text-(--ui-text-muted)"
|
|
2822
2957
|
},
|
|
2823
2958
|
variants: {
|
|
2824
2959
|
pinned: {
|
|
2825
2960
|
true: {
|
|
2826
|
-
th: "sticky bg-
|
|
2827
|
-
td: "sticky bg-
|
|
2961
|
+
th: "sticky bg-(--ui-bg)/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0",
|
|
2962
|
+
td: "sticky bg-(--ui-bg)/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0"
|
|
2828
2963
|
}
|
|
2829
2964
|
},
|
|
2830
2965
|
sticky: {
|
|
2831
2966
|
true: {
|
|
2832
|
-
thead: "sticky top-0 inset-x-0 bg-
|
|
2967
|
+
thead: "sticky top-0 inset-x-0 bg-(--ui-bg)/75 z-[1] backdrop-blur"
|
|
2833
2968
|
}
|
|
2834
2969
|
},
|
|
2835
2970
|
loading: {
|
|
@@ -2852,13 +2987,13 @@ const table = (options) => ({
|
|
|
2852
2987
|
loading: true,
|
|
2853
2988
|
loadingColor,
|
|
2854
2989
|
class: {
|
|
2855
|
-
thead: `after:bg-
|
|
2990
|
+
thead: `after:bg-(--ui-${loadingColor})`
|
|
2856
2991
|
}
|
|
2857
2992
|
})), {
|
|
2858
2993
|
loading: true,
|
|
2859
2994
|
loadingColor: "neutral",
|
|
2860
2995
|
class: {
|
|
2861
|
-
thead: "after:bg-
|
|
2996
|
+
thead: "after:bg-(--ui-bg-inverted)"
|
|
2862
2997
|
}
|
|
2863
2998
|
}, {
|
|
2864
2999
|
loading: true,
|
|
@@ -2896,7 +3031,7 @@ const tabs = (options) => ({
|
|
|
2896
3031
|
root: "flex items-center gap-2",
|
|
2897
3032
|
list: "relative flex p-1 group",
|
|
2898
3033
|
indicator: "absolute transition-[translate,width] duration-200",
|
|
2899
|
-
trigger: ["group relative inline-flex items-center shrink-0 min-w-0 data-[state=inactive]:text-
|
|
3034
|
+
trigger: ["group relative inline-flex items-center shrink-0 min-w-0 data-[state=inactive]:text-(--ui-text-muted) hover:data-[state=inactive]:not-disabled:text-(--ui-text) font-medium rounded-[calc(var(--ui-radius)*1.5)] disabled:cursor-not-allowed disabled:opacity-75 focus:outline-hidden", options.theme.transitions && "transition-colors"],
|
|
2900
3035
|
content: "focus:outline-none w-full",
|
|
2901
3036
|
leadingIcon: "shrink-0",
|
|
2902
3037
|
leadingAvatar: "shrink-0",
|
|
@@ -2910,12 +3045,12 @@ const tabs = (options) => ({
|
|
|
2910
3045
|
},
|
|
2911
3046
|
variant: {
|
|
2912
3047
|
pill: {
|
|
2913
|
-
list: "bg-
|
|
3048
|
+
list: "bg-(--ui-bg-elevated) rounded-[calc(var(--ui-radius)*2)]",
|
|
2914
3049
|
trigger: "flex-1 w-full",
|
|
2915
3050
|
indicator: "rounded-[calc(var(--ui-radius)*1.5)] shadow-xs"
|
|
2916
3051
|
},
|
|
2917
3052
|
link: {
|
|
2918
|
-
list: "border-
|
|
3053
|
+
list: "border-(--ui-border)",
|
|
2919
3054
|
indicator: "rounded-full"
|
|
2920
3055
|
}
|
|
2921
3056
|
},
|
|
@@ -2923,12 +3058,12 @@ const tabs = (options) => ({
|
|
|
2923
3058
|
horizontal: {
|
|
2924
3059
|
root: "flex-col",
|
|
2925
3060
|
list: "w-full",
|
|
2926
|
-
indicator: "left-0 w-
|
|
3061
|
+
indicator: "left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",
|
|
2927
3062
|
trigger: "justify-center"
|
|
2928
3063
|
},
|
|
2929
3064
|
vertical: {
|
|
2930
3065
|
list: "flex-col",
|
|
2931
|
-
indicator: "top-0 h-
|
|
3066
|
+
indicator: "top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"
|
|
2932
3067
|
}
|
|
2933
3068
|
},
|
|
2934
3069
|
size: {
|
|
@@ -2990,29 +3125,29 @@ const tabs = (options) => ({
|
|
|
2990
3125
|
color,
|
|
2991
3126
|
variant: "pill",
|
|
2992
3127
|
class: {
|
|
2993
|
-
indicator: `bg-
|
|
2994
|
-
trigger: `data-[state=active]:text-
|
|
3128
|
+
indicator: `bg-(--ui-${color})`,
|
|
3129
|
+
trigger: `data-[state=active]:text-(--ui-bg) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ui-${color})`
|
|
2995
3130
|
}
|
|
2996
3131
|
})), {
|
|
2997
3132
|
color: "neutral",
|
|
2998
3133
|
variant: "pill",
|
|
2999
3134
|
class: {
|
|
3000
|
-
indicator: "bg-
|
|
3001
|
-
trigger: "data-[state=active]:text-
|
|
3135
|
+
indicator: "bg-(--ui-bg-inverted)",
|
|
3136
|
+
trigger: "data-[state=active]:text-(--ui-bg) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ui-border-inverted)"
|
|
3002
3137
|
}
|
|
3003
3138
|
}, ...(options.theme.colors || []).map((color) => ({
|
|
3004
3139
|
color,
|
|
3005
3140
|
variant: "link",
|
|
3006
3141
|
class: {
|
|
3007
|
-
indicator: `bg-
|
|
3008
|
-
trigger: `data-[state=active]:text-
|
|
3142
|
+
indicator: `bg-(--ui-${color})`,
|
|
3143
|
+
trigger: `data-[state=active]:text-(--ui-${color}) focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
3009
3144
|
}
|
|
3010
3145
|
})), {
|
|
3011
3146
|
color: "neutral",
|
|
3012
3147
|
variant: "link",
|
|
3013
3148
|
class: {
|
|
3014
|
-
indicator: "bg-
|
|
3015
|
-
trigger: "data-[state=active]:text-
|
|
3149
|
+
indicator: "bg-(--ui-bg-inverted)",
|
|
3150
|
+
trigger: "data-[state=active]:text-(--ui-text-highlighted) focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)"
|
|
3016
3151
|
}
|
|
3017
3152
|
}],
|
|
3018
3153
|
defaultVariants: {
|
|
@@ -3028,38 +3163,43 @@ const textarea = (options) => {
|
|
|
3028
3163
|
|
|
3029
3164
|
const toast = (options) => ({
|
|
3030
3165
|
slots: {
|
|
3031
|
-
root: "relative group overflow-hidden bg-
|
|
3032
|
-
wrapper: "w-0 flex-1 flex flex-col
|
|
3033
|
-
title: "text-sm font-medium text-
|
|
3034
|
-
description: "text-sm text-
|
|
3166
|
+
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",
|
|
3167
|
+
wrapper: "w-0 flex-1 flex flex-col",
|
|
3168
|
+
title: "text-sm font-medium text-(--ui-text-highlighted)",
|
|
3169
|
+
description: "text-sm text-(--ui-text-muted)",
|
|
3035
3170
|
icon: "shrink-0 size-5",
|
|
3036
3171
|
avatar: "shrink-0",
|
|
3037
3172
|
avatarSize: "2xl",
|
|
3038
3173
|
actions: "flex gap-1.5 shrink-0",
|
|
3039
3174
|
progress: "absolute inset-x-0 bottom-0 h-1 z-[-1]",
|
|
3040
|
-
close: "p-0
|
|
3175
|
+
close: "p-0"
|
|
3041
3176
|
},
|
|
3042
3177
|
variants: {
|
|
3043
3178
|
color: {
|
|
3044
3179
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
3045
|
-
root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
3046
|
-
icon: `text-
|
|
3047
|
-
progress: `bg-
|
|
3180
|
+
root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`,
|
|
3181
|
+
icon: `text-(--ui-${color})`,
|
|
3182
|
+
progress: `bg-(--ui-${color})`
|
|
3048
3183
|
}])),
|
|
3049
3184
|
neutral: {
|
|
3050
|
-
root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
3051
|
-
icon: "text-
|
|
3052
|
-
progress: "bg-
|
|
3185
|
+
root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)",
|
|
3186
|
+
icon: "text-(--ui-text-highlighted)",
|
|
3187
|
+
progress: "bg-(--ui-bg-inverted)"
|
|
3053
3188
|
}
|
|
3054
3189
|
},
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
root: "items-start",
|
|
3058
|
-
actions: "items-start mt-1"
|
|
3059
|
-
},
|
|
3060
|
-
false: {
|
|
3190
|
+
orientation: {
|
|
3191
|
+
horizontal: {
|
|
3061
3192
|
root: "items-center",
|
|
3062
3193
|
actions: "items-center"
|
|
3194
|
+
},
|
|
3195
|
+
vertical: {
|
|
3196
|
+
root: "items-start",
|
|
3197
|
+
actions: "items-start mt-2.5"
|
|
3198
|
+
}
|
|
3199
|
+
},
|
|
3200
|
+
title: {
|
|
3201
|
+
true: {
|
|
3202
|
+
description: "mt-1"
|
|
3063
3203
|
}
|
|
3064
3204
|
}
|
|
3065
3205
|
},
|
|
@@ -3070,8 +3210,8 @@ const toast = (options) => ({
|
|
|
3070
3210
|
|
|
3071
3211
|
const toaster = {
|
|
3072
3212
|
slots: {
|
|
3073
|
-
viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-
|
|
3074
|
-
base: "pointer-events-auto absolute inset-x-0 z-
|
|
3213
|
+
viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-(--height) focus:outline-none",
|
|
3214
|
+
base: "pointer-events-auto absolute inset-x-0 z-(--index) transform-(--transform) data-[expanded=false]:data-[front=false]:h-(--front-height) data-[expanded=false]:data-[front=false]:*:invisible data-[state=closed]:animate-[toast-closed_200ms_ease-in-out] data-[state=closed]:data-[expanded=false]:data-[front=false]:animate-[toast-collapsed-closed_200ms_ease-in-out] data-[swipe=move]:transition-none transition-[transform,translate,height] duration-200 ease-out"
|
|
3075
3215
|
},
|
|
3076
3216
|
variants: {
|
|
3077
3217
|
position: {
|
|
@@ -3115,10 +3255,10 @@ const toaster = {
|
|
|
3115
3255
|
}
|
|
3116
3256
|
}, {
|
|
3117
3257
|
swipeDirection: ["left", "right"],
|
|
3118
|
-
class: "data-[swipe=move]:translate-x-
|
|
3258
|
+
class: "data-[swipe=move]:translate-x-(--reka-toast-swipe-move-x) data-[swipe=end]:translate-x-(--reka-toast-swipe-end-x) data-[swipe=cancel]:translate-x-0"
|
|
3119
3259
|
}, {
|
|
3120
3260
|
swipeDirection: ["up", "down"],
|
|
3121
|
-
class: "data-[swipe=move]:translate-y-
|
|
3261
|
+
class: "data-[swipe=move]:translate-y-(--reka-toast-swipe-move-y) data-[swipe=end]:translate-y-(--reka-toast-swipe-end-y) data-[swipe=cancel]:translate-y-0"
|
|
3122
3262
|
}],
|
|
3123
3263
|
defaultVariants: {
|
|
3124
3264
|
position: "bottom-right"
|
|
@@ -3127,8 +3267,8 @@ const toaster = {
|
|
|
3127
3267
|
|
|
3128
3268
|
const tooltip = {
|
|
3129
3269
|
slots: {
|
|
3130
|
-
content: "flex items-center gap-1 bg-
|
|
3131
|
-
arrow: "fill-
|
|
3270
|
+
content: "flex items-center gap-1 bg-(--ui-bg) text-(--ui-text-highlighted) shadow-sm 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] pointer-events-auto",
|
|
3271
|
+
arrow: "fill-(--ui-border)",
|
|
3132
3272
|
text: "truncate",
|
|
3133
3273
|
kbds: `hidden lg:inline-flex items-center shrink-0 gap-0.5 before:content-['\xB7'] before:me-0.5`,
|
|
3134
3274
|
kbdsSize: "sm"
|
|
@@ -3227,6 +3367,25 @@ function getTemplates(options, uiConfig) {
|
|
|
3227
3367
|
}
|
|
3228
3368
|
});
|
|
3229
3369
|
}
|
|
3370
|
+
templates.push({
|
|
3371
|
+
filename: "ui.css",
|
|
3372
|
+
write: true,
|
|
3373
|
+
getContents: () => `@theme default {
|
|
3374
|
+
--color-old-neutral-50: ${colors.neutral[50]};
|
|
3375
|
+
--color-old-neutral-100: ${colors.neutral[100]};
|
|
3376
|
+
--color-old-neutral-200: ${colors.neutral[200]};
|
|
3377
|
+
--color-old-neutral-300: ${colors.neutral[300]};
|
|
3378
|
+
--color-old-neutral-400: ${colors.neutral[400]};
|
|
3379
|
+
--color-old-neutral-500: ${colors.neutral[500]};
|
|
3380
|
+
--color-old-neutral-600: ${colors.neutral[600]};
|
|
3381
|
+
--color-old-neutral-700: ${colors.neutral[700]};
|
|
3382
|
+
--color-old-neutral-800: ${colors.neutral[800]};
|
|
3383
|
+
--color-old-neutral-900: ${colors.neutral[900]};
|
|
3384
|
+
--color-old-neutral-950: ${colors.neutral[950]};
|
|
3385
|
+
${[...options.theme?.colors || [], "neutral"].map((color) => [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].map((shade) => `--color-${color}-${shade}: var(--ui-color-${color}-${shade});`).join("\n ")).join("\n ")}
|
|
3386
|
+
}
|
|
3387
|
+
`
|
|
3388
|
+
});
|
|
3230
3389
|
templates.push({
|
|
3231
3390
|
filename: "ui/index.ts",
|
|
3232
3391
|
write: true,
|
|
@@ -3235,7 +3394,7 @@ function getTemplates(options, uiConfig) {
|
|
|
3235
3394
|
templates.push({
|
|
3236
3395
|
filename: "types/ui.d.ts",
|
|
3237
3396
|
getContents: () => `import * as ui from '#build/ui'
|
|
3238
|
-
import type { DeepPartial } from '
|
|
3397
|
+
import type { DeepPartial } from '@nuxt/ui'
|
|
3239
3398
|
import type { defaultConfig } from 'tailwind-variants'
|
|
3240
3399
|
import colors from 'tailwindcss/colors'
|
|
3241
3400
|
|