@anker-in/headless-ui 1.0.9-temp.6 → 1.0.9-temp.6-alpha.1753671079072

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.
Files changed (113) hide show
  1. package/dist/cjs/biz-components/Slogan/index.js +1 -1
  2. package/dist/cjs/biz-components/Slogan/index.js.map +2 -2
  3. package/dist/esm/biz-components/Slogan/index.js +1 -1
  4. package/dist/esm/biz-components/Slogan/index.js.map +3 -3
  5. package/package.json +1 -1
  6. package/dist/cjs/apps/playground/utils/classnames.d.ts +0 -1
  7. package/dist/cjs/biz-components/AccordionCards/useDebounce.d.ts +0 -6
  8. package/dist/cjs/biz-components/MediaPlayerMulti/YouTubePlayer.d.ts +0 -3
  9. package/dist/cjs/biz-components/SectionHeading/SectionHeading.d.ts +0 -4
  10. package/dist/cjs/biz-components/SectionHeading/index.d.ts +0 -0
  11. package/dist/cjs/biz-components/SectionHeading/types.d.ts +0 -6
  12. package/dist/cjs/biz-components/Shelf/Shelf.d.ts +0 -8
  13. package/dist/cjs/biz-components/Shelf/index.d.ts +0 -1
  14. package/dist/cjs/biz-components/Shelf/types.d.ts +0 -6
  15. package/dist/cjs/biz-components/ShelfDisplay/tab.d.ts +0 -7
  16. package/dist/cjs/components/col.d.ts +0 -29
  17. package/dist/cjs/components/dropdown.d.ts +0 -27
  18. package/dist/cjs/components/inputnumber.d.ts +0 -0
  19. package/dist/cjs/components/row.d.ts +0 -18
  20. package/dist/cjs/helpers/get-subtree.d.ts +0 -12
  21. package/dist/cjs/packages/ui/src/components/avatar.d.ts +0 -26
  22. package/dist/cjs/packages/ui/src/components/index.d.ts +0 -20
  23. package/dist/cjs/packages/ui/src/index.d.ts +0 -1
  24. package/dist/cjs/packages/ui/src/stories/avatar.stories.d.ts +0 -40
  25. package/dist/cjs/packages/ui/src/stories/badge.stories.d.ts +0 -26
  26. package/dist/cjs/packages/ui/src/stories/button.stories.d.ts +0 -48
  27. package/dist/cjs/packages/ui/src/stories/checkbox.stories.d.ts +0 -46
  28. package/dist/cjs/packages/ui/src/stories/container.stories.d.ts +0 -36
  29. package/dist/cjs/packages/ui/src/stories/dialog.stories.d.ts +0 -20
  30. package/dist/cjs/packages/ui/src/stories/grid.stories.d.ts +0 -42
  31. package/dist/cjs/packages/ui/src/stories/heading.stories.d.ts +0 -82
  32. package/dist/cjs/packages/ui/src/stories/input.stories.d.ts +0 -35
  33. package/dist/cjs/packages/ui/src/stories/picture.stories.d.ts +0 -18
  34. package/dist/cjs/packages/ui/src/stories/popover.stories.d.ts +0 -17
  35. package/dist/cjs/packages/ui/src/stories/radio.stories.d.ts +0 -39
  36. package/dist/cjs/packages/ui/src/stories/skeleton.stories.d.ts +0 -20
  37. package/dist/cjs/packages/ui/src/stories/text.stories.d.ts +0 -94
  38. package/dist/cjs/src/components/index.d.ts +0 -21
  39. package/dist/cjs/src/components/input-number.d.ts +0 -47
  40. package/dist/cjs/src/index.d.ts +0 -1
  41. package/dist/cjs/src/stories/avatar.stories.d.ts +0 -40
  42. package/dist/cjs/src/stories/badge.stories.d.ts +0 -26
  43. package/dist/cjs/src/stories/button.stories.d.ts +0 -48
  44. package/dist/cjs/src/stories/checkbox.stories.d.ts +0 -46
  45. package/dist/cjs/src/stories/container.stories.d.ts +0 -36
  46. package/dist/cjs/src/stories/dialog.stories.d.ts +0 -20
  47. package/dist/cjs/src/stories/grid.stories.d.ts +0 -42
  48. package/dist/cjs/src/stories/heading.stories.d.ts +0 -82
  49. package/dist/cjs/src/stories/input-number.stories.d.ts +0 -51
  50. package/dist/cjs/src/stories/input.stories.d.ts +0 -35
  51. package/dist/cjs/src/stories/picture.stories.d.ts +0 -18
  52. package/dist/cjs/src/stories/popover.stories.d.ts +0 -17
  53. package/dist/cjs/src/stories/radio.stories.d.ts +0 -39
  54. package/dist/cjs/src/stories/skeleton.stories.d.ts +0 -20
  55. package/dist/cjs/src/stories/text.stories.d.ts +0 -94
  56. package/dist/cjs/stories/shelf.stories.d.ts +0 -17
  57. package/dist/cjs/tailwind.config.d.ts +0 -253
  58. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  59. package/dist/esm/apps/playground/utils/classnames.d.ts +0 -1
  60. package/dist/esm/biz-components/AccordionCards/useDebounce.d.ts +0 -6
  61. package/dist/esm/biz-components/MediaPlayerMulti/YouTubePlayer.d.ts +0 -3
  62. package/dist/esm/biz-components/SectionHeading/SectionHeading.d.ts +0 -4
  63. package/dist/esm/biz-components/SectionHeading/index.d.ts +0 -0
  64. package/dist/esm/biz-components/SectionHeading/types.d.ts +0 -6
  65. package/dist/esm/biz-components/Shelf/Shelf.d.ts +0 -8
  66. package/dist/esm/biz-components/Shelf/index.d.ts +0 -1
  67. package/dist/esm/biz-components/Shelf/types.d.ts +0 -6
  68. package/dist/esm/biz-components/ShelfDisplay/tab.d.ts +0 -7
  69. package/dist/esm/components/col.d.ts +0 -29
  70. package/dist/esm/components/dropdown.d.ts +0 -27
  71. package/dist/esm/components/inputnumber.d.ts +0 -0
  72. package/dist/esm/components/row.d.ts +0 -18
  73. package/dist/esm/helpers/get-subtree.d.ts +0 -12
  74. package/dist/esm/packages/ui/src/components/avatar.d.ts +0 -26
  75. package/dist/esm/packages/ui/src/components/index.d.ts +0 -20
  76. package/dist/esm/packages/ui/src/index.d.ts +0 -1
  77. package/dist/esm/packages/ui/src/stories/avatar.stories.d.ts +0 -40
  78. package/dist/esm/packages/ui/src/stories/badge.stories.d.ts +0 -26
  79. package/dist/esm/packages/ui/src/stories/button.stories.d.ts +0 -48
  80. package/dist/esm/packages/ui/src/stories/checkbox.stories.d.ts +0 -46
  81. package/dist/esm/packages/ui/src/stories/container.stories.d.ts +0 -36
  82. package/dist/esm/packages/ui/src/stories/dialog.stories.d.ts +0 -20
  83. package/dist/esm/packages/ui/src/stories/grid.stories.d.ts +0 -42
  84. package/dist/esm/packages/ui/src/stories/heading.stories.d.ts +0 -82
  85. package/dist/esm/packages/ui/src/stories/input.stories.d.ts +0 -35
  86. package/dist/esm/packages/ui/src/stories/picture.stories.d.ts +0 -18
  87. package/dist/esm/packages/ui/src/stories/popover.stories.d.ts +0 -17
  88. package/dist/esm/packages/ui/src/stories/radio.stories.d.ts +0 -39
  89. package/dist/esm/packages/ui/src/stories/skeleton.stories.d.ts +0 -20
  90. package/dist/esm/packages/ui/src/stories/text.stories.d.ts +0 -94
  91. package/dist/esm/src/components/index.d.ts +0 -21
  92. package/dist/esm/src/components/input-number.d.ts +0 -47
  93. package/dist/esm/src/index.d.ts +0 -1
  94. package/dist/esm/src/stories/avatar.stories.d.ts +0 -40
  95. package/dist/esm/src/stories/badge.stories.d.ts +0 -26
  96. package/dist/esm/src/stories/button.stories.d.ts +0 -48
  97. package/dist/esm/src/stories/checkbox.stories.d.ts +0 -46
  98. package/dist/esm/src/stories/container.stories.d.ts +0 -36
  99. package/dist/esm/src/stories/dialog.stories.d.ts +0 -20
  100. package/dist/esm/src/stories/grid.stories.d.ts +0 -42
  101. package/dist/esm/src/stories/heading.stories.d.ts +0 -82
  102. package/dist/esm/src/stories/input-number.stories.d.ts +0 -51
  103. package/dist/esm/src/stories/input.stories.d.ts +0 -35
  104. package/dist/esm/src/stories/picture.stories.d.ts +0 -18
  105. package/dist/esm/src/stories/popover.stories.d.ts +0 -17
  106. package/dist/esm/src/stories/radio.stories.d.ts +0 -39
  107. package/dist/esm/src/stories/skeleton.stories.d.ts +0 -20
  108. package/dist/esm/src/stories/text.stories.d.ts +0 -94
  109. package/dist/esm/stories/shelf.stories.d.ts +0 -17
  110. package/dist/esm/tailwind.config.d.ts +0 -253
  111. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  112. /package/dist/cjs/hooks/{useEXposure.d.ts → useExposure.d.ts} +0 -0
  113. /package/dist/esm/hooks/{useEXposure.d.ts → useExposure.d.ts} +0 -0
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var Q=Object.create;var v=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty;var et=(t,e)=>{for(var n in e)v(t,n,{get:e[n],enumerable:!0})},G=(t,e,n,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of X(e))!tt.call(t,o)&&o!==n&&v(t,o,{get:()=>e[o],enumerable:!(l=W(e,o))||l.enumerable});return t};var rt=(t,e,n)=>(n=t!=null?Q(Z(t)):{},G(e||!t||!t.__esModule?v(n,"default",{value:t,enumerable:!0}):n,t)),nt=t=>G(v({},"__esModule",{value:!0}),t);var lt={};et(lt,{componentName:()=>V,componentType:()=>C,default:()=>st});module.exports=nt(lt);var s=require("react/jsx-runtime"),r=rt(require("react")),D=require("@gsap/react"),g=require("gsap"),N=require("gsap/dist/SplitText"),d=require("gsap/dist/ScrollTrigger"),c=require("../../helpers/utils.js"),w=require("../../components/index.js"),P=require("../../shared/Styles.js"),j=require("react-intersection-observer"),A=require("../../hooks/useExposure.js");const C="copy",V="brand_slogan";function ot(t=[],e=3){const n=[];for(let l=0;l<t.length;l+=e)n.push(t.slice(l,l+e));return n}const z=r.default.forwardRef(({data:t,className:e=""},n)=>{const{title:l,features:o=[],featureChunkSize:R=3}=t,[y,I]=r.default.useState(0),[F,b]=r.default.useState(!0),T=(0,r.useRef)(null),x=ot(o,R),E=x.length,u=o.length>R,U=u?[...x,x[0]]:x,S=40;(0,r.useImperativeHandle)(n,()=>T.current);const{ref:Y,inView:k}=(0,j.useInView)();(0,A.useExposure)(T,{componentType:C,componentName:V,componentTitle:l}),r.default.useEffect(()=>{if(!u)return;const i=setInterval(()=>{I(a=>a+1),b(!0)},3e3);return()=>clearInterval(i)},[E,u]),r.default.useEffect(()=>{if(u)if(y===E){const i=setTimeout(()=>{b(!1),I(0)},500);return()=>clearTimeout(i)}else b(!0)},[y,E,u]);const m=(0,r.useRef)(null),M=(0,r.useRef)(null),h=(0,r.useRef)(null);return(0,D.useGSAP)(()=>{g.gsap.registerPlugin(d.ScrollTrigger,N.SplitText);function i(){if(!m.current)return;h.current=new N.SplitText(m.current,{type:"words",wordsClass:"word"});const a=m.current?.clientHeight||100,f=h.current.words;g.gsap.set(f,{opacity:0}),d.ScrollTrigger.create({trigger:m.current,start:"bottom bottom-=4%",end:`bottom+=${a*1.5}px bottom-=4%`,scrub:!0,onUpdate:p=>{const _=p.progress,L=f.length,q=1/L,$=.5;f.forEach((B,J)=>{const K=J/L*(1-$),O=q*(1+$);let H=(_-K)/O;H=Math.max(0,Math.min(H,1)),g.gsap.set(B,{opacity:H})})}}),o&&o.length>0&&d.ScrollTrigger.create({trigger:M.current,start:`bottom+=${a*2}px bottom-=6%`,end:`bottom+=${a*2+100}px bottom-=6%`,onUpdate:p=>{g.gsap.set(M.current,{opacity:p.progress})}})}return k&&i(),()=>{h.current&&h.current.revert(),d.ScrollTrigger.getAll().forEach(a=>a.kill())}},[k]),(0,s.jsx)("div",{ref:Y,children:(0,s.jsxs)("div",{ref:T,className:(0,c.cn)("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",e),children:[(0,s.jsx)(w.Heading,{ref:m,as:"h2",size:2,weight:"bold",align:"left",className:(0,c.cn)("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:l}),o&&o.length>0&&(0,s.jsx)("div",{className:(0,c.cn)("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${S}px]`),children:(0,s.jsx)("div",{className:(0,c.cn)(["flex flex-col",F?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${y*S}px)`},children:U.map((i,a)=>(0,s.jsx)("div",{className:(0,c.cn)("laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${S}px]`),children:i.map((f,p)=>(0,s.jsxs)(r.default.Fragment,{children:[p>0&&(0,s.jsx)("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),(0,s.jsx)(w.Text,{size:3,align:"left",as:"p",className:"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:f.title})]},p))},a))})})]})})});z.displayName="Slogan";var st=(0,P.withLayout)(z);
1
+ "use strict";"use client";var O=Object.create;var v=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var tt=(t,e)=>{for(var n in e)v(t,n,{get:e[n],enumerable:!0})},G=(t,e,n,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of W(e))!Z.call(t,o)&&o!==n&&v(t,o,{get:()=>e[o],enumerable:!(l=Q(e,o))||l.enumerable});return t};var et=(t,e,n)=>(n=t!=null?O(X(t)):{},G(e||!t||!t.__esModule?v(n,"default",{value:t,enumerable:!0}):n,t)),rt=t=>G(v({},"__esModule",{value:!0}),t);var st={};tt(st,{componentName:()=>C,componentType:()=>A,default:()=>ot});module.exports=rt(st);var s=require("react/jsx-runtime"),r=et(require("react")),at=require("@gsap/react"),g=require("gsap"),N=require("gsap/dist/SplitText"),d=require("gsap/dist/ScrollTrigger"),c=require("../../helpers/utils.js"),w=require("../../components/index.js"),D=require("../../shared/Styles.js"),P=require("react-intersection-observer"),j=require("../../hooks/useExposure.js");const A="copy",C="brand_slogan";function nt(t=[],e=3){const n=[];for(let l=0;l<t.length;l+=e)n.push(t.slice(l,l+e));return n}const z=r.default.forwardRef(({data:t,className:e=""},n)=>{const{title:l,features:o=[],featureChunkSize:R=3}=t,[y,I]=r.default.useState(0),[V,b]=r.default.useState(!0),T=(0,r.useRef)(null),x=nt(o,R),E=x.length,u=o.length>R,F=u?[...x,x[0]]:x,S=40;(0,r.useImperativeHandle)(n,()=>T.current);const{ref:U,inView:k}=(0,P.useInView)();(0,j.useExposure)(T,{componentType:A,componentName:C,componentTitle:l}),r.default.useEffect(()=>{if(!u)return;const i=setInterval(()=>{I(a=>a+1),b(!0)},3e3);return()=>clearInterval(i)},[E,u]),r.default.useEffect(()=>{if(u)if(y===E){const i=setTimeout(()=>{b(!1),I(0)},500);return()=>clearTimeout(i)}else b(!0)},[y,E,u]);const f=(0,r.useRef)(null),M=(0,r.useRef)(null),h=(0,r.useRef)(null);return(0,r.useEffect)(()=>{g.gsap.registerPlugin(d.ScrollTrigger,N.SplitText);function i(){if(!f.current)return;h.current=new N.SplitText(f.current,{type:"words",wordsClass:"word"});const a=f.current?.clientHeight||100,m=h.current.words;g.gsap.set(m,{opacity:0}),d.ScrollTrigger.create({trigger:f.current,start:"bottom bottom-=4%",end:`bottom+=${a*1.5}px bottom-=4%`,scrub:!0,onUpdate:p=>{const Y=p.progress,L=m.length,_=1/L,$=.5;m.forEach((q,B)=>{const J=B/L*(1-$),K=_*(1+$);let H=(Y-J)/K;H=Math.max(0,Math.min(H,1)),g.gsap.set(q,{opacity:H})})}}),o&&o.length>0&&d.ScrollTrigger.create({trigger:M.current,start:`bottom+=${a*2}px bottom-=6%`,end:`bottom+=${a*2+100}px bottom-=6%`,onUpdate:p=>{g.gsap.set(M.current,{opacity:p.progress})}})}return k&&i(),()=>{h.current&&h.current.revert(),d.ScrollTrigger.getAll().forEach(a=>a.kill())}},[k]),(0,s.jsx)("div",{ref:U,children:(0,s.jsxs)("div",{ref:T,className:(0,c.cn)("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",e),children:[(0,s.jsx)(w.Heading,{ref:f,as:"h2",size:2,weight:"bold",align:"left",className:(0,c.cn)("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:l}),o&&o.length>0&&(0,s.jsx)("div",{className:(0,c.cn)("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${S}px]`),children:(0,s.jsx)("div",{className:(0,c.cn)(["flex flex-col",V?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${y*S}px)`},children:F.map((i,a)=>(0,s.jsx)("div",{className:(0,c.cn)("laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${S}px]`),children:i.map((m,p)=>(0,s.jsxs)(r.default.Fragment,{children:[p>0&&(0,s.jsx)("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),(0,s.jsx)(w.Text,{size:3,align:"left",as:"p",className:"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:m.title})]},p))},a))})})]})})});z.displayName="Slogan";var ot=(0,D.withLayout)(z);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Slogan/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { useGSAP } from '@gsap/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, Text } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useInView } from 'react-intersection-observer'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { ref: inViewRef, inView } = useInView()\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n\n useGSAP(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n\n function gsapResize() {\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5}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 if (features && features.length > 0) {\n ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\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: any) => t.kill())\n }\n }, [inView])\n\n return (\n <div ref={inViewRef}>\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning\n ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]'\n : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n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C,QACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,gFACV,KAAMD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,EACF,CAEJ,CAAC,EAEDvC,EAAO,YAAc,SAErB,IAAOjB,MAAQ,cAAWiB,CAAM",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useEffect } from 'react'\nimport { useGSAP } from '@gsap/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, Text } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useInView } from 'react-intersection-observer'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { ref: inViewRef, inView } = useInView()\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n\n function gsapResize() {\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5}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 if (features && features.length > 0) {\n ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\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: any) => t.kill())\n }\n }, [inView])\n\n return (\n <div ref={inViewRef}>\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning\n ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]'\n : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withLayout(Slogan)\n"],
5
+ "mappings": "0kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,EAAA,kBAAAC,EAAA,YAAAC,KAAA,eAAAC,GAAAL,IA0IQ,IAAAM,EAAA,6BAzIRC,EAA8D,qBAC9DA,GAA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O,CACnB,QAASiB,EAAY,QACrB,MAAO,WAAWG,EAAS,CAAC,gBAC5B,IAAK,WAAWA,EAAS,EAAI,GAAG,gBAChC,SAAWE,GAAc,CACvB,OAAK,IAAIL,EAAY,QAAS,CAAE,QAASK,EAAK,QAAS,CAAC,CAC1D,CACF,CAAC,CAEL,CAEA,OAAIT,GACFM,EAAW,EAGN,IAAM,CACXD,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9D,gBAAc,OAAO,EAAE,QAASa,GAAWA,EAAE,KAAK,CAAC,CACrD,CACF,EAAG,CAAClB,CAAM,CAAC,KAGT,OAAC,OAAI,IAAKD,EACR,oBAAC,OACC,IAAKN,EACL,aAAW,MACT,2KACAT,CACF,EAEA,oBAAC,WACC,IAAKmB,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,aAAW,MACT,sGACF,EACA,KAAMjB,EACR,EACCC,GAAYA,EAAS,OAAS,MAC7B,OAAC,OAAI,aAAW,MAAG,gDAAiD,aAAaW,CAAW,KAAK,EAC/F,mBAAC,OACC,aAAW,MAAG,CACZ,gBACAP,EACI,mEACA,kBACN,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaS,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACsB,EAAOC,OACzB,OAAC,OACC,aAAW,MACT,8EACA,aAAatB,CAAW,KAC1B,EAGC,SAAAqB,EAAM,IAAI,CAACE,EAASC,OACnB,QAAC,EAAAxC,QAAM,SAAN,CACE,UAAAwC,EAAQ,MAAK,OAAC,OAAI,UAAU,wDAAwD,KACrF,OAAC,QACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,gFACV,KAAMD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,EACF,CAEJ,CAAC,EAEDvC,EAAO,YAAc,SAErB,IAAOjB,MAAQ,cAAWiB,CAAM",
6
6
  "names": ["Slogan_exports", "__export", "componentName", "componentType", "Slogan_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_react_intersection_observer", "import_useExposure", "chunkArray", "array", "size", "result", "i", "Slogan", "React", "data", "className", "ref", "title", "features", "featureChunkSize", "groupIndex", "setGroupIndex", "isTransitioning", "setIsTransitioning", "innerRef", "featuresGroups", "totalGroups", "needCarousel", "displayGroups", "groupHeight", "inViewRef", "inView", "timer", "handle", "titleRef", "featuresRef", "splitTextInstance", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "start", "width", "opacity", "t", "group", "idx", "feature", "index"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as n,jsxs as G}from"react/jsx-runtime";import l,{useImperativeHandle as Y,useRef as x}from"react";import{useGSAP as _}from"@gsap/react";import{gsap as h}from"gsap";import{SplitText as L}from"gsap/dist/SplitText";import{ScrollTrigger as v}from"gsap/dist/ScrollTrigger";import{cn as c}from"../../helpers/utils.js";import{Heading as q,Text as B}from"../../components/index.js";import{withLayout as J}from"../../shared/Styles.js";import{useInView as K}from"react-intersection-observer";import{useExposure as O}from"../../hooks/useExposure.js";const Q="copy",W="brand_slogan";function X(u=[],m=3){const f=[];for(let e=0;e<u.length;e+=m)f.push(u.slice(e,e+m));return f}const $=l.forwardRef(({data:u,className:m=""},f)=>{const{title:e,features:o=[],featureChunkSize:H=3}=u,[w,N]=l.useState(0),[z,y]=l.useState(!0),b=x(null),g=X(o,H),T=g.length,a=o.length>H,D=a?[...g,g[0]]:g,E=40;Y(f,()=>b.current);const{ref:P,inView:R}=K();O(b,{componentType:Q,componentName:W,componentTitle:e}),l.useEffect(()=>{if(!a)return;const r=setInterval(()=>{N(t=>t+1),y(!0)},3e3);return()=>clearInterval(r)},[T,a]),l.useEffect(()=>{if(a)if(w===T){const r=setTimeout(()=>{y(!1),N(0)},500);return()=>clearTimeout(r)}else y(!0)},[w,T,a]);const i=x(null),I=x(null),d=x(null);return _(()=>{h.registerPlugin(v,L);function r(){if(!i.current)return;d.current=new L(i.current,{type:"words",wordsClass:"word"});const t=i.current?.clientHeight||100,p=d.current.words;h.set(p,{opacity:0}),v.create({trigger:i.current,start:"bottom bottom-=4%",end:`bottom+=${t*1.5}px bottom-=4%`,scrub:!0,onUpdate:s=>{const j=s.progress,k=p.length,A=1/k,M=.5;p.forEach((C,V)=>{const F=V/k*(1-M),U=A*(1+M);let S=(j-F)/U;S=Math.max(0,Math.min(S,1)),h.set(C,{opacity:S})})}}),o&&o.length>0&&v.create({trigger:I.current,start:`bottom+=${t*2}px bottom-=6%`,end:`bottom+=${t*2+100}px bottom-=6%`,onUpdate:s=>{h.set(I.current,{opacity:s.progress})}})}return R&&r(),()=>{d.current&&d.current.revert(),v.getAll().forEach(t=>t.kill())}},[R]),n("div",{ref:P,children:G("div",{ref:b,className:c("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",m),children:[n(q,{ref:i,as:"h2",size:2,weight:"bold",align:"left",className:c("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:e}),o&&o.length>0&&n("div",{className:c("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${E}px]`),children:n("div",{className:c(["flex flex-col",z?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${w*E}px)`},children:D.map((r,t)=>n("div",{className:c("laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${E}px]`),children:r.map((p,s)=>G(l.Fragment,{children:[s>0&&n("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),n(B,{size:3,align:"left",as:"p",className:"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:p.title})]},s))},t))})})]})})});$.displayName="Slogan";var pt=J($);export{W as componentName,Q as componentType,pt as default};
1
+ "use client";import{jsx as n,jsxs as G}from"react/jsx-runtime";import l,{useImperativeHandle as Y,useRef as x,useEffect as _}from"react";import"@gsap/react";import{gsap as h}from"gsap";import{SplitText as L}from"gsap/dist/SplitText";import{ScrollTrigger as v}from"gsap/dist/ScrollTrigger";import{cn as c}from"../../helpers/utils.js";import{Heading as q,Text as B}from"../../components/index.js";import{withLayout as J}from"../../shared/Styles.js";import{useInView as K}from"react-intersection-observer";import{useExposure as O}from"../../hooks/useExposure.js";const Q="copy",W="brand_slogan";function X(u=[],f=3){const m=[];for(let e=0;e<u.length;e+=f)m.push(u.slice(e,e+f));return m}const $=l.forwardRef(({data:u,className:f=""},m)=>{const{title:e,features:o=[],featureChunkSize:H=3}=u,[w,N]=l.useState(0),[z,y]=l.useState(!0),b=x(null),g=X(o,H),T=g.length,a=o.length>H,D=a?[...g,g[0]]:g,E=40;Y(m,()=>b.current);const{ref:P,inView:R}=K();O(b,{componentType:Q,componentName:W,componentTitle:e}),l.useEffect(()=>{if(!a)return;const r=setInterval(()=>{N(t=>t+1),y(!0)},3e3);return()=>clearInterval(r)},[T,a]),l.useEffect(()=>{if(a)if(w===T){const r=setTimeout(()=>{y(!1),N(0)},500);return()=>clearTimeout(r)}else y(!0)},[w,T,a]);const i=x(null),I=x(null),d=x(null);return _(()=>{h.registerPlugin(v,L);function r(){if(!i.current)return;d.current=new L(i.current,{type:"words",wordsClass:"word"});const t=i.current?.clientHeight||100,p=d.current.words;h.set(p,{opacity:0}),v.create({trigger:i.current,start:"bottom bottom-=4%",end:`bottom+=${t*1.5}px bottom-=4%`,scrub:!0,onUpdate:s=>{const j=s.progress,k=p.length,A=1/k,M=.5;p.forEach((C,V)=>{const F=V/k*(1-M),U=A*(1+M);let S=(j-F)/U;S=Math.max(0,Math.min(S,1)),h.set(C,{opacity:S})})}}),o&&o.length>0&&v.create({trigger:I.current,start:`bottom+=${t*2}px bottom-=6%`,end:`bottom+=${t*2+100}px bottom-=6%`,onUpdate:s=>{h.set(I.current,{opacity:s.progress})}})}return R&&r(),()=>{d.current&&d.current.revert(),v.getAll().forEach(t=>t.kill())}},[R]),n("div",{ref:P,children:G("div",{ref:b,className:c("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",f),children:[n(q,{ref:i,as:"h2",size:2,weight:"bold",align:"left",className:c("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:e}),o&&o.length>0&&n("div",{className:c("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${E}px]`),children:n("div",{className:c(["flex flex-col",z?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${w*E}px)`},children:D.map((r,t)=>n("div",{className:c("laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${E}px]`),children:r.map((p,s)=>G(l.Fragment,{children:[s>0&&n("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),n(B,{size:3,align:"left",as:"p",className:"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:p.title})]},s))},t))})})]})})});$.displayName="Slogan";var ct=J($);export{W as componentName,Q as componentType,ct as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Slogan/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { useGSAP } from '@gsap/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, Text } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useInView } from 'react-intersection-observer'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { ref: inViewRef, inView } = useInView()\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n\n useGSAP(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n\n function gsapResize() {\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5}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 if (features && features.length > 0) {\n ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\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: any) => t.kill())\n }\n }, [inView])\n\n return (\n <div ref={inViewRef}>\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning\n ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]'\n : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withLayout(Slogan)\n"],
5
- "mappings": "aA0IQ,cAAAA,EAiCY,QAAAC,MAjCZ,oBAzIR,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAS,WAAAC,MAAe,cACxB,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,aAAAC,MAAiB,8BAC1B,OAAS,eAAAC,MAAmB,6BAErB,MAAMC,EAAgB,OAChBC,EAAgB,eAE7B,SAASC,EAAWC,EAA6B,CAAC,EAAGC,EAAe,EAAG,CACrE,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,EAAM,OAAQG,GAAKF,EACrCC,EAAO,KAAKF,EAAM,MAAMG,EAAGA,EAAIF,CAAI,CAAC,EAEtC,OAAOC,CACT,CAEA,MAAME,EAASpB,EAAM,WAAwC,CAAC,CAAE,KAAAqB,EAAM,UAAAC,EAAY,EAAG,EAAGC,IAAQ,CAC9F,KAAM,CAAE,MAAAC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xB,EAACU,EAAA,CACC,IAAKiC,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,UAAWlC,EACT,sGACF,EACA,KAAMiB,EACR,EACCC,GAAYA,EAAS,OAAS,GAC7B3B,EAAC,OAAI,UAAWS,EAAG,gDAAiD,aAAa6B,CAAW,KAAK,EAC/F,SAAAtC,EAAC,OACC,UAAWS,EAAG,CACZ,gBACAsB,EACI,mEACA,kBACN,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaS,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACqB,EAAOC,IACzB3D,EAAC,OACC,UAAWS,EACT,8EACA,aAAa6B,CAAW,KAC1B,EAGC,SAAAoB,EAAM,IAAI,CAACE,EAASC,IACnB5D,EAACC,EAAM,SAAN,CACE,UAAA2D,EAAQ,GAAK7D,EAAC,OAAI,UAAU,wDAAwD,EACrFA,EAACW,EAAA,CACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,gFACV,KAAMiD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,EACF,CAEJ,CAAC,EAEDrC,EAAO,YAAc,SAErB,IAAOwC,GAAQlD,EAAWU,CAAM",
6
- "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "useGSAP", "gsap", "SplitText", "ScrollTrigger", "cn", "Heading", "Text", "withLayout", "useInView", "useExposure", "componentType", "componentName", "chunkArray", "array", "size", "result", "i", "Slogan", "data", "className", "ref", "title", "features", "featureChunkSize", "groupIndex", "setGroupIndex", "isTransitioning", "setIsTransitioning", "innerRef", "featuresGroups", "totalGroups", "needCarousel", "displayGroups", "groupHeight", "inViewRef", "inView", "timer", "handle", "titleRef", "featuresRef", "splitTextInstance", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "start", "width", "opacity", "group", "idx", "feature", "index", "Slogan_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useEffect } from 'react'\nimport { useGSAP } from '@gsap/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, Text } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useInView } from 'react-intersection-observer'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { ref: inViewRef, inView } = useInView()\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n\n function gsapResize() {\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5}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 if (features && features.length > 0) {\n ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\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: any) => t.kill())\n }\n }, [inView])\n\n return (\n <div ref={inViewRef}>\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning\n ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]'\n : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withLayout(Slogan)\n"],
5
+ "mappings": "aA0IQ,cAAAA,EAiCY,QAAAC,MAjCZ,oBAzIR,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,EAAQ,aAAAC,MAAiB,QAC9D,MAAwB,cACxB,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,aAAAC,MAAiB,8BAC1B,OAAS,eAAAC,MAAmB,6BAErB,MAAMC,EAAgB,OAChBC,EAAgB,eAE7B,SAASC,E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K,QAAS,CAAC,CAC1D,CACF,CAAC,CAEL,CAEA,OAAIT,GACFM,EAAW,EAGN,IAAM,CACXD,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9DrC,EAAc,OAAO,EAAE,QAAS,GAAW,EAAE,KAAK,CAAC,CACrD,CACF,EAAG,CAACgC,CAAM,CAAC,EAGTxC,EAAC,OAAI,IAAKuC,EACR,SAAAtC,EAAC,OACC,IAAKgC,EACL,UAAWxB,EACT,2KACAe,CACF,EAEA,UAAAxB,EAACU,EAAA,CACC,IAAKiC,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,UAAWlC,EACT,sGACF,EACA,KAAMiB,EACR,EACCC,GAAYA,EAAS,OAAS,GAC7B3B,EAAC,OAAI,UAAWS,EAAG,gDAAiD,aAAa6B,CAAW,KAAK,EAC/F,SAAAtC,EAAC,OACC,UAAWS,EAAG,CACZ,gBACAsB,EACI,mEACA,kBACN,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaS,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACqB,EAAOC,IACzB3D,EAAC,OACC,UAAWS,EACT,8EACA,aAAa6B,CAAW,KAC1B,EAGC,SAAAoB,EAAM,IAAI,CAACE,EAASC,IACnB5D,EAACC,EAAM,SAAN,CACE,UAAA2D,EAAQ,GAAK7D,EAAC,OAAI,UAAU,wDAAwD,EACrFA,EAACW,EAAA,CACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,gFACV,KAAMiD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,EACF,CAEJ,CAAC,EAEDrC,EAAO,YAAc,SAErB,IAAOwC,GAAQlD,EAAWU,CAAM",
6
+ "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "useEffect", "gsap", "SplitText", "ScrollTrigger", "cn", "Heading", "Text", "withLayout", "useInView", "useExposure", "componentType", "componentName", "chunkArray", "array", "size", "result", "i", "Slogan", "data", "className", "ref", "title", "features", "featureChunkSize", "groupIndex", "setGroupIndex", "isTransitioning", "setIsTransitioning", "innerRef", "featuresGroups", "totalGroups", "needCarousel", "displayGroups", "groupHeight", "inViewRef", "inView", "timer", "handle", "titleRef", "featuresRef", "splitTextInstance", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "start", "width", "opacity", "group", "idx", "feature", "index", "Slogan_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-temp.6",
3
+ "version": "1.0.9-temp.6-alpha.1753671079072",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",
@@ -1 +0,0 @@
1
- export declare function classNames(...arr: unknown[]): string;
@@ -1,6 +0,0 @@
1
- type DebounceOptions = {
2
- leading?: boolean;
3
- trailing?: boolean;
4
- };
5
- export declare function useDebounce<T extends any[]>(func: (...args: T) => void, delay?: number, options?: DebounceOptions): (...args: T) => void;
6
- export {};
@@ -1,3 +0,0 @@
1
- export declare function YouTubePlayer({ youTubeId }: {
2
- youTubeId: string;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { SectionHeadingProps } from './types.js';
3
- declare const SectionHeading: React.ForwardRefExoticComponent<SectionHeadingProps & React.RefAttributes<HTMLDivElement>>;
4
- export default SectionHeading;
File without changes
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export interface SectionHeadingProps {
3
- title: string;
4
- className?: string;
5
- children: React.ReactNode;
6
- }
@@ -1,8 +0,0 @@
1
- import type { ShelfProps } from './types.js';
2
- declare const _default: {
3
- (props: Omit<ShelfProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
4
- className?: string;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- displayName: string;
7
- };
8
- export default _default;
@@ -1 +0,0 @@
1
- export { default } from './Shelf.js';
@@ -1,6 +0,0 @@
1
- export type ShelfProps = {
2
- id: string;
3
- title: string;
4
- subtitle: string;
5
- products: any[];
6
- };
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface TabsProps {
3
- tabs: any[];
4
- onTabClick?: (value: any) => void;
5
- }
6
- declare const Tab: React.FC<TabsProps>;
7
- export default Tab;
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import type { ReactNode } from 'react';
3
- interface mediaProps {
4
- span?: number;
5
- pull?: number;
6
- push?: number;
7
- offset?: number;
8
- order?: number;
9
- }
10
- interface ColProps {
11
- children?: ReactNode;
12
- span?: number;
13
- className?: string;
14
- asChild?: boolean;
15
- offset?: number;
16
- order?: number;
17
- push?: number;
18
- pull?: number;
19
- flex?: number;
20
- allFlex?: number;
21
- md?: number | mediaProps;
22
- lxl?: number | mediaProps;
23
- mdl?: number | mediaProps;
24
- xlxxl?: number | mediaProps;
25
- minxxl?: number | mediaProps;
26
- }
27
- declare const Col: React.ForwardRefExoticComponent<ColProps & React.RefAttributes<HTMLDivElement>>;
28
- export { Col };
29
- export type { ColProps };
@@ -1,27 +0,0 @@
1
- import * as React from 'react';
2
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
- declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
- declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
- declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
6
- declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
7
- declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
8
- declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
- declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
- inset?: boolean;
11
- } & React.RefAttributes<HTMLDivElement>>;
12
- declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
- declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
- inset?: boolean;
16
- } & React.RefAttributes<HTMLDivElement>>;
17
- declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
- declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
- declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
20
- inset?: boolean;
21
- } & React.RefAttributes<HTMLDivElement>>;
22
- declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
- declare const DropdownMenuShortcut: {
24
- ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
25
- displayName: string;
26
- };
27
- export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
File without changes
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import type { ReactNode } from 'react';
3
- interface RowProps {
4
- children?: ReactNode;
5
- className?: string;
6
- align?: 'start' | 'center' | 'end' | 'stretch' | {
7
- [key in 'md' | 'mdl' | 'xlxxl' | 'minxxl']: 'start' | 'center' | 'end' | 'stretch';
8
- };
9
- asChild?: boolean;
10
- gutter?: number | object | Array<object | number>;
11
- wrap?: boolean;
12
- justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly' | {
13
- [key in 'md' | 'mdl' | 'xlxxl' | 'minxxl']: 'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly';
14
- };
15
- }
16
- declare const Row: React.ForwardRefExoticComponent<RowProps & React.RefAttributes<HTMLDivElement>>;
17
- export { Row };
18
- export type { RowProps };
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * This is a helper function that is used when a component supports `asChild`
4
- * using the `Slot` component but its implementation contains nested DOM elements.
5
- *
6
- * Using it ensures if a consumer uses the `asChild` prop, the elements are in
7
- * correct order in the DOM, adopting the intended consumer `children`.
8
- */
9
- export declare function getSubtree(options: {
10
- asChild: boolean | undefined;
11
- children: React.ReactNode;
12
- }, content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)): React.ReactNode;
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import * as AvatarPrimitive from '@radix-ui/react-avatar';
3
- import { type VariantProps } from 'class-variance-authority';
4
- declare const Avatar: React.ForwardRefExoticComponent<{
5
- /** 定义子组件作为父组件的类型,详细使用方式请参考radix-ui */
6
- asChild?: boolean;
7
- /** 类名*/
8
- className?: string;
9
- /** 样式*/
10
- style?: React.CSSProperties;
11
- /** 点击事件*/
12
- onClick?: Function;
13
- /** 文本自适应*/
14
- isAdaptation?: boolean;
15
- /** 文本自适应最小字体, 开启时生效*/
16
- minSize?: number;
17
- /** 文本自适应最大字体, 开启时生效*/
18
- maxSize?: number;
19
- /** 文本自适应类*/
20
- textClassName?: string;
21
- } & VariantProps<(props?: ({
22
- size?: "small" | "medium" | "large" | null | undefined;
23
- } & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string> & Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
24
- declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
25
- declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
26
- export { Avatar, AvatarImage, AvatarFallback };
@@ -1,20 +0,0 @@
1
- export { default as Button } from './button.js';
2
- export { default as Badge } from './badge.js';
3
- export * from './input.js';
4
- export { default as Checkbox } from './checkbox.js';
5
- export { default as Skeleton } from './skeleton.js';
6
- export * from './dialog.js';
7
- export * from './popover.js';
8
- export * from './radio.js';
9
- export * from './dialog.js';
10
- export * from './text.js';
11
- export * from './gird.js';
12
- export * from './col.js';
13
- export * from './row.js';
14
- export * from './heading.js';
15
- export * from './container.js';
16
- export * from './color.js';
17
- export * from './link.js';
18
- export * from './avatar.js';
19
- export { default as Picture } from './picture.js';
20
- export { default as Theme } from './theme.js';
@@ -1 +0,0 @@
1
- export * from './components/index.js';
@@ -1,40 +0,0 @@
1
- declare const meta: {
2
- title: string;
3
- component: import("react").ForwardRefExoticComponent<{
4
- asChild?: boolean;
5
- className?: string;
6
- style?: React.CSSProperties;
7
- onClick?: Function;
8
- isAdaptation?: boolean;
9
- minSize?: number;
10
- maxSize?: number;
11
- textClassName?: string;
12
- } & import("class-variance-authority").VariantProps<(props?: ({
13
- size?: "small" | "medium" | "large" | null | undefined;
14
- } & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string> & Omit<import("@radix-ui/react-avatar").AvatarProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
15
- tags: string[];
16
- subcomponents: any;
17
- parameters: {
18
- layout: string;
19
- docs: {
20
- description: {
21
- component: string;
22
- };
23
- };
24
- };
25
- argTypes: {
26
- size: {
27
- description: string;
28
- table: {
29
- defaultValue: {
30
- summary: string;
31
- };
32
- };
33
- };
34
- };
35
- };
36
- export default meta;
37
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
38
- export declare const AvatarType: () => import("react/jsx-runtime").JSX.Element;
39
- export declare const AvatarTextAdaptation: () => import("react/jsx-runtime").JSX.Element;
40
- export declare const AvatarSize: () => import("react/jsx-runtime").JSX.Element;
@@ -1,26 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import { Badge } from '../components/index.js';
3
- declare const meta: {
4
- title: string;
5
- component: typeof Badge;
6
- parameters: {
7
- layout: string;
8
- };
9
- tags: string[];
10
- argTypes: {
11
- variant: {
12
- control: {
13
- type: "select";
14
- };
15
- options: string[];
16
- };
17
- };
18
- args: {
19
- variant: "default";
20
- children: string;
21
- };
22
- };
23
- export default meta;
24
- type Story = StoryObj<typeof meta>;
25
- export declare const Default: Story;
26
- export declare const Examples: Story;
@@ -1,48 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import React from 'react';
3
- declare const meta: {
4
- title: string;
5
- component: React.ForwardRefExoticComponent<import("../components/button.js").ButtonProps & React.RefAttributes<HTMLButtonElement>>;
6
- parameters: {
7
- layout: string;
8
- };
9
- tags: string[];
10
- argTypes: {
11
- variant: {
12
- control: {
13
- type: "select";
14
- };
15
- options: string[];
16
- };
17
- size: {
18
- control: {
19
- type: "select";
20
- };
21
- options: string[];
22
- };
23
- hoverEffect: {
24
- description: string;
25
- control: {
26
- type: "select";
27
- };
28
- options: string[];
29
- };
30
- };
31
- args: {
32
- variant: "primary";
33
- size: "base";
34
- children: string;
35
- asChild: false;
36
- disabled: false;
37
- loading: false;
38
- hoverEffect: "none";
39
- };
40
- };
41
- export default meta;
42
- type Story = StoryObj<typeof meta>;
43
- export declare const Primary: Story;
44
- export declare const Secondary: Story;
45
- export declare const Link: Story;
46
- export declare const WithIcon: Story;
47
- export declare const Aschild: Story;
48
- export declare const Spinner: Story;
@@ -1,46 +0,0 @@
1
- import type { StoryObj } from '@storybook/react/*';
2
- import React from 'react';
3
- declare const meta: {
4
- title: string;
5
- component: React.ForwardRefExoticComponent<import("../components/checkbox.js").CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
6
- parameters: {
7
- layout: string;
8
- docs: {
9
- description: {
10
- component: string;
11
- };
12
- };
13
- };
14
- tags: string[];
15
- argTypes: {
16
- size: {
17
- control: {
18
- type: "select";
19
- };
20
- options: string[];
21
- description: string;
22
- table: {
23
- defaultValue: {
24
- summary: string;
25
- };
26
- };
27
- };
28
- };
29
- args: {
30
- size: "base";
31
- };
32
- };
33
- export default meta;
34
- type Story = StoryObj<typeof meta>;
35
- export declare const Default: Story;
36
- export declare const Sizes: {
37
- (): import("react/jsx-runtime").JSX.Element;
38
- parameters: {
39
- docs: {
40
- description: {
41
- story: string;
42
- };
43
- };
44
- };
45
- };
46
- export declare const Disabled: () => import("react/jsx-runtime").JSX.Element;
@@ -1,36 +0,0 @@
1
- import React from 'react';
2
- import { Container } from '../components/index.js';
3
- import type { StoryObj } from '@storybook/react';
4
- declare const meta: {
5
- title: string;
6
- component: React.ForwardRefExoticComponent<{
7
- asChild?: boolean;
8
- children?: React.ReactNode;
9
- className?: string;
10
- type?: "default" | "home" | "none";
11
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
- parameters: {
13
- layout: string;
14
- docs: {
15
- description: {
16
- component: string;
17
- };
18
- };
19
- };
20
- tags: string[];
21
- argTypes: {
22
- type: {
23
- description: string;
24
- control: {
25
- type: "select";
26
- };
27
- options: string[];
28
- };
29
- };
30
- args: {
31
- type: "default";
32
- };
33
- };
34
- export default meta;
35
- type Story = StoryObj<typeof Container>;
36
- export declare const Default: Story;
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import { Dialog } from '../components/index.js';
3
- import type { StoryObj } from '@storybook/react/*';
4
- declare const meta: {
5
- title: string;
6
- component: React.FC<import("@radix-ui/react-dialog").DialogProps>;
7
- subcomponents: any;
8
- parameters: {
9
- layout: string;
10
- docs: {
11
- description: {
12
- component: string;
13
- };
14
- };
15
- };
16
- tags: string[];
17
- };
18
- export default meta;
19
- type Story = StoryObj<typeof Dialog>;
20
- export declare const Default: Story;