@anker-in/headless-ui 0.0.27-alpha.51 → 0.0.27-alpha.53

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 (89) hide show
  1. package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +1 -0
  2. package/dist/cjs/biz-components/Category/SwiperCategory.d.ts +16 -0
  3. package/dist/cjs/biz-components/Category/SwiperCategory.js +2 -0
  4. package/dist/cjs/biz-components/Category/SwiperCategory.js.map +7 -0
  5. package/dist/cjs/biz-components/Category/index.d.ts +1 -0
  6. package/dist/cjs/biz-components/Category/index.js +1 -1
  7. package/dist/cjs/biz-components/Category/index.js.map +3 -3
  8. package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -0
  9. package/dist/cjs/biz-components/Graphic/index.d.ts +1 -0
  10. package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -0
  11. package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +1 -0
  12. package/dist/cjs/biz-components/Marquee/index.d.ts +1 -0
  13. package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +1 -0
  14. package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +1 -0
  15. package/dist/cjs/biz-components/MemberEquity/index.d.ts +1 -0
  16. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +1 -0
  17. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  18. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  19. package/dist/cjs/biz-components/Shelf/Shelf.d.ts +1 -0
  20. package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +1 -0
  21. package/dist/cjs/biz-components/Slogan/index.d.ts +1 -0
  22. package/dist/cjs/biz-components/Slogan/index.js +1 -1
  23. package/dist/cjs/biz-components/Slogan/index.js.map +2 -2
  24. package/dist/cjs/biz-components/Tabs/Tabs.d.ts +1 -0
  25. package/dist/cjs/biz-components/Title/index.d.ts +1 -0
  26. package/dist/cjs/shared/Styles.d.ts +2 -1
  27. package/dist/cjs/shared/Styles.js +1 -1
  28. package/dist/cjs/shared/Styles.js.map +3 -3
  29. package/dist/cjs/shared/getKeyPropsString.d.ts +4 -0
  30. package/dist/cjs/shared/getKeyPropsString.js +2 -0
  31. package/dist/cjs/shared/getKeyPropsString.js.map +7 -0
  32. package/dist/cjs/shared/simpleHash.d.ts +1 -0
  33. package/dist/cjs/shared/simpleHash.js +2 -0
  34. package/dist/cjs/shared/simpleHash.js.map +7 -0
  35. package/dist/cjs/stories/HeroBanner.stories.d.ts +1 -0
  36. package/dist/cjs/stories/brandEquity.stories.d.ts +1 -0
  37. package/dist/cjs/stories/category.stories.d.ts +1 -0
  38. package/dist/cjs/stories/evaluate.stories.d.ts +1 -0
  39. package/dist/cjs/stories/graphic.stories.d.ts +2 -1
  40. package/dist/cjs/stories/marquee.stories.d.ts +1 -0
  41. package/dist/cjs/stories/mediaplayerMulti.stories.d.ts +1 -0
  42. package/dist/cjs/stories/shelf.stories.d.ts +1 -0
  43. package/dist/cjs/stories/shelfDisplay.stories.d.ts +1 -0
  44. package/dist/cjs/stories/slogan.stories.d.ts +1 -0
  45. package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +1 -0
  46. package/dist/esm/biz-components/Category/SwiperCategory.d.ts +16 -0
  47. package/dist/esm/biz-components/Category/SwiperCategory.js +2 -0
  48. package/dist/esm/biz-components/Category/SwiperCategory.js.map +7 -0
  49. package/dist/esm/biz-components/Category/index.d.ts +1 -0
  50. package/dist/esm/biz-components/Category/index.js +1 -1
  51. package/dist/esm/biz-components/Category/index.js.map +3 -3
  52. package/dist/esm/biz-components/Evaluate/index.d.ts +1 -0
  53. package/dist/esm/biz-components/Graphic/index.d.ts +1 -0
  54. package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -0
  55. package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +1 -0
  56. package/dist/esm/biz-components/Marquee/index.d.ts +1 -0
  57. package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +1 -0
  58. package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +1 -0
  59. package/dist/esm/biz-components/MemberEquity/index.d.ts +1 -0
  60. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +1 -0
  61. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  62. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  63. package/dist/esm/biz-components/Shelf/Shelf.d.ts +1 -0
  64. package/dist/esm/biz-components/ShelfDisplay/index.d.ts +1 -0
  65. package/dist/esm/biz-components/Slogan/index.d.ts +1 -0
  66. package/dist/esm/biz-components/Slogan/index.js +1 -1
  67. package/dist/esm/biz-components/Slogan/index.js.map +2 -2
  68. package/dist/esm/biz-components/Tabs/Tabs.d.ts +1 -0
  69. package/dist/esm/biz-components/Title/index.d.ts +1 -0
  70. package/dist/esm/shared/Styles.d.ts +2 -1
  71. package/dist/esm/shared/Styles.js +1 -1
  72. package/dist/esm/shared/Styles.js.map +3 -3
  73. package/dist/esm/shared/getKeyPropsString.d.ts +4 -0
  74. package/dist/esm/shared/getKeyPropsString.js +2 -0
  75. package/dist/esm/shared/getKeyPropsString.js.map +7 -0
  76. package/dist/esm/shared/simpleHash.d.ts +1 -0
  77. package/dist/esm/shared/simpleHash.js +2 -0
  78. package/dist/esm/shared/simpleHash.js.map +7 -0
  79. package/dist/esm/stories/HeroBanner.stories.d.ts +1 -0
  80. package/dist/esm/stories/brandEquity.stories.d.ts +1 -0
  81. package/dist/esm/stories/category.stories.d.ts +1 -0
  82. package/dist/esm/stories/evaluate.stories.d.ts +1 -0
  83. package/dist/esm/stories/graphic.stories.d.ts +2 -1
  84. package/dist/esm/stories/marquee.stories.d.ts +1 -0
  85. package/dist/esm/stories/mediaplayerMulti.stories.d.ts +1 -0
  86. package/dist/esm/stories/shelf.stories.d.ts +1 -0
  87. package/dist/esm/stories/shelfDisplay.stories.d.ts +1 -0
  88. package/dist/esm/stories/slogan.stories.d.ts +1 -0
  89. package/package.json +1 -1
