diff --git a/package-lock.json b/package-lock.json index 2ef76d0..bafac59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,8 +7,10 @@ "dependencies": { "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-radio-group": "^1.1.3", + "clsx": "^2.1.1", "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "tailwind-merge": "^2.3.0" }, "devDependencies": { "autoprefixer": "^10.4.19", @@ -1408,6 +1410,14 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "engines": { + "node": ">=6" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2692,6 +2702,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tailwind-merge": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.3.0.tgz", + "integrity": "sha512-vkYrLpIP+lgR0tQCG6AP7zZXCTLc1Lnv/CCRT3BqJ9CZ3ui2++GPaGb1x/ILsINIMSYqqvrpqjUFsMNLlW99EA==", + "dependencies": { + "@babel/runtime": "^7.24.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, "node_modules/tailwindcss": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz", diff --git a/package.json b/package.json index 6f88630..9e3ebc2 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,10 @@ "dependencies": { "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-radio-group": "^1.1.3", + "clsx": "^2.1.1", "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "tailwind-merge": "^2.3.0" }, "devDependencies": { "autoprefixer": "^10.4.19", diff --git a/src/app.jsx b/src/app.jsx index 64a9069..ba4c0f8 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -1,38 +1,31 @@ +import { useState } from "react"; 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"; + +import { Button } from "./components/button"; +import { Input } from "./components/input"; 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 (