mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-18 14:08:06 +01:00
feat(module): define neutral utilities (#3629)
Co-authored-by: Sébastien Chopin <atinux@gmail.com>
This commit is contained in:
@@ -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-(--ui-border)',
|
||||
content: 'max-h-60 w-(--reka-combobox-trigger-width) min-w-fit 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] origin-(--reka-combobox-content-transform-origin) pointer-events-auto',
|
||||
viewport: 'divide-y divide-(--ui-border) scroll-py-1',
|
||||
arrow: 'fill-default',
|
||||
content: 'max-h-60 w-(--reka-combobox-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-combobox-content-transform-origin) pointer-events-auto',
|
||||
viewport: 'divide-y divide-default scroll-py-1',
|
||||
group: 'p-1 isolate',
|
||||
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:not-data-disabled:text-(--ui-text-highlighted) data-highlighted:not-data-disabled:before:bg-(--ui-bg-elevated)/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['shrink-0 text-(--ui-text-dimmed) group-data-highlighted:not-group-data-disabled:text-(--ui-text)', options.theme.transitions && 'transition-colors'],
|
||||
empty: 'py-2 text-center text-sm text-muted',
|
||||
label: 'font-semibold text-highlighted',
|
||||
separator: '-mx-1 my-1 h-px bg-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-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50', options.theme.transitions && 'transition-colors before:transition-colors'],
|
||||
itemLeadingIcon: ['shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default', options.theme.transitions && 'transition-colors'],
|
||||
itemLeadingAvatar: 'shrink-0',
|
||||
itemLeadingAvatarSize: '',
|
||||
itemLeadingChip: 'shrink-0',
|
||||
@@ -23,9 +23,9 @@ export default (options: Required<ModuleOptions>) => {
|
||||
itemTrailing: 'ms-auto inline-flex gap-1.5 items-center',
|
||||
itemTrailingIcon: 'shrink-0',
|
||||
itemLabel: 'truncate',
|
||||
tagsItem: 'px-1.5 py-0.5 rounded-sm 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',
|
||||
tagsItem: 'px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-disabled:cursor-not-allowed data-disabled:opacity-75',
|
||||
tagsItemText: 'truncate',
|
||||
tagsItemDelete: ['inline-flex items-center rounded-xs text-(--ui-text-dimmed) hover:text-(--ui-text) hover:bg-(--ui-bg-accented)/75 disabled:pointer-events-none', options.theme.transitions && 'transition-colors'],
|
||||
tagsItemDelete: ['inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none', options.theme.transitions && 'transition-colors'],
|
||||
tagsItemDeleteIcon: '',
|
||||
tagsInput: ''
|
||||
},
|
||||
@@ -33,10 +33,10 @@ export default (options: Required<ModuleOptions>) => {
|
||||
multiple: {
|
||||
true: {
|
||||
root: 'flex-wrap',
|
||||
tagsInput: 'border-0 bg-transparent placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
tagsInput: 'border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
},
|
||||
false: {
|
||||
base: 'w-full border-0 placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
base: 'w-full border-0 placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75'
|
||||
}
|
||||
},
|
||||
size: {
|
||||
@@ -101,12 +101,12 @@ export default (options: Required<ModuleOptions>) => {
|
||||
color,
|
||||
multiple: true,
|
||||
variant: ['outline', 'subtle'],
|
||||
class: `has-focus-visible:ring-2 has-focus-visible:ring-(--ui-${color})`
|
||||
class: `has-focus-visible:ring-2 has-focus-visible:ring-${color}`
|
||||
})), {
|
||||
color: 'neutral',
|
||||
multiple: true,
|
||||
variant: ['outline', 'subtle'],
|
||||
class: 'has-focus-visible:ring-2 has-focus-visible:ring-(--ui-border-inverted)'
|
||||
class: 'has-focus-visible:ring-2 has-focus-visible:ring-inverted'
|
||||
}]
|
||||
}, input(options))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user