mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-23 16:30:45 +01:00
Compare commits
3 Commits
v3.0.0-alp
...
v3.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6ae1dcb1d | ||
|
|
2e954467c4 | ||
|
|
d3317d828e |
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [3.0.0-alpha.3](https://github.com/nuxt/ui/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-09-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **module:** move `colors` options into `theme.colors` ([2e95446](https://github.com/nuxt/ui/commit/2e954467c4679d70b68d3155ae34eca300508e38))
|
||||||
|
|
||||||
## [3.0.0-alpha.2](https://github.com/nuxt/ui/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-09-18)
|
## [3.0.0-alpha.2](https://github.com/nuxt/ui/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-09-18)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
10
docs/app/mdc.config.ts
Normal file
10
docs/app/mdc.config.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { defineConfig } from '@nuxtjs/mdc/config'
|
||||||
|
import { transformerColorHighlight } from 'shiki-transformer-color-highlight'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
shiki: {
|
||||||
|
transformers: [
|
||||||
|
transformerColorHighlight()
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -76,9 +76,24 @@ export default defineNuxtConfig({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
### `colors`
|
### `fonts`
|
||||||
|
|
||||||
Use the `colors` option to choose which Tailwind CSS colors are used to generate classes for components.
|
Use the `fonts` option to enable or disable the `@nuxt/fonts` module.
|
||||||
|
|
||||||
|
- Default: `true`{lang="ts-type"}
|
||||||
|
|
||||||
|
```ts [nuxt.config.ts]
|
||||||
|
export default defineNuxtConfig({
|
||||||
|
modules: ['@nuxt/ui'],
|
||||||
|
ui: {
|
||||||
|
fonts: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### `theme.colors`
|
||||||
|
|
||||||
|
Use the `theme.colors` option to choose which Tailwind CSS colors are used to generate classes for components.
|
||||||
|
|
||||||
- Default: `['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']`{lang="ts-type"}
|
- Default: `['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']`{lang="ts-type"}
|
||||||
|
|
||||||
@@ -95,21 +110,6 @@ export default defineNuxtConfig({
|
|||||||
This can help reduce the number of CSS classes generated in your bundle.
|
This can help reduce the number of CSS classes generated in your bundle.
|
||||||
::
|
::
|
||||||
|
|
||||||
### `fonts`
|
|
||||||
|
|
||||||
Use the `fonts` option to enable or disable the `@nuxt/fonts` module.
|
|
||||||
|
|
||||||
- Default: `true`{lang="ts-type"}
|
|
||||||
|
|
||||||
```ts [nuxt.config.ts]
|
|
||||||
export default defineNuxtConfig({
|
|
||||||
modules: ['@nuxt/ui'],
|
|
||||||
ui: {
|
|
||||||
fonts: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
### `theme.transitions`
|
### `theme.transitions`
|
||||||
|
|
||||||
Use the `theme.transitions` option to disable all transitions on components.
|
Use the `theme.transitions` option to disable all transitions on components.
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Tailwind CSS v4 takes a CSS-first configuration approach, you now customize your
|
|||||||
--color-green-700: #007F45;
|
--color-green-700: #007F45;
|
||||||
--color-green-800: #016538;
|
--color-green-800: #016538;
|
||||||
--color-green-900: #0A5331;
|
--color-green-900: #0A5331;
|
||||||
--color-green-950: #052e16;
|
--color-green-950: #052E16;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ slots:
|
|||||||
---
|
---
|
||||||
::
|
::
|
||||||
|
|
||||||
You can change these colors with the [`colors`](/getting-started/installation#colors) option in your `nuxt.config.ts` to select only the colors you're actually using.
|
You can change these colors with the [`theme.colors`](/getting-started/installation#themecolors) option in your `nuxt.config.ts` to select only the colors you're actually using.
|
||||||
|
|
||||||
For example, if you added a custom `cerise` color and only use the default `blue` and `green` colors in your application, you can configure the `colors` option like this:
|
For example, if you added a custom `cerise` color and only use the default `blue` and `green` colors in your application, you can configure the `colors` option like this:
|
||||||
|
|
||||||
@@ -25,7 +25,9 @@ For example, if you added a custom `cerise` color and only use the default `blue
|
|||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
modules: ['@nuxt/ui'],
|
modules: ['@nuxt/ui'],
|
||||||
ui: {
|
ui: {
|
||||||
colors: ['cerise', 'blue', 'green']
|
theme: {
|
||||||
|
colors: ['cerise', 'blue', 'green']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
"nuxt-component-meta": "^0.8.2",
|
"nuxt-component-meta": "^0.8.2",
|
||||||
"nuxt-og-image": "^3.0.2",
|
"nuxt-og-image": "^3.0.2",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
|
"shiki-transformer-color-highlight": "^0.0.0",
|
||||||
"ufo": "^1.5.4",
|
"ufo": "^1.5.4",
|
||||||
"valibot": "^0.42.0",
|
"valibot": "^0.42.0",
|
||||||
"yup": "^1.4.0",
|
"yup": "^1.4.0",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@nuxt/ui",
|
"name": "@nuxt/ui",
|
||||||
"description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
|
"description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
|
||||||
"version": "3.0.0-alpha.2",
|
"version": "3.0.0-alpha.3",
|
||||||
"packageManager": "pnpm@9.10.0",
|
"packageManager": "pnpm@9.10.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
17
pnpm-lock.yaml
generated
17
pnpm-lock.yaml
generated
@@ -175,6 +175,9 @@ importers:
|
|||||||
prettier:
|
prettier:
|
||||||
specifier: ^3.3.3
|
specifier: ^3.3.3
|
||||||
version: 3.3.3
|
version: 3.3.3
|
||||||
|
shiki-transformer-color-highlight:
|
||||||
|
specifier: ^0.0.0
|
||||||
|
version: 0.0.0
|
||||||
ufo:
|
ufo:
|
||||||
specifier: ^1.5.4
|
specifier: ^1.5.4
|
||||||
version: 1.5.4
|
version: 1.5.4
|
||||||
@@ -2630,6 +2633,9 @@ packages:
|
|||||||
colorette@2.0.20:
|
colorette@2.0.20:
|
||||||
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
|
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
|
||||||
|
|
||||||
|
colorjs.io@0.5.2:
|
||||||
|
resolution: {integrity: sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==}
|
||||||
|
|
||||||
comma-separated-tokens@2.0.3:
|
comma-separated-tokens@2.0.3:
|
||||||
resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}
|
resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}
|
||||||
|
|
||||||
@@ -5589,6 +5595,9 @@ packages:
|
|||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
|
shiki-transformer-color-highlight@0.0.0:
|
||||||
|
resolution: {integrity: sha512-jzaEo6wdBIYelDNrc0UqoHn2zc6m4AXGVWUrHLbV2pw9V3SYjX5VjNQR0eEGPlXZ9BL9NVYXVxHsVxrOxFDZEw==}
|
||||||
|
|
||||||
shiki@1.17.7:
|
shiki@1.17.7:
|
||||||
resolution: {integrity: sha512-Zf6hNtWhFyF4XP5OOsXkBTEx9JFPiN0TQx4wSe+Vqeuczewgk2vT4IZhF4gka55uelm052BD5BaHavNqUNZd+A==}
|
resolution: {integrity: sha512-Zf6hNtWhFyF4XP5OOsXkBTEx9JFPiN0TQx4wSe+Vqeuczewgk2vT4IZhF4gka55uelm052BD5BaHavNqUNZd+A==}
|
||||||
|
|
||||||
@@ -9656,6 +9665,8 @@ snapshots:
|
|||||||
|
|
||||||
colorette@2.0.20: {}
|
colorette@2.0.20: {}
|
||||||
|
|
||||||
|
colorjs.io@0.5.2: {}
|
||||||
|
|
||||||
comma-separated-tokens@2.0.3: {}
|
comma-separated-tokens@2.0.3: {}
|
||||||
|
|
||||||
commander@10.0.1: {}
|
commander@10.0.1: {}
|
||||||
@@ -13532,6 +13543,12 @@ snapshots:
|
|||||||
interpret: 1.4.0
|
interpret: 1.4.0
|
||||||
rechoir: 0.6.2
|
rechoir: 0.6.2
|
||||||
|
|
||||||
|
shiki-transformer-color-highlight@0.0.0:
|
||||||
|
dependencies:
|
||||||
|
'@shikijs/core': 1.17.7
|
||||||
|
'@shikijs/types': 1.17.7
|
||||||
|
colorjs.io: 0.5.2
|
||||||
|
|
||||||
shiki@1.17.7:
|
shiki@1.17.7:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@shikijs/core': 1.17.7
|
'@shikijs/core': 1.17.7
|
||||||
|
|||||||
@@ -12,12 +12,6 @@ export interface ModuleOptions {
|
|||||||
*/
|
*/
|
||||||
prefix?: string
|
prefix?: string
|
||||||
|
|
||||||
/**
|
|
||||||
* Colors to generate classes for (based on TailwindCSS colors)
|
|
||||||
* @defaultValue ['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']
|
|
||||||
*/
|
|
||||||
colors?: string[]
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable `@nuxt/fonts` module
|
* Enable or disable `@nuxt/fonts` module
|
||||||
* @defaultValue true
|
* @defaultValue true
|
||||||
@@ -25,6 +19,12 @@ export interface ModuleOptions {
|
|||||||
fonts?: boolean
|
fonts?: boolean
|
||||||
|
|
||||||
theme?: {
|
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']
|
||||||
|
*/
|
||||||
|
colors?: string[]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable transitions on components
|
* Enable or disable transitions on components
|
||||||
* @defaultValue true
|
* @defaultValue true
|
||||||
@@ -43,16 +43,17 @@ export default defineNuxtModule<ModuleOptions>({
|
|||||||
},
|
},
|
||||||
defaults: {
|
defaults: {
|
||||||
prefix: 'U',
|
prefix: 'U',
|
||||||
colors: undefined,
|
|
||||||
fonts: true,
|
fonts: true,
|
||||||
theme: {
|
theme: {
|
||||||
|
colors: undefined,
|
||||||
transitions: true
|
transitions: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async setup(options, nuxt) {
|
async setup(options, nuxt) {
|
||||||
const { resolve } = createResolver(import.meta.url)
|
const { resolve } = createResolver(import.meta.url)
|
||||||
|
|
||||||
options.colors = options.colors?.length ? [...new Set(['primary', 'error', ...options.colors])] : ['primary', 'error', 'red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']
|
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']
|
||||||
|
|
||||||
nuxt.options.ui = options
|
nuxt.options.ui = options
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, ''])),
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||||
gray: ''
|
gray: ''
|
||||||
},
|
},
|
||||||
variant: {
|
variant: {
|
||||||
@@ -34,25 +34,25 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compoundVariants: [...options.colors.map((color: string) => ({
|
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'solid',
|
variant: 'solid',
|
||||||
class: {
|
class: {
|
||||||
root: `bg-${color}-500 dark:bg-${color}-400 text-white dark:text-gray-900`
|
root: `bg-${color}-500 dark:bg-${color}-400 text-white dark:text-gray-900`
|
||||||
}
|
}
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'outline',
|
variant: 'outline',
|
||||||
class: {
|
class: {
|
||||||
root: `text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/25 dark:ring-${color}-400/25`
|
root: `text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/25 dark:ring-${color}-400/25`
|
||||||
}
|
}
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'soft',
|
variant: 'soft',
|
||||||
class: {
|
class: {
|
||||||
root: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400`
|
root: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400`
|
||||||
}
|
}
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'subtle',
|
variant: 'subtle',
|
||||||
class: {
|
class: {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
base: 'rounded-md font-medium inline-flex items-center',
|
base: 'rounded-md font-medium inline-flex items-center',
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, ''])),
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||||
gray: ''
|
gray: ''
|
||||||
},
|
},
|
||||||
variant: {
|
variant: {
|
||||||
@@ -19,19 +19,19 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
lg: 'text-sm px-2 py-1'
|
lg: 'text-sm px-2 py-1'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compoundVariants: [...options.colors.map((color: string) => ({
|
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'solid',
|
variant: 'solid',
|
||||||
class: `bg-${color}-500 dark:bg-${color}-400 text-white dark:text-gray-900`
|
class: `bg-${color}-500 dark:bg-${color}-400 text-white dark:text-gray-900`
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'outline',
|
variant: 'outline',
|
||||||
class: `text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/50 dark:ring-${color}-400/50`
|
class: `text-${color}-500 dark:text-${color}-400 ring ring-inset ring-${color}-500/50 dark:ring-${color}-400/50`
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'soft',
|
variant: 'soft',
|
||||||
class: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400`
|
class: `bg-${color}-500/10 dark:bg-${color}-400/10 text-${color}-500 dark:text-${color}-400`
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'subtle',
|
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-${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`
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
active: false,
|
active: false,
|
||||||
to: true,
|
to: true,
|
||||||
class: {
|
class: {
|
||||||
link: ['hover:text-gray-700 dark:hover:text-gray-200', options.theme?.transitions && 'transition-colors']
|
link: ['hover:text-gray-700 dark:hover:text-gray-200', options.theme.transitions && 'transition-colors']
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { buttonGroupVariant } from './button-group'
|
|||||||
|
|
||||||
export default (options: Required<ModuleOptions>) => ({
|
export default (options: Required<ModuleOptions>) => ({
|
||||||
slots: {
|
slots: {
|
||||||
base: ['rounded-md font-medium inline-flex items-center focus:outline-none disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75', options.theme?.transitions && 'transition-colors'],
|
base: ['rounded-md font-medium inline-flex items-center focus:outline-none disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75', options.theme.transitions && 'transition-colors'],
|
||||||
label: 'truncate',
|
label: 'truncate',
|
||||||
leadingIcon: 'shrink-0',
|
leadingIcon: 'shrink-0',
|
||||||
leadingAvatar: 'shrink-0',
|
leadingAvatar: 'shrink-0',
|
||||||
@@ -12,7 +12,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
variants: {
|
variants: {
|
||||||
...buttonGroupVariant,
|
...buttonGroupVariant,
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, ''])),
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||||
gray: ''
|
gray: ''
|
||||||
},
|
},
|
||||||
variant: {
|
variant: {
|
||||||
@@ -69,27 +69,27 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
true: ''
|
true: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compoundVariants: [...options.colors.map((color: string) => ({
|
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'solid',
|
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-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`
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'outline',
|
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-${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`
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'soft',
|
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-${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`
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'subtle',
|
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-${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`
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'ghost',
|
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-${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`
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'link',
|
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-${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`
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`])),
|
...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'
|
gray: 'focus-visible:outline-gray-900 dark:focus-visible:outline-white'
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
@@ -58,7 +58,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
true: ''
|
true: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compoundVariants: [...options.colors.map((color: string) => ({
|
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
checked: true,
|
checked: true,
|
||||||
class: `ring-2 ring-${color}-500 dark:ring-${color}-400 bg-${color}-500 dark:bg-${color}-400`
|
class: `ring-2 ring-${color}-500 dark:ring-${color}-400 bg-${color}-500 dark:bg-${color}-400`
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, `bg-${color}-500 dark:bg-${color}-400`])),
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, `bg-${color}-500 dark:bg-${color}-400`])),
|
||||||
gray: 'bg-gray-500 dark:bg-gray-400'
|
gray: 'bg-gray-500 dark:bg-gray-400'
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
group: 'p-1 isolate',
|
group: 'p-1 isolate',
|
||||||
empty: 'py-6 text-center text-sm',
|
empty: 'py-6 text-center text-sm',
|
||||||
label: 'px-2 py-1.5 text-xs font-semibold text-gray-900 dark:text-white',
|
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'],
|
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'],
|
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'],
|
||||||
itemLeadingAvatar: 'shrink-0',
|
itemLeadingAvatar: 'shrink-0',
|
||||||
itemLeadingAvatarSize: '2xs',
|
itemLeadingAvatarSize: '2xs',
|
||||||
itemLeadingChip: 'shrink-0 size-5',
|
itemLeadingChip: 'shrink-0 size-5',
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
itemLeadingIcon: 'text-gray-700 dark:text-gray-200'
|
itemLeadingIcon: 'text-gray-700 dark:text-gray-200'
|
||||||
},
|
},
|
||||||
false: {
|
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'],
|
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']
|
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']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
itemLeadingIcon: 'text-gray-700 dark:text-gray-200'
|
itemLeadingIcon: 'text-gray-700 dark:text-gray-200'
|
||||||
},
|
},
|
||||||
false: {
|
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'],
|
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']
|
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']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import input from './input'
|
|||||||
export default (options: Required<ModuleOptions>) => {
|
export default (options: Required<ModuleOptions>) => {
|
||||||
return defuFn({
|
return defuFn({
|
||||||
slots: {
|
slots: {
|
||||||
base: () => ['rounded-md', options.theme?.transitions && 'transition-colors'],
|
base: () => ['rounded-md', options.theme.transitions && 'transition-colors'],
|
||||||
trailing: 'absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75',
|
trailing: 'absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75',
|
||||||
arrow: 'fill-gray-200 dark:fill-gray-800',
|
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]',
|
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]',
|
||||||
@@ -14,8 +14,8 @@ export default (options: Required<ModuleOptions>) => {
|
|||||||
empty: 'py-2 text-center text-sm text-gray-500 dark:text-gray-400',
|
empty: 'py-2 text-center text-sm text-gray-500 dark:text-gray-400',
|
||||||
label: 'font-semibold text-gray-900 dark:text-white',
|
label: 'font-semibold text-gray-900 dark:text-white',
|
||||||
separator: '-mx-1 my-1 h-px bg-gray-200 dark:bg-gray-800',
|
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'],
|
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'],
|
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'],
|
||||||
itemLeadingAvatar: 'shrink-0',
|
itemLeadingAvatar: 'shrink-0',
|
||||||
itemLeadingAvatarSize: '',
|
itemLeadingAvatarSize: '',
|
||||||
itemLeadingChip: 'shrink-0',
|
itemLeadingChip: 'shrink-0',
|
||||||
@@ -25,7 +25,7 @@ export default (options: Required<ModuleOptions>) => {
|
|||||||
itemLabel: 'truncate',
|
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-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',
|
||||||
tagsItemText: 'truncate',
|
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-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'],
|
||||||
tagsItemDeleteIcon: '',
|
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-gray-400 dark:placeholder-gray-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||||
},
|
},
|
||||||
@@ -97,7 +97,7 @@ export default (options: Required<ModuleOptions>) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compoundVariants: [...options.colors.map((color: string) => ({
|
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
multiple: true,
|
multiple: true,
|
||||||
variant: ['outline', 'subtle'],
|
variant: ['outline', 'subtle'],
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { buttonGroupVariantWithRoot } from './button-group'
|
|||||||
export default (options: Required<ModuleOptions>) => ({
|
export default (options: Required<ModuleOptions>) => ({
|
||||||
slots: {
|
slots: {
|
||||||
root: 'relative inline-flex items-center',
|
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 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',
|
leading: 'absolute inset-y-0 start-0 flex items-center',
|
||||||
leadingIcon: 'shrink-0 text-gray-400 dark:text-gray-500',
|
leadingIcon: 'shrink-0 text-gray-400 dark:text-gray-500',
|
||||||
leadingAvatar: 'shrink-0',
|
leadingAvatar: 'shrink-0',
|
||||||
@@ -58,7 +58,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
none: 'text-gray-900 dark:text-white'
|
none: 'text-gray-900 dark:text-white'
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, ''])),
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||||
gray: ''
|
gray: ''
|
||||||
},
|
},
|
||||||
leading: {
|
leading: {
|
||||||
@@ -77,11 +77,11 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
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-gray-500 dark:file:text-gray-400 file:outline-none'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compoundVariants: [...options.colors.map((color: string) => ({
|
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: ['outline', 'subtle'],
|
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-${color}-500 dark:focus-visible:ring-${color}-400`
|
||||||
})), ...options.colors.map((color: string) => ({
|
})), ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
highlight: true,
|
highlight: true,
|
||||||
class: `ring ring-inset ring-${color}-500 dark:ring-${color}-400`
|
class: `ring ring-inset ring-${color}-500 dark:ring-${color}-400`
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
variants: {
|
variants: {
|
||||||
active: {
|
active: {
|
||||||
true: 'text-primary-500 dark:text-primary-400',
|
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']
|
false: ['text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200', options.theme.transitions && 'transition-colors']
|
||||||
},
|
},
|
||||||
disabled: {
|
disabled: {
|
||||||
true: 'cursor-not-allowed opacity-75'
|
true: 'cursor-not-allowed opacity-75'
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, {
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||||
link: `focus-visible:before:ring-${color}-500 dark:focus-visible:before:ring-${color}-400`,
|
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`
|
childLink: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`
|
||||||
}])),
|
}])),
|
||||||
@@ -43,7 +43,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
highlightColor: {
|
highlightColor: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, ''])),
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||||
gray: ''
|
gray: ''
|
||||||
},
|
},
|
||||||
variant: {
|
variant: {
|
||||||
@@ -70,8 +70,8 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
false: {
|
false: {
|
||||||
link: 'text-gray-500 dark:text-gray-400',
|
link: 'text-gray-500 dark:text-gray-400',
|
||||||
linkLeadingIcon: 'text-gray-400 dark:text-gray-500',
|
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'],
|
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']
|
childLinkIcon: ['text-gray-400 dark:text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-200', options.theme.transitions && 'transition-colors']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
disabled: {
|
disabled: {
|
||||||
@@ -102,10 +102,10 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
active: false,
|
active: false,
|
||||||
variant: 'pill',
|
variant: 'pill',
|
||||||
class: {
|
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'],
|
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']
|
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']
|
||||||
}
|
}
|
||||||
}, ...options.colors.map((color: string) => ({
|
}, ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'pill',
|
variant: 'pill',
|
||||||
active: true,
|
active: true,
|
||||||
@@ -133,17 +133,17 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
active: true,
|
active: true,
|
||||||
highlight: true,
|
highlight: true,
|
||||||
class: {
|
class: {
|
||||||
link: ['hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50', options.theme?.transitions && 'before:transition-colors']
|
link: ['hover:before:bg-gray-50 dark:hover:before:bg-gray-800/50', options.theme.transitions && 'before:transition-colors']
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
disabled: false,
|
disabled: false,
|
||||||
active: false,
|
active: false,
|
||||||
variant: 'link',
|
variant: 'link',
|
||||||
class: {
|
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'],
|
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']
|
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']
|
||||||
}
|
}
|
||||||
}, ...options.colors.map((color: string) => ({
|
}, ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'link',
|
variant: 'link',
|
||||||
active: true,
|
active: true,
|
||||||
@@ -159,7 +159,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
link: 'text-gray-900 dark:text-white',
|
link: 'text-gray-900 dark:text-white',
|
||||||
linkLeadingIcon: 'text-gray-900 dark:text-white'
|
linkLeadingIcon: 'text-gray-900 dark:text-white'
|
||||||
}
|
}
|
||||||
}, ...options.colors.map((highlightColor: string) => ({
|
}, ...(options.theme.colors || []).map((highlightColor: string) => ({
|
||||||
highlightColor,
|
highlightColor,
|
||||||
highlight: true,
|
highlight: true,
|
||||||
active: true,
|
active: true,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
'elastic': ''
|
'elastic': ''
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, {
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||||
indicator: `bg-${color}-500 dark:bg-${color}-400`,
|
indicator: `bg-${color}-500 dark:bg-${color}-400`,
|
||||||
steps: `text-${color}-500 dark:text-${color}-400`
|
steps: `text-${color}-500 dark:text-${color}-400`
|
||||||
}])),
|
}])),
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, {
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||||
base: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`,
|
base: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`,
|
||||||
indicator: `bg-${color}-500 dark:bg-${color}-400`
|
indicator: `bg-${color}-500 dark:bg-${color}-400`
|
||||||
}])),
|
}])),
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export default (options: Required<ModuleOptions>) => {
|
|||||||
return defuFn({
|
return defuFn({
|
||||||
slots: {
|
slots: {
|
||||||
root: () => undefined,
|
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'],
|
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',
|
value: 'truncate group-data-placeholder:text-current/50',
|
||||||
arrow: 'fill-gray-200 dark:fill-gray-800',
|
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]',
|
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]',
|
||||||
@@ -16,8 +16,8 @@ export default (options: Required<ModuleOptions>) => {
|
|||||||
empty: 'py-2 text-center text-sm text-gray-500 dark:text-gray-400',
|
empty: 'py-2 text-center text-sm text-gray-500 dark:text-gray-400',
|
||||||
label: 'font-semibold text-gray-900 dark:text-white',
|
label: 'font-semibold text-gray-900 dark:text-white',
|
||||||
separator: '-mx-1 my-1 h-px bg-gray-200 dark:bg-gray-800',
|
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'],
|
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'],
|
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'],
|
||||||
itemLeadingAvatar: 'shrink-0',
|
itemLeadingAvatar: 'shrink-0',
|
||||||
itemLeadingAvatarSize: '',
|
itemLeadingAvatarSize: '',
|
||||||
itemLeadingChip: 'shrink-0',
|
itemLeadingChip: 'shrink-0',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, { border: `border-${color}-500 dark:border-${color}-400` }])),
|
...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' }
|
gray: { border: 'border-gray-200 dark:border-gray-800' }
|
||||||
},
|
},
|
||||||
orientation: {
|
orientation: {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, {
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||||
range: `bg-${color}-500 dark:bg-${color}-400`,
|
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`
|
thumb: `ring-${color}-500 dark:ring-${color}-400 focus-visible:outline-${color}-500/50 dark:focus-visible:outline-${color}-400/50`
|
||||||
}])),
|
}])),
|
||||||
|
|||||||
@@ -3,17 +3,17 @@ import type { ModuleOptions } from '../module'
|
|||||||
export default (options: Required<ModuleOptions>) => ({
|
export default (options: Required<ModuleOptions>) => ({
|
||||||
slots: {
|
slots: {
|
||||||
root: 'relative flex items-start',
|
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-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'],
|
||||||
container: 'flex items-center',
|
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',
|
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'],
|
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'],
|
||||||
wrapper: 'ms-2',
|
wrapper: 'ms-2',
|
||||||
label: 'block font-medium text-gray-700 dark:text-gray-200',
|
label: 'block font-medium text-gray-700 dark:text-gray-200',
|
||||||
description: 'text-gray-500 dark:text-gray-400'
|
description: 'text-gray-500 dark:text-gray-400'
|
||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [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`,
|
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`
|
icon: `group-data-[state=checked]:text-${color}-500 dark:group-data-[state=checked]:text-${color}-400`
|
||||||
}])),
|
}])),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
root: 'flex items-center gap-2',
|
root: 'flex items-center gap-2',
|
||||||
list: 'relative flex p-1 group',
|
list: 'relative flex p-1 group',
|
||||||
indicator: 'absolute transition-[translate,width] duration-200',
|
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-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'],
|
||||||
content: 'focus:outline-none w-full',
|
content: 'focus:outline-none w-full',
|
||||||
leadingIcon: 'shrink-0',
|
leadingIcon: 'shrink-0',
|
||||||
leadingAvatar: 'shrink-0',
|
leadingAvatar: 'shrink-0',
|
||||||
@@ -14,7 +14,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, ''])),
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, ''])),
|
||||||
gray: ''
|
gray: ''
|
||||||
},
|
},
|
||||||
variant: {
|
variant: {
|
||||||
@@ -95,7 +95,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
list: 'border-l',
|
list: 'border-l',
|
||||||
indicator: '-left-px w-px'
|
indicator: '-left-px w-px'
|
||||||
}
|
}
|
||||||
}, ...options.colors.map((color: string) => ({
|
}, ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'pill',
|
variant: 'pill',
|
||||||
class: {
|
class: {
|
||||||
@@ -109,7 +109,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
indicator: 'bg-gray-900 dark:bg-white',
|
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'
|
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'
|
||||||
}
|
}
|
||||||
}, ...options.colors.map((color: string) => ({
|
}, ...(options.theme.colors || []).map((color: string) => ({
|
||||||
color,
|
color,
|
||||||
variant: 'link',
|
variant: 'link',
|
||||||
class: {
|
class: {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default (options: Required<ModuleOptions>) => ({
|
|||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
...Object.fromEntries(options.colors.map((color: string) => [color, {
|
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, {
|
||||||
icon: `text-${color}-500 dark:text-${color}-400`,
|
icon: `text-${color}-500 dark:text-${color}-400`,
|
||||||
progress: `bg-${color}-500 dark:bg-${color}-400`
|
progress: `bg-${color}-500 dark:bg-${color}-400`
|
||||||
}])),
|
}])),
|
||||||
|
|||||||
Reference in New Issue
Block a user