@@ -19,6 +19,7 @@ export interface BrandEquityProps extends ComponentCommonProps {
19
19
  declare const _default: {
20
20
  (props: Omit<BrandEquityProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
21
21
  className?: string;
22
+ data?: Record<string, any>;
22
23
  }): import("react/jsx-runtime").JSX.Element;
23
24
  displayName: string;
24
25
  };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export interface SwiperBoxProps {
3
+ data: {
4
+ list: any[];
5
+ configuration?: any;
6
+ };
7
+ id: string;
8
+ className?: string;
9
+ breakpoints?: Record<number, Object>;
10
+ Slide: React.ComponentType<{
11
+ data: any;
12
+ configuration?: any;
13
+ }>;
14
+ }
15
+ declare const SwiperBox: React.ForwardRefExoticComponent<SwiperBoxProps & React.RefAttributes<HTMLDivElement>>;
16
+ export default SwiperBox;
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var w=Object.create;var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var g=(e,i)=>{for(var r in i)t(e,r,{get:i[r],enumerable:!0})},l=(e,i,r,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of m(i))!S.call(e,o)&&o!==r&&t(e,o,{get:()=>i[o],enumerable:!(s=c(i,o))||s.enumerable});return e};var x=(e,i,r)=>(r=e!=null?w(u(e)):{},l(i||!e||!e.__esModule?t(r,"default",{value:e,enumerable:!0}):r,e)),y=e=>l(t({},"__esModule",{value:!0}),e);var M={};g(M,{default:()=>B});module.exports=y(M);var n=require("react/jsx-runtime"),d=x(require("react")),b=require("../../helpers/utils.js"),p=require("swiper/react"),a=require("swiper/modules");const f=d.default.forwardRef(({data:e,Slide:i,id:r})=>(0,n.jsx)(p.Swiper,{freeMode:!0,mousewheel:{forceToAxis:!0},className:"!overflow-visible",modules:[a.FreeMode,a.Mousewheel,a.Pagination],breakpoints:{0:{spaceBetween:16,slidesPerView:1,freeMode:!1},374:{spaceBetween:16,freeMode:!1,slidesPerView:1},768:{spaceBetween:16,freeMode:!1,slidesPerView:6}},children:e?.list?.map((s,o)=>(0,n.jsx)(p.SwiperSlide,{className:"!flex !h-[unset]",children:(0,n.jsx)(i,{data:s,configuration:e?.configuration})},r+"SwiperSlide"+o))}));f.displayName="SwiperBox";var B=f;
2
+ //# sourceMappingURL=SwiperCategory.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/Category/SwiperCategory.tsx"],
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, FreeMode, Mousewheel } from 'swiper/modules'\n\nexport interface SwiperBoxProps {\n data: {\n list: any[]\n configuration?: any\n }\n id: string\n className?: string\n breakpoints?: Record<number, Object>\n Slide: React.ComponentType<{ data: any; configuration?: any }>\n}\n\nconst SwiperBox = React.forwardRef<HTMLDivElement, SwiperBoxProps>(({ data, Slide, id }) => {\n return (\n <Swiper\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n className=\"!overflow-visible\"\n modules={[FreeMode, Mousewheel, Pagination]}\n breakpoints={{\n 0: {\n spaceBetween: 16,\n slidesPerView: 1,\n freeMode: false,\n },\n 374: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 1,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 6,\n },\n }}\n >\n {data?.list?.map((item, jIndex) => (\n <SwiperSlide key={id + 'SwiperSlide' + jIndex} className=\"!flex !h-[unset]\">\n <Slide data={item} configuration={data?.configuration} />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\n\nSwiperBox.displayName = 'SwiperBox'\n\nexport default SwiperBox\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8CU,IAAAI,EAAA,6BA7CVC,EAAkB,oBAClBC,EAAmB,kCACnBD,EAAoC,wBACpCE,EAAiD,0BAajD,MAAMC,EAAY,EAAAC,QAAM,WAA2C,CAAC,CAAE,KAAAC,EAAM,MAAAC,EAAO,GAAAC,CAAG,OAElF,OAAC,UACC,SAAU,GACV,WAAY,CACV,YAAa,EACf,EACA,UAAU,oBACV,QAAS,CAAC,WAAU,aAAY,YAAU,EAC1C,YAAa,CACX,EAAG,CACD,aAAc,GACd,cAAe,EACf,SAAU,EACZ,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EAEC,SAAAF,GAAM,MAAM,IAAI,CAACG,EAAMC,OACtB,OAAC,eAA8C,UAAU,mBACvD,mBAACH,EAAA,CAAM,KAAME,EAAM,cAAeH,GAAM,cAAe,GADvCE,EAAK,cAAgBE,CAEvC,CACD,EACH,CAEH,EAEDN,EAAU,YAAc,YAExB,IAAON,EAAQM",
6
+ "names": ["SwiperCategory_exports", "__export", "SwiperCategory_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_modules", "SwiperBox", "React", "data", "Slide", "id", "item", "jIndex"]
7
+ }
@@ -22,6 +22,7 @@ export interface CategoryProps {
22
22
  declare const _default: {
23
23
  (props: Omit<CategoryProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
24
24
  className?: string;
25
+ data?: Record<string, any>;
25
26
  }): import("react/jsx-runtime").JSX.Element;
26
27
  displayName: string;
27
28
  };
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var g=Object.create;var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},n=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of x(t))!w.call(e,a)&&a!==r&&i(e,a,{get:()=>t[a],enumerable:!(s=u(t,a))||s.enumerable});return e};var l=(e,t,r)=>(r=e!=null?g(b(e)):{},n(t||!e||!e.__esModule?i(r,"default",{value:e,enumerable:!0}):r,e)),h=e=>n(i({},"__esModule",{value:!0}),e);var N={};y(N,{default:()=>F});module.exports=h(N);var o=require("react/jsx-runtime"),k=require("react"),p=require("../../helpers/utils.js"),c=l(require("../../components/picture.js")),d=require("../../shared/Styles.js"),m=l(require("../Title/index.js")),f=l(require("../SwiperBox/index.js"));const C=({data:e,configuration:t})=>(0,o.jsxs)("div",{className:(0,p.cn)("box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]","laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]",t?.shape==="round"?"rounded-[16px]":"rounded-none"),children:[(0,o.jsx)(c.default,{className:"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover",source:e?.image}),(0,o.jsx)("p",{className:"tablet:text-lg flex-1 text-center text-sm font-semibold",children:e?.name})]}),v=({data:e,buildData:t,className:r="",key:s})=>(0,o.jsxs)("div",{className:(0,p.cn)("w-full",r),children:[e?.title&&(0,o.jsx)(m.default,{data:{title:e?.title}}),(0,o.jsx)(f.default,{className:"!overflow-visible",id:"Category"+s,data:{list:e?.products,configuration:{shape:e?.shape}},Slide:C,breakpoints:{0:{spaceBetween:"12px",freeMode:!1,slidesPerView:1},374:{spaceBetween:"12px",freeMode:!1,slidesPerView:3.3},768:{spaceBetween:"16px",freeMode:!1,slidesPerView:6}}})]});var F=(0,d.withStyles)(v);
1
+ "use strict";"use client";var f=Object.create;var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var v=(e,r)=>{for(var o in r)i(e,o,{get:r[o],enumerable:!0})},p=(e,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of x(r))!h.call(e,s)&&s!==o&&i(e,s,{get:()=>r[s],enumerable:!(a=g(r,s))||a.enumerable});return e};var c=(e,r,o)=>(o=e!=null?f(b(e)):{},p(r||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e)),y=e=>p(i({},"__esModule",{value:!0}),e);var A={};v(A,{default:()=>E});module.exports=y(A);var t=require("react/jsx-runtime"),S=require("react"),l=require("../../helpers/utils.js"),n=c(require("../../components/picture.js")),m=require("../../shared/Styles.js"),u=c(require("../Title/index.js")),d=c(require("./SwiperCategory.js"));const F=(e,r)=>{const o=[];for(let a=0;a<e.length;a+=r)o.push(e.slice(a,a+r));return o},N=({data:e,configuration:r})=>(0,t.jsxs)("div",{className:(0,l.cn)("box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]","laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]",r?.shape==="round"?"rounded-[16px]":"rounded-none"),children:[(0,t.jsx)(n.default,{className:"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover",source:e?.image}),(0,t.jsx)("p",{className:"tablet:text-lg flex-1 text-center text-sm font-semibold",children:e?.name})]}),C=({data:e,configuration:r})=>(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3",children:e?.map((o,a)=>(0,t.jsxs)("div",{className:(0,l.cn)("box-border max-h-[126px] w-full overflow-hidden bg-[#EAEAEC]","cursor-pointer px-3 py-4 hover:bg-[#FFFFFF]",r?.shape==="round"?"rounded-[16px]":"rounded-none"),children:[(0,t.jsx)(n.default,{className:"mb-2 flex h-[74px] w-full items-center object-cover",source:o?.image}),(0,t.jsx)("p",{className:"flex-1 truncate text-center text-sm font-semibold",children:o?.name})]},`${o?.name}${a}`))}),w=({data:e,configuration:r})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"tablet:block hidden",children:(0,t.jsx)("div",{className:"mx-auto flex w-full gap-4",children:e?.map((o,a)=>(0,t.jsxs)("div",{className:(0,l.cn)("box-border flex w-[calc(20%-12px)] shrink-0 flex-col overflow-hidden bg-[#EAEAEC]","laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]",r?.shape==="round"?"rounded-[16px]":"rounded-none"),children:[(0,t.jsx)(n.default,{className:"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover",source:o?.image}),(0,t.jsx)("p",{className:"tablet:text-lg flex-1 text-center text-sm font-semibold",children:o?.name})]},a))})}),(0,t.jsx)("div",{className:"tablet:hidden block",children:(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3",children:e?.map((o,a)=>(0,t.jsxs)("div",{className:(0,l.cn)("box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden bg-[#EAEAEC]","cursor-pointer p-4 hover:bg-[#FFFFFF]",a===0?"row-span-2":"",r?.shape==="round"?"rounded-[16px]":"rounded-none"),children:[(0,t.jsx)(n.default,{className:(0,l.cn)("mb-2 flex h-[74px] w-full items-center object-cover",a===0?"h-[140px]":"h-[74px]"),source:o?.image}),(0,t.jsx)("p",{className:"line-clamp-2 flex-1 text-center text-sm font-semibold",children:o?.name})]},a))})})]}),k=({data:e,buildData:r,className:o="",key:a})=>{const s=e?.products?.length<=5;return(0,t.jsxs)("div",{className:(0,l.cn)("w-full",o),children:[e?.title&&(0,t.jsx)(u.default,{data:{title:e?.title}}),s?(0,t.jsx)(w,{data:e?.products,configuration:{shape:e?.shape}}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"tablet:block hidden",children:(0,t.jsx)(d.default,{id:`Category${a}`,Slide:N,data:{list:e?.products,configuration:{shape:e?.shape}}})}),(0,t.jsx)("div",{className:"tablet:hidden block overflow-hidden",children:(0,t.jsx)(d.default,{id:`Category1${a}`,Slide:C,data:{list:F(e?.products,6),configuration:{shape:e?.shape}}})})]})]})};var E=(0,m.withStyles)(k);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Category/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: string\n name: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n data: {\n products: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n key?: string\n}\n\nconst CategoryItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]',\n 'laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-[16px]' : 'rounded-none'\n )}\n >\n <Picture className=\"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover\" source={data?.image} />\n <p className=\"tablet:text-lg flex-1 text-center text-sm font-semibold\">{data?.name}</p>\n </div>\n )\n}\n\nconst Category: React.FC<CategoryProps> = ({ data, buildData, className = '', key }) => {\n return (\n <div className={cn('w-full', className)}>\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Category' + key}\n data={{ list: data?.products, configuration: { shape: data?.shape } }}\n Slide={CategoryItem}\n breakpoints={{\n 0: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: '12px',\n freeMode: false,\n slidesPerView: 3.3,\n },\n 768: {\n spaceBetween: '16px',\n freeMode: false,\n slidesPerView: 6,\n },\n }}\n />\n </div>\n )\n}\n\nexport default withStyles(Category)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiCI,IAAAI,EAAA,6BAhCJC,EAAkB,iBAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAA2B,kCAC3BC,EAAkB,gCAClBC,EAAsB,oCAyBtB,MAAMC,EAAe,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,OAExC,QAAC,OACC,aAAW,MACT,+DACA,+DACAA,GAAe,QAAU,QAAU,iBAAmB,cACxD,EAEA,oBAAC,EAAAC,QAAA,CAAQ,UAAU,uEAAuE,OAAQF,GAAM,MAAO,KAC/G,OAAC,KAAE,UAAU,0DAA2D,SAAAA,GAAM,KAAK,GACrF,EAIEG,EAAoC,CAAC,CAAE,KAAAH,EAAM,UAAAI,EAAW,UAAAC,EAAY,GAAI,IAAAC,CAAI,OAE9E,QAAC,OAAI,aAAW,MAAG,SAAUD,CAAS,EACnC,UAAAL,GAAM,UAAS,OAAC,EAAAO,QAAA,CAAM,KAAM,CAAE,MAAOP,GAAM,KAAM,EAAG,KACrD,OAAC,EAAAQ,QAAA,CACC,UAAU,oBACV,GAAI,WAAaF,EACjB,KAAM,CAAE,KAAMN,GAAM,SAAU,cAAe,CAAE,MAAOA,GAAM,KAAM,CAAE,EACpE,MAAOD,EACP,YAAa,CACX,EAAG,CACD,aAAc,OACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,OACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EAIJ,IAAOT,KAAQ,cAAWa,CAAQ",
6
- "names": ["Category_exports", "__export", "Category_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_Styles", "import_Title", "import_SwiperBox", "CategoryItem", "data", "configuration", "Picture", "Category", "buildData", "className", "key", "Title", "SwiperBox"]
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from './SwiperCategory.js'\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: string\n name: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n theme?: 'light' | 'dark'\n data: {\n products: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n key?: string\n}\n\nconst chunkArray = (arr: any[], size: number) => {\n const chunks = []\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size))\n }\n return chunks\n}\n\nconst CategoryPcItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'box-border flex w-full flex-col overflow-hidden bg-[#EAEAEC]',\n 'laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-[16px]' : 'rounded-none'\n )}\n >\n <Picture className=\"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover\" source={data?.image} />\n <p className=\"tablet:text-lg flex-1 text-center text-sm font-semibold\">{data?.name}</p>\n </div>\n )\n}\n\nconst CategoryMobileItem = ({ data, configuration }: { data: CategoryItem[]; configuration?: any }) => {\n return (\n <div className=\"grid grid-cols-2 gap-3\">\n {data?.map((item, index) => {\n return (\n <div\n key={`${item?.name}${index}`}\n className={cn(\n 'box-border max-h-[126px] w-full overflow-hidden bg-[#EAEAEC]',\n 'cursor-pointer px-3 py-4 hover:bg-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-[16px]' : 'rounded-none'\n )}\n >\n <Picture className=\"mb-2 flex h-[74px] w-full items-center object-cover\" source={item?.image} />\n <p className=\"flex-1 truncate text-center text-sm font-semibold\">{item?.name}</p>\n </div>\n )\n })}\n </div>\n )\n}\n\nconst SoundCoreCategoryItem = ({ data, configuration }: { data: CategoryItem[]; configuration?: any }) => {\n return (\n <>\n <div className=\"tablet:block hidden\">\n <div className=\"mx-auto flex w-full gap-4\">\n {data?.map((item, index) => {\n return (\n <div\n key={index}\n className={cn(\n 'box-border flex w-[calc(20%-12px)] shrink-0 flex-col overflow-hidden bg-[#EAEAEC]',\n 'laptop:p-6 desktop:p-8 cursor-pointer p-4 hover:bg-[#FFFFFF]',\n configuration?.shape === 'round' ? 'rounded-[16px]' : 'rounded-none'\n )}\n >\n <Picture\n className=\"tablet:h-[146px] mb-2 flex h-[74px] w-full items-center object-cover\"\n source={item?.image}\n />\n <p className=\"tablet:text-lg flex-1 text-center text-sm font-semibold\">{item?.name}</p>\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"tablet:hidden block\">\n <div className=\"grid grid-cols-2 gap-3\">\n {data?.map((item, index) => {\n return (\n <div\n key={index}\n className={cn(\n 'box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden bg-[#EAEAEC]',\n 'cursor-pointer p-4 hover:bg-[#FFFFFF]',\n index === 0 ? 'row-span-2' : '',\n configuration?.shape === 'round' ? 'rounded-[16px]' : 'rounded-none'\n )}\n >\n <Picture\n className={cn(\n 'mb-2 flex h-[74px] w-full items-center object-cover',\n index === 0 ? 'h-[140px]' : 'h-[74px]'\n )}\n source={item?.image}\n />\n <p className=\"line-clamp-2 flex-1 text-center text-sm font-semibold\">{item?.name}</p>\n </div>\n )\n })}\n </div>\n </div>\n </>\n )\n}\n\nconst Category: React.FC<CategoryProps> = ({ data, buildData, className = '', key }) => {\n // soundcore\u54C1\u724C\u54C1\u7C7B\u4E0D\u8D85\u8FC75\u4E2A\uFF0C\u5355\u72EC\u505A\u6837\u5F0F\u5904\u7406\n const isSoundCore = data?.products?.length <= 5\n return (\n <div className={cn('w-full', className)}>\n {data?.title && <Title data={{ title: data?.title }} />}\n {isSoundCore ? (\n <SoundCoreCategoryItem data={data?.products} configuration={{ shape: data?.shape }} />\n ) : (\n <>\n <div className=\"tablet:block hidden\">\n <SwiperBox\n id={`Category${key}`}\n Slide={CategoryPcItem}\n data={{ list: data?.products, configuration: { shape: data?.shape } }}\n />\n </div>\n <div className=\"tablet:hidden block overflow-hidden\">\n <SwiperBox\n id={`Category1${key}`}\n Slide={CategoryMobileItem}\n data={{ list: chunkArray(data?.products, 6), configuration: { shape: data?.shape } }}\n />\n </div>\n </>\n )}\n </div>\n )\n}\n\nexport default withStyles(Category)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAyCI,IAAAI,EAAA,6BAxCJC,EAAkB,iBAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAA2B,kCAC3BC,EAAkB,gCAClBC,EAAsB,kCAyBtB,MAAMC,EAAa,CAACC,EAAYC,IAAiB,CAC/C,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,EAAI,OAAQG,GAAKF,EACnCC,EAAO,KAAKF,EAAI,MAAMG,EAAGA,EAAIF,CAAI,CAAC,EAEpC,OAAOC,CACT,EAEME,EAAiB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,OAE1C,QAAC,OACC,aAAW,MACT,+DACA,+DACAA,GAAe,QAAU,QAAU,iBAAmB,cACxD,EAEA,oBAAC,EAAAC,QAAA,CAAQ,UAAU,uEAAuE,OAAQF,GAAM,MAAO,KAC/G,OAAC,KAAE,UAAU,0DAA2D,SAAAA,GAAM,KAAK,GACrF,EAIEG,EAAqB,CAAC,CAAE,KAAAH,EAAM,cAAAC,CAAc,OAE9C,OAAC,OAAI,UAAU,yBACZ,SAAAD,GAAM,IAAI,CAACI,EAAMC,OAEd,QAAC,OAEC,aAAW,MACT,+DACA,8CACAJ,GAAe,QAAU,QAA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,CAAsB,KAAMN,GAAM,SAAU,cAAe,CAAE,MAAOA,GAAM,KAAM,EAAG,KAEpF,oBACE,oBAAC,OAAI,UAAU,sBACb,mBAAC,EAAAa,QAAA,CACC,GAAI,WAAWH,CAAG,GAClB,MAAOX,EACP,KAAM,CAAE,KAAMC,GAAM,SAAU,cAAe,CAAE,MAAOA,GAAM,KAAM,CAAE,EACtE,EACF,KACA,OAAC,OAAI,UAAU,sCACb,mBAAC,EAAAa,QAAA,CACC,GAAI,YAAYH,CAAG,GACnB,MAAOP,EACP,KAAM,CAAE,KAAMT,EAAWM,GAAM,SAAU,CAAC,EAAG,cAAe,CAAE,MAAOA,GAAM,KAAM,CAAE,EACrF,EACF,GACF,GAEJ,CAEJ,EAEA,IAAOf,KAAQ,cAAWsB,CAAQ",
6
+ "names": ["Category_exports", "__export", "Category_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_Styles", "import_Title", "import_SwiperCategory", "chunkArray", "arr", "size", "chunks", "i", "CategoryPcItem", "data", "configuration", "Picture", "CategoryMobileItem", "item", "index", "SoundCoreCategoryItem", "Category", "buildData", "className", "key", "isSoundCore", "Title", "SwiperBox"]
7
7
  }
