@activecollab/components
Version:
ActiveCollab Components
36 lines • 1.38 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
const _excluded = ["className", "id", "hover"];
import React, { forwardRef } from "react";
import classnames from "classnames";
import { StyledRadioButton, StyledRadioInput, StyledRadioLabel } from "./Styles";
import RadioButtonIcon from "../Icons/collection/RadioButton";
export const RadioButton = /*#__PURE__*/forwardRef((_ref, ref) => {
let {
className = "",
id = "radio",
hover
} = _ref,
props = _objectWithoutPropertiesLoose(_ref, _excluded);
return /*#__PURE__*/React.createElement(StyledRadioButton, {
className: classnames("c-radio-btn", {
"c-radio-btn__hover": hover,
"c-radio-btn__controlled": typeof hover === "boolean"
}, className),
$isHovered: hover,
$isControlled: typeof hover === "boolean"
}, /*#__PURE__*/React.createElement(StyledRadioInput, _extends({
id: id,
className: "c-radio-btn--input",
type: "radio",
ref: ref
}, props)), /*#__PURE__*/React.createElement(StyledRadioLabel, {
htmlFor: id,
className: "c-radio-btn--label"
}, /*#__PURE__*/React.createElement(RadioButtonIcon, {
width: "16",
height: "16"
})));
});
RadioButton.displayName = "RadioButton";
//# sourceMappingURL=RadioButton.js.map