diff --git a/assets/icon-checkbox-checked.svg b/assets/icon-checkbox-checked.svg new file mode 100644 index 0000000..f3e969b --- /dev/null +++ b/assets/icon-checkbox-checked.svg @@ -0,0 +1,3 @@ + diff --git a/assets/icon-checkbox-unchecked.svg b/assets/icon-checkbox-unchecked.svg new file mode 100644 index 0000000..d21f62a --- /dev/null +++ b/assets/icon-checkbox-unchecked.svg @@ -0,0 +1,3 @@ + diff --git a/package-lock.json b/package-lock.json index 1ecc9a2..2ef76d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "dependencies": { + "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-radio-group": "^1.1.3", "react": "^18.3.1", "react-dom": "^18.3.1" @@ -528,6 +529,36 @@ "@babel/runtime": "^7.13.10" } }, + "node_modules/@radix-ui/react-checkbox": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.0.4.tgz", + "integrity": "sha512-CBuGQa52aAYnADZVt/KBQzXrwx6TqnlwtcIPGtVt5JkkzQwMOLJjPukimhfKEr4GQNd43C+djUh5Ikopj8pSLg==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.1", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-context": "1.0.1", + "@radix-ui/react-presence": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-use-controllable-state": "1.0.1", + "@radix-ui/react-use-previous": "1.0.1", + "@radix-ui/react-use-size": "1.0.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-collection": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.0.3.tgz", diff --git a/package.json b/package.json index b359c8d..6f88630 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "build": "vite build" }, "dependencies": { + "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-radio-group": "^1.1.3", "react": "^18.3.1", "react-dom": "^18.3.1" diff --git a/src/app.jsx b/src/app.jsx index 38e84c9..64a9069 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -1,6 +1,20 @@ import * as RadioGroup from "@radix-ui/react-radio-group"; +import * as Checkbox from "@radix-ui/react-checkbox"; + +import icon_checkbox_checked from "../assets/icon-checkbox-checked.svg"; +import icon_checkbox_unchecked from "../assets/icon-checkbox-unchecked.svg"; +import { useState } from "react"; const InputField = ({ label, type = "text", required = false, ...props }) => { + const inputProps = { + className: + "block w-full cursor-pointer rounded-lg border-[1px] border-grey-500 px-300 py-150 text-body-md focus:border-green-600 group-hover:border-green-600", + name: label.toLowerCase().replace(/ /g, "_"), + required: required, + autoComplete: "off", + ...props, + }; + return ( ); }; export default () => { + const [checkbox, setCheckbox] = useState(false); + return (