@@ -26,6 +26,7 @@ export interface EvaluateProps {
26
26
  declare const _default: {
27
27
  (props: Omit<EvaluateProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
28
28
  className?: string;
29
+ data?: Record<string, any>;
29
30
  }): import("react/jsx-runtime").JSX.Element;
30
31
  displayName: string;
31
32
  };
@@ -15,6 +15,7 @@ export interface GraphicProps extends ComponentCommonProps {
15
15
  declare const _default: {
16
16
  (props: Omit<GraphicProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
17
17
  className?: string;
18
+ data?: Record<string, any>;
18
19
  }): import("react/jsx-runtime").JSX.Element;
19
20
  displayName: string;
20
21
  };
@@ -20,6 +20,7 @@ interface GraphicAttractionBlockProps extends ComponentCommonProps {
20
20
  declare const _default: {
21
21
  (props: Omit<GraphicAttractionBlockProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
22
22
  className?: string;
23
+ data?: Record<string, any>;
23
24
  }): import("react/jsx-runtime").JSX.Element;
24
25
  displayName: string;
25
26
  };
@@ -3,6 +3,7 @@ import type { HeroBannerProps } from './types.js';
3
3
  declare const _default: {
4
4
  (props: Omit<HeroBannerProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
5
5
  className?: string;
6
+ data?: Record<string, any>;
6
7
  }): import("react/jsx-runtime").JSX.Element;
7
8
  displayName: string;
8
9
  };
@@ -26,6 +26,7 @@ declare const MarqueeTextContent: React.ForwardRefExoticComponent<MarqueeTextCon
26
26
  declare const _default: {
27
27
  (props: Omit<FastMarqueeProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
28
28
  className?: string;
29
+ data?: Record<string, any>;
29
30
  }): import("react/jsx-runtime").JSX.Element;
30
31
  displayName: string;
31
32
  };
@@ -2,6 +2,7 @@ import type { MediaPlayerBaseProps } from './types.js';
2
2
  declare const _default: {
3
3
  (props: Omit<MediaPlayerBaseProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
4
4
  className?: string;
5
+ data?: Record<string, any>;
5
6
  }): import("react/jsx-runtime").JSX.Element;
6
7
  displayName: string;
7
8
  };
@@ -2,6 +2,7 @@ import type { MediaPlayerMultiProps } from './types.js';
2
2
  declare const _default: {
3
3
  (props: Omit<MediaPlayerMultiProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
4
4
  className?: string;
5
+ data?: Record<string, any>;
5
6
  }): import("react/jsx-runtime").JSX.Element;
6
7
  displayName: string;
7
8
  };
@@ -2,6 +2,7 @@ import type { MemberEquityProps } from './types.js';
2
2
  declare const _default: {
3
3
  (props: Omit<MemberEquityProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
4
4
  className?: string;
5
+ data?: Record<string, any>;
5
6
  }): import("react/jsx-runtime").JSX.Element;
6
7
  displayName: string;
7
8
  };
@@ -3,6 +3,7 @@ import type { MultiLayoutGraphicBlockProps } from './types';
3
3
  declare const _default: {
4
4
  (props: Omit<MultiLayoutGraphicBlockProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
5
5
  className?: string;
6
+ data?: Record<string, any>;
6
7
  }): import("react/jsx-runtime").JSX.Element;
7
8
  displayName: string;
8
9
  };
