@zenpatient-org/healthspan-marketing-ui 0.1.141 → 0.1.142

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),t=require("react"),C=require("react-dom"),p=require("./scienceHero.module.css.cjs.js");function L({children:s,backgroundImage:w,cursorLink:v}){const[i,x]=t.useState({x:0,y:0}),[h,m]=t.useState(0),[$,c]=t.useState(!1),[g,l]=t.useState(!1),[o,b]=t.useState(null),[r,M]=t.useState(!1);t.useEffect(()=>{l(!0);const e=()=>M(window.innerWidth<=768);return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),l(!1)}},[]),t.useEffect(()=>{if(r)return;const e=f=>{x({x:f.clientX,y:f.clientY})},d=()=>{m(window.scrollY)};return window.addEventListener("mousemove",e),window.addEventListener("scroll",d),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("scroll",d)}},[r]);const S=e=>{r||(b(e.currentTarget.getBoundingClientRect()),c(!0))},y=()=>{r||c(!1)},E=()=>{window.location.href=v};if(typeof window>"u")return s;if(r)return n.jsx(n.Fragment,{children:s});const u=`circle(270px at ${i.x}px ${i.y}px)`,a=$&&o&&n.jsx("div",{className:p.default.cursorContainer,style:{position:"fixed",top:`${o.top}px`,left:`${o.left}px`,width:`${o.width}px`,height:`${o.height}px`,overflow:"hidden",cursor:"pointer"},children:n.jsx("div",{className:p.default.normalBackground,style:{position:"absolute",top:`${-o.top}px`,left:`${-o.left}px`,backgroundImage:`url(${w})`,clipPath:u,WebkitClipPath:u,backgroundPosition:`center ${-h}px`}})});return n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-type":"hero",onMouseEnter:S,onMouseLeave:y,onClick:E,style:{cursor:"pointer"},children:s}),g&&a&&C.createPortal(a,document.body)]})}exports.ScienceHeroCursor=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("./components/ScienceClientCursor.cjs.js"),c=require("./components/ScienceServerCursor.cjs.js");function u({children:e,backgroundImage:n,cursorLink:i}){return typeof window>"u"?r.jsx(c.ScienceServerCursor,{children:e}):r.jsx(o.ScienceClientCursor,{backgroundImage:n,cursorLink:i,children:e})}exports.ScienceHeroCursor=u;
@@ -1,9 +1,8 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- type ScienceHeroCursorProps = {
3
+ export type ScienceHeroCursorProps = {
4
4
  children: React.ReactNode;
5
5
  backgroundImage: string;
6
6
  cursorLink: string;
7
7
  };
8
- export declare function ScienceHeroCursor({ children, backgroundImage, cursorLink }: ScienceHeroCursorProps): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
9
- export {};
8
+ export declare function ScienceHeroCursor({ children, backgroundImage, cursorLink }: ScienceHeroCursorProps): import("react/jsx-runtime").JSX.Element;
@@ -1,85 +1,9 @@
1
- "use client";
2
- import { jsx as r, Fragment as p, jsxs as P } from "react/jsx-runtime";
3
- import { useState as o, useEffect as w } from "react";
4
- import { createPortal as R } from "react-dom";
5
- import m from "./scienceHero.module.css.es.js";
6
- function z({ children: s, backgroundImage: h, cursorLink: v }) {
7
- const [i, x] = o({ x: 0, y: 0 }), [M, b] = o(0), [g, l] = o(!1), [y, c] = o(!1), [t, $] = o(null), [n, E] = o(!1);
8
- w(() => {
9
- c(!0);
10
- const e = () => E(window.innerWidth <= 768);
11
- return e(), window.addEventListener("resize", e), () => {
12
- window.removeEventListener("resize", e), c(!1);
13
- };
14
- }, []), w(() => {
15
- if (n) return;
16
- const e = (f) => {
17
- x({
18
- x: f.clientX,
19
- y: f.clientY
20
- });
21
- }, a = () => {
22
- b(window.scrollY);
23
- };
24
- return window.addEventListener("mousemove", e), window.addEventListener("scroll", a), () => {
25
- window.removeEventListener("mousemove", e), window.removeEventListener("scroll", a);
26
- };
27
- }, [n]);
28
- const C = (e) => {
29
- n || ($(e.currentTarget.getBoundingClientRect()), l(!0));
30
- }, L = () => {
31
- n || l(!1);
32
- }, k = () => {
33
- window.location.href = v;
34
- };
35
- if (typeof window > "u") return s;
36
- if (n)
37
- return /* @__PURE__ */ r(p, { children: s });
38
- const d = `circle(270px at ${i.x}px ${i.y}px)`, u = g && t && /* @__PURE__ */ r(
39
- "div",
40
- {
41
- className: m.cursorContainer,
42
- style: {
43
- position: "fixed",
44
- top: `${t.top}px`,
45
- left: `${t.left}px`,
46
- width: `${t.width}px`,
47
- height: `${t.height}px`,
48
- overflow: "hidden",
49
- cursor: "pointer"
50
- },
51
- children: /* @__PURE__ */ r(
52
- "div",
53
- {
54
- className: m.normalBackground,
55
- style: {
56
- position: "absolute",
57
- top: `${-t.top}px`,
58
- left: `${-t.left}px`,
59
- backgroundImage: `url(${h})`,
60
- clipPath: d,
61
- WebkitClipPath: d,
62
- backgroundPosition: `center ${-M}px`
63
- }
64
- }
65
- )
66
- }
67
- );
68
- return /* @__PURE__ */ P(p, { children: [
69
- /* @__PURE__ */ r(
70
- "div",
71
- {
72
- "data-type": "hero",
73
- onMouseEnter: C,
74
- onMouseLeave: L,
75
- onClick: k,
76
- style: { cursor: "pointer" },
77
- children: s
78
- }
79
- ),
80
- y && u && R(u, document.body)
81
- ] });
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { ScienceClientCursor as n } from "./components/ScienceClientCursor.es.js";
3
+ import { ScienceServerCursor as t } from "./components/ScienceServerCursor.es.js";
4
+ function m({ children: r, backgroundImage: o, cursorLink: i }) {
5
+ return typeof window > "u" ? /* @__PURE__ */ e(t, { children: r }) : /* @__PURE__ */ e(n, { backgroundImage: o, cursorLink: i, children: r });
82
6
  }
83
7
  export {
84
- z as ScienceHeroCursor
8
+ m as ScienceHeroCursor
85
9
  };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),t=require("react"),E=require("react-dom"),p=require("../scienceHero.module.css.cjs.js");function L({children:r,backgroundImage:w,cursorLink:h}){const[i,v]=t.useState({x:0,y:0}),[x,m]=t.useState(0),[$,c]=t.useState(!1),[g,l]=t.useState(!1),[o,b]=t.useState(null),[s,M]=t.useState(!1);t.useEffect(()=>{l(!0);const e=()=>M(window.innerWidth<=768);return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),l(!1)}},[]),t.useEffect(()=>{if(s)return;const e=f=>{v({x:f.clientX,y:f.clientY})},d=()=>{m(window.scrollY)};return window.addEventListener("mousemove",e),window.addEventListener("scroll",d),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("scroll",d)}},[s]);const S=e=>{s||(b(e.currentTarget.getBoundingClientRect()),c(!0))},C=()=>{s||c(!1)},y=()=>{window.location.href=h};if(s)return n.jsx(n.Fragment,{children:r});const u=`circle(270px at ${i.x}px ${i.y}px)`,a=$&&o&&n.jsx("div",{className:p.default.cursorContainer,style:{position:"fixed",top:`${o.top}px`,left:`${o.left}px`,width:`${o.width}px`,height:`${o.height}px`,overflow:"hidden",cursor:"pointer"},children:n.jsx("div",{className:p.default.normalBackground,style:{position:"absolute",top:`${-o.top}px`,left:`${-o.left}px`,backgroundImage:`url(${w})`,clipPath:u,WebkitClipPath:u,backgroundPosition:`center ${-x}px`}})});return n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-type":"hero",onMouseEnter:S,onMouseLeave:C,onClick:y,style:{cursor:"pointer"},children:r}),g&&a&&E.createPortal(a,document.body)]})}exports.ScienceClientCursor=L;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ type ScienceClientCursorProps = {
