UNPKG

@hypothesis/frontend-shared

Version:

Shared components, styles and utilities for Hypothesis projects

31 lines 1.1 kB
var _jsxFileName = "/home/runner/work/frontend-shared/frontend-shared/src/components/input/RadioButton.tsx"; import { RadioCheckedIcon, RadioIcon } from '../icons'; import ToggleInput from './ToggleInput'; import { jsxDEV as _jsxDEV } from "preact/jsx-dev-runtime"; /** * Render a labeled radio input. The radio is styled with two icons: one for the * unchecked state and one for the checked state. The input itself is positioned * exactly on top of the icon, but is non-visible. * * Note: * This component was created with the intention to make it the foundation for * RadioGroup, but we finally found it easier to implement something from scratch. * If we don't find a use case for this component, we'll remove it eventually. */ export default function RadioButton({ icon = RadioIcon, checkedIcon = RadioCheckedIcon, ...rest }) { return _jsxDEV(ToggleInput, { icon: icon, checkedIcon: checkedIcon, type: "radio", ...rest }, void 0, false, { fileName: _jsxFileName, lineNumber: 43, columnNumber: 5 }, this); } //# sourceMappingURL=RadioButton.js.map