UNPKG

@shopify/shop-minis-react

Version:

React component library for Shopify Shop Minis with Tailwind CSS v4 support (source-only, requires TypeScript)

34 lines (33 loc) 934 B
import { jsx as i } from "react/jsx-runtime"; import * as t from "react"; import { motion as s } from "../../shop-minis-react/node_modules/.pnpm/motion@12.17.3_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/motion/dist/es/framer-motion/dist/es/render/components/motion/proxy.js"; const l = ({ onLongPress: e, delay: o = 500, children: c, ...a }) => { const r = t.useRef(void 0), u = t.useCallback(() => { r.current = window.setTimeout(() => { e(), r.current = void 0; }, o); }, [e, o]), n = t.useCallback(() => { r.current && (clearTimeout(r.current), r.current = void 0); }, []); return t.useEffect(() => () => { r.current && clearTimeout(r.current); }, []), /* @__PURE__ */ i( s.div, { onTapStart: u, onTap: n, onTapCancel: n, ...a, children: c } ); }; export { l as LongPressDetector }; //# sourceMappingURL=long-press-detector.js.map