4
+ children: React.ReactNode;
5
+ backgroundImage: string;
6
+ cursorLink: string;
7
+ };
8
+ export declare function ScienceClientCursor({ children, backgroundImage, cursorLink }: ScienceClientCursorProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,84 @@
1
+ "use client";
2
+ import { jsx as r, Fragment as f, jsxs as P } from "react/jsx-runtime";
3
+ import { useState as o, useEffect as m } from "react";
4
+ import { createPortal as R } from "react-dom";
5
+ import w from "../scienceHero.module.css.es.js";
6
+ function z({ children: s, backgroundImage: h, cursorLink: v }) {
7
+ const [i, x] = o({ x: 0, y: 0 }), [M, b] = o(0), [g, l] = o(!1), [$, c] = o(!1), [t, y] = o(null), [n, C] = o(!1);
8
+ m(() => {
9
+ c(!0);
10
+ const e = () => C(window.innerWidth <= 768);
11
+ return e(), window.addEventListener("resize", e), () => {
12
+ window.removeEventListener("resize", e), c(!1);
13
+ };
14
+ }, []), m(() => {
15
+ if (n) return;
16
+ const e = (p) => {
17
+ x({
18
+ x: p.clientX,
19
+ y: p.clientY
20
+ });
21
+ }, u = () => {
22
+ b(window.scrollY);
23
+ };
24
+ return window.addEventListener("mousemove", e), window.addEventListener("scroll", u), () => {
25
+ window.removeEventListener("mousemove", e), window.removeEventListener("scroll", u);
26
+ };
27
+ }, [n]);
28
+ const E = (e) => {
29
+ n || (y(e.currentTarget.getBoundingClientRect()), l(!0));
30
+ }, L = () => {
31
+ n || l(!1);
32
+ }, k = () => {
33
+ window.location.href = v;
34
+ };
35
+ if (n)
36
+ return /* @__PURE__ */ r(f, { children: s });
37
+ const a = `circle(270px at ${i.x}px ${i.y}px)`, d = g && t && /* @__PURE__ */ r(
38
+ "div",
39
+ {
40
+ className: w.cursorContainer,
41
+ style: {
42
+ position: "fixed",
43
+ top: `${t.top}px`,
44
+ left: `${t.left}px`,
45
+ width: `${t.width}px`,
46
+ height: `${t.height}px`,
47
+ overflow: "hidden",
48
+ cursor: "pointer"
49
+ },
50
+ children: /* @__PURE__ */ r(
51
+ "div",
52
+ {
53
+ className: w.normalBackground,
54
+ style: {
55
+ position: "absolute",
56
+ top: `${-t.top}px`,
57
+ left: `${-t.left}px`,
58
+ backgroundImage: `url(${h})`,
59
+ clipPath: a,
60
+ WebkitClipPath: a,
61
+ backgroundPosition: `center ${-M}px`
62
+ }
63
+ }
64
+ )
65
+ }
66
+ );
67
+ return /* @__PURE__ */ P(f, { children: [
68
+ /* @__PURE__ */ r(
69
+ "div",
70
+ {
71
+ "data-type": "hero",
72
+ onMouseEnter: E,
73
+ onMouseLeave: L,
74
+ onClick: k,
75
+ style: { cursor: "pointer" },
76
+ children: s
77
+ }
78
+ ),
79
+ $ && d && R(d, document.body)
80
+ ] });
81
+ }
82
+ export {
83
+ z as ScienceClientCursor
84
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=({children:e})=>e;exports.ScienceServerCursor=r;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+
3
+ export declare const ScienceServerCursor: ({ children }: {
4
+ children: React.ReactNode;
5
+ }) => React.ReactNode;
@@ -0,0 +1,4 @@
1
+ const e = ({ children: r }) => r;
2
+ export {
3
+ e as ScienceServerCursor
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenpatient-org/healthspan-marketing-ui",
3
- "version": "0.1.141",
3
+ "version": "0.1.142",
4
4
  "description": "Design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",