1212// limitations under the License.
1313
1414import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox' ;
15- import clsx from 'clsx' ;
15+ import { clsx } from 'clsx' ;
1616import type { CSSProperties , HTMLAttributes , ReactNode , Ref } from 'react' ;
1717import { forwardRef , useCallback } from 'react' ;
1818
@@ -28,11 +28,14 @@ import {
2828 spacingProps ,
2929} from '../system' ;
3030import type { ColorVariant , Size , Status } from '../types' ;
31+ import { CheckboxMark , CheckboxVisual } from './CheckboxVisual' ;
3132
33+ // oxlint-disable-next-line import/no-unassigned-import -- This import intentionally registers shared layout styles.
3234import '../system/layout.css' ;
35+ // oxlint-disable-next-line import/no-unassigned-import -- This import intentionally registers shared radius styles.
3336import '../system/radius.css' ;
37+ // oxlint-disable-next-line import/no-unassigned-import -- This import intentionally registers shared spacing styles.
3438import '../system/spacing.css' ;
35- import './checkbox.css' ;
3639
3740export type CheckboxLabelPosition = 'start' | 'end' ;
3841export type CheckboxVariant = 'subtle' | 'solid' | 'outline' ;
@@ -162,6 +165,7 @@ export const Checkbox = forwardRef<HTMLElement, CheckboxProps>(function Checkbox
162165 const control = (
163166 < BaseCheckbox . Root
164167 { ...domProps }
168+ render = { < CheckboxVisual /> }
165169 ref = { ref }
166170 id = { id }
167171 checked = { checked }
@@ -177,7 +181,7 @@ export const Checkbox = forwardRef<HTMLElement, CheckboxProps>(function Checkbox
177181 uncheckedValue = { uncheckedValue }
178182 form = { form }
179183 inputRef = { inputRef }
180- className = { clsx ( 'ps-Checkbox' , radiusClassName , ! hasLabel && callerClassName , slotProps ?. control ?. className ) }
184+ className = { clsx ( radiusClassName , ! hasLabel && callerClassName , slotProps ?. control ?. className ) }
181185 style = { controlStyle }
182186 data-invalid = { invalid ? '' : undefined }
183187 data-size = { size }
@@ -188,7 +192,7 @@ export const Checkbox = forwardRef<HTMLElement, CheckboxProps>(function Checkbox
188192 className = { clsx ( 'ps-Checkbox__indicator' , slotProps ?. indicator ?. className ) }
189193 style = { slotProps ?. indicator ?. style }
190194 >
191- < span className = "ps-Checkbox__mark" aria-hidden = "true" />
195+ < CheckboxMark />
192196 </ BaseCheckbox . Indicator >
193197 </ BaseCheckbox . Root >
194198 ) ;
0 commit comments