@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
93 lines • 2.07 kB
JavaScript
import { c as _c } from "react-compiler-runtime";
import classNames from "classnames";
import { forwardRef } from "react";
import Icon from "../Icon/Icon.js";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const DropdownItem = /*#__PURE__*/forwardRef((t0, ref) => {
const $ = _c(19);
let children;
let icon;
let props;
let state;
let t1;
let t2;
if ($[0] !== ref || $[1] !== t0) {
const {
icon: t3,
children: t4,
state: t5,
...t6
} = t0;
icon = t3;
children = t4;
props = t6;
state = t5 === undefined ? "default" : t5;
t1 = ref;
t2 = classNames("bf-dropdown-item", props.className, {
"bf-dropdown-item-inactive": state === "inactive"
});
$[0] = ref;
$[1] = t0;
$[2] = children;
$[3] = icon;
$[4] = props;
$[5] = state;
$[6] = t1;
$[7] = t2;
} else {
children = $[2];
icon = $[3];
props = $[4];
state = $[5];
t1 = $[6];
t2 = $[7];
}
let t3;
if ($[8] !== icon || $[9] !== state) {
t3 = icon && /*#__PURE__*/_jsx(Icon, {
icon: icon,
className: classNames("bf-dropdown-item-icon", {
"bfc-alert": state === "alert",
"bfc-success": state === "success",
"bfc-warning": state === "warning"
}),
marginRight: true
});
$[8] = icon;
$[9] = state;
$[10] = t3;
} else {
t3 = $[10];
}
let t4;
if ($[11] !== children) {
t4 = /*#__PURE__*/_jsx("div", {
className: "bf-dropdown-item-content",
children: children
});
$[11] = children;
$[12] = t4;
} else {
t4 = $[12];
}
let t5;
if ($[13] !== props || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 || $[17] !== t4) {
t5 = /*#__PURE__*/_jsxs("div", {
ref: t1,
className: t2,
...props,
children: [t3, t4]
});
$[13] = props;
$[14] = t1;
$[15] = t2;
$[16] = t3;
$[17] = t4;
$[18] = t5;
} else {
t5 = $[18];
}
return t5;
});
DropdownItem.displayName = "Dropdown.Item";
export default DropdownItem;