{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "rating-input-field", "type": "registry:component", "title": "Rating Input Field", "description": "Field component for star rating inputs with validation and error handling", "dependencies": [ "react", "@registry/react" ], "registryDependencies": [ "https://components.thgaltitude.com/r/react/field-wrapper", "https://components.thgaltitude.com/r/react/rating-input" ], "files": [ { "path": "registry/react/component/fields/rating-input-field.tsx", "content": "import React from \"react\";\nimport type { InputHTMLAttributes } from \"react\";\nimport RatingInput from \"@registry/react/ui/rating-input\";\nimport FieldWrapper from \"@registry/react/component/field-wrapper\";\nimport type { FieldProps } from \"@registry/react/component/field-wrapper\";\n\n// Define the specific props for RatingInput\ntype RatingInputSpecificProps = {\n numberOfOptions?: number;\n defaultValue?: number | null;\n value?: number | null;\n onChange?: (value: number | null) => void;\n};\n\n// Combine FieldProps with RatingInput specific props\ninterface RatingInputFieldProps\n extends FieldProps,\n RatingInputSpecificProps,\n Omit<\n InputHTMLAttributes,\n | \"id\"\n | \"name\"\n | \"disabled\"\n | \"required\"\n | \"aria-invalid\"\n | \"onChange\"\n | \"value\"\n | \"defaultValue\"\n > {}\n\nconst RatingInputField: React.FC = ({\n id,\n name,\n label,\n helperText,\n errorMessage,\n required = false,\n \"aria-invalid\": ariaInvalid = false,\n disabled = false,\n numberOfOptions = 5,\n defaultValue,\n value,\n onChange,\n ...restProps\n}) => {\n return (\n
\n \n \n \n
\n );\n};\n\nexport default RatingInputField;\n", "type": "registry:component", "target": "react/component/fields/rating-input-field.tsx" } ] }