{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "jsonforms-time-control",
  "description": "JSONForms time input renderer.",
  "dependencies": [
    "@jsonforms/core",
    "@jsonforms/react"
  ],
  "registryDependencies": [
    "https://mksingh.dev/r/typography.json",
    "input"
  ],
  "files": [
    {
      "path": "registry/forms/renderers/time-control.tsx",
      "content": "import { useState } from 'react';\n\nimport { ControlProps, isTimeControl, rankWith } from '@jsonforms/core';\nimport { withJsonFormsControlProps } from '@jsonforms/react';\n\nimport Typography from '~/components/ui/typography';\nimport { Input } from '~/components/ui/input';\nimport { Label } from '~/components/ui/label';\nimport { shouldShowError } from '~/components/forms/utils';\n\nconst TimeControlRenderer = (props: ControlProps) => {\n    const { label, data, handleChange, path, visible, enabled, errors, config } = props;\n    const [touched, setTouched] = useState(false);\n\n    if (!visible) return null;\n\n    return (\n        <div className=\"flex flex-col gap-1 py-2\">\n            {label && <Label className=\"text-xs font-medium text-foreground\">{label}</Label>}\n            <Input\n                type=\"time\"\n                value={data ?? ''}\n                onChange={e => handleChange(path, e.target.value)}\n                onBlur={() => setTouched(true)}\n                disabled={!enabled}\n            />\n            {shouldShowError(config, touched) && errors && <Typography variant=\"error\">{errors.split(\"\\n\")[0]}</Typography>}\n        </div>\n    );\n};\n\nexport const timeControlTester = rankWith(11, isTimeControl);\nexport default withJsonFormsControlProps(TimeControlRenderer);\n",
      "type": "registry:component",
      "target": "components/forms/renderers/time-control.tsx"
    }
  ],
  "type": "registry:component"
}