Skip to content

Commit

Permalink
Fix primefaces#5444/primefaces#5443: Tailwind fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Nov 29, 2023
1 parent 50501d1 commit ec66357
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 27 deletions.
34 changes: 15 additions & 19 deletions components/doc/multiselect/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ export function TailwindDoc(props) {
basic: `
const TRANSITIONS = {
overlay: {
enterFromClass: 'opacity-0 scale-75',
enterActiveClass: 'transition-transform transition-opacity duration-150 ease-in',
leaveActiveClass: 'transition-opacity duration-150 ease-linear',
leaveToClass: 'opacity-0'
timeout: 150,
classNames: {
enter: 'opacity-0 scale-75',
enterActive: 'opacity-100 !scale-100 transition-transform transition-opacity duration-150 ease-in',
exit: 'opacity-100',
exitActive: '!opacity-0 transition-opacity duration-150 ease-linear'
}
}
};
Expand All @@ -24,9 +27,8 @@ const Tailwind = {
labelContainer: 'overflow-hidden flex flex-auto cursor-pointer',
label: ({ props }) => ({
className: classNames('block overflow-hidden whitespace-nowrap cursor-pointer overflow-ellipsis', 'text-gray-800 dark:text-white/80', 'p-3 transition duration-200', {
'!p-3': props.display !== 'chip' && (props?.modelValue == null || props?.modelValue == undefined),
'!py-1.5 px-3': props.display == 'chip' && props?.modelValue !== null,
'!p-3': props.display == 'chip' && props?.modelValue == null
'!p-3': props.display !== 'chip' && (props.value == null || props.value == undefined),
'!py-1.5 px-3': props.display === 'chip' && props.value !== null
})
}),
token: {
Expand Down Expand Up @@ -71,18 +73,12 @@ const Tailwind = {
},
list: 'py-3 list-none m-0',
item: ({ context }) => ({
className: classNames(
'cursor-pointer font-normal overflow-hidden relative whitespace-nowrap',
'm-0 p-3 border-0 transition-shadow duration-200 rounded-none',
'dark:text-white/80 dark:hover:bg-gray-800',
'hover:text-gray-700 hover:bg-gray-200',
{
'text-gray-700': !context.focused && !context.selected,
'bg-gray-300 text-gray-700 dark:text-white/80 dark:bg-gray-800/90': context.focused && !context.selected,
'bg-blue-400 text-blue-700 dark:bg-blue-400 dark:text-white/80': context.focused && context.selected,
'bg-blue-50 text-blue-700 dark:bg-blue-300 dark:text-white/80': !context.focused && context.selected
}
)
className: classNames('cursor-pointer font-normal overflow-hidden relative whitespace-nowrap', 'm-0 p-3 border-0 transition-shadow duration-200 rounded-none', {
'text-gray-700 hover:text-gray-700 hover:bg-gray-200 dark:text-white/80 dark:hover:bg-gray-800': !context.focused && !context.selected,
'bg-gray-300 text-gray-700 dark:text-white/80 dark:bg-gray-800/90 hover:text-gray-700 hover:bg-gray-200 dark:text-white/80 dark:hover:bg-gray-800': context.focused && !context.selected,
'bg-blue-100 text-blue-700 dark:bg-blue-400 dark:text-white/80': context.focused && context.selected,
'bg-blue-50 text-blue-700 dark:bg-blue-300 dark:text-white/80': !context.focused && context.selected
})
}),
checkboxContainer: {
className: classNames('inline-flex cursor-pointer select-none align-bottom relative', 'mr-2', 'w-6 h-6')
Expand Down
4 changes: 2 additions & 2 deletions components/doc/rating/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const Tailwind = {
className: classNames(
'inline-flex items-center',
{
'cursor-pointer': !props.readonly,
'cursor-default': props.readonly
'cursor-pointer': !props.readOnly,
'cursor-default': props.readOnly
},
{
'outline-none outline-offset-0 shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]': context.focused
Expand Down
2 changes: 1 addition & 1 deletion components/doc/togglebutton/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Tailwind = {
label: 'font-bold text-center w-full',
icon: ({ props }) => ({
className: classNames(' mr-2', {
'text-gray-600 dark:text-white/70': !props.modelValue,
'text-gray-600 dark:text-white/70': !props.checked,
'text-white': props.checked
})
})
Expand Down
10 changes: 5 additions & 5 deletions components/lib/passthrough/tailwind/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,8 @@ const Tailwind = {
className: classNames(
'inline-flex items-center',
{
'cursor-pointer': !props.readonly,
'cursor-default': props.readonly
'cursor-pointer': !props.readOnly,
'cursor-default': props.readOnly
},
{
'outline-none outline-offset-0 shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]': context.focused
Expand Down Expand Up @@ -1016,7 +1016,7 @@ const Tailwind = {
label: 'font-bold text-center w-full',
icon: ({ props }) => ({
className: classNames(' mr-2', {
'text-gray-600 dark:text-white/70': !props.modelValue,
'text-gray-600 dark:text-white/70': !props.checked,
'text-white': props.checked
})
})
Expand Down Expand Up @@ -1312,8 +1312,8 @@ const Tailwind = {
labelContainer: 'overflow-hidden flex flex-auto cursor-pointer',
label: ({ props }) => ({
className: classNames('block overflow-hidden whitespace-nowrap cursor-pointer overflow-ellipsis', 'text-gray-800 dark:text-white/80', 'p-3 transition duration-200', {
'!p-3': props.display !== 'chip' && (props?.modelValue == null || props?.modelValue == undefined),
'!py-1.5 px-3': props.display === 'chip' && props?.modelValue !== null
'!p-3': props.display !== 'chip' && (props.value == null || props.value == undefined),
'!py-1.5 px-3': props.display === 'chip' && props.value !== null
})
}),
token: {
Expand Down

0 comments on commit ec66357

Please sign in to comment.