From 5df484718ac6adf780c6a2bcba0574ffe2ec07b6 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Fri, 12 Dec 2025 12:51:37 +1000 Subject: [PATCH] fix(ui): fix checkbox tick not visible in light/dark mode The checkmark SVG was nested inside a span, making peer-checked selectors ineffective since peer only works on siblings. Fix by moving the checkmark and indeterminate SVGs to be direct siblings of the hidden input element, allowing Tailwind's peer-checked and peer-data-[indeterminate] selectors to properly toggle visibility. --- packages/ui/src/Checkbox/Checkbox.tsx | 82 ++++++++++++++------------- packages/ui/src/Checkbox/variants.ts | 8 +-- 2 files changed, 47 insertions(+), 43 deletions(-) diff --git a/packages/ui/src/Checkbox/Checkbox.tsx b/packages/ui/src/Checkbox/Checkbox.tsx index daef4df..844512f 100644 --- a/packages/ui/src/Checkbox/Checkbox.tsx +++ b/packages/ui/src/Checkbox/Checkbox.tsx @@ -1,13 +1,7 @@ import { cn } from '@tpmjs/utils/cn'; import { forwardRef, useEffect, useRef } from 'react'; import type { CheckboxProps } from './types'; -import { - checkboxLabelVariants, - checkboxUIVariants, - checkboxVariants, - checkmarkVariants, - indeterminateVariants, -} from './variants'; +import { checkboxLabelVariants, checkboxUIVariants, checkboxVariants } from './variants'; /** * Checkbox component @@ -93,37 +87,8 @@ export const Checkbox = forwardRef( /> ); - const checkboxUI = ( - - {/* Checkmark icon */} - - - {/* Indeterminate line */} - - - ); + // Visual checkbox box (background, border, etc.) - no icons inside + const checkboxUI = ; const labelElement = label ? (