diff --git a/packages/ui/src/form-fields/checkbox.tsx b/packages/ui/src/form-fields/checkbox.tsx index 887bc6074..f41bece26 100644 --- a/packages/ui/src/form-fields/checkbox.tsx +++ b/packages/ui/src/form-fields/checkbox.tsx @@ -3,15 +3,26 @@ import * as React from "react"; import { cn } from "../../helpers"; export interface CheckboxProps extends React.InputHTMLAttributes { - intermediate?: boolean; - className?: string; + containerClassName?: string; + iconClassName?: string; + indeterminate?: boolean; } const Checkbox = React.forwardRef((props, ref) => { - const { id, name, checked, intermediate = false, disabled, className = "", ...rest } = props; + const { + id, + name, + checked, + indeterminate = false, + disabled, + containerClassName, + iconClassName, + className, + ...rest + } = props; return ( -
+
((props, ref) name={name} checked={checked} className={cn( - "appearance-none shrink-0 w-4 h-4 border rounded-[3px] focus:outline-1 focus:outline-offset-4 focus:outline-custom-primary-50", + "appearance-none shrink-0 size-4 border rounded-[3px] focus:outline-1 focus:outline-offset-4 focus:outline-custom-primary-50 cursor-pointer", { "border-custom-border-200 bg-custom-background-80 cursor-not-allowed": disabled, - "cursor-pointer border-custom-border-300 hover:border-custom-border-400 bg-white": !disabled, - "border-custom-primary-40 bg-custom-primary-100 hover:bg-custom-primary-200": - !disabled && (checked || intermediate), - } + "border-custom-border-300 hover:border-custom-border-400 bg-transparent": !disabled, + "border-custom-primary-40 hover:border-custom-primary-40 bg-custom-primary-100 hover:bg-custom-primary-200": + !disabled && (checked || indeterminate), + }, + className )} disabled={disabled} {...rest} /> = (props) => control={control} name="property_change" render={({ field: { value, onChange } }) => ( - onChange(!value)} className="mx-2" /> + onChange(!value)} containerClassName="mx-2" /> )} />
@@ -99,12 +99,12 @@ export const EmailNotificationForm: FC = (props) => render={({ field: { value, onChange } }) => ( { setValue("issue_completed", !value, { shouldDirty: true }); onChange(!value); }} - className="mx-2" + containerClassName="mx-2" /> )} /> @@ -120,7 +120,7 @@ export const EmailNotificationForm: FC = (props) => control={control} name="issue_completed" render={({ field: { value, onChange } }) => ( - onChange(!value)} className="mx-2" /> + onChange(!value)} containerClassName="mx-2" /> )} />
@@ -137,7 +137,7 @@ export const EmailNotificationForm: FC = (props) => control={control} name="comment" render={({ field: { value, onChange } }) => ( - onChange(!value)} className="mx-2" /> + onChange(!value)} containerClassName="mx-2" /> )} /> @@ -154,7 +154,7 @@ export const EmailNotificationForm: FC = (props) => control={control} name="mention" render={({ field: { value, onChange } }) => ( - onChange(!value)} className="mx-2" /> + onChange(!value)} containerClassName="mx-2" /> )} />