{"version":3,"file":"Radio.cjs","names":[],"sources":["../../../../../src/components/Form/Controls/Radio/Radio.tsx"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, {\n  type ComponentProps,\n  type ComponentRef,\n  forwardRef,\n  type PropsWithChildren,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport styles from \"./Radio.module.css\";\n\ntype RadioProps = {\n  /**\n   * The CSS class name.\n   */\n  className?: string;\n} & Omit<React.ComponentPropsWithoutRef<\"input\">, \"type\">;\n\n/**\n * A radio component.\n */\nexport const RadioInput = forwardRef<\n  HTMLInputElement,\n  PropsWithChildren<RadioProps>\n>(function Radio({ className, ...props }, ref) {\n  const classes = classnames(styles.container, className);\n  return (\n    <div className={classes}>\n      <input ref={ref} {...props} className={styles.input} type=\"radio\" />\n      <div className={styles.ui} />\n    </div>\n  );\n});\n\nexport const RadioControl = forwardRef<\n  ComponentRef<typeof RadioInput>,\n  ComponentProps<typeof RadioInput>\n>(function RadioControl(props, ref) {\n  return (\n    <Control asChild>\n      <RadioInput ref={ref} {...props} />\n    </Control>\n  );\n});\n"],"mappings":";;;;;;;;;;;;AA8BA,IAAa,cAAA,GAAA,MAAA,YAGX,SAAS,MAAM,EAAE,WAAW,GAAG,SAAS,KAAK;AAE7C,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,YAAA,GAAA,WAAA,SAFoB,qBAAA,QAAO,WAAW,UAAU;YAErD,CACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;GAAY;GAAK,GAAI;GAAO,WAAW,qBAAA,QAAO;GAAO,MAAK;GAAU,CAAA,EACpE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAW,qBAAA,QAAO,IAAM,CAAA,CACzB;;EAER;AAEF,IAAa,gBAAA,GAAA,MAAA,YAGX,SAAS,aAAa,OAAO,KAAK;AAClC,QACE,iBAAA,GAAA,kBAAA,KAAC,qBAAA,SAAD;EAAS,SAAA;YACP,iBAAA,GAAA,kBAAA,KAAC,YAAD;GAAiB;GAAK,GAAI;GAAS,CAAA;EAC3B,CAAA;EAEZ"}