Skip to content

Commit cd8e212

Browse files
G3rootpumfleet
andauthored
fix: check box (#8328)
Co-authored-by: Bailey Pumfleet <[email protected]>
1 parent 9dd36bd commit cd8e212

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

packages/features/form-builder/Components.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ import type {
99
import { classNames } from "@calcom/lib";
1010
import { useLocale } from "@calcom/lib/hooks/useLocale";
1111
import type { BookingFieldType } from "@calcom/prisma/zod-utils";
12-
import { PhoneInput, AddressInput, Button, Label, Group, RadioField, EmailField, Tooltip } from "@calcom/ui";
12+
import {
13+
PhoneInput,
14+
AddressInput,
15+
Button,
16+
Label,
17+
Group,
18+
RadioField,
19+
EmailField,
20+
Tooltip,
21+
Checkbox,
22+
} from "@calcom/ui";
1323
import { UserPlus, X } from "@calcom/ui/components/icon";
1424

1525
import { ComponentForField } from "./FormBuilder";
@@ -364,21 +374,19 @@ export const Components: Record<BookingFieldType, Component> = {
364374
factory: ({ readOnly, label, value, setValue }) => {
365375
return (
366376
<div className="flex">
367-
<input
368-
type="checkbox"
377+
<Checkbox
369378
onChange={(e) => {
370379
if (e.target.checked) {
371380
setValue(true);
372381
} else {
373382
setValue(false);
374383
}
375384
}}
376-
className="border-default disabled:bg-emphasis disabled:dark:text-subtle text-emphasis h-4 w-4 rounded focus:ring-black ltr:mr-2 rtl:ml-2"
377385
placeholder=""
378386
checked={value}
379387
disabled={readOnly}
388+
description={label ?? ""}
380389
/>
381-
<Label className="text-emphasis -mt-px block text-sm font-medium">{label}</Label>
382390
</div>
383391
);
384392
},

packages/ui/components/form/checkbox/Checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const CheckboxField = forwardRef<HTMLInputElement, Props>(
5353
type="checkbox"
5454
disabled={disabled}
5555
className={classNames(
56-
"text-primary-600 focus:ring-primary-500 border-default h-4 w-4 rounded ltr:mr-2 rtl:ml-2 ",
56+
"text-primary-600 focus:ring-primary-500 border-default bg-default h-4 w-4 rounded ltr:mr-2 rtl:ml-2",
5757
!error && disabled
5858
? "bg-gray-300 checked:bg-gray-300"
5959
: "hover:bg-subtle checked:bg-gray-800",

0 commit comments

Comments
 (0)