@@ -1,2 +1,2 @@
1
- "use strict";var M=Object.create;var k=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var H=(a,l)=>{for(var i in l)k(a,i,{get:l[i],enumerable:!0})},g=(a,l,i,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let m of R(l))!z.call(a,m)&&m!==i&&k(a,m,{get:()=>l[m],enumerable:!(d=P(l,m))||d.enumerable});return a};var N=(a,l,i)=>(i=a!=null?M(S(a)):{},g(l||!a||!a.__esModule?k(i,"default",{value:a,enumerable:!0}):i,a)),$=a=>g(k({},"__esModule",{value:!0}),a);var E={};H(E,{default:()=>D});module.exports=$(E);var e=require("react/jsx-runtime"),T=N(require("react")),v=require("../../shared/Styles.js"),I=N(require("../../components/picture.js")),x=N(require("../../components/button.js")),B=require("../../components/heading.js"),G=require("../../components/text.js"),o=require("../../components/carousel.js"),c=require("../../components/gird.js"),w=N(require("../Title/index.js")),L=require("../../helpers/utils.js"),u=require("../../components/tabs.js");const h=({item:a,shape:l="square"})=>{const{theme:i="light",title:d,description:m,imageUrl:p,primaryButton:r,secondaryButton:f}=a;return(0,e.jsxs)("div",{className:(0,L.cn)("item-wrapper relative w-full",{"rounded-box":l==="rounded","aiui-dark":i==="dark"},"text-info-primary"),children:[(0,e.jsx)(I.default,{source:p?.url,className:"inset-0",style:{aspectRatio:`${p?.width}/${p?.height}`}}),(0,e.jsxs)("div",{className:"laptop:p-6 desktop:p-[32px] absolute inset-x-0 bottom-0 flex flex-col gap-6 p-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(B.Heading,{size:3,className:"item-title",html:d}),(0,e.jsx)(G.Text,{size:2,className:"item-description",html:m})]}),(0,e.jsxs)("div",{className:"flex gap-[16px]",children:[f&&(0,e.jsx)(x.default,{variant:"secondary",asChild:!0,children:(0,e.jsx)("a",{href:f.link,children:f.text})}),r&&(0,e.jsx)(x.default,{variant:"primary",asChild:!0,children:(0,e.jsx)("a",{href:r.link,children:r.text})})]})]})]})},q=T.default.forwardRef((a,l)=>{const{shape:i,sectionTitle:d,groupByTab:m=!1,items:p=[],carousel:r}=a.data,f=t=>{switch(t){case"full":return 12;case"half":return 6;case"one-third":return 4}},y=p.map(t=>t.tabName).filter(Boolean).filter((t,s,n)=>n.indexOf(t)===s),C=y.map(t=>({tabName:t,items:p.filter(s=>s.tabName===t)})).reduce((t,s)=>(t[s.tabName]=s.items,t),{});return(0,e.jsxs)("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:l,className:"text-info-primary",children:[d&&(0,e.jsx)(w.default,{data:{title:d},className:"section-title"}),m?(0,e.jsxs)(u.Tabs,{shape:i,align:"left",defaultValue:y[0],children:[(0,e.jsx)(u.TabsList,{children:y.map((t,s)=>(0,e.jsx)(u.TabsTrigger,{value:t,children:t},s))}),y.map((t,s)=>(0,e.jsx)(u.TabsContent,{value:t,className:"desktop:mt-[36px] mt-[24px] w-full",children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(c.Grid,{className:"w-full",children:[C[t].map((n,b)=>(0,e.jsx)(c.GridItem,{span:f(n.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)(h,{item:n})},b)),(0,e.jsx)(c.GridItem,{className:"laptop:hidden block",span:12,children:(0,e.jsx)(o.Carousel,{className:"",children:(0,e.jsx)(o.CarouselContent,{className:"flex",children:C[t].map((n,b)=>(0,e.jsx)(o.CarouselItem,{className:"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5",children:(0,e.jsx)(h,{item:n,shape:i})},b))})})})]}),r&&r?.items.length>0?(0,e.jsx)(o.Carousel,{className:"laptop:mt-4 mt-3",children:(0,e.jsx)(o.CarouselContent,{className:"flex",children:r.items.map((n,b)=>(0,e.jsx)(o.CarouselItem,{className:"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5",children:(0,e.jsx)(h,{item:n,shape:i})},b))})}):null]})},s))]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(c.Grid,{className:"w-full",children:[p.map((t,s)=>(0,e.jsx)(c.GridItem,{span:f(t.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)(h,{item:t})},s)),p.map((t,s)=>(0,e.jsx)(c.GridItem,{span:f("full"),className:"laptop:hidden block",children:(0,e.jsx)(h,{item:t})},s))]}),r&&r?.items.length>0?(0,e.jsx)(o.Carousel,{className:"laptop:mt-4 mt-3",children:(0,e.jsx)(o.CarouselContent,{className:"flex",children:r.items.map((t,s)=>(0,e.jsx)(o.CarouselItem,{className:"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5",children:(0,e.jsx)(h,{item:t,shape:i})},s))})}):null]})]})});var D=(0,v.withStyles)(q);
1
+ "use strict";var M=Object.create;var N=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var H=(a,l)=>{for(var i in l)N(a,i,{get:l[i],enumerable:!0})},g=(a,l,i,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let m of R(l))!z.call(a,m)&&m!==i&&N(a,m,{get:()=>l[m],enumerable:!(d=P(l,m))||d.enumerable});return a};var k=(a,l,i)=>(i=a!=null?M(S(a)):{},g(l||!a||!a.__esModule?N(i,"default",{value:a,enumerable:!0}):i,a)),$=a=>g(N({},"__esModule",{value:!0}),a);var E={};H(E,{default:()=>D});module.exports=$(E);var e=require("react/jsx-runtime"),v=k(require("react")),T=require("../../shared/Styles.js"),I=k(require("../../components/picture.js")),x=k(require("../../components/button.js")),w=require("../../components/heading.js"),B=require("../../components/text.js"),o=require("../../components/carousel.js"),c=require("../../components/gird.js"),G=k(require("../Title/index.js")),L=require("../../helpers/utils.js"),u=require("../../components/tabs.js");const h=({item:a,shape:l="square"})=>{const{theme:i="light",title:d,description:m,imageUrl:p,primaryButton:r,secondaryButton:f}=a;return(0,e.jsxs)("div",{className:(0,L.cn)("item-wrapper group relative w-full",{"rounded-box":l==="rounded","aiui-dark":i==="dark"},"text-info-primary"),children:[(0,e.jsx)(I.default,{source:p?.url,className:"inset-0 overflow-hidden",imgClassName:"transition-all duration-300 group-hover:scale-105",style:{aspectRatio:`${p?.width}/${p?.height}`}}),(0,e.jsxs)("div",{className:"laptop:p-6 desktop:p-[32px] absolute inset-x-0 bottom-0 flex flex-col gap-6 p-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(w.Heading,{size:3,className:"item-title",html:d}),(0,e.jsx)(B.Text,{size:2,className:"item-description",html:m})]}),(0,e.jsxs)("div",{className:"flex gap-[16px]",children:[f&&(0,e.jsx)(x.default,{variant:"secondary",asChild:!0,children:(0,e.jsx)("a",{href:f.link,children:f.text})}),r&&(0,e.jsx)(x.default,{variant:"primary",asChild:!0,children:(0,e.jsx)("a",{href:r.link,children:r.text})})]})]})]})},q=v.default.forwardRef((a,l)=>{const{shape:i,sectionTitle:d,groupByTab:m=!1,items:p=[],carousel:r}=a.data,f=t=>{switch(t){case"full":return 12;case"half":return 6;case"one-third":return 4}},y=p.map(t=>t.tabName).filter(Boolean).filter((t,s,n)=>n.indexOf(t)===s),C=y.map(t=>({tabName:t,items:p.filter(s=>s.tabName===t)})).reduce((t,s)=>(t[s.tabName]=s.items,t),{});return(0,e.jsxs)("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:l,className:"text-info-primary",children:[d&&(0,e.jsx)(G.default,{data:{title:d},className:"section-title"}),m?(0,e.jsxs)(u.Tabs,{shape:i,align:"left",defaultValue:y[0],children:[(0,e.jsx)(u.TabsList,{children:y.map((t,s)=>(0,e.jsx)(u.TabsTrigger,{value:t,children:t},s))}),y.map((t,s)=>(0,e.jsx)(u.TabsContent,{value:t,className:"desktop:mt-[36px] mt-[24px] w-full",children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(c.Grid,{className:"w-full",children:[C[t].map((n,b)=>(0,e.jsx)(c.GridItem,{span:f(n.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)(h,{item:n})},b)),(0,e.jsx)(c.GridItem,{className:"laptop:hidden block",span:12,children:(0,e.jsx)(o.Carousel,{className:"",children:(0,e.jsx)(o.CarouselContent,{className:"flex",children:C[t].map((n,b)=>(0,e.jsx)(o.CarouselItem,{className:"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5",children:(0,e.jsx)(h,{item:n,shape:i})},b))})})})]}),r&&r?.items.length>0?(0,e.jsx)(o.Carousel,{className:"laptop:mt-4 mt-3",children:(0,e.jsx)(o.CarouselContent,{className:"flex",children:r.items.map((n,b)=>(0,e.jsx)(o.CarouselItem,{className:"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5",children:(0,e.jsx)(h,{item:n,shape:i})},b))})}):null]})},s))]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(c.Grid,{className:"w-full",children:[p.map((t,s)=>(0,e.jsx)(c.GridItem,{span:f(t.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)(h,{item:t})},s)),p.map((t,s)=>(0,e.jsx)(c.GridItem,{span:f("full"),className:"laptop:hidden block",children:(0,e.jsx)(h,{item:t})},s))]}),r&&r?.items.length>0?(0,e.jsx)(o.Carousel,{className:"laptop:mt-4 mt-3",children:(0,e.jsx)(o.CarouselContent,{className:"flex",children:r.items.map((t,s)=>(0,e.jsx)(o.CarouselItem,{className:"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5",children:(0,e.jsx)(h,{item:t,shape:i})},s))})}):null]})]})});var D=(0,T.withStyles)(q);
2
2
  //# sourceMappingURL=MultiLayoutGraphicBlock.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.tsx"],
