mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
chore(module): add nuxt preset
This commit is contained in:
@@ -33,7 +33,7 @@ export interface ModuleOptions {
|
||||
}
|
||||
|
||||
const defaults = {
|
||||
preset: 'tailwindui',
|
||||
preset: 'default',
|
||||
prefix: 'u',
|
||||
colors: {
|
||||
primary: 'indigo',
|
||||
|
||||
55
src/runtime/presets/nuxt.ts
Normal file
55
src/runtime/presets/nuxt.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import defu from 'defu'
|
||||
import preset from './default'
|
||||
|
||||
const badge = {
|
||||
variant: {
|
||||
primary: 'bg-gray-800 text-white',
|
||||
secondary: 'bg-white text-gray-700'
|
||||
}
|
||||
}
|
||||
|
||||
const button = {
|
||||
variant: {
|
||||
primary: 'border border-transparent text-white bg-gray-800 hover:bg-gray-900 focus:ring-2 focus:ring-offset-2 focus:ring-gray-900',
|
||||
secondary: 'border border-gray-300 text-gray-700 bg-white hover:bg-gray-50 focus:ring-2 focus:ring-offset-2 focus:ring-gray-900',
|
||||
link: 'border border-transparent text-gray-900 hover:underline focus:underline'
|
||||
}
|
||||
}
|
||||
|
||||
const input = {
|
||||
appearance: {
|
||||
default: 'focus:ring-1 focus:ring-gray-900 focus:border-gray-900 border border-gray-300 rounded-md shadow-sm'
|
||||
}
|
||||
}
|
||||
|
||||
const textarea = {
|
||||
...input
|
||||
}
|
||||
|
||||
const select = {
|
||||
...input
|
||||
}
|
||||
|
||||
const radio = {
|
||||
base: 'h-4 w-4 text-gray-900 focus:ring-2 focus:ring-offset-2 focus:ring-gray-900 u-border-gray-300 disabled:opacity-50 disabled:cursor-not-allowed'
|
||||
}
|
||||
|
||||
const checkbox = {
|
||||
base: `${radio.base} rounded`
|
||||
}
|
||||
|
||||
const toggle = {
|
||||
base: 'relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2',
|
||||
active: 'bg-gray-800'
|
||||
}
|
||||
|
||||
export default defu(preset, {
|
||||
badge,
|
||||
button,
|
||||
input,
|
||||
textarea,
|
||||
select,
|
||||
radio,
|
||||
checkbox,
|
||||
toggle
|
||||
})
|
||||
Reference in New Issue
Block a user