UNPKG

@anoki/fse-ui

Version:

FSE UI components library

60 lines (59 loc) 1.35 kB
import { j as o } from "./index.es237.js"; import { useState as p } from "react"; import { StepItem as S } from "./index.es287.js"; import './components/ui/Accordion/AccordionStepper/AccordionStepper.css';/* empty css */ import f from "./index.es289.js"; import { SectionHeading as j } from "./index.es123.js"; const b = ({ steps: s, mainTitle: r, toggleStepsLabels: m, toggleSingleStepsLabel: c }) => { const [l, n] = p( s.map((e, t) => t === 0) ), [a, i] = p(!1), g = () => { const e = !a; n(s.map(() => e)), i(e); }, d = (e) => { const t = [...l]; t[e] = !t[e], n(t); }; return /* @__PURE__ */ o.jsxs("div", { className: "accordion-stepper", children: [ /* @__PURE__ */ o.jsx( j, { color: "primary", title: r, className: "mainTitle", fs: "4", mdFs: "2" } ), /* @__PURE__ */ o.jsx( f, { className: "toggle-all", onClick: g, isOpen: a, toggleLabels: m } ), s.map((e, t) => /* @__PURE__ */ o.jsx( S, { index: t, title: e.title, content: e.content, isOpen: l[t], detailLabels: c, onToggle: () => d(t) }, t )) ] }); }; export { b as AccordionStepper }; //# sourceMappingURL=index.es15.js.map