UNPKG

stone-kit

Version:
38 lines (37 loc) 1.27 kB
import { jsxs as w, jsx as s } from "react/jsx-runtime"; import { useRef as n, useEffect as a } from "react"; import { c as o } from "../../../index-rKuIKazb.js"; const _ = "_switcherWrapper_jdmcl_29", d = "_swiper_jdmcl_40", l = "_swiperBackward_jdmcl_1", m = "_swiperActive_jdmcl_55", v = "_swiperForward_jdmcl_1", j = "_swiperInactive_jdmcl_60", f = "_swiperPoint_jdmcl_65", u = "_swiperPointActive_jdmcl_77", I = "_swiperInitialize_jdmcl_101", i = { switcherWrapper: _, swiper: d, swiperBackward: l, swiperActive: m, swiperForward: v, swiperInactive: j, swiperPoint: f, swiperPointActive: u, swiperInitialize: I }, c = o.bind(i), x = ({ children: t, isActive: e, onClick: p }) => { const r = n(!0); return a(() => { r.current && (r.current = !1); }, []), /* @__PURE__ */ w("div", { className: i.switcherWrapper, children: [ /* @__PURE__ */ s( "div", { className: c( i.swiper, { [i.swiperInitialize]: r.current }, { [i.swiperActive]: e }, { [i.swiperInactive]: !e && !r.current } ), onClick: p, children: /* @__PURE__ */ s("div", { className: c(i.swiperPoint, { [i.swiperPointActive]: e }) }) } ), t ] }); }; export { x as Switcher };