UNPKG

@intility/bifrost-react

Version:

React library for Intility's design system, Bifrost.

89 lines 1.91 kB
import { c as _c } from "react-compiler-runtime"; import { forwardRef } from "react"; import classnames from "classnames"; import ExpandIcon from "../internal/ExpandIcon/ExpandIcon.internal.js"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /** * Button with a rotatable angle icon */ const ButtonExpand = /*#__PURE__*/forwardRef((t0, ref) => { const $ = _c(19); let children; let className; let iconProps; let open; let props; if ($[0] !== t0) { ({ children, className, open, iconProps, ...props } = t0); $[0] = t0; $[1] = children; $[2] = className; $[3] = iconProps; $[4] = open; $[5] = props; } else { children = $[1]; className = $[2]; iconProps = $[3]; open = $[4]; props = $[5]; } let t1; if ($[6] !== className) { t1 = classnames("bf-button-expand bf-neutral-link", className); $[6] = className; $[7] = t1; } else { t1 = $[7]; } let t2; if ($[8] !== iconProps || $[9] !== open) { t2 = /*#__PURE__*/_jsx(ExpandIcon, { open: open, iconProps: iconProps }); $[8] = iconProps; $[9] = open; $[10] = t2; } else { t2 = $[10]; } let t3; if ($[11] !== children) { t3 = children && /*#__PURE__*/_jsx("span", { className: "bf-neutral-link-text", children: children }); $[11] = children; $[12] = t3; } else { t3 = $[12]; } let t4; if ($[13] !== props || $[14] !== ref || $[15] !== t1 || $[16] !== t2 || $[17] !== t3) { t4 = /*#__PURE__*/_jsxs("button", { type: "button", ...props, ref: ref, className: t1, children: [t2, t3] }); $[13] = props; $[14] = ref; $[15] = t1; $[16] = t2; $[17] = t3; $[18] = t4; } else { t4 = $[18]; } return t4; }); ButtonExpand.displayName = "Button.Expand"; export default ButtonExpand;