PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.6.1
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.6.1
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / team-updraft / lib-onboarding-wizard / Wizard / Onboarding / src / components / Fields / CheckboxInput.tsx

CheckboxInput.tsx in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 4.6.1, at vendor/team-updraft/lib-onboarding-wizard/Wizard/Onboarding/src/components/Fields/CheckboxInput.tsx

47 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {memo} from "@wordpress/element";
2 import Icon from "../../utils/Icon";
3 import * as Checkbox from '@radix-ui/react-checkbox';
4
5 interface CheckboxInputProps {
6 label: string;
7 value: boolean;
8 id: string;
9 onChange: (value: boolean) => void;
10 required?: boolean;
11 disabled?: boolean;
12 }
13
14 const CheckboxInput = ({
15 label,
16 value,
17 id,
18 onChange,
19 disabled,
20 }:CheckboxInputProps) => {
21 return (
22 <Checkbox.Root
23 className={`flex-shrink-0 ${disabled ? "opacity-50 pointer-events-none" : ""}`}
24 id={id}
25 checked={!!value}
26 aria-label={label}
27 disabled={disabled}
28 onCheckedChange={onChange}
29 >
30 {!value && <Icon
31 name="checkbox-rounded-outline"
32 fill="#B7BABD"
33 size={25}
34 strokeWidth={3}
35 />}
36 <Checkbox.Indicator className="flex items-center justify-center">
37 <Icon
38 name="checkbox-rounded"
39 size={25}
40 strokeWidth={3}
41 />
42 </Checkbox.Indicator>
43 </Checkbox.Root>
44 );
45 };
46
47 export default memo(CheckboxInput);