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

fix: #6405 Fix Tailwind theme for TriStateCheckbox #6406

Merged
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
8 changes: 6 additions & 2 deletions components/doc/tristatecheckbox/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const Tailwind = {
root: {
className: classNames('cursor-pointer inline-flex relative select-none align-bottom', 'w-6 h-6')
},
checkbox: ({ props }) => ({
input: {
className: classNames('absolute appearance-none top-0 left-0 size-full p-0 m-0 opacity-0 z-10 outline-none cursor-pointer')
},
box: ({ props }) => ({
className: classNames(
'flex items-center justify-center',
'border-2 w-6 h-6 rounded-lg transition-colors duration-200',
Expand All @@ -23,7 +26,8 @@ const Tailwind = {
'cursor-default opacity-60': props.disabled
}
)
})
}),
icon: 'w-4 h-4 transition-all duration-200 text-white text-base dark:text-gray-900'
}
}
`
Expand Down
8 changes: 6 additions & 2 deletions components/lib/passthrough/tailwind/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,10 @@ const Tailwind = {
root: {
className: classNames('cursor-pointer inline-flex relative select-none align-bottom', 'w-6 h-6')
},
checkbox: ({ props }) => ({
input: {
className: classNames('absolute appearance-none top-0 left-0 size-full p-0 m-0 opacity-0 z-10 outline-none cursor-pointer')
},
box: ({ props }) => ({
className: classNames(
'flex items-center justify-center',
'border-2 w-6 h-6 rounded-lg transition-colors duration-200',
Expand All @@ -1045,7 +1048,8 @@ const Tailwind = {
'cursor-default opacity-60': props.disabled
}
)
})
}),
icon: 'w-4 h-4 transition-all duration-200 text-white text-base dark:text-gray-900'
},
checkbox: {
root: {
Expand Down
25 changes: 14 additions & 11 deletions components/lib/tristatecheckbox/TriStateCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,20 @@ export const TriStateCheckbox = React.memo(
ptm('root')
);

const inputProps = mergeProps({
id: props.inputId,
className: cx('input'),
type: 'checkbox',
'aria-invalid': props.invalid,
disabled: props.disabled,
readOnly: props.readOnly,
value: props.value,
checked: props.value,
onChange: onChange
});
const inputProps = mergeProps(
{
id: props.inputId,
className: cx('input'),
type: 'checkbox',
'aria-invalid': props.invalid,
disabled: props.disabled,
readOnly: props.readOnly,
value: props.value,
checked: props.value,
onChange: onChange
},
ptm('input')
);

return (
<>
Expand Down
Loading