diff --git a/src/plugins/components/autocomplete/autocomplete.config.ts b/src/plugins/components/autocomplete/autocomplete.config.ts index 5b6fe66..d559ca4 100644 --- a/src/plugins/components/autocomplete/autocomplete.config.ts +++ b/src/plugins/components/autocomplete/autocomplete.config.ts @@ -1,6 +1,6 @@ export const key = 'autocomplete' as const -export const config = { +export const defaultConfig = { rounded: { none: 'none', sm: 'md', @@ -43,6 +43,16 @@ export const config = { }, }, }, + icon: { + color: { + light: 'muted-400', + dark: 'muted-400', + }, + transition: { + property: 'colors', + duration: '300', + }, + }, transition: { property: 'all', duration: '300', @@ -472,276 +482,276 @@ export const config = { }, } -export const defaultConfig = { - labelFloat: { - text: 'primary-500', - size: '5', - duration: '300', - }, - multipleList: { - item: { - bg: 'muted-200', - bgDark: 'muted-700', - text: 'muted-400', - textSize: 'xs', - font: 'sans', - fontWeight: 'medium', - }, - icon: { - size: '3', - }, - }, - icon: { - text: 'muted-400', - duration: '300', - }, - input: { - size: 'full', - font: 'sans', - duration: '300', - focusVisible: { - labelFloat: { - text: 'primary-500', - textDark: 'primary-500', - }, - icon: { - text: 'primary-500', - }, - }, - }, - clear: { - text: 'muted-400', - textHover: 'muted-700', - textHoverDark: 'muted-200', - duration: '300', - inner: { - size: '4', - }, - }, - errorText: { - text: 'danger-600', - textSize: '[0.65rem]', - font: 'sans', - fontWeight: 'medium', - }, - results: { - text: 'base', - shadow: 'muted-500/10', - shadowDark: 'muted-800/10', - shadowSize: 'lg', - }, - itemInner: { - space: '2', - duration: '300', - selectedIcon: { - text: 'success-500', - size: '4', - }, - hasMedia: { - size: '8', - }, - }, - placeholder: { - font: 'sans', - text: 'muted-700', - textDark: 'muted-400', - }, - rounded: { - default: 'md', - smooth: 'lg', - curved: 'xl', - full: { - input: 'full', - inner: 'xl', - }, - }, - sm: { - text: 'xs', - icon: { - size: '8', - innerSize: '4', - }, - placeload: { - size: '8', - }, - clear: { - size: '8', - }, - }, - md: { - text: '[0.825rem]', - icon: { - size: '10', - innerSize: '[1.15rem]', - }, - placeload: { - size: '10', - }, - clear: { - size: '10', - }, - }, - lg: { - text: 'sm', - icon: { - size: '12', - innerSize: '5', - }, - placeload: { - size: '12', - }, - clear: { - size: '12', - }, - }, - default: { - bg: 'white', - bgDark: 'muted-900/75', - border: 'muted-300', - borderDark: 'muted-700', - text: 'muted-600', - textDark: 'muted-200', - textPlaceholder: 'muted-300', - textPlaceholderDark: 'muted-500', - results: { - border: 'muted-200', - borderDark: 'muted-700', - bg: 'white', - bgDark: 'muted-800', - }, - resultsInner: { - bg: 'muted-100', - bgDark: 'muted-700', - }, - }, - defaultContrast: { - bg: 'white', - bgDark: 'muted-950/75', - border: 'muted-300', - borderDark: 'muted-800', - text: 'muted-600', - textDark: 'muted-200', - textPlaceholder: 'muted-300', - textPlaceholderDark: 'muted-600', - results: { - border: 'muted-200', - borderDark: 'muted-800', - bg: 'white', - bgDark: 'muted-950/75', - }, - resultsInner: { - bg: 'muted-100', - bgDark: 'muted-800', - }, - }, - muted: { - bg: 'muted-100', - bgDark: 'muted-900/75', - border: 'muted-200', - borderDark: 'muted-700', - text: 'muted-600', - textDark: 'muted-200', - textPlaceholder: 'muted-300', - textPlaceholderDark: 'muted-500', - results: { - border: 'muted-200', - borderDark: 'muted-700', - bg: 'white', - bgDark: 'muted-800', - }, - resultsInner: { - bg: 'white', - bgDark: 'muted-700', - }, - }, - mutedContrast: { - bg: 'muted-100', - bgDark: 'muted-950/75', - border: 'muted-100', - borderDark: 'muted-800', - text: 'muted-600', - textDark: 'muted-200', - textPlaceholder: 'muted-300', - textPlaceholderDark: 'muted-600', - results: { - border: 'muted-200', - borderDark: 'muted-800', - bg: 'white', - bgDark: 'muted-950/75', - }, - resultsInner: { - bg: 'white', - bgDark: 'muted-700', - }, - }, - notLoading: { - text: 'muted-300', - textDark: 'muted-600', - }, - error: { - border: 'danger-500', - borderDark: 'danger-500', - icon: { - text: 'danger-500', - }, - }, - hasNotIcon: { - text: { - sm: 'xs', - md: 'sm', - lg: 'sm', - }, - labelFloat: { - sm: 'xs', - md: { - text: 'xs', - focusVisible: { - text: 'xs', - }, - placeholderShown: { - text: '[0.825rem]', - }, - }, - lg: { - text: 'xs', - focusVisible: { - text: 'xs', - }, - placeholderShown: { - text: '[0.825rem]', - }, - }, - }, - }, - hasIcon: { - text: { - sm: 'xs', - md: 'sm', - lg: 'base', - }, - labelFloat: { - sm: 'xs', - md: { - text: 'xs', - focusVisible: { - text: 'xs', - }, - placeholderShown: { - text: '[0.825rem]', - }, - }, - lg: { - text: 'xs', - focusVisible: { - text: 'xs', - }, - placeholderShown: { - text: '[0.825rem]', - }, - }, - }, - }, -} +// export const defaultConfig = { +// labelFloat: { +// text: 'primary-500', +// size: '5', +// duration: '300', +// }, +// multipleList: { +// item: { +// bg: 'muted-200', +// bgDark: 'muted-700', +// text: 'muted-400', +// textSize: 'xs', +// font: 'sans', +// fontWeight: 'medium', +// }, +// icon: { +// size: '3', +// }, +// }, +// icon: { +// text: 'muted-400', +// duration: '300', +// }, +// input: { +// size: 'full', +// font: 'sans', +// duration: '300', +// focusVisible: { +// labelFloat: { +// text: 'primary-500', +// textDark: 'primary-500', +// }, +// icon: { +// text: 'primary-500', +// }, +// }, +// }, +// clear: { +// text: 'muted-400', +// textHover: 'muted-700', +// textHoverDark: 'muted-200', +// duration: '300', +// inner: { +// size: '4', +// }, +// }, +// errorText: { +// text: 'danger-600', +// textSize: '[0.65rem]', +// font: 'sans', +// fontWeight: 'medium', +// }, +// results: { +// text: 'base', +// shadow: 'muted-500/10', +// shadowDark: 'muted-800/10', +// shadowSize: 'lg', +// }, +// itemInner: { +// space: '2', +// duration: '300', +// selectedIcon: { +// text: 'success-500', +// size: '4', +// }, +// hasMedia: { +// size: '8', +// }, +// }, +// placeholder: { +// font: 'sans', +// text: 'muted-700', +// textDark: 'muted-400', +// }, +// rounded: { +// default: 'md', +// smooth: 'lg', +// curved: 'xl', +// full: { +// input: 'full', +// inner: 'xl', +// }, +// }, +// sm: { +// text: 'xs', +// icon: { +// size: '8', +// innerSize: '4', +// }, +// placeload: { +// size: '8', +// }, +// clear: { +// size: '8', +// }, +// }, +// md: { +// text: '[0.825rem]', +// icon: { +// size: '10', +// innerSize: '[1.15rem]', +// }, +// placeload: { +// size: '10', +// }, +// clear: { +// size: '10', +// }, +// }, +// lg: { +// text: 'sm', +// icon: { +// size: '12', +// innerSize: '5', +// }, +// placeload: { +// size: '12', +// }, +// clear: { +// size: '12', +// }, +// }, +// default: { +// bg: 'white', +// bgDark: 'muted-900/75', +// border: 'muted-300', +// borderDark: 'muted-700', +// text: 'muted-600', +// textDark: 'muted-200', +// textPlaceholder: 'muted-300', +// textPlaceholderDark: 'muted-500', +// results: { +// border: 'muted-200', +// borderDark: 'muted-700', +// bg: 'white', +// bgDark: 'muted-800', +// }, +// resultsInner: { +// bg: 'muted-100', +// bgDark: 'muted-700', +// }, +// }, +// defaultContrast: { +// bg: 'white', +// bgDark: 'muted-950/75', +// border: 'muted-300', +// borderDark: 'muted-800', +// text: 'muted-600', +// textDark: 'muted-200', +// textPlaceholder: 'muted-300', +// textPlaceholderDark: 'muted-600', +// results: { +// border: 'muted-200', +// borderDark: 'muted-800', +// bg: 'white', +// bgDark: 'muted-950/75', +// }, +// resultsInner: { +// bg: 'muted-100', +// bgDark: 'muted-800', +// }, +// }, +// muted: { +// bg: 'muted-100', +// bgDark: 'muted-900/75', +// border: 'muted-200', +// borderDark: 'muted-700', +// text: 'muted-600', +// textDark: 'muted-200', +// textPlaceholder: 'muted-300', +// textPlaceholderDark: 'muted-500', +// results: { +// border: 'muted-200', +// borderDark: 'muted-700', +// bg: 'white', +// bgDark: 'muted-800', +// }, +// resultsInner: { +// bg: 'white', +// bgDark: 'muted-700', +// }, +// }, +// mutedContrast: { +// bg: 'muted-100', +// bgDark: 'muted-950/75', +// border: 'muted-100', +// borderDark: 'muted-800', +// text: 'muted-600', +// textDark: 'muted-200', +// textPlaceholder: 'muted-300', +// textPlaceholderDark: 'muted-600', +// results: { +// border: 'muted-200', +// borderDark: 'muted-800', +// bg: 'white', +// bgDark: 'muted-950/75', +// }, +// resultsInner: { +// bg: 'white', +// bgDark: 'muted-700', +// }, +// }, +// notLoading: { +// text: 'muted-300', +// textDark: 'muted-600', +// }, +// error: { +// border: 'danger-500', +// borderDark: 'danger-500', +// icon: { +// text: 'danger-500', +// }, +// }, +// hasNotIcon: { +// text: { +// sm: 'xs', +// md: 'sm', +// lg: 'sm', +// }, +// labelFloat: { +// sm: 'xs', +// md: { +// text: 'xs', +// focusVisible: { +// text: 'xs', +// }, +// placeholderShown: { +// text: '[0.825rem]', +// }, +// }, +// lg: { +// text: 'xs', +// focusVisible: { +// text: 'xs', +// }, +// placeholderShown: { +// text: '[0.825rem]', +// }, +// }, +// }, +// }, +// hasIcon: { +// text: { +// sm: 'xs', +// md: 'sm', +// lg: 'base', +// }, +// labelFloat: { +// sm: 'xs', +// md: { +// text: 'xs', +// focusVisible: { +// text: 'xs', +// }, +// placeholderShown: { +// text: '[0.825rem]', +// }, +// }, +// lg: { +// text: 'xs', +// focusVisible: { +// text: 'xs', +// }, +// placeholderShown: { +// text: '[0.825rem]', +// }, +// }, +// }, +// }, +// } export type AutocompleteConfig = typeof defaultConfig export interface AutocompletePluginConfig { diff --git a/src/plugins/components/autocomplete/autocomplete.stories.ts b/src/plugins/components/autocomplete/autocomplete.stories.ts index 0353db6..242e7a7 100644 --- a/src/plugins/components/autocomplete/autocomplete.stories.ts +++ b/src/plugins/components/autocomplete/autocomplete.stories.ts @@ -1161,6 +1161,7 @@ export const MediaIconSm: Story = { name: 'Media icon: sm', args: { label: 'Search', + labelFloat: true, size: 'sm', contrast: 'default', shape: 'rounded', @@ -1238,6 +1239,7 @@ export const MediaIconMd: Story = { name: 'Media icon: md', args: { label: 'Search', + labelFloat: true, size: 'md', contrast: 'default', shape: 'rounded', @@ -1315,6 +1317,7 @@ export const MediaIconLg: Story = { name: 'Media icon: lg', args: { label: 'Search', + labelFloat: true, size: 'lg', contrast: 'default', shape: 'rounded', diff --git a/src/plugins/components/autocomplete/index.ts b/src/plugins/components/autocomplete/index.ts index 29fc994..d0fa2f5 100644 --- a/src/plugins/components/autocomplete/index.ts +++ b/src/plugins/components/autocomplete/index.ts @@ -21,276 +21,431 @@ export default plugin.withOptions( addComponents({ [`.${prefix}autocomplete`]: { [`@apply w-full relative`]: {}, - + //Autocomplete:label [`.${prefix}autocomplete-label, .${prefix}label-float`]: { [`@apply ${prefix}label`]: {}, }, + //Autocomplete:label float [`.${prefix}label-float`]: { - [`@apply text-${config.labelFloat.text} pointer-events-none absolute inline-flex h-${config.labelFloat.size} select-none items-center leading-none transition-all duration-${config.labelFloat.duration}`]: + //Base + [`@apply pointer-events-none absolute inline-flex select-none items-center leading-none`]: + {}, + //Color & Height + [`@apply text-${config.label.float.font.color} h-${config.label.float.height}`]: + {}, + //Transition + [`@apply transition-${config.label.float.transition.property} duration-${config.label.float.transition.duration}`]: {}, }, + //Autocomplete:multiple [`.${prefix}autocomplete-multiple`]: { [`@apply block`]: {}, - + //multiple:list [`.${prefix}autocomplete-multiple-list`]: { [`@apply my-2 flex flex-wrap gap-1`]: {}, }, + //multiple:list item [`.${prefix}autocomplete-multiple-list-item`]: { - [`@apply bg-${config.multipleList.item.bg} text-${config.multipleList.item.text} dark:bg-${config.multipleList.item.bgDark} flex items-center py-2 pe-2 ps-3 font-${config.multipleList.item.font} text-${config.multipleList.item.textSize} font-${config.multipleList.item.fontWeight}`]: + //Base + [`@apply flex items-center py-2 pe-2 ps-3`]: {}, + //Font + [`@apply font-${config.multiple.item.font.family} text-${config.multiple.item.font.size} font-${config.multiple.item.font.weight}`]: + {}, + //Text color + [`@apply text-${config.multiple.item.font.color.light} dark:text-${config.multiple.item.font.color.dark}`]: + {}, + //Background + [`@apply bg-${config.multiple.item.background.light} dark:bg-${config.multiple.item.background.dark}`]: {}, }, + //multiple:list icon [`.${prefix}autocomplete-multiple-list-item-icon`]: { - [`@apply ms-1 block h-${config.multipleList.icon.size} w-${config.multipleList.icon.size}`]: + [`@apply ms-1 block h-${config.multiple.icon.size} w-${config.multiple.icon.size}`]: {}, }, }, + //Autocomplete:outer [`.${prefix}autocomplete-outer`]: { [`@apply relative`]: {}, }, + //Autocomplete:icon [`.${prefix}autocomplete-icon`]: { - [`@apply text-${config.icon.text} absolute start-0 top-0 z-10 flex items-center justify-center transition-colors duration-${config.icon.duration}`]: + [`@apply absolute start-0 top-0 z-10 flex items-center justify-center`]: + {}, + //Font + [`@apply text-${config.input.icon.color.light} dark:text-${config.input.icon.color.dark}`]: + {}, + //Transition + [`@apply transition-${config.input.icon.transition.property} duration-${config.input.icon.transition.duration}`]: {}, }, + //Autocomplete:input [`.${prefix}autocomplete-input`]: { - [`@apply ${prefix}focus w-${config.input.size} font-${config.input.font} transition-all duration-${config.input.duration} disabled:cursor-not-allowed disabled:opacity-75`]: + [`@apply ${prefix}focus w-${config.input.width} font-${config.input.font.family}`]: {}, - + //State + [`@apply disabled:cursor-not-allowed disabled:opacity-75`]: {}, + //Transition + [`@apply transition-${config.input.transition.property} duration-${config.input.transition.duration}`]: + {}, + //Focus:label float [`&:focus-visible ~ .${prefix}label-float`]: { - [`@apply !text-${config.input.focusVisible.labelFloat.text} dark:!text-${config.input.focusVisible.labelFloat.textDark}`]: + [`@apply !text-${config.input.focus.label.float.font.color.light} dark:!text-${config.input.focus.label.float.font.color.dark}`]: {}, }, + //Focus:icon [`&:focus-visible ~ .${prefix}autocomplete-icon`]: { - [`@apply !text-${config.input.focusVisible.icon.text}`]: {}, + [`@apply !text-${config.input.focus.icon.color.light} dark:!text-${config.input.focus.icon.color.dark}`]: + {}, }, + //State:disabled [`&:disabled ~ .${prefix}autocomplete-icon`]: { [`@apply cursor-not-allowed opacity-75`]: {}, }, }, + //Autocomplete:clear [`.${prefix}autocomplete-clear`]: { - [`@apply text-${config.clear.text} hover:text-${config.clear.textHover} dark:hover:text-${config.clear.textHoverDark} absolute end-0 top-0 z-auto flex items-center justify-center transition-colors duration-${config.clear.duration} cursor-pointer`]: + [`@apply absolute end-0 top-0 z-auto flex items-center justify-center cursor-pointer`]: + {}, + //Text color + [`@apply text-${config.clear.font.color.base.light} dark:text-${config.clear.font.color.base.dark}`]: {}, + //Text color hover + [`@apply hover:text-${config.clear.font.color.hover.light} dark:hover:text-${config.clear.font.color.hover.dark}`]: + {}, + //Transition + [`@apply transition-${config.clear.transition.property} duration-${config.clear.transition.duration}`]: + {}, + //Clear:inner [`.${prefix}autocomplete-clear-inner`]: { [`@apply w-${config.clear.inner.size} h-${config.clear.inner.size}`]: {}, }, }, + //Autocomplete:placeload [`.${prefix}autocomplete-placeload`]: { [`@apply absolute start-0 top-0 flex w-full items-center px-4`]: {}, - + //Placeload:inner [`.${prefix}placeload`]: { [`@apply h-3 w-full max-w-[75%] rounded`]: {}, }, }, + //Autocomplete:error [`.${prefix}autocomplete-error-text`]: { - [`@apply text-${config.errorText.text} mt-1 block font-${config.errorText.font} text-${config.errorText.textSize} font-${config.errorText.fontWeight} leading-none`]: + //Base + [`@apply mt-1 block leading-none`]: {}, + //Error text font + [`@apply font-${config.error.font.family} text-${config.error.font.size} font-${config.error.font.weight}`]: + {}, + //Error text color + [`@apply text-${config.error.font.color.light} dark:text-${config.error.font.color.dark}`]: {}, }, + //Autocomplete:results [`.${prefix}autocomplete-results`]: { - [`@apply ${prefix}slimscroll absolute z-20 mt-1 max-h-[265px] w-full overflow-auto py-1 text-${config.results.text} shadow-${config.results.shadowSize} shadow-${config.results.shadow} dark:shadow-${config.results.shadowDark} outline-none sm:text-sm`]: + [`@apply ${prefix}slimscroll absolute z-20 mt-1 max-h-[265px] w-full overflow-auto py-1 outline-none sm:text-sm`]: + {}, + //Font size + [`@apply text-${config.results.font.size}`]: {}, + //Shadow + [`@apply shadow-${config.results.shadow.size} shadow-${config.results.shadow.light} dark:shadow-${config.results.shadow.dark}`]: {}, + //Results:header & footer [`.${prefix}autocomplete-results-header, .${prefix}autocomplete-results-footer`]: { [`@apply relative px-2 py-1`]: {}, }, }, + //Autocomplete:results item [`.${prefix}autocomplete-results-item`]: { [`@apply px-2 py-1`]: {}, }, + //Item:inner [`.${prefix}autocomplete-results-item-inner`]: { - [`@apply text-muted-800 dark:text-muted-100 flex gap-2 cursor-pointer items-center p-${config.itemInner.space} transition-colors duration-${config.itemInner.duration}`]: + [`@apply text-muted-800 dark:text-muted-100 flex gap-2 cursor-pointer items-center`]: {}, - + //Padding + [`@apply p-${config.item.padding}`]: {}, + //Transition + [`@apply transition-${config.item.transition.property} duration-${config.item.transition.duration}`]: + {}, + //Item:selected [`.${prefix}autocomplete-results-item-selected`]: { [`@apply ms-auto flex items-center justify-center`]: {}, }, + //Selected:icon [`.${prefix}autocomplete-results-item-selected-icon`]: { - [`@apply text-${config.itemInner.selectedIcon.text} block h-${config.itemInner.selectedIcon.size} w-${config.itemInner.selectedIcon.size}`]: + [`@apply block text-${config.item.icon.color}`]: {}, + //Size + [`@apply h-${config.item.icon.size} w-${config.item.icon.size}`]: {}, }, + //Item:media [`&.${prefix}has-media`]: { [`.${prefix}autocomplete-results-item-selected`]: { - [`@apply h-${config.itemInner.hasMedia.size} w-${config.itemInner.hasMedia.size}`]: + [`@apply h-${config.item.media.size} w-${config.item.media.size}`]: {}, }, }, }, + //Results:placeholder [`.${prefix}autocomplete-results-placeholder`]: { - [`@apply relative px-4 py-2`]: {}, - [`.${prefix}autocomplete-results-placeholder-text`]: { - [`@apply font-${config.placeholder.font} text-${config.placeholder.text} dark:text-${config.placeholder.textDark} cursor-default select-none`]: - {}, - }, + //Base + [`@apply relative px-4 py-2 cursor-default select-none`]: {}, + //Font + [`@apply font-${config.placeholder.font.family} text-${config.placeholder.font.color.light} dark:text-${config.placeholder.font.color.dark}`]: + {}, }, + //Rounded:sm [`&.${prefix}autocomplete-rounded`]: { [`.${prefix}autocomplete-input`]: { - [`@apply rounded-${config.rounded.default}`]: {}, + [`@apply rounded-${config.rounded.sm}`]: {}, }, - + //Inner elements [`.${prefix}autocomplete-results, .${prefix}autocomplete-results-item-inner, .${prefix}autocomplete-multiple .${prefix}autocomplete-multiple-list-item`]: { - [`@apply rounded-${config.rounded.default}`]: {}, + [`@apply rounded-${config.rounded.sm}`]: {}, }, }, + //Rounded:md [`&.${prefix}autocomplete-smooth`]: { [`.${prefix}autocomplete-input`]: { - [`@apply rounded-${config.rounded.smooth}`]: {}, + [`@apply rounded-${config.rounded.md}`]: {}, }, - + //Inner elements [`.${prefix}autocomplete-results, .${prefix}autocomplete-results-item-inner, .${prefix}autocomplete-multiple .${prefix}autocomplete-multiple-list-item`]: { - [`@apply rounded-${config.rounded.smooth}`]: {}, + [`@apply rounded-${config.rounded.md}`]: {}, }, }, + //Rounded:lg [`&.${prefix}autocomplete-curved`]: { [`.${prefix}autocomplete-input`]: { - [`@apply rounded-${config.rounded.curved}`]: {}, + [`@apply rounded-${config.rounded.lg}`]: {}, }, - + //Inner elements [`.${prefix}autocomplete-results, .${prefix}autocomplete-results-item-inner, .${prefix}autocomplete-multiple .${prefix}autocomplete-multiple-list-item`]: { - [`@apply rounded-${config.rounded.curved}`]: {}, + [`@apply rounded-${config.rounded.lg}`]: {}, }, }, + //Rounded:full [`&.${prefix}autocomplete-full`]: { [`.${prefix}autocomplete-input, .${prefix}autocomplete-multiple .${prefix}autocomplete-multiple-list-item`]: { - [`@apply rounded-${config.rounded.full.input}`]: {}, + [`@apply rounded-${config.rounded.full}`]: {}, }, [`.${prefix}autocomplete-results, .${prefix}autocomplete-results-item-inner`]: { - [`@apply rounded-${config.rounded.full.inner}`]: {}, + [`@apply rounded-${config.rounded.lg}`]: {}, }, }, + //Size:sm [`&.${prefix}autocomplete-sm`]: { [`.${prefix}autocomplete-label`]: { - [`@apply pb-1 text-${config.sm.text}`]: {}, + [`@apply pb-1 text-${config.size.sm.font.size}`]: {}, }, [`.${prefix}label-float`]: { [`@apply top-1.5`]: {}, }, [`.${prefix}autocomplete-icon`]: { - [`@apply h-${config.sm.icon.size} w-${config.sm.icon.size}`]: {}, + [`@apply h-${config.size.sm.icon.size.outer} w-${config.size.sm.icon.size.outer}`]: + {}, [`.${prefix}autocomplete-icon-inner`]: { - [`@apply h-${config.sm.icon.innerSize} w-${config.sm.icon.innerSize}`]: + [`@apply h-${config.size.sm.icon.size.inner} w-${config.size.sm.icon.size.inner}`]: {}, }, }, [`.${prefix}autocomplete-placeload`]: { - [`@apply h-${config.sm.placeload.size}`]: {}, + [`@apply h-${config.size.sm.placeload.size}`]: {}, }, [`.${prefix}autocomplete-clear`]: { - [`@apply h-${config.sm.clear.size} w-${config.sm.clear.size}`]: + [`@apply h-${config.size.sm.clear.size} w-${config.size.sm.clear.size}`]: {}, }, }, + //Size:md [`&.${prefix}autocomplete-md`]: { [`.${prefix}autocomplete-label`]: { - [`@apply pb-1 text-${config.md.text}`]: {}, + [`@apply pb-1 text-${config.size.md.font.size}`]: {}, }, [`.${prefix}label-float`]: { [`@apply top-2.5`]: {}, }, [`.${prefix}autocomplete-icon`]: { - [`@apply h-${config.md.icon.size} w-${config.md.icon.size}`]: {}, + [`@apply h-${config.size.md.icon.size.outer} w-${config.size.md.icon.size.outer}`]: + {}, [`.${prefix}autocomplete-icon-inner`]: { - [`@apply h-${config.md.icon.innerSize} w-${config.md.icon.innerSize}`]: + [`@apply h-${config.size.md.icon.size.inner} w-${config.size.md.icon.size.inner}`]: {}, }, }, [`.${prefix}autocomplete-placeload`]: { - [`@apply h-${config.md.placeload.size}`]: {}, + [`@apply h-${config.size.md.placeload.size}`]: {}, }, [`.${prefix}autocomplete-clear`]: { - [`@apply h-${config.md.clear.size} w-${config.md.clear.size}`]: + [`@apply h-${config.size.md.clear.size} w-${config.size.md.clear.size}`]: {}, }, }, + //Size:lg [`&.${prefix}autocomplete-lg`]: { [`.${prefix}autocomplete-label`]: { - [`@apply pb-1 text-${config.lg.text}`]: {}, + [`@apply pb-1 text-${config.size.lg.font.size}`]: {}, }, [`.${prefix}label-float`]: { [`@apply top-3.5`]: {}, }, [`.${prefix}autocomplete-icon`]: { - [`@apply h-${config.lg.icon.size} w-${config.lg.icon.size}`]: {}, + [`@apply h-${config.size.lg.icon.size.outer} w-${config.size.lg.icon.size.outer}`]: + {}, [`.${prefix}autocomplete-icon-inner`]: { - [`@apply h-${config.lg.icon.innerSize} w-${config.lg.icon.innerSize}`]: + [`@apply h-${config.size.lg.icon.size.inner} w-${config.size.lg.icon.size.inner}`]: {}, }, }, [`.${prefix}autocomplete-placeload`]: { - [`@apply h-${config.lg.placeload.size}`]: {}, + [`@apply h-${config.size.lg.placeload.size}`]: {}, }, [`.${prefix}autocomplete-clear`]: { - [`@apply h-${config.lg.clear.size} w-${config.lg.clear.size}`]: + [`@apply h-${config.size.lg.clear.size} w-${config.size.lg.clear.size}`]: {}, }, }, + //Color:default [`&.${prefix}autocomplete-default`]: { [`.${prefix}autocomplete-input`]: { - [`@apply border bg-${config.default.bg} border-${config.default.border} text-${config.default.text} placeholder:text-${config.default.textPlaceholder} dark:border-${config.default.borderDark} dark:bg-${config.default.bgDark} dark:text-${config.default.textDark} dark:placeholder:text-${config.default.textPlaceholderDark}`]: + //Text + [`@apply text-${config.color.default.base.font.color.light} dark:text-${config.color.default.base.font.color.dark}`]: + {}, + //Background + [`@apply bg-${config.color.default.base.background.light} dark:bg-${config.color.default.base.background.dark}`]: + {}, + //Border + [`@apply border border-${config.color.default.base.border.light} dark:border-${config.color.default.base.border.dark}`]: + {}, + //Placeholder + [`@apply placeholder:text-${config.color.default.base.placeholder.color.light} dark:placeholder:text-${config.color.default.base.placeholder.color.dark}`]: {}, }, + //Results [`.${prefix}autocomplete-results`]: { - [`@apply border-${config.default.results.border} dark:border-${config.default.results.borderDark} dark:bg-${config.default.results.bgDark} border bg-${config.default.results.bg}`]: + //Border + [`@apply border border-${config.color.default.results.outer.border.light} dark:border-${config.color.default.results.outer.border.dark}`]: + {}, + //Background + [`@apply bg-${config.color.default.results.outer.background.light} dark:bg-${config.color.default.results.outer.background.dark}`]: {}, }, + //Results:inner [`.${prefix}autocomplete-results-item-inner.${prefix}active`]: { - [`@apply bg-${config.default.resultsInner.bg} dark:bg-${config.default.resultsInner.bgDark}`]: + [`@apply bg-${config.color.default.results.inner.background.light} dark:bg-${config.color.default.results.inner.background.dark}`]: {}, }, }, + //Color:default contrast [`&.${prefix}autocomplete-default-contrast`]: { [`.${prefix}autocomplete-input`]: { - [`@apply border bg-${config.defaultContrast.bg} border-${config.defaultContrast.border} text-${config.defaultContrast.text} placeholder:text-${config.defaultContrast.textPlaceholder} dark:border-${config.defaultContrast.borderDark} dark:bg-${config.defaultContrast.bgDark} dark:text-${config.defaultContrast.textDark} dark:placeholder:text-${config.defaultContrast.textPlaceholderDark}`]: + //Text + [`@apply text-${config.color.defaultContrast.base.font.color.light} dark:text-${config.color.defaultContrast.base.font.color.dark}`]: + {}, + //Background + [`@apply bg-${config.color.defaultContrast.base.background.light} dark:bg-${config.color.defaultContrast.base.background.dark}`]: + {}, + //Border + [`@apply border border-${config.color.defaultContrast.base.border.light} dark:border-${config.color.defaultContrast.base.border.dark}`]: + {}, + //Placeholder + [`@apply placeholder:text-${config.color.defaultContrast.base.placeholder.color.light} dark:placeholder:text-${config.color.defaultContrast.base.placeholder.color.dark}`]: {}, }, + //Results [`.${prefix}autocomplete-results`]: { - [`@apply border-${config.defaultContrast.results.border} dark:border-${config.defaultContrast.results.borderDark} dark:bg-${config.defaultContrast.results.bgDark} border bg-${config.defaultContrast.results.bg}`]: + //Border + [`@apply border border-${config.color.defaultContrast.results.outer.border.light} dark:border-${config.color.defaultContrast.results.outer.border.dark}`]: + {}, + //Background + [`@apply bg-${config.color.defaultContrast.results.outer.background.light} dark:bg-${config.color.defaultContrast.results.outer.background.dark}`]: {}, }, + //Results:inner [`.${prefix}autocomplete-results-item-inner.${prefix}active`]: { - [`@apply bg-${config.defaultContrast.resultsInner.bg} dark:bg-${config.defaultContrast.resultsInner.bgDark}`]: + [`@apply bg-${config.color.defaultContrast.results.inner.background.light} dark:bg-${config.color.defaultContrast.results.inner.background.dark}`]: {}, }, }, + //Color:muted [`&.${prefix}autocomplete-muted`]: { [`.${prefix}autocomplete-input`]: { - [`@apply border bg-${config.muted.bg} border-${config.muted.border} text-${config.muted.text} placeholder:text-${config.muted.textPlaceholder} dark:border-${config.muted.borderDark} dark:bg-${config.muted.bgDark} dark:text-${config.muted.textDark} dark:placeholder:text-${config.muted.textPlaceholderDark}`]: + //Text + [`@apply text-${config.color.muted.base.font.color.light} dark:text-${config.color.muted.base.font.color.dark}`]: + {}, + //Background + [`@apply bg-${config.color.muted.base.background.light} dark:bg-${config.color.muted.base.background.dark}`]: + {}, + //Border + [`@apply border border-${config.color.muted.base.border.light} dark:border-${config.color.muted.base.border.dark}`]: + {}, + //Placeholder + [`@apply placeholder:text-${config.color.muted.base.placeholder.color.light} dark:placeholder:text-${config.color.muted.base.placeholder.color.dark}`]: {}, }, + //Results [`.${prefix}autocomplete-results`]: { - [`@apply border-${config.muted.results.border} dark:border-${config.muted.results.borderDark} dark:bg-${config.muted.results.bgDark} border bg-${config.muted.results.bg}`]: + //Border + [`@apply border border-${config.color.muted.results.outer.border.light} dark:border-${config.color.muted.results.outer.border.dark}`]: + {}, + //Background + [`@apply bg-${config.color.muted.results.outer.background.light} dark:bg-${config.color.muted.results.outer.background.dark}`]: {}, }, + //Results:inner [`.${prefix}autocomplete-results-item-inner.${prefix}active`]: { - [`@apply bg-${config.muted.resultsInner.bg} dark:bg-${config.muted.resultsInner.bgDark}`]: + [`@apply bg-${config.color.muted.results.inner.background.light} dark:bg-${config.color.muted.results.inner.background.dark}`]: {}, }, }, + //Color:muted contrast [`&.${prefix}autocomplete-muted-contrast`]: { [`.${prefix}autocomplete-input`]: { - [`@apply border bg-${config.mutedContrast.bg} border-${config.mutedContrast.border} text-${config.mutedContrast.text} placeholder:text-${config.mutedContrast.textPlaceholder} dark:border-${config.mutedContrast.borderDark} dark:bg-${config.mutedContrast.bgDark} dark:text-${config.mutedContrast.textDark} dark:placeholder:text-${config.mutedContrast.textPlaceholderDark}`]: + //Text + [`@apply text-${config.color.mutedContrast.base.font.color.light} dark:text-${config.color.mutedContrast.base.font.color.dark}`]: + {}, + //Background + [`@apply bg-${config.color.mutedContrast.base.background.light} dark:bg-${config.color.mutedContrast.base.background.dark}`]: + {}, + //Border + [`@apply border border-${config.color.mutedContrast.base.border.light} dark:border-${config.color.mutedContrast.base.border.dark}`]: + {}, + //Placeholder + [`@apply placeholder:text-${config.color.mutedContrast.base.placeholder.color.light} dark:placeholder:text-${config.color.mutedContrast.base.placeholder.color.dark}`]: {}, }, + //Results [`.${prefix}autocomplete-results`]: { - [`@apply border-${config.mutedContrast.results.border} dark:border-${config.mutedContrast.results.borderDark} dark:bg-${config.mutedContrast.results.bgDark} border bg-${config.mutedContrast.results.bg}`]: + //Border + [`@apply border border-${config.color.mutedContrast.results.outer.border.light} dark:border-${config.color.mutedContrast.results.outer.border.dark}`]: + {}, + //Background + [`@apply bg-${config.color.mutedContrast.results.outer.background.light} dark:bg-${config.color.mutedContrast.results.outer.background.dark}`]: {}, }, + //Results:inner [`.${prefix}autocomplete-results-item-inner.${prefix}active`]: { - [`@apply bg-${config.mutedContrast.resultsInner.bg} dark:bg-${config.mutedContrast.resultsInner.bgDark}`]: + [`@apply bg-${config.color.mutedContrast.results.inner.background.light} dark:bg-${config.color.mutedContrast.results.inner.background.dark}`]: {}, }, }, + //Autocomplete:not loading [`&:not(.${prefix}autocomplete-loading)`]: { [`.${prefix}autocomplete-input:placeholder-shown ~ .${prefix}label-float`]: { - [`@apply text-${config.notLoading.text} dark:text-${config.notLoading.textDark}`]: + [`@apply text-${config.loaded.font.color.light} dark:text-${config.loaded.font.color.dark}`]: {}, }, }, + //Autocomplete:loading [`&.${prefix}autocomplete-loading`]: { [`.${prefix}autocomplete-input`]: { [`@apply !text-transparent placeholder:!text-transparent dark:placeholder:!text-transparent`]: @@ -305,6 +460,7 @@ export default plugin.withOptions( [`@apply opacity-50`]: {}, }, }, + //Autocomplete:label float [`&.${prefix}autocomplete-label-float`]: { [`.${prefix}autocomplete-input`]: { [`@apply placeholder:text-transparent dark:placeholder:text-transparent`]: @@ -315,56 +471,65 @@ export default plugin.withOptions( [`@apply mb-6`]: {}, }, }, + //Autocomplte:input error [`&.${prefix}autocomplete-error`]: { [`.${prefix}autocomplete-input`]: { - [`@apply !border-${config.error.border} dark:!border-${config.error.borderDark}`]: + [`@apply !border-${config.error.input.border.light} dark:!border-${config.error.input.border.dark}`]: {}, }, - + //Input:icon [`.${prefix}autocomplete-icon`]: { - [`@apply !text-${config.error.icon.text}`]: {}, + [`@apply !text-${config.error.icon.color.light} dark:!text-${config.error.icon.color.dark}`]: + {}, }, }, + //Size:sm without icon [`&:not(.${prefix}has-icon).${prefix}autocomplete-sm`]: { [`.${prefix}autocomplete-input`]: { - [`@apply h-8 py-1 text-${config.hasNotIcon.text.sm} leading-4 px-2`]: + [`@apply h-8 py-1 text-${config.icon.disabled.input.sm.font.size} leading-4 px-2`]: {}, }, }, + //Size:sm with icon [`&.${prefix}has-icon.${prefix}autocomplete-sm`]: { [`.${prefix}autocomplete-input`]: { - [`@apply h-8 py-1 text-${config.hasIcon.text.sm} leading-4 pe-3 ps-8`]: + [`@apply h-8 py-1 text-${config.icon.enabled.input.sm.font.size} leading-4 pe-3 ps-8`]: {}, }, }, + //Size:md without icon [`&:not(.${prefix}has-icon).${prefix}autocomplete-md`]: { [`.${prefix}autocomplete-input`]: { - [`@apply h-10 py-2 text-${config.hasNotIcon.text.md} leading-5 px-3`]: + [`@apply h-10 py-2 text-${config.icon.disabled.input.md.font.size} leading-5 px-3`]: {}, }, }, + //Size:md with icon [`&.${prefix}has-icon.${prefix}autocomplete-md`]: { [`.${prefix}autocomplete-input`]: { - [`@apply h-10 py-2 text-${config.hasIcon.text.md} leading-5 pe-4 ps-10`]: + [`@apply h-10 py-2 text-${config.icon.enabled.input.md.font.size} leading-5 pe-4 ps-10`]: {}, }, }, + //Size:lg without icon [`&:not(.${prefix}has-icon).${prefix}autocomplete-lg`]: { [`.${prefix}autocomplete-input`]: { - [`@apply h-12 py-2 text-${config.hasNotIcon.text.lg} leading-5 px-4`]: + [`@apply h-12 py-2 text-${config.icon.disabled.input.lg.font.size} leading-5 px-4`]: {}, }, }, + //Size:lg with icon [`&.${prefix}has-icon.${prefix}autocomplete-lg`]: { [`.${prefix}autocomplete-input`]: { - [`@apply h-12 py-2 text-${config.hasIcon.text.lg} leading-5 pe-4 ps-11`]: + [`@apply h-12 py-2 text-${config.icon.enabled.input.lg.font.size} leading-5 pe-4 ps-11`]: {}, }, }, + //Size:sm without icon and label float [`&.${prefix}autocomplete-label-float:not(.${prefix}has-icon).${prefix}autocomplete-sm`]: { [`.${prefix}label-float`]: { - [`@apply start-3 -ms-3 -mt-7 text-${config.hasNotIcon.labelFloat.sm}`]: + [`@apply start-3 -ms-3 -mt-7 text-${config.icon.disabled.label.float.sm.font.size}`]: {}, }, [`.${prefix}autocomplete-input:focus-visible ~ .${prefix}label-float`]: @@ -376,10 +541,11 @@ export default plugin.withOptions( [`@apply ms-0 mt-0`]: {}, }, }, + //Size:sm with icon and label float [`&.${prefix}autocomplete-label-float.${prefix}has-icon.${prefix}autocomplete-sm`]: { [`.${prefix}label-float`]: { - [`@apply start-8 -ms-8 -mt-7 text-${config.hasIcon.labelFloat.sm}`]: + [`@apply start-8 -ms-8 -mt-7 text-${config.icon.enabled.label.float.sm.font.size}`]: {}, }, @@ -393,73 +559,77 @@ export default plugin.withOptions( [`@apply ms-0 mt-0`]: {}, }, }, + //Size:md without icon and label float [`&.${prefix}autocomplete-label-float:not(.${prefix}has-icon).${prefix}autocomplete-md`]: { [`.${prefix}label-float`]: { - [`@apply start-3 -ms-3 -mt-8 text-${config.hasNotIcon.labelFloat.md.text}`]: + [`@apply start-3 -ms-3 -mt-8 text-${config.icon.disabled.label.float.md.font.size.base}`]: {}, }, [`.${prefix}autocomplete-input:focus-visible ~ .${prefix}label-float`]: { - [`@apply !-ms-3 !-mt-8 !text-${config.hasNotIcon.labelFloat.md.focusVisible.text}`]: + [`@apply !-ms-3 !-mt-8 !text-${config.icon.disabled.label.float.md.font.size.focus}`]: {}, }, [`.${prefix}autocomplete-input:placeholder-shown ~ .${prefix}label-float`]: { - [`@apply ms-0 mt-0 text-${config.hasNotIcon.labelFloat.md.placeholderShown.text}`]: + [`@apply ms-0 mt-0 text-${config.icon.disabled.label.float.md.font.size.unfocus}`]: {}, }, }, + //Size:md with icon and label float [`&.${prefix}autocomplete-label-float.${prefix}has-icon.${prefix}autocomplete-md`]: { [`.${prefix}label-float`]: { - [`@apply start-10 -ms-10 -mt-8 text-${config.hasIcon.labelFloat.md.text}`]: + [`@apply start-10 -ms-10 -mt-8 text-${config.icon.enabled.label.float.md.font.size.base}`]: {}, }, [`.${prefix}autocomplete-input:focus-visible ~ .${prefix}label-float`]: { - [`@apply !-ms-10 !-mt-8 !text-${config.hasIcon.labelFloat.md.focusVisible.text}`]: + [`@apply !-ms-10 !-mt-8 !text-${config.icon.enabled.label.float.md.font.size.focus}`]: {}, }, [`.${prefix}autocomplete-input:placeholder-shown ~ .${prefix}label-float`]: { - [`@apply ms-0 mt-0 text-${config.hasIcon.labelFloat.md.placeholderShown.text}`]: + [`@apply ms-0 mt-0 text-${config.icon.enabled.label.float.md.font.size.unfocus}`]: {}, }, }, + //Size:lg without icon and label float [`&.${prefix}autocomplete-label-float:not(.${prefix}has-icon).${prefix}autocomplete-lg`]: { [`.${prefix}label-float`]: { - [`@apply start-3 -ms-3 -mt-8 text-${config.hasNotIcon.labelFloat.lg.text}`]: + [`@apply start-3 -ms-3 -mt-8 text-${config.icon.disabled.label.float.lg.font.size.base}`]: {}, }, [`.${prefix}autocomplete-input:focus-visible ~ .${prefix}label-float`]: { - [`@apply !-ms-3 !-mt-9 !text-${config.hasNotIcon.labelFloat.lg.focusVisible.text}`]: + [`@apply !-ms-3 !-mt-9 !text-${config.icon.disabled.label.float.lg.font.size.focus}`]: {}, }, [`.${prefix}autocomplete-input:placeholder-shown ~ .${prefix}label-float`]: { - [`@apply ms-0 mt-0 text-${config.hasNotIcon.labelFloat.lg.placeholderShown.text}`]: + [`@apply ms-0 mt-0 text-${config.icon.disabled.label.float.lg.font.size.unfocus}`]: {}, }, }, + //Size:lg with icon and label float [`&.${prefix}autocomplete-label-float.${prefix}has-icon.${prefix}autocomplete-lg`]: { [`.${prefix}label-float`]: { - [`@apply start-11 -ms-10 -mt-8 text-${config.hasIcon.labelFloat.lg.text}`]: + [`@apply start-11 -ms-10 -mt-8 text-${config.icon.enabled.label.float.lg.font.size.base}`]: {}, }, [`.${prefix}autocomplete-input:focus-visible ~ .${prefix}label-float`]: { - [`@apply !-ms-10 !-mt-9 !text-${config.hasIcon.labelFloat.lg.focusVisible.text}`]: + [`@apply !-ms-10 !-mt-9 !text-${config.icon.enabled.label.float.lg.font.size.focus}`]: {}, }, [`.${prefix}autocomplete-input:placeholder-shown ~ .${prefix}label-float`]: { - [`@apply ms-0 mt-0 text-${config.hasIcon.labelFloat.lg.placeholderShown.text}`]: + [`@apply ms-0 mt-0 text-${config.icon.enabled.label.float.lg.font.size.unfocus}`]: {}, }, },