UNPKG

@intility/bifrost-react

Version:

React library for Intility's design system, Bifrost.

66 lines (65 loc) 2.37 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { faCircle } from "@fortawesome/free-regular-svg-icons/faCircle"; import { faSquare } from "@fortawesome/free-regular-svg-icons/faSquare"; import { faSquareCheck } from "@fortawesome/free-solid-svg-icons/faSquareCheck"; import { faCircleDot } from "@fortawesome/free-solid-svg-icons/faCircleDot"; import { faCheck } from "@fortawesome/free-solid-svg-icons/faCheck"; import bfIndeterminate from "../../assets/bfIndeterminate.js"; import Icon from "../Icon/Icon.js"; const CheckboxIcon = ({ type, indeterminate })=>{ if (indeterminate) { return /*#__PURE__*/ _jsx("span", { className: "bf-checkbox-icon", children: /*#__PURE__*/ _jsx(Icon, { className: "bf-checkbox-indeterminate", icon: bfIndeterminate }) }); } if (type === "switch") { return /*#__PURE__*/ _jsx("span", { className: "bf-switch", children: /*#__PURE__*/ _jsxs("span", { className: "bf-switch-thumb", children: [ /*#__PURE__*/ _jsx(Icon, { className: "bf-checkbox-checked", icon: faCheck }), /*#__PURE__*/ _jsx("span", { className: "bf-checkbox-unchecked" }) ] }) }); } if (type === "radio") { return /*#__PURE__*/ _jsxs("span", { className: "bf-checkbox-icon", children: [ /*#__PURE__*/ _jsx(Icon, { className: "bf-checkbox-checked", icon: faCircleDot }), /*#__PURE__*/ _jsx(Icon, { className: "bf-checkbox-unchecked", icon: faCircle }) ] }); } return /*#__PURE__*/ _jsxs("span", { className: "bf-checkbox-icon", children: [ /*#__PURE__*/ _jsx(Icon, { className: "bf-checkbox-checked", icon: faSquareCheck }), /*#__PURE__*/ _jsx(Icon, { className: "bf-checkbox-unchecked", icon: faSquare }) ] }); }; export default CheckboxIcon;