mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
chore: use new syntax for css variables (#3258)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -89,9 +89,9 @@ const isDark = computed({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UApp class="flex justify-center items-center h-screen w-full relative font-sans">
|
||||
<UApp>
|
||||
<div v-if="status === 'pending' || error || !component || !components?.length">
|
||||
<div v-if="error" class="flex flex-col justify-center items-center h-screen w-screen text-center text-[var(--ui-color-error-500)]">
|
||||
<div v-if="error" class="flex flex-col justify-center items-center h-screen w-screen text-center text-(--ui-color-error-500)">
|
||||
<UILogo class="h-8" />
|
||||
<UIcon name="i-lucide-circle-alert" size="20" class="mt-2" />
|
||||
<p>
|
||||
@@ -100,9 +100,7 @@ const isDark = computed({
|
||||
</div>
|
||||
</div>
|
||||
<template v-else>
|
||||
<div
|
||||
class="top-0 h-[49px] border-b border-[var(--ui-border)] flex justify-center"
|
||||
>
|
||||
<div class="top-0 h-[49px] border-b border-(--ui-border) flex justify-center">
|
||||
<span />
|
||||
|
||||
<UInputMenu
|
||||
@@ -114,8 +112,8 @@ const isDark = computed({
|
||||
icon="i-lucide-search"
|
||||
/>
|
||||
|
||||
<div class="absolute top-[49px] bottom-0 inset-x-0 grid xl:grid-cols-8 grid-cols-4 bg-[var(--ui-bg)]">
|
||||
<div class="col-span-1 border-r border-[var(--ui-border)] hidden xl:block overflow-y-auto">
|
||||
<div class="absolute top-[49px] bottom-0 inset-x-0 grid xl:grid-cols-8 grid-cols-4 bg-(--ui-bg)">
|
||||
<div class="col-span-1 border-r border-(--ui-border) hidden xl:block overflow-y-auto">
|
||||
<UNavigationMenu
|
||||
:items="components.map((c) => ({ ...c, active: c.slug === component?.slug, onSelect: () => component = c }))"
|
||||
orientation="vertical"
|
||||
@@ -144,10 +142,10 @@ const isDark = computed({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border-l border-[var(--ui-border)] flex flex-col col-span-2 overflow-y-auto">
|
||||
<UTabs color="neutral" variant="link" :items="tabs" class="relative" :ui="{ list: 'sticky top-0 bg-[var(--ui-bg)] z-50' }">
|
||||
<div class="border-l border-(--ui-border) flex flex-col col-span-2 overflow-y-auto">
|
||||
<UTabs color="neutral" variant="link" :items="tabs" class="relative" :ui="{ list: 'sticky top-0 bg-(--ui-bg) z-50' }">
|
||||
<template #props>
|
||||
<div v-for="prop in componentPropsMeta" :key="'prop-' + prop.name" class="px-3 py-5 border-b border-[var(--ui-border)]">
|
||||
<div v-for="prop in componentPropsMeta" :key="'prop-' + prop.name" class="px-3 py-5 border-b border-(--ui-border)">
|
||||
<ComponentPropInput
|
||||
v-model="componentProps[prop.name]"
|
||||
:meta="prop"
|
||||
@@ -170,39 +168,17 @@ const isDark = computed({
|
||||
@theme {
|
||||
--font-sans: 'DM Sans', sans-serif;
|
||||
|
||||
--color-primary-50: var(--ui-color-primary-50);
|
||||
--color-primary-100: var(--ui-color-primary-100);
|
||||
--color-primary-200: var(--ui-color-primary-200);
|
||||
--color-primary-300: var(--ui-color-primary-300);
|
||||
--color-primary-400: var(--ui-color-primary-400);
|
||||
--color-primary-500: var(--ui-color-primary-500);
|
||||
--color-primary-600: var(--ui-color-primary-600);
|
||||
--color-primary-700: var(--ui-color-primary-700);
|
||||
--color-primary-800: var(--ui-color-primary-800);
|
||||
--color-primary-900: var(--ui-color-primary-900);
|
||||
--color-primary-950: var(--ui-color-primary-950);
|
||||
|
||||
--color-neutral-50: var(--ui-color-neutral-50);
|
||||
--color-neutral-100: var(--ui-color-neutral-100);
|
||||
--color-neutral-200: var(--ui-color-neutral-200);
|
||||
--color-neutral-300: var(--ui-color-neutral-300);
|
||||
--color-neutral-400: var(--ui-color-neutral-400);
|
||||
--color-neutral-500: var(--ui-color-neutral-500);
|
||||
--color-neutral-600: var(--ui-color-neutral-600);
|
||||
--color-neutral-700: var(--ui-color-neutral-700);
|
||||
--color-neutral-800: var(--ui-color-neutral-800);
|
||||
--color-neutral-900: var(--ui-color-neutral-900);
|
||||
--color-neutral-950: var(--ui-color-neutral-950);
|
||||
}
|
||||
|
||||
:root {
|
||||
--ui-border: var(--ui-color-neutral-200);
|
||||
--ui-bg: white;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--ui-border: var(--ui-color-neutral-800);
|
||||
--ui-bg: var(--ui-color-neutral-900);
|
||||
--color-green-50: #EFFDF5;
|
||||
--color-green-100: #D9FBE8;
|
||||
--color-green-200: #B3F5D1;
|
||||
--color-green-300: #75EDAE;
|
||||
--color-green-400: #00DC82;
|
||||
--color-green-500: #00C16A;
|
||||
--color-green-600: #00A155;
|
||||
--color-green-700: #007F45;
|
||||
--color-green-800: #016538;
|
||||
--color-green-900: #0A5331;
|
||||
--color-green-950: #052E16;
|
||||
}
|
||||
|
||||
.shiki
|
||||
|
||||
@@ -18,7 +18,7 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="border rounded-[var(--ui-radius)] border-[var(--ui-border)]">
|
||||
<div class="border rounded-(--ui-radius) border-(--ui-border)">
|
||||
<div
|
||||
ref="wrapper"
|
||||
:class="['overflow-hidden', collapsed && overflow ? 'max-h-48' : 'max-h-none']"
|
||||
@@ -29,7 +29,7 @@ onMounted(() => {
|
||||
</div>
|
||||
<UButton
|
||||
v-if="overflow"
|
||||
class="bg-[var(--ui-bg)] group w-full flex justify-center my-1 border-t border-[var(--ui-border)] rounded-t-none"
|
||||
class="bg-(--ui-bg) group w-full flex justify-center my-1 border-t border-(--ui-border) rounded-t-none"
|
||||
variant="link"
|
||||
color="neutral"
|
||||
trailing-icon="i-lucide-chevron-down"
|
||||
|
||||
@@ -126,7 +126,7 @@ const previewUrl = computed(() => {
|
||||
</div>
|
||||
<div v-if="highlightedCode && formattedCode" v-show="rendererReady" class="relative w-full p-3">
|
||||
<!-- eslint-disable vue/no-v-html -->
|
||||
<pre class="p-4 min-h-40 max-h-72 text-sm overflow-y-auto rounded-[calc(var(--ui-radius)*1.5)] border border-[var(--ui-border)] bg-neutral-50 dark:bg-neutral-800" v-html="highlightedCode" />
|
||||
<pre class="p-4 min-h-40 max-h-72 text-sm overflow-y-auto rounded-[calc(var(--ui-radius)*1.5)] border border-(--ui-border) bg-(--ui-bg-muted)" v-html="highlightedCode" />
|
||||
<UButton
|
||||
color="neutral"
|
||||
variant="link"
|
||||
|
||||
@@ -17,21 +17,21 @@ watchEffect(() => {
|
||||
})
|
||||
|
||||
const description = computed(() => {
|
||||
return props.meta.description?.replace(/`([^`]+)`/g, '<code class="font-medium bg-[var(--ui-bg-elevated)] px-1 py-0.5 rounded-[var(--ui-radius)]">$1</code>')
|
||||
return props.meta.description?.replace(/`([^`]+)`/g, '<code class="font-medium bg-(--ui-bg-elevated) px-1 py-0.5 rounded-(--ui-radius)">$1</code>')
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UFormField :name="meta?.name" class="" :ui="{ wrapper: 'mb-2' }" :class="{ 'opacity-70 cursor-not-allowed': !matchedInput || ignore }">
|
||||
<template #label>
|
||||
<p v-if="meta?.name" class="font-mono font-bold px-1.5 py-0.5 border border-[var(--ui-border-accented)] border-dashed rounded-[var(--ui-radius)] bg-[var(--ui-bg-elevated)]">
|
||||
<p v-if="meta?.name" class="font-mono font-bold px-1.5 py-0.5 border border-(--ui-border-accented) border-dashed rounded-(--ui-radius) bg-(--ui-bg-elevated)">
|
||||
{{ meta?.name }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #description>
|
||||
<!-- eslint-disable vue/no-v-html -->
|
||||
<p v-if="meta.description" class="text-neutral-600 dark:text-neutral-400 mt-1" v-html="description" />
|
||||
<p v-if="meta.description" class="mt-1" v-html="description" />
|
||||
</template>
|
||||
|
||||
<component :is="matchedInput.component" v-if="!ignore && matchedInput" v-model="modelValue" :schema="parsedSchema" />
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
viewBox="0 0 1020 200"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="w-auto h-6 shrink-0 text-[var(--ui-text)]"
|
||||
><path d="M377 200C379.16 200 381 198.209 381 196V103C381 103 386 112 395 127L434 194C435.785 197.74 439.744 200 443 200H470V50H443C441.202 50 439 51.4941 439 54V148L421 116L385 55C383.248 51.8912 379.479 50 376 50H350V200H377Z" fill="currentColor" /><path d="M726 92H739C742.314 92 745 89.3137 745 86V60H773V92H800V116H773V159C773 169.5 778.057 174 787 174H800V200H783C759.948 200 745 185.071 745 160V116H726V92Z" fill="currentColor" /><path d="M591 92V154C591 168.004 585.742 179.809 578 188C570.258 196.191 559.566 200 545 200C530.434 200 518.742 196.191 511 188C503.389 179.809 498 168.004 498 154V92H514C517.412 92 520.769 92.622 523 95C525.231 97.2459 526 98.5652 526 102V154C526 162.059 526.457 167.037 530 171C533.543 174.831 537.914 176 545 176C552.217 176 555.457 174.831 559 171C562.543 167.037 563 162.059 563 154V102C563 98.5652 563.769 96.378 566 94C567.96 91.9107 570.028 91.9599 573 92C573.411 92.0055 574.586 92 575 92H591Z" fill="currentColor" /><path d="M676 144L710 92H684C680.723 92 677.812 93.1758 676 96L660 120L645 97C643.188 94.1758 639.277 92 636 92H611L645 143L608 200H634C637.25 200 640.182 196.787 642 194L660 167L679 195C680.818 197.787 683.75 200 687 200H713L676 144Z" fill="currentColor" /><path d="M168 200H279C282.542 200 285.932 198.756 289 197C292.068 195.244 295.23 193.041 297 190C298.77 186.959 300.002 183.51 300 179.999C299.998 176.488 298.773 173.04 297 170.001L222 41C220.23 37.96 218.067 35.7552 215 34C211.933 32.2448 207.542 31 204 31C200.458 31 197.067 32.2448 194 34C190.933 35.7552 188.77 37.96 187 41L168 74L130 9.99764C128.228 6.95784 126.068 3.75491 123 2C119.932 0.245087 116.542 0 113 0C109.458 0 106.068 0.245087 103 2C99.9323 3.75491 96.7717 6.95784 95 9.99764L2 170.001C0.226979 173.04 0.00154312 176.488 1.90993e-06 179.999C-0.0015393 183.51 0.229648 186.959 2 190C3.77035 193.04 6.93245 195.244 10 197C13.0675 198.756 16.4578 200 20 200H90C117.737 200 137.925 187.558 152 164L186 105L204 74L259 168H186L168 200ZM89 168H40L113 42L150 105L125.491 147.725C116.144 163.01 105.488 168 89 168Z" fill="var(--ui-color-primary-500)" /><path d="M958 60.0001H938C933.524 60.0001 929.926 59.9395 927 63C924.074 65.8905 925 67.5792 925 72V141C925 151.372 923.648 156.899 919 162C914.352 166.931 908.468 169 899 169C889.705 169 882.648 166.931 878 162C873.352 156.899 873 151.372 873 141V72.0001C873 67.5793 872.926 65.8906 870 63.0001C867.074 59.9396 863.476 60.0001 859 60.0001H840V141C840 159.023 845.016 173.458 855 184C865.156 194.542 879.893 200 899 200C918.107 200 932.844 194.542 943 184C953.156 173.458 958 159.023 958 141V60.0001Z" fill="var(--ui-color-primary-500)" /><path fill-rule="evenodd" clip-rule="evenodd" d="M1000 60.0233L1020 60V77L1020 128V156.007L1020 181L1020 189.004C1020 192.938 1019.98 194.429 1017 197.001C1014.02 199.725 1009.56 200 1005 200H986.001V181.006L986 130.012V70.0215C986 66.1576 986.016 64.5494 989 62.023C991.819 59.6358 995.437 60.0233 1000 60.0233Z" fill="var(--ui-color-primary-500)" /></svg>
|
||||
class="w-auto h-6 shrink-0 text-(--ui-text)"
|
||||
><path d="M377 200C379.16 200 381 198.209 381 196V103C381 103 386 112 395 127L434 194C435.785 197.74 439.744 200 443 200H470V50H443C441.202 50 439 51.4941 439 54V148L421 116L385 55C383.248 51.8912 379.479 50 376 50H350V200H377Z" fill="currentColor" /><path d="M726 92H739C742.314 92 745 89.3137 745 86V60H773V92H800V116H773V159C773 169.5 778.057 174 787 174H800V200H783C759.948 200 745 185.071 745 160V116H726V92Z" fill="currentColor" /><path d="M591 92V154C591 168.004 585.742 179.809 578 188C570.258 196.191 559.566 200 545 200C530.434 200 518.742 196.191 511 188C503.389 179.809 498 168.004 498 154V92H514C517.412 92 520.769 92.622 523 95C525.231 97.2459 526 98.5652 526 102V154C526 162.059 526.457 167.037 530 171C533.543 174.831 537.914 176 545 176C552.217 176 555.457 174.831 559 171C562.543 167.037 563 162.059 563 154V102C563 98.5652 563.769 96.378 566 94C567.96 91.9107 570.028 91.9599 573 92C573.411 92.0055 574.586 92 575 92H591Z" fill="currentColor" /><path d="M676 144L710 92H684C680.723 92 677.812 93.1758 676 96L660 120L645 97C643.188 94.1758 639.277 92 636 92H611L645 143L608 200H634C637.25 200 640.182 196.787 642 194L660 167L679 195C680.818 197.787 683.75 200 687 200H713L676 144Z" fill="currentColor" /><path d="M168 200H279C282.542 200 285.932 198.756 289 197C292.068 195.244 295.23 193.041 297 190C298.77 186.959 300.002 183.51 300 179.999C299.998 176.488 298.773 173.04 297 170.001L222 41C220.23 37.96 218.067 35.7552 215 34C211.933 32.2448 207.542 31 204 31C200.458 31 197.067 32.2448 194 34C190.933 35.7552 188.77 37.96 187 41L168 74L130 9.99764C128.228 6.95784 126.068 3.75491 123 2C119.932 0.245087 116.542 0 113 0C109.458 0 106.068 0.245087 103 2C99.9323 3.75491 96.7717 6.95784 95 9.99764L2 170.001C0.226979 173.04 0.00154312 176.488 1.90993e-06 179.999C-0.0015393 183.51 0.229648 186.959 2 190C3.77035 193.04 6.93245 195.244 10 197C13.0675 198.756 16.4578 200 20 200H90C117.737 200 137.925 187.558 152 164L186 105L204 74L259 168H186L168 200ZM89 168H40L113 42L150 105L125.491 147.725C116.144 163.01 105.488 168 89 168Z" fill="var(--ui-primary)" /><path d="M958 60.0001H938C933.524 60.0001 929.926 59.9395 927 63C924.074 65.8905 925 67.5792 925 72V141C925 151.372 923.648 156.899 919 162C914.352 166.931 908.468 169 899 169C889.705 169 882.648 166.931 878 162C873.352 156.899 873 151.372 873 141V72.0001C873 67.5793 872.926 65.8906 870 63.0001C867.074 59.9396 863.476 60.0001 859 60.0001H840V141C840 159.023 845.016 173.458 855 184C865.156 194.542 879.893 200 899 200C918.107 200 932.844 194.542 943 184C953.156 173.458 958 159.023 958 141V60.0001Z" fill="var(--ui-primary)" /><path fill-rule="evenodd" clip-rule="evenodd" d="M1000 60.0233L1020 60V77L1020 128V156.007L1020 181L1020 189.004C1020 192.938 1019.98 194.429 1017 197.001C1014.02 199.725 1009.56 200 1005 200H986.001V181.006L986 130.012V70.0215C986 66.1576 986.016 64.5494 989 62.023C991.819 59.6358 995.437 60.0233 1000 60.0233Z" fill="var(--ui-primary)" /></svg>
|
||||
</template>
|
||||
|
||||
@@ -26,7 +26,7 @@ const attributesSchemas = computed(() => {
|
||||
<ComponentPropInput
|
||||
v-for="attributeSchema in attributesSchemas"
|
||||
:key="attributeSchema.name"
|
||||
class="border-b last:border-b-0 border-[var(--ui-border)] p-4"
|
||||
class="border-b last:border-b-0 border-(--ui-border) p-4"
|
||||
:model-value="modelValue?.[attributeSchema.name]"
|
||||
:meta="attributeSchema"
|
||||
@update:model-value="(value: any) => {
|
||||
|
||||
@@ -23,11 +23,11 @@ const route = useRoute()
|
||||
|
||||
<UFooter>
|
||||
<template #left>
|
||||
<NuxtLink v-if="route.path.startsWith('/pro')" to="https://ui.nuxt.com/pro/purchase" target="_blank" class="text-sm text-[var(--ui-text-muted)]">
|
||||
Purchase <span class="text-[var(--ui-text-highlighted)]">Nuxt UI Pro</span>
|
||||
<NuxtLink v-if="route.path.startsWith('/pro')" to="https://ui.nuxt.com/pro/purchase" target="_blank" class="text-sm text-(--ui-text-muted)">
|
||||
Purchase <span class="text-(--ui-text-highlighted)">Nuxt UI Pro</span>
|
||||
</NuxtLink>
|
||||
<NuxtLink v-else to="https://github.com/nuxt/ui" target="_blank" class="text-sm text-[var(--ui-text-muted)]">
|
||||
Published under <span class="text-[var(--ui-text-highlighted)]">MIT License</span>
|
||||
<NuxtLink v-else to="https://github.com/nuxt/ui" target="_blank" class="text-sm text-(--ui-text-muted)">
|
||||
Published under <span class="text-(--ui-text-highlighted)">MIT License</span>
|
||||
</NuxtLink>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ watch(framework, () => {
|
||||
:content="false"
|
||||
color="neutral"
|
||||
:ui="{
|
||||
indicator: 'bg-[var(--ui-bg)]',
|
||||
trigger: 'px-1 data-[state=active]:text-[var(--ui-text-highlighted)]'
|
||||
indicator: 'bg-(--ui-bg)',
|
||||
trigger: 'px-1 data-[state=active]:text-(--ui-text-highlighted)'
|
||||
}"
|
||||
size="sm"
|
||||
@update:model-value="(framework = $event as string)"
|
||||
|
||||
@@ -27,7 +27,7 @@ const items = computed(() => props.links.map(({ icon, ...link }) => link))
|
||||
<template>
|
||||
<UHeader :ui="{ left: 'min-w-0' }" mode="drawer" :menu="{ shouldScaleBackground: true }">
|
||||
<template #left>
|
||||
<NuxtLink to="/" class="flex items-end gap-2 font-bold text-xl text-[var(--ui-text-highlighted)] min-w-0 focus-visible:outline-[var(--ui-primary)] shrink-0" aria-label="Nuxt UI">
|
||||
<NuxtLink to="/" class="flex items-end gap-2 font-bold text-xl text-(--ui-text-highlighted) min-w-0 focus-visible:outline-(--ui-primary) shrink-0" aria-label="Nuxt UI">
|
||||
<LogoPro class="w-auto h-6 shrink-0 ui-pro-only" />
|
||||
<Logo class="w-auto h-6 shrink-0 ui-only" />
|
||||
</NuxtLink>
|
||||
@@ -45,7 +45,7 @@ const items = computed(() => props.links.map(({ icon, ...link }) => link))
|
||||
trailing-icon="i-lucide-chevron-down"
|
||||
size="xs"
|
||||
class="-mb-[6px] font-semibold rounded-full truncate"
|
||||
:class="[open && 'bg-[var(--ui-primary)]/15 ']"
|
||||
:class="[open && 'bg-(--ui-primary)/15 ']"
|
||||
:ui="{
|
||||
trailingIcon: ['transition-transform duration-200', open ? 'rotate-180' : undefined].filter(Boolean).join(' ')
|
||||
}"
|
||||
|
||||
@@ -19,8 +19,8 @@ watch(module, () => {
|
||||
:content="false"
|
||||
color="neutral"
|
||||
:ui="{
|
||||
indicator: 'bg-[var(--ui-bg)]',
|
||||
trigger: 'px-1 data-[state=active]:text-[var(--ui-text-highlighted)]'
|
||||
indicator: 'bg-(--ui-bg)',
|
||||
trigger: 'px-1 data-[state=active]:text-(--ui-text-highlighted)'
|
||||
}"
|
||||
size="sm"
|
||||
@update:model-value="(module = $event as string)"
|
||||
|
||||
@@ -316,15 +316,15 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${hash({ props:
|
||||
<template>
|
||||
<div class="my-5">
|
||||
<div>
|
||||
<div v-if="options.length" class="flex items-center gap-2.5 border border-[var(--ui-border-muted)] border-b-0 relative rounded-t-[calc(var(--ui-radius)*1.5)] px-4 py-2.5 overflow-x-auto">
|
||||
<div v-if="options.length" class="flex items-center gap-2.5 border border-(--ui-border-muted) border-b-0 relative rounded-t-[calc(var(--ui-radius)*1.5)] px-4 py-2.5 overflow-x-auto">
|
||||
<template v-for="option in options" :key="option.name">
|
||||
<UFormField
|
||||
:label="option.label"
|
||||
size="sm"
|
||||
class="inline-flex ring ring-[var(--ui-border-accented)] rounded-[var(--ui-radius)]"
|
||||
class="inline-flex ring ring-(--ui-border-accented) rounded-(--ui-radius)"
|
||||
:ui="{
|
||||
wrapper: 'bg-[var(--ui-bg-elevated)]/50 rounded-l-[var(--ui-radius)] flex border-r border-[var(--ui-border-accented)]',
|
||||
label: 'text-[var(--ui-text-muted)] px-2 py-1.5',
|
||||
wrapper: 'bg-(--ui-bg-elevated)/50 rounded-l-(--ui-radius) flex border-r border-(--ui-border-accented)',
|
||||
label: 'text-(--ui-text-muted) px-2 py-1.5',
|
||||
container: 'mt-0'
|
||||
}"
|
||||
>
|
||||
@@ -335,7 +335,7 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${hash({ props:
|
||||
value-key="value"
|
||||
color="neutral"
|
||||
variant="soft"
|
||||
class="rounded-[var(--ui-radius)] rounded-l-none min-w-12"
|
||||
class="rounded-(--ui-radius) rounded-l-none min-w-12"
|
||||
:class="[option.name.toLowerCase().endsWith('color') && 'pl-6']"
|
||||
:ui="{ itemLeadingChip: 'size-2' }"
|
||||
@update:model-value="setComponentProp(option.name, $event)"
|
||||
@@ -357,14 +357,14 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${hash({ props:
|
||||
:model-value="getComponentProp(option.name)"
|
||||
color="neutral"
|
||||
variant="soft"
|
||||
:ui="{ base: 'rounded-[var(--ui-radius)] rounded-l-none min-w-12' }"
|
||||
:ui="{ base: 'rounded-(--ui-radius) rounded-l-none min-w-12' }"
|
||||
@update:model-value="setComponentProp(option.name, $event)"
|
||||
/>
|
||||
</UFormField>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div v-if="component" class="flex justify-center border border-b-0 border-[var(--ui-border-muted)] relative p-4 z-[1]" :class="[!options.length && 'rounded-t-[calc(var(--ui-radius)*1.5)]', props.class, { 'overflow-hidden': props.overflowHidden }]">
|
||||
<div v-if="component" class="flex justify-center border border-b-0 border-(--ui-border-muted) relative p-4 z-[1]" :class="[!options.length && 'rounded-t-[calc(var(--ui-radius)*1.5)]', props.class, { 'overflow-hidden': props.overflowHidden }]">
|
||||
<component :is="component" v-bind="{ ...componentProps, ...componentEvents }">
|
||||
<template v-for="slot in Object.keys(slots || {})" :key="slot" #[slot]>
|
||||
<slot :name="slot" mdc-unwrap="p">
|
||||
|
||||
@@ -149,8 +149,8 @@ const urlSearchParams = computed(() => {
|
||||
<template>
|
||||
<div ref="el" class="my-5">
|
||||
<template v-if="preview">
|
||||
<div class="border border-[var(--ui-border-muted)] relative z-[1]" :class="[{ 'border-b-0 rounded-t-[calc(var(--ui-radius)*1.5)]': props.source, 'rounded-[calc(var(--ui-radius)*1.5)]': !props.source, 'overflow-hidden': props.overflowHidden }]">
|
||||
<div v-if="props.options?.length || !!slots.options" class="flex gap-4 p-4 border-b border-[var(--ui-border-muted)]">
|
||||
<div class="border border-(--ui-border-muted) relative z-[1]" :class="[{ 'border-b-0 rounded-t-[calc(var(--ui-radius)*1.5)]': props.source, 'rounded-[calc(var(--ui-radius)*1.5)]': !props.source, 'overflow-hidden': props.overflowHidden }]">
|
||||
<div v-if="props.options?.length || !!slots.options" class="flex gap-4 p-4 border-b border-(--ui-border-muted)">
|
||||
<slot name="options" />
|
||||
|
||||
<UFormField
|
||||
@@ -159,10 +159,10 @@ const urlSearchParams = computed(() => {
|
||||
:label="option.label"
|
||||
:name="option.name"
|
||||
size="sm"
|
||||
class="inline-flex ring ring-[var(--ui-border-accented)] rounded-[var(--ui-radius)]"
|
||||
class="inline-flex ring ring-(--ui-border-accented) rounded-(--ui-radius)"
|
||||
:ui="{
|
||||
wrapper: 'bg-[var(--ui-bg-elevated)]/50 rounded-l-[var(--ui-radius)] flex border-r border-[var(--ui-border-accented)]',
|
||||
label: 'text-[var(--ui-text-muted)] px-2 py-1.5',
|
||||
wrapper: 'bg-(--ui-bg-elevated)/50 rounded-l-(--ui-radius) flex border-r border-(--ui-border-accented)',
|
||||
label: 'text-(--ui-text-muted) px-2 py-1.5',
|
||||
container: 'mt-0'
|
||||
}"
|
||||
>
|
||||
@@ -174,7 +174,7 @@ const urlSearchParams = computed(() => {
|
||||
:value-key="option.name.toLowerCase().endsWith('color') ? 'value' : undefined"
|
||||
color="neutral"
|
||||
variant="soft"
|
||||
class="rounded-[var(--ui-radius)] rounded-l-none min-w-12"
|
||||
class="rounded-(--ui-radius) rounded-l-none min-w-12"
|
||||
:multiple="option.multiple"
|
||||
:class="[option.name.toLowerCase().endsWith('color') && 'pl-6']"
|
||||
:ui="{ itemLeadingChip: 'size-2' }"
|
||||
@@ -195,7 +195,7 @@ const urlSearchParams = computed(() => {
|
||||
:model-value="get(optionsValues, option.name)"
|
||||
color="neutral"
|
||||
variant="soft"
|
||||
:ui="{ base: 'rounded-[var(--ui-radius)] rounded-l-none min-w-12' }"
|
||||
:ui="{ base: 'rounded-(--ui-radius) rounded-l-none min-w-12' }"
|
||||
@update:model-value="set(optionsValues, option.name, $event)"
|
||||
/>
|
||||
</UFormField>
|
||||
|
||||
@@ -112,7 +112,7 @@ const metaProps: ComputedRef<ComponentMeta['props']> = computed(() => {
|
||||
<ProseTd>
|
||||
<HighlightInlineType v-if="prop.type" :type="prop.type" />
|
||||
|
||||
<MDC v-if="prop.description" :value="prop.description" class="text-[var(--ui-text-toned)] mt-1" />
|
||||
<MDC v-if="prop.description" :value="prop.description" class="text-(--ui-text-toned) mt-1" />
|
||||
|
||||
<ComponentPropsLinks v-if="prop.tags?.length" :prop="prop" />
|
||||
<ComponentPropsSchema v-if="prop.schema" :prop="prop" :ignore="ignore" />
|
||||
|
||||
@@ -40,7 +40,7 @@ const schemaProps = computed(() => {
|
||||
<ProseLi v-for="schemaProp in schemaProps" :key="schemaProp.name">
|
||||
<HighlightInlineType :type="`${schemaProp.name}${schemaProp.required === false ? '?' : ''}: ${schemaProp.type}`" />
|
||||
|
||||
<MDC v-if="schemaProp.description" :value="schemaProp.description" class="text-[var(--ui-text-muted)] my-1" />
|
||||
<MDC v-if="schemaProp.description" :value="schemaProp.description" class="text-(--ui-text-muted) my-1" />
|
||||
</ProseLi>
|
||||
</ProseUl>
|
||||
</ProseCollapsible>
|
||||
|
||||
@@ -36,7 +36,7 @@ const meta = await fetchComponentMeta(name as any)
|
||||
<ProseTd>
|
||||
<HighlightInlineType v-if="slot.type" :type="slot.type" />
|
||||
|
||||
<MDC v-if="slot.description" :value="slot.description" class="text-[var(--ui-text-toned)] mt-1" />
|
||||
<MDC v-if="slot.description" :value="slot.description" class="text-(--ui-text-toned) mt-1" />
|
||||
</ProseTd>
|
||||
</ProseTr>
|
||||
</ProseTbody>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="relative overflow-hidden rounded-[var(--ui-radius)] border border-dashed border-[var(--ui-border-accented)] opacity-75 px-4 flex items-center justify-center">
|
||||
<svg class="absolute inset-0 h-full w-full stroke-[var(--ui-border-inverted)]/10" fill="none">
|
||||
<div class="relative overflow-hidden rounded-(--ui-radius) border border-dashed border-(--ui-border-accented) opacity-75 px-4 flex items-center justify-center">
|
||||
<svg class="absolute inset-0 h-full w-full stroke-(--ui-border-inverted)/10" fill="none">
|
||||
<defs>
|
||||
<pattern
|
||||
id="pattern-5c1e4f0e-62d5-498b-8ff0-cf77bb448c8e"
|
||||
|
||||
@@ -18,7 +18,7 @@ const items = [
|
||||
<template>
|
||||
<UAccordion :items="items">
|
||||
<template #content="{ item }">
|
||||
<p class="pb-3.5 text-sm text-[var(--ui-text-muted)]">
|
||||
<p class="pb-3.5 text-sm text-(--ui-text-muted)">
|
||||
This is the {{ item.label }} panel.
|
||||
</p>
|
||||
</template>
|
||||
|
||||
@@ -22,7 +22,7 @@ const items = [
|
||||
<template>
|
||||
<UAccordion :items="items">
|
||||
<template #colors="{ item }">
|
||||
<p class="text-sm pb-3.5 text-[var(--ui-primary)]">
|
||||
<p class="text-sm pb-3.5 text-(--ui-primary)">
|
||||
{{ item.content }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<ULink
|
||||
to="https://github.com/benjamincanac"
|
||||
target="_blank"
|
||||
class="hover:ring-[var(--ui-primary)] transition"
|
||||
class="hover:ring-(--ui-primary) transition"
|
||||
raw
|
||||
>
|
||||
<UAvatar
|
||||
@@ -15,7 +15,7 @@
|
||||
<ULink
|
||||
to="https://github.com/romhml"
|
||||
target="_blank"
|
||||
class="hover:ring-[var(--ui-primary)] transition"
|
||||
class="hover:ring-(--ui-primary) transition"
|
||||
raw
|
||||
>
|
||||
<UAvatar
|
||||
@@ -27,7 +27,7 @@
|
||||
<ULink
|
||||
to="https://github.com/noook"
|
||||
target="_blank"
|
||||
class="hover:ring-[var(--ui-primary)] transition"
|
||||
class="hover:ring-(--ui-primary) transition"
|
||||
raw
|
||||
>
|
||||
<UAvatar
|
||||
|
||||
@@ -14,7 +14,7 @@ const items = [{
|
||||
<template>
|
||||
<UBreadcrumb :items="items">
|
||||
<template #separator>
|
||||
<span class="mx-2 text-[var(--ui-text-muted)]">/</span>
|
||||
<span class="mx-2 text-(--ui-text-muted)">/</span>
|
||||
</template>
|
||||
</UBreadcrumb>
|
||||
</template>
|
||||
|
||||
@@ -33,7 +33,7 @@ const items = computed(() => [{
|
||||
|
||||
<template>
|
||||
<UContextMenu :items="items" :ui="{ content: 'w-48' }">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72">
|
||||
Right click here
|
||||
</div>
|
||||
</UContextMenu>
|
||||
|
||||
@@ -26,7 +26,7 @@ const items = [
|
||||
|
||||
<template>
|
||||
<UContextMenu :items="items" :ui="{ content: 'w-48' }">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72">
|
||||
Right click here
|
||||
</div>
|
||||
</UContextMenu>
|
||||
|
||||
@@ -13,7 +13,7 @@ const items = [{
|
||||
|
||||
<template>
|
||||
<UContextMenu :items="items" :ui="{ content: 'w-48' }">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72">
|
||||
Right click here
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@ const items = [{
|
||||
</template>
|
||||
|
||||
<template #refresh-trailing>
|
||||
<UIcon v-if="loading" name="i-lucide-refresh-cw" class="shrink-0 size-5 text-[var(--ui-primary)] animate-spin" />
|
||||
<UIcon v-if="loading" name="i-lucide-refresh-cw" class="shrink-0 size-5 text-(--ui-primary) animate-spin" />
|
||||
</template>
|
||||
</UContextMenu>
|
||||
</template>
|
||||
|
||||
@@ -7,7 +7,7 @@ const open = ref(false)
|
||||
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-lucide-chevron-up" />
|
||||
|
||||
<template #header>
|
||||
<h2 class="text-[var(--ui-text-highlighted)] font-semibold">
|
||||
<h2 class="text-(--ui-text-highlighted) font-semibold">
|
||||
Drawer non-dismissible
|
||||
</h2>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const items = [
|
||||
<UButton label="Open" color="neutral" variant="outline" icon="i-lucide-menu" />
|
||||
|
||||
<template #profile-trailing>
|
||||
<UIcon name="i-lucide-badge-check" class="shrink-0 size-5 text-[var(--ui-primary)]" />
|
||||
<UIcon name="i-lucide-badge-check" class="shrink-0 size-5 text-(--ui-primary)" />
|
||||
</template>
|
||||
</UDropdownMenu>
|
||||
</template>
|
||||
|
||||
@@ -17,7 +17,7 @@ const items = [{
|
||||
<UButton label="Open" color="neutral" variant="outline" icon="i-lucide-menu" />
|
||||
|
||||
<template #profile-trailing>
|
||||
<UIcon name="i-lucide-badge-check" class="shrink-0 size-5 text-[var(--ui-primary)]" />
|
||||
<UIcon name="i-lucide-badge-check" class="shrink-0 size-5 text-(--ui-primary)" />
|
||||
</template>
|
||||
</UDropdownMenu>
|
||||
</template>
|
||||
|
||||
@@ -33,7 +33,7 @@ const { data: users, status } = await useFetch('https://jsonplaceholder.typicode
|
||||
<template #item-label="{ item }">
|
||||
{{ item.label }}
|
||||
|
||||
<span class="text-[var(--ui-text-muted)]">
|
||||
<span class="text-(--ui-text-muted)">
|
||||
{{ item.email }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
@@ -15,7 +15,7 @@ const domain = ref(domains[0])
|
||||
}"
|
||||
>
|
||||
<template #leading>
|
||||
<p class="text-sm text-[var(--ui-text-muted)]">
|
||||
<p class="text-sm text-(--ui-text-muted)">
|
||||
https://
|
||||
</p>
|
||||
</template>
|
||||
|
||||
@@ -13,7 +13,7 @@ const maxLength = 15
|
||||
<template #trailing>
|
||||
<div
|
||||
id="character-count"
|
||||
class="text-xs text-[var(--ui-text-muted)] tabular-nums"
|
||||
class="text-xs text-(--ui-text-muted) tabular-nums"
|
||||
aria-live="polite"
|
||||
role="status"
|
||||
>
|
||||
|
||||
@@ -4,8 +4,8 @@ const value = ref('')
|
||||
|
||||
<template>
|
||||
<UInput v-model="value" placeholder="" :ui="{ base: 'peer' }">
|
||||
<label class="pointer-events-none absolute left-0 -top-2.5 text-[var(--ui-text-highlighted)] text-xs font-medium px-1.5 transition-all peer-focus:-top-2.5 peer-focus:text-[var(--ui-text-highlighted)] peer-focus:text-xs peer-focus:font-medium peer-placeholder-shown:text-sm peer-placeholder-shown:text-[var(--ui-text-dimmed)] peer-placeholder-shown:top-1.5 peer-placeholder-shown:font-normal">
|
||||
<span class="inline-flex bg-[var(--ui-bg)] px-1">Email address</span>
|
||||
<label class="pointer-events-none absolute left-0 -top-2.5 text-(--ui-text-highlighted) text-xs font-medium px-1.5 transition-all peer-focus:-top-2.5 peer-focus:text-(--ui-text-highlighted) peer-focus:text-xs peer-focus:font-medium peer-placeholder-shown:text-sm peer-placeholder-shown:text-(--ui-text-dimmed) peer-placeholder-shown:top-1.5 peer-placeholder-shown:font-normal">
|
||||
<span class="inline-flex bg-(--ui-bg) px-1">Email address</span>
|
||||
</label>
|
||||
</UInput>
|
||||
</template>
|
||||
|
||||
@@ -77,7 +77,7 @@ const text = computed(() => {
|
||||
v-for="(req, index) in strength"
|
||||
:key="index"
|
||||
class="flex items-center gap-0.5"
|
||||
:class="req.met ? 'text-[var(--ui-success)]' : 'text-[var(--ui-text-muted)]'"
|
||||
:class="req.met ? 'text-(--ui-success)' : 'text-(--ui-text-muted)'"
|
||||
>
|
||||
<UIcon :name="req.met ? 'i-lucide-circle-check' : 'i-lucide-circle-x'" class="size-4 shrink-0" />
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ const items = [
|
||||
:items="items"
|
||||
class="w-full justify-center"
|
||||
:ui="{
|
||||
viewport: 'sm:w-[var(--reka-navigation-menu-viewport-width)]',
|
||||
viewport: 'sm:w-(--reka-navigation-menu-viewport-width)',
|
||||
childList: 'sm:w-96',
|
||||
childLinkDescription: 'text-balance line-clamp-2'
|
||||
}"
|
||||
@@ -74,11 +74,11 @@ const items = [
|
||||
</li>
|
||||
|
||||
<li v-for="child in item.children" :key="child.label">
|
||||
<ULink class="text-sm text-left rounded-md p-3 transition-colors hover:bg-[var(--ui-bg-elevated)]/50">
|
||||
<p class="font-medium text-[var(--ui-text-highlighted)]">
|
||||
<ULink class="text-sm text-left rounded-md p-3 transition-colors hover:bg-(--ui-bg-elevated)/50">
|
||||
<p class="font-medium text-(--ui-text-highlighted)">
|
||||
{{ child.label }}
|
||||
</p>
|
||||
<p class="text-[var(--ui-text-muted)] line-clamp-2">
|
||||
<p class="text-(--ui-text-muted) line-clamp-2">
|
||||
{{ child.description }}
|
||||
</p>
|
||||
</ULink>
|
||||
|
||||
@@ -8,7 +8,7 @@ const open = ref(false)
|
||||
|
||||
<template #content>
|
||||
<div class="flex items-center gap-4 mb-4">
|
||||
<h2 class="text-[var(--ui-text-highlighted)] font-semibold">
|
||||
<h2 class="text-(--ui-text-highlighted) font-semibold">
|
||||
Popover non-dismissible
|
||||
</h2>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ const { data: users, status } = await useFetch('https://jsonplaceholder.typicode
|
||||
<template #item-label="{ item }">
|
||||
{{ item.label }}
|
||||
|
||||
<span class="text-[var(--ui-text-muted)]">
|
||||
<span class="text-(--ui-text-muted)">
|
||||
{{ item.email }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
@@ -100,7 +100,7 @@ const columnFilters = ref([{
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col flex-1 w-full">
|
||||
<div class="flex px-4 py-3.5 border-b border-[var(--ui-border-accented)]">
|
||||
<div class="flex px-4 py-3.5 border-b border-(--ui-border-accented)">
|
||||
<UInput
|
||||
:model-value="(table?.tableApi?.getColumn('email')?.getFilterValue() as string)"
|
||||
class="max-w-sm"
|
||||
|
||||
@@ -130,7 +130,7 @@ function getHeader(column: Column<Payment>, label: string) {
|
||||
variant: 'ghost',
|
||||
label,
|
||||
icon: isSorted ? (isSorted === 'asc' ? 'i-lucide-arrow-up-narrow-wide' : 'i-lucide-arrow-down-wide-narrow') : 'i-lucide-arrow-up-down',
|
||||
class: '-mx-2.5 data-[state=open]:bg-[var(--ui-bg-elevated)]'
|
||||
class: '-mx-2.5 data-[state=open]:bg-(--ui-bg-elevated)'
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ const columnVisibility = ref({
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col flex-1 w-full">
|
||||
<div class="flex justify-end px-4 py-3.5 border-b border-[var(--ui-border-accented)]">
|
||||
<div class="flex justify-end px-4 py-3.5 border-b border-(--ui-border-accented)">
|
||||
<UDropdownMenu
|
||||
:items="table?.tableApi?.getAllColumns().filter(column => column.getCanHide()).map(column => ({
|
||||
label: upperFirst(column.id),
|
||||
|
||||
@@ -263,7 +263,7 @@ function randomize() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex-1 divide-y divide-[var(--ui-border-accented)] w-full">
|
||||
<div class="flex-1 divide-y divide-(--ui-border-accented) w-full">
|
||||
<div class="flex items-center gap-2 px-4 py-3.5 overflow-x-auto">
|
||||
<UInput
|
||||
:model-value="(table?.tableApi?.getColumn('email')?.getFilterValue() as string)"
|
||||
@@ -310,7 +310,7 @@ function randomize() {
|
||||
</template>
|
||||
</UTable>
|
||||
|
||||
<div class="px-4 py-3.5 text-sm text-[var(--ui-text-muted)]">
|
||||
<div class="px-4 py-3.5 text-sm text-(--ui-text-muted)">
|
||||
{{ table?.tableApi?.getFilteredSelectedRowModel().rows.length || 0 }} of
|
||||
{{ table?.tableApi?.getFilteredRowModel().rows.length || 0 }} row(s) selected.
|
||||
</div>
|
||||
|
||||
@@ -35,7 +35,7 @@ const columns: TableColumn<User>[] = [{
|
||||
size: 'lg'
|
||||
}),
|
||||
h('div', undefined, [
|
||||
h('p', { class: 'font-medium text-[var(--ui-text-highlighted)]' }, row.original.name),
|
||||
h('p', { class: 'font-medium text-(--ui-text-highlighted)' }, row.original.name),
|
||||
h('p', { class: '' }, `@${row.original.username}`)
|
||||
])
|
||||
])
|
||||
|
||||
@@ -95,7 +95,7 @@ const globalFilter = ref('45')
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col flex-1 w-full">
|
||||
<div class="flex px-4 py-3.5 border-b border-[var(--ui-border-accented)]">
|
||||
<div class="flex px-4 py-3.5 border-b border-(--ui-border-accented)">
|
||||
<UInput
|
||||
v-model="globalFilter"
|
||||
class="max-w-sm"
|
||||
|
||||
@@ -162,7 +162,7 @@ const pagination = ref({
|
||||
class="flex-1"
|
||||
/>
|
||||
|
||||
<div class="flex justify-center border-t border-[var(--ui-border)] pt-4">
|
||||
<div class="flex justify-center border-t border-(--ui-border) pt-4">
|
||||
<UPagination
|
||||
:default-page="(table?.tableApi?.getState().pagination.pageIndex || 0) + 1"
|
||||
:items-per-page="table?.tableApi?.getState().pagination.pageSize"
|
||||
|
||||
@@ -111,7 +111,7 @@ const expanded = ref({ 1: true })
|
||||
v-model:expanded="expanded"
|
||||
:data="data"
|
||||
:columns="columns"
|
||||
:ui="{ tr: 'data-[expanded=true]:bg-[var(--ui-bg-elevated)]/50' }"
|
||||
:ui="{ tr: 'data-[expanded=true]:bg-(--ui-bg-elevated)/50' }"
|
||||
class="flex-1"
|
||||
>
|
||||
<template #expanded="{ row }">
|
||||
|
||||
@@ -113,7 +113,7 @@ const rowSelection = ref({ 1: true })
|
||||
:columns="columns"
|
||||
/>
|
||||
|
||||
<div class="px-4 py-3.5 border-t border-[var(--ui-border-accented)] text-sm text-[var(--ui-text-muted)]">
|
||||
<div class="px-4 py-3.5 border-t border-(--ui-border-accented) text-sm text-(--ui-text-muted)">
|
||||
{{ table?.tableApi?.getFilteredSelectedRowModel().rows.length || 0 }} of
|
||||
{{ table?.tableApi?.getFilteredRowModel().rows.length || 0 }} row(s) selected.
|
||||
</div>
|
||||
|
||||
@@ -97,7 +97,7 @@ function getDropdownActions(user: User): DropdownMenuItem[][] {
|
||||
<div class="flex items-center gap-3">
|
||||
<UAvatar :src="`https://i.pravatar.cc/120?img=${row.original.id}`" size="lg" />
|
||||
<div>
|
||||
<p class="font-medium text-[var(--ui-text-highlighted)]">
|
||||
<p class="font-medium text-(--ui-text-highlighted)">
|
||||
{{ row.original.name }}
|
||||
</p>
|
||||
<p>
|
||||
|
||||
@@ -26,7 +26,7 @@ const state = reactive({
|
||||
<template>
|
||||
<UTabs :items="items" variant="link" class="gap-4 w-full" :ui="{ trigger: 'flex-1' }">
|
||||
<template #account="{ item }">
|
||||
<p class="text-[var(--ui-text-muted)] mb-4">
|
||||
<p class="text-(--ui-text-muted) mb-4">
|
||||
{{ item.description }}
|
||||
</p>
|
||||
|
||||
@@ -43,7 +43,7 @@ const state = reactive({
|
||||
</template>
|
||||
|
||||
<template #password="{ item }">
|
||||
<p class="text-[var(--ui-text-muted)] mb-4">
|
||||
<p class="text-(--ui-text-muted) mb-4">
|
||||
{{ item.description }}
|
||||
</p>
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ const appConfig = useAppConfig()
|
||||
<UFormField
|
||||
label="toaster.duration"
|
||||
size="sm"
|
||||
class="inline-flex ring ring-[var(--ui-border-accented)] rounded-[var(--ui-radius)]"
|
||||
class="inline-flex ring ring-(--ui-border-accented) rounded-(--ui-radius)"
|
||||
:ui="{
|
||||
wrapper: 'bg-[var(--ui-bg-elevated)]/50 rounded-l-[var(--ui-radius)] flex border-r border-[var(--ui-border-accented)]',
|
||||
label: 'text-[var(--ui-text-muted)] px-2 py-1.5',
|
||||
wrapper: 'bg-(--ui-bg-elevated)/50 rounded-l-(--ui-radius) flex border-r border-(--ui-border-accented)',
|
||||
label: 'text-(--ui-text-muted) px-2 py-1.5',
|
||||
container: 'mt-0'
|
||||
}"
|
||||
>
|
||||
@@ -18,7 +18,7 @@ const appConfig = useAppConfig()
|
||||
v-model="appConfig.toaster.duration"
|
||||
color="neutral"
|
||||
variant="soft"
|
||||
:ui="{ base: 'rounded-[var(--ui-radius)] rounded-l-none min-w-12' }"
|
||||
:ui="{ base: 'rounded-(--ui-radius) rounded-l-none min-w-12' }"
|
||||
/>
|
||||
</UFormField>
|
||||
</div>
|
||||
|
||||
@@ -7,10 +7,10 @@ const appConfig = useAppConfig()
|
||||
<UFormField
|
||||
label="toaster.expand"
|
||||
size="sm"
|
||||
class="inline-flex ring ring-[var(--ui-border-accented)] rounded-[var(--ui-radius)]"
|
||||
class="inline-flex ring ring-(--ui-border-accented) rounded-(--ui-radius)"
|
||||
:ui="{
|
||||
wrapper: 'bg-[var(--ui-bg-elevated)]/50 rounded-l-[var(--ui-radius)] flex border-r border-[var(--ui-border-accented)]',
|
||||
label: 'text-[var(--ui-text-muted)] px-2 py-1.5',
|
||||
wrapper: 'bg-(--ui-bg-elevated)/50 rounded-l-(--ui-radius) flex border-r border-(--ui-border-accented)',
|
||||
label: 'text-(--ui-text-muted) px-2 py-1.5',
|
||||
container: 'mt-0'
|
||||
}"
|
||||
>
|
||||
@@ -19,7 +19,7 @@ const appConfig = useAppConfig()
|
||||
:items="[true, false]"
|
||||
color="neutral"
|
||||
variant="soft"
|
||||
class="rounded-[var(--ui-radius)] rounded-l-none min-w-12"
|
||||
class="rounded-(--ui-radius) rounded-l-none min-w-12"
|
||||
:search-input="false"
|
||||
/>
|
||||
</UFormField>
|
||||
|
||||
@@ -10,10 +10,10 @@ const appConfig = useAppConfig()
|
||||
<UFormField
|
||||
label="toaster.position"
|
||||
size="sm"
|
||||
class="inline-flex ring ring-[var(--ui-border-accented)] rounded-[var(--ui-radius)]"
|
||||
class="inline-flex ring ring-(--ui-border-accented) rounded-(--ui-radius)"
|
||||
:ui="{
|
||||
wrapper: 'bg-[var(--ui-bg-elevated)]/50 rounded-l-[var(--ui-radius)] flex border-r border-[var(--ui-border-accented)]',
|
||||
label: 'text-[var(--ui-text-muted)] px-2 py-1.5',
|
||||
wrapper: 'bg-(--ui-bg-elevated)/50 rounded-l-(--ui-radius) flex border-r border-(--ui-border-accented)',
|
||||
label: 'text-(--ui-text-muted) px-2 py-1.5',
|
||||
container: 'mt-0'
|
||||
}"
|
||||
>
|
||||
@@ -22,7 +22,7 @@ const appConfig = useAppConfig()
|
||||
:items="positions"
|
||||
color="neutral"
|
||||
variant="soft"
|
||||
class="rounded-[var(--ui-radius)] rounded-l-none min-w-12"
|
||||
class="rounded-(--ui-radius) rounded-l-none min-w-12"
|
||||
:search-input="false"
|
||||
/>
|
||||
</UFormField>
|
||||
|
||||
@@ -68,7 +68,7 @@ function setBlackAsPrimary(value: boolean) {
|
||||
:variant="open ? 'soft' : 'ghost'"
|
||||
square
|
||||
aria-label="Color picker"
|
||||
:ui="{ leadingIcon: 'text-[var(--ui-primary)]' }"
|
||||
:ui="{ leadingIcon: 'text-(--ui-primary)' }"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -14,13 +14,13 @@ defineProps<{
|
||||
:icon="icon"
|
||||
:label="label"
|
||||
:variant="selected ? 'soft' : 'outline'"
|
||||
class="capitalize ring-[var(--ui-border)] rounded-[var(--ui-radius)] text-[11px]"
|
||||
class="capitalize ring-(--ui-border) rounded-(--ui-radius) text-[11px]"
|
||||
>
|
||||
<template v-if="chip" #leading>
|
||||
<slot name="leading">
|
||||
<span
|
||||
class="inline-block w-2 h-2 rounded-full"
|
||||
:class="`bg-[var(--color-light)] dark:bg-[var(--color-dark)]`"
|
||||
:class="`bg-(--color-light) dark:bg-(--color-dark)`"
|
||||
:style="{
|
||||
'--color-light': `var(--color-${chip}-500)`,
|
||||
'--color-dark': `var(--color-${chip}-400)`
|
||||
|
||||
@@ -182,7 +182,7 @@ export default defineConfig({
|
||||
::
|
||||
|
||||
::note
|
||||
Try the :prose-icon{name="i-lucide-swatch-book" class="text-[var(--ui-primary)]"} theme picker in the header above to change `primary` and `neutral` colors.
|
||||
Try the :prose-icon{name="i-lucide-swatch-book" class="text-(--ui-primary)"} theme picker in the header above to change `primary` and `neutral` colors.
|
||||
::
|
||||
|
||||
These colors are used to style the components but also to generate the `color` variants:
|
||||
@@ -287,7 +287,7 @@ Nuxt UI automatically creates a CSS variable for each color alias you define whi
|
||||
::
|
||||
|
||||
::note
|
||||
You can use these variables in classes like `text-[var(--ui-primary)]`, it will automatically adapt to the current color scheme.
|
||||
You can use these variables in classes like `text-(--ui-primary)`, it will automatically adapt to the current color scheme.
|
||||
::
|
||||
|
||||
::tip
|
||||
@@ -468,7 +468,7 @@ Nuxt UI automatically applies a text and background color on the `<body>` elemen
|
||||
|
||||
```css
|
||||
body {
|
||||
@apply antialiased text-[var(--ui-text)] bg-[var(--ui-bg)];
|
||||
@apply antialiased text-(--ui-text) bg-(--ui-bg);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -532,7 +532,7 @@ Nuxt UI uses a global `--ui-radius` CSS variable for consistent border rounding.
|
||||
```
|
||||
|
||||
::note
|
||||
Try the :prose-icon{name="i-lucide-swatch-book" class="text-[var(--ui-primary)]"} theme picker in the header above to change the base radius value.
|
||||
Try the :prose-icon{name="i-lucide-swatch-book" class="text-(--ui-primary)"} theme picker in the header above to change the base radius value.
|
||||
::
|
||||
|
||||
::tip
|
||||
@@ -636,7 +636,7 @@ Components in Nuxt UI can have multiple `slots`, each representing a distinct HT
|
||||
```ts [src/theme/card.ts]
|
||||
export default {
|
||||
slots: {
|
||||
root: 'bg-[var(--ui-bg)] ring ring-[var(--ui-border)] divide-y divide-[var(--ui-border)] rounded-[calc(var(--ui-radius)*2)] shadow-sm',
|
||||
root: 'bg-(--ui-bg) ring ring-(--ui-border) divide-y divide-(--ui-border) rounded-[calc(var(--ui-radius)*2)] shadow-sm',
|
||||
header: 'p-4 sm:px-6',
|
||||
body: 'p-4 sm:p-6',
|
||||
footer: 'p-4 sm:px-6'
|
||||
@@ -670,7 +670,7 @@ Some components don't have slots, they are just composed of a single root elemen
|
||||
|
||||
```ts [src/theme/container.ts]
|
||||
export default {
|
||||
base: 'max-w-[var(--ui-container)] mx-auto px-4 sm:px-6 lg:px-8'
|
||||
base: 'max-w-(--ui-container) mx-auto px-4 sm:px-6 lg:px-8'
|
||||
}
|
||||
```
|
||||
|
||||
@@ -695,7 +695,7 @@ Nuxt UI components use `variants` to change the `slots` styles based on props. H
|
||||
```ts [src/theme/avatar.ts]
|
||||
export default {
|
||||
slots: {
|
||||
root: 'inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-[var(--ui-bg-elevated)]',
|
||||
root: 'inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-(--ui-bg-elevated)',
|
||||
image: 'h-full w-full rounded-[inherit] object-cover'
|
||||
},
|
||||
variants: {
|
||||
|
||||
@@ -256,7 +256,7 @@ props:
|
||||
color: neutral
|
||||
variant: outline
|
||||
ui:
|
||||
leadingIcon: 'text-[var(--ui-primary)]'
|
||||
leadingIcon: 'text-(--ui-primary)'
|
||||
slots:
|
||||
default: |
|
||||
|
||||
|
||||
@@ -95,12 +95,12 @@ props:
|
||||
slots:
|
||||
default: |
|
||||
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72">
|
||||
Right click here
|
||||
</div>
|
||||
---
|
||||
|
||||
:div{class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72"}[Right click here]
|
||||
:div{class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72"}[Right click here]
|
||||
::
|
||||
|
||||
::note
|
||||
@@ -137,12 +137,12 @@ props:
|
||||
slots:
|
||||
default: |
|
||||
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72">
|
||||
Right click here
|
||||
</div>
|
||||
---
|
||||
|
||||
:div{class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72"}[Right click here]
|
||||
:div{class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72"}[Right click here]
|
||||
::
|
||||
|
||||
### Disabled
|
||||
@@ -171,12 +171,12 @@ props:
|
||||
slots:
|
||||
default: |
|
||||
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72">
|
||||
Right click here
|
||||
</div>
|
||||
---
|
||||
|
||||
:div{class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72"}[Right click here]
|
||||
:div{class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72"}[Right click here]
|
||||
::
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -224,7 +224,7 @@ Make sure to add the `vaul-drawer-wrapper` directive to a parent element of your
|
||||
```vue [app.vue]
|
||||
<template>
|
||||
<UApp>
|
||||
<div class="bg-[var(--ui-bg)]" vaul-drawer-wrapper>
|
||||
<div class="bg-(--ui-bg)" vaul-drawer-wrapper>
|
||||
<NuxtLayout>
|
||||
<NuxtPage />
|
||||
</NuxtLayout>
|
||||
@@ -238,7 +238,7 @@ export default defineNuxtConfig({
|
||||
app: {
|
||||
rootAttrs: {
|
||||
'vaul-drawer-wrapper': '',
|
||||
'class': 'bg-[var(--ui-bg)]'
|
||||
'class': 'bg-(--ui-bg)'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -194,12 +194,12 @@ This will give you access to the following:
|
||||
|
||||
| Name | Type |
|
||||
| ---- | ---- |
|
||||
| `submit()`{lang="ts-type"} | `Promise<void>`{lang="ts-type"} <br> <div class="text-[var(--ui-text-toned)] mt-1"><p>Triggers form submission.</p> |
|
||||
| `validate(opts: { name?: keyof T \| (keyof T)[], silent?: boolean, nested?: boolean, transform?: boolean })`{lang="ts-type"} | `Promise<T>`{lang="ts-type"} <br> <div class="text-[var(--ui-text-toned)] mt-1"><p>Triggers form validation. Will raise any errors unless `opts.silent` is set to true.</p> |
|
||||
| `clear(path?: keyof T)`{lang="ts-type"} | `void` <br> <div class="text-[var(--ui-text-toned)] mt-1"><p>Clears form errors associated with a specific path. If no path is provided, clears all form errors.</p> |
|
||||
| `getErrors(path?: keyof T)`{lang="ts-type"} | `FormError[]`{lang="ts-type"} <br> <div class="text-[var(--ui-text-toned)] mt-1"><p>Retrieves form errors associated with a specific path. If no path is provided, returns all form errors.</p></div> |
|
||||
| `setErrors(errors: FormError[], path?: keyof T)`{lang="ts-type"} | `void` <br> <div class="text-[var(--ui-text-toned)] mt-1"><p>Sets form errors for a given path. If no path is provided, overrides all errors.</p> |
|
||||
| `errors`{lang="ts-type"} | `Ref<FormError[]>`{lang="ts-type"} <br> <div class="text-[var(--ui-text-toned)] mt-1"><p>A reference to the array containing validation errors. Use this to access or manipulate the error information.</p> |
|
||||
| `submit()`{lang="ts-type"} | `Promise<void>`{lang="ts-type"} <br> <div class="text-(--ui-text-toned) mt-1"><p>Triggers form submission.</p> |
|
||||
| `validate(opts: { name?: keyof T \| (keyof T)[], silent?: boolean, nested?: boolean, transform?: boolean })`{lang="ts-type"} | `Promise<T>`{lang="ts-type"} <br> <div class="text-(--ui-text-toned) mt-1"><p>Triggers form validation. Will raise any errors unless `opts.silent` is set to true.</p> |
|
||||
| `clear(path?: keyof T)`{lang="ts-type"} | `void` <br> <div class="text-(--ui-text-toned) mt-1"><p>Clears form errors associated with a specific path. If no path is provided, clears all form errors.</p> |
|
||||
| `getErrors(path?: keyof T)`{lang="ts-type"} | `FormError[]`{lang="ts-type"} <br> <div class="text-(--ui-text-toned) mt-1"><p>Retrieves form errors associated with a specific path. If no path is provided, returns all form errors.</p></div> |
|
||||
| `setErrors(errors: FormError[], path?: keyof T)`{lang="ts-type"} | `void` <br> <div class="text-(--ui-text-toned) mt-1"><p>Sets form errors for a given path. If no path is provided, overrides all errors.</p> |
|
||||
| `errors`{lang="ts-type"} | `Ref<FormError[]>`{lang="ts-type"} <br> <div class="text-(--ui-text-toned) mt-1"><p>A reference to the array containing validation errors. Use this to access or manipulate the error information.</p> |
|
||||
| `disabled`{lang="ts-type"} | `Ref<boolean>`{lang="ts-type"} |
|
||||
| `dirty`{lang="ts-type"} | `Ref<boolean>`{lang="ts-type"} `true` if at least one form field has been updated by the user.|
|
||||
| `dirtyFields`{lang="ts-type"} | `DeepReadonly<Set<keyof T>>`{lang="ts-type"} Tracks fields that have been modified by the user. |
|
||||
|
||||
@@ -66,7 +66,7 @@ props:
|
||||
raw: true
|
||||
to: /components/link
|
||||
activeClass: 'font-bold'
|
||||
inactiveClass: 'text-[var(--ui-text-muted)]'
|
||||
inactiveClass: 'text-(--ui-text-muted)'
|
||||
slots:
|
||||
default: Link
|
||||
---
|
||||
|
||||
@@ -334,7 +334,7 @@ props:
|
||||
- label: Help
|
||||
icon: i-lucide-circle-help
|
||||
disabled: true
|
||||
class: 'data-[orientation=horizontal]:border-b border-[var(--ui-border)] data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-48'
|
||||
class: 'data-[orientation=horizontal]:border-b border-(--ui-border) data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-48'
|
||||
---
|
||||
::
|
||||
|
||||
@@ -838,7 +838,7 @@ name: 'navigation-menu-content-slot-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, we add the `sm:w-[var(--reka-navigation-menu-viewport-width)]` class on the `viewport` to have a dynamic width. This requires to set a width on the content's first child.
|
||||
In this example, we add the `sm:w-(--reka-navigation-menu-viewport-width)` class on the `viewport` to have a dynamic width. This requires to set a width on the content's first child.
|
||||
::
|
||||
|
||||
## API
|
||||
|
||||
@@ -74,13 +74,13 @@ props:
|
||||
|
||||
Use the `columns` prop as an array of [ColumnDef](https://tanstack.com/table/latest/docs/api/core/column-def) objects with properties like:
|
||||
|
||||
- `accessorKey`: [The key of the row object to use when extracting the value for the column.]{class="text-[var(--ui-text-muted)]"}
|
||||
- `header`: [The header to display for the column. If a string is passed, it can be used as a default for the column ID. If a function is passed, it will be passed a props object for the header and should return the rendered header value (the exact type depends on the adapter being used).]{class="text-[var(--ui-text-muted)]"}
|
||||
- `cell`: [The cell to display each row for the column. If a function is passed, it will be passed a props object for the cell and should return the rendered cell value (the exact type depends on the adapter being used).]{class="text-[var(--ui-text-muted)]"}
|
||||
- `meta`: [Extra properties for the column.]{class="text-[var(--ui-text-muted)]"}
|
||||
- `accessorKey`: [The key of the row object to use when extracting the value for the column.]{class="text-(--ui-text-muted)"}
|
||||
- `header`: [The header to display for the column. If a string is passed, it can be used as a default for the column ID. If a function is passed, it will be passed a props object for the header and should return the rendered header value (the exact type depends on the adapter being used).]{class="text-(--ui-text-muted)"}
|
||||
- `cell`: [The cell to display each row for the column. If a function is passed, it will be passed a props object for the cell and should return the rendered cell value (the exact type depends on the adapter being used).]{class="text-(--ui-text-muted)"}
|
||||
- `meta`: [Extra properties for the column.]{class="text-(--ui-text-muted)"}
|
||||
- `class`:
|
||||
- `td`: [The classes to apply to the `td` element.]{class="text-[var(--ui-text-muted)]"}
|
||||
- `th`: [The classes to apply to the `th` element.]{class="text-[var(--ui-text-muted)]"}
|
||||
- `td`: [The classes to apply to the `td` element.]{class="text-(--ui-text-muted)"}
|
||||
- `th`: [The classes to apply to the `th` element.]{class="text-(--ui-text-muted)"}
|
||||
|
||||
In order to render components or other HTML elements, you will need to use the Vue [`h` function](https://vuejs.org/api/render-function.html#h) inside the `header` and `cell` props. This is different from other components that use slots but allows for more flexibility.
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export default defineNuxtConfig({
|
||||
},
|
||||
rootAttrs: {
|
||||
'vaul-drawer-wrapper': '',
|
||||
'class': 'bg-[var(--ui-bg)]'
|
||||
'class': 'bg-(--ui-bg)'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ defineShortcuts({
|
||||
|
||||
<template>
|
||||
<UApp :toaster="(appConfig.toaster as any)">
|
||||
<div class="h-screen w-screen overflow-hidden flex min-h-0 bg-[var(--ui-bg)]" vaul-drawer-wrapper>
|
||||
<UNavigationMenu :items="items" orientation="vertical" class="hidden lg:flex border-e border-[var(--ui-border)] overflow-y-auto w-48 p-4" />
|
||||
<UNavigationMenu :items="items" orientation="horizontal" class="lg:hidden border-b border-[var(--ui-border)] [&>div]:min-w-min overflow-x-auto" />
|
||||
<div class="h-screen w-screen overflow-hidden flex min-h-0 bg-(--ui-bg)" vaul-drawer-wrapper>
|
||||
<UNavigationMenu :items="items" orientation="vertical" class="hidden lg:flex border-e border-(--ui-border) overflow-y-auto w-48 p-4" />
|
||||
<UNavigationMenu :items="items" orientation="horizontal" class="lg:hidden border-b border-(--ui-border) [&>div]:min-w-min overflow-x-auto" />
|
||||
|
||||
<div class="fixed top-15 lg:top-3 right-4 flex items-center gap-2">
|
||||
<UButton
|
||||
|
||||
@@ -84,9 +84,9 @@ defineShortcuts({
|
||||
<template>
|
||||
<template v-if="!$route.path.startsWith('/__nuxt_ui__')">
|
||||
<UApp :toaster="appConfig.toaster">
|
||||
<div class="h-screen w-screen overflow-hidden flex flex-col lg:flex-row min-h-0 bg-[var(--ui-bg)]" vaul-drawer-wrapper>
|
||||
<UNavigationMenu :items="items" orientation="vertical" class="hidden lg:flex border-e border-[var(--ui-border)] overflow-y-auto w-48 p-4" />
|
||||
<UNavigationMenu :items="items" orientation="horizontal" class="lg:hidden border-b border-[var(--ui-border)] [&>div]:min-w-min overflow-x-auto" />
|
||||
<div class="h-screen w-screen overflow-hidden flex flex-col lg:flex-row min-h-0 bg-(--ui-bg)" vaul-drawer-wrapper>
|
||||
<UNavigationMenu :items="items" orientation="vertical" class="hidden lg:flex border-e border-(--ui-border) overflow-y-auto w-48 p-4" />
|
||||
<UNavigationMenu :items="items" orientation="horizontal" class="lg:hidden border-b border-(--ui-border) [&>div]:min-w-min overflow-x-auto" />
|
||||
|
||||
<div class="fixed top-15 lg:top-3 right-4 flex items-center gap-2">
|
||||
<ClientOnly v-if="!colorMode?.forced">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="relative overflow-hidden rounded-[var(--ui-radius)] border border-dashed border-[var(--ui-border-accented)] opacity-75 px-4 flex items-center justify-center">
|
||||
<svg class="absolute inset-0 h-full w-full stroke-[var(--ui-border-inverted)]/10" fill="none">
|
||||
<div class="relative overflow-hidden rounded-(--ui-radius) border border-dashed border-(--ui-border-accented) opacity-75 px-4 flex items-center justify-center">
|
||||
<svg class="absolute inset-0 h-full w-full stroke-(--ui-border-inverted)/10" fill="none">
|
||||
<defs>
|
||||
<pattern
|
||||
id="pattern-5c1e4f0e-62d5-498b-8ff0-cf77bb448c8e"
|
||||
|
||||
@@ -32,13 +32,13 @@ const items = [{
|
||||
<UCard :ui="{ body: 'p-0 sm:p-0' }">
|
||||
<UAccordion :items="items" class="w-96" :ui="{ trigger: 'px-3.5', body: 'px-3.5' }">
|
||||
<template #body="{ item }">
|
||||
<p class="text-[var(--ui-text-muted)]">
|
||||
<p class="text-(--ui-text-muted)">
|
||||
{{ item.content }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #custom-body="{ item }">
|
||||
<p class="text-[var(--ui-text-muted)]">
|
||||
<p class="text-(--ui-text-muted)">
|
||||
Custom: {{ item.content }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
@@ -138,7 +138,7 @@ defineShortcuts({
|
||||
<UButton label="Open drawer" color="neutral" variant="outline" />
|
||||
|
||||
<template #content>
|
||||
<ReuseTemplate class="border-t border-[var(--ui-border)] mt-4" />
|
||||
<ReuseTemplate class="border-t border-(--ui-border) mt-4" />
|
||||
</template>
|
||||
</UDrawer>
|
||||
|
||||
|
||||
@@ -106,13 +106,13 @@ defineShortcuts(extractShortcuts(items.value))
|
||||
</div>
|
||||
|
||||
<UContextMenu :items="items" :ui="{ content: 'w-48' }" :size="size">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72">
|
||||
Right click here
|
||||
</div>
|
||||
</UContextMenu>
|
||||
|
||||
<UContextMenu :items="itemsWithColor" :ui="{ content: 'w-48' }" :size="size">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72">
|
||||
<div class="flex items-center justify-center rounded-md border border-dashed border-(--ui-border-accented) text-sm aspect-video w-72">
|
||||
Color right click here
|
||||
</div>
|
||||
</UContextMenu>
|
||||
|
||||
@@ -144,7 +144,7 @@ defineShortcuts(extractShortcuts(items.value))
|
||||
<UButton label="Open" color="neutral" variant="outline" icon="i-lucide-menu" />
|
||||
|
||||
<template #custom-trailing>
|
||||
<UIcon name="i-lucide-badge-check" class="shrink-0 size-5 text-[var(--ui-primary)]" />
|
||||
<UIcon name="i-lucide-badge-check" class="shrink-0 size-5 text-(--ui-primary)" />
|
||||
</template>
|
||||
</UDropdownMenu>
|
||||
|
||||
@@ -152,7 +152,7 @@ defineShortcuts(extractShortcuts(items.value))
|
||||
<UButton label="Color" color="neutral" variant="outline" icon="i-lucide-menu" />
|
||||
|
||||
<template #custom-trailing>
|
||||
<UIcon name="i-lucide-badge-check" class="shrink-0 size-5 text-[var(--ui-primary)]" />
|
||||
<UIcon name="i-lucide-badge-check" class="shrink-0 size-5 text-(--ui-primary)" />
|
||||
</template>
|
||||
</UDropdownMenu>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +54,7 @@ const disabled = ref(false)
|
||||
<FormExampleNestedList />
|
||||
</div>
|
||||
|
||||
<div class="border border-[var(--ui-border)] rounded-lg">
|
||||
<div class="border border-(--ui-border) rounded-lg">
|
||||
<div class="py-2 px-4 flex gap-4 items-center">
|
||||
<UFormField label="Validate on" class="flex items-center gap-2">
|
||||
<USelectMenu v-model="validateOn" :items="['input', 'change', 'blur']" multiple class="w-48" />
|
||||
@@ -62,7 +62,7 @@ const disabled = ref(false)
|
||||
<UCheckbox v-model="disabled" label="Disabled" />
|
||||
</div>
|
||||
|
||||
<FormExampleElements :validate-on="validateOn" :disabled="disabled" class="border-t border-[var(--ui-border)] p-4" />
|
||||
<FormExampleElements :validate-on="validateOn" :disabled="disabled" class="border-t border-(--ui-border) p-4" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<ULink active>
|
||||
Button active
|
||||
</ULink>
|
||||
<ULink active class="font-medium" active-class="text-[var(--ui-text-highlighted)]">
|
||||
<ULink active class="font-medium" active-class="text-(--ui-text-highlighted)">
|
||||
Button active with class
|
||||
</ULink>
|
||||
<ULink active disabled>
|
||||
@@ -18,7 +18,7 @@
|
||||
<ULink>
|
||||
Button inactive
|
||||
</ULink>
|
||||
<ULink class="font-medium" inactive-class="hover:text-[var(--ui-primary)]">
|
||||
<ULink class="font-medium" inactive-class="hover:text-(--ui-primary)">
|
||||
Button inactive with class
|
||||
</ULink>
|
||||
<ULink disabled>
|
||||
@@ -34,7 +34,7 @@
|
||||
<ULink to="/components/link">
|
||||
Link active
|
||||
</ULink>
|
||||
<ULink to="/components/link" class="font-medium" active-class="text-[var(--ui-text-highlighted)]">
|
||||
<ULink to="/components/link" class="font-medium" active-class="text-(--ui-text-highlighted)">
|
||||
Link active with class
|
||||
</ULink>
|
||||
<ULink to="/components/link" disabled>
|
||||
@@ -44,7 +44,7 @@
|
||||
<ULink to="/components/button">
|
||||
Link inactive
|
||||
</ULink>
|
||||
<ULink to="/components/button" class="font-medium" inactive-class="hover:text-[var(--ui-primary)]">
|
||||
<ULink to="/components/button" class="font-medium" inactive-class="hover:text-(--ui-primary)">
|
||||
Link inactive with class
|
||||
</ULink>
|
||||
<ULink to="/components/button" disabled>
|
||||
|
||||
@@ -112,7 +112,7 @@ const items = [
|
||||
:content-orientation="contentOrientation"
|
||||
:highlight="highlight"
|
||||
:highlight-color="highlightColor"
|
||||
:class="highlight && 'data-[orientation=horizontal]:border-b border-[var(--ui-border)]'"
|
||||
:class="highlight && 'data-[orientation=horizontal]:border-b border-(--ui-border)'"
|
||||
class="data-[orientation=vertical]:data-[collapsed=false]:w-48"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="flex flex-col gap-4">
|
||||
<div>
|
||||
<p class="font-semibold text-[var(--ui-text-highlighted)]">
|
||||
<p class="font-semibold text-(--ui-text-highlighted)">
|
||||
Nuxt UI
|
||||
</p>
|
||||
<p>An open-source UI component library.</p>
|
||||
|
||||
@@ -333,10 +333,10 @@ onMounted(() => {
|
||||
getPaginationRowModel: getPaginationRowModel()
|
||||
}"
|
||||
:ui="{
|
||||
tr: 'divide-x divide-[var(--ui-border)]'
|
||||
tr: 'divide-x divide-(--ui-border)'
|
||||
}"
|
||||
sticky
|
||||
class="border border-[var(--ui-border-accented)] rounded-[var(--ui-radius)]"
|
||||
class="border border-(--ui-border-accented) rounded-(--ui-radius)"
|
||||
>
|
||||
<template #expanded="{ row }">
|
||||
<pre>{{ row.original }}</pre>
|
||||
@@ -344,7 +344,7 @@ onMounted(() => {
|
||||
</UTable>
|
||||
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<div class="text-sm text-[var(--ui-text-muted)]">
|
||||
<div class="text-sm text-(--ui-text-muted)">
|
||||
{{ table?.tableApi?.getFilteredSelectedRowModel().rows.length || 0 }} of
|
||||
{{ table?.tableApi?.getFilteredRowModel().rows.length || 0 }} row(s) selected.
|
||||
</div>
|
||||
|
||||
@@ -57,7 +57,7 @@ const items = [{
|
||||
class="w-96"
|
||||
>
|
||||
<template #custom="{ item }">
|
||||
<span class="text-[var(--ui-text-muted)]">Custom: {{ item.content }}</span>
|
||||
<span class="text-(--ui-text-muted)">Custom: {{ item.content }}</span>
|
||||
</template>
|
||||
</UTabs>
|
||||
</div>
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<div class="flex flex-col gap-4">
|
||||
<UCard class="w-96">
|
||||
<template #header>
|
||||
<div class="bg-[var(--ui-bg-accented)]/40 h-8" />
|
||||
<div class="bg-(--ui-bg-accented)/40 h-8" />
|
||||
</template>
|
||||
<div class="bg-[var(--ui-bg-accented)]/40 h-32" />
|
||||
<div class="bg-(--ui-bg-accented)/40 h-32" />
|
||||
<template #footer>
|
||||
<div class="bg-[var(--ui-bg-accented)]/40 h-8" />
|
||||
<div class="bg-(--ui-bg-accented)/40 h-8" />
|
||||
</template>
|
||||
</UCard>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<UCollapsible class="w-48">
|
||||
<UButton label="Open Collapse" block />
|
||||
<template #content>
|
||||
<div class="bg-[var(--ui-bg-accented)]/40 h-60" />
|
||||
<div class="bg-(--ui-bg-accented)/40 h-60" />
|
||||
</template>
|
||||
</UCollapsible>
|
||||
</template>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<UContainer>
|
||||
<div class="bg-[var(--ui-bg-accented)]/40 h-60 aspect-video w-72" />
|
||||
<div class="bg-(--ui-bg-accented)/40 h-60 aspect-video w-72" />
|
||||
</UContainer>
|
||||
</template>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<UContextMenu>
|
||||
<div class="bg-[var(--ui-bg-accented)]/40 h-60 w-72" />
|
||||
<div class="bg-(--ui-bg-accented)/40 h-60 w-72" />
|
||||
</UContextMenu>
|
||||
</template>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<UPopover>
|
||||
<UButton label="Open Collapse" />
|
||||
<template #content>
|
||||
<div class="bg-[var(--ui-bg-accented)]/40 h-24 w-60" />
|
||||
<div class="bg-(--ui-bg-accented)/40 h-24 w-60" />
|
||||
</template>
|
||||
</UPopover>
|
||||
</template>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<UTooltip>
|
||||
<div class="bg-[var(--ui-bg-accented)]/40 size-20" />
|
||||
<div class="bg-(--ui-bg-accented)/40 size-20" />
|
||||
</UTooltip>
|
||||
</template>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@layer base {
|
||||
body {
|
||||
@apply antialiased text-[var(--ui-text)] bg-[var(--ui-bg)] scheme-light dark:scheme-dark;
|
||||
@apply antialiased text-(--ui-text) bg-(--ui-bg) scheme-light dark:scheme-dark;
|
||||
}
|
||||
|
||||
:root, .light {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export default {
|
||||
slots: {
|
||||
root: 'w-full',
|
||||
item: 'border-b border-[var(--ui-border)] last:border-b-0',
|
||||
item: 'border-b border-(--ui-border) last:border-b-0',
|
||||
header: 'flex',
|
||||
trigger: 'group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-[var(--ui-primary)] min-w-0',
|
||||
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',
|
||||
content: 'data-[state=open]:animate-[accordion-down_200ms_ease-out] data-[state=closed]:animate-[accordion-up_200ms_ease-out] overflow-hidden focus:outline-none',
|
||||
body: 'text-sm pb-3.5',
|
||||
leadingIcon: 'shrink-0 size-5',
|
||||
|
||||
@@ -43,49 +43,49 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
color,
|
||||
variant: 'solid',
|
||||
class: {
|
||||
root: `bg-[var(--ui-${color})] text-[var(--ui-bg)]`
|
||||
root: `bg-(--ui-${color}) text-(--ui-bg)`
|
||||
}
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'outline',
|
||||
class: {
|
||||
root: `text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25`
|
||||
root: `text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25`
|
||||
}
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'soft',
|
||||
class: {
|
||||
root: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})]`
|
||||
root: `bg-(--ui-${color})/10 text-(--ui-${color})`
|
||||
}
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'subtle',
|
||||
class: {
|
||||
root: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25`
|
||||
root: `bg-(--ui-${color})/10 text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25`
|
||||
}
|
||||
})), {
|
||||
color: 'neutral',
|
||||
variant: 'solid',
|
||||
class: {
|
||||
root: 'text-[var(--ui-bg)] bg-[var(--ui-bg-inverted)]'
|
||||
root: 'text-(--ui-bg) bg-(--ui-bg-inverted)'
|
||||
}
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'outline',
|
||||
class: {
|
||||
root: 'text-[var(--ui-text-highlighted)] bg-[var(--ui-bg)] ring ring-inset ring-[var(--ui-border)]'
|
||||
root: 'text-(--ui-text-highlighted) bg-(--ui-bg) ring ring-inset ring-(--ui-border)'
|
||||
}
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'soft',
|
||||
class: {
|
||||
root: 'text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)]/50'
|
||||
root: 'text-(--ui-text-highlighted) bg-(--ui-bg-elevated)/50'
|
||||
}
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'subtle',
|
||||
class: {
|
||||
root: 'text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)]/50 ring ring-inset ring-[var(--ui-border-accented)]'
|
||||
root: 'text-(--ui-text-highlighted) bg-(--ui-bg-elevated)/50 ring ring-inset ring-(--ui-border-accented)'
|
||||
}
|
||||
}],
|
||||
defaultVariants: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export default {
|
||||
slots: {
|
||||
root: 'inline-flex flex-row-reverse justify-end',
|
||||
base: 'relative rounded-full ring-[var(--ui-bg)] first:me-0'
|
||||
base: 'relative rounded-full ring-(--ui-bg) first:me-0'
|
||||
},
|
||||
variants: {
|
||||
size: {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export default {
|
||||
slots: {
|
||||
root: 'inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-[var(--ui-bg-elevated)]',
|
||||
root: 'inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-(--ui-bg-elevated)',
|
||||
image: 'h-full w-full rounded-[inherit] object-cover data-[error]:hidden',
|
||||
fallback: 'font-medium leading-none text-[var(--ui-text-muted)] truncate',
|
||||
icon: 'text-[var(--ui-text-muted)] shrink-0'
|
||||
fallback: 'font-medium leading-none text-(--ui-text-muted) truncate',
|
||||
icon: 'text-(--ui-text-muted) shrink-0'
|
||||
},
|
||||
variants: {
|
||||
size: {
|
||||
|
||||
@@ -58,35 +58,35 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'solid',
|
||||
class: `bg-[var(--ui-${color})] text-[var(--ui-bg)]`
|
||||
class: `bg-(--ui-${color}) text-(--ui-bg)`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'outline',
|
||||
class: `text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/50`
|
||||
class: `text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/50`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'soft',
|
||||
class: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})]`
|
||||
class: `bg-(--ui-${color})/10 text-(--ui-${color})`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'subtle',
|
||||
class: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25`
|
||||
class: `bg-(--ui-${color})/10 text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25`
|
||||
})), {
|
||||
color: 'neutral',
|
||||
variant: 'solid',
|
||||
class: 'text-[var(--ui-bg)] bg-[var(--ui-bg-inverted)]'
|
||||
class: 'text-(--ui-bg) bg-(--ui-bg-inverted)'
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'outline',
|
||||
class: 'ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg)]'
|
||||
class: 'ring ring-inset ring-(--ui-border-accented) text-(--ui-text) bg-(--ui-bg)'
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'soft',
|
||||
class: 'text-[var(--ui-text)] bg-[var(--ui-bg-elevated)]'
|
||||
class: 'text-(--ui-text) bg-(--ui-bg-elevated)'
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'subtle',
|
||||
class: 'ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg-elevated)]'
|
||||
class: 'ring ring-inset ring-(--ui-border-accented) text-(--ui-text) bg-(--ui-bg-elevated)'
|
||||
}],
|
||||
defaultVariants: {
|
||||
color: 'primary',
|
||||
|
||||
@@ -5,21 +5,21 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
root: 'relative min-w-0',
|
||||
list: 'flex items-center gap-1.5',
|
||||
item: 'flex min-w-0',
|
||||
link: 'group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-[var(--ui-primary)]',
|
||||
link: 'group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-(--ui-primary)',
|
||||
linkLeadingIcon: 'shrink-0 size-5',
|
||||
linkLeadingAvatar: 'shrink-0',
|
||||
linkLeadingAvatarSize: '2xs',
|
||||
linkLabel: 'truncate',
|
||||
separator: 'flex',
|
||||
separatorIcon: 'shrink-0 size-5 text-[var(--ui-text-muted)]'
|
||||
separatorIcon: 'shrink-0 size-5 text-(--ui-text-muted)'
|
||||
},
|
||||
variants: {
|
||||
active: {
|
||||
true: {
|
||||
link: 'text-[var(--ui-primary)] font-semibold'
|
||||
link: 'text-(--ui-primary) font-semibold'
|
||||
},
|
||||
false: {
|
||||
link: 'text-[var(--ui-text-muted)] font-medium'
|
||||
link: 'text-(--ui-text-muted) font-medium'
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
@@ -36,7 +36,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
active: false,
|
||||
to: true,
|
||||
class: {
|
||||
link: ['hover:text-[var(--ui-text)]', options.theme.transitions && 'transition-colors']
|
||||
link: ['hover:text-(--ui-text)', options.theme.transitions && 'transition-colors']
|
||||
}
|
||||
}]
|
||||
})
|
||||
|
||||
@@ -78,51 +78,51 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'solid',
|
||||
class: `text-[var(--ui-bg)] bg-[var(--ui-${color})] hover:bg-[var(--ui-${color})]/75 disabled:bg-[var(--ui-${color})] aria-disabled:bg-[var(--ui-${color})] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-${color})]`
|
||||
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})`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'outline',
|
||||
class: `ring ring-inset ring-[var(--ui-${color})]/50 text-[var(--ui-${color})] hover:bg-[var(--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-[var(--ui-${color})]`
|
||||
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})`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'soft',
|
||||
class: `text-[var(--ui-${color})] bg-[var(--ui-${color})]/10 hover:bg-[var(--ui-${color})]/15 focus-visible:bg-[var(--ui-${color})]/15 disabled:bg-[var(--ui-${color})]/10 aria-disabled:bg-[var(--ui-${color})]/10`
|
||||
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`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'subtle',
|
||||
class: `text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25 bg-[var(--ui-${color})]/10 hover:bg-[var(--ui-${color})]/15 disabled:bg-[var(--ui-${color})]/10 aria-disabled:bg-[var(--ui-${color})]/10 focus-visible:ring-2 focus-visible:ring-[var(--ui-${color})]`
|
||||
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})`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'ghost',
|
||||
class: `text-[var(--ui-${color})] hover:bg-[var(--ui-${color})]/10 focus-visible:bg-[var(--ui-${color})]/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent`
|
||||
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`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'link',
|
||||
class: `text-[var(--ui-${color})] hover:text-[var(--ui-${color})]/75 disabled:text-[var(--ui-${color})] aria-disabled:text-[var(--ui-${color})] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`
|
||||
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})`
|
||||
})), {
|
||||
color: 'neutral',
|
||||
variant: 'solid',
|
||||
class: 'text-[var(--ui-bg)] bg-[var(--ui-bg-inverted)] hover:bg-[var(--ui-bg-inverted)]/90 disabled:bg-[var(--ui-bg-inverted)] aria-disabled:bg-[var(--ui-bg-inverted)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-border-inverted)]'
|
||||
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)'
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'outline',
|
||||
class: 'ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg)] hover:bg-[var(--ui-bg-elevated)] disabled:bg-[var(--ui-bg)] aria-disabled:bg-[var(--ui-bg)] focus-visible:ring-2 focus-visible:ring-[var(--ui-border-inverted)]'
|
||||
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)'
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'soft',
|
||||
class: 'text-[var(--ui-text)] bg-[var(--ui-bg-elevated)] hover:bg-[var(--ui-bg-accented)]/75 focus-visible:bg-[var(--ui-bg-accented)]/75 disabled:bg-[var(--ui-bg-elevated)] aria-disabled:bg-[var(--ui-bg-elevated)]'
|
||||
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)'
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'subtle',
|
||||
class: 'ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg-elevated)] hover:bg-[var(--ui-bg-accented)]/75 disabled:bg-[var(--ui-bg-elevated)] aria-disabled:bg-[var(--ui-bg-elevated)] focus-visible:ring-2 focus-visible:ring-[var(--ui-border-inverted)]'
|
||||
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)'
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'ghost',
|
||||
class: 'text-[var(--ui-text)] hover:bg-[var(--ui-bg-elevated)] focus-visible:bg-[var(--ui-bg-elevated)] hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent'
|
||||
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'
|
||||
}, {
|
||||
color: 'neutral',
|
||||
variant: 'link',
|
||||
class: 'text-[var(--ui-text-muted)] hover:text-[var(--ui-text)] disabled:text-[var(--ui-text-muted)] aria-disabled:text-[var(--ui-text-muted)] focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-[var(--ui-border-inverted)]'
|
||||
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)'
|
||||
}, {
|
||||
size: 'xs',
|
||||
square: true,
|
||||
|
||||
@@ -12,17 +12,17 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
gridBody: 'grid',
|
||||
headCell: 'rounded-[calc(var(--ui-radius)*1.5)]',
|
||||
cell: 'relative text-center',
|
||||
cellTrigger: ['m-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap focus-visible:ring-2 focus:outline-none data-disabled:text-[var(--ui-text-muted)] data-unavailable:line-through data-unavailable:text-[var(--ui-text-muted)] data-unavailable:pointer-events-none data-[selected]:text-[var(--ui-bg)] data-today:font-semibold', options.theme.transitions && 'transition']
|
||||
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']
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||
headCell: `text-[var(--ui-${color})]`,
|
||||
cellTrigger: `focus-visible:ring-[var(--ui-${color})] data-[selected]:bg-[var(--ui-${color})] data-today:not-data-[selected]:text-[var(--ui-${color})] data-[highlighted]:bg-[var(--ui-${color})]/20 hover:not-data-[selected]:bg-[var(--ui-${color})]/20`
|
||||
headCell: `text-(--ui-${color})`,
|
||||
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`
|
||||
}])),
|
||||
neutral: {
|
||||
headCell: 'text-[var(--ui-bg-inverted)]',
|
||||
cellTrigger: 'focus-visible:ring-[var(--ui-border-inverted)] data-[selected]:bg-[var(--ui-bg-inverted)] data-today:not-data-[selected]:text-[var(--ui-bg-inverted)] data-[highlighted]:bg-[var(--ui-bg-inverted)]/20 hover:not-data-[selected]:bg-[var(--ui-bg-inverted)]/10'
|
||||
headCell: 'text-(--ui-bg-inverted)',
|
||||
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'
|
||||
}
|
||||
},
|
||||
size: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
slots: {
|
||||
root: 'bg-[var(--ui-bg)] ring ring-[var(--ui-border)] divide-y divide-[var(--ui-border)] rounded-[calc(var(--ui-radius)*2)] shadow-sm',
|
||||
root: 'bg-(--ui-bg) ring ring-(--ui-border) divide-y divide-(--ui-border) rounded-[calc(var(--ui-radius)*2)] shadow-sm',
|
||||
header: 'p-4 sm:px-6',
|
||||
body: 'p-4 sm:p-6',
|
||||
footer: 'p-4 sm:px-6'
|
||||
|
||||
@@ -11,7 +11,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
prev: 'absolute rounded-full',
|
||||
next: 'absolute rounded-full',
|
||||
dots: 'absolute inset-x-0 -bottom-7 flex flex-wrap items-center justify-center gap-3',
|
||||
dot: ['cursor-pointer size-3 bg-[var(--ui-border-accented)] rounded-full', options.theme.transitions && 'transition']
|
||||
dot: ['cursor-pointer size-3 bg-(--ui-border-accented) rounded-full', options.theme.transitions && 'transition']
|
||||
},
|
||||
variants: {
|
||||
orientation: {
|
||||
@@ -30,7 +30,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
active: {
|
||||
true: {
|
||||
dot: 'bg-[var(--ui-border-inverted)]'
|
||||
dot: 'bg-(--ui-border-inverted)'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,17 @@ import type { ModuleOptions } from '../module'
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'relative flex items-start',
|
||||
base: 'shrink-0 flex items-center justify-center rounded-[var(--ui-radius)] text-[var(--ui-bg)] ring ring-inset ring-[var(--ui-border-accented)] focus-visible:outline-2 focus-visible:outline-offset-2',
|
||||
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',
|
||||
container: 'flex items-center',
|
||||
wrapper: 'ms-2',
|
||||
icon: 'shrink-0 size-full',
|
||||
label: 'block font-medium text-[var(--ui-text)]',
|
||||
description: 'text-[var(--ui-text-muted)]'
|
||||
label: 'block font-medium text-(--ui-text)',
|
||||
description: 'text-(--ui-text-muted)'
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, `focus-visible:outline-[var(--ui-${color})]`])),
|
||||
neutral: 'focus-visible:outline-[var(--ui-border-inverted)]'
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, `focus-visible:outline-(--ui-${color})`])),
|
||||
neutral: 'focus-visible:outline-(--ui-border-inverted)'
|
||||
},
|
||||
size: {
|
||||
xs: {
|
||||
@@ -44,7 +44,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
required: {
|
||||
true: {
|
||||
label: 'after:content-[\'*\'] after:ms-0.5 after:text-[var(--ui-error)]'
|
||||
label: 'after:content-[\'*\'] after:ms-0.5 after:text-(--ui-error)'
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
@@ -61,11 +61,11 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
checked: true,
|
||||
class: `ring-2 ring-[var(--ui-${color})] bg-[var(--ui-${color})]`
|
||||
class: `ring-2 ring-(--ui-${color}) bg-(--ui-${color})`
|
||||
})), {
|
||||
color: 'neutral',
|
||||
checked: true,
|
||||
class: 'ring-2 ring-[var(--ui-border-inverted)] bg-[var(--ui-bg-inverted)]'
|
||||
class: 'ring-2 ring-(--ui-border-inverted) bg-(--ui-bg-inverted)'
|
||||
}],
|
||||
defaultVariants: {
|
||||
size: 'md',
|
||||
|
||||
@@ -3,12 +3,12 @@ import type { ModuleOptions } from '../module'
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'relative inline-flex items-center justify-center shrink-0',
|
||||
base: 'rounded-full ring ring-[var(--ui-bg)] flex items-center justify-center text-[var(--ui-bg)] font-medium whitespace-nowrap'
|
||||
base: 'rounded-full ring ring-(--ui-bg) flex items-center justify-center text-(--ui-bg) font-medium whitespace-nowrap'
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, `bg-[var(--ui-${color})]`])),
|
||||
neutral: 'bg-[var(--ui-text-muted)]'
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, `bg-(--ui-${color})`])),
|
||||
neutral: 'bg-(--ui-text-muted)'
|
||||
},
|
||||
size: {
|
||||
'3xs': 'h-[4px] min-w-[4px] text-[4px]',
|
||||
|
||||
@@ -4,9 +4,9 @@ export default {
|
||||
picker: 'flex gap-4',
|
||||
selector: 'rounded-[calc(var(--ui-radius)*1.5)]',
|
||||
selectorBackground: 'w-full h-full relative rounded-[calc(var(--ui-radius)*1.2)]',
|
||||
selectorThumb: '-translate-y-1/2 -translate-x-1/2 absolute size-4 ring-2 ring-[var(--color-white)] rounded-full cursor-pointer data-[disabled]:cursor-not-allowed',
|
||||
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',
|
||||
track: 'w-[8px] relative rounded-[calc(var(--ui-radius)*1.5)]',
|
||||
trackThumb: 'absolute transform -translate-y-1/2 -translate-x-[4px] rtl:translate-x-[4px] size-4 rounded-full ring-2 ring-[var(--color-white)] cursor-pointer data-[disabled]:cursor-not-allowed'
|
||||
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'
|
||||
},
|
||||
variants: {
|
||||
size: {
|
||||
|
||||
@@ -2,14 +2,14 @@ import type { ModuleOptions } from '../module'
|
||||
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'flex flex-col min-h-0 min-w-0 divide-y divide-[var(--ui-border)]',
|
||||
root: 'flex flex-col min-h-0 min-w-0 divide-y divide-(--ui-border)',
|
||||
input: '[&>input]:h-12',
|
||||
close: '',
|
||||
content: 'relative overflow-hidden flex flex-col',
|
||||
viewport: 'relative divide-y divide-[var(--ui-border)] scroll-py-1 overflow-y-auto flex-1 focus:outline-none',
|
||||
viewport: 'relative divide-y divide-(--ui-border) scroll-py-1 overflow-y-auto flex-1 focus:outline-none',
|
||||
group: 'p-1 isolate',
|
||||
empty: 'py-6 text-center text-sm text-[var(--ui-text-muted)]',
|
||||
label: 'px-2 py-1.5 text-xs font-semibold text-[var(--ui-text-highlighted)]',
|
||||
empty: 'py-6 text-center text-sm text-(--ui-text-muted)',
|
||||
label: 'px-2 py-1.5 text-xs font-semibold text-(--ui-text-highlighted)',
|
||||
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',
|
||||
itemLeadingIcon: 'shrink-0 size-5',
|
||||
itemLeadingAvatar: 'shrink-0',
|
||||
@@ -18,23 +18,23 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
itemLeadingChipSize: 'md',
|
||||
itemTrailing: 'ms-auto inline-flex gap-1.5 items-center',
|
||||
itemTrailingIcon: 'shrink-0 size-5',
|
||||
itemTrailingHighlightedIcon: 'shrink-0 size-5 text-[var(--ui-text-dimmed)] hidden group-data-highlighted:inline-flex',
|
||||
itemTrailingHighlightedIcon: 'shrink-0 size-5 text-(--ui-text-dimmed) hidden group-data-highlighted:inline-flex',
|
||||
itemTrailingKbds: 'hidden lg:inline-flex items-center shrink-0 gap-0.5',
|
||||
itemTrailingKbdsSize: 'md',
|
||||
itemLabel: 'truncate space-x-1 rtl:space-x-reverse',
|
||||
itemLabelBase: 'text-[var(--ui-text-highlighted)] [&>mark]:text-[var(--ui-bg)] [&>mark]:bg-[var(--ui-primary)]',
|
||||
itemLabelPrefix: 'text-[var(--ui-text)]',
|
||||
itemLabelSuffix: 'text-[var(--ui-text-dimmed)] [&>mark]:text-[var(--ui-bg)] [&>mark]:bg-[var(--ui-primary)]'
|
||||
itemLabelBase: 'text-(--ui-text-highlighted) [&>mark]:text-(--ui-bg) [&>mark]:bg-(--ui-primary)',
|
||||
itemLabelPrefix: 'text-(--ui-text)',
|
||||
itemLabelSuffix: 'text-(--ui-text-dimmed) [&>mark]:text-(--ui-bg) [&>mark]:bg-(--ui-primary)'
|
||||
},
|
||||
variants: {
|
||||
active: {
|
||||
true: {
|
||||
item: 'text-[var(--ui-text-highlighted)] before:bg-[var(--ui-bg-elevated)]',
|
||||
itemLeadingIcon: 'text-[var(--ui-text)]'
|
||||
item: 'text-(--ui-text-highlighted) before:bg-(--ui-bg-elevated)',
|
||||
itemLeadingIcon: 'text-(--ui-text)'
|
||||
},
|
||||
false: {
|
||||
item: ['text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)]', options.theme.transitions && 'transition-colors']
|
||||
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'],
|
||||
itemLeadingIcon: ['text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text)', options.theme.transitions && 'transition-colors']
|
||||
}
|
||||
},
|
||||
loading: {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default {
|
||||
base: 'max-w-[var(--ui-container)] mx-auto px-4 sm:px-6 lg:px-8'
|
||||
base: 'max-w-(--ui-container) mx-auto px-4 sm:px-6 lg:px-8'
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ import type { ModuleOptions } from '../module'
|
||||
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
content: 'min-w-32 bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] divide-y divide-[var(--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]',
|
||||
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]',
|
||||
group: 'p-1 isolate',
|
||||
label: 'w-full flex items-center font-semibold text-[var(--ui-text-highlighted)]',
|
||||
separator: '-mx-1 my-1 h-px bg-[var(--ui-border)]',
|
||||
label: 'w-full flex items-center font-semibold text-(--ui-text-highlighted)',
|
||||
separator: '-mx-1 my-1 h-px bg-(--ui-border)',
|
||||
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',
|
||||
itemLeadingIcon: 'shrink-0',
|
||||
itemLeadingAvatar: 'shrink-0',
|
||||
@@ -15,7 +15,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
itemTrailingKbds: 'hidden lg:inline-flex items-center shrink-0',
|
||||
itemTrailingKbdsSize: '',
|
||||
itemLabel: 'truncate',
|
||||
itemLabelExternalIcon: 'inline-block size-3 align-top text-[var(--ui-text-dimmed)]'
|
||||
itemLabelExternalIcon: 'inline-block size-3 align-top text-(--ui-text-dimmed)'
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
@@ -24,12 +24,12 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
active: {
|
||||
true: {
|
||||
item: 'text-[var(--ui-text-highlighted)] before:bg-[var(--ui-bg-elevated)]',
|
||||
itemLeadingIcon: 'text-[var(--ui-text)]'
|
||||
item: 'text-(--ui-text-highlighted) before:bg-(--ui-bg-elevated)',
|
||||
itemLeadingIcon: 'text-(--ui-text)'
|
||||
},
|
||||
false: {
|
||||
item: ['text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-[state=open]:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50 data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]', options.theme.transitions && 'transition-colors']
|
||||
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'],
|
||||
itemLeadingIcon: ['text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text) group-data-[state=open]:text-(--ui-text)', options.theme.transitions && 'transition-colors']
|
||||
}
|
||||
},
|
||||
loading: {
|
||||
@@ -89,15 +89,15 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
color,
|
||||
active: false,
|
||||
class: {
|
||||
item: `text-[var(--ui-${color})] data-highlighted:text-[var(--ui-${color})] data-highlighted:before:bg-[var(--ui-${color})]/10 data-[state=open]:before:bg-[var(--ui-${color})]/10`,
|
||||
itemLeadingIcon: `text-[var(--ui-${color})]/75 group-data-highlighted:text-[var(--ui-${color})] group-data-[state=open]:text-[var(--ui-${color})]`
|
||||
item: `text-(--ui-${color}) data-highlighted:text-(--ui-${color}) data-highlighted:before:bg-(--ui-${color})/10 data-[state=open]:before:bg-(--ui-${color})/10`,
|
||||
itemLeadingIcon: `text-(--ui-${color})/75 group-data-highlighted:text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
||||
}
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
active: true,
|
||||
class: {
|
||||
item: `text-[var(--ui-${color})] before:bg-[var(--ui-${color})]/10`,
|
||||
itemLeadingIcon: `text-[var(--ui-${color})]`
|
||||
item: `text-(--ui-${color}) before:bg-(--ui-${color})/10`,
|
||||
itemLeadingIcon: `text-(--ui-${color})`
|
||||
}
|
||||
}))],
|
||||
defaultVariants: {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export default {
|
||||
slots: {
|
||||
overlay: 'fixed inset-0 bg-[var(--ui-bg-elevated)]/75',
|
||||
content: 'fixed bg-[var(--ui-bg)] ring ring-[var(--ui-border)] flex focus:outline-none',
|
||||
handle: 'shrink-0 rounded-full bg-[var(--ui-bg-accented)]',
|
||||
overlay: 'fixed inset-0 bg-(--ui-bg-elevated)/75',
|
||||
content: 'fixed bg-(--ui-bg) ring ring-(--ui-border) flex focus:outline-none',
|
||||
handle: 'shrink-0 rounded-full bg-(--ui-bg-accented)',
|
||||
container: 'w-full flex flex-col gap-4 p-4 overflow-y-auto',
|
||||
header: '',
|
||||
title: 'text-[var(--ui-text-highlighted)] font-semibold',
|
||||
description: 'mt-1 text-[var(--ui-text-muted)] text-sm',
|
||||
title: 'text-(--ui-text-highlighted) font-semibold',
|
||||
description: 'mt-1 text-(--ui-text-muted) text-sm',
|
||||
body: 'flex-1',
|
||||
footer: 'flex flex-col gap-1.5'
|
||||
},
|
||||
|
||||
@@ -2,11 +2,11 @@ import type { ModuleOptions } from '../module'
|
||||
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
content: 'min-w-32 bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] divide-y divide-[var(--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]',
|
||||
arrow: 'fill-[var(--ui-border)]',
|
||||
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]',
|
||||
arrow: 'fill-(--ui-border)',
|
||||
group: 'p-1 isolate',
|
||||
label: 'w-full flex items-center font-semibold text-[var(--ui-text-highlighted)]',
|
||||
separator: '-mx-1 my-1 h-px bg-[var(--ui-border)]',
|
||||
label: 'w-full flex items-center font-semibold text-(--ui-text-highlighted)',
|
||||
separator: '-mx-1 my-1 h-px bg-(--ui-border)',
|
||||
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',
|
||||
itemLeadingIcon: 'shrink-0',
|
||||
itemLeadingAvatar: 'shrink-0',
|
||||
@@ -16,7 +16,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
itemTrailingKbds: 'hidden lg:inline-flex items-center shrink-0',
|
||||
itemTrailingKbdsSize: '',
|
||||
itemLabel: 'truncate',
|
||||
itemLabelExternalIcon: 'inline-block size-3 align-top text-[var(--ui-text-dimmed)]'
|
||||
itemLabelExternalIcon: 'inline-block size-3 align-top text-(--ui-text-dimmed)'
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
@@ -25,12 +25,12 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
active: {
|
||||
true: {
|
||||
item: 'text-[var(--ui-text-highlighted)] before:bg-[var(--ui-bg-elevated)]',
|
||||
itemLeadingIcon: 'text-[var(--ui-text)]'
|
||||
item: 'text-(--ui-text-highlighted) before:bg-(--ui-bg-elevated)',
|
||||
itemLeadingIcon: 'text-(--ui-text)'
|
||||
},
|
||||
false: {
|
||||
item: ['text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-[state=open]:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50 data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]', options.theme.transitions && 'transition-colors']
|
||||
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'],
|
||||
itemLeadingIcon: ['text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text) group-data-[state=open]:text-(--ui-text)', options.theme.transitions && 'transition-colors']
|
||||
}
|
||||
},
|
||||
loading: {
|
||||
@@ -90,15 +90,15 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
color,
|
||||
active: false,
|
||||
class: {
|
||||
item: `text-[var(--ui-${color})] data-highlighted:text-[var(--ui-${color})] data-highlighted:before:bg-[var(--ui-${color})]/10 data-[state=open]:before:bg-[var(--ui-${color})]/10`,
|
||||
itemLeadingIcon: `text-[var(--ui-${color})]/75 group-data-highlighted:text-[var(--ui-${color})] group-data-[state=open]:text-[var(--ui-${color})]`
|
||||
item: `text-(--ui-${color}) data-highlighted:text-(--ui-${color}) data-highlighted:before:bg-(--ui-${color})/10 data-[state=open]:before:bg-(--ui-${color})/10`,
|
||||
itemLeadingIcon: `text-(--ui-${color})/75 group-data-highlighted:text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
||||
}
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
active: true,
|
||||
class: {
|
||||
item: `text-[var(--ui-${color})] before:bg-[var(--ui-${color})]/10`,
|
||||
itemLeadingIcon: `text-[var(--ui-${color})]`
|
||||
item: `text-(--ui-${color}) before:bg-(--ui-${color})/10`,
|
||||
itemLeadingIcon: `text-(--ui-${color})`
|
||||
}
|
||||
}))],
|
||||
defaultVariants: {
|
||||
|
||||
@@ -3,12 +3,12 @@ export default {
|
||||
root: '',
|
||||
wrapper: '',
|
||||
labelWrapper: 'flex content-center items-center justify-between',
|
||||
label: 'block font-medium text-[var(--ui-text)]',
|
||||
label: 'block font-medium text-(--ui-text)',
|
||||
container: 'mt-1 relative',
|
||||
description: 'text-[var(--ui-text-muted)]',
|
||||
error: 'mt-2 text-[var(--ui-error)]',
|
||||
hint: 'text-[var(--ui-text-muted)]',
|
||||
help: 'mt-2 text-[var(--ui-text-muted)]'
|
||||
description: 'text-(--ui-text-muted)',
|
||||
error: 'mt-2 text-(--ui-error)',
|
||||
hint: 'text-(--ui-text-muted)',
|
||||
help: 'mt-2 text-(--ui-text-muted)'
|
||||
},
|
||||
variants: {
|
||||
size: {
|
||||
@@ -20,7 +20,7 @@ export default {
|
||||
},
|
||||
required: {
|
||||
true: {
|
||||
label: `after:content-['*'] after:ms-0.5 after:text-[var(--ui-error)]`
|
||||
label: `after:content-['*'] after:ms-0.5 after:text-(--ui-error)`
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7,15 +7,15 @@ export default (options: Required<ModuleOptions>) => {
|
||||
slots: {
|
||||
base: () => ['rounded-[calc(var(--ui-radius)*1.5)]', options.theme.transitions && 'transition-colors'],
|
||||
trailing: 'group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75',
|
||||
arrow: 'fill-[var(--ui-border)]',
|
||||
content: 'max-h-60 w-[var(--reka-popper-anchor-width)] bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--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',
|
||||
viewport: 'divide-y divide-[var(--ui-border)] scroll-py-1',
|
||||
arrow: 'fill-(--ui-border)',
|
||||
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',
|
||||
viewport: 'divide-y divide-(--ui-border) scroll-py-1',
|
||||
group: 'p-1 isolate',
|
||||
empty: 'py-2 text-center text-sm text-[var(--ui-text-muted)]',
|
||||
label: 'font-semibold text-[var(--ui-text-highlighted)]',
|
||||
separator: '-mx-1 my-1 h-px bg-[var(--ui-border)]',
|
||||
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-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['shrink-0 text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)]', options.theme.transitions && 'transition-colors'],
|
||||
empty: 'py-2 text-center text-sm text-(--ui-text-muted)',
|
||||
label: 'font-semibold text-(--ui-text-highlighted)',
|
||||
separator: '-mx-1 my-1 h-px bg-(--ui-border)',
|
||||
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'],
|
||||
itemLeadingIcon: ['shrink-0 text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text)', options.theme.transitions && 'transition-colors'],
|
||||
itemLeadingAvatar: 'shrink-0',
|
||||
itemLeadingAvatarSize: '',
|
||||
itemLeadingChip: 'shrink-0',
|
||||
@@ -23,9 +23,9 @@ export default (options: Required<ModuleOptions>) => {
|
||||
itemTrailing: 'ms-auto inline-flex gap-1.5 items-center',
|
||||
itemTrailingIcon: 'shrink-0',
|
||||
itemLabel: 'truncate',
|
||||
tagsItem: 'px-1.5 py-0.5 rounded-[var(--ui-radius)] font-medium inline-flex items-center gap-0.5 ring ring-inset ring-[var(--ui-border-accented)] bg-[var(--ui-bg-elevated)] text-[var(--ui-text)] data-disabled:cursor-not-allowed data-disabled:opacity-75',
|
||||
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',
|
||||
tagsItemText: 'truncate',
|
||||
tagsItemDelete: ['inline-flex items-center rounded-[calc(var(--ui-radius)/2)] text-[var(--ui-text-dimmed)] hover:text-[var(--ui-text)] hover:bg-[var(--ui-bg-accented)]/75 disabled:pointer-events-none', options.theme.transitions && 'transition-colors'],
|
||||
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'],
|
||||
tagsItemDeleteIcon: '',
|
||||
tagsInput: ''
|
||||
},
|
||||
@@ -33,10 +33,10 @@ export default (options: Required<ModuleOptions>) => {
|
||||
multiple: {
|
||||
true: {
|
||||
root: 'flex-wrap',
|
||||
tagsInput: 'border-0 bg-transparent placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
tagsInput: 'border-0 bg-transparent placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
},
|
||||
false: {
|
||||
base: 'w-full border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
base: 'w-full border-0 placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
}
|
||||
},
|
||||
size: {
|
||||
@@ -101,12 +101,12 @@ export default (options: Required<ModuleOptions>) => {
|
||||
color,
|
||||
multiple: true,
|
||||
variant: ['outline', 'subtle'],
|
||||
class: `has-focus-visible:ring-2 has-focus-visible:ring-[var(--ui-${color})]`
|
||||
class: `has-focus-visible:ring-2 has-focus-visible:ring-(--ui-${color})`
|
||||
})), {
|
||||
color: 'neutral',
|
||||
multiple: true,
|
||||
variant: ['outline', 'subtle'],
|
||||
class: 'has-focus-visible:ring-2 has-focus-visible:ring-[var(--ui-border-inverted)]'
|
||||
class: 'has-focus-visible:ring-2 has-focus-visible:ring-(--ui-border-inverted)'
|
||||
}]
|
||||
}, input(options))
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export default (options: Required<ModuleOptions>) => {
|
||||
return {
|
||||
slots: {
|
||||
root: 'relative inline-flex items-center',
|
||||
base: ['w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75', options.theme.transitions && 'transition-colors'],
|
||||
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'],
|
||||
increment: 'absolute flex items-center',
|
||||
decrement: 'absolute flex items-center'
|
||||
},
|
||||
@@ -50,19 +50,19 @@ export default (options: Required<ModuleOptions>) => {
|
||||
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: ['outline', 'subtle'],
|
||||
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`
|
||||
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
highlight: true,
|
||||
class: `ring ring-inset ring-[var(--ui-${color})]`
|
||||
class: `ring ring-inset ring-(--ui-${color})`
|
||||
})), {
|
||||
color: 'neutral',
|
||||
variant: ['outline', 'subtle'],
|
||||
class: 'focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-border-inverted)]'
|
||||
class: 'focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)'
|
||||
}, {
|
||||
color: 'neutral',
|
||||
highlight: true,
|
||||
class: 'ring ring-inset ring-[var(--ui-border-inverted)]'
|
||||
class: 'ring ring-inset ring-(--ui-border-inverted)'
|
||||
}, {
|
||||
orientation: 'horizontal',
|
||||
size: 'xs',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user