@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
86 lines • 1.87 kB
JavaScript
import { c as _c } from "react-compiler-runtime";
import { faAngleRight } from "@fortawesome/free-solid-svg-icons/faAngleRight";
import Icon from "../Icon/Icon.js";
import Inline from "../Inline/Inline.js";
import InlineStretch from "../Inline/Inline.Stretch.js";
import DropdownItem from "./Dropdown.Item.js";
import Dropdown from "./Dropdown.js";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const DropdownGroup = t0 => {
const $ = _c(12);
const {
icon,
children,
name
} = t0;
let t1;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
t1 = [-9, 19];
$[0] = t1;
} else {
t1 = $[0];
}
let t2;
if ($[1] !== name) {
t2 = /*#__PURE__*/_jsx(InlineStretch, {
children: name
});
$[1] = name;
$[2] = t2;
} else {
t2 = $[2];
}
let t3;
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
t3 = /*#__PURE__*/_jsx(Icon, {
icon: faAngleRight,
widthAuto: true
});
$[3] = t3;
} else {
t3 = $[3];
}
let t4;
if ($[4] !== t2) {
t4 = /*#__PURE__*/_jsxs(Inline, {
align: "center",
children: [t2, t3]
});
$[4] = t2;
$[5] = t4;
} else {
t4 = $[5];
}
let t5;
if ($[6] !== icon || $[7] !== t4) {
t5 = /*#__PURE__*/_jsx("button", {
type: "button",
children: /*#__PURE__*/_jsx(DropdownItem, {
icon: icon,
children: t4
})
});
$[6] = icon;
$[7] = t4;
$[8] = t5;
} else {
t5 = $[8];
}
let t6;
if ($[9] !== children || $[10] !== t5) {
t6 = /*#__PURE__*/_jsx(Dropdown, {
placement: "right-start",
offset: t1,
content: children,
children: t5
});
$[9] = children;
$[10] = t5;
$[11] = t6;
} else {
t6 = $[11];
}
return t6;
};
DropdownGroup.displayName = "Dropdown.Group";
export default DropdownGroup;