mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-22 07:50:36 +01:00
refactor(module)!: implement design system with CSS variables (#2298)
This commit is contained in:
@@ -2,6 +2,7 @@ import { defu } from 'defu'
|
||||
import { createResolver, defineNuxtModule, addComponentsDir, addImportsDir, addVitePlugin, addPlugin, installModule, hasNuxtModule } from '@nuxt/kit'
|
||||
import { addTemplates } from './templates'
|
||||
import icons from './theme/icons'
|
||||
import { pick } from './runtime/utils'
|
||||
|
||||
export type * from './runtime/types'
|
||||
|
||||
@@ -18,10 +19,16 @@ export interface ModuleOptions {
|
||||
*/
|
||||
fonts?: boolean
|
||||
|
||||
/**
|
||||
* Enable or disable `@nuxtjs/color-mode` module
|
||||
* @defaultValue true
|
||||
*/
|
||||
colorMode?: boolean
|
||||
|
||||
theme?: {
|
||||
/**
|
||||
* Colors to generate classes for (defaults to TailwindCSS colors)
|
||||
* @defaultValue ['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']
|
||||
* @defaultValue ['primary', 'secondary', 'success', 'info', 'warning', 'error']
|
||||
*/
|
||||
colors?: string[]
|
||||
|
||||
@@ -44,6 +51,7 @@ export default defineNuxtModule<ModuleOptions>({
|
||||
defaults: {
|
||||
prefix: 'U',
|
||||
fonts: true,
|
||||
colorMode: true,
|
||||
theme: {
|
||||
colors: undefined,
|
||||
transitions: true
|
||||
@@ -53,18 +61,22 @@ export default defineNuxtModule<ModuleOptions>({
|
||||
const { resolve } = createResolver(import.meta.url)
|
||||
|
||||
options.theme = options.theme || {}
|
||||
options.theme.colors = options.theme.colors?.length ? [...new Set(['primary', 'error', ...options.theme.colors])] : ['primary', 'error', 'red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']
|
||||
options.theme.colors = options.theme.colors?.length ? [...new Set(['primary', ...options.theme.colors])] : ['primary', 'secondary', 'success', 'info', 'warning', 'error']
|
||||
|
||||
nuxt.options.ui = options
|
||||
|
||||
nuxt.options.alias['#ui'] = resolve('./runtime')
|
||||
|
||||
nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, {
|
||||
colors: {
|
||||
colors: pick({
|
||||
primary: 'green',
|
||||
secondary: 'blue',
|
||||
success: 'green',
|
||||
info: 'blue',
|
||||
warning: 'yellow',
|
||||
error: 'red',
|
||||
gray: 'slate'
|
||||
},
|
||||
neutral: 'slate'
|
||||
}, [...(options.theme?.colors || []), 'neutral' as any]),
|
||||
icons
|
||||
})
|
||||
|
||||
@@ -88,8 +100,12 @@ export default defineNuxtModule<ModuleOptions>({
|
||||
}
|
||||
|
||||
await registerModule('@nuxt/icon', { cssLayer: 'components' })
|
||||
await registerModule('@nuxt/fonts', { experimental: { processCSSVariables: true } })
|
||||
await registerModule('@nuxtjs/color-mode', { classSuffix: '', disableTransition: true })
|
||||
if (options.fonts) {
|
||||
await registerModule('@nuxt/fonts', { experimental: { processCSSVariables: true } })
|
||||
}
|
||||
if (options.colorMode) {
|
||||
await registerModule('@nuxtjs/color-mode', { classSuffix: '', disableTransition: true })
|
||||
}
|
||||
|
||||
addPlugin({ src: resolve('./runtime/plugins/colors') })
|
||||
addPlugin({ src: resolve('./runtime/plugins/modal') })
|
||||
|
||||
@@ -31,7 +31,7 @@ export interface AlertProps {
|
||||
actions?: ButtonProps[]
|
||||
/**
|
||||
* Display a close button to dismiss the alert.
|
||||
* `{ size: 'md', color: 'gray', variant: 'link' }`{lang="ts-type"}
|
||||
* `{ size: 'md', color: 'neutral', variant: 'link' }`{lang="ts-type"}
|
||||
* @emits `close`
|
||||
* @defaultValue false
|
||||
*/
|
||||
@@ -117,7 +117,7 @@ const ui = computed(() => alert({
|
||||
v-if="close"
|
||||
:icon="closeIcon || appConfig.ui.icons.close"
|
||||
size="md"
|
||||
color="gray"
|
||||
color="neutral"
|
||||
variant="link"
|
||||
aria-label="Close"
|
||||
v-bind="typeof close === 'object' ? close : undefined"
|
||||
|
||||
@@ -67,7 +67,7 @@ export interface CommandPaletteProps<G, T> extends Pick<ComboboxRootProps, 'mult
|
||||
placeholder?: InputProps['placeholder']
|
||||
/**
|
||||
* Display a close button in the input (useful when inside a Modal for example).
|
||||
* `{ size: 'md', color: 'gray', variant: 'ghost' }`{lang="ts-type"}
|
||||
* `{ size: 'md', color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
|
||||
* @defaultValue false
|
||||
*/
|
||||
close?: ButtonProps | boolean
|
||||
@@ -233,7 +233,7 @@ const groups = computed(() => {
|
||||
v-if="close"
|
||||
:icon="closeIcon || appConfig.ui.icons.close"
|
||||
size="md"
|
||||
color="gray"
|
||||
color="neutral"
|
||||
variant="ghost"
|
||||
aria-label="Close"
|
||||
v-bind="typeof close === 'object' ? close : undefined"
|
||||
|
||||
@@ -37,7 +37,7 @@ export interface ModalProps extends DialogRootProps {
|
||||
portal?: boolean
|
||||
/**
|
||||
* Display a close button to dismiss the modal.
|
||||
* `{ size: 'md', color: 'gray', variant: 'ghost' }`{lang="ts-type"}
|
||||
* `{ size: 'md', color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
|
||||
* @defaultValue true
|
||||
*/
|
||||
close?: ButtonProps | boolean
|
||||
@@ -138,7 +138,7 @@ const ui = computed(() => modal({
|
||||
v-if="close"
|
||||
:icon="closeIcon || appConfig.ui.icons.close"
|
||||
size="md"
|
||||
color="gray"
|
||||
color="neutral"
|
||||
variant="ghost"
|
||||
aria-label="Close"
|
||||
v-bind="typeof close === 'object' ? close : undefined"
|
||||
|
||||
@@ -142,7 +142,7 @@ const lists = computed(() => props.items?.length ? (Array.isArray(props.items[0]
|
||||
<slot :name="item.slot ? `${item.slot}-trailing`: 'item-trailing'" :item="item" :active="active" :index="index">
|
||||
<UBadge
|
||||
v-if="item.badge"
|
||||
color="gray"
|
||||
color="neutral"
|
||||
variant="outline"
|
||||
:size="((props.ui?.linkTrailingBadgeSize || ui.linkTrailingBadgeSize()) as BadgeProps['size'])"
|
||||
v-bind="(typeof item.badge === 'string' || typeof item.badge === 'number') ? { label: item.badge } : item.badge"
|
||||
|
||||
@@ -44,7 +44,7 @@ export interface PaginationProps extends Pick<PaginationRootProps, 'defaultPage'
|
||||
ellipsisIcon?: string
|
||||
/**
|
||||
* The color of the pagination controls.
|
||||
* @defaultValue 'gray'
|
||||
* @defaultValue 'neutral'
|
||||
*/
|
||||
color?: ButtonProps['color']
|
||||
/**
|
||||
@@ -106,7 +106,7 @@ import { useAppConfig } from '#imports'
|
||||
|
||||
const props = withDefaults(defineProps<PaginationProps>(), {
|
||||
size: 'md',
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'outline',
|
||||
activeColor: 'primary',
|
||||
activeVariant: 'solid',
|
||||
|
||||
@@ -35,7 +35,7 @@ export interface SlideoverProps extends DialogRootProps {
|
||||
portal?: boolean
|
||||
/**
|
||||
* Display a close button to dismiss the slideover.
|
||||
* `{ size: 'md', color: 'gray', variant: 'ghost' }`{lang="ts-type"}
|
||||
* `{ size: 'md', color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
|
||||
* @defaultValue true
|
||||
*/
|
||||
close?: ButtonProps | boolean
|
||||
@@ -137,7 +137,7 @@ const ui = computed(() => slideover({
|
||||
v-if="close"
|
||||
:icon="closeIcon || appConfig.ui.icons.close"
|
||||
size="md"
|
||||
color="gray"
|
||||
color="neutral"
|
||||
variant="ghost"
|
||||
aria-label="Close"
|
||||
v-bind="typeof close === 'object' ? close : undefined"
|
||||
|
||||
@@ -31,7 +31,7 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
||||
actions?: ButtonProps[]
|
||||
/**
|
||||
* Display a close button to dismiss the toast.
|
||||
* `{ size: 'md', color: 'gray', variant: 'link' }`{lang="ts-type"}
|
||||
* `{ size: 'md', color: 'neutral', variant: 'link' }`{lang="ts-type"}
|
||||
* @defaultValue true
|
||||
*/
|
||||
close?: ButtonProps | boolean
|
||||
@@ -145,7 +145,7 @@ defineExpose({
|
||||
v-if="close"
|
||||
:icon="closeIcon || appConfig.ui.icons.close"
|
||||
size="md"
|
||||
color="gray"
|
||||
color="neutral"
|
||||
variant="link"
|
||||
aria-label="Close"
|
||||
v-bind="typeof close === 'object' ? close : undefined"
|
||||
|
||||
@@ -1,59 +1,50 @@
|
||||
@theme {
|
||||
--color-gray-*: initial;
|
||||
--color-cool-50: #f9fafb;
|
||||
--color-cool-100: #f3f4f6;
|
||||
--color-cool-200: #e5e7eb;
|
||||
--color-cool-300: #d1d5db;
|
||||
--color-cool-400: #9ca3af;
|
||||
--color-cool-500: #6b7280;
|
||||
--color-cool-600: #4b5563;
|
||||
--color-cool-700: #374151;
|
||||
--color-cool-800: #1f2937;
|
||||
--color-cool-900: #111827;
|
||||
--color-cool-950: #030712;
|
||||
|
||||
--spacing-4_5: 1.125rem;
|
||||
|
||||
--color-primary-50: var(--color-primary-50);
|
||||
--color-primary-100: var(--color-primary-100);
|
||||
--color-primary-200: var(--color-primary-200);
|
||||
--color-primary-300: var(--color-primary-300);
|
||||
--color-primary-400: var(--color-primary-400);
|
||||
--color-primary-500: var(--color-primary-500);
|
||||
--color-primary-600: var(--color-primary-600);
|
||||
--color-primary-700: var(--color-primary-700);
|
||||
--color-primary-800: var(--color-primary-800);
|
||||
--color-primary-900: var(--color-primary-900);
|
||||
--color-primary-950: var(--color-primary-950);
|
||||
--color-error-50: var(--color-error-50);
|
||||
--color-error-100: var(--color-error-100);
|
||||
--color-error-200: var(--color-error-200);
|
||||
--color-error-300: var(--color-error-300);
|
||||
--color-error-400: var(--color-error-400);
|
||||
--color-error-500: var(--color-error-500);
|
||||
--color-error-600: var(--color-error-600);
|
||||
--color-error-700: var(--color-error-700);
|
||||
--color-error-800: var(--color-error-800);
|
||||
--color-error-900: var(--color-error-900);
|
||||
--color-error-950: var(--color-error-950);
|
||||
--color-gray-50: var(--color-gray-50);
|
||||
--color-gray-100: var(--color-gray-100);
|
||||
--color-gray-200: var(--color-gray-200);
|
||||
--color-gray-300: var(--color-gray-300);
|
||||
--color-gray-400: var(--color-gray-400);
|
||||
--color-gray-500: var(--color-gray-500);
|
||||
--color-gray-600: var(--color-gray-600);
|
||||
--color-gray-700: var(--color-gray-700);
|
||||
--color-gray-800: var(--color-gray-800);
|
||||
--color-gray-900: var(--color-gray-900);
|
||||
--color-gray-950: var(--color-gray-950);
|
||||
}
|
||||
|
||||
@variant dark (&:where(.dark, .dark *));
|
||||
|
||||
@layer base {
|
||||
body {
|
||||
@apply antialiased font-sans text-[--ui-text] bg-[--ui-bg];
|
||||
}
|
||||
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
color-scheme: light;
|
||||
|
||||
--ui-text-dimmed: var(--ui-color-neutral-400);
|
||||
--ui-text-muted: var(--ui-color-neutral-500);
|
||||
--ui-text-toned: var(--ui-color-neutral-600);
|
||||
--ui-text: var(--ui-color-neutral-700);
|
||||
--ui-text-highlighted: var(--ui-color-neutral-900);
|
||||
|
||||
--ui-bg: var(--color-white);
|
||||
--ui-bg-elevated: var(--ui-color-neutral-100);
|
||||
--ui-bg-accented: var(--ui-color-neutral-200);
|
||||
--ui-bg-inverted: var(--ui-color-neutral-900);
|
||||
|
||||
--ui-border: var(--ui-color-neutral-200);
|
||||
--ui-border-accented: var(--ui-color-neutral-300);
|
||||
--ui-border-inverted: var(--ui-color-neutral-900);
|
||||
}
|
||||
|
||||
.dark {
|
||||
color-scheme: dark;
|
||||
|
||||
--ui-text-dimmed: var(--ui-color-neutral-500);
|
||||
--ui-text-muted: var(--ui-color-neutral-400);
|
||||
--ui-text-toned: var(--ui-color-neutral-300);
|
||||
--ui-text: var(--ui-color-neutral-200);
|
||||
--ui-text-highlighted: var(--color-white);
|
||||
|
||||
--ui-bg: var(--ui-color-neutral-900);
|
||||
--ui-bg-elevated: var(--ui-color-neutral-800);
|
||||
--ui-bg-accented: var(--ui-color-neutral-700);
|
||||
--ui-bg-inverted: var(--color-white);
|
||||
|
||||
--ui-border: var(--ui-color-neutral-800);
|
||||
--ui-border-accented: var(--ui-color-neutral-700);
|
||||
--ui-border-inverted: var(--color-white);
|
||||
}
|
||||
|
||||
@keyframes accordion-up {
|
||||
|
||||
@@ -9,19 +9,24 @@ export default defineNuxtPlugin(() => {
|
||||
|
||||
const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950]
|
||||
|
||||
function generateColor(key: string, value: string) {
|
||||
return `${shades.map(shade => `--color-${key}-${shade}: var(--color-${value}-${shade});`).join('\n ')}`
|
||||
function generateShades(key: string, value: string) {
|
||||
return `${shades.map(shade => `--ui-color-${key}-${shade}: var(--color-${value}-${shade});`).join('\n ')}`
|
||||
}
|
||||
function generateColor(key: string, shade: number) {
|
||||
return `--ui-${key}: var(--ui-color-${key}-${shade});`
|
||||
}
|
||||
|
||||
const root = computed(() => {
|
||||
const { neutral, ...colors } = appConfig.ui.colors
|
||||
|
||||
return `:root {
|
||||
${Object.entries(appConfig.ui.colors).map(([key, value]: [string, string]) => generateColor(key, value)).join('\n ')}
|
||||
--color-primary-DEFAULT: var(--color-primary-500);
|
||||
${Object.entries(appConfig.ui.colors).map(([key, value]: [string, string]) => generateShades(key, value)).join('\n ')}
|
||||
|
||||
${Object.keys(colors).map(key => generateColor(key, 500)).join('\n ')}
|
||||
}
|
||||
.dark {
|
||||
--color-primary-DEFAULT: var(--color-primary-400);
|
||||
}
|
||||
`
|
||||
${Object.keys(colors).map(key => generateColor(key, 400)).join('\n ')}
|
||||
}`
|
||||
})
|
||||
|
||||
// Head
|
||||
|
||||
@@ -52,15 +52,17 @@ export function addTemplates(options: ModuleOptions, nuxt: Nuxt) {
|
||||
filename: 'types/ui.d.ts',
|
||||
getContents: () => `import * as ui from '#build/ui'
|
||||
import type { DeepPartial } from '#ui/types/utils'
|
||||
import colors from 'tailwindcss/colors'
|
||||
|
||||
const colors = ${JSON.stringify(options.theme?.colors || [])} as const;
|
||||
const icons = ${JSON.stringify(nuxt.options.appConfig.ui.icons)};
|
||||
|
||||
type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone'
|
||||
type Color = Exclude<keyof typeof colors, 'inherit' | 'current' | 'transparent' | 'black' | 'white' | NeutralColor>
|
||||
|
||||
type AppConfigUI = {
|
||||
colors?: {
|
||||
primary?: Exclude<typeof colors[number], 'error' | 'primary'>
|
||||
error?: Exclude<typeof colors[number], 'primary' | 'error'>
|
||||
gray?: 'slate' | 'cool' | 'zinc' | 'neutral' | 'stone'
|
||||
${options.theme?.colors?.map(color => `${color}?: Color`).join('\n\t\t')}
|
||||
neutral?: NeutralColor
|
||||
}
|
||||
icons?: Partial<typeof icons>
|
||||
} & DeepPartial<typeof ui, string>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export default {
|
||||
slots: {
|
||||
root: 'w-full',
|
||||
item: 'border-b border-gray-200 dark:border-gray-800 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-primary-500 dark:focus-visible:outline-primary-400 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',
|
||||
|
||||
@@ -15,7 +15,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||
gray: ''
|
||||
neutral: ''
|
||||
},
|
||||
variant: {
|
||||
solid: '',
|
||||
@@ -38,49 +38,49 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
color,
|
||||
variant: 'solid',
|
||||
class: {
|
||||
root: `bg-${color}-500 dark:bg-${color}-400 text-white dark:text-gray-900`
|
||||
root: `bg-[--ui-${color}] text-[--ui-bg]`
|
||||
}
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'outline',
|
||||
class: {
|
||||
root: `text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/25 dark:ring-${color}-400/25`
|
||||
root: `text-[--ui-${color}] ring ring-inset ring-[--ui-${color}]/25`
|
||||
}
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'soft',
|
||||
class: {
|
||||
root: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400`
|
||||
root: `bg-[--ui-${color}]/10 text-[--ui-${color}]`
|
||||
}
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'subtle',
|
||||
class: {
|
||||
root: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/25 dark:ring-${color}-400/25`
|
||||
root: `bg-[--ui-${color}]/10 text-[--ui-${color}] ring ring-inset ring-[--ui-${color}]/25`
|
||||
}
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'solid',
|
||||
class: {
|
||||
root: 'text-white dark:text-gray-900 bg-gray-900 dark:bg-white'
|
||||
root: 'text-[--ui-bg] bg-[--ui-bg-inverted]'
|
||||
}
|
||||
}, {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'outline',
|
||||
class: {
|
||||
root: 'text-gray-900 dark:text-white bg-white dark:bg-gray-900 ring ring-inset ring-gray-200 dark:ring-gray-800'
|
||||
root: 'text-[--ui-text-highlighted] bg-[--ui-bg] ring ring-inset ring-[--ui-border]'
|
||||
}
|
||||
}, {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'soft',
|
||||
class: {
|
||||
root: 'text-gray-900 dark:text-white bg-gray-50 dark:bg-gray-800/50'
|
||||
root: 'text-[--ui-text-highlighted] bg-[--ui-bg-elevated]/50'
|
||||
}
|
||||
}, {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'subtle',
|
||||
class: {
|
||||
root: 'text-gray-900 dark:text-white bg-gray-50 dark:bg-gray-800/50 ring ring-inset ring-gray-300 dark:ring-gray-700'
|
||||
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-white dark:ring-gray-900 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-gray-100 dark:bg-gray-800',
|
||||
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',
|
||||
fallback: 'font-medium leading-none text-gray-500 dark:text-gray-400 truncate',
|
||||
icon: 'text-gray-500 dark:text-gray-400 shrink-0'
|
||||
fallback: 'font-medium leading-none text-[--ui-text-muted] truncate',
|
||||
icon: 'text-[--ui-text-muted] shrink-0'
|
||||
},
|
||||
variants: {
|
||||
size: {
|
||||
|
||||
@@ -5,7 +5,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||
gray: ''
|
||||
neutral: ''
|
||||
},
|
||||
variant: {
|
||||
solid: '',
|
||||
@@ -22,35 +22,35 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'solid',
|
||||
class: `bg-${color}-500 dark:bg-${color}-400 text-white dark:text-gray-900`
|
||||
class: `bg-[--ui-${color}] text-[--ui-bg]`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'outline',
|
||||
class: `text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/50 dark:ring-${color}-400/50`
|
||||
class: `text-[--ui-${color}] ring ring-inset ring-[--ui-${color}]/50`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'soft',
|
||||
class: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400`
|
||||
class: `bg-[--ui-${color}]/10 text-[--ui-${color}]`
|
||||
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'subtle',
|
||||
class: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/25 dark:ring-${color}-400/25`
|
||||
class: `bg-[--ui-${color}]/10 text-[--ui-${color}] ring ring-inset ring-[--ui-${color}]/25`
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'solid',
|
||||
class: 'text-white dark:text-gray-900 bg-gray-900 dark:bg-white'
|
||||
class: 'text-[--ui-bg] bg-[--ui-bg-inverted]'
|
||||
}, {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'outline',
|
||||
class: 'ring ring-inset ring-gray-300 dark:ring-gray-700 text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-900'
|
||||
class: 'ring ring-inset ring-[--ui-border-accented] text-[--ui-text] bg-[--ui-bg]'
|
||||
}, {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'soft',
|
||||
class: 'text-gray-700 dark:text-gray-200 bg-gray-100 dark:bg-gray-800'
|
||||
class: 'text-[--ui-text] bg-[--ui-bg-elevated]'
|
||||
}, {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'subtle',
|
||||
class: 'ring ring-inset ring-gray-300 dark:ring-gray-700 text-gray-700 dark:text-gray-200 bg-gray-100 dark:bg-gray-800'
|
||||
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-primary-500 dark:focus-visible:outline-primary-400',
|
||||
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-gray-500 dark:text-gray-400'
|
||||
separatorIcon: 'shrink-0 size-5 text-[--ui-text-muted]'
|
||||
},
|
||||
variants: {
|
||||
active: {
|
||||
true: {
|
||||
link: 'text-primary-500 dark:text-primary-400 font-semibold'
|
||||
link: 'text-[--ui-primary] font-semibold'
|
||||
},
|
||||
false: {
|
||||
link: 'text-gray-500 dark:text-gray-400 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-gray-700 dark:hover:text-gray-200', options.theme.transitions && 'transition-colors']
|
||||
link: ['hover:text-[--ui-text]', options.theme.transitions && 'transition-colors']
|
||||
}
|
||||
}]
|
||||
})
|
||||
|
||||
@@ -13,7 +13,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
...buttonGroupVariant,
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||
gray: ''
|
||||
neutral: ''
|
||||
},
|
||||
variant: {
|
||||
solid: '',
|
||||
@@ -72,51 +72,51 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'solid',
|
||||
class: `text-white dark:text-gray-900 bg-${color}-500 hover:bg-${color}-600 disabled:bg-${color}-500 aria-disabled:bg-${color}-500 dark:bg-${color}-400 dark:hover:bg-${color}-500 dark:disabled:bg-${color}-400 dark:aria-disabled:bg-${color}-400 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`
|
||||
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-${color}-500/50 dark:ring-${color}-400/50 text-${color}-500 dark:text-${color}-400 hover:bg-${color}-500/10 disabled:bg-transparent aria-disabled:bg-transparent dark:hover:bg-${color}-400/10 dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`
|
||||
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-${color}-500 dark:text-${color}-400 bg-${color}-500/10 hover:bg-${color}-500/15 focus-visible:bg-${color}-500/15 disabled:bg-${color}-500/10 aria-disabled:bg-${color}-500/10 dark:bg-${color}-400/10 dark:hover:bg-${color}-400/15 dark:focus-visible:bg-${color}-400/15 dark:disabled:bg-${color}-400/10 dark:aria-disabled:bg-${color}-400/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-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/25 dark:ring-${color}-400/25 bg-${color}-500/10 hover:bg-${color}-500/15 disabled:bg-${color}-500/10 aria-disabled:bg-${color}-500/10 dark:bg-${color}-400/10 dark:hover:bg-${color}-400/15 dark:disabled:bg-${color}-400/10 dark:aria-disabled:bg-${color}-400/10 focus-visible:ring-2 focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`
|
||||
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-${color}-500 dark:text-${color}-400 hover:bg-${color}-500/10 focus-visible:bg-${color}-500/10 disabled:bg-transparent aria-disabled:bg-transparent dark:hover:bg-${color}-400/10 dark:focus-visible:bg-${color}-400/10 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-${color}-500 hover:text-${color}-600 disabled:text-${color}-500 aria-disabled:text-${color}-500 dark:text-${color}-400 dark:hover:text-${color}-500 dark:disabled:text-${color}-400 dark:aria-disabled:text-${color}-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`
|
||||
class: `text-[--ui-${color}] hover:text-[--ui-${color}] disabled:text-[--ui-${color}] aria-disabled:text-[--ui-${color}] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-${color}]`
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'solid',
|
||||
class: 'text-white dark:text-gray-900 bg-gray-900 hover:bg-gray-700 disabled:bg-gray-900 aria-disabled:bg-gray-900 dark:bg-white dark:hover:bg-gray-200 dark:disabled:bg-white dark:aria-disabled:bg-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900 dark:focus-visible:outline-white'
|
||||
class: 'text-[--ui-bg] bg-[--ui-bg-inverted] hover:bg-[--ui-bg-inverted]/80 disabled:bg-[--ui-bg-inverted] aria-disabled:bg-[--ui-bg-inverted] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[--ui-border-inverted]'
|
||||
}, {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'outline',
|
||||
class: 'ring ring-inset ring-gray-300 dark:ring-gray-700 text-gray-700 dark:text-gray-200 bg-white hover:bg-gray-100 disabled:bg-white aria-disabled:bg-white dark:bg-gray-900 dark:hover:bg-gray-800 dark:disabled:bg-gray-900 dark:aria-disabled:bg-gray-900 focus-visible:ring-2 focus-visible:ring-gray-900 dark:focus-visible:ring-white'
|
||||
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: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'soft',
|
||||
class: 'text-gray-700 dark:text-gray-200 bg-gray-100 hover:bg-gray-200 focus-visible:bg-gray-200 disabled:bg-gray-100 aria-disabled:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700/50 dark:focus-visible:bg-gray-700/50 dark:disabled:bg-gray-800 dark:aria-disabled:bg-gray-800'
|
||||
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: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'subtle',
|
||||
class: 'ring ring-inset ring-gray-300 dark:ring-gray-700 text-gray-700 dark:text-gray-200 bg-gray-100 hover:bg-gray-200 disabled:bg-gray-100 aria-disabled:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700/50 dark:disabled:bg-gray-800 dark:aria-disabled:bg-gray-800 focus-visible:ring-2 focus-visible:ring-gray-900 dark:focus-visible:ring-white'
|
||||
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: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'ghost',
|
||||
class: 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 focus-visible:bg-gray-100 disabled:bg-transparent aria-disabled:bg-transparent dark:hover:bg-gray-800 dark:focus-visible:bg-gray-800 dark:hover: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: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'link',
|
||||
class: 'text-gray-500 hover:text-gray-700 disabled:text-gray-500 aria-disabled:text-gray-500 dark:text-gray-400 dark:hover:text-gray-200 dark:disabled:text-gray-400 dark:aria-disabled:text-gray-400 focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-gray-900 dark:focus-visible:ring-white'
|
||||
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,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
slots: {
|
||||
root: 'bg-white dark:bg-gray-900 ring ring-gray-200 dark:ring-gray-800 divide-y divide-gray-200 dark:divide-gray-800 rounded-lg shadow',
|
||||
root: 'bg-[--ui-bg] ring ring-[--ui-border] divide-y divide-[--ui-border] rounded-lg shadow',
|
||||
header: 'p-4 sm:px-6',
|
||||
body: 'p-4 sm:p-6',
|
||||
footer: 'p-4 sm:px-6'
|
||||
|
||||
@@ -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 text-white dark:text-gray-900 ring ring-inset ring-gray-300 dark:ring-gray-700 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2',
|
||||
base: 'shrink-0 flex items-center justify-center rounded text-[--ui-bg] ring ring-inset ring-[--ui-border-accented] focus:outline-none 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-gray-700 dark:text-gray-200',
|
||||
description: 'text-gray-500 dark:text-gray-400'
|
||||
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-${color}-500 dark:focus-visible:outline-${color}-400`])),
|
||||
gray: 'focus-visible:outline-gray-900 dark:focus-visible:outline-white'
|
||||
...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-error-500 dark:after:text-error-400'
|
||||
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-${color}-500 dark:ring-${color}-400 bg-${color}-500 dark:bg-${color}-400`
|
||||
class: `ring-2 ring-[--ui-${color}] bg-[--ui-${color}]`
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
checked: true,
|
||||
class: 'ring-2 ring-gray-900 dark:ring-white bg-gray-900 dark:bg-white'
|
||||
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-white dark:ring-gray-900 flex items-center justify-center text-white dark:text-gray-900 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-${color}-500 dark:bg-${color}-400`])),
|
||||
gray: 'bg-gray-500 dark:bg-gray-400'
|
||||
...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]',
|
||||
|
||||
@@ -2,28 +2,28 @@ import type { ModuleOptions } from '../module'
|
||||
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'flex flex-col min-h-0 min-w-0 divide-y divide-gray-200 dark:divide-gray-800',
|
||||
root: 'flex flex-col min-h-0 min-w-0 divide-y divide-[--ui-border]',
|
||||
input: '[&>input]:h-12',
|
||||
close: '',
|
||||
content: 'relative overflow-hidden',
|
||||
viewport: 'divide-y divide-gray-200 dark:divide-gray-800 scroll-py-1',
|
||||
viewport: 'divide-y divide-[--ui-border] scroll-py-1',
|
||||
group: 'p-1 isolate',
|
||||
empty: 'py-6 text-center text-sm',
|
||||
label: 'px-2 py-1.5 text-xs font-semibold text-gray-900 dark:text-white',
|
||||
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-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['shrink-0 size-5 text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200', options.theme.transitions && 'transition-colors'],
|
||||
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-md 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 size-5 text-[--ui-text-dimmed] group-data-highlighted:text-[--ui-text]', options.theme.transitions && 'transition-colors'],
|
||||
itemLeadingAvatar: 'shrink-0',
|
||||
itemLeadingAvatarSize: '2xs',
|
||||
itemLeadingChip: 'shrink-0 size-5',
|
||||
itemLeadingChipSize: 'md',
|
||||
itemTrailing: 'ms-auto inline-flex gap-1.5 items-center',
|
||||
itemTrailingIcon: 'shrink-0 size-5',
|
||||
itemTrailingHighlightedIcon: 'shrink-0 size-5 text-gray-400 dark:text-gray-500 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',
|
||||
itemLabelBase: 'text-gray-900 dark:text-white [&>mark]:bg-primary-500 dark:[&>mark]:bg-primary-400 [&>mark]:text-white dark:[&>mark]:text-gray-900',
|
||||
itemLabelPrefix: 'text-gray-700 dark:text-gray-200',
|
||||
itemLabelSuffix: 'text-gray-400 dark:text-gray-500 [&>mark]:bg-primary-500 dark:[&>mark]:bg-primary-400 [&>mark]:text-white dark:[&>mark]:text-gray-900'
|
||||
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]'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,10 +2,10 @@ import type { ModuleOptions } from '../module'
|
||||
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
content: 'min-w-32 bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 divide-y divide-gray-200 dark:divide-gray-800 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-md 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-gray-900 dark:text-white',
|
||||
separator: '-mx-1 my-1 h-px bg-gray-200 dark:bg-gray-800',
|
||||
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-md data-disabled:cursor-not-allowed data-disabled:opacity-75',
|
||||
itemLeadingIcon: 'shrink-0',
|
||||
itemLeadingAvatar: 'shrink-0',
|
||||
@@ -15,17 +15,17 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
itemTrailingKbds: 'hidden lg:inline-flex items-center shrink-0',
|
||||
itemTrailingKbdsSize: '',
|
||||
itemLabel: 'truncate',
|
||||
itemLabelExternalIcon: 'size-3 align-top text-gray-400 dark:text-gray-500'
|
||||
itemLabelExternalIcon: 'size-3 align-top text-[--ui-text-dimmed]'
|
||||
},
|
||||
variants: {
|
||||
active: {
|
||||
true: {
|
||||
item: 'text-gray-900 dark:text-white before:bg-gray-100 dark:before:bg-gray-800',
|
||||
itemLeadingIcon: 'text-gray-700 dark:text-gray-200'
|
||||
item: 'text-[--ui-text-highlighted] before:bg-[--ui-bg-elevated]',
|
||||
itemLeadingIcon: 'text-[--ui-text]'
|
||||
},
|
||||
false: {
|
||||
item: ['text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50 data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200', 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']
|
||||
}
|
||||
},
|
||||
size: {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export default {
|
||||
slots: {
|
||||
overlay: 'fixed inset-0 z-50 bg-gray-200/75 dark:bg-gray-800/75',
|
||||
content: 'fixed z-50 bg-white dark:bg-gray-900 ring ring-gray-200 dark:ring-gray-800 flex focus:outline-none',
|
||||
handle: 'shrink-0 rounded-full bg-gray-200 dark:bg-gray-700',
|
||||
overlay: 'fixed inset-0 z-50 bg-[--ui-bg-elevated]/75',
|
||||
content: 'fixed z-50 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-gray-900 dark:text-white font-semibold',
|
||||
description: 'mt-1 text-gray-500 dark:text-gray-400 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-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 divide-y divide-gray-200 dark:divide-gray-800 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-gray-200 dark:fill-gray-800',
|
||||
content: 'min-w-32 bg-[--ui-bg] shadow-lg rounded-md 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-gray-900 dark:text-white',
|
||||
separator: '-mx-1 my-1 h-px bg-gray-200 dark:bg-gray-800',
|
||||
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-md data-disabled:cursor-not-allowed data-disabled:opacity-75',
|
||||
itemLeadingIcon: 'shrink-0',
|
||||
itemLeadingAvatar: 'shrink-0',
|
||||
@@ -16,17 +16,17 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
itemTrailingKbds: 'hidden lg:inline-flex items-center shrink-0',
|
||||
itemTrailingKbdsSize: '',
|
||||
itemLabel: 'truncate',
|
||||
itemLabelExternalIcon: 'size-3 align-top text-gray-400 dark:text-gray-500'
|
||||
itemLabelExternalIcon: 'size-3 align-top text-[--ui-text-dimmed]'
|
||||
},
|
||||
variants: {
|
||||
active: {
|
||||
true: {
|
||||
item: 'text-gray-900 dark:text-white before:bg-gray-100 dark:before:bg-gray-800',
|
||||
itemLeadingIcon: 'text-gray-700 dark:text-gray-200'
|
||||
item: 'text-[--ui-text-highlighted] before:bg-[--ui-bg-elevated]',
|
||||
itemLeadingIcon: 'text-[--ui-text]'
|
||||
},
|
||||
false: {
|
||||
item: ['text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50 data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200', 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']
|
||||
}
|
||||
},
|
||||
size: {
|
||||
|
||||
@@ -3,12 +3,12 @@ export default {
|
||||
root: '',
|
||||
wrapper: '',
|
||||
labelWrapper: 'flex content-center items-center justify-between',
|
||||
label: 'block font-medium text-gray-700 dark:text-gray-200',
|
||||
label: 'block font-medium text-[--ui-text]',
|
||||
container: 'mt-1 relative',
|
||||
description: 'text-gray-500 dark:text-gray-400',
|
||||
error: 'mt-2 text-error-500 dark:text-error-400',
|
||||
hint: 'text-gray-500 dark:text-gray-400',
|
||||
help: 'mt-2 text-gray-500 dark:text-gray-400'
|
||||
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-error-500 dark:after:text-error-400`
|
||||
label: `after:content-['*'] after:ms-0.5 after:text-[--ui-error]`
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7,15 +7,15 @@ export default (options: Required<ModuleOptions>) => {
|
||||
slots: {
|
||||
base: () => ['rounded-md', 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-gray-200 dark:fill-gray-800',
|
||||
content: 'max-h-60 w-[--radix-popper-anchor-width] bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
viewport: 'divide-y divide-gray-200 dark:divide-gray-800 scroll-py-1',
|
||||
arrow: 'fill-[--ui-border]',
|
||||
content: 'max-h-60 w-[--radix-popper-anchor-width] bg-[--ui-bg] shadow-lg rounded-md ring ring-[--ui-border] overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
viewport: 'divide-y divide-[--ui-border] scroll-py-1',
|
||||
group: 'p-1 isolate',
|
||||
empty: 'py-2 text-center text-sm text-gray-500 dark:text-gray-400',
|
||||
label: 'font-semibold text-gray-900 dark:text-white',
|
||||
separator: '-mx-1 my-1 h-px bg-gray-200 dark:bg-gray-800',
|
||||
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-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['shrink-0 text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200', 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-md 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,11 +23,11 @@ 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 font-medium inline-flex items-center gap-0.5 ring ring-inset ring-gray-300 dark:ring-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 data-disabled:cursor-not-allowed data-disabled:opacity-75',
|
||||
tagsItem: 'px-1.5 py-0.5 rounded 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-sm text-gray-400 dark:text-gray-500 hover:text-gray-700 hover:bg-gray-200 dark:hover:text-gray-200 dark:hover:bg-gray-700/50 disabled:pointer-events-none', options.theme.transitions && 'transition-colors'],
|
||||
tagsItemDelete: ['inline-flex items-center rounded-sm 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: 'border-0 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
tagsInput: 'border-0 placeholder-[--ui-text-dimmed] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
},
|
||||
variants: {
|
||||
multiple: {
|
||||
@@ -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-${color}-500 dark:has-[:focus-visible]:ring-${color}-400`
|
||||
class: `has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[--${color}]`
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
multiple: true,
|
||||
variant: ['outline', 'subtle'],
|
||||
class: 'has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-gray-500 dark:has-[:focus-visible]:ring-white'
|
||||
class: 'has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[--ui-border-inverted]'
|
||||
}]
|
||||
}, input(options))
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@ import { buttonGroupVariantWithRoot } from './button-group'
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'relative inline-flex items-center',
|
||||
base: ['w-full rounded-md border-0 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75', options.theme.transitions && 'transition-colors'],
|
||||
base: ['w-full rounded-md border-0 placeholder-[--ui-text-dimmed] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75', options.theme.transitions && 'transition-colors'],
|
||||
leading: 'absolute inset-y-0 start-0 flex items-center',
|
||||
leadingIcon: 'shrink-0 text-gray-400 dark:text-gray-500',
|
||||
leadingIcon: 'shrink-0 text-[--ui-text-dimmed]',
|
||||
leadingAvatar: 'shrink-0',
|
||||
trailing: 'absolute inset-y-0 end-0 flex items-center',
|
||||
trailingIcon: 'shrink-0 text-gray-400 dark:text-gray-500'
|
||||
trailingIcon: 'shrink-0 text-[--ui-text-dimmed]'
|
||||
},
|
||||
variants: {
|
||||
...buttonGroupVariantWithRoot,
|
||||
@@ -51,15 +51,15 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
}
|
||||
},
|
||||
variant: {
|
||||
outline: 'text-gray-900 dark:text-white bg-white dark:bg-gray-900 ring ring-inset ring-gray-300 dark:ring-gray-700',
|
||||
soft: 'text-gray-900 dark:text-white bg-gray-50 hover:bg-gray-100 focus:bg-gray-100 disabled:bg-gray-50 dark:bg-gray-800/50 dark:hover:bg-gray-800 dark:focus:bg-gray-800 dark:disabled:bg-gray-800/50',
|
||||
subtle: 'text-gray-900 dark:text-white bg-gray-100 dark:bg-gray-800 ring ring-inset ring-gray-300 dark:ring-gray-700',
|
||||
ghost: 'text-gray-900 dark:text-white hover:bg-gray-100 focus:bg-gray-100 disabled:bg-transparent dark:hover:bg-gray-800 dark:focus:bg-gray-800 dark:disabled:bg-transparent',
|
||||
none: 'text-gray-900 dark:text-white'
|
||||
outline: 'text-[--ui-text-highlighted] bg-[--ui-bg] ring ring-inset ring-[--ui-border-accented]',
|
||||
soft: 'text-[--ui-text-highlighted] bg-[--ui-bg-elevated]/50 hover:bg-[--ui-bg-elevated] focus:bg-[--ui-bg-elevated] disabled:bg-[--ui-bg-elevated]/50',
|
||||
subtle: 'text-[--ui-text-highlighted] bg-[--ui-bg-elevated] ring ring-inset ring-[--ui-border-accented]',
|
||||
ghost: 'text-[--ui-text-highlighted] hover:bg-[--ui-bg-elevated] focus:bg-[--ui-bg-elevated] disabled:bg-transparent dark:disabled:bg-transparent',
|
||||
none: 'text-[--ui-text-highlighted]'
|
||||
},
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||
gray: ''
|
||||
neutral: ''
|
||||
},
|
||||
leading: {
|
||||
true: ''
|
||||
@@ -74,25 +74,25 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
true: ''
|
||||
},
|
||||
type: {
|
||||
file: 'file:mr-1.5 file:font-medium file:text-gray-500 dark:file:text-gray-400 file:outline-none'
|
||||
file: 'file:mr-1.5 file:font-medium file:text-[--ui-text-muted] file:outline-none'
|
||||
}
|
||||
},
|
||||
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: ['outline', 'subtle'],
|
||||
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`
|
||||
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-${color}-500 dark:ring-${color}-400`
|
||||
class: `ring ring-inset ring-[--ui-${color}]`
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: ['outline', 'subtle'],
|
||||
class: 'focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-gray-900 dark:focus-visible:ring-white'
|
||||
class: 'focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-border-inverted]'
|
||||
}, {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
highlight: true,
|
||||
class: 'ring ring-inset ring-gray-900 dark:ring-white'
|
||||
class: 'ring ring-inset ring-[--ui-border-inverted]'
|
||||
}, {
|
||||
leading: true,
|
||||
size: 'xs',
|
||||
|
||||
@@ -2,9 +2,9 @@ export default {
|
||||
base: 'inline-flex items-center justify-center px-1 rounded font-medium font-sans',
|
||||
variants: {
|
||||
variant: {
|
||||
solid: 'bg-gray-900 dark:bg-white text-white dark:text-gray-900',
|
||||
outline: 'bg-white dark:bg-gray-900 text-gray-900 dark:text-white ring ring-inset ring-gray-300 dark:ring-gray-700',
|
||||
subtle: 'bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 ring ring-inset ring-gray-300 dark:ring-gray-700'
|
||||
solid: 'bg-[--ui-bg-inverted] text-[--ui-bg]',
|
||||
outline: 'bg-[--ui-bg] text-[--ui-text-highlighted] ring ring-inset ring-[--ui-border-accented]',
|
||||
subtle: 'bg-[--ui-bg-elevated] text-[--ui-text] ring ring-inset ring-[--ui-border-accented]'
|
||||
},
|
||||
size: {
|
||||
sm: 'h-4 min-w-[16px] text-[10px]',
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { ModuleOptions } from '../module'
|
||||
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
base: 'focus-visible:outline-primary-500 dark:focus-visible:outline-primary-400',
|
||||
base: 'focus-visible:outline-[--ui-primary]',
|
||||
variants: {
|
||||
active: {
|
||||
true: 'text-primary-500 dark:text-primary-400',
|
||||
false: ['text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200', options.theme.transitions && 'transition-colors']
|
||||
true: 'text-[--ui-primary]',
|
||||
false: ['text-[--ui-text-muted] hover:text-[--ui-text]', options.theme.transitions && 'transition-colors']
|
||||
},
|
||||
disabled: {
|
||||
true: 'cursor-not-allowed opacity-75'
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export default {
|
||||
slots: {
|
||||
overlay: 'fixed inset-0 z-50 bg-gray-200/75 dark:bg-gray-800/75',
|
||||
content: 'fixed z-50 w-full h-dvh bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-800 flex flex-col focus:outline-none',
|
||||
overlay: 'fixed inset-0 z-50 bg-[--ui-bg-elevated]/75',
|
||||
content: 'fixed z-50 w-full h-dvh bg-[--ui-bg] divide-y divide-[--ui-border] flex flex-col focus:outline-none',
|
||||
header: 'px-4 py-5 sm:px-6',
|
||||
body: 'flex-1 p-4 sm:p-6',
|
||||
footer: 'flex items-center gap-1.5 p-4 sm:px-6',
|
||||
title: 'text-gray-900 dark:text-white font-semibold',
|
||||
description: 'mt-1 text-gray-500 dark:text-gray-400 text-sm',
|
||||
title: 'text-[--ui-text-highlighted] font-semibold',
|
||||
description: 'mt-1 text-[--ui-text-muted] text-sm',
|
||||
close: 'absolute top-4 right-4'
|
||||
},
|
||||
variants: {
|
||||
@@ -21,7 +21,7 @@ export default {
|
||||
content: 'inset-0'
|
||||
},
|
||||
false: {
|
||||
content: 'top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] sm:max-w-lg sm:h-auto sm:my-8 sm:rounded-lg sm:shadow-lg sm:ring ring-gray-200 dark:ring-gray-800'
|
||||
content: 'top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] sm:max-w-lg sm:h-auto sm:my-8 sm:rounded-lg sm:shadow-lg sm:ring ring-[--ui-border]'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,37 +14,37 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
linkTrailingBadgeSize: 'sm',
|
||||
linkTrailingIcon: 'size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200',
|
||||
linkLabel: 'truncate',
|
||||
linkLabelExternalIcon: 'size-3 align-top text-gray-400 dark:text-gray-500',
|
||||
linkLabelExternalIcon: 'size-3 align-top text-[--ui-text-dimmed]',
|
||||
childList: 'grid grid-cols-2 gap-2 p-2',
|
||||
childItem: '',
|
||||
childLink: 'group size-full px-3 py-2 rounded-md flex items-start gap-2 text-left',
|
||||
childLinkWrapper: 'flex flex-col items-start',
|
||||
childLinkIcon: 'size-5 shrink-0',
|
||||
childLinkLabel: 'font-semibold text-sm relative inline-flex',
|
||||
childLinkLabelExternalIcon: 'size-3 align-top text-gray-400 dark:text-gray-500',
|
||||
childLinkDescription: 'text-sm text-gray-500 dark:text-gray-400',
|
||||
separator: 'px-2 h-px bg-gray-200 dark:bg-gray-800',
|
||||
childLinkLabelExternalIcon: 'size-3 align-top text-[--ui-text-dimmed]',
|
||||
childLinkDescription: 'text-sm text-[--ui-text-muted]',
|
||||
separator: 'px-2 h-px bg-[--ui-border]',
|
||||
viewportWrapper: 'absolute top-full inset-x-0 flex w-full',
|
||||
// FIXME: add `sm:w-[var(--radix-navigation-menu-viewport-width)]` / `transition-[width,height]` / `origin-[top_center]` once position is based on trigger
|
||||
viewport: 'relative overflow-hidden bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 h-[--radix-navigation-menu-viewport-height] w-full data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
viewport: 'relative overflow-hidden bg-[--ui-bg] shadow-lg rounded-md ring ring-[--ui-border] h-[--radix-navigation-menu-viewport-height] w-full data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
content: 'absolute top-0 left-0 w-full data-[motion=from-start]:animate-[enter-from-left_200ms_ease] data-[motion=from-end]:animate-[enter-from-right_200ms_ease] data-[motion=to-start]:animate-[exit-to-left_200ms_ease] data-[motion=to-end]:animate-[exit-to-right_200ms_ease]',
|
||||
indicator: 'data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] bottom-0 z-[1] flex h-2.5 items-end justify-center overflow-hidden transition-transform duration-200 ease-out',
|
||||
arrow: 'relative top-[50%] size-2.5 rotate-45 border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 z-[1] rounded-sm'
|
||||
arrow: 'relative top-[50%] size-2.5 rotate-45 border border-[--ui-border] bg-[--ui-bg] z-[1] rounded-sm'
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||
link: `focus-visible:before:ring-${color}-500 dark:focus-visible:before:ring-${color}-400`,
|
||||
childLink: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`
|
||||
link: `focus-visible:before:ring-[--ui-${color}]`,
|
||||
childLink: `focus-visible:outline-[--ui-${color}]`
|
||||
}])),
|
||||
gray: {
|
||||
link: 'focus-visible:before:ring-gray-900 dark:focus-visible:before:ring-white',
|
||||
childLink: 'focus-visible:outline-gray-900 dark:focus-visible:outline-white'
|
||||
neutral: {
|
||||
link: 'focus-visible:before:ring-[--ui-border-inverted]',
|
||||
childLink: 'focus-visible:outline-[--ui-border-inverted]'
|
||||
}
|
||||
},
|
||||
highlightColor: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||
gray: ''
|
||||
neutral: ''
|
||||
},
|
||||
variant: {
|
||||
pill: '',
|
||||
@@ -64,14 +64,14 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
active: {
|
||||
true: {
|
||||
childLink: 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white',
|
||||
childLinkIcon: 'text-gray-700 dark:text-gray-200'
|
||||
childLink: 'bg-[--ui-bg-elevated] text-[--ui-text-highlighted]',
|
||||
childLinkIcon: 'text-[--ui-text]'
|
||||
},
|
||||
false: {
|
||||
link: 'text-gray-500 dark:text-gray-400',
|
||||
linkLeadingIcon: 'text-gray-400 dark:text-gray-500',
|
||||
childLink: ['hover:bg-gray-50 dark:hover:bg-gray-800/50 text-gray-700 dark:text-gray-200 hover:text-gray-900 dark:hover:text-white', options.theme.transitions && 'transition-colors'],
|
||||
childLinkIcon: ['text-gray-400 dark:text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-200', options.theme.transitions && 'transition-colors']
|
||||
link: 'text-[--ui-text-muted]',
|
||||
linkLeadingIcon: 'text-[--ui-text-dimmed]',
|
||||
childLink: ['hover:bg-[--ui-bg-elevated]/50 text-[--ui-text] hover:text-[--ui-text-highlighted]', options.theme.transitions && 'transition-colors'],
|
||||
childLinkIcon: ['text-[--ui-text-dimmed] group-hover:text-[--ui-text]', options.theme.transitions && 'transition-colors']
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
@@ -102,76 +102,76 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
active: false,
|
||||
variant: 'pill',
|
||||
class: {
|
||||
link: ['hover:text-gray-900 dark:hover:text-white hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50 data-[state=open]:text-gray-900 dark:data-[state=open]:text-white data-[state=open]:before:bg-gray-50 dark:data-[state=open]:before:bg-gray-800/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
linkLeadingIcon: ['group-hover:text-gray-700 dark:group-hover:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200', options.theme.transitions && 'transition-colors']
|
||||
link: ['hover:text-[--ui-text-highlighted] hover:before:bg-[--ui-bg-elevated]/50 data-[state=open]:text-[--ui-text-highlighted] data-[state=open]:before:bg-[--ui-bg-elevated]/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
linkLeadingIcon: ['group-hover:text-[--ui-text] group-data-[state=open]:text-[--ui-text]', options.theme.transitions && 'transition-colors']
|
||||
}
|
||||
}, ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'pill',
|
||||
active: true,
|
||||
class: {
|
||||
link: `text-${color}-500 dark:text-${color}-400`,
|
||||
linkLeadingIcon: `text-${color}-500 dark:text-${color}-400`
|
||||
link: `text-[--ui-${color}]`,
|
||||
linkLeadingIcon: `text-[--ui-${color}]`
|
||||
}
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'pill',
|
||||
active: true,
|
||||
class: {
|
||||
link: 'text-gray-900 dark:text-white',
|
||||
linkLeadingIcon: 'text-gray-900 dark:text-white'
|
||||
link: 'text-[--ui-text-highlighted]',
|
||||
linkLeadingIcon: 'text-[--ui-text-highlighted]'
|
||||
}
|
||||
}, {
|
||||
variant: 'pill',
|
||||
active: true,
|
||||
highlight: false,
|
||||
class: {
|
||||
link: 'before:bg-gray-100 dark:before:bg-gray-800'
|
||||
link: 'before:bg-[--ui-bg-elevated]'
|
||||
}
|
||||
}, {
|
||||
variant: 'pill',
|
||||
active: true,
|
||||
highlight: true,
|
||||
class: {
|
||||
link: ['hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50', options.theme.transitions && 'before:transition-colors']
|
||||
link: ['hover:before:bg-[--ui-bg-elevated]/50', options.theme.transitions && 'before:transition-colors']
|
||||
}
|
||||
}, {
|
||||
disabled: false,
|
||||
active: false,
|
||||
variant: 'link',
|
||||
class: {
|
||||
link: ['hover:text-gray-900 dark:hover:text-white data-[state=open]:text-gray-900 dark:data-[state=open]:text-white', options.theme.transitions && 'transition-colors'],
|
||||
linkLeadingIcon: ['group-hover:text-gray-700 dark:group-hover:text-gray-200 group-data-[state=open]:text-gray-700 dark:group-data-[state=open]:text-gray-200', options.theme.transitions && 'transition-colors']
|
||||
link: ['hover:text-[--ui-text-highlighted] data-[state=open]:text-[--ui-text-highlighted]', options.theme.transitions && 'transition-colors'],
|
||||
linkLeadingIcon: ['group-hover:text-[--ui-text] group-data-[state=open]:text-[--ui-text]', options.theme.transitions && 'transition-colors']
|
||||
}
|
||||
}, ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'link',
|
||||
active: true,
|
||||
class: {
|
||||
link: `text-${color}-500 dark:text-${color}-400`,
|
||||
linkLeadingIcon: `text-${color}-500 dark:text-${color}-400`
|
||||
link: `text-[--ui-${color}]`,
|
||||
linkLeadingIcon: `text-[--ui-${color}]`
|
||||
}
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'link',
|
||||
active: true,
|
||||
class: {
|
||||
link: 'text-gray-900 dark:text-white',
|
||||
linkLeadingIcon: 'text-gray-900 dark:text-white'
|
||||
link: 'text-[--ui-text-highlighted]',
|
||||
linkLeadingIcon: 'text-[--ui-text-highlighted]'
|
||||
}
|
||||
}, ...(options.theme.colors || []).map((highlightColor: string) => ({
|
||||
highlightColor,
|
||||
highlight: true,
|
||||
active: true,
|
||||
class: {
|
||||
link: `after:bg-${highlightColor}-500 dark:after:bg-${highlightColor}-400`
|
||||
link: `after:bg-[--ui-${highlightColor}]`
|
||||
}
|
||||
})), {
|
||||
highlightColor: 'gray',
|
||||
highlightColor: 'neutral',
|
||||
highlight: true,
|
||||
active: true,
|
||||
class: {
|
||||
link: 'after:bg-gray-900 dark:after:bg-white'
|
||||
link: 'after:bg-[--ui-bg-inverted]'
|
||||
}
|
||||
}],
|
||||
defaultVariants: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
slots: {
|
||||
content: 'bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
arrow: 'fill-gray-200 dark:fill-gray-800'
|
||||
content: 'bg-[--ui-bg] shadow-lg rounded-md ring ring-[--ui-border] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
arrow: 'fill-[--ui-border]'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ import type { ModuleOptions } from '../module'
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'gap-2',
|
||||
base: 'relative overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700',
|
||||
base: 'relative overflow-hidden rounded-full bg-[--ui-bg-accented]',
|
||||
indicator: 'rounded-full size-full transition-transform duration-200 ease-out',
|
||||
status: 'flex justify-end text-gray-400 dark:text-gray-500 transition-[width] duration-200',
|
||||
status: 'flex justify-end text-[--ui-text-dimmed] transition-[width] duration-200',
|
||||
steps: 'grid items-end',
|
||||
step: 'truncate text-end row-start-1 col-start-1 transition-opacity'
|
||||
},
|
||||
@@ -18,12 +18,12 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||
indicator: `bg-${color}-500 dark:bg-${color}-400`,
|
||||
steps: `text-${color}-500 dark:text-${color}-400`
|
||||
indicator: `bg-[--ui-${color}]`,
|
||||
steps: `text-[--ui-${color}]`
|
||||
}])),
|
||||
gray: {
|
||||
indicator: 'bg-gray-900 dark:bg-white',
|
||||
steps: 'text-white dark:text-gray-900'
|
||||
neutral: {
|
||||
indicator: 'bg-[--ui-bg-inverted]',
|
||||
steps: 'text-[--ui-bg]'
|
||||
}
|
||||
},
|
||||
size: {
|
||||
@@ -61,7 +61,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
step: 'opacity-100'
|
||||
},
|
||||
first: {
|
||||
step: 'opacity-100 text-gray-500 dark:text-gray-400'
|
||||
step: 'opacity-100 text-[--ui-text-muted]'
|
||||
},
|
||||
other: {
|
||||
step: 'opacity-0'
|
||||
|
||||
@@ -4,24 +4,24 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'relative',
|
||||
fieldset: 'flex',
|
||||
legend: 'mb-1 block font-medium text-gray-700 dark:text-gray-200',
|
||||
legend: 'mb-1 block font-medium text-[--ui-text]',
|
||||
item: 'flex items-start',
|
||||
base: 'rounded-full ring ring-inset ring-gray-300 dark:ring-gray-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-offset-white dark:focus-visible:outline-offset-gray-900',
|
||||
indicator: 'flex items-center justify-center size-full rounded-full after:bg-white dark:after:bg-gray-900 after:rounded-full',
|
||||
base: 'rounded-full ring ring-inset ring-[--ui-border-accented] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-offset-[--ui-bg]',
|
||||
indicator: 'flex items-center justify-center size-full rounded-full after:bg-[--ui-bg] after:rounded-full',
|
||||
container: 'flex items-center',
|
||||
wrapper: 'ms-2',
|
||||
label: 'block font-medium text-gray-700 dark:text-gray-200',
|
||||
description: 'text-gray-500 dark:text-gray-400'
|
||||
label: 'block font-medium text-[--ui-text]',
|
||||
description: 'text-[--ui-text-muted]'
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||
base: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`,
|
||||
indicator: `bg-${color}-500 dark:bg-${color}-400`
|
||||
base: `focus-visible:outline-[--ui-${color}]`,
|
||||
indicator: `bg-[--ui-${color}]`
|
||||
}])),
|
||||
gray: {
|
||||
base: 'focus-visible:outline-gray-900 dark:focus-visible:outline-white',
|
||||
indicator: 'bg-gray-900 dark:bg-white'
|
||||
neutral: {
|
||||
base: 'focus-visible:outline-[--ui-border-inverted]',
|
||||
indicator: 'bg-[--ui-bg-inverted]'
|
||||
}
|
||||
},
|
||||
orientation: {
|
||||
@@ -83,7 +83,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
required: {
|
||||
true: {
|
||||
legend: 'after:content-[\'*\'] after:ms-0.5 after:text-error-500 dark:after:text-error-400'
|
||||
legend: 'after:content-[\'*\'] after:ms-0.5 after:text-[--ui-error]'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@ export default (options: Required<ModuleOptions>) => {
|
||||
slots: {
|
||||
value: 'truncate',
|
||||
placeholder: 'truncate text-current/50',
|
||||
input: 'placeholder-gray-400 dark:placeholder-gray-500 border-0 border-b border-gray-200 dark:border-gray-800 focus:outline-none'
|
||||
input: 'placeholder-[--ui-text-dimmed] border-0 border-b border-[--ui-border] focus:outline-none'
|
||||
},
|
||||
variants: {
|
||||
size: {
|
||||
|
||||
@@ -9,15 +9,15 @@ export default (options: Required<ModuleOptions>) => {
|
||||
root: () => undefined,
|
||||
base: () => ['relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75', options.theme.transitions && 'transition-colors'],
|
||||
value: 'truncate group-data-placeholder:text-current/50',
|
||||
arrow: 'fill-gray-200 dark:fill-gray-800',
|
||||
content: 'max-h-60 w-[--radix-popper-anchor-width] bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
viewport: 'divide-y divide-gray-200 dark:divide-gray-800 scroll-py-1',
|
||||
arrow: 'fill-[--ui-border]',
|
||||
content: 'max-h-60 w-[--radix-popper-anchor-width] bg-[--ui-bg] shadow-lg rounded-md ring ring-[--ui-border] overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
viewport: 'divide-y divide-[--ui-border] scroll-py-1',
|
||||
group: 'p-1 isolate',
|
||||
empty: 'py-2 text-center text-sm text-gray-500 dark:text-gray-400',
|
||||
label: 'font-semibold text-gray-900 dark:text-white',
|
||||
separator: '-mx-1 my-1 h-px bg-gray-200 dark:bg-gray-800',
|
||||
item: ['group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-gray-700 dark:text-gray-200 data-highlighted:text-gray-900 dark:data-highlighted:text-white data-highlighted:before:bg-gray-50 dark:data-highlighted:before:bg-gray-800/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['shrink-0 text-gray-400 dark:text-gray-500 group-data-highlighted:text-gray-700 dark:group-data-highlighted:text-gray-200', 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 select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md 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',
|
||||
|
||||
@@ -4,7 +4,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'flex items-center align-center text-center',
|
||||
border: '',
|
||||
container: 'font-medium text-gray-700 dark:text-gray-200 flex',
|
||||
container: 'font-medium text-[--ui-text] flex',
|
||||
icon: 'shrink-0 size-5',
|
||||
avatar: 'shrink-0',
|
||||
avatarSize: '2xs',
|
||||
@@ -12,8 +12,8 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, { border: `border-${color}-500 dark:border-${color}-400` }])),
|
||||
gray: { border: 'border-gray-200 dark:border-gray-800' }
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, { border: `border-[--ui-${color}]` }])),
|
||||
neutral: { border: 'border-[--ui-border]' }
|
||||
},
|
||||
orientation: {
|
||||
horizontal: {
|
||||
@@ -88,7 +88,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
class: { border: 'border-s-[5px]' }
|
||||
}],
|
||||
defaultVariants: {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
size: 'xs',
|
||||
type: 'solid'
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default {
|
||||
base: 'animate-pulse rounded-md bg-gray-100 dark:bg-gray-800'
|
||||
base: 'animate-pulse rounded-md bg-[--ui-bg-elevated]'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export default {
|
||||
slots: {
|
||||
overlay: 'fixed inset-0 z-50 bg-gray-200/75 dark:bg-gray-800/75',
|
||||
content: 'fixed z-50 bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-800 sm:ring ring-gray-200 dark:ring-gray-800 sm:shadow-lg flex flex-col focus:outline-none',
|
||||
overlay: 'fixed inset-0 z-50 bg-[--ui-bg-elevated]/75',
|
||||
content: 'fixed z-50 bg-[--ui-bg] divide-y divide-[--ui-border] sm:ring ring-[--ui-border] sm:shadow-lg flex flex-col focus:outline-none',
|
||||
header: 'px-4 py-5 sm:px-6',
|
||||
body: 'flex-1 overflow-y-auto p-4 sm:p-6',
|
||||
footer: 'flex items-center gap-1.5 p-4 sm:px-6',
|
||||
title: 'text-gray-900 dark:text-white font-semibold',
|
||||
description: 'mt-1 text-gray-500 dark:text-gray-400 text-sm',
|
||||
title: 'text-[--ui-text-highlighted] font-semibold',
|
||||
description: 'mt-1 text-[--ui-text-muted] text-sm',
|
||||
close: 'absolute top-4 right-4'
|
||||
},
|
||||
variants: {
|
||||
|
||||
@@ -3,19 +3,19 @@ import type { ModuleOptions } from '../module'
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'relative flex items-center select-none touch-none',
|
||||
track: 'relative bg-gray-200 dark:bg-gray-700 overflow-hidden rounded-full grow',
|
||||
track: 'relative bg-[--ui-bg-accented] overflow-hidden rounded-full grow',
|
||||
range: 'absolute rounded-full',
|
||||
thumb: 'rounded-full bg-white dark:bg-gray-900 ring-2 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2'
|
||||
thumb: 'rounded-full bg-[--ui-bg] ring-2 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2'
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||
range: `bg-${color}-500 dark:bg-${color}-400`,
|
||||
thumb: `ring-${color}-500 dark:ring-${color}-400 focus-visible:outline-${color}-500/50 dark:focus-visible:outline-${color}-400/50`
|
||||
range: `bg-[--ui-${color}]`,
|
||||
thumb: `ring-[--ui-${color}] focus-visible:outline-[--ui-${color}]`
|
||||
}])),
|
||||
gray: {
|
||||
range: 'bg-gray-900 dark:bg-white',
|
||||
thumb: 'ring-gray-900 dark:ring-white focus-visible:outline-gray-900/50 dark:focus-visible:outline-white/50'
|
||||
neutral: {
|
||||
range: 'bg-[--ui-bg-inverted]',
|
||||
thumb: 'ring-[--ui-border-inverted] focus-visible:outline-[--ui-border-inverted]/50'
|
||||
}
|
||||
},
|
||||
size: {
|
||||
|
||||
@@ -3,23 +3,23 @@ import type { ModuleOptions } from '../module'
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'relative flex items-start',
|
||||
base: ['inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900 data-[state=unchecked]:bg-gray-200 dark:data-[state=unchecked]:bg-gray-700', options.theme.transitions && 'transition-colors duration-200'],
|
||||
base: ['inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-[--ui-bg] data-[state=unchecked]:bg-[--ui-bg-accented]', options.theme.transitions && 'transition-colors duration-200'],
|
||||
container: 'flex items-center',
|
||||
thumb: 'group pointer-events-none block rounded-full bg-white dark:bg-gray-900 shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 flex items-center justify-center',
|
||||
icon: ['absolute shrink-0 group-data-[state=unchecked]:text-gray-400 dark:group-data-[state=unchecked]:text-gray-500 opacity-0 size-10/12', options.theme.transitions && 'transition-[color,opacity] duration-200'],
|
||||
thumb: 'group pointer-events-none block rounded-full bg-[--ui-bg] shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 flex items-center justify-center',
|
||||
icon: ['absolute shrink-0 group-data-[state=unchecked]:text-[--ui-text-dimmed] opacity-0 size-10/12', options.theme.transitions && 'transition-[color,opacity] duration-200'],
|
||||
wrapper: 'ms-2',
|
||||
label: 'block font-medium text-gray-700 dark:text-gray-200',
|
||||
description: 'text-gray-500 dark:text-gray-400'
|
||||
label: 'block font-medium text-[--ui-text]',
|
||||
description: 'text-[--ui-text-muted]'
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||
base: `data-[state=checked]:bg-${color}-500 dark:data-[state=checked]:bg-${color}-400 focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`,
|
||||
icon: `group-data-[state=checked]:text-${color}-500 dark:group-data-[state=checked]:text-${color}-400`
|
||||
base: `data-[state=checked]:bg-[--ui-${color}] focus-visible:ring-[--ui-${color}]`,
|
||||
icon: `group-data-[state=checked]:text-[--ui-${color}]`
|
||||
}])),
|
||||
gray: {
|
||||
base: 'data-[state=checked]:bg-gray-900 dark:data-[state=checked]:bg-white focus-visible:ring-gray-900 dark:focus-visible:ring-white',
|
||||
icon: 'group-data-[state=checked]:text-gray-900 dark:group-data-[state=checked]:text-white'
|
||||
neutral: {
|
||||
base: 'data-[state=checked]:bg-[--ui-bg-inverted] focus-visible:ring-[--ui-border-inverted]',
|
||||
icon: 'group-data-[state=checked]:text-[--ui-text-highlighted]'
|
||||
}
|
||||
},
|
||||
size: {
|
||||
@@ -71,7 +71,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
required: {
|
||||
true: {
|
||||
label: 'after:content-[\'*\'] after:ms-0.5 after:text-error-500 dark:after:text-error-400'
|
||||
label: 'after:content-[\'*\'] after:ms-0.5 after:text-[--ui-error]'
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
|
||||
@@ -5,7 +5,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
root: 'flex items-center gap-2',
|
||||
list: 'relative flex p-1 group',
|
||||
indicator: 'absolute transition-[translate,width] duration-200',
|
||||
trigger: ['relative inline-flex items-center shrink-0 data-[state=inactive]:text-gray-500 dark:data-[state=inactive]:text-gray-400 hover:data-[state=inactive]:text-gray-700 dark:hover:data-[state=inactive]:text-gray-200 font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none', options.theme.transitions && 'transition-colors'],
|
||||
trigger: ['relative inline-flex items-center shrink-0 data-[state=inactive]:text-[--ui-text-muted] hover:data-[state=inactive]:text-[--ui-text] font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none', options.theme.transitions && 'transition-colors'],
|
||||
content: 'focus:outline-none w-full',
|
||||
leadingIcon: 'shrink-0',
|
||||
leadingAvatar: 'shrink-0',
|
||||
@@ -15,16 +15,16 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||
gray: ''
|
||||
neutral: ''
|
||||
},
|
||||
variant: {
|
||||
pill: {
|
||||
list: 'bg-gray-100 dark:bg-gray-800 rounded-lg',
|
||||
list: 'bg-[--ui-bg-elevated] rounded-lg',
|
||||
trigger: 'flex-1',
|
||||
indicator: 'rounded-md shadow-sm'
|
||||
},
|
||||
link: {
|
||||
list: 'border-gray-200 dark:border-gray-800',
|
||||
list: 'border-[--ui-border]',
|
||||
indicator: 'rounded-full'
|
||||
}
|
||||
},
|
||||
@@ -99,29 +99,29 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
color,
|
||||
variant: 'pill',
|
||||
class: {
|
||||
indicator: `bg-${color}-500 dark:bg-${color}-400`,
|
||||
trigger: `data-[state=active]:text-white dark:data-[state=active]:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`
|
||||
indicator: `bg-[--ui-${color}]`,
|
||||
trigger: `data-[state=active]:text-[--ui-bg] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[--ui-${color}]`
|
||||
}
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'pill',
|
||||
class: {
|
||||
indicator: 'bg-gray-900 dark:bg-white',
|
||||
trigger: 'data-[state=active]:text-white dark:data-[state=active]:text-gray-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900 dark:focus-visible:outline-white'
|
||||
indicator: 'bg-[--ui-bg-inverted]',
|
||||
trigger: 'data-[state=active]:text-[--ui-bg] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[--ui-border-inverted]'
|
||||
}
|
||||
}, ...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
variant: 'link',
|
||||
class: {
|
||||
indicator: `bg-${color}-500 dark:bg-${color}-400`,
|
||||
trigger: `data-[state=active]:text-${color}-500 dark:data-[state=active]:text-${color}-400 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`
|
||||
indicator: `bg-[--ui-${color}]`,
|
||||
trigger: `data-[state=active]:text-[--ui-${color}] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-${color}]`
|
||||
}
|
||||
})), {
|
||||
color: 'gray',
|
||||
color: 'neutral',
|
||||
variant: 'link',
|
||||
class: {
|
||||
indicator: 'bg-gray-900 dark:bg-white',
|
||||
trigger: 'data-[state=active]:text-gray-900 dark:data-[state=active]:text-white focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-gray-900 dark:focus-visible:ring-white'
|
||||
indicator: 'bg-[--ui-bg-inverted]',
|
||||
trigger: 'data-[state=active]:text-[--ui-text-highlighted] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-border-inverted]'
|
||||
}
|
||||
}],
|
||||
defaultVariants: {
|
||||
|
||||
@@ -2,10 +2,10 @@ import type { ModuleOptions } from '../module'
|
||||
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'relative group overflow-hidden bg-white dark:bg-gray-900 shadow-lg rounded-lg ring ring-gray-200 dark:ring-gray-800 p-4 flex gap-2.5 focus:outline-none',
|
||||
root: 'relative group overflow-hidden bg-[--ui-bg] shadow-lg rounded-lg ring ring-[--ui-border] p-4 flex gap-2.5 focus:outline-none',
|
||||
wrapper: 'w-0 flex-1 flex flex-col gap-1',
|
||||
title: 'text-sm font-medium text-gray-900 dark:text-white',
|
||||
description: 'text-sm text-gray-500 dark:text-gray-400',
|
||||
title: 'text-sm font-medium text-[--ui-text-highlighted]',
|
||||
description: 'text-sm text-[--ui-text-muted]',
|
||||
icon: 'shrink-0 size-5',
|
||||
avatar: 'shrink-0',
|
||||
avatarSize: '2xl',
|
||||
@@ -16,14 +16,14 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||
root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}-500 dark:focus-visible:ring-${color}-400`,
|
||||
icon: `text-${color}-500 dark:text-${color}-400`,
|
||||
progress: `bg-${color}-500 dark:bg-${color}-400`
|
||||
root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-${color}]`,
|
||||
icon: `text-[--ui-${color}]`,
|
||||
progress: `bg-[--ui-${color}]`
|
||||
}])),
|
||||
gray: {
|
||||
root: 'focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-gray-900 dark:focus-visible:ring-white',
|
||||
icon: 'text-gray-900 dark:text-white',
|
||||
progress: 'bg-gray-900 dark:bg-white'
|
||||
neutral: {
|
||||
root: 'focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[--ui-border-inverted]',
|
||||
icon: 'text-[--ui-text-highlighted]',
|
||||
progress: 'bg-[--ui-bg-inverted]'
|
||||
}
|
||||
},
|
||||
multiline: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export default {
|
||||
slots: {
|
||||
content: 'flex items-center gap-1 bg-white dark:bg-gray-900 text-gray-900 dark:text-white shadow rounded ring ring-gray-200 dark:ring-gray-800 h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
arrow: 'fill-gray-200 dark:fill-gray-800',
|
||||
content: 'flex items-center gap-1 bg-[--ui-bg] text-[--ui-text-highlighted] shadow rounded ring ring-[--ui-border] h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
arrow: 'fill-[--ui-border]',
|
||||
text: 'truncate',
|
||||
kbds: `hidden lg:inline-flex items-center shrink-0 gap-0.5 before:content-['·'] before:mr-0.5`,
|
||||
kbdsSize: 'sm'
|
||||
|
||||
Reference in New Issue
Block a user