PluginProbe
Extendify / 2.2.0
Extendify v2.2.0
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Launch / components / CheckboxInput.jsx

CheckboxInput.jsx in Extendify 2.2.0, at src/Launch/components/CheckboxInput.jsx

57 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import classNames from 'classnames';
2
3 export const CheckboxInput = ({
4 label,
5 slug,
6 description,
7 checked,
8 onChange,
9 locked = false,
10 }) => {
11 return (
12 <label
13 className={classNames('flex items-center px-4 py-3.5', {
14 'focus-within:text-design-main hover:text-design-main': !locked,
15 })}
16 htmlFor={slug}>
17 <span className="relative mr-3 inline-block h-5 w-5 align-middle rtl:ml-3 rtl:mr-0">
18 <input
19 id={slug}
20 className="m-0 h-5 w-5 rounded-sm"
21 style={{
22 '--ext-design-main': locked ? '#BBBBBB' : undefined,
23 }}
24 disabled={locked}
25 type="checkbox"
26 onChange={locked ? undefined : onChange}
27 checked={locked ? true : checked}
28 />
29 <svg
30 className={classNames('absolute inset-0 block h-5 w-5', {
31 'text-white': checked,
32 'text-transparent': !checked,
33 })}
34 viewBox="1 0 20 20"
35 fill="none"
36 xmlns="http://www.w3.org/2000/svg"
37 role="presentation">
38 <path
39 d="M8.72912 13.7449L5.77536 10.7911L4.76953 11.7899L8.72912 15.7495L17.2291 7.24948L16.2304 6.25073L8.72912 13.7449Z"
40 fill="currentColor"
41 />
42 </svg>
43 </span>
44 <span className="flex grow flex-col overflow-hidden">
45 <span className="truncate text-base font-medium leading-tight">
46 {label}
47 </span>
48 {description ? (
49 <span className="block pt-1">{description}</span>
50 ) : (
51 <span />
52 )}
53 </span>
54 </label>
55 );
56 };
57