UNPKG

@intility/bifrost-react

Version:

React library for Intility's design system, Bifrost.

116 lines 2.81 kB
import { c as _c } from "react-compiler-runtime"; import { forwardRef } from "react"; import classnames from "classnames"; import { jsx as _jsx } from "react/jsx-runtime"; const Button = /*#__PURE__*/forwardRef((t0, ref) => { const $ = _c(29); let children; let className; let props; let t1; let t2; let t3; let t4; let t5; let t6; let t7; if ($[0] !== t0) { ({ children, variant: t1, state: t2, className, small: t3, active: t4, pill: t5, noPadding: t6, type: t7, ...props } = t0); $[0] = t0; $[1] = children; $[2] = className; $[3] = props; $[4] = t1; $[5] = t2; $[6] = t3; $[7] = t4; $[8] = t5; $[9] = t6; $[10] = t7; } else { children = $[1]; className = $[2]; props = $[3]; t1 = $[4]; t2 = $[5]; t3 = $[6]; t4 = $[7]; t5 = $[8]; t6 = $[9]; t7 = $[10]; } const variant = t1 === undefined ? "basic" : t1; const state = t2 === undefined ? "default" : t2; const small = t3 === undefined ? false : t3; const active = t4 === undefined ? false : t4; const pill = t5 === undefined ? false : t5; const noPadding = t6 === undefined ? false : t6; const type = t7 === undefined ? "button" : t7; const t8 = variant === "filled"; const t9 = variant === "flat"; const t10 = state === "inverted"; const t11 = state === "inactive"; const t12 = state === "alert"; const t13 = state === "neutral"; let t14; if ($[11] !== active || $[12] !== className || $[13] !== noPadding || $[14] !== pill || $[15] !== small || $[16] !== t10 || $[17] !== t11 || $[18] !== t12 || $[19] !== t13 || $[20] !== t8 || $[21] !== t9) { t14 = classnames(className, "bf-button", { "bf-button-small": small, "bf-button-filled": t8, "bf-button-flat": t9, "bf-button-inverted": t10, "bf-button-inactive": t11, "bf-button-alert": t12, "bf-button-neutral": t13, "bf-button-selected": active, "bf-button-pill": pill, "bf-button-nopadding": noPadding }); $[11] = active; $[12] = className; $[13] = noPadding; $[14] = pill; $[15] = small; $[16] = t10; $[17] = t11; $[18] = t12; $[19] = t13; $[20] = t8; $[21] = t9; $[22] = t14; } else { t14 = $[22]; } let t15; if ($[23] !== children || $[24] !== props || $[25] !== ref || $[26] !== t14 || $[27] !== type) { t15 = /*#__PURE__*/_jsx("button", { ...props, className: t14, ref: ref, type: type, children: children }); $[23] = children; $[24] = props; $[25] = ref; $[26] = t14; $[27] = type; $[28] = t15; } else { t15 = $[28]; } return t15; }); Button.displayName = "Button"; export default Button;