@anker-in/headless-ui 1.0.9-alpha.1753674575237 → 1.0.9-alpha.1753679595686

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,2 +1,2 @@
1
- "use strict";"use client";var I=Object.create;var c=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var U=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of A(e))!D.call(t,o)&&o!==r&&c(t,o,{get:()=>e[o],enumerable:!(s=N(e,o))||s.enumerable});return t};var $=(t,e,r)=>(r=t!=null?I(C(t)):{},y(e||!t||!t.__esModule?c(r,"default",{value:t,enumerable:!0}):r,t)),j=t=>y(c({},"__esModule",{value:!0}),t);var B={};U(B,{default:()=>q});module.exports=j(B);var d=require("react/jsx-runtime"),i=$(require("react")),n=require("gsap"),f=require("gsap/dist/SplitText"),u=require("gsap/dist/ScrollTrigger"),b=require("../../helpers/utils.js"),v=require("../../components/index.js"),x=require("../../shared/Styles.js"),R=require("react-intersection-observer");const T=i.default.forwardRef(({data:t,className:e})=>{const{title:r,theme:s}=t,o=(0,i.useRef)(null),l=(0,i.useRef)(null),{ref:E,inView:g}=(0,R.useInView)();return(0,i.useEffect)(()=>{n.gsap.registerPlugin(f.SplitText,u.ScrollTrigger);function H(){if(!o.current)return;const a=o.current?.clientHeight||80;l.current=new f.SplitText(o.current,{type:"words",wordsClass:"word"});const m=l.current.words;n.gsap.set(m,{opacity:0}),n.gsap.timeline({trigger:o.current,start:"bottom bottom-=4%",end:`bottom+=${a*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:k=>{const M=k.progress,h=m.length,L=1/h,w=.5;m.forEach((P,S)=>{const V=S/h*(1-w),z=L*(1+w);let p=(M-V)/z;p=Math.max(0,Math.min(p,1)),n.gsap.set(P,{opacity:p})})}})}return g&&H(),()=>{l.current&&l.current.revert(),u.ScrollTrigger.getAll().forEach(a=>a.kill())}},[g]),r&&(0,d.jsx)("div",{ref:E,className:(0,b.cn)("mb-[24px] space-y-4",e,{"aiui-dark":s==="dark"}),children:(0,d.jsx)(v.Heading,{ref:o,as:"h2",size:4,html:r})})});T.displayName="Title";var q=(0,x.withLayout)(T);
1
+ "use strict";"use client";var N=Object.create;var l=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var j=(t,r)=>{for(var e in r)l(t,e,{get:r[e],enumerable:!0})},T=(t,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of D(r))!$.call(t,o)&&o!==e&&l(t,o,{get:()=>r[o],enumerable:!(i=C(r,o))||i.enumerable});return t};var q=(t,r,e)=>(e=t!=null?N(U(t)):{},T(r||!t||!t.__esModule?l(e,"default",{value:t,enumerable:!0}):e,t)),A=t=>T(l({},"__esModule",{value:!0}),t);var F={};j(F,{default:()=>B});module.exports=A(F);var g=require("react/jsx-runtime"),n=q(require("react")),c=require("gsap"),u=require("gsap/dist/SplitText"),f=require("gsap/dist/ScrollTrigger"),b=require("../../helpers/utils.js"),R=require("../../components/index.js"),v=require("../../shared/Styles.js"),x=require("react-intersection-observer");const y=n.default.forwardRef(({data:t,className:r})=>{const{title:e,theme:i}=t,o=(0,n.useRef)(null),s=(0,n.useRef)(null),a=(0,n.useRef)(null),{ref:H,inView:d}=(0,x.useInView)();return(0,n.useEffect)(()=>{c.gsap.registerPlugin(u.SplitText,f.ScrollTrigger);function E(){if(!o.current)return;const M=o.current?.clientHeight||80;s.current=new u.SplitText(o.current,{type:"words",wordsClass:"word"});const m=s.current.words;c.gsap.set(m,{opacity:0}),a.current=f.ScrollTrigger.create({trigger:o.current,start:"bottom bottom-=4%",end:`bottom+=${M*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:S=>{const k=S.progress,h=m.length,L=1/h,w=.5;m.forEach((P,V)=>{const z=V/h*(1-w),I=L*(1+w);let p=(k-z)/I;p=Math.max(0,Math.min(p,1)),c.gsap.set(P,{opacity:p})})}})}return d&&E(),()=>{s.current&&s.current.revert(),a.current&&a.current.kill()}},[d]),e&&(0,g.jsx)("div",{ref:H,className:(0,b.cn)("mb-[24px] space-y-4",r,{"aiui-dark":i==="dark"}),children:(0,g.jsx)(R.Heading,{ref:o,as:"h2",size:4,html:e})})});y.displayName="Title";var B=(0,v.withLayout)(y);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useEffect, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n gsap.timeline({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n }\n }, [inView])\n\n return (\n title && (\n <div ref={inViewRef} className={cn('mb-[24px] space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={title} />\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA+DQ,IAAAI,EAAA,6BA9DRC,EAAyC,oBACzCC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAwB,qCACxBC,EAA2B,kCAE3BC,EAA0B,uCAE1B,MAAMC,EAAQ,EAAAC,QAAM,WAAuC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,IAAM,CAClF,KAAM,CAAE,MAAAC,EAAO,MAAAC,CAAM,EAAIH,EACnBI,KAAW,UAA2B,IAAI,EAC1CC,KAAoB,UAAyB,IAAI,EAEjD,CAAE,IAAKC,EAAW,OAAAC,CAAO,KAAI,aAAU,EAE7C,sBAAU,IAAM,CACd,OAAK,eAAe,YAAW,eAAa,EAC5C,SAASC,GAAa,CACpB,GAAI,CAACJ,EAAS,QAAS,OACvB,MAAMK,EAASL,EAAS,SAAS,cAAgB,GACjDC,EAAkB,QAAU,IAAI,YAAUD,EAAS,QAAS,CAC1D,KAAM,QACN,WAAY,MACd,CAAC,EACD,MAAMM,EAAQL,EAAkB,QAAQ,MACxC,OAAK,IAAIK,EAAO,CAAE,QAAS,CAAE,CAAC,EAC9B,OAAK,SAAS,CACZ,QAASN,EAAS,QAClB,MAAO,oBACP,IAAK,WAAWK,EAAS,IAAM,EAAE,gBACjC,MAAO,GACP,SAAWE,GAAc,CACvB,MAAMC,EAAWD,EAAK,SAChBE,EAAQH,EAAM,OACdI,EAAW,EAAID,EACfE,EAAU,GAChBL,EAAM,QAAQ,CAACM,EAAWC,IAAc,CACtC,MAAMC,EAASD,EAAIJ,GAAU,EAAIE,GAC3BI,EAAQL,GAAY,EAAIC,GAC9B,IAAIK,GAAWR,EAAWM,GAASC,EACnCC,EAAU,KAAK,IAAI,EAAG,KAAK,IAAIA,EAAS,CAAC,CAAC,EAC1C,OAAK,IAAIJ,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,CACH,CAEA,OAAIb,GACFC,EAAW,EAGN,IAAM,CACXH,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9D,gBAAc,OAAO,EAAE,QAASgB,GAA2BA,EAAE,KAAK,CAAC,CACrE,CACF,EAAG,CAACd,CAAM,CAAC,EAGTL,MACE,OAAC,OAAI,IAAKI,EAAW,aAAW,MAAG,sBAAuBL,EAAW,CAAE,YAAaE,IAAU,MAAO,CAAC,EACpG,mBAAC,WAAQ,IAAKC,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMF,EAAO,EACxD,CAGN,CAAC,EAEDJ,EAAM,YAAc,QAEpB,IAAOX,KAAQ,cAAWW,CAAK",
6
- "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_react_intersection_observer", "Title", "React", "data", "className", "title", "theme", "titleRef", "splitTextInstance", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "t"]
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n title && (\n <div ref={inViewRef} className={cn('mb-[24px] space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={title} />\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
+ "mappings": "ukBAAA,IAAAA,E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AAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,CACH,CAEA,OAAIb,GACFC,EAAW,EAGN,IAAM,CACXJ,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAE9DC,EAAiB,SAAWA,EAAiB,QAAQ,KAAK,CAC5D,CACF,EAAG,CAACE,CAAM,CAAC,EAGTN,MACE,OAAC,OAAI,IAAKK,EAAW,aAAW,MAAG,sBAAuBN,EAAW,CAAE,YAAaE,IAAU,MAAO,CAAC,EACpG,mBAAC,WAAQ,IAAKC,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMF,EAAO,EACxD,CAGN,CAAC,EAEDJ,EAAM,YAAc,QAEpB,IAAOX,KAAQ,cAAWW,CAAK",
6
+ "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_react_intersection_observer", "Title", "React", "data", "className", "title", "theme", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as d}from"react/jsx-runtime";import M,{useEffect as L,useRef as m}from"react";import{gsap as r}from"gsap";import{SplitText as p}from"gsap/dist/SplitText";import{ScrollTrigger as f}from"gsap/dist/ScrollTrigger";import{cn as P}from"../../helpers/utils.js";import{Heading as S}from"../../components/index.js";import{withLayout as V}from"../../shared/Styles.js";import{useInView as z}from"react-intersection-observer";const u=M.forwardRef(({data:g,className:h})=>{const{title:s,theme:w}=g,t=m(null),e=m(null),{ref:y,inView:l}=z();return L(()=>{r.registerPlugin(p,f);function T(){if(!t.current)return;const o=t.current?.clientHeight||80;e.current=new p(t.current,{type:"words",wordsClass:"word"});const i=e.current.words;r.set(i,{opacity:0}),r.timeline({trigger:t.current,start:"bottom bottom-=4%",end:`bottom+=${o*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:b=>{const v=b.progress,c=i.length,x=1/c,a=.5;i.forEach((R,E)=>{const H=E/c*(1-a),k=x*(1+a);let n=(v-H)/k;n=Math.max(0,Math.min(n,1)),r.set(R,{opacity:n})})}})}return l&&T(),()=>{e.current&&e.current.revert(),f.getAll().forEach(o=>o.kill())}},[l]),s&&d("div",{ref:y,className:P("mb-[24px] space-y-4",h,{"aiui-dark":w==="dark"}),children:d(S,{ref:t,as:"h2",size:4,html:s})})});u.displayName="Title";var q=V(u);export{q as default};
1
+ "use client";import{jsx as g}from"react/jsx-runtime";import k,{useEffect as L,useRef as i}from"react";import{gsap as s}from"gsap";import{SplitText as p}from"gsap/dist/SplitText";import{ScrollTrigger as u}from"gsap/dist/ScrollTrigger";import{cn as P}from"../../helpers/utils.js";import{Heading as V}from"../../components/index.js";import{withLayout as z}from"../../shared/Styles.js";import{useInView as I}from"react-intersection-observer";const f=k.forwardRef(({data:d,className:h})=>{const{title:l,theme:w}=d,t=i(null),r=i(null),e=i(null),{ref:T,inView:c}=I();return L(()=>{s.registerPlugin(p,u);function y(){if(!t.current)return;const b=t.current?.clientHeight||80;r.current=new p(t.current,{type:"words",wordsClass:"word"});const o=r.current.words;s.set(o,{opacity:0}),e.current=u.create({trigger:t.current,start:"bottom bottom-=4%",end:`bottom+=${b*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:R=>{const v=R.progress,a=o.length,x=1/a,m=.5;o.forEach((H,E)=>{const M=E/a*(1-m),S=x*(1+m);let n=(v-M)/S;n=Math.max(0,Math.min(n,1)),s.set(H,{opacity:n})})}})}return c&&y(),()=>{r.current&&r.current.revert(),e.current&&e.current.kill()}},[c]),l&&g("div",{ref:T,className:P("mb-[24px] space-y-4",h,{"aiui-dark":w==="dark"}),children:g(V,{ref:t,as:"h2",size:4,html:l})})});f.displayName="Title";var B=z(f);export{B as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useEffect, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n gsap.timeline({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n }\n }, [inView])\n\n return (\n title && (\n <div ref={inViewRef} className={cn('mb-[24px] space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={title} />\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default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IA,EAAS,CAAC,CAAC,EAC1C5B,EAAK,IAAIwB,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,CACH,CAEA,OAAIb,GACFC,EAAW,EAGN,IAAM,CACXH,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9DX,EAAc,OAAO,EAAE,QAAS2B,GAA2BA,EAAE,KAAK,CAAC,CACrE,CACF,EAAG,CAACd,CAAM,CAAC,EAGTL,GACEd,EAAC,OAAI,IAAKkB,EAAW,UAAWX,EAAG,sBAAuBM,EAAW,CAAE,YAAaE,IAAU,MAAO,CAAC,EACpG,SAAAf,EAACQ,EAAA,CAAQ,IAAKQ,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMF,EAAO,EACxD,CAGN,CAAC,EAEDH,EAAM,YAAc,QAEpB,IAAOuB,EAAQzB,EAAWE,CAAK",
6
- "names": ["jsx", "React", "useEffect", "useRef", "gsap", "SplitText", "ScrollTrigger", "cn", "Heading", "withLayout", "useInView", "Title", "data", "className", "title", "theme", "titleRef", "splitTextInstance", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "t", "Title_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n title && (\n <div ref={inViewRef} className={cn('mb-[24px] space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={title} />\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
+ "mappings": "aAiEQ,cAAAA,MAAA,oBAhER,OAAOC,GAAS,aAAAC,EAAW,UAAAC,MAAc,QACzC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,MAAe,4BACxB,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,aAAAC,MAAiB,8BAE1B,MAAMC,EAAQV,EAAM,WAAuC,CAAC,CAAE,KAAAW,EAAM,UAAAC,CAAU,IAAM,CAClF,KAAM,CAAE,MAAAC,EAAO,MAAAC,CAAM,EAAI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G,SAAAf,EAACQ,EAAA,CAAQ,IAAKQ,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMF,EAAO,EACxD,CAGN,CAAC,EAEDH,EAAM,YAAc,QAEpB,IAAOuB,EAAQzB,EAAWE,CAAK",
6
+ "names": ["jsx", "React", "useEffect", "useRef", "gsap", "SplitText", "ScrollTrigger", "cn", "Heading", "withLayout", "useInView", "Title", "data", "className", "title", "theme", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "Title_default"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.0.9-alpha.1753674575237",
3
+ "version": "1.0.9-alpha.1753679595686",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",