Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #6093 Fix Tailwind styles in unstyled mode #7124

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,11 @@ export const Calendar = React.memo(
DomHandler.absolutePosition(overlayRef.current, inputRef.current);
}
}

// #6093 Forcibly remove minWidth when in unstyled mode
if (isUnstyled()) {
overlayRef.current.style.minWidth = '';
}
};

const enableModality = () => {
Expand Down
18 changes: 8 additions & 10 deletions components/lib/passthrough/tailwind/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1207,9 +1207,9 @@ const Tailwind = {
})
},
panel: ({ props }) => ({
className: classNames('bg-white dark:bg-gray-900', 'min-w-full', {
className: classNames('bg-white dark:bg-gray-900', 'top-0 left-0 w-auto min-w-min p-2 rounded-lg', {
'shadow-md border-0 absolute': !props.inline,
'inline-block overflow-x-auto border border-gray-300 dark:border-blue-900/40 p-2 rounded-lg': props.inline
'inline-block overflow-x-auto border border-gray-300 dark:border-blue-900/40': props.inline
})
}),
header: {
Expand Down Expand Up @@ -1237,7 +1237,7 @@ const Tailwind = {
)
},
table: {
className: classNames('border-collapse w-full', 'my-2')
className: classNames('border-collapse w-full', 'my-2 mx-0')
},
tableHeaderCell: 'p-2',
weekDay: 'text-gray-600 dark:text-white/70',
Expand All @@ -1252,7 +1252,7 @@ const Tailwind = {
'cursor-pointer': !context.disabled
},
{
'text-gray-600 dark:text-white/70 bg-transprent hover:bg-gray-200 dark:hover:bg-gray-800/80': !context.selected && !context.disabled,
'text-gray-600 dark:text-white/70 bg-transparent hover:bg-gray-200 dark:hover:bg-gray-800/80': !context.selected && !context.disabled,
'text-blue-700 bg-blue-100 hover:bg-blue-200': context.selected && !context.disabled
}
)
Expand All @@ -1263,7 +1263,7 @@ const Tailwind = {
'w-1/3 inline-flex items-center justify-center cursor-pointer overflow-hidden relative',
'p-2 transition-shadow duration-200 rounded-lg',
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]',
{ 'text-gray-600 dark:text-white/70 bg-transprent hover:bg-gray-200 dark:hover:bg-gray-800/80': !context.selected && !context.disabled, 'text-blue-700 bg-blue-100 hover:bg-blue-200': context.selected && !context.disabled }
{ 'text-gray-600 dark:text-white/70 bg-transparent hover:bg-gray-200 dark:hover:bg-gray-800/80': !context.selected && !context.disabled, 'text-blue-700 bg-blue-100 hover:bg-blue-200': context.selected && !context.disabled }
)
}),
yearPicker: {
Expand All @@ -1275,7 +1275,7 @@ const Tailwind = {
'p-2 transition-shadow duration-200 rounded-lg',
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]',
{
'text-gray-600 dark:text-white/70 bg-transprent hover:bg-gray-200 dark:hover:bg-gray-800/80': !context.selected && !context.disabled,
'text-gray-600 dark:text-white/70 bg-transparent hover:bg-gray-200 dark:hover:bg-gray-800/80': !context.selected && !context.disabled,
'text-blue-700 bg-blue-100 hover:bg-blue-200': context.selected && !context.disabled
}
)
Expand All @@ -1302,10 +1302,8 @@ const Tailwind = {
'hover:text-gray-700 dark:hover:text-white/80 hover:border-transparent hover:bg-gray-200 dark:hover:bg-gray-800/80 '
)
},
groupContainer: 'flex',
group: {
className: classNames('flex-1', 'border-l border-gray-300 pr-0.5 pl-0.5 pt-0 pb-0', 'first:pl-0 first:border-l-0')
},
groupContainer: '',
group: '',
transition: TRANSITIONS.overlay
},
listbox: {
Expand Down
Loading