4
- "sourcesContent": ["import React from 'react'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withStyles } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport { Carousel, CarouselContent, CarouselItem } from '../../components/carousel.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport Title from '../Title/index.js'\nimport type { Shape } from '../../types/props'\nimport { cn } from '../../helpers/utils.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nconst ItemBlock = ({ item, shape = 'square' }: { item: Item } & { shape?: Shape }) => {\n const { theme = 'light', title, description, imageUrl, primaryButton, secondaryButton } = item\n\n return (\n <div\n className={cn(\n `item-wrapper relative w-full`,\n {\n 'rounded-box': shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n },\n 'text-info-primary'\n )}\n >\n <Picture\n source={imageUrl?.url}\n className=\"inset-0\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n <div className=\"laptop:p-6 desktop:p-[32px] absolute inset-x-0 bottom-0 flex flex-col gap-6 p-3\">\n <div>\n <Heading size={3} className=\"item-title\" html={title} />\n <Text size={2} className=\"item-description\" html={description} />\n </div>\n <div className=\"flex gap-[16px]\">\n {secondaryButton && (\n <Button variant=\"secondary\" asChild>\n <a href={secondaryButton.link}>{secondaryButton.text}</a>\n </Button>\n )}\n {primaryButton && (\n <Button variant=\"primary\" asChild>\n <a href={primaryButton.link}>{primaryButton.text}</a>\n </Button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = props.data\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section data-ui-component-id=\"MultiLayoutGraphicBlock\" ref={ref} className=\"text-info-primary\">\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={tabNames[0]!}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger key={index} value={tabName!}>\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={tabName!} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <Grid className=\"w-full\">\n {tabItemsMaps[tabName].map((item, index) => (\n <GridItem key={index} span={getSpan(item.width ?? 'full')} className=\"laptop:block hidden\">\n <ItemBlock item={item} />\n </GridItem>\n ))}\n {\n <GridItem className=\"laptop:hidden block\" span={12}>\n <Carousel className=\"\">\n <CarouselContent className=\"flex\">\n {tabItemsMaps[tabName].map((item, index) => (\n <CarouselItem key={index} className=\"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5\">\n <ItemBlock item={item} shape={shape} />\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n </GridItem>\n }\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <Carousel className=\"laptop:mt-4 mt-3\">\n <CarouselContent className=\"flex\">\n {carousel.items.map((item, index) => (\n <CarouselItem key={index} className=\"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5\">\n <ItemBlock item={item} shape={shape} />\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => (\n <GridItem key={index} span={getSpan(item.width ?? 'full')} className=\"laptop:block hidden\">\n <ItemBlock item={item} />\n </GridItem>\n ))}\n {items.map((item, index) => (\n <GridItem key={index} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock item={item} />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <Carousel className=\"laptop:mt-4 mt-3\">\n <CarouselContent className=\"flex\">\n {carousel.items.map((item, index) => (\n <CarouselItem key={index} className=\"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5\">\n <ItemBlock item={item} shape={shape} />\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n ) : null}\n </>\n )}\n </section>\n )\n})\n\nexport default withStyles(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2BM,IAAAI,EAAA,6BA3BNC,EAAkB,oBAElBC,EAA2B,kCAC3BC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAwB,uCACxBC,EAAqB,oCACrBC,EAAwD,wCACxDC,EAA+B,oCAC/BC,EAAkB,gCAElBC,EAAmB,kCACnBC,EAAyD,oCACzD,MAAMC,EAAY,CAAC,CAAE,KAAAC,EAAM,MAAAC,EA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,gBAAyB,UAAU,qDAClC,mBAACtB,EAAA,CAAU,KAAMC,EAAM,MAAOC,EAAO,GADpBoB,CAEnB,CACD,EACH,EACF,EACE,MACN,GAjCgBA,CAkClB,CACD,GACH,KAEA,oBACE,qBAAC,QAAK,UAAU,SACb,UAAAL,EAAM,IAAI,CAAChB,EAAMqB,OAChB,OAAC,YAAqB,KAAMH,EAAQlB,EAAK,OAAS,MAAM,EAAG,UAAU,sBACnE,mBAACD,EAAA,CAAU,KAAMC,EAAM,GADVqB,CAEf,CACD,EACAL,EAAM,IAAI,CAAChB,EAAMqB,OAChB,OAAC,YAAqB,KAAMH,EAAQ,MAAM,EAAG,UAAU,sBACrD,mBAACnB,EAAA,CAAU,KAAMC,EAAM,GADVqB,CAEf,CACD,GACH,EACCJ,GAAYA,GAAU,MAAM,OAAS,KACpC,OAAC,YAAS,UAAU,mBAClB,mBAAC,mBAAgB,UAAU,OACxB,SAAAA,EAAS,MAAM,IAAI,CAACjB,EAAMqB,OACzB,OAAC,gBAAyB,UAAU,qDAClC,mBAACtB,EAAA,CAAU,KAAMC,EAAM,MAAOC,EAAO,GADpBoB,CAEnB,CACD,EACH,EACF,EACE,MACN,GAEJ,CAEJ,CAAC,EAED,IAAOpC,KAAQ,cAAWyB,CAAuB",
4
+ "sourcesContent": ["import React from 'react'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withStyles } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport { Carousel, CarouselContent, CarouselItem } from '../../components/carousel.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport Title from '../Title/index.js'\nimport type { Shape } from '../../types/props'\nimport { cn } from '../../helpers/utils.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nconst ItemBlock = ({ item, shape = 'square' }: { item: Item } & { shape?: Shape }) => {\n const { theme = 'light', title, description, imageUrl, primaryButton, secondaryButton } = item\n\n return (\n <div\n className={cn(\n `item-wrapper group relative w-full`,\n {\n 'rounded-box': shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n },\n 'text-info-primary'\n )}\n >\n <Picture\n source={imageUrl?.url}\n className=\"inset-0 overflow-hidden\"\n imgClassName=\"transition-all duration-300 group-hover:scale-105\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n <div className=\"laptop:p-6 desktop:p-[32px] absolute inset-x-0 bottom-0 flex flex-col gap-6 p-3\">\n <div>\n <Heading size={3} className=\"item-title\" html={title} />\n <Text size={2} className=\"item-description\" html={description} />\n </div>\n <div className=\"flex gap-[16px]\">\n {secondaryButton && (\n <Button variant=\"secondary\" asChild>\n <a href={secondaryButton.link}>{secondaryButton.text}</a>\n </Button>\n )}\n {primaryButton && (\n <Button variant=\"primary\" asChild>\n <a href={primaryButton.link}>{primaryButton.text}</a>\n </Button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = props.data\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section data-ui-component-id=\"MultiLayoutGraphicBlock\" ref={ref} className=\"text-info-primary\">\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={tabNames[0]!}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger key={index} value={tabName!}>\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={tabName!} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <Grid className=\"w-full\">\n {tabItemsMaps[tabName].map((item, index) => (\n <GridItem key={index} span={getSpan(item.width ?? 'full')} className=\"laptop:block hidden\">\n <ItemBlock item={item} />\n </GridItem>\n ))}\n {\n <GridItem className=\"laptop:hidden block\" span={12}>\n <Carousel className=\"\">\n <CarouselContent className=\"flex\">\n {tabItemsMaps[tabName].map((item, index) => (\n <CarouselItem key={index} className=\"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5\">\n <ItemBlock item={item} shape={shape} />\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n </GridItem>\n }\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <Carousel className=\"laptop:mt-4 mt-3\">\n <CarouselContent className=\"flex\">\n {carousel.items.map((item, index) => (\n <CarouselItem key={index} className=\"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5\">\n <ItemBlock item={item} shape={shape} />\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => (\n <GridItem key={index} span={getSpan(item.width ?? 'full')} className=\"laptop:block hidden\">\n <ItemBlock item={item} />\n </GridItem>\n ))}\n {items.map((item, index) => (\n <GridItem key={index} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock item={item} />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <Carousel className=\"laptop:mt-4 mt-3\">\n <CarouselContent className=\"flex\">\n {carousel.items.map((item, index) => (\n <CarouselItem key={index} className=\"tablet:basis-2/5 laptop:basis-[32%] flex basis-4/5\">\n <ItemBlock item={item} shape={shape} />\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n ) : null}\n </>\n )}\n </section>\n )\n})\n\nexport default withStyles(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2BM,IAAAI,EAAA,6BA3BNC,EAAkB,oBAElBC,EAA2B,kCAC3BC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAwB,uCACxBC,EAAqB,oCACrBC,EAAwD,wCACxDC,EAA+B,oCAC/BC,EAAkB,gCAElBC,EAAmB,kCACnBC,EAAyD,oCACzD,MAAMC,EAAY,CAAC,CAAE,KAAAC,EAAM,MAAAC,EAAQ,QAAS,IAA0C,CACpF,KAAM,CAAE,MAAAC,EAAQ,QAAS,MAAAC,EAAO,YAAAC,EAAa,SAAAC,EAAU,cAAAC,EAAe,gBAAAC,CAAgB,EAAIP,EAE1F,SACE,QAAC,OACC,aAAW,MACT,qCACA,CACE,cAAeC,IAAU,UACzB,YAAaC,IAAU,MACzB,EACA,mBACF,EAEA,oBAAC,EAAAM,QAAA,CACC,OAAQH,GAAU,IAClB,UAAU,0BACV,aAAa,oDACb,MAAO,CAAE,YAAa,GAAGA,GAAU,KAAK,IAAIA,GAAU,MAAM,EAAG,EACjE,KACA,QAAC,OAAI,UAAU,kFACb,qBAAC,OACC,oBAAC,WAAQ,KAAM,EAAG,UAAU,aAAa,KAAMF,EAAO,KACtD,OAAC,QAAK,KAAM,EAAG,UAAU,mBAAmB,KAAMC,EAAa,GACjE,KACA,QAAC,OAAI,UAAU,kBACZ,UAAAG,MACC,OAAC,EAAAE,QAAA,CAAO,QAAQ,YAAY,QAAO,GACjC,mBAAC,KAAE,KAAMF,EAAgB,KAAO,SAAAA,EAAgB,KAAK,EACvD,EAEDD,MACC,OAAC,EAAAG,QAAA,CAAO,QAAQ,UAAU,QAAO,GAC/B,mBAAC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J,CAEJ,CAAC,EAED,IAAOpC,KAAQ,cAAWyB,CAAuB",
6
6
  "names": ["MultiLayoutGraphicBlock_exports", "__export", "MultiLayoutGraphicBlock_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_Styles", "import_picture", "import_button", "import_heading", "import_text", "import_carousel", "import_gird", "import_Title", "import_utils", "import_tabs", "ItemBlock", "item", "shape", "theme", "title", "description", "imageUrl", "primaryButton", "secondaryButton", "Picture", "Button", "MultiLayoutGraphicBlock", "React", "props", "ref", "sectionTitle", "groupByTab", "items", "carousel", "getSpan", "width", "tabNames", "index", "arr", "tabItemsMaps", "tabName", "acc", "cur", "Title"]
7
7
  }
@@ -2,6 +2,7 @@ import type { ShelfProps } from './types.js';
2
2
  declare const _default: {
3
3
  (props: Omit<ShelfProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
4
4
  className?: string;
5
+ data?: Record<string, any>;
5
6
  }): import("react/jsx-runtime").JSX.Element;
6
7
  displayName: string;
7
8
  };
@@ -53,6 +53,7 @@ export interface ShelfDisplayProps {
53
53
  declare const _default: {
54
54
  (props: Omit<ShelfDisplayProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
55
55
  className?: string;
56
+ data?: Record<string, any>;
56
57
  }): import("react/jsx-runtime").JSX.Element;
57
58
  displayName: string;
58
59
  };
@@ -3,6 +3,7 @@ import type { SloganProps } from './types.js';
3
3
  declare const _default: {
4
4
  (props: Omit<SloganProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
5
5
  className?: string;
6
+ data?: Record<string, any>;
6
7
  }): import("react/jsx-runtime").JSX.Element;
7
8
  displayName: string;
