diff --git a/.changeset/short-starfishes-sell.md b/.changeset/short-starfishes-sell.md new file mode 100644 index 0000000000..dd4165c256 --- /dev/null +++ b/.changeset/short-starfishes-sell.md @@ -0,0 +1,7 @@ +--- +'@toptal/picasso-checkbox': patch +'@toptal/picasso-radio': patch +'@toptal/picasso-form': patch +--- + +- migrate styles of FormControlLabel to TailwindCSS diff --git a/packages/base/Checkbox/src/Checkbox/Checkbox.tsx b/packages/base/Checkbox/src/Checkbox/Checkbox.tsx index 7965690691..8b584e4a79 100644 --- a/packages/base/Checkbox/src/Checkbox/Checkbox.tsx +++ b/packages/base/Checkbox/src/Checkbox/Checkbox.tsx @@ -12,6 +12,7 @@ import React, { forwardRef } from 'react' import { Container } from '@toptal/picasso-container' import { FormControlLabel } from '@toptal/picasso-form' import type { RequiredDecoration } from '@toptal/picasso-form' +import { twJoin } from '@toptal/picasso-tailwind-merge' import styles from './styles' @@ -111,8 +112,11 @@ export const Checkbox = forwardRef( style={labelStyle} ref={ref as React.ForwardedRef} classes={{ - ...rootClasses, - label: classes.label, + label: twJoin( + 'max-w-[calc(100%_-_1.5em_+_1px)]', + 'ml-[0.5em]', + disabled && 'text-gray-500' + ), }} control={muiCheckbox} requiredDecoration={requiredDecoration} diff --git a/packages/base/Checkbox/src/Checkbox/__snapshots__/test.tsx.snap b/packages/base/Checkbox/src/Checkbox/__snapshots__/test.tsx.snap index 02ae772b82..fbcf30cfd1 100644 --- a/packages/base/Checkbox/src/Checkbox/__snapshots__/test.tsx.snap +++ b/packages/base/Checkbox/src/Checkbox/__snapshots__/test.tsx.snap @@ -15,7 +15,7 @@ exports[`Checkbox Checkbox.Group renders checkbox in a grid group 1`] = ` class="box-border m-0 p-[8px] sm:basis-4/12 sm:max-w leading-none pt-0 pb-0 [&>.picasso-checkbox]:mb-[0.5em]" >