Skip to content

Commit

Permalink
chore(theme): clean Select & InputMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Sep 17, 2024
1 parent 2346f52 commit ff8eefd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
7 changes: 2 additions & 5 deletions src/theme/input-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import input from './input'
export default (options: Required<ModuleOptions>) => {
return defuFn({
slots: {
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',
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',
Expand All @@ -26,11 +28,6 @@ export default (options: Required<ModuleOptions>) => {
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: '',
tagsInput: 'border-0 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
}
}, {
slots: {
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'
},
variants: {
multiple: {
Expand Down
12 changes: 4 additions & 8 deletions src/theme/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { buttonGroupVariant } from './button-group'
export default (options: Required<ModuleOptions>) => {
return defuFn({
slots: {
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',
Expand All @@ -24,6 +27,7 @@ export default (options: Required<ModuleOptions>) => {
itemLabel: 'truncate'
},
variants: {
...buttonGroupVariant,
size: {
xs: {
label: 'p-1 text-[10px]/3 gap-1',
Expand Down Expand Up @@ -72,13 +76,5 @@ export default (options: Required<ModuleOptions>) => {
}
}
}
}, {
slots: {
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'
},
variants: {
...buttonGroupVariant
}
}, input(options))
}

0 comments on commit ff8eefd

Please sign in to comment.