{"version":3,"file":"Checkbox.cjs","names":[],"sources":["../../../../../src/components/Form/Controls/Checkbox/Checkbox.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} from \"react\";\nimport CheckIcon from \"@vector-im/compound-design-tokens/assets/web/icons/check\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport styles from \"./Checkbox.module.css\";\n\ntype Props = {\n  /**\n   * The CSS class name.\n   */\n  className?: string;\n} & Omit<ComponentProps<\"input\">, \"type\">;\n\n/**\n * A styled checkbox input, for standalone use.\n */\nexport const CheckboxInput = forwardRef<HTMLInputElement, Props>(\n  function Checkbox({ className, ...props }, ref) {\n    const classes = classnames(styles.container, className);\n    return (\n      <div className={classes}>\n        <input ref={ref} className={styles.input} {...props} type=\"checkbox\" />\n        <div className={styles.ui}>\n          <CheckIcon aria-hidden={true} />\n        </div>\n      </div>\n    );\n  },\n);\n\n/**\n * A styled checkbox input wrapped in a `Control` component, for use in Radix forms.\n */\nexport const CheckboxControl = forwardRef<\n  ComponentRef<typeof CheckboxInput>,\n  ComponentProps<typeof CheckboxInput>\n>(function CheckboxControl(props, ref) {\n  return (\n    <Control asChild>\n      <CheckboxInput ref={ref} {...props} />\n    </Control>\n  );\n});\n"],"mappings":";;;;;;;;;;;;;;AA8BA,IAAa,iBAAA,GAAA,MAAA,YACX,SAAS,SAAS,EAAE,WAAW,GAAG,SAAS,KAAK;AAE9C,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,YAAA,GAAA,WAAA,SAFoB,wBAAA,QAAO,WAAW,UAAU;YAErD,CACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;GAAY;GAAK,WAAW,wBAAA,QAAO;GAAO,GAAI;GAAO,MAAK;GAAa,CAAA,EACvE,iBAAA,GAAA,kBAAA,KAAC,OAAD;GAAK,WAAW,wBAAA,QAAO;aACrB,iBAAA,GAAA,kBAAA,KAAC,yDAAA,SAAD,EAAW,eAAa,MAAQ,CAAA;GAC5B,CAAA,CACF;;EAGX;;;;AAKD,IAAa,mBAAA,GAAA,MAAA,YAGX,SAAS,gBAAgB,OAAO,KAAK;AACrC,QACE,iBAAA,GAAA,kBAAA,KAAC,qBAAA,SAAD;EAAS,SAAA;YACP,iBAAA,GAAA,kBAAA,KAAC,eAAD;GAAoB;GAAK,GAAI;GAAS,CAAA;EAC9B,CAAA;EAEZ"}