8
9
  };
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var L=Object.create;var g=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var J=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},G=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Y(e))!B.call(t,s)&&s!==r&&g(t,s,{get:()=>e[s],enumerable:!(l=U(e,s))||l.enumerable});return t};var K=(t,e,r)=>(r=t!=null?L(q(t)):{},G(e||!t||!t.__esModule?g(r,"default",{value:t,enumerable:!0}):r,t)),O=t=>G(g({},"__esModule",{value:!0}),t);var W={};J(W,{default:()=>V});module.exports=O(W);var o=require("react/jsx-runtime"),n=K(require("react")),F=require("@gsap/react"),d=require("gsap"),b=require("gsap/SplitText"),x=require("gsap/ScrollTrigger"),D=require("../../helpers/utils.js"),h=require("../../components/index.js"),H=require("../../shared/Styles.js");d.gsap.registerPlugin(b.SplitText,x.ScrollTrigger);function Q(t=[],e=3){const r=[];for(let l=0;l<t.length;l+=e)r.push(t.slice(l,l+e));return r}const R=n.default.forwardRef(({data:t,className:e},r)=>{const{title:l,features:s=[],featureChunkSize:N=3}=t,[w,I]=n.default.useState(0),[P,v]=n.default.useState(!0),u=Q(s,N),y=u.length,p=s.length>N,A=p?[...u,u[0]]:u,S=40;n.default.useEffect(()=>{if(!p)return;const a=setInterval(()=>{I(i=>i+1),v(!0)},3e3);return()=>clearInterval(a)},[y,p]),n.default.useEffect(()=>{if(p)if(w===y){const a=setTimeout(()=>{v(!1),I(0)},500);return()=>clearTimeout(a)}else v(!0)},[w,y,p]);const f=(0,n.useRef)(null),m=(0,n.useRef)(null);return(0,F.useGSAP)(()=>{if(!f.current)return;m.current=new b.SplitText(f.current,{type:"words",wordsClass:"word"});const a=m.current.words;return d.gsap.set(a,{opacity:0}),x.ScrollTrigger.create({trigger:f.current,start:"top 80%",end:"top 50%",scrub:!0,onUpdate:i=>{const T=i.progress,c=a.length,C=1/c,E=.5;a.forEach((M,$)=>{const j=$/c*(1-E),z=C*(1+E);let k=(T-j)/z;k=Math.max(0,Math.min(k,1)),d.gsap.set(M,{opacity:k})})}}),()=>{m.current&&m.current.revert(),x.ScrollTrigger.getAll().forEach(i=>i.kill())}},[]),(0,o.jsxs)("div",{ref:r,className:(0,D.cn)("laptop:flex-row laptop:items-end laptop:justify-between text-info-primary desktop:min-h-[64px] lg-desktop:min-h-[128px] flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",e),children:[(0,o.jsx)(h.Heading,{ref:f,as:"h2",size:2,weight:"bold",align:"left",className:"slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none text-[#1D1D1F]",children:l}),s&&s.length>0&&(0,o.jsx)("div",{className:"relative w-full max-w-[500px] overflow-hidden",style:{height:`${S}px`},children:(0,o.jsx)("div",{className:(0,D.cn)(["flex flex-col",P?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${w*S}px)`},children:A.map((a,i)=>(0,o.jsx)("div",{className:"flex w-full flex-row items-stretch gap-3 overflow-hidden",style:{height:`${S}px`},children:a.map((T,c)=>(0,o.jsxs)(n.default.Fragment,{children:[c>0&&(0,o.jsx)("div",{className:"slogan-feature-divider w-px self-stretch bg-[#D9D9D9]"}),(0,o.jsx)(h.Text,{align:"left",as:"p",className:"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-2 text-[12px] font-medium leading-[1.4] text-[#1D1D1F]",html:T.title})]},c))},i))})})]})});R.displayName="Slogan";var V=(0,H.withStyles)(R);
1
+ "use strict";"use client";var L=Object.create;var g=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var J=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},G=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Y(e))!B.call(t,s)&&s!==r&&g(t,s,{get:()=>e[s],enumerable:!(l=U(e,s))||l.enumerable});return t};var K=(t,e,r)=>(r=t!=null?L(q(t)):{},G(e||!t||!t.__esModule?g(r,"default",{value:t,enumerable:!0}):r,t)),O=t=>G(g({},"__esModule",{value:!0}),t);var W={};J(W,{default:()=>V});module.exports=O(W);var o=require("react/jsx-runtime"),n=K(require("react")),F=require("@gsap/react"),d=require("gsap"),k=require("gsap/SplitText"),x=require("gsap/ScrollTrigger"),D=require("../../helpers/utils.js"),h=require("../../components/index.js"),H=require("../../shared/Styles.js");d.gsap.registerPlugin(k.SplitText,x.ScrollTrigger);function Q(t=[],e=3){const r=[];for(let l=0;l<t.length;l+=e)r.push(t.slice(l,l+e));return r}const R=n.default.forwardRef(({data:t,className:e=""},r)=>{const{title:l,features:s=[],featureChunkSize:N=3}=t,[w,I]=n.default.useState(0),[P,v]=n.default.useState(!0),u=Q(s,N),y=u.length,p=s.length>N,A=p?[...u,u[0]]:u,S=40;n.default.useEffect(()=>{if(!p)return;const a=setInterval(()=>{I(i=>i+1),v(!0)},3e3);return()=>clearInterval(a)},[y,p]),n.default.useEffect(()=>{if(p)if(w===y){const a=setTimeout(()=>{v(!1),I(0)},500);return()=>clearTimeout(a)}else v(!0)},[w,y,p]);const f=(0,n.useRef)(null),m=(0,n.useRef)(null);return(0,F.useGSAP)(()=>{if(!f.current)return;m.current=new k.SplitText(f.current,{type:"words",wordsClass:"word"});const a=m.current.words;return d.gsap.set(a,{opacity:0}),x.ScrollTrigger.create({trigger:f.current,start:"top 80%",end:"top 50%",scrub:!0,onUpdate:i=>{const T=i.progress,c=a.length,C=1/c,E=.5;a.forEach((M,$)=>{const j=$/c*(1-E),z=C*(1+E);let b=(T-j)/z;b=Math.max(0,Math.min(b,1)),d.gsap.set(M,{opacity:b})})}}),()=>{m.current&&m.current.revert(),x.ScrollTrigger.getAll().forEach(i=>i.kill())}},[]),(0,o.jsxs)("div",{ref:r,className:(0,D.cn)("laptop:flex-row laptop:items-end laptop:justify-between text-info-primary laptop:min-h-[64px] lg-desktop:min-h-[128px] flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",e),children:[(0,o.jsx)(h.Heading,{ref:f,as:"h2",size:2,weight:"bold",align:"left",className:"slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none text-[#1D1D1F]",children:l}),s&&s.length>0&&(0,o.jsx)("div",{className:"relative w-full max-w-[500px] overflow-hidden",style:{height:`${S}px`},children:(0,o.jsx)("div",{className:(0,D.cn)(["flex flex-col",P?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${w*S}px)`},children:A.map((a,i)=>(0,o.jsx)("div",{className:"flex w-full flex-row items-stretch gap-3 overflow-hidden",style:{height:`${S}px`},children:a.map((T,c)=>(0,o.jsxs)(n.default.Fragment,{children:[c>0&&(0,o.jsx)("div",{className:"slogan-feature-divider w-px self-stretch bg-[#D9D9D9]"}),(0,o.jsx)(h.Text,{align:"left",as:"p",className:"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-2 text-[12px] font-medium leading-[1.4] text-[#1D1D1F]",html:T.title})]},c))},i))})})]})});R.displayName="Slogan";var V=(0,H.withStyles)(R);
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, { useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/SplitText'\nimport { ScrollTrigger } from 'gsap/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\n\ngsap.registerPlugin(SplitText, ScrollTrigger)\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 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 // \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(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n if (!titleRef.current) return\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 ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top 80%',\n end: 'top 50%',\n scrub: true,\n onUpdate: self => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word, i) => {\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 return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach(t => t.kill())\n }\n }, [])\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:flex-row laptop:items-end laptop:justify-between text-info-primary desktop:min-h-[64px] lg-desktop:min-h-[128px] 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=\"slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none text-[#1D1D1F]\"\n >\n {title}\n </Heading>\n {features && features.length > 0 && (\n <div className=\"relative w-full max-w-[500px] overflow-hidden\" style={{ height: `${groupHeight}px` }}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]' : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className=\"flex w-full flex-row items-stretch gap-3 overflow-hidden\"\n style={{ height: `${groupHeight}px` }}\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-[#D9D9D9]\" />}\n <Text\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-2 text-[12px] font-medium leading-[1.4] text-[#1D1D1F]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withStyles(Slogan)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmGM,IAAAI,EAAA,6BAlGNC,EAA8B,oBAC9BA,EAAwB,uBACxBC,EAAqB,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E,kBACzF,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaQ,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACiB,EAAOC,OACzB,OAAC,OACC,UAAU,2DACV,MAAO,CAAE,OAAQ,GAAGjB,CAAW,IAAK,EAGnC,SAAAgB,EAAM,IAAI,CAACE,EAASC,OACnB,QAAC,EAAAlC,QAAM,SAAN,CACE,UAAAkC,EAAQ,MAAK,OAAC,OAAI,UAAU,wDAAwD,KACrF,OAAC,QACC,MAAM,OACN,GAAG,IACH,UAAU,8HACV,KAAMD,EAAQ,MAChB,IAPmBC,CAQrB,CACD,GAZIF,CAaP,CACD,EACH,EACF,GAEJ,CAEJ,CAAC,EAEDjC,EAAO,YAAc,SAErB,IAAOf,KAAQ,cAAWe,CAAM",
4
+ "sourcesContent": ["'use client'\nimport React, { useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/SplitText'\nimport { ScrollTrigger } from 'gsap/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\n\ngsap.registerPlugin(SplitText, ScrollTrigger)\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 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 // \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(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n if (!titleRef.current) return\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 ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top 80%',\n end: 'top 50%',\n scrub: true,\n onUpdate: self => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word, i) => {\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 return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach(t => t.kill())\n }\n }, [])\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:flex-row laptop:items-end laptop:justify-between text-info-primary laptop:min-h-[64px] lg-desktop:min-h-[128px] 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=\"slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none text-[#1D1D1F]\"\n >\n {title}\n </Heading>\n {features && features.length > 0 && (\n <div className=\"relative w-full max-w-[500px] overflow-hidden\" style={{ height: `${groupHeight}px` }}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]' : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className=\"flex w-full flex-row items-stretch gap-3 overflow-hidden\"\n style={{ height: `${groupHeight}px` }}\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-[#D9D9D9]\" />}\n <Text\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text tablet:text-[13px] laptop:text-[14px] line-clamp-2 text-[12px] font-medium leading-[1.4] text-[#1D1D1F]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withStyles(Slogan)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmGM,IAAAI,EAAA,6BAlGNC,EAA8B,oBAC9BA,EAAwB,uBACxBC,EAAqB,gBACrBC,EAA0B,0BAC1BC,EAA8B,8BAC9BC,EAAmB,kCACnBC,EAA8B,qCAC9BC,EAA2B,kCAG3B,OAAK,eAAe,YAAW,eAAa,EAE5C,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,OA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C,QACC,MAAM,OACN,GAAG,IACH,UAAU,8HACV,KAAMD,EAAQ,MAChB,IAPmBC,CAQrB,CACD,GAZIF,CAaP,CACD,EACH,EACF,GAEJ,CAEJ,CAAC,EAEDjC,EAAO,YAAc,SAErB,IAAOf,KAAQ,cAAWe,CAAM",
6
6
  "names": ["Slogan_exports", "__export", "Slogan_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "chunkArray", "array", "size", "result", "i", "Slogan", "React", "data", "className", "ref", "title", "features", "featureChunkSize", "groupIndex", "setGroupIndex", "isTransitioning", "setIsTransitioning", "featuresGroups", "totalGroups", "needCarousel", "displayGroups", "groupHeight", "timer", "handle", "titleRef", "splitTextInstance", "words", "self", "progress", "total", "interval", "overlap", "word", "start", "width", "opacity", "t", "group", "idx", "feature", "index"]
7
7
  }
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  declare const _default: {
4
4
  (props: Omit<TabsProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
5
5
  className?: string;
6
+ data?: Record<string, any>;
6
7
  }): import("react/jsx-runtime").JSX.Element;
7
8
  displayName: string;
8
9
  };
@@ -3,6 +3,7 @@ import type { TitleProps } from './types.js';
3
3
  declare const _default: {
4
4
  (props: Omit<TitleProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
5
5
  className?: string;
6
+ data?: Record<string, any>;
6
7
  }): import("react/jsx-runtime").JSX.Element;
7
8
  displayName: string;
8
9
  };
