diff --git a/.eslintrc.js b/.eslintrc.js index b376a9e..88a409a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -39,8 +39,6 @@ module.exports = { "react/jsx-filename-extension": "off", "react/jsx-props-no-spreading": "off", "react/require-default-props": "off", - "react/react-in-jsx-scope": "off", - "react/jsx-uses-react": "off", "typescript-sort-keys/interface": "error", "typescript-sort-keys/string-enum": "error", "unused-imports/no-unused-imports": "error", diff --git a/src/components/FormBuilder/fields/RadioGroupField.tsx b/src/components/FormBuilder/fields/RadioGroupField.tsx index 6c1e72c..39e0789 100644 --- a/src/components/FormBuilder/fields/RadioGroupField.tsx +++ b/src/components/FormBuilder/fields/RadioGroupField.tsx @@ -1,3 +1,4 @@ +import React from "react"; import { cva } from "class-variance-authority"; import { cn } from "#/lib/utils"; import { @@ -9,11 +10,7 @@ import { FormMessage, } from "#/components/ui/Form"; import { Label } from "#/components/ui/Label"; -import { - RadioGroup, - RadioGroupItem, - RadioGroupItemWithChildren, -} from "#/components/ui/RadioGroup"; +import { RadioGroup, RadioGroupItem } from "#/components/ui/RadioGroup"; import { BaseField, withConditional } from "../fields"; export interface RadioGroupFieldProps extends BaseField { @@ -58,25 +55,25 @@ const RadioGroupWithoutSection = ({ form, field }) => ( - {field.options.map((option, idx) => ( + {field.options.map((option) => ( 1, - })} + className="flex items-center space-x-1 space-y-0" > - - - - {option.label} - - + { + rcfField.onChange( + rcfField.value === option.value ? null : option.value + ); + }} + > + + + {option.label} + ))} diff --git a/src/components/ui/Form.tsx b/src/components/ui/Form.tsx index 03e22bd..7b3e539 100644 --- a/src/components/ui/Form.tsx +++ b/src/components/ui/Form.tsx @@ -215,22 +215,18 @@ const FormLabel = React.forwardRef< >(({ className, tooltip, ...props }, ref) => { const { error, formItemId } = useFormField(); - const label = ( -