From 94000aab200d62b20587ea1f6c4d80e26f6f001f Mon Sep 17 00:00:00 2001 From: Corban Riley Date: Wed, 10 Apr 2024 20:17:36 -0400 Subject: [PATCH] Fixing Checkbox --- src/components/Checkbox/Checkbox.tsx | 15 +++++---------- src/components/Checkbox/styles.css.ts | 23 ++++++++--------------- src/components/RadioGroup/styles.css.ts | 1 + 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/components/Checkbox/Checkbox.tsx b/src/components/Checkbox/Checkbox.tsx index 2c43298c5..03ab52d21 100644 --- a/src/components/Checkbox/Checkbox.tsx +++ b/src/components/Checkbox/Checkbox.tsx @@ -4,12 +4,7 @@ import { forwardRef, Ref } from 'react' import { Field, FieldProps } from '~/components/Field' import { CheckmarkIcon } from '~/icons' -import { - checkboxVariants, - CheckboxVariants, - indicatorVariants, - IndicatorVariants, -} from './styles.css' +import { checkboxVariants, CheckboxVariants, indicator } from './styles.css' export type CheckboxProps = FieldProps & CheckboxVariants & @@ -18,11 +13,11 @@ export type CheckboxProps = FieldProps & id?: string } -type IndicatorProps = IndicatorVariants & {} +type IndicatorProps = CheckboxVariants & {} const Indicator = ({ size = 'sm' }: IndicatorProps) => ( - - + + ) @@ -55,7 +50,7 @@ export const Checkbox = forwardRef( ref={ref} {...rest} > - + ) diff --git a/src/components/Checkbox/styles.css.ts b/src/components/Checkbox/styles.css.ts index beff9f118..5ed6ac063 100644 --- a/src/components/Checkbox/styles.css.ts +++ b/src/components/Checkbox/styles.css.ts @@ -11,6 +11,7 @@ export const checkboxVariants = recipe({ borderWidth: 'thin', borderStyle: 'solid', borderColor: 'borderFocus', + background: 'transparent', opacity: { base: '100', hover: '80', @@ -32,19 +33,11 @@ export const checkboxVariants = recipe({ export type CheckboxVariants = RecipeVariants -export const indicatorVariants = recipe({ - base: atoms({ - color: 'text100', - background: 'text50', - borderRadius: 'xs', - }), - - variants: { - size: { - sm: [{ height: 20, width: 20 }], - lg: [{ height: 28, width: 28 }], - }, - }, +export const indicator = atoms({ + color: 'text100', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + width: 'full', + height: 'full', }) - -export type IndicatorVariants = RecipeVariants diff --git a/src/components/RadioGroup/styles.css.ts b/src/components/RadioGroup/styles.css.ts index 95942d967..eb901c77c 100644 --- a/src/components/RadioGroup/styles.css.ts +++ b/src/components/RadioGroup/styles.css.ts @@ -15,6 +15,7 @@ export const radioItemVariants = recipe({ disabled: 'default', }, opacity: { + hover: '80', disabled: '50', }, }),