@@ -15,7 +15,7 @@ export declare const getStylesProps: <T extends Record<string, unknown>>(props:
15
15
  * 样式 Hook,返回样式类名和样式组件
16
16
  * @param styleProps - 样式属性
17
17
  */
18
- export declare const useStyles: (styleProps: Partial<StylesProps>) => {
18
+ export declare const useStyles: (styleProps: Partial<StylesProps>, data?: Record<string, any>) => {
19
19
  readonly className: `block-${string} `;
20
20
  readonly StyleComponent: import("react/jsx-runtime").JSX.Element;
21
21
  readonly uid: string;
@@ -28,6 +28,7 @@ export declare const useStyles: (styleProps: Partial<StylesProps>) => {
28
28
  export declare function withStyles<P extends object>(WrappedComponent: React.ComponentType<P>, defaultStyleProps?: Partial<StylesProps>): {
29
29
  (props: Omit<P, keyof StylesProps> & Partial<StylesProps> & {
30
30
  className?: string;
31
+ data?: Record<string, any>;
31
32
  }): import("react/jsx-runtime").JSX.Element;
32
33
  displayName: string;
33
34
  };
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var s in e)a(t,s,{get:e[s],enumerable:!0})},g=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!P.call(t,r)&&r!==s&&a(t,r,{get:()=>e[r],enumerable:!(n=d(e,r))||n.enumerable});return t};var f=t=>g(a({},"__esModule",{value:!0}),t);var $={};p($,{getStylesProps:()=>c,useStyles:()=>y,withStyles:()=>N});module.exports=f($);var o=require("react/jsx-runtime"),l=require("react");const i=()=>`style_${Math.random().toString(36).substring(2,9)}_${Date.now().toString(36)}`,c=t=>{const{style:e,uid:s,disabled:n}=t;return{style:e,uid:s,disabled:n}},b=({style:t,uid:e=i(),disabled:s=!1})=>!t||s?null:(0,o.jsx)("style",{suppressHydrationWarning:!0,"data-style-id":e,children:`.block-${e} { ${t} }`}),y=t=>{const e=(0,l.useMemo)(()=>t?.uid||i(),[t?.uid]),s=(0,l.useMemo)(()=>(0,o.jsx)(b,{...t,uid:e}),[t,e]);return{className:`block-${e} `,StyleComponent:s,uid:e}};function N(t,e){const s=function(n){const r={...e,...c(n)},{className:u,StyleComponent:S}=y(r);return(0,o.jsxs)(o.Fragment,{children:[S,(0,o.jsx)(t,{...n,className:`${u} ${n.className}`})]})};return s.displayName=t.displayName||t.name||"Component",s}
1
+ "use strict";var g=Object.create;var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var b=(t,e)=>{for(var s in e)a(t,s,{get:e[s],enumerable:!0})},i=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of f(e))!R.call(t,r)&&r!==s&&a(t,r,{get:()=>e[r],enumerable:!(n=p(e,r))||n.enumerable});return t};var $=(t,e,s)=>(s=t!=null?g(N(t)):{},i(e||!t||!t.__esModule?a(s,"default",{value:t,enumerable:!0}):s,t)),k=t=>i(a({},"__esModule",{value:!0}),t);var C={};b(C,{getStylesProps:()=>m,useStyles:()=>S,withStyles:()=>h});module.exports=k(C);var o=require("react/jsx-runtime"),l=require("react"),y=require("./simpleHash.js"),d=$(require("./getKeyPropsString.js"));const c=t=>{const e=(0,d.default)(t);return`style_${(0,y.simpleHash)(e)}`},m=t=>{const{style:e,uid:s,disabled:n}=t;return{style:e,uid:s,disabled:n}},x=({style:t,uid:e=c({}),disabled:s=!1})=>!t||s?null:(0,o.jsx)("style",{suppressHydrationWarning:!0,"data-style-id":e,children:`.block-${e} { ${t} }`}),S=(t,e)=>{const s=(0,l.useMemo)(()=>t?.uid||c({...t,data:e}),[e,t]),n=(0,l.useMemo)(()=>(0,o.jsx)(x,{...t,uid:s}),[t,s]);return{className:`block-${s} `,StyleComponent:n,uid:s}};function h(t,e){const s=function(n){const r={...e,...m(n)},{className:u,StyleComponent:P}=S(r,n.data);return(0,o.jsxs)(o.Fragment,{children:[P,(0,o.jsx)(t,{...n,className:`${u} ${n.className}`})]})};return s.displayName=t.displayName||t.name||"Component",s}
2
2
  //# sourceMappingURL=Styles.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/shared/Styles.tsx"],
