UNPKG

stone-kit

Version:
50 lines (49 loc) 1.63 kB
import { jsxs as a, jsx as t } from "react/jsx-runtime"; import { useRef as o, useEffect as _ } from "react"; import { c as m } from "../../../index-rKuIKazb.js"; const v = "_switcherWrapper_1mk97_29", h = "_switcherWrapperReverse_1mk97_40", k = "_switcherWrapperBetween_1mk97_44", d = "_swiper_1mk97_48", W = "_swiperBackward_1mk97_1", l = "_swiperActive_1mk97_63", f = "_swiperForward_1mk97_1", u = "_swiperInactive_1mk97_68", I = "_swiperInitialize_1mk97_73", P = "_swiperPoint_1mk97_77", B = "_swiperPointActive_1mk97_89", e = { switcherWrapper: v, switcherWrapperReverse: h, switcherWrapperBetween: k, swiper: d, swiperBackward: W, swiperActive: l, swiperForward: f, swiperInactive: u, swiperInitialize: I, swiperPoint: P, swiperPointActive: B }, s = m.bind(e), z = ({ children: p, isActive: i, onClick: c, isReverse: w, isBetween: n }) => { const r = o(!0); return _(() => { r.current && (r.current = !1); }, []), /* @__PURE__ */ a( "div", { className: s( e.switcherWrapper, { [e.switcherWrapperReverse]: w }, { [e.switcherWrapperBetween]: n } ), children: [ /* @__PURE__ */ t( "div", { className: s( e.swiper, { [e.swiperInitialize]: r.current }, { [e.swiperActive]: i }, { [e.swiperInactive]: !i && !r.current } ), onClick: c, children: /* @__PURE__ */ t("div", { className: s(e.swiperPoint, { [e.swiperPointActive]: i }) }) } ), p ] } ); }; export { z as Switcher };