@lanaco/lnc-react-ui
Version:
React component library
69 lines (67 loc) • 1.49 kB
JavaScript
import { jsxs as f, jsx as u } from "react/jsx-runtime";
import { forwardRef as y } from "react";
import { s as h } from "./emotion-styled.browser.esm-DfbrHHed.js";
import x from "./Icon.js";
import { c as C } from "./utils-BUdHa0nB.js";
import { u as g } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
const A = {
small: "0.6rem 1rem",
medium: "0.8rem 1.25rem",
large: "1rem 1.5rem"
}, N = h.div`
display: flex;
justify-content: space-between;
cursor: pointer;
color: ${(e) => C(
e.theme,
"Accordion",
"primary",
"enabled",
"summaryText"
)};
padding: ${(e) => A[e.size]};
& .accordion-icon-lnc {
transform: ${(e) => e.isExpanded ? "rotate(180deg)" : "rotate(0)"};
transition: transform 0.25s ease;
}
`, b = y((e, r) => {
const {
disabled: s,
isExpanded: n,
onExpand: a,
onClick: m = () => {
},
size: t = "small",
className: i = "",
style: c = {},
children: l,
...d
} = e, p = { theme: g(), size: t, style: c, className: i };
return /* @__PURE__ */ f(
N,
{
ref: r,
...p,
onClick: (o) => {
s == !1 && a(o), m(o);
},
isExpanded: n,
...d,
children: [
l,
/* @__PURE__ */ u(
x,
{
icon: "angle-down",
sizeInUnits: "1.125rem",
className: "accordion-icon-lnc"
}
)
]
}
);
});
b.displayName = "ACCORDION_SUMMARY";
export {
b as default
};