UNPKG

stone-kit

Version:
51 lines (50 loc) 1.68 kB
import { jsxs as o, jsx as p } from "react/jsx-runtime"; import { useRef as _, useEffect as d } from "react"; import { c as v } from "../../../index-YnD2EP-S.js"; const h = "_switcherWrapper_1b1pd_29", b = "_switcherWrapperReverse_1b1pd_40", W = "_switcherWrapperBetween_1b1pd_44", l = "_swiper_1b1pd_48", m = "_swiperBackward_1b1pd_1", f = "_swiperActive_1b1pd_63", u = "_swiperForward_1b1pd_1", I = "_swiperInactive_1b1pd_68", P = "_swiperInitialize_1b1pd_73", B = "_swiperPoint_1b1pd_77", A = "_swiperPointActive_1b1pd_89", e = { switcherWrapper: h, switcherWrapperReverse: b, switcherWrapperBetween: W, swiper: l, swiperBackward: m, swiperActive: f, swiperForward: u, swiperInactive: I, swiperInitialize: P, swiperPoint: B, swiperPointActive: A }, s = v.bind(e), F = ({ children: t, isActive: i, onClick: c, isReverse: w, isBetween: n, dataTestId: a }) => { const r = _(!0); return d(() => { r.current && (r.current = !1); }, []), /* @__PURE__ */ o( "div", { className: s( e.switcherWrapper, { [e.switcherWrapperReverse]: w }, { [e.switcherWrapperBetween]: n } ), children: [ /* @__PURE__ */ p( "div", { className: s( e.swiper, { [e.swiperInitialize]: r.current }, { [e.swiperActive]: i }, { [e.swiperInactive]: !i && !r.current } ), onClick: c, "data-testid": a, children: /* @__PURE__ */ p("div", { className: s(e.swiperPoint, { [e.swiperPointActive]: i }) }) } ), t ] } ); }; export { F as Switcher };