4
- "sourcesContent": ["import React, { useMemo } from 'react'\n\nexport interface StylesProps {\n /** \u81EA\u5B9A\u4E49\u6837\u5F0F\u5B57\u7B26\u4E32 */\n style?: string\n /** \u552F\u4E00\u6807\u8BC6\u7B26 */\n uid?: string\n /** \u662F\u5426\u7981\u7528 */\n disabled?: boolean\n}\n\n/**\n * \u751F\u6210\u552F\u4E00\u6807\u8BC6\u7B26\n */\nconst generateUID = () => {\n return `style_${Math.random().toString(36).substring(2, 9)}_${Date.now().toString(36)}`\n}\n\n/**\n * \u4ECE\u7EC4\u4EF6 props \u4E2D\u63D0\u53D6\u6837\u5F0F\u76F8\u5173\u5C5E\u6027\n */\nexport const getStylesProps = <T extends Record<string, unknown>>(props: T & StylesProps): StylesProps => {\n const { style, uid, disabled } = props\n return { style, uid, disabled }\n}\n\n/**\n * \u6837\u5F0F\u6CE8\u5165\u7EC4\u4EF6\n */\nconst Styles: React.FC<StylesProps> = ({ style, uid = generateUID(), disabled = false }) => {\n if (!style || disabled) {\n return null\n }\n\n return <style suppressHydrationWarning data-style-id={uid}>{`.block-${uid} { ${style} }`}</style>\n}\n\n/**\n * \u6837\u5F0F Hook\uFF0C\u8FD4\u56DE\u6837\u5F0F\u7C7B\u540D\u548C\u6837\u5F0F\u7EC4\u4EF6\n * @param styleProps - \u6837\u5F0F\u5C5E\u6027\n */\nexport const useStyles = (styleProps: Partial<StylesProps>) => {\n const uid = useMemo(() => styleProps?.uid || generateUID(), [styleProps?.uid])\n\n const StyleComponent = useMemo(() => <Styles {...styleProps} uid={uid} />, [styleProps, uid])\n\n return {\n className: `block-${uid} `,\n StyleComponent,\n uid,\n } as const\n}\n\n/**\n * \u6837\u5F0F\u9AD8\u9636\u7EC4\u4EF6\uFF0C \u7528\u4E8E\u7ED9\u7EC4\u4EF6\u7528style \u6807\u7B7E\u7684\u5F62\u5F0F\u8FFD\u52A0\u6837\u5F0F\n * @param WrappedComponent - \u9700\u8981\u5305\u88C5\u7684\u7EC4\u4EF6\n * @param defaultStyleProps - \u9ED8\u8BA4\u6837\u5F0F\u5C5E\u6027\n */\nexport function withStyles<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n defaultStyleProps?: Partial<StylesProps>\n) {\n const WithStyles = function (props: Omit<P, keyof StylesProps> & Partial<StylesProps> & { className?: string }) {\n const finalStyleProps = {\n ...defaultStyleProps,\n ...getStylesProps(props),\n }\n\n const { className, StyleComponent } = useStyles(finalStyleProps)\n\n return (\n <>\n {StyleComponent}\n <WrappedComponent {...(props as P)} className={`${className} ${props.className}`} />\n </>\n )\n }\n\n // \u76F4\u63A5\u4F7F\u7528\u539F\u59CB\u7EC4\u4EF6\u7684\u540D\u79F0\n WithStyles.displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'\n return WithStyles\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,cAAAC,EAAA,eAAAC,IAAA,eAAAC,EAAAL,GAkCS,IAAAM,EAAA,6BAlCTC,EAA+B,iBAc/B,MAAMC,EAAc,IACX,SAAS,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAG,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,SAAS,EAAE,CAAC,GAM1EN,EAAqDO,GAAwC,CACxG,KAAM,CAAE,MAAAC,EAAO,IAAAC,EAAK,SAAAC,CAAS,EAAIH,EACjC,MAAO,CAAE,MAAAC,EAAO,IAAAC,EAAK,SAAAC,CAAS,CAChC,EAKMC,EAAgC,CAAC,CAAE,MAAAH,EAAO,IAAAC,EAAMH,EAAY,EAAG,SAAAI,EAAW,EAAM,IAChF,CAACF,GAASE,EACL,QAGF,OAAC,SAAM,yBAAwB,GAAC,gBAAeD,EAAM,mBAAUA,CAAG,MAAMD,CAAK,KAAK,EAO9EP,EAAaW,GAAqC,CAC7D,MAAMH,KAAM,WAAQ,IAAMG,GAAY,KAAON,EAAY,EAAG,CAACM,GAAY,GAAG,CAAC,EAEvEC,KAAiB,WAAQ,OAAM,OAACF,EAAA,CAAQ,GAAGC,EAAY,IAAKH,EAAK,EAAI,CAACG,EAAYH,CAAG,CAAC,EAE5F,MAAO,CACL,UAAW,SAASA,CAAG,IACvB,eAAAI,EACA,IAAAJ,CACF,CACF,EAOO,SAASP,EACdY,EACAC,EACA,CACA,MAAMC,EAAa,SAAUT,EAAmF,CAC9G,MAAMU,EAAkB,CACtB,GAAGF,EACH,GAAGf,EAAeO,CAAK,CACzB,EAEM,CAAE,UAAAW,EAAW,eAAAL,CAAe,EAAIZ,EAAUgB,CAAe,EAE/D,SACE,oBACG,UAAAJ,KACD,OAACC,EAAA,CAAkB,GAAIP,EAAa,UAAW,GAAGW,CAAS,IAAIX,EAAM,SAAS,GAAI,GACpF,CAEJ,EAGA,OAAAS,EAAW,YAAcF,EAAiB,aAAeA,EAAiB,MAAQ,YAC3EE,CACT",
6
- "names": ["Styles_exports", "__export", "getStylesProps", "useStyles", "withStyles", "__toCommonJS", "import_jsx_runtime", "import_react", "generateUID", "props", "style", "uid", "disabled", "Styles", "styleProps", "StyleComponent", "WrappedComponent", "defaultStyleProps", "WithStyles", "finalStyleProps", "className"]
4
+ "sourcesContent": ["import React, { useMemo } from 'react'\nimport { simpleHash } from './simpleHash.js'\nimport getKeyPropsString from './getKeyPropsString.js'\n\nexport interface StylesProps {\n /** \u81EA\u5B9A\u4E49\u6837\u5F0F\u5B57\u7B26\u4E32 */\n style?: string\n /** \u552F\u4E00\u6807\u8BC6\u7B26 */\n uid?: string\n /** \u662F\u5426\u7981\u7528 */\n disabled?: boolean\n}\n\n/**\n * \u6839\u636E props \u751F\u6210\u786E\u5B9A\u6027 uid\n */\nconst generateUID = (props: Record<string, any>) => {\n const keyString = getKeyPropsString(props)\n return `style_${simpleHash(keyString)}`\n}\n\n/**\n * \u4ECE\u7EC4\u4EF6 props \u4E2D\u63D0\u53D6\u6837\u5F0F\u76F8\u5173\u5C5E\u6027\n */\nexport const getStylesProps = <T extends Record<string, unknown>>(props: T & StylesProps): StylesProps => {\n const { style, uid, disabled } = props\n return { style, uid, disabled }\n}\n\n/**\n * \u6837\u5F0F\u6CE8\u5165\u7EC4\u4EF6\n */\nconst Styles: React.FC<StylesProps> = ({ style, uid = generateUID({}), disabled = false }) => {\n if (!style || disabled) {\n return null\n }\n\n return <style suppressHydrationWarning data-style-id={uid}>{`.block-${uid} { ${style} }`}</style>\n}\n\n/**\n * \u6837\u5F0F Hook\uFF0C\u8FD4\u56DE\u6837\u5F0F\u7C7B\u540D\u548C\u6837\u5F0F\u7EC4\u4EF6\n * @param styleProps - \u6837\u5F0F\u5C5E\u6027\n */\nexport const useStyles = (styleProps: Partial<StylesProps>, data?: Record<string, any>) => {\n const uid = useMemo(() => styleProps?.uid || generateUID({ ...styleProps, data }), [data, styleProps])\n\n const StyleComponent = useMemo(() => <Styles {...styleProps} uid={uid} />, [styleProps, uid])\n\n return {\n className: `block-${uid} `,\n StyleComponent,\n uid,\n } as const\n}\n\n/**\n * \u6837\u5F0F\u9AD8\u9636\u7EC4\u4EF6\uFF0C \u7528\u4E8E\u7ED9\u7EC4\u4EF6\u7528style \u6807\u7B7E\u7684\u5F62\u5F0F\u8FFD\u52A0\u6837\u5F0F\n * @param WrappedComponent - \u9700\u8981\u5305\u88C5\u7684\u7EC4\u4EF6\n * @param defaultStyleProps - \u9ED8\u8BA4\u6837\u5F0F\u5C5E\u6027\n */\nexport function withStyles<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n defaultStyleProps?: Partial<StylesProps>\n) {\n const WithStyles = function (\n props: Omit<P, keyof StylesProps> & Partial<StylesProps> & { className?: string; data?: Record<string, any> }\n ) {\n const finalStyleProps = {\n ...defaultStyleProps,\n ...getStylesProps(props),\n }\n\n const { className, StyleComponent } = useStyles(finalStyleProps, props.data)\n\n return (\n <>\n {StyleComponent}\n <WrappedComponent {...(props as P)} className={`${className} ${props.className}`} />\n </>\n )\n }\n\n // \u76F4\u63A5\u4F7F\u7528\u539F\u59CB\u7EC4\u4EF6\u7684\u540D\u79F0\n WithStyles.displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'\n return With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C,EAAA,CAAkB,GAAIV,EAAa,UAAW,GAAGc,CAAS,IAAId,EAAM,SAAS,GAAI,GACpF,CAEJ,EAGA,OAAAY,EAAW,YAAcF,EAAiB,aAAeA,EAAiB,MAAQ,YAC3EE,CACT",
6
+ "names": ["Styles_exports", "__export", "getStylesProps", "useStyles", "withStyles", "__toCommonJS", "import_jsx_runtime", "import_react", "import_simpleHash", "import_getKeyPropsString", "generateUID", "props", "keyString", "getKeyPropsString", "style", "uid", "disabled", "Styles", "styleProps", "data", "StyleComponent", "WrappedComponent", "defaultStyleProps", "WithStyles", "finalStyleProps", "className"]
7
7
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 选取关键 props 生成 key 字符串
3
+ */
4
+ export default function getKeyPropsString(props: Record<string, any>): string;
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(t,n)=>{for(var e in n)a(t,e,{get:n[e],enumerable:!0})},g=(t,n,e,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of c(n))!d.call(t,r)&&r!==e&&a(t,r,{get:()=>n[r],enumerable:!(i=u(n,r))||i.enumerable});return t};var s=t=>g(a({},"__esModule",{value:!0}),t);var l={};f(l,{default:()=>y});module.exports=s(l);function y(t){return["style","className","id","name","type","data"].map(e=>{if(e==="data"&&typeof t[e]=="object"&&t[e]!==null)try{return JSON.stringify(t[e])}catch{return""}return t[e]!==void 0?String(t[e]):""}).join("|")}
2
+ //# sourceMappingURL=getKeyPropsString.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/shared/getKeyPropsString.ts"],
4
+ "sourcesContent": ["/**\n * \u9009\u53D6\u5173\u952E props \u751F\u6210 key \u5B57\u7B26\u4E32\n */\nexport default function getKeyPropsString(props: Record<string, any>): string {\n const keys = ['style', 'className', 'id', 'name', 'type', 'data']\n return keys\n .map(k => {\n if (k === 'data' && typeof props[k] === 'object' && props[k] !== null) {\n try {\n return JSON.stringify(props[k])\n } catch {\n return ''\n }\n }\n return props[k] !== undefined ? String(props[k]) : ''\n })\n .join('|')\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAGe,SAARE,EAAmCE,EAAoC,CAE5E,MADa,CAAC,QAAS,YAAa,KAAM,OAAQ,OAAQ,MAAM,EAE7D,IAAIC,GAAK,CACR,GAAIA,IAAM,QAAU,OAAOD,EAAMC,CAAC,GAAM,UAAYD,EAAMC,CAAC,IAAM,KAC/D,GAAI,CACF,OAAO,KAAK,UAAUD,EAAMC,CAAC,CAAC,CAChC,MAAQ,CACN,MAAO,EACT,CAEF,OAAOD,EAAMC,CAAC,IAAM,OAAY,OAAOD,EAAMC,CAAC,CAAC,EAAI,EACrD,CAAC,EACA,KAAK,GAAG,CACb",
6
+ "names": ["getKeyPropsString_exports", "__export", "getKeyPropsString", "__toCommonJS", "props", "k"]
7
+ }
@@ -0,0 +1 @@
1
+ export declare function simpleHash(str: string): string;
@@ -0,0 +1,2 @@
1
+ "use strict";var h=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of o(t))!s.call(e,r)&&r!==n&&h(e,r,{get:()=>t[r],enumerable:!(i=a(t,r))||i.enumerable});return e};var c=e=>l(h({},"__esModule",{value:!0}),e);var p={};g(p,{simpleHash:()=>f});module.exports=c(p);function f(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return Math.abs(t).toString(36)}
2
+ //# sourceMappingURL=simpleHash.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/shared/simpleHash.ts"],
4
+ "sourcesContent": ["export function simpleHash(str: string): string {\n let hash = 5381\n for (let i = 0; i < str.length; i++) {\n hash = (hash << 5) + hash + str.charCodeAt(i)\n }\n return Math.abs(hash).toString(36)\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAAO,SAASE,EAAWE,EAAqB,CAC9C,IAAIC,EAAO,KACX,QAASC,EAAI,EAAGA,EAAIF,EAAI,OAAQE,IAC9BD,GAAQA,GAAQ,GAAKA,EAAOD,EAAI,WAAWE,CAAC,EAE9C,OAAO,KAAK,IAAID,CAAI,EAAE,SAAS,EAAE,CACnC",
6
+ "names": ["simpleHash_exports", "__export", "simpleHash", "__toCommonJS", "str", "hash", "i"]
7
+ }
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  component: {
6
6
  (props: Omit<import("../biz-components/HeroBanner/types.js").HeroBannerProps & import("react").RefAttributes<HTMLDivElement>, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps> & {
7
7
  className?: string;
8
+ data?: Record<string, any>;
8
9
  }): import("react/jsx-runtime").JSX.Element;
9
10
  displayName: string;
10
11
  };
@@ -4,6 +4,7 @@ declare const meta: {
4
4
  component: {
5
5
  (props: Omit<import("../biz-components/BrandEquity/BrandEquity.js").BrandEquityProps, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps> & {
6
6
  className?: string;
7
+ data?: Record<string, any>;
7
8
  }): import("react/jsx-runtime").JSX.Element;
8
9
  displayName: string;
9
10
  };
@@ -4,6 +4,7 @@ declare const meta: {
4
4
  component: {
5
5
  (props: Omit<import("../biz-components/Category/index.js").CategoryProps, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps> & {
6
6
  className?: string;
7
+ data?: Record<string, any>;
7
8
  }): import("react/jsx-runtime").JSX.Element;
8
9
  displayName: string;
9
10
  };
@@ -4,6 +4,7 @@ declare const meta: {
4
4
  component: {
5
5
  (props: Omit<import("../biz-components/Evaluate/index.js").EvaluateProps, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps> & {
6
6
  className?: string;
7
+ data?: Record<string, any>;
7
8
  }): import("react/jsx-runtime").JSX.Element;
8
9
  displayName: string;
9
10
  };
@@ -4,6 +4,7 @@ declare const meta: {
4
4
  component: {
5
5
  (props: Omit<import("../biz-components/Graphic/index.js").GraphicProps & import("react").RefAttributes<HTMLDivElement>, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps> & {
6
6
  className?: string;
7
+ data?: Record<string, any>;
7
8
  }): import("react/jsx-runtime").JSX.Element;
8
9
  displayName: string;
9
10
  };
@@ -40,7 +41,7 @@ declare const meta: {
40
41
  title: string;
41
42
  textColor?: string;
42
43
  }[];
43
- };
44
+ } & Record<string, any>;
44
45
  shape?: "round" | "square" | undefined;
45
46
  event?: any;
46
47